benilla-re systems structs docs

s_meshCapsShift

global · terrain

Address
0x86c2f8 · 16 bytes, up to 0x86c307
Type
uint32_t[4]
Meaning
Holds the caps shifts of the four neighbours' levels: 0, 8, 16, 24
Confidence
verified, proof one
Finding
terrain/lod#chunk-mesh-selection

Finding: Chunk mesh selection in terrain: lod

0x6beb50(draw) keys a chunk's mesh. The key is the level shifted by 16. With world flag 4 each of the four neighbours (+0xc4 to +0xd0: y − 1, x + 1, y + 1 and x − 1 in the tile's chunk grid) of a strictly higher level adds that level to the key shifted by 0, 4, 8 and 12, and to the caps word shifted by 0, 8, 16 and 24; a lower or equal neighbour adds nothing. A changed key invalidates both buffers and is stored at +0xbc.

The derivation is in the doc.