« Dripping Blood Maya Mel Script | Main | Canon 5D vs Nikon D200 »
November 11, 2005
Real Time Lighting in Shake

I like techniques that push from Maya into Shake some tasks traditionally considered the purvue of a renderer (such as UV mapping) so when I saw Derrick Dressel's NormalLight3D on the highend3d.com forum, I wanted to play around a bit with the general idea of using Shake to light an image of normals.

I didn't develop the idea very far, or write a macro, but I put together a simple Shake node tree that implements the mathematical function, the dot product.
First I used Maya to model a weird shape.
Next I used the Mental Ray renderer to output an image of normals.
By calculating the dot product of the normal image with an image representing the direction of incident light, I produce an image of that shape as if textured with a Lambert shader and lit with a directional light.

By varying the image, I vary the direction of the incoming light.


Posted by digital artform at November 11, 2005 05:53 PM
Comments
How do I read in Maya MR normal files into something like AfterEffects if I don't use Shake?
Posted by: Chris at November 13, 2005 04:19 PM
Iwe been interested in the subject to but I never managed to replicate back lighting in Fusion. Network is the same but I just cant get it to do Backlighting. Or edge Lighting. Im using Normal render from Camera space Maya - MentalRay.
Posted by: Kristijan at November 17, 2005 06:31 AM
Hmm Now I did diferent and it kind of work. I multiply my Normal pass with some primary color and on my normal pass just befor mult node I add CC node and play with saturation and hue. With saturatio+++up to 10 units I get sharpnes and with hue direction. But I cant get light to come from say floor.
Posted by: Kristijan at November 17, 2005 06:52 AM
Kristijan:
The problem is one of how to handle negative numbers in the colors. I was going to play with it further to try and get the negative numbers to work correctly internally. I'm pretty sure it can be done, but you might have to figure out how to "fool" Shake into that workflow.
Chris:
I'm not sure how to handle those files in AE.
Posted by: Joseph Francis at November 17, 2005 07:21 AM
Hey, Joseph! I love your site, man. I found your camera projection article to be most helpfull last summer.
Chris:
One way of getting those negative numbers in the 8 or 16 bit image is to simply use a set range node in Maya to squeeze -1 to 1 range into 0-1. Then after converting the image to float, use the Compress or Expand node to reverse this in Shake. I'm sure the the same idea could be utilized in Fusion. Then to get back lighting make Blue -1 and use red and green to control x/y positioning. You might also want to normalize your light vector color. To do this make a ColorX node and divide each channel by the sum of the absolute values of all channels. r = r / (fabs(r) + fabs(g) + fabs(b))
Kristijan:
Try to think of the light direction as a vector describing where the light is comming from. Total Blue is from the camera, -1 Blue behind the object, red is right, negative red is left and green is ffrom top, -1 green from bottom. To get a light coming from the floor you'd want to have green set to -1. Bottom right would be 1 red -1 green and 0 blue. You'll probably want to normalize your light vector. Read my reply to Chris.
I hate to shamelessly promote my macro, but the download includes the Shake script I used to make the macro with comments about how it works. Plus the readme includes tips on getting normals and such from Maya. I'd highly recommend looking through it.
-Derick
Posted by: Derick at March 22, 2006 10:44 AM
I don't know why you perform an iMult
because you also could reorder it to rnn, gnn,bnn
that should be faster but with the same result
Posted by: Rhino at May 13, 2006 07:21 AM