Sign in to follow this  
Raketenmann

Faster font-rendering through render-to-texture?

Recommended Posts

Raketenmann    122
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
_the_phantom_    11250
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this