Shadow map

Then we code in the shade

A shadow map is calculated for a light and is used to check what other positions in the world are in shadow from that light. It's a made in two steps.

Create the shadow map

The shadow map is a depth map from the view of the light source. In it all the objects that will cast shadows need to be rendered. For a directional light it can be a orthographic projection, for others a perspective one. On depth information so simple shaders that only write depth can be used. The shadow map need to be update each time the light or any of the shadow casting objects move.

Use the shadow map

Calculate the light transform

When rendering a position in the scene transform that position into the space of the shadow map.

Sample shadow map

Used that light space position to check in the shadow map if the current position is in shadow from the shadow map.

Draw

If the position in the scene is in shadow ignore the light else include it's values when calculating the light value.

Reference

Cascading Shadow Maps - 2020

Shadows Everywhere - 2020

Common Techniques to Improve Shadow Depth Maps - 2018


Advanced Real-time Shadowing - 2016

Sparse Shadow Trees - 2016

More Efficient Virtual Shadow Maps for Many Lights -2015

Dealing with Shadow Map Artifacts - 2015

Shadow mapping basics - 2015

Shadow Maps Don’t (Always) Need Mips - 2014

Efficient Virtual Shadow Maps for Many Lights - 2014

Shadow Mapping - 2014

Moment Shadow Mapping - 2013

Deferred Rendering Shadow Mapping - 2013

A Sampling of Shadow Techniques - 2013

Shadow Mapping - 2012

CSM Scrolling, an Acceleration Technique for the Rendering of Cascaded Shadow Maps - 2012

The Dark Art of Shadow Mapping - 2010

Sample Distribution Shadow Maps - 2010

Shadow Map Allocation - 2011

Adaptive Volumetric Shadow Maps - 2010

Graphics Tech: Shadow Maps (part 2): Save 25% texture memory, and possibly much more. - 2010

Graphics Tech: Shadow Maps (part 1) - 2010

Tech feature: Sunlight with Shadows - 2010

Shadows in Ratchet & Clank Future: Tools of Destruction - 2007

Robust unit cube clipping for shadow mapping - 2007

Gpu Gems : Chapter 11. Shadow Map Antialiasing - 2004

Chapter 12. Omnidirectional Shadow Mapping - 2004

Tutorial 14: Shadow Mapping

Multipass Shadow Mapping With Point Lights

Cascaded Shadow Mapping

Contact-hardening Soft Shadows Made Fast

Directional Shadows Cascaded Maps

Cascaded Shadow Maps with Soft Shadows

Sample Distribution Shadow Maps

Cascaded Shadow Maps with Soft Shadows