benilla-re systems structs docs

s_alphaStageScale

global · terrain

Address
0x810e8c · 4 bytes, up to 0x810e8f
Type
float
Meaning
Holds -0.125, the extra scale of the alpha map's texture matrix
Confidence
verified, proof one
Finding
terrain/render#chunk-layers-in-multipass

Finding: Chunk layers in multipass in terrain: render

On the multipass path the chunk draws opaque with the first layer and alpha blended after it, one pass a layer. Each layer's texture is stage 0; a later layer's alpha map is stage 1 with the combine preset 1. Both stages generate their coordinates from the vertex position (mode 2) through a texture matrix that scales by −1/sy and moves by the negated offset of the chunk from the camera; stage 1 scales by a further −0.125. The shadow comes after the layers as one more pass.

The derivation is in the doc.