# Baked Texture Animations to Reduce CPU Usage with Many Concurrent Animations

**URL:** <https://forum.babylonjs.com/t/baked-texture-animations-to-reduce-cpu-usage-with-many-concurrent-animations/43244>\
**Category:** Questions\
**Created:** [August 11, 2023, 3:45pm UTC](https://forum.babylonjs.com/t/baked-texture-animations-to-reduce-cpu-usage-with-many-concurrent-animations/43244 "2023-08-11T15:45:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![webgrid](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/webgrid/32/24940_2.png) [@webgrid](https://forum.babylonjs.com/u/webgrid)\
**Post date:** [August 11, 2023, 3:45pm UTC](https://forum.babylonjs.com/t/baked-texture-animations-to-reduce-cpu-usage-with-many-concurrent-animations/43244/1 "2023-08-11T15:45:55Z")

</div>

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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [August 17, 2023, 9:42pm UTC](https://forum.babylonjs.com/t/baked-texture-animations-to-reduce-cpu-usage-with-many-concurrent-animations/43244/2 "2023-08-17T21:42:24Z")

</div>

cc @Evgeni_Popov

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [August 18, 2023, 9:48am UTC](https://forum.babylonjs.com/t/baked-texture-animations-to-reduce-cpu-usage-with-many-concurrent-animations/43244/3 "2023-08-18T09:48:27Z")

</div>

No, baked texture animations are more limited than normal animations; you can’t have several animations applied to the same mesh at the same time, so you can’t have transitions (unless the transition is an animation itself and not a blend!). What’s more, there’s no interpolation between frames, so the animation may appear a little choppier, depending on the framerate.

You may find this thread interesting, as @oriongu had the same problem as you:

> [@Baked Texture Animations with Animation Groups?](https://forum.babylonjs.com/t/baked-texture-animations-with-animation-groups/32518/13):
>
> Hi @Evgeni_Popov, I was looking to integrate vat animations into my project but was wondering what are the benefits? With a standard async import of 100+ entities, I get similar fps to your playground example? And that’s with 0 optimization, I’m sure I could improve that number. Hopefully, my question isnt too silly slight_smile

And the doc:

[https://doc.babylonjs.com/features/featuresDeepDive/animation/baked\_texture\_animations](https://doc.babylonjs.com/features/featuresDeepDive/animation/baked_texture_animations)
