Fastest font engine

Started by
5 comments, last by DerekBaker 17 years, 8 months ago
Currently using ID3DXFONT and am losing >8% of FPS just printing "Rendering 2996". I'll be going for bitmaps. Should I use DirectDraw Blt as in an example on found on the web or texturing a sprite? Thanks
Advertisement
First of all, if that is the only benchmark you have done, which im guessing it is, then it isn't a good assumption that D3DXFont is slow. Have you tried writing multiple pieces of text, large pieces of text etc?

Chances are that you wont write one better.

Dave
Also, what else is going on in the scene? If it's just a spinning cube or somthing, then rendering the text is comparitively a lot of work. If you have a full scene, the percentage will be less.
Printing "Number of objects rendered 2996 out of 10000" cuts the speed to ~13% below no text, so it's not linear. But it is clearly too much.

You don't think a pre-bitmapped font could be rendered quicker?
I have 10000 low-poly low-texture models - tiger.x from the SDK - of which 2996 are rendered at the start.
Unless the text changes every frame - render it to a texture and draw the texture.

If it changes every frame -- that's silly, no one can read a single frame char, not to mention more than one.

ID3DXFont isn't very slow, in general. You should only really consider a replacement if you're rendering multiple lines of text that change very frequently.

Lastly, even a "pre-bitmapped font" requires a lock to a buffer, which would likely be a pain for you to get right. Another option is using a modified version of shader instancing, which again, would be a pain to get to run well. Finally, if you write your own, you'll need to take care of all the annoying details like blurred fonts. After all that work, you'll save yourself 2%.

It just isn't worth it.

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.
I'm suprised that ID3DXFont doesn't have a bad rep. The book I have here - Introduction to 3D dfame Programming with DirectX 9.0 by Frank Luna - says that CD3DFont is "much faster".

However I've just found this: http://www.gamedev.net/community/forums/topic.asp?topic_id=182032

[EDIT] Switched to newer version of ID3DXFont and the difference is night and day.
Printing three lines of text, the old version fell 19.7% (going from no text to text), the new version fell only 2.1%. And this for is for the basic unoptimised version - passing 0 for the sprite interface.

Thanks for the replies.


[Edited by - DerekBaker on July 27, 2006 4:56:05 AM]

This topic is closed to new replies.

Advertisement