Logo Mibo

ShadowAtlasConfig Type

Configuration for the shadow atlas system.

This configuration controls both the atlas texture layout and shadow rendering behavior. Some fields (marked as "ForwardPbr-specific") are only used by the ForwardPbrPipeline implementation. Other pipelines may ignore these fields or use different strategies.

Record fields

Record Field Description

DirectionalAtlasRatio

Full Usage: DirectionalAtlasRatio

Field type: float32

Fraction of the atlas the single directional caster occupies. Default: 0.5.

The directional light is registered first (slot 0) and there is exactly one of it. With a non-zero ratio it gets a dedicated top region of the atlas sized (Resolution × Resolution × ratio) — e.g. 0.5 of an 8192² atlas is 8192×4096 (~4K), instead of the 1/MaxCasters tile the uniform grid would give it. This makes directional shadows high-resolution by default without the user tuning MaxCasters to their scene's light count.

Point/spot casters subdivide the remaining bottom strip (Resolution × (1-ratio)) into a square grid based on their active count. 1.0 gives the directional light the whole atlas (directional-only scenes). 0.0 restores the legacy uniform grid (all casters share 1/MaxCasters tiles — backward compatible).

Field type: float32

DirectionalLightDistance

Full Usage: DirectionalLightDistance

Field type: float32 voption

Distance to place directional light camera behind the shadow origin. Default: auto-derived.

ForwardPbr-specific: Larger values capture more of the scene but reduce shadow precision. When None, derived from camera far plane (far * 0.5). Typical range: 50-200 units.

Field type: float32 voption

DirectionalLightSize

Full Usage: DirectionalLightSize

Field type: float32 voption

Half-size of directional light orthographic projection. Default: auto-derived.

ForwardPbr-specific: Controls the coverage area of directional shadows. Larger values cast shadows over a wider area but reduce resolution. When None, derived from camera frustum at mid-distance. Typical range: 20-100 units.

Field type: float32 voption

GridSnapSize

Full Usage: GridSnapSize

Field type: float32

Grid snap size for shadow origin to reduce flickering. Default: 2.0.

ForwardPbr-specific: Snaps the shadow origin to a grid to prevent shadow shimmer as the camera moves. Larger values = more stable but less precise shadows. Set to 0 to disable snapping. Typical range: 1.0-5.0 units.

Field type: float32

MaxCasters

Full Usage: MaxCasters

Field type: int

Maximum number of shadow casters. Must be perfect square (4, 9, 16, 25, 36).

Field type: int

MaxShadowLightDistance

Full Usage: MaxShadowLightDistance

Field type: float32

Maximum distance from the camera at which point/spot lights cast shadows. Default: 50.

ForwardPbr-specific: Lights beyond this distance are excluded from the shadow pass for performance. Increase for open-world or RTS games with large scenes; decrease for tighter, more shadow-dense scenes. Measured in world units (distance, not squared).

Field type: float32

OriginStrategy

Full Usage: OriginStrategy

Field type: ShadowOriginStrategy

Strategy for determining shadow map origin. Default: CameraTarget.

ForwardPbr-specific: Controls where directional light shadows are centered. CameraTarget works well for third-person games where the camera follows a player. SceneCenter works for fixed scenes. Use Custom for first-person or special cases.

Field type: ShadowOriginStrategy

Resolution

Full Usage: Resolution

Field type: int

Resolution of the atlas texture (square). Default 2048.

Field type: int

Type something to start searching.