benilla-re systems structs docs

s_liquidRampB

global · terrain

Address
0xc7fcd8 · 1024 bytes, up to 0xc800d7
Type
float[256]
Meaning
Holds the ocean ramp min(1, i/255) as the 53-bit product of i and 0.58333331 by its reciprocal
Confidence
verified, proof one
Finding
terrain/liquid#depth-ramps

Finding: Depth ramps in terrain: liquid

At start-up 0x68c4c0 builds the tables the vertex fills read. With c = 0.58333331, for i from 0 to 255, B[i] = min(1, (c·i)·(1/(c·255))) and A[i] = (i·(1/9))·0.21428572, or 1.0 when i·(1/9) is above 4.6666665, B at 0xc7fcd8 and A at 0xc81768; every value is a float of a 53-bit computation. It also fills 64 alpha bytes, floor of 255·min(1, 1.6·(i/63)⁸), into the top byte of 0xc7fbc0's dwords, makes three liquid textures and loads the shader ocean0_s.

The derivation is in the doc.