Metal Tutorial 4 β Shadows
Shadows are what make objects feel grounded in a scene. This tutorial implements shadow mapping: a depth-only first pass from the lightβs perspective builds the shadow map, and the deferred lighting pass compares each fragmentβs light-space depth against it to decide lit vs. shadowed.

What youβll learn:
- Rendering a depth-only pass into an
MTLTextureshadow map - Transforming fragments to light space for depth comparison
- Shadow bias to avoid self-shadowing artifacts
- Percentage-closer filtering (PCF) for soft shadow edges