Mesh skinning fixed
After many, many wasted hours, I finally fixed an issue I didn’t realise I had with the mesh skinning. In an effort to optimise processing the vertices at runtime the vertices were pre-multiplied by the inverse bind matrix, which I thought was a sensible thing to do. For some reason that I haven’t yet figured out, this was a mistake. I’ve deferred that stage to the model update function. Now instead of a vertex with an influence of one joint transforming just the positions and normals, it’s the case that the inverse bind matrix is used for both alongside the other transform. It was already a heavy operation that I wanted to optimise later, but now it’s even more of a processing hog.
I think it’s taken about two or three weeks to realise that nothing was wrong with either the exporter or the model itself in any way and it was just a case of commenting-out (for now) around ten or so lines of code in the initialisation phase and introducing that into the model update function.
Here are some screenshots of the progress to get to where I am. Ignore the holes in the mesh, they’re from faces with the wrong winding order that I haven’t yet addressed.
The model before setting up the rig and skinning it.
After rigging and skinning.
The first attempt, as you may just about be able to make out, there’s a skeleton in the centre of that mess of polygons.
At this point, I removed the background to better see what was happening with the next attempts (many more abominations came of this phase).
Finally, he walks upright with arms raised uncomfortably.
There are some issues with rotations in the bind position, but I’m not worried about it right now. I also just wanted to get started with the walk cycle, making sure it would export and render correctly before moving forward with polising it and fixing the arms just hanging out at the side. There’s a bunch of code I wrote to try and solve the issue from the exporter side that I now need to remove and I also need to fix the face order. Plus, the animation itself is not great in motion, but that’s something I’ll improve as time goes on.
With this major setback, I’ll miss the original release of the teaser. Hopefully, it will be ready before December.
Oh, also. Happy birthday, Dreamcast :).