Shadow Mapping

Shadow Mapping 1   Shadow Mapping 2

Description:

This program displays a simple scene, lit by a single light. The scene is first rendered from the light's point of view, and the depth values are loaded into a texture. This texture is then projected onto the scene as drawn from the eye's point of view, and a comparison with distance from the light is made. This determines shadowed regions.

This demo implements 8-bit "Dual Texture" shadow mapping and a 16-bit version using register combiners. 24-bit hardware shadow mapping is also demonstrated.

Requirements:

ARB_multitexture
EXT_texture_env_combine

Required for 16-bit shadow mapping:

NV_register_combiners

Required for hardware shadow mapping:

SGIX_depth_texture
SGIX_shadow
EXT_blend_minmax

References:

Shadow Mapping with Today's OpenGL Hardware, by Mark Kilgard. developer.nvidia.com

Projective Texture Mapping, by Cass Everitt. developer.nvidia.com

Hardware Shadow Mapping, by Cass Everitt. developer.nvidia.com

"Shadowcast" demo. developer.nvidia.com

Download:

shadowmap.zip (125 KB)