I have a method in my project that plays animations and handles transitions from playing animations to new ones. It utilizes Babylon’s AnimationGroup and works with several checks and conditions to handle looping, last played animations, walk animations, etc.
However, I’ve noticed that when running more than 30-40 animations concurrently, the CPU usage becomes a significant concern. I’m looking to optimize this by possibly using baked texture animations.
Here’s my existing method for playing animations:
private play_animation(entity: entity, ag: BABYLON.AnimationGroup...): void {
// (Code...)
entity.animateTransitionTo(ag); //Utilizes setWeightForAllAnimatables for the weight shift.
}
My question is it feasible to convert the existing play_animation
method into a baked texture animation within Babylon.js? While keeping existing logic (such as transitions handled by animateTransitionTo
) while utilizing baked texture animations?