Texture Atlas of Avatar (1 Draw Call)

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 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!

Single mesh from modular parts that can be animated: Loading character with animations to scene and cloning it with animation groups - #9 by Panuchka (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?

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?

Here is a quick hack 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! :slightly_smiling_face:

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.