Wednesday, February 12, 2014

Intro

the previous simpler diffuse doesn't have a light loop to automatically go through all the lights in the scene and apply it to the shader. This simple diffuse shader will use a light array type to gather the lights in the scene and apply it tothe shader.

Notes

the light array type comes with the use i_ and n_ prefix in the struct portion of the C source. i_ gives the index to the first light, and n_ gives the number of lights. The miTag string is the same as a light type except its in array form now, light[1], note, not light[0], because 0 is the base address of the array(i think).

Notes

the function mi_sample_light returns light_color, direction, and the dot_nl.
Inside maya, the shader node has a text box that can create a light, or type in the light name. It only accepts a single light, thus, simpler diffuse shader. Regardless, its the first light based shader.