pub struct Assignment {
pub light: usize,
pub base: usize,
pub level: usize,
}Expand description
One shadowed light: which light it is, where its run of tiles starts, and how large each of them is.
The triple rather than a light index alone, because a slot no longer decides
a tile: a spot owns one tile and a point owns POINT_FACES, so where a
light’s map lives is an allocation and not an index — and since
topic 45’s priority rung, how large it is is an allocation
too.
Fields§
§light: usizeWhich light, as an index into the list Selection::update was given.
base: usizeThe first of the light’s tiles, as an index into the atlas’s light region
— so light_tile of it is the atlas tile, and it is also the number
Light::row puts in GpuLight::shadow_tile.
level: usizeWhich of TILE_LEVELS sizes each of those tiles is: 0 a whole root
cell of TILE texels, each one below a halving of it.
One level for the whole run, which is what a point light needs: its six faces are one map of one sphere seen six ways, and a cube with one face finer than its neighbour would change resolution across a seam.
Carried on the assignment rather than recomputed because it is the
hysteresis’ memory — tile_level reads last frame’s level out of
Selection::slots to decide this frame’s.