|
DOT3 per-pixel lighting demo.
It uses a Normal map and a Light map, both coded as independent textures.
Each pixel color is a vector coded, where color range [0,255] is mapped
as vector in range [-1.0,+1.0].
A math operation called DOT3 applied to Light vector and Normal vector results
a scalar value, interpreted as light intensity. This operation is made for each
pixel on texture.
Light Intensity = DOT3(light, normal);
This technique allows complex lighting effects, as bumps, on low polygon count
geometries.
|