TextRenderComponent performance is surprisingly bad

I have a question about the performance of the TextRenderComponent class. I’m working on a program which requires me to render quite a lot of Text in an open world, and I’ve noticed what I consider a disproportionate performance impact.

I can render hundreds of static meshes each with thousands of polygons and complex materials and stay below 6ms render time, but as soon as I have ~120 TextRenderComponents in my viewport, even with just ~8 characters each on average, my rendering times explode (~20ms). I really don’t see why this should need to happen (not that it matters much, but this is on a 3.5 GHz i7 with a Geforce 770).

My specific use case is that I generate lots of TextRenderComponents when the level loads, and fill them once with text. After this point, they will never change again. Is there any way to take advantage of this?

This is probably not a big issue for most games, but for non-game applications it is quite a hindrance. In the same vein, for these types of applications it would also be nice to be able to render (extruded) 3D text.

Am I missing something? Can any improvement in text rendering performance be expected in the short term? If not, what would be the best way to go about implementing a better performing component for Text rendering – perhaps one which “bakes” its text once set?

Well, after looking at the implementation (particularly DrawString3D in TextRenderComponent.cpp) at least it’s no longer surprising that it can be quite slow. I guess I’ll have to create a new class for my use case, which buffers the rendered text in a texture and only redraws it when it changes.

Hi there,

yes, I got the same problem here. Especially rotating them is incredibly slow.