benilla-re systems structs docs

s_oneOver255

global · models

Address
0x8026c8 · 4 bytes, up to 0x8026cb
Type
float
Meaning
Holds 1/255, the scale of a byte to a unit value
Confidence
verified, proof one
Finding
models/render#software-skinning

Finding: Software skinning in models: drawing

A vertex is 48 bytes: position, four weight bytes, four bone index bytes, normal and texture coordinates. Its matrix is the bone matrices summed by weight w/255, starting from the first weight and stopping at the first zero weight; a vertex with the same weights and indices as the previous one reuses its matrix. The output is 32 bytes: position, normal and the texture coordinates copied. Two routines do this, and the processor picks one when the first instance is built: on a processor with MMX and SSE, every one the client runs on today, the SSE routine 0x71a9e0; else the x87 routine 0x71a720, which the SSE routine also calls for an output buffer not 16-byte aligned.

routinearithmeticposition, per columnnormal, per column
SSE 0x71a9e0single precision, mulps/addps((x·m0 + m3) + y·m1) + z·m2(nx·m0 + ny·m1) + nz·m2
x87 0x71a720the FPU's 53-bit precision, partial sums stored as floats((m20·z + m10·y) + m00·x) + m30(m00·nx + m20·nz) + m10·ny

The derivation is in the doc.