35 const f32 d = glm::distance(a.
pos, b.
pos);
47 for (
u32 i = 0; i < count; ++i) {
49 for (
u32 c = 0; c < channels && out[i] < 0; ++c) {
51 for (
u32 j = 0; j < i && free; ++j) {
54 if (free) out[i] =
static_cast<i32>(c);
56 if (out[i] < 0) ++dropped;
Core type definitions and utilities for ESEngine.
bool shadowMasksCollide(const ShadowMaskLight &a, const ShadowMaskLight &b)
Whether two lights cannot share a channel: one reads where the other writes.
std::int32_t i32
Signed 32-bit integer.
u32 assignShadowChannels(const ShadowMaskLight *lights, u32 count, u32 channels, i32 *out)
Gives each light the first channel none of its collisions hold, in the order the lights are given.
std::uint32_t u32
Unsigned 32-bit integer.
float f32
32-bit floating point
One light as the channel assignment sees it: where its shadows are read and where they can land.
f32 write
Where its geometry can be written: within this distance of pos.
bool everywhere
A directional light is read and written everywhere, so it shares a channel with nothing.
f32 read
Where a fragment reads this light's channel: within this distance of pos.