Text in 3D as meshes


Text rendering ideas are rumbling my head. I’d need to add a lot of dynamic texts to my scene. It seems too expensive to generate a texture for each of them.

I was wondering if there’s some solution that renders a font to a texture and then generates text meshes using quads / shaders. I’d need to be able to align these texts and predict / control their sizes, and ideally apply different colouring and effects, all in order to save textures.

Ideally I would even need ot batch several of those as I’d have possibly hundreds of them, but that’s another story.

I think this approach is used by some engines, but I guess there’s more to the story. Is this a proper approach to (many) text rendering in 3D, in BabylonJS? Does somethign like this exist?


There are quite a number of threads in this forum related to text rendering.

For eg:


Thank you! I don’t know how I missed those.

I’ll try MeshWriter. Btw seems the demo playgrounds linked from here are broken: Extensions/MeshWriter at master · BabylonJS/Extensions · GitHub

@TheLeftover might have an idea ?

Sorry about that. Some time ago, we had a disconnect between the playground code and made the MeshWriter showcases fail. When I repaired that, I failed to update the BABYLON repo readme.

I believe the code is fine; this was a playground-only problem. However, I must update the repo you mentioned.

In the meantime, you can visit GitHub - briantbutton/meshwriter: Babylon Mesh Writer, which is the same thing, but one version newer. It does, however, point to the revised playgrounds.

1 Like

@PirateJC would you mind updating our doc pages with the new working links ?

This would be a huge help :slight_smile:

Thanks a ton for your reactivity @TheLeftover !!!