benilla-re systems structs docs

s_d3dTexCoordModeHandlers

global · gx

Address
0x5a2d6c · 28 bytes, up to 0x5a2d87
Type
void *[7]
Meaning
Holds the case addresses of the Direct3D texture coordinate mode switch in 0x5a2b40
Confidence
verified, proof one
Finding
gx/renderstate#texture-coordinate-modes

Finding: Texture coordinate modes in gx: render state

Ids 0x2f to 0x36 give a stage a coordinate mode 0 to 6. Direct3D (0x5a2b40) sets the stage's TEXCOORDINDEX to the stage number or-ed with a generator: mode 0 none; modes 1, 2 and 3 0x20000 (camera-space position); mode 4 0x30000 (reflection vector); mode 5 0x10000 (camera-space normal); mode 6 0x30000. The stage's mode matrix is the identity for modes 0, 3, 4 and 5, a copy of the top view matrix with its 3 by 3 part transposed and its translation row negated for modes 1 and 2 (mode 1 multiplies it further), and for mode 6 the rows (0.5, 0, 0, 0), (0, 0.5, 0, 0), (0, 0, 1, 0), (0.5, 0.5, 0, 1).

The derivation is in the doc.