Jump to content
  • Advertisement
Sign in to follow this  
DerekBaker

Fastest font engine

This topic is 4468 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!