API

Interface CsmStaticCacheOptions

Options for enableCsmStaticCache.

interface CsmStaticCacheOptions {
    cascadeCoveragePadding?: number;
    refitAngle: number;
    refitMaxIntervalMs?: number;
    staticCascadesPerFrame?: number;
}
Index
cascadeCoveragePadding?: number

Opt-in camera-coverage refit, for stabilized cascades only. Each cascade's bounding sphere is widened by this fraction (0.2 = 20 % wider, so 1/1.2 of the texel density), and a camera move no longer refits every cascade: a cascade is refit and re-rendered, alone and in that same frame, only when the camera's current slice leaves the area its published map covers (outside the unit disc of its shadow clip space, or outside its light-depth range). A change of field of view, near/far plane or aspect still refits every cascade. 0 or omitted keeps the historical behaviour: every camera change refits and re-renders all cascades. A positive value must be at least 2 / mapSize: texel snapping shifts a fit by up to sqrt(2) / mapSize of its radius, and a smaller padding would leave a FRESH fit failing its own coverage test (refit every frame).

refitAngle: number

Accumulated sun-rotation angle (radians) since the last cascade refit that forces the next one.

refitMaxIntervalMs?: number

Force a refit after this much wall time, including while the light is paused. Default 0 (no interval floor).

staticCascadesPerFrame?: number

Spread a drift-only refit's static re-render over frames: at most this many cascades are re-rendered per frame, round-robin, so the periodic refresh costs a slice of every frame instead of one long frame. Refits caused by the camera, the content or the caster membership still re-render every cascade in their own frame. 0 or omitted keeps the single-frame re-render.