Jump to content
  • Advertisement
Sign in to follow this  
Dirge

OpenGL Fonts w/ single channel

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

So I'm writing my font renderer for a low level embedded system which uses OpenGL ES and I have a slight dilemma I thought I'd pick your brains about. I'm exporting bitmap fonts uncompressed as tga and I'd like to save on the memory (for obvious reasons) by using a single-channel texture as opposed to 4-channel rgb). Now the problem is how do I render the text so it won't have a black border? Initially I solved this by changing the blend function to src color, inv src color, but this creates a problem for me if I did want to actually change the transparency of the text on the fly (via vertex color for ex. fading text). The solution seems to be to store all white in rgb and the glyphs in alpha but once again, the problem becomes memory. So how can I render properly blended text from a single channel texture while still allowing separate alpha blending to occur. Thoughts? p.s. I don't believe glBlendColorEXT is supported :-/

Share this post


Link to post
Share on other sites
Advertisement
If the font glyphs are stored as an 8-bit value, you should be able to use Add as the color op on the sampler, and keep the multiply by vertex color to enable you to color and alpha the text.

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.

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!