# Texture Atlas of Avatar (1 Draw Call)

**URL:** <https://forum.babylonjs.com/t/texture-atlas-of-avatar-1-draw-call/47191>\
**Category:** Questions\
**Created:** [January 13, 2024, 6:25pm UTC](https://forum.babylonjs.com/t/texture-atlas-of-avatar-1-draw-call/47191 "2024-01-13T18:25:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pruthi.hardik](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pruthi.hardik/32/37204_2.png) [@pruthi.hardik](https://forum.babylonjs.com/u/pruthi.hardik)\
**Post date:** [January 13, 2024, 6:25pm UTC](https://forum.babylonjs.com/t/texture-atlas-of-avatar-1-draw-call/47191/1 "2024-01-13T18:25:12Z")

</div>

Hi, I’m an active user of Babylonjs, made multiple projects/games/metaverse using the same. I need some help regarding Texture Atlases. Like [Ready Player Me](https://readyplayer.me/) does it automatically converts the avatar into single mesh, single material and make texture atlases and have 1 draw call, how can we achieve this using Babylonjs? Any help would be much appreciated!

---

<div class="post-metadata">

**Author:** ![Joe\_Kerr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joe_kerr/32/39017_2.png) [@Joe\_Kerr](https://forum.babylonjs.com/u/Joe_Kerr)\
**Post date:** [January 14, 2024, 1:06pm UTC](https://forum.babylonjs.com/t/texture-atlas-of-avatar-1-draw-call/47191/2 "2024-01-14T13:06:53Z")

</div>

Single mesh from modular parts that can be animated: [Loading character with animations to scene and cloning it with animation groups - #9 by Panuchka](https://forum.babylonjs.com/t/loading-character-with-animations-to-scene-and-cloning-it-with-animation-groups/19685/9) (works like charm!)

Single material: Do the avatars use painted textures (rather than palettes) and different channels (normal, metal, etc)? And they are modular, right? Each body part/accessory has its own unique texture/s?

---

<div class="post-metadata">

**Author:** ![pruthi.hardik](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pruthi.hardik/32/37204_2.png) [@pruthi.hardik](https://forum.babylonjs.com/u/pruthi.hardik)\
**Post date:** [January 15, 2024, 5:23pm UTC](https://forum.babylonjs.com/t/texture-atlas-of-avatar-1-draw-call/47191/3 "2024-01-15T17:23:32Z")

</div>

Yes, the body mesh has its own material and texture, same with hair, top, bottom, shoes. Is there a way to combine all of them into one single material?

---

<div class="post-metadata">

**Author:** ![Joe\_Kerr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joe_kerr/32/39017_2.png) [@Joe\_Kerr](https://forum.babylonjs.com/u/Joe_Kerr)\
**Post date:** [January 16, 2024, 7:38pm UTC](https://forum.babylonjs.com/t/texture-atlas-of-avatar-1-draw-call/47191/4 "2024-01-16T19:38:47Z")

</div>

Here is a [quick hack](https://playground.babylonjs.com/#92Y727#432) where I assign a single atlas material to all 5 body parts. Beware that the Dude textures are inverted on y.

You will notice that it takes way too long doing it it this way. Even if you do proper offsetting and shrink the atlas texture to e.g. 4096 it is still not acceptable. I am going to move this to Blender/Python and handle it within my asset pipeline.

Maybe the code can be improved or someone can do some shader magic to get it working dynamically.

btw. thanks @pruthi.hardik for bringing this up. I did not even think about baking textures into an atlas. This gives me so many new possibilities now! 🙂

---

<div class="post-metadata">

**Author:** ![pruthi.hardik](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pruthi.hardik/32/37204_2.png) [@pruthi.hardik](https://forum.babylonjs.com/u/pruthi.hardik)\
**Post date:** [January 17, 2024, 6:29am UTC](https://forum.babylonjs.com/t/texture-atlas-of-avatar-1-draw-call/47191/5 "2024-01-17T06:29:21Z")

</div>

Woah! That’s some interesting demo, a different way of doing it. Thanks! And yes maybe someone can improve or give an optimal shader based approach.
