Text() ruins my hopes and dreams

Blitz3D Forums/Blitz3D Programming/Text() ruins my hopes and dreams

bytecode77(Posted 2007) [#1]
i suck down from 100 fps to 80 fps if i print some debug&informations on the screen...
i know that this is a known issue. i just wanted to tell.

is there a very easy solution i just dont see, or am i doomed to use my programs with less-20-fps?


b32(Posted 2007) [#2]
Have you tried using a bitmap font ?


GfK(Posted 2007) [#3]
Yes, use bitmap fonts.

TTFs are hideous in games anyway.


_33(Posted 2007) [#4]
use FastText or FastImage.


bytecode77(Posted 2007) [#5]
i'm using bitmap fonts or even 3d bitmap fonts in my games.
for my virtualGL lib i'll maybee implement a font system just like in openGL
thanks for these tips :)
bye


OJay(Posted 2007) [#6]
or draw your text to a masked image and draw that instead of your plain text. using text() once a second to update the image should be fast enough...


_33(Posted 2007) [#7]
I did some test on my rig. A screen with a simple sphere looping with a flip 0, I get 2850 fps with a TEXT instruction saying "FPS: 2850" in small letters. If I use FastImage to display the fps, I get 3000 fps of the same thing. So roughly, I lost 150 fps with a TEXT instruction.

I also did a second test, but with a busy screen. With or without using the TEXT instruction on the busy screen, I got a solid 160 fps, so I lost no frames on my second test.

Using TEXT for a flip 1 won't have ANY influence.

Finally, using TEXT to display your FPS is very convenient if your 3D app is in the lower FPS ranges. If it's hitting 1000+ fps, then obviously TEXT will eat up a couple of them to do what it has to do.


Stevie G(Posted 2007) [#8]
Using TEXT for a flip 1 won't have ANY influence.



... on your setup ;)


bytecode77(Posted 2007) [#9]
hm. thanks for all these replys!
i will implement a bitmap font system to my opengl library!
this will be just like the real openGL


IPete2(Posted 2007) [#10]
_33

What do you get if you dont display the text fps on screen at all?

It would be interesting to know what additional strain any kind of fastimage/bitmapped font causes the cpu.

IPete2.


D4NM4N(Posted 2007) [#11]
If i remember a fast way to do text/2d over 3d in b3d is to have a 3d quad (or a flat cube would do) attached to the camera as a child and with "in-front" entityorder() set. Then scale it so it perfectly fits the camera viewport. Or just the area you need to print to.

Then texture the quad with a createtexture(1024,1024) (for example or just 512x512 for a small screen area :)
Then render the text to the quads texturebuffer rather than to the front/backbuffer. This way you avoid the old 2d over 3d problem on some cards.

It doesnt look as good as 2D on 3D but is much faster and is great for simple scoreboards/debug etc.

Check out the radar and meters in these screens, they use 2 separate 'hud' quads. The score text is just a bitmap font similar to described by the others above: