Textures can also be used to generate shadows. First, the scene is rendered from the
point of view of each light source, but only the depth-buffer values are retained.
In this example the closer points are lighter and more distant parts are darker
(with the exception of the most distant value which is shown as white for contrast).
As each pixel is shaded (once more shadow mapping assumes that the illumination
model is applied at each pixel) a vector from the visible point to the light source is
computed (Remember it is needed to compute, N . L). As part of normalizing it
we compute its length. If we find the projection of the 3D point that we are shading onto each lights shadow
buffer we can compare this length with the value stored in the shadow buffer. If the shadow-buffer is less than
the current point's length then the point is in shadow and the corresponding light source can be ignored for
that point.