Skip to main content

Module clustered

Module clustered 

Source
Expand description

The cluster grid: which lights reach which part of the frustum (forward+). See clustered.wgsl for the culling geometry.

Structs§

Clusters
The grid, the lights in it, and the pass that fills it.

Constants§

CELLS
How many cells there are.
GRID
Cells across, down, and into the frame; 16x9 keeps a cell roughly square, 24 slices is the usual.
MAX_LIGHTS_PER_CELL
How many lights one cell can hold; a cell that wants more drops the rest.

Functions§

slice_scale_bias
Scale and bias mapping a view-space depth to a slice: slice = log(depth) * scale + bias.