Skip to main content

Module lit_clusters

Module lit_clusters 

Source
Expand description

The cluster debug scene: the grid a lit frame looks its lights up in.

Nothing of the lit scene is reused. What this scene has to show is where the light counts differ from cell to cell, and the lit sceneโ€™s lights reach nearly every cell, which leaves that map flat: here one row of each light kind crosses a long floor, so each kindโ€™s footprint is a band of its own and a light written into the wrong cells moves a patch rather than shifting a level everywhere.

Re-exportsยง

use super::LitSurface; ๐Ÿ”’
use super::PlacedLight; ๐Ÿ”’
use super::SceneControl; ๐Ÿ”’
use super::SceneDef; ๐Ÿ”’
use super::SceneOptions; ๐Ÿ”’
use super::allocate_surface; ๐Ÿ”’
use super::camera_looking_at; ๐Ÿ”’
use super::grid; ๐Ÿ”’
use unlit_ecs::bundle; ๐Ÿ”’
use unlit_wgpu::pipeline::LitShader; ๐Ÿ”’
use unlit3d::prelude::*; ๐Ÿ”’

Constantsยง

CLUSTER_COLUMNS ๐Ÿ”’
The columns the debug floorโ€™s lights stand in.
CLUSTER_EYE ๐Ÿ”’
Where the debug camera sits and what it looks at.
CLUSTER_FAR ๐Ÿ”’
CLUSTER_FLOOR ๐Ÿ”’
The debug floor: how wide and how deep, and where its front edge sits.
CLUSTER_NEAR ๐Ÿ”’
The depth range the debug sceneโ€™s grid spans.
CLUSTER_ROWS ๐Ÿ”’
Where each row of lights sits, nearest first: its depth, the height its lights hover at, and how far each one reaches.
CLUSTER_TARGET ๐Ÿ”’

Staticsยง

CLUSTER_SCENE
The frameโ€™s cluster grid, composited over the lighting.

Functionsยง

build_clusters ๐Ÿ”’
Build the cluster debug sceneโ€™s world content.
cluster_grid ๐Ÿ”’
The WESL the debug sceneโ€™s fragment stage runs, spliced at the built-in stageโ€™s fragment hook.