The diffuse shading factor is the dot product between the normal and the light vector. The Visibility Factor output socket is the falloff attenuation, it’s always 1 for sun/hemi lamps, for point and spot lamps is the falloff already calculated, no need for additional calculations to get 1/D^2.
To get the full diffuse term, you multiply the dot product of normal and light vector with the visibility factor, then with the light color, then the diffuse color (or albedo), and then the shadows. The result can be directly connected to the output node.
The normal has to be from the Geometry node or the Normal output form a material node if you have a normal map in the texture slots. At the end you can multiply the baked AO with the diffuse shading.
wow, nice. 8 lamp data nodes.
But after bringing Suzanne to 500K vertex, the node material solution gives less framerate than using real lights … I guess it’s due to the shadow/normals part
Maybe someone can double check…
But very well done that node setup