Avoiding Ugly Color Falloff in 3D

| 2 Comments | No TrackBacks

ugly3D.jpg
A standard shader has a boring color falloff. Most painters, when rendering a surface which turns away from light, will identify (or invent) a reason to introduce a shift in the hue of a surface as it darkens. One way you can do this in 3D is to map a color ramp to light falloff.

cyanLambert.jpg
A standard shader, in this case a cyan-colored Lambert shader, is usually implemented inside the renderer as a multiplication of a base color and a grayscale Lambert falloff.

cyanLambert2.jpg
When color falls off in this way, it can go through muddy, dull midtones.

rampLambert.jpg
If you remap the falloff with a ramp, you can give it a richer look. For details on one way to do this, read on...

shader1.jpg
Start with a Surface Shader node.

shader2.jpg
Add a ramp. They default to V-ramps. Connect the output of the V-0ramp to the Out Color of the Surface Shader.

shader3.jpg

Add a Lambert to the V-Ramp. (Did you know you can do that?)

Lambert2Ramp.jpg
The Lambert falls off through shades of gray. That means the red, green, and blue channels of the output color of the Lambert are identical. Since they are identical, choose any channel you like (I chose the green channel in this case) and connect it to the V input of the UV coordinate input of the ramp.

(I chose the V input because the ramp defaults to a V-ramp. If I had changed it to a U-ramp, I would have used the U input.)

defaultRamp.jpg
Here's a default ramp.

defaultRamp2.jpg
Here's a render of the objects using the default ramp.

newRamp.jpg
Adjust a pleasing falloff into the ramp...

rampLambert.jpg
...and you'll achieve a pleasing falloff in the lighting of the rendered objects.

This kind of hue falloff is common in Renderman shaders. I don't see it done a lot in Maya shaders.

If you are uncomfortable using a Surface Shader as your final base shader, you can use other shaders that are more to your liking. I haven't done a lot of work chaining one shader into another as I did above; perhaps you have. If not, you might have fun experimenting along those lines.

Here's a related link:
Avoiding Ugly Grads in 2D

UPDATE 8/25/2005
Here's a much better way of doing the same thing:

Instead of using surface shaders, it creates Hue Falloff Directly in the Maya Light where one could argue it really belongs.

UPDATE 7/30/2009

Mark Sweeney has some interesting discussion on the matter

No TrackBacks

TrackBack URL: http://www.digitalartform.com/cgi-bin/mt/mt-tb.cgi/21

2 Comments

This is one of those things which I'm reluctant to say how long I've struggled with. And to think I've been using samplerInfo node enough to have found this on my own - and didn't. Thank you for posting this very handy bit of information.

I have a much improved version here now:

http://www.digitalartform.com/archives/2005/08/hue_falloff_in.html

Instead of building the color falloff into the surface shader, I build it into the light, where it really belongs.

Leave a comment

About this Entry

This page contains a single entry by published on October 25, 2004 10:58 PM.

Anatomy Practice: The Scapula was the previous entry in this blog.

Anatomy Practice: The Pelvis is the next entry in this blog.

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