• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

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

thedavil

Is ID3DXFont faster than CD3DFont with the DX update?

19 posts in this topic

The Subject says it all. Has anyone tested it yet to any extent? -Dave Mandrella thedavil@hotmail.com [edited by - thedavil on September 25, 2003 4:35:21 PM]
0

Share this post


Link to post
Share on other sites
I''ve played with it a bit, and it''s definitely comparable. I haven''t tried it with all the optimizations (don''t save state, use D3DXSprite, etc) though.


Stay Casual,

Ken
Drunken Hyena
0

Share this post


Link to post
Share on other sites
I haven''t tested it yet. But in the previos version, CD3DFont is a LOT faster than ID3DXFont. ID3DXFont, I think, uses mathematical calculations to render the fonts. CD3DFont on the other hand, uses textured quad. And textured quad is definitely faster.
0

Share this post


Link to post
Share on other sites
Yeah, that is how it used to work, but with the DX Summer Update they changed it to work more like CD3DFont and totally took GDI out of the picture, so there was supposed to be a huge speed boost. I just wanted to know if it was possible to use ID3DXFont to render text faster than CD3DFont now that GDI is not being used. Basically a frame-rate to frame-rate ratio under different render options would be nice, but I''d just settle for a general comparison for plain text.

-Dave Mandrella
thedavil@hotmail.com
0

Share this post


Link to post
Share on other sites
Hi guys,

I''m working on doing a test of the new ID3DXFont and then I''ll report my findings.

Pedro Remedios
Hail Storm Studios
0

Share this post


Link to post
Share on other sites
I have exactly the same speed with the new ID3DXFont(summer sdk update) than my own bitmap font class.

BUT, i haven''t optimized ALOT my own bitmap class...

The thing is that ID3DXFont is really fun to play with and alot less problems...

it was time for ms to do this...

0

Share this post


Link to post
Share on other sites
I was very interested in this myself - there are some areas where I''m currently relying on CD3DFont.

I was able to do a quick implementation in my existing app using ID3DXFont - my results seem in line with Drunken Hyena''s comments. I basically threw d3dxfont and cd3dfont calls on top of my existing rendering (as if showing debug status/etc). I used 9 calls to DrawText, each call rendering about 70 characters.

While less than scientific, my results were:

* No font rendering = 166fps
* CD3DFont = 127fps
* ID3DXFont = 112fps

Using no other rendering (just clearing the screen each frame):

* No font rendering = 333fps
* CD3DFont = 205fps
* ID3DXFont = 170fps

Hopefully Pedro will do a more intensive test . This test was pretty simple and lacked variety.

0

Share this post


Link to post
Share on other sites
Was that test using the summer update? It''s been greatly improved.

The biggest boost you could get is using the D3DXSprite. It has to create a D3DXSprite object every call if you don''t. Also, Sprite will cache the calls and sort things by texture if you create it that way (drawing actually happens in Flush() or End()) so using the Sprite is a big improvement, especially if you have several font objects running through the same sprite.

Incidentally, it still uses GDI, but only to create the font bitmap, so only when you create it.

I like pie.
0

Share this post


Link to post
Share on other sites
I have a kinda of dumb question, what is the summer update?? If I knew what i was i could help you, but currently my computer never fully installs DX v9.0(a or b i have tried them both) It keeps stalling up when it is copying the file "qasf.dll". I know this should belong in another topic but just wanted to slide it in(hehe).

A REAL question: What else is in the summer update? Is there a new HLSL tutorial? (I would go to microsoft.com but when they designed Windows, they forgot to add a USER-friendly site as well)

This confused person is gonna hit you where it hurts, you programmer (THE HANDS!!!)
0

Share this post


Link to post
Share on other sites
quote:
Original post by RenderTarget
Was that test using the summer update? It's been greatly improved.

The biggest boost you could get is using the D3DXSprite. It has to create a D3DXSprite object every call if you don't. Also, Sprite will cache the calls and sort things by texture if you create it that way (drawing actually happens in Flush() or End()) so using the Sprite is a big improvement, especially if you have several font objects running through the same sprite.

Incidentally, it still uses GDI, but only to create the font bitmap, so only when you create it.

I like pie.


What do you mean when you say
quote:
The biggest boost you could get is using the D3DXSprite.


For some reason my documentation didn't get an update...either that or they hid the new information on this class pretty well.
Is it related to the three methods?:

ID3DXFont::PreloadCharacters
ID3DXFont::PreloadGlyphs
ID3DXFont::PreloadText
USAGE:
MyFontObject.PreloadCharacters(a,Z);
MyFontObject.PreloadGlyphs(a,Z);


The third looks to be only for strings, so while it may help for pre-loading I don't think it will help in real-time.

There's also this:
quote:

The ID3DXFont and ID3DXSprite interfaces now have more options to improve font rendering performance and to control sprite buffer storage and transformations. Also see available sprite rendering options in D3DXSPRITE.


But it doesn't get specific :-/

-Dave Mandrella
thedavil@hotmail.com

EDIT: Stupid Smilies

[edited by - thedavil on September 25, 2003 8:33:43 PM]
0

Share this post


Link to post
Share on other sites
The Direct X summer update is just that...an update for the Direct X SDK. Check out the news on this site (gamedev.net)

I'm not positive, but you can probably install the new update without having the SDK already installed. It appears to have all the Libs and Includes there.

Here's the only info I found on HLSL:
quote:

HLSL Flow Control
The high-level shader language (HLSL) shader model has been extended to cover static and dynamic flow control and predication. This support will allow more complex shaders to be developed in HLSL. For more information, see Flow Control.


quote:

HLSL Workshop
The high-level shader language (HLSL) Workshop is a set of tutorials that make it easy to learn how to generate HLSL shaders.



So yeah there are some tutorials for ya.

-Dave Mandrella
thedavil@hotmail.com

Oh, and if you don't get an error or "Application Not Responding" message when it stalls then just wait until you get a message or it completes. Patients is a virtue as they say. If all else fails just find that DLL and delete it (you'll probably need to close some programs) then try installing again.


[edited by - thedavil on September 25, 2003 8:45:55 PM]
0

Share this post


Link to post
Share on other sites
Whoops... I didn''t mean "HLSL tutorial", I meant HLSL compiler. I think i read somewhere that there will be a new one or at least updated. Is that true?
0

Share this post


Link to post
Share on other sites
quote:
Original post by RenderTarget
The biggest boost you could get is using the D3DXSprite. It has to create a D3DXSprite object every call if you don''t.

Acutally it doesn''t create a D3DXSprite object each time, it uses an internal one. But it''s less optimal than using your own because it has to call D3DXSprite::Begin and D3DXSprite::End each time you call DrawText. Also, if you set up your own D3DXSprite you can control whether states need to be saved and things like that which can also improve performance.



Stay Casual,

Ken
Drunken Hyena
0

Share this post


Link to post
Share on other sites
quote:
Original post by thedavil
What do you mean when you say
quote:
The biggest boost you could get is using the D3DXSprite.





The first parameter to D3DXFont::DrawText is a D3DXSprite object that it uses to optimize the rendering. If you set it to NULL, it uses an internal one which is very fast, but not as fast as it could be.


Stay Casual,

Ken
Drunken Hyena
0

Share this post


Link to post
Share on other sites
Ok, I see it now:
quote:

To improve efficiency, a sprite object should be specified if ID3DXFont::DrawText is to be called more than once in a row.


I wish they had a tutorial for this stuff
Now...here''s a tough question: How to make the sprite object as efficient as possible for dynamic text?

What I''d like to do is make a character map (using only characters on the keyboard) with a pointer (array) to each letter and from there build my strings on top of a sprite as textures (or a faster way if anyone knows one (Grouping Sprites perhaps)).

In my situation I am going to have a lot of Dynamic Text to work with, so simply creating the Sprite with the string won''t do. Do you think I''d be better off doing it this way, or just letting ID3DXFont handle it and set the param to NULL???

-Dave Mandrella
0

Share this post


Link to post
Share on other sites
The ID3DXSprite interface handles the *drawing* of sprites. ID3DXFont makes use of ID3DXSprite to draw the individual glyphs.

If you specify your own sprite object when calling DrawText, you are in control of when the sprite''s Begin and End methods are called. This allows you to call DrawText multiple times between Begin and End.. which can save the device alot of work saving and restoring state, etc.

When calling Begin on your sprite object, there is a flag parameter which specifies how you want the sprite object to behave. If you are drawing 2D text, you will probably want to use D3DXSPRITE_ALPHABLEND | D3DXSPRITE_SORT_TEXTURE as flags.

xyzzy
0

Share this post


Link to post
Share on other sites
Sprite rocks after this update.
I always told people not to use it, because of the lack of alpha blending/testing(couldnt turn off after colorkey made).
But now.. it''s been upgraded faster, better, easier

Sprite::Begin( flags ) rocks

.lick
0

Share this post


Link to post
Share on other sites
Hi Guys,

Sorry about the delay. As for the test, all I did was run the Text3D sample from the summer update. The results were more or less the same as those of chdennis. I believe that a game will never have more than the equivalent of 3 lines of text per game screen. If anybody disagrees please say so! My opinion is based on the games I''ve played.

Now I can use ID3DXFont instead of bitmap font creator because previously, CD3DFont was not antialiasing the fonts and ID3DXFont was but it was tooooo slow. But now that it''s faster (100% boost!!!!! From 50 fps to 120 fps!) I have no more worries about text in my engine.

Well I''m off to the gym. See yas!

Pedro Remedios
Hail Storm Studios
0

Share this post


Link to post
Share on other sites