benilla-re systems structs docs

BuildLightColours

function · lighting · primitive

Address
0x6d37e0 · 546 bytes, up to 0x6d3a01
Meaning
Builds the diffuse, ambient, window and HSV colours from the light table
Confidence
verified, proof one
Finding
lighting/fog#light-colours
Test
lighting::dn_fog_ambient_darkened_difftest, lighting::dn_fog_derive_difftest

Finding: Light colours in lighting: fog and the world light

After each table build 0x6d37e0 derives the light colours at state +0x168 onward: diffuse (+0x174) is colour band 0 and ambient (+0x178) band 1. The window diffuse (+0x17c) is the 8-bit blend of band 0 toward band 1 at a = 0x80 with a zero top byte; the window ambient (+0x180) is band 1 blended toward band 0 at 0x80, then 16 added to each channel saturating at 255, top byte 0xff. +0x184 to +0x190 hold ambient with its HSV saturation ×0.33 and value ×1.25 as three floats and 1.0, and +0x194 is band 1 with each channel (c + 3)·85 >> 8 under the red byte of band 8.

The derivation is in the doc.

Callers 1

Callees 3

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