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:
09:46PM - 13 Feb 23 UTC
Collecting here the list of improvements related to the animation system we woul
… d like to see in our version 7:
- [ ] Improved Animation Memory management (Draft https://github.com/BabylonJS/Babylon.js/pull/13434)
- [x] Animation Blending
- [ ] Animation Group Blending/Layering
- [ ] Animation Sequencing
- [x] Skeleton Retargeting (identical skeleton shape and identical bone hierarchy)
- [ ] Skeleton Retargeting (different skeleton shape and identical bone hierarchy)
- [ ] Skeleton Retargeting (different skeleton shape and different bone hierarchy)
- [ ] Bones management helper (position in world space....)
- [ ] Animation management helper (visual debugger without meshes....)
- [ ] Can we remove `Skeleton.needInitialSkinMatrix` and everything related to it? It seems it's an old feature not used anymore...
- [ ] Optimize performances in a "Not using scale" mode (send only translation+quaternion to the shader, not a whole mat4x4)
The issues will be refined in their own one once will start the next release.
Here is a list of related forum thread/issues this should be able to address:
@Evgeni_Popov, I hope this will end up being a very nice performance improvement