benilla-re systems structs docs

CWorld::UpdateSkyAndFog

function · terrain · primitive

Address
0x66ff60 · 583 bytes, up to 0x6701a6
Signature
void __fastcall (uint32_t arg1, uint32_t arg2)
Meaning
Computes the frame's fog and sky values from the light state
Confidence
verified, proof one
Finding
lighting/fog#world-light-commit

Finding: World light commit in lighting: fog and the world light

After the fog update 0x66ff60 dims ambient and diffuse by the sun glare and writes the world's device light record: its direction is the sun direction and its three colours (models/lights#light-object) are ambient, diffuse and colour band 9, each channel times 1/255. The dim is a = the byte of f32((1 − f)·255 + 512) >> 14 with f = 0.35·g, g the sun glare's look factor (celestial#glare-update); each channel becomes (c·a + 0xff) >> 8, so f = 0 is the identity. On the full-recompute path f is 0.

The derivation is in the doc.

Callers 2

Callees 9

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