benilla-re systems structs docs

s_cloudPermutation

global · lighting

Address
0x86f2d0 · 256 bytes, up to 0x86f3cf
Type
const uint8_t[256]
Meaning
Holds the cloud noise's 256-entry permutation
Confidence
inferred
Finding
lighting/clouds#cloud-noise

Finding: Cloud noise in lighting: clouds

The noise value n is four octaves of value noise, each half the amplitude of the one before: lattice values from a table of 256 random floats 1 − 2·rand/32767 filled at start-up, a 256-entry permutation, and a fade table 0.5·(1 − cos(i·π/256)) for the interpolation weights, stepped in 16-bit fixed point by a per-octave step from 0x86f3dc and advanced by the noise phase. The third octave's partial sum also gives each texel a surface slope, its difference to the previous texel and the previous row times 2^(shift − 7).

The derivation is in the doc.