s_shDirectionalScale
global · models
- Address
0x812080· 4 bytes, up to0x812083- Type
const float- Meaning
- Holds 2.956793, the scale of a directional colour into the harmonic terms
- Confidence
- verified, proof one
- Finding
- models/lights#spherical-harmonic-terms
Finding: Spherical harmonic terms in models: lights
An ambient colour c adds c to the ambient sum and 3.5449078·c (2√π) to each channel's
constant term. A directional colour c along d first takes d through the scene's view +0x9c
(row vector, 3×3 part) when the record has a scene, then adds c_ch·d to each channel's
directional sum, (0.212671·r + 0.71516·g + 0.072169·b)·d to the luminance-weighted sum, and c
to the directional colour sum. It then adds 2.956793·c_ch·Y_i to the nine terms of each channel,
with (x, y, z) = −d:
| i | Y_i |
|---|---|
| 0 | 0.2820948 |
| 1, 2, 3 | −0.4886025·y, 0.4886025·z, −0.4886025·x |
| 4, 5 | 1.0925484·x·y, −1.0925484·y·z |
| 6 | 0.3153916·(3z² − 1) |
| 7, 8 | −1.0925484·x·z, 0.5462742·(x² − y²) |
A light's third colour adds to the third colour sum.
The derivation is in the doc.