Sr. Guapo
Swordmaster
USA
272 Posts |
Posted - May 16 2004 : 3:51:35 PM
|
Quick Question (I hope) - Is there another way to output text to the screen in DirectX? Usind D3DX, It lowered my framerate from ~600 FPS to almost 200 FPS! I think that's really weird, because each of the 32X32 sprites I'm Rendering only take away 5 to 10 FPS. Can anyone help me? |
|
VBBR
Moderator
Brazil
617 Posts |
Posted - May 16 2004 : 3:53:08 PM
|
Use custom text with bitmap fonts?
|
Whatever. Who knows... |
|
|
Sr. Guapo
Swordmaster
USA
272 Posts |
Posted - May 16 2004 : 3:55:05 PM
|
Maybe... I could give it a try
PS - Wow, that was fast! |
|
|
VBBR
Moderator
Brazil
617 Posts |
Posted - May 16 2004 : 4:48:11 PM
|
2 minutes from each post to the following... wow. Really a coincidence, I was just hoping around here and your topic showed |
Whatever. Who knows... |
|
|
EACam
Warrior
154 Posts |
Posted - May 16 2004 : 8:58:01 PM
|
Umm...if you're getting that kind of frame rate, you're definately not using VSYNC. and when you don't have VSYNC on, little things like that drastically decrease the fps. It's not bad. it's just making it closer to what it would be without VSYNC |
|
|
Sr. Guapo
Swordmaster
USA
272 Posts |
Posted - May 16 2004 : 9:01:42 PM
|
I know... I intentionally shut off VSYNC when I test. It shows me how fast it really runs. I guess that makes some sense though... |
Edited by - Sr. Guapo on May 16 2004 9:02:21 PM |
|
|
masterbooda
Swordmaster
277 Posts |
Posted - May 17 2004 : 12:47:42 AM
|
I had that same problem with my engine.... Are you creating the font on every render call or just once at the begining of the program? Also If I make the rect to output the text, just a little bigger than the text, It was a difference of that magnitude.... kind of wierd but true... But to be totally honest with you make a custom font using a .bmp or .dds file, just like vbbr said... it is alot quicker... DaBooda out...
|
DaBooda Team is back: http://dabooda.789mb.com/ |
|
|
Sr. Guapo
Swordmaster
USA
272 Posts |
Posted - May 17 2004 : 11:28:08 AM
|
I only create the font once, but I could check the second part (about the rect size)... Thanks |
|
|
EACam
Warrior
154 Posts |
Posted - May 17 2004 : 7:39:16 PM
|
Custom rendering is faster? Really? |
|
|
Sr. Guapo
Swordmaster
USA
272 Posts |
Posted - May 17 2004 : 8:54:46 PM
|
I don't know. I just don't feel like investing the time to create my own font though. My life is so busy (Halo)... |
|
|
masterbooda
Swordmaster
277 Posts |
Posted - May 17 2004 : 10:27:58 PM
|
Cunstom rendering is faster because you could just blt every character onto a texture, unless you are updating your text every render pass, then I would suggest text... But I always consider text like the score, or energy to be just a collection of sprites... Yes the speed is sacrificed, but with a custom font, you can work with it a little better, because you know the height and width of every character... but basically it boils down to preference...
But to not get off point here, yes changing the rect did make a big difference... even by subtracting 1 from width I would salvage 100 frames... I would like to know what causes this... any expert help on this subject would be appreciative... |
DaBooda Team is back: http://dabooda.789mb.com/ |
|
|
Almar
Moderator
Netherlands
192 Posts |
Posted - May 18 2004 : 12:49:23 AM
|
In YALg I prepare an array for every character, with the index as keycode I believe.
so font(65) is probably A (or a?) and giving me the right tu/tv coords.
Then a trianglist of 6 verts is created, and appended to the "font string" (which is just for every time I call my Createfontverts)
then all next frames I can simply render the vertex list I have. Remember 50 chars * 6 is already 300 verts. Recreating those every frame is just plain silly. (I also use the "overdim" method often demonstrated by Rag on a Stick on lucky's) |
|
|