Jump to content
  • Advertisement
Sign in to follow this  
hury

Text blending

This topic is 3710 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, is it possible to make Text transparent? My Text output method looks like this: glutBitmapCharacter (GLUT_BITMAP_HELVETICA_10, s); Alex

Share this post


Link to post
Share on other sites
Advertisement
I don't know GLUT that well, so I can't comment on how to do it with GLUT.

But without GLUT it would just be a matter of texture combine modes.

What I do is: Use a color for the character quad that represents the color of the character as well as the transparency/opacity along with a greyscale texture that basically gives you the character. At render time the quad color is modulated with the texture, so if I use opaque red = (1, 0, 0, 1) the final color would be :

color = tex * 1, 0, 0, i.e. a shade of red
alpha = tex * 1, i.e. the texture alone defines the opacity

If I used half-transparent red = (1, 0, 0, 0.5) the final color would become:
color = tex * 1, 0, 0, i.e. a shade of red
alpha = tex * 0.5, i.e. the text is fully transparent where the texture is and half-transparent where the texture is fully transparent

From this thread I learn that using glColor influences the color of the drawn character, so using glColor4f(...., alpha) should work.

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!