I guess your performance loss is perfectly acceptable.. A decrease of a thousand frames per second seems a lot, but when you look at it from a mathematical point, it isn't that bad.
I took my calculator to show you why:
So rendering the second label only takes 0.06 ms which is perfectly acceptable if you ask me. Rendering text is usualy slower than rendering quads because under the hood, D3D is rendering a quad for each character (If i'm not mistaking).Rendering 4500 frames per second (= 1000ms), means that rendering one frame takes:
1000/4500 = 0.22 ms
Now.. when your FPS drops to 3500, a frame will render in:
1000/3500 = 0.28ms
This is all theory. If you can optimize your render code, you can get far better performance than 81 FPS. Please note that changing renderstates also takes time. You only have to do this once when rendering those 200 font's.Now when you want to render 200 labels, it would theoraticly take:
0.22 + (200 * 0.06) = 12.2ms
Which results in an FPS of
1000/12.2 = 81 FPS.
Which is still acceptable, if i'm concerned.
Pre-rendering all your labels would give you a speed increase, but i doubt whether it's worth the effort. :?
Bookmarks