Shadow mapping

Shadow mapping explained: GPU-based shadow rendering technique using depth textures to determine lit and shadowed areas with dynamic shadows support.
 

What is Shadow Mapping?

Shadow mapping is a shadow rendering technique that uses depth textures to determine which areas are in shadow.

How It Works

The algorithm consists of four key steps:

  1. Depth texture generation: Render the scene from the light source perspective, storing only depth values
  2. Distance calculation: Calculate the distance from each pixel to the light source
  3. Depth comparison: Compare the pixel distance with the corresponding depth texture value
  4. Shadow determination: If the depth value is smaller than the pixel distance, the pixel is in shadow; otherwise, it's lit

Advantages

Disadvantages

Typical Parameters

Performance Considerations