Spot light parameters uploaded as one element of the spot-light storage buffer.
innerAngle/outerAngle describe the cosine-falloff cone; the
view-projection matrix (lightViewProj) and a slice of the shared 2D shadow
array are consumed when castShadows is true.
The view-projection matrix is lazily computed from position, direction,
outerAngle, and range via computeLightViewProj. A dirty flag
avoids redundant recomputation: after mutating those fields in-place, call
markDirty before the next access.
The perspective view-projection derived from the light's position,
direction, outerAngle, and range. Lazily recomputed on first access
after construction or after markDirty is called.
Returns the cached view-projection matrix, recomputing it lazily only
when marked dirty. Safe to call every frame — the matrix is recalculated
at most once between markDirty calls.
Parameters
near: number = 0.1
Near plane for the perspective frustum (default 0.1).
Spot light parameters uploaded as one element of the spot-light storage buffer.
innerAngle/outerAngledescribe the cosine-falloff cone; the view-projection matrix (lightViewProj) and a slice of the shared 2D shadow array are consumed whencastShadowsis true.The view-projection matrix is lazily computed from
position,direction,outerAngle, andrangevia computeLightViewProj. A dirty flag avoids redundant recomputation: after mutating those fields in-place, call markDirty before the next access.