benilla-re systems structs docs

s_liquidMeshCases

global · terrain

Address
0x68a738 · 15 bytes, up to 0x68a746
Type
uint8_t[15]
Meaning
Holds the case a template of n picks, indexed by n minus 1: 0 for n = 1, 1 for 3, 7 and 15, else 2
Confidence
verified, proof one
Finding
terrain/liquid#liquid-mesh-templates

Finding: Liquid mesh templates in terrain: liquid

The first area constructed makes five liquid mesh templates once (0x68a750, from 0x6c1d77), 0x44 bytes each, for n = 0, 1, 3, 7 and 15 (the table at 0x86a040). A template of n has (n + 2)² vertices on a grid of n + 1 cells a side. A vertex has a texture coordinate u/(n + 1), v/(n + 1) and a position of −4.1666665 times it. Rows run alternately up and down from u = 0, so the vertex list is a serpentine. The 16-bit index list holds (n + 1)(n + 2)·2 + 2 entries. Nothing in the image reads the templates after they are made.

The derivation is in the doc.