Skip to content

Shadow

Per-light shadow configuration.

Plain, user-tunable data owned by a shadow-casting light and exposed as a public member. Holds only the settings that cannot be derived from the light. The depth framebuffer, texture, and light-space projection are owned by the renderer, and the projection is derived from the light's own properties.

Properties

bias float

Constant depth bias applied to the shadow compare.

Positive values push the compare toward the light, reducing self-shadowing artifacts. Overly large values cause shadows to visibly detach from their casters.

cpp
float bias {0.0f};

extent float

Half-width of the directional shadow camera's orthographic box.

cpp
float extent {15.0f};

far float

Far plane of the shadow camera.

Directional lights always use this value. Point lights and spot lights with a positive range use the range instead.

cpp
float far {500.0f};

map_size unsigned int

Resolution of the square shadow map.

cpp
unsigned int map_size {1024};

near float

Near plane of the shadow camera.

cpp
float near {0.5f};

radius float

Penumbra width in shadow map texels.

Values in the range stay smooth. Larger values trade quality for width. Only used when PCF is selected.

cpp
float radius {1.0f};

Released under the MIT License.