AddMapLight
function · terrain · primitive
- Address
0x6a7ac0· 561 bytes, up to0x6a7cf0- Signature
void __thiscall (void *this, const float *point)- Meaning
- Adds a map point light to a context, attenuated by its distance from the context's point
- Confidence
- verified, proof one
- Finding
- terrain/lights#point-lights
- Test
terrain::chunk_add_light_difftest,terrain::chunk_add_light_falloff_difftest
Finding: Point lights in terrain: map lights
0x6a7ac0 adds a map point light to a lighting context, attenuated by distance from the context's
point +0x24 raised by 1.1666666. A light whose falloff +0xf0 is 0 is added unchanged. Otherwise the intensity is
1.0 inside +0xe8, 1 − (d − start) × falloff between +0xe8 and +0xec, and the light is
dropped from +0xec outward. The added record is a copy of the light's 27 dwords with its
direction set from the offset and its colour +0xb8 times the intensity at +0x40. 0x69e1c0
is the radius fall-off of a fog: 1 below +0x10, 1 − (d − +0x10)/(+0x14 − +0x10) up to +0x14, d clamped to
[0, +0x14].
The derivation is in the doc.
Callers 1
- GatherMapObjectLights terrain
Callees 7
- SetVector3 spline
- AllocCacheLight terrain
- UnlinkLightLink terrain
- GetLightListLink terrain
- M2LightSetType models
- M2LightSetDirection models
- M2LightSetEnabled models
Calls and jumps by a bare address, from tables/calls.tsv.