benilla-re systems structs docs

M2Lighting

struct · models · 436 bytes

Meaning
Holds the lights an instance draws with: nearest point lights, sums, harmonic terms, fog, clip plane
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.

offsetholds
+0x004position
+0x014flags: 1 lights in view space, 2 dominant light derived, 4 constants packed
+0x018, +0x024, +0x030directional sums colour·direction for red, green, blue
+0x03c, +0x048luminance-weighted direction sum, directional colour sum
+0x054ambient sum
+0x060, +0x078dominant light colour and direction
+0x06cthird colour sum
+0x084, +0x0a8, +0x0ccspherical harmonic terms for red, green, blue
+0x0f0seven packed constant vectors
+0x160, +0x170, +0x180nearest point lights, their squared distances, their count
+0x184 to +0x190fog start, fog end, 1/(end − start), fog colour
+0x19c, +0x1a0clip plane flag, plane

The derivation is in the doc.

Fields 21

offsetsizetypenamemeaningconfidencefinding
0x00004M2Scene *m_sceneHolds the scene the record gathers lights fromverified, proof onemodels/lights#lighting-record
0x000412float[3]m_positionHolds the position the record is lit atverified, proof onemodels/lights#lighting-record
0x00144uint32_tm_flagsHolds what is derived: 1 lights in view space, 2 dominant light, 4 packed constantsverified, proof onemodels/lights#lighting-record
0x001836float[9]m_directionalSumsHolds the per-channel sums of colour times direction, three vectorsverified, proof onemodels/lights#spherical-harmonic-terms
0x003c12float[3]m_luminanceDirectionHolds the sum of luminance times direction over the directional lightsverified, proof onemodels/lights#spherical-harmonic-terms
0x004812float[3]m_directionalColorHolds the sum of the directional coloursverified, proof onemodels/lights#spherical-harmonic-terms
0x005412float[3]m_ambientHolds the summed ambient colourverified, proof onemodels/lights#lighting-record
0x006012float[3]m_dominantColorHolds the dominant light colourverified, proof onemodels/lights#dominant-light
0x006c12float[3]m_thirdColorHolds the sum of the lights' third coloursverified, proof onemodels/lights#spherical-harmonic-terms
0x007812float[3]m_dominantDirectionHolds the dominant light directionverified, proof onemodels/lights#dominant-light
0x0084108float[27]m_shTermsHolds the nine harmonic terms of red, green and blueverified, proof onemodels/lights#spherical-harmonic-terms
0x00f0112float[28]m_shConstantsHolds the seven packed harmonic constant vectorsverified, proof onemodels/lights#harmonic-constants
0x016016M2Light *[4]m_nearLightsHolds the nearest point lights as a max-heapverified, proof onemodels/lights#lighting-record
0x017016float[4]m_nearDistancesHolds the squared distances of the nearest point lightsverified, proof onemodels/lights#lighting-record
0x01804uint32_tm_nearCountHolds the number of nearest point lightsverified, proof onemodels/lights#lighting-record
0x01844floatm_fogStartHolds the fog startverified, proof onemodels/lights#lighting-record
0x01884floatm_fogEndHolds the fog endverified, proof onemodels/lights#lighting-record
0x018c4floatm_fogScaleHolds 1/(fog end - fog start)verified, proof onemodels/lights#lighting-record
0x019012float[3]m_fogColorHolds the fog colourverified, proof onemodels/lights#lighting-record
0x019c4uint32_tm_hasClipPlaneHolds whether the record carries a clip planeverified, proof onemodels/lights#view-space-lights
0x01a016float[4]m_clipPlaneHolds the clip plane normal and distanceverified, proof onemodels/lights#view-space-lights