M2LightingInitialize
function · models · orchestration
- Address
0x71bc30· 55 bytes, up to0x71bc66- Meaning
- Clears a lighting record and stores its scene and position
- Confidence
- verified, proof one
- Finding
- models/lights#lighting-record
Finding: Lighting record in models: lights
0x71bc30(scene, position) zeroes a record and stores its scene and position. The record holds
up to four point lights with their squared distances, the summed ambient and directional colours,
27 spherical harmonic terms (nine per channel), the fog and the clip plane.
| offset | holds |
|---|---|
+0x004 | position |
+0x014 | flags: 1 lights in view space, 2 dominant light derived, 4 constants packed |
+0x018, +0x024, +0x030 | directional sums colour·direction for red, green, blue |
+0x03c, +0x048 | luminance-weighted direction sum, directional colour sum |
+0x054 | ambient sum |
+0x060, +0x078 | dominant light colour and direction |
+0x06c | third colour sum |
+0x084, +0x0a8, +0x0cc | spherical harmonic terms for red, green, blue |
+0x0f0 | seven packed constant vectors |
+0x160, +0x170, +0x180 | nearest point lights, their squared distances, their count |
+0x184 to +0x190 | fog start, fog end, 1/(end − start), fog colour |
+0x19c, +0x1a0 | clip plane flag, plane |
The derivation is in the doc.
Callers 7
- CharSelectLightCallback glue
- SetupWorldStages terrain
- DrawChunkPass terrain
- DrawMapObjectPass terrain
- InitLiquidPassState terrain
- GatherSlotLights terrain
- CM2Model::UpdateLighting models
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.