Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

colinisinhere

blending

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

I know that the blend function glBlendFunc(GL_SRC_ALPHA, GL_ONE); renders the transparency with the alpha value... but how would i inverse it so that the lighter the alpha value is the more it is transparent?

Share this post


Link to post
Share on other sites
Advertisement
maybe i explained it wrong... i have some text i want to show on the screen... i want the text to be black... so... i have black text on a white background... how can i make the white blend away and the black to stay? the function you made didnt work!

Share this post


Link to post
Share on other sites
i would think GL_ONE_MINUS_SRC,

so adding the text over something would be
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC)

no alpha needed

[edited by - rick_appleton on August 18, 2003 11:06:03 PM]

Share this post


Link to post
Share on other sites
Your problem is you''re using an additive blending that''s mostly suitable for "glowing" things and can never darken the background.

I use glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); The font texture is white/grey with an alpha channel. Where the alpha channel is totally opaque, the resulting pixel color is only determined by glColor and the color of the font texture, and not affected by the background. (So setting glColor to black will create black text on whatever background)

Share this post


Link to post
Share on other sites

  • 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!