#### Archived

This topic is now archived and is closed to further replies.

# ID3DXFont::DrawText = FPS drop 400 -> 275?!?!

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

## Recommended Posts

I''m using ID3DXFont::DrawText method to display some text in my game, but it seems to have a huge performance hit. What i am using it for is displaying the number of frames per second. I also used an external program (FRAPS) to monitor the FPS of my game so i could see what the difference was when i switch it on and off... I was amazed by the results, it seems that my FPS without drawing the font is 400. While when i switch the font back on it, i get an FPS of 275.. I am sure its the ID3DXFont::DrawText, because i commented out that line alone, leaving all the fps calculation in there even know it wasn''t being displayed. Has anybody else noticed this? what gives? Would i be better off writing my own class to draw fonts from bitmaps?

##### Share on other sites
quote:
Original post by SpaceDude
I''m using ID3DXFont::DrawText method to display some text in my game, but it seems to have a huge performance hit. What i am using it for is displaying the number of frames per second. I also used an external program (FRAPS) to monitor the FPS of my game so i could see what the difference was when i switch it on and off...

I was amazed by the results, it seems that my FPS without drawing the font is 400. While when i switch the font back on it, i get an FPS of 275.. I am sure its the ID3DXFont::DrawText, because i commented out that line alone, leaving all the fps calculation in there even know it wasn''t being displayed.

That doesn''t mean much. FPS is not linear. You go from 2.5 ms per frame to 3.8 ms. If that''s just overhead that happens once it''s no big deal.
If you go from 100 to 90 fps you''re inclined to say it''s a small decrease in speed. But then you go from 10 ms to 11 ms per frame, almost the same.

##### Share on other sites
Which version of DX are you using? 8 or 9? I ask because the DX8 version of ID3DXFont was incredibly and unusably slow. It''s a lot faster now (and great and easy to use) in DX9.

Dustin Franklin
Mircrosoft DirectX MVP

##### Share on other sites
quote:
Original post by circlesoft
Which version of DX are you using? 8 or 9? I ask because the DX8 version of ID3DXFont was incredibly and unusably slow. It''s a lot faster now (and great and easy to use) in DX9 Summer Update version

| TripleBuffer Software |
| Plug-in Manager :: System Information Class :: C++ Debug Kit :: DirectX Tutorials :: Awesome Books |

##### Share on other sites
Make sure you have the Directx 9 Summer Update too, ID3DXFont was improved in that update.

##### Share on other sites
@IFooBar:
maybe you should try making your posts less subtle

@Jingo:
that''s what IFooBar said

@SpaceDude:
circlesoft is correct, frames per second is NOT a good way of determining your application speed at-a-glance. I find it much more useful to output milliseconds taken (or in my case, microseconds) per frame, which is a much easier to use benchmark.

Chris Pergrossi
My Realm | "Good Morning, Dave"

##### Share on other sites
are they still planning on removing CD3DFONT? I heard they were.

##### Share on other sites
I''m using DirectX 9, i''m not sure about the summer update though... I''m at work now, i''ll check when i get home... thanks!

PS: FrameTime = 1/FPS, so doesn''t really matter what u use as long as u know what it is. Even a drop from 100 fps to 90 fps is ridiculous just for displaying some text.

##### Share on other sites
Well if you have the summer update you can use
ID3DXFont::PreloadCharacters, ID3DXFont::PreloadText or ID3DXFont::PreloadGlyphs
to increase the framerate quite a lot. I had the same problem with the framerate, it was taking up something like 30% of the execution time to draw the fps counter. Its less than 1% now.

quote:
Original post by c t o a n
@Jingo:
that's what IFooBar said

My mistake

[edited by - Jingo on March 18, 2004 9:14:37 AM]

##### Share on other sites
quote:
Original post by SpaceDude
I''m using DirectX 9, i''m not sure about the summer update though... I''m at work now, i''ll check when i get home... thanks!

PS: FrameTime = 1/FPS, so doesn''t really matter what u use as long as u know what it is. Even a drop from 100 fps to 90 fps is ridiculous just for displaying some text.

Considering the work it does, it''s actually pretty reasonable. D3DXFont is a high quality text renderer. If you want to favour speed over quality, then it isn''t a good choice for you.

D3DFont (in the Common directory of the SDK) should be faster while still having decent output quality.

Stay Casual,

Ken
Drunken Hyena

1. 1
2. 2
3. 3
Rutin
18
4. 4
JoeJ
14
5. 5

• 14
• 10
• 23
• 9
• 42
• ### Forum Statistics

• Total Topics
632635
• Total Posts
3007559
• ### Who's Online (See full list)

There are no registered users currently online

×