DETAILS:
The NormalLight3D node takes in a normal map and a z-depth channel
and will return 3D lighting information. It uses an accurate vector
dot product lighting method and will return diffuse and Specular
highlights. Extra goodies include falloff, specular highlights, color
channel input for compositing, colored lighting and specular highlights
and a 3D light with quality settings.
How it works:
First Shake creates an image the size of your normal map that
stores vectors from the pixel on the image plane to the light that
vector. It uses X and Y pixel coordinates to calculate X and Y axes
and the Z channel to calculate the Z axis of the image's pixel. We
then do a dot product of this vector map with the normal map to get
diffuse light information. To get specular information I run the
normal map through a colorX node that rotates all the vectors so
they're pointing at what would be reflected by the ray from camera to
surface... so if the vector is pointing 90 degrees from the camera
along the X axis (or <<1,0,0>> normal vector) the color X
node will rotate the vector another 90 degrees so it's pointing 180
degrees from the camera (or <<0,1,0>>) if it's 45 degrees
in the X it'll rotate it another 45 degrees to make it 90. We then do
a dot product with this adjusted normal map with the plane to light
vector map. To adjust the specular rolloff (AKA glossiness) we run the
result of this through a gamma node and then a multiply node to control
the specular intensity and color.
.
|