Header menu logo Mibo.Raylib

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

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

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

ShowDebugOverlay

Full Usage: ShowDebugOverlay

Field type: bool

Whether to show debug overlay. Default false.

Field type: bool

Type something to start searching.