Skip to main content

MAX_DIRECTIONAL_LIGHTS

Constant MAX_DIRECTIONAL_LIGHTS 

Source
pub const MAX_DIRECTIONAL_LIGHTS: usize = 4;
Expand description

How many directional lights one frame’s LightingUniform carries.

A directional light reaches every fragment, so the frame-wide uniform holds them beside the ambient term rather than the grid spending a slot in every cell on each. A frame with more than this many keeps the strongest ones and drops the rest; the shader reads every slot and an unused one holds no colour, so it adds nothing.