« Saturated Hues and RGB Color Space in Maya | Main | Maya Ramp Shader »

May 24, 2006

Sophisticated Control over Hue In Maya Shading

It's hard to light highly saturated colored objects in a sophisticated manner, even when (and one might say especially when) using saturated light.

Suppose I have a bright red flag. Further suppose I wish its shaded areas to fall into a rich dark purple.

Easier said than done.

render1_2.jpg

My first attempt might entail filling the dark areas of my waving red flag with a saturated purple light. As you can see from the images above, saturated purple light has no effect on a saturated red object because saturated red (1 0 0) times dark purple (.5 0 .5) only equals dark red (.5 0 0)

What I need to do is use the lighting of the flag as a matte into another texture map - a purple one.

twoFlags.jpg

First a create a second texture map in a deep rich purple.

shaderNetwork_v1.jpg

Next I use surface luminance to control a blend between the red and purple flag textures.

render3.jpg

It's not a bad idea. The only problem is Maya continues to LIGHT the flag. See how dark the shaded area still is? I don't want that effect.

shaderNetwork_v2.jpg

I compensate for the lighting by DIVIDING the object's color by its own luminance. This effectively turns the Lambert lighting into a surface shader.

render4.jpg

Ah, that's more like it! See how nice and purple the shaded region is? It's not just a darker version of the red flag; it's a whole other hue. Very painterly. Not at all CG-ish.

UPDATE 5/29/2006

If this line of thinking interests you, be sure to explore Maya's Ramp Shader, which addresses the issue of hue falloff in CG lighting.

Posted by digital artform at May 24, 2006 09:56 PM

Comments

For you who is often taking screen shots for your tips articles, I'd like to advice you to use SLIBER. I press ALT+F2 and a screenshot that I crop is saved. Wonder full tool : http://www.sliber.com/

Posted by: Nicolas d'Haussy at May 26, 2006 09:46 AM

I'll check it out; thanks!

Posted by: Joseph Francis at May 26, 2006 09:55 AM

Joseph,

I found this article from the APA forums...I am a board member of the LA chapter.

After reading this article regarding the "Flag", I was a bit confused as to why all the trouble...could have just cut and pasted into another layer the shady part or just larger then that and used Selective color to change the black to the color needed. Then add a black mask and just paint in the areas of the flag...and perhaps throw a "Curve" afterward. Now your article may be over-my-head in experience, but I'm not sure. You caught my eye with the APA response regarding the 645...I use to know all that stuff.
Anyhow, let me know if I am on the right track.
Thanks,
Ken

Posted by: Ken PIvak at May 26, 2006 06:27 PM

excelent, thanks for the tutorial!!!

Posted by: zamolxes at May 26, 2006 11:28 PM

Hi, thanks for writing, Ken,

You could do what you're describing if you were working on a single image in Photoshop. What I'm describing is for motion graphics where the lighting effect is coming from synthetic 3D lights, and there may be many other flags of different colors, and the whole thing has to work in motion. In that case, it's easier to do this stuff as part of the recipe that generates the animation frames, rather than as a post-process during compositing.

Posted by: Joseph Francis at May 27, 2006 12:25 AM

Zamolxes, thanks for writing. I checked out your own blog, at http://mustec.bgsu.edu/~virgil/ -- very good.

I want to spend some time there, reading more in detail.

Posted by: Joseph Francis at May 27, 2006 12:33 AM

you could of also used a ramp with a surface shader, NO?

Posted by: david ying at May 30, 2006 09:03 AM

Yes. See my update of 5/29/2006 - the last line of the blog entry.

Posted by: Joseph Francis at May 30, 2006 11:31 AM

Post a comment




Remember Me?

(you may use HTML tags for style)