Shadow Mapping Demo

This demo features depth-based shadow mapping and soft shadows.

A shadow map is generated by rendering the scene from the light’s perspective.  This shadow map is then used during a second pass rendering of the scene from the camera’s perspective to generate shadows.

The pixel shader calculates the pixel’s position in light space and tests this position against the shadow map to determine if the pixel is in a shadow or not.  Soft shadows are achieved by sampling in a small radius around the pixel and averaging out the shadow attenuation values for the final color of the pixel.

This entry was posted in Demos, Projects. Bookmark the permalink.

Comments are closed.