Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Performance issue with D3DXFont DrawText

88 views
Skip to first unread message

listechtony

unread,
Dec 2, 2009, 8:21:01 PM12/2/09
to
I am using

D3DXCreateFont to create a D3DX Font then calling DrawText to render some
text. It works fine when the amount of text to display is not great, but I am
displaying millions of points and they all some text associated with them.
Therefore I have the DrawText function in a for loop and it is being
performed millions of times. Sure, on the screen, the text can merge together
and being unreadable, but that is another issue. It is taking about 50
seconds to render 2 million pieces of text.

What is the most efficient way I can render millions of pieces of text in
Direct3d 9.0?

Chuck Walbourn [MSFT]

unread,
Dec 3, 2009, 5:21:24 PM12/3/09
to
The most efficient way to render text is to not render it. Can your user
really see all millions of characters at the same time?

You might also want to look at the new DirectWrite API which is part of the
DirectX 11 Runtime for such a text-heavy application.

--
--
-Chuck Walbourn
SDE, XNA Developer Connection

This posting is provided "AS IS" with no warranties, and confers no rights.

listechtony

unread,
Dec 3, 2009, 5:38:03 PM12/3/09
to
I understand your point, and that is a question we need to ponder. Firstly
though, we need the options available to us. We have decided to use Direct 3d
9.0 for now, since many of our users are still on XP with older cards. So
bearing that in mind, what do you recommend.?We currently use GDI, to render
our app and note that using GDI is actually faster to render these million
pieces of text than DirectX, D3DXFont. Does that make sense to you?

Chuck Walbourn [MSFT]

unread,
Dec 3, 2009, 6:10:24 PM12/3/09
to
D3DXFont is intended to put horizontal text on Direct3D applications as
debug overlays or a game HUD. It really is not intended for dumping millions
of lines of text to the display. GDI is probably a better choice for that if
Direct2D/DirectWrite is not an option.

Richard [Microsoft Direct3D MVP]

unread,
Dec 7, 2009, 2:02:50 PM12/7/09
to
[Please do not mail me a copy of your followup]

=?Utf-8?B?bGlzdGVjaHRvbnk=?= <liste...@discussions.microsoft.com> spake the secret code
<41288B1D-2219-4F4C...@microsoft.com> thusly:

It sounds like you are labelling points. Are many of the labels
identical? If so, you can do better than ID3DXFont by caching the
text rendering to a texture and drawing a textured quad for the
repeated text.
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

Legalize Adulthood! <http://legalizeadulthood.wordpress.com>

0 new messages