Text on mesh optimization

I’m current using a transparent plane mesh with a single text character.
Meaning if I want the word “fizz buzz”, I have 8 new meshes, each with a unique dynamic texture. (I’m aware I could optimize this by generating the materials and reuse, like in the letter z above).

I noticed quite a large increase in draw calls when these plane meshes are active, and I want to try to reduce the draw calls and hence performance.
Would it be possible to use instances and then somehow use the vertex buffer to have different text characters per instance?

First you could directly write the full sentence and use only one plane :slight_smile:

Now if you still need to keep separate letters, you could have one texture containing all the required letters and use instances with separate uvs to fetch from different part of the texture but it might be more complex to put in motion.

The planes must be separate because they have independent animations attached to them.
I think what you are mentioning a sprite sheet right? I saw I need a Windows os to run a generator for those

I agree sprite might be a good idea too :slight_smile:

You could try to first generate your spritesheet manually offline to see if that works for you ?

Would it be possible to use instances then instead of clones?

The sprites would do the heavy lifting for you in this case.

Something along these lines may be adaptable to single letter use https://www.babylonjs-playground.com/#A9K31I#5