Jump to content
  • Advertisement

Archived

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

LiquidLight

OpenGL OpenGL font engine speed

This topic is 5357 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello! I''ve implemented a litte OGL wrapper for FreeType font rendering engine. Currently for the font rendering I''m not using textures but I''m using bitmaps copied from system memory directly to video memory. I''m not completely satisfied with performace of my string rendering routine (~400fps without, ~200fps with ~100 chars 16x16, quite a performance hit!). A sure speed up is using quads and texutres, but I''m not sure to have pixel perfect alignment of pixels due to UV interpolation, so before rewriting everything I wanted to know if some one has already solved this problem and how. Thanks. Michele

Share this post


Link to post
Share on other sites
Advertisement
When framerates are high, a miniscule increase in frame time means a massive drop in framerate.

If you dropped from 60fps to 30fps, I would worry about it. As it is now, 200 fps is pretty darned high.

Share this post


Link to post
Share on other sites
quote:
A sure speed up is using quads and texutres, but I''m not sure to have pixel perfect alignment of pixels due to UV interpolation, so before rewriting everything I wanted to know if some one has already solved this problem and how.
Thanks.


Almost all the engines I''ve seen use textures and quads or tristrips. Sure, it won''t be pixel perfect, but is text the center of the game? I''m sure it depends on the level of text in a project though. I get good results using glOrtho() and font textures with nigh a performance hit.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by LiquidLight
A sure speed up is using quads and texutres, but I''m not sure to have pixel perfect alignment of pixels due to UV interpolation, so before rewriting everything I wanted to know if some one has already solved this problem and how.


Of course you can get pixel perfect alignment. You have to understand how OpenGL treats subtexel coordinates in relation to screen subpixel coordinates. This is described in the OpenGL specs, chapter 3: "A fragment is located by its lower left corner, which lies on integer grid coordinates. Rasterization operations also refer to a fragment''s center, which is offset by (1/2, 1/2) from its lower left corner (and so lies on half-integer coordinates)."

If you know that bilinear subtexel interpolation will always work from the texel center outwards, then you can adjust your texture and screen coordinates to be perfectly aligned. You won''t get any interpolation artifacts, and get a pixel perfect representation of your bitmap, just as if you copied it into the framebuffer.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Deyja
When framerates are high, a miniscule increase in frame time means a massive drop in framerate.

If you dropped from 60fps to 30fps, I would worry about it. As it is now, 200 fps is pretty darned high.


when i draw nothing, i get ~ 3500 fps ... and when i draw nothing + my console, it drops to 2000 fps :D ( 1/3 of the screen renders text)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!