Class: ShadowFrameLedger
The shared per-frame shadow budget, charged in face units (one 256² local face = 1; the CSM near cascade ≈ 4; a far cascade ≈ 6 — calibration lives in LocalLightsOptions). Both shadow consumers — the CSM cascades and the local light atlas — draw depth from the same GPU in the same frame, so they share one explicit budget instead of discovering each other through dropped frames.
Grant order per frame, matching the RFC:
- CSM near cascade — priority 1, never denied. Gameplay-critical, and denying it would change CSM behavior in zero-light worlds (invariant 6). Overdraft is recorded, not prevented.
- Dynamic local faces — a held light follows the player; staleness is visible immediately. The local scheduler reserves these units before CSM renders so a far cascade cannot eat them first.
- CSM far cascades — already deferred one-per-frame today; the ledger
formalizes it. To keep CSM byte-identical when no local lights are
active, denial only applies while locals are actually consuming
(reservation or spend); and to prevent starvation under a permanently
reserving held light, a far cascade denied
maxFarDeferralsframes in a row is force-granted on the next. - Invalidated static local faces, FIFO — drain over frames; a TNT blast re-renders torch shadows over several frames, not one.
Constructors
constructor
• new ShadowFrameLedger(maxFarDeferrals?): ShadowFrameLedger
Parameters
| Name | Type | Default value |
|---|---|---|
maxFarDeferrals | number | 2 |