Expand description
Backend-agnostic decal support. Owns the per-decal model / inverse-model
matrix math the projected-decal pass needs at runtime, the DecalRecord the
backends consume, and the DecalSet slot table they drive the pass from.
Decals are stamped onto the scene depth buffer by drawing a unit-box volume
per decal: the fragment shader reconstructs the world-space point of each
rasterised pixel from depth and tests whether it lies inside the box.
Structs§
- AtCapacity
- Returned by
DecalSet::insertwhen every slot up to the set’s capacity is live. The capacity is the backend’s own per-decal descriptor reservation, so the backend words the error. - Decal
Record - Per-decal data the renderer consumes each frame. Built once at
GraphicsSysteminit from the world’sDecalcomponents. - Decal
Set - The decals a backend’s projected-decal pass draws, addressed by the slot id
DecalSet::insertreturns. That id is stable untilDecalSet::removetombstones it, and indexes the backend’s parallel per-decal resources (an albedo descriptor, a uniform ring slot). - Visible
Decal - A decal that survived the frustum cull, with the per-decal inputs its draw needs.
Enums§
- Remove
Error - Why
DecalSet::removerejected an id.
Functions§
- build_
decal_ records - Resolve a list of
Decalcomponents intoDecalRecords the backend can consume. Skips decals whose texture reference is missing, invisible decals, and decals whose size is degenerate (any non-positive component). - decal_
model_ matrix - Build the world-space
modelmatrix for a decal:T(position) * R_yxz * S(size). Column-major; the inner index is the row. Matches the rotation convention used byProp::model_matrix. - invert_
decal_ model - Invert an affine TRS matrix of the form built by
decal_model_matrix. The 3×3 linear part isR * diag(size); its inverse isdiag(1/size) * R_transpose. The translation flips into the inverted frame:-inv_linear * translation.