Jump to content
  • Advertisement
Sign in to follow this  
SnAkE

blend multiple textures together

This topic is 4850 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 there, I am trying to understand how the GL_BLEND works, but have some trouble blending a texture on the final scene... here is what i got: - I draw different textures on the screen/blend them together - There are black parts left that I want to fill with a "background-texture" - try to blend this texture to the parts of the screen, where the current color is black and not on the other parts my try was to blend it with "glBlendFunc(GL_ONE, GL_ONE);", that works nice for the black parts, but not for the already drawn parts, because the new texture gets blended with the old ones... do you guys know a way to do it properly? btw: i do have alpha-values available if that helps

Share this post


Link to post
Share on other sites
Advertisement
u need to create an alpha channel + check what parts of the texture are black and set the alpha value to 0 if its not set it to 1
see here for an example of blending
uk.geocities.com/sloppyturds/stuff/opengl_blending.zip

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!