Header menu logo Mibo

ShadowAtlasConfig Type

Configuration for the shadow atlas system.

This configuration controls both the atlas texture layout and shadow rendering behavior. Some fields are only used by the forward pipeline implementation. Other pipelines may ignore these fields or use different strategies.

Record fields

Record Field Description

DirectionalLightDistance

Full Usage: DirectionalLightDistance

Field type: float32 voption

Distance to place directional light camera behind the shadow origin. Default: 100.

Larger values capture more of the scene but reduce shadow precision. 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: 50.

Controls the coverage area of directional shadows. Larger values cast shadows over a wider area but reduce resolution. Typical range: 20-100 units.

Field type: float32 voption

DirectionalOriginY

Full Usage: DirectionalOriginY

Field type: float32

Fixed world-space Y for the directional shadow frustum origin. Default: 0.

Locking the shadow origin's Y prevents the shadow frustum from sliding vertically when the camera target moves up/down (e.g., the player jumps). Override this if your scene's ground level is not at Y=0.

Field type: float32

GridSnapSize

Full Usage: GridSnapSize

Field type: float32

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

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

OriginStrategy

Full Usage: OriginStrategy

Field type: ShadowOriginStrategy

Strategy for determining shadow map origin. Default: CameraTarget.

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.