M2LightingDeriveDominantLight
function · models · primitive
- Address
0x71c2f0· 482 bytes, up to0x71c4d1- Signature
void __thiscall (M2Lighting *this)- Meaning
- Derives a lighting record's dominant direction and colour from its directional sums, once
- Confidence
- verified, proof one
- Finding
- models/lights#dominant-light
- Test
models::camera_facing_basis_difftest
Finding: Dominant light in models: lights
Once per record (flag 2) the directional sums collapse into one light. Its direction +0x78 is the
luminance-weighted sum normalized, or (0, 0, −1) when its squared length is at most 1e-5 or NaN.
With c_ch the dot product of that direction with each channel's directional sum and S the
directional colour sum, the light's colour +0x60 is 1.25·c − 0.25·S and 0.25·(S − c) adds to
the ambient sum.
The derivation is in the doc.
Callers 2
- CM2Model::UpdateLighting models
- M2LightingSetDeviceLights models
Callees 3
- SetVector3 spline
- DivideVector3 spline
- Vector3LengthSquared spline
Calls and jumps by a bare address, from tables/calls.tsv.