M2LightingSetFog
function · models · primitive
- Address
0x71c110· 65 bytes, up to0x71c150- Meaning
- Sets a lighting record's fog colour, start and end, and the reciprocal of the fog range
- Confidence
- verified, proof one
- Finding
- models/lights#lighting-record
- Test
models::fade_set_range_difftest
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 4
- GatherSlotLights terrain
- ApplyMapLighting terrain
- ApplyMapObjectFog terrain
- SimpleModelLightCallback ui
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.