Sign in to follow this  
biohazard_prod

Transparent Font

Recommended Posts

Been toying with this problem for three days now and still no solution. I decided to do texture mapped fonts (dumped raster fonts, too damn slow). Each font is a 256x256 texture with white characters on black background. The broblem is I want to do more than simple masking. I want transparent fonts. And this is giving me some headaches. I've tried everything but I couldn't get the damn effect I was looking for. If I mask, I can't get transparency, if I use simple blending I can't get solid color. Any ideea ? PS: I use the font texture as a mask too. Managed to do masking by rendering twice, once with (GL_ZERO, GL_ONE_MINUS_SRC_COLOR) and once with (GL_ONE, GL_ONE)
Edit by Fruny: Gave a meaningful title to the thread. [Edited by - Fruny on March 11, 2006 10:39:15 AM]

Share this post


Link to post
Share on other sites
In the font texture, load the glyph information into the alpha channel and set RGB channels to max (white) (Simple paint programs won't show you the image correctly, just plain white, use tools like DX Texture Tool to view the alpha channel).

While rendering the font enable texturing and blending (which I think you are already doing) and set TexEnv to GL_MODULATE.

Set the color to whatever you desire(rgb and alpha) before you draw your glyph triangles.

This should work.

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