Vertex Animation Textures

So, from this thread: Loving the thin instances! I thought about it and using the above resources (@Raggar you rock! ), managed to cobble up a dirty 1st pass VAT generator here: Babylon.js Playground

It takes an imported mesh with skeleton and animation and returns a VAT texture which you can save for use with your own custom shader. Once that’s done, a little test is performed against a nodematerial and instancedBuffer to create many instances with independent animations.

There are still a lot of stuff to add/tweak/test. For instance (no pun intended), the animation doesn’t consider bone_influencers > 4 since I’m not grabbing the MatricesIndicesExtraKind / MatricesWeightExtraKind yet. The VAT is also fairly low res (I think), and a lot more work is needed to make a better texture (I’m guessing exr). There is some jerkiness in the way the instances move. I’m guessing the texelfetch result from the VAT is not as high res. yada, yada, yada…

The good part is: no need to swizzle the texture, no need for 3rd party scripts/hacks etc. If you have a mesh with bone animations that is imported into the PG, you can make a VAT. I think it’s a start…

Plus I’m beat, anyone is free to try and take it to another level. I think it shouldn’t be too hard to make a VAT generator dedicated for bjs users on a url somewhere?

3 Likes