benilla-re systems structs docs

PackCombined64Half

function · terrain · primitive

Address
0x6b0510 · 594 bytes, up to 0x6b0761
Signature
void __fastcall (uint16_t *dst, const uint8_t **alpha, const uint8_t *shadow)
Meaning
Packs the shadow and three 64x64 alpha maps into 32x32 texels on the 0 to 60 and 63 walk
Confidence
verified, proof one
Finding
terrain/chunk#combined-chunk-texture
Test
terrain::alpha_texel_32_edge

Finding: Combined chunk texture in terrain: chunk

With either shader flag set, a chunk gets one texture (+0x13c) that packs its shadow and the alpha maps of layers 1 to 3: texel = s << 12 | a1 << 8 | a2 << 4 | a3, each a 4-bit value. A layer without an alpha map, or a missing layer, gives 0xf; the shadow is 0xf for a clear bit or no map and 0 for a set bit. The size and the sample walks follow the alpha maps.

The derivation is in the doc.

Callers 1

Callees 0

None by a direct call or jump.

Calls and jumps by a bare address, from tables/calls.tsv.