70 if (g.light.raw == entity.
raw)
return &g;
107 for (
u32 take = want; take > 0; --take) {
116 if (take == want) grant.
refusal = why;
Who owns which square of the one shadow texture.
Core type definitions and utilities for ESEngine.
A square texture divided into a grid of cells, handed out as square blocks.
i32 allocate(u32 count, u32 cells, AtlasRefusal &why)
Claims count tiles of cells x cells cells each.
std::int32_t i32
Signed 32-bit integer.
ShadowGrant claimTiles(ShadowAtlas &atlas, Entity light, u32 want, u32 cells, i32 &outFirst, ShadowClaim policy=ShadowClaim::AllOrNothing)
Claim a complete shadow map, or explicitly allow fewer cascades.
std::uint32_t u32
Unsigned 32-bit integer.
std::uint8_t u8
Unsigned 8-bit integer.
AtlasRefusal
Why a claim was turned down. Three different answers on purpose: raising the atlas size fixes NoSpace...
Entity identifier with packed index + generation.
One caster's claim on the atlas: what it wanted, what it kept, and why the difference.
u32 requested
Tiles asked for: a sun's cascade set, a cube's six faces, or one.
u32 granted
Tiles kept. 0 means this light casts no shadow at all this frame.
Entity light
The light that asked. Carried so a reader can name it rather than an index.
The frame's whole shadow allocation, as numbers something outside it can check.
const ShadowGrant * grantFor(Entity entity) const
What entity asked for and kept, or null when it asked nothing.
u32 reducedCasters() const
u32 deniedCasters() const
bool hasSameDenial(const ShadowGrant &claim) const
Whether this report already contains the same denied claim.
std::vector< ShadowGrant > grants