s_riverSwatch
global · terrain
- Address
0xc89d68· 4 bytes, up to0xc89d6b- Type
void *- Meaning
- Holds the river swatch texture
- Confidence
- verified, proof one
- Finding
- terrain/liquidpass#liquid-swatch-textures
Finding: Liquid swatch textures in terrain: liquid passes
0x68c4c0 makes two 8×64 textures that 0x68a830 fills: the river swatch (0xc89d68) and the ocean
swatch (0xc81b90). The callback runs for level 1 only. Row k is the shallow colour plus
floor(k × (deep − shallow)/64) on each of the colour and alpha bytes; the colours are the light
state's words at +0xe8, +0xec (river, colour bands 16 and 17 of the light record) and +0xe0, +0xe4 (ocean, bands 14 and 15) and the alphas the
LightParams floats at +0x114, +0x118 (river) and +0x11c, +0x120 (ocean), each as the byte
of f32(v × 255 + 512) >> 14. On the last row the ocean swatch alone has its brightness
multiplied by 0.9 in HSV and its alpha forced to 255.
The derivation is in the doc.