benilla-re systems structs docs

s_detailRamp

global · terrain

Address
0xcaf79c · 4 bytes, up to 0xcaf79f
Type
void *
Meaning
Holds the detail doodad fade ramp texture
Confidence
verified, proof one
Finding
terrain/detail#detail-doodad-draw

Finding: Detail doodad draw in terrain: detail doodads

0x6b2b80 draws a chunk's batch. It sets stage 0 combine 1 (modulate), culling off, device colour white, blend 2, the alpha reference to the byte 0xc7b2fc (128 at start-up), depth write on and the ramp on stage 1 with combine 1, camera-space texture coordinates (state 0x30 = 3) and its texture matrix on (state 0x38 = 1). The stage 1 matrix makes u = (z − 52.5)/17.5 and v = y/17.5 of the eye-space position: scale 1/(70 × 0.25), rotate π/2 about y, translate (0, 0, 70 × −0.75). Each slot with data is uploaded and drawn with its model's texture on stage 0. Culling and depth write are set to 1 at the end.

The derivation is in the doc.