benilla-re systems structs docs

M2LightToDeviceLight

function · models · primitive

Address
0x71b7c0 · 867 bytes, up to 0x71bb22
Meaning
Fills a device light record from a light's type, colours, position and direction
Confidence
inferred
Finding
models/lights#fixed-function-lights
Test
models::light_clamp_pack_difftest

Finding: Fixed-function lights in models: lights

Without vertex shaders a record reaches the device as four lights. Slot 0 is the dominant light: a directional light along +0x78 with ambient +0x54, diffuse +0x60 and third colour +0x6c. Slots 1 to 3 take the nearest point lights from the end of the heap backward, so with four the heap root, the farthest, is left out: diffuse from the light's +0x3c, no ambient or third colour, attenuation +0x54 to +0x5c, at +0x18 (view space) or at +0xc minus the caller's origin. Unused slots are disabled. A colour reaches the device as an ARGB word divided by its largest component, alpha included, with that largest value as the light's scale.

The derivation is in the doc.

Callers 1

Callees 4

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