Skeletal mesh performance

This thread: Baked animation performance - #24 by arcman7 discusses a number of animation optimisations. One thing that really caught my attention was the following post by @Evgeni_Popov:

Their mesh size is 260 triangles while the arachnid is 1794.

In addition, they optimized the calculation for their use case:

  • only rotation and position for bones (no scaling). So they only do two texture reads to get the quaternion and position values, while we do 4 reads to build a 4x4 matrix.
  • only two bones max

So they do 2*2=4 texture reads in total, while we do 4*4=16 because the arachnid has NUM_BONE_INFLUENCERS = 4.

Would it be possible for Babylon.JS to support skeletal meshes that will not be scaled? It seems like optionally using a skeleton that does not support scaling would be a good trade-off if it means halving the number of texture reads.



@Evgeni_Popov Any thoughts?

I think that should be possible, I have added it to the Animation Improvements issue:


Thank you @Evgeni_Popov, I hope this will end up being a very nice performance improvement :smiley: