Doing animation skinning on the Sega Dreamcast and need an efficient way to accumulate N weighted joint matrices into a single skin matrix, which you can transform each vertex of your mesh against? …sounds like you could use some GAINZ, my friend!
Presenting shz_xmtrx_blend(), a hand-written inline SH4 assembly routine for adding and accumulating a matrix whose elements have all been uniformly scaled by a weight value onto the active 4x4 matrix held within the FP register back-bank of the SH4 FPU.
I just saw the Simulant engine, a user of my SH4ZAM fast-math library, get a big update to its animation and skinning system… and I couldn’t help but notice that the routine for applying an animation pose to a mesh was missing just THIS ONE VITAL ROUTINE which would’ve allowed for the construction of the weighted skin matrix and subsequent position and normal transforms by it to be done ENTIRELY within fast XMTRX registers, rather than round-tripping to and from memory doing it all in C++.
Now to get this mofo typed up, unit tested, and benchmarked, so we can measure dem sweet GAINZ! 💪