benilla-re systems structs docs

BakeMapEntityGroupLight

function · terrain · primitive

Address
0x69e4c0 · 683 bytes, up to 0x69e76a
Signature
void __thiscall (void *this, void *a, void *b, void *c, NTempest::C3Vector *arg5)
Meaning
Bakes a map object group's vertex colour into an entity's directional light and ambient target
Confidence
verified, proof one
Finding
terrain/lights#interior-light-bake
Test
terrain::cmapobj_vert_offsets_difftest

Finding: Interior light bake in terrain: map lights

0x6a8410 (a doodad def) and 0x69e4c0 (an entity) bake a map object group's vertex colour into the light. They trace down into the group (0x6a4cc0, or 0x6a4dc0 for a known face) and take the surface colour; 0x6a77e0 makes the directional +0xa0 (largest channel raised to at least 0xa8) and the ambient (at most 0x60), at +0x9c for a def and the target +0xf4 for an entity. The sampler returns alpha 0xff always and a selector, bit 0 of the hit face's flag byte. With the selector set the day light's colours (+0x174, +0x178) replace both words, +0xa3 becomes 0xff and +0x90 bit 0x800 is set; clear, the words stay and the bit is cleared. A sampler that fails leaves everything.

The derivation is in the doc.

Callers 0

None by a direct call or jump.

Callees 8

Calls and jumps by a bare address, from tables/calls.tsv.