Jump to content
  • Advertisement
Sign in to follow this  
Raketenmann

Faster font-rendering through render-to-texture?

This topic is 4617 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

Hi! I'm currently working on a GUI-System and thinking about ways of improving the rendering process. Of course there is a lot of text in a GUI for a game. Some are quiet long, like mission-briefings, some are rather short, like button labels. At the moment, i tried two ways of font rendering, both discribed in the famous NeHe Tutorials lesson 13, which is the bitmap-method lesson 17, which is the 2D Texture font. While using the 2D Texture font, i thought of speeding the rendering up, by render all the texts to a texture and use that texture to display that specific texts again and again. So a text with 800 characters would use 1 quad instead of 800 quads. My way of getting that text to a texture would go via glCopyTexImage2D(..). via the parameters of that function, one can specify the area of the screen that should be copied...alright, but how can you specify the area where it should be rendered to in the target texture? Is it only possible to fill a whole texture with a part of the backbuffer, or is there a way of writing just at a specific area of the texture? Do you think, that this method provides a remarkable speed up? If yes, only for large text? regards, Philipp

Share this post


Link to post
Share on other sites
Advertisement
why not try it and find out?

The function you probably want is infact glSubTexImage() as this allows you to pull a part of the framebuffer out and update a location on a texture.

The Red Book has more details on this..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!