Texture and Shadow Mapping
Rendering Shadows In several passes: first draw the ambient component only, then by drawing the front faces and back faces of the shadow volumes (with depth test enabled), update the counter (stencil buffer) to determine pixels which are in between front and back faces of the shadow volume. (They are in shadow). Last pass to draw diffuse and specular components only for pixels that are not in shadow (use stencil test to identify these pixels by using the stencil buffer created in the second step)