M2SkinVertices
function · models · primitive
- Address
0x71a720· 700 bytes, up to0x71a9db- Meaning
- Skins a submesh's vertices by up to four weighted bones with x87 arithmetic
- Confidence
- verified, proof one
- Finding
- models/render#software-skinning
- Test
models::m2_vertex_transform_difftest
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.
| routine | arithmetic | position, per column | normal, per column |
|---|---|---|---|
SSE 0x71a9e0 | single precision, mulps/addps | ((x·m0 + m3) + y·m1) + z·m2 | (nx·m0 + ny·m1) + nz·m2 |
x87 0x71a720 | the 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.
Callers 1
- M2SkinVerticesSse models
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.