ShadowAtlas Type
Manages a texture atlas for multiple shadow maps. Supports directional, point (cubemap), and spot light shadows.
Constructors
| Constructor |
Description
|
Full Usage:
ShadowAtlas(config, biasConfig)
Parameters:
ShadowAtlasConfig
biasConfig : ShadowBiasConfig
Returns: ShadowAtlas
|
|
Instance members
| Instance member |
Description
|
Full Usage:
this.ActiveCasterCount
Returns: int
|
Get the number of active caster regions (computed by PrepareUniforms).
|
Full Usage:
this.AddCaster
Parameters:
ShadowCasterType
lightPosition : Vector3
lightDirection : Vector3
lightTarget : Vector3
enabled : bool
biasOverride : float32 voption
Returns: int<MeasureProduct<ShadowCasterId, MeasureOne>> voption
|
Register a new shadow caster and allocate atlas regions. Returns the caster ID, or ValueNone if the atlas is full.
|
Full Usage:
this.Biases
Returns: float32 array
|
|
Full Usage:
this.CasterTypes
Returns: int array
|
|
Full Usage:
this.Casters
Returns: ValueCollection<int<MeasureProduct<ShadowCasterId, MeasureOne>>, ShadowCasterData>
|
Get all active casters (for iteration).
|
Full Usage:
this.Clear
|
Clear all casters and reset slot allocator. Call at start of each frame. |
Full Usage:
this.ClearRegion
Parameters:
int
|
Clear a specific region in the atlas.
|
Full Usage:
this.Count
Returns: int
|
Number of currently allocated casters.
|
|
The depth-only FBO for the atlas.
|
|
Get bias for a caster type, respecting per-caster override.
|
Full Usage:
this.GetRegionScissor
Parameters:
int
|
Get scissor rectangle for a region index.
|
Full Usage:
this.GetRegionViewport
Parameters:
int
|
Get viewport rectangle for a region index.
|
|
|
Full Usage:
this.GridSize
Returns: int
|
Grid size (rows/columns) of the atlas.
|
Full Usage:
this.Initialize
|
Creates the atlas FBO and depth texture. Must be called during pipeline initialization. |
|
|
Full Usage:
this.PrepareUniforms
|
Prepare uniform arrays for upload to shader. Call this each frame before rendering. |
Full Usage:
this.RegionSize
Returns: int
|
Size of each region in pixels.
|
|
Remove a shadow caster and free its atlas regions.
|
Full Usage:
this.RenderDebugOverlay
Parameters:
int
screenHeight : int
|
Render the debug overlay showing atlas regions.
|
Full Usage:
this.SetCasterViewProj
Parameters:
int<MeasureProduct<ShadowCasterId, MeasureOne>>
vp : Matrix4x4
|
Set the view-projection matrix for a single-region caster.
|
|
Set the view-projection matrix for a specific atlas region.
|
Full Usage:
this.Shutdown
|
Destroys the atlas FBO and releases resources. Must be called during pipeline shutdown. |
|
|
Full Usage:
this.UpdateCaster
Parameters:
int<MeasureProduct<ShadowCasterId, MeasureOne>>
?lightPosition : Vector3
?lightDirection : Vector3
?lightTarget : Vector3
?enabled : bool
?biasOverride : float32 voption
|
Update a shadow caster's properties.
|
|
Get prepared uniform arrays (call after PrepareUniforms).
|
Mibo.Raylib