Skip to main content

Module spot_shadow

Module spot_shadow 

Source
Expand description

Slice assignment and light-space projections for the spot shadow map array.

Local lights are static, so both the slice each shadowed spot owns and the matrix it renders with are decided once per scene and never recomputed. Only the depth contents need refreshing, and only when a caster moves – that schedule is SpotShadowScheduler below, which mirrors the prime-then- round-robin policy the CSM cascades use.

A spot’s projection is a perspective frustum whose vertical FOV is the full cone angle (2x the outer half-angle), so the cone inscribes the shadow slice’s square footprint. Right-handed with [0, 1] depth, matching csm.rs, so the same matrices are valid on all three backends.

Structs§

SpotShadowScheduler
Prime-then-round-robin refresh schedule over the assigned slices, mirroring ShadowCascadeScheduler. Every slice renders once before it can be sampled; after that Hybrid refreshes one slice per frame so N shadowed spots cost one extra depth render per frame rather than N.