Hue Falloff in Maya Lights

| 2 Comments

hueFalloffDemo.jpg
The typical CG light only loses luminosity as it rolls off from direct to oblique illumination. That can look dull.

Here's a technique for introducing angle-based hue falloff into the light for a richer look.

hueFalloffNetwork.jpg
The basic idea is to calculate the "facing ratio" not of the camera's view of an object, but of the light's view of the object, and to map that light facing ratio through a ramp and back into the light's color attribute.

Here's a brief overview:

1) Get the world position of the point being shaded by using the samplerInfoNode.

2) Get the world position of the light using the lightInfo node.

3) Subtract (1) from (2) to get a vector from the surface point to the light.

4) Get the surface normal in camera space using the samplerInfo node.

5) Convert the surface normal to world space using a vectorProduct node set appropriately.

6) Take the dot product of (3) and (5) using another vectorProduct node set to "dot product" -- this is the light facing ratio.

7) Clamp the light facing ratio (6) to between 0 and 1.

8) Run the facing ratio intoi the V-coordinate of a V-ramp set to colors of your choice.

9) Loop the output of the ramp back into the light color.

You now have angle-based hue falloff built into the light.

To explore this in detail, download the maya scene file:
hueFalloffLight.ma

normalRamp.jpg

normalObjects.jpg

specialRamp.jpg

specialObjects.jpg

You can use any surface shaders you wish to use on the objects. All the color falloff action is in the light

2 Comments

Realy smooth solution. Great work!

Leave a comment

About this Entry

This page contains a single entry by published on August 25, 2005 10:53 PM.

Alias SketchBook Pro 2.0 was the previous entry in this blog.

Proportional Dividers is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.