Hi,
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.
Thanks.
2 Likes
@Evgeni_Popov Any thoughts?
I think that should be possible, I have added it to the Animation Improvements issue:
opened 09:46PM - 13 Feb 23 UTC
rendering engine
new feature
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:
- https://forum.babylonjs.com/t/animations-storing-key-frames-in-typed-arrays/36566/18
- https://forum.babylonjs.com/t/how-to-bind-separate-glb-file-such-as-cloth-etc-to-armature/37574
- https://forum.babylonjs.com/t/usd-3000-reward-anyone-figured-out-retargeting-yet/36629/30
- https://forum.babylonjs.com/t/additive-animations-distorted/37751
- https://forum.babylonjs.com/t/usd-1000-reward-moving-bones-to-different-position/37929
- https://forum.babylonjs.com/t/gltf-animation-loops-when-i-click-how-to-stop-the-loop/38477/6
- https://forum.babylonjs.com/t/baked-texture-animations-with-animation-groups/32518/11
- https://forum.babylonjs.com/t/skeletal-mesh-performance/40522
3 Likes
Thank you @Evgeni_Popov , I hope this will end up being a very nice performance improvement