D3DXText |
Sr. Guapo | 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 | Use custom text with bitmap fonts? |
Sr. Guapo | Maybe... I could give it a try
PS - Wow, that was fast! |
VBBR | 2 minutes from each post to the following... wow.
Really a coincidence, I was just hoping around here and your topic showed [:)] |
EACam | 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 | 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... |
masterbooda | 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... |
Sr. Guapo | I only create the font once, but I could check the second part (about the rect size)... Thanks |
EACam | Custom rendering is faster? Really? |
Sr. Guapo | 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 | 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... |
Almar Joling | 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) |