Jump to content
  • Advertisement
Sign in to follow this  
ViperG

Masking with Alpha Layer and Blending Black

This topic is 4867 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'm masking with the Alpha Layer, so I can Blend a texture on top of another These are the steps I'm Taking: 1)Turn On Alpha Buffer Drawing by using glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 2)Draw Space ship into the screen buffer and Alpha Buffer 3)Modulate Damage texture with Alpha Buffer using glBlendFunc(GL_DST_ALPHA, GL_ONE); Now here are some screen shots and some problems: Now this is as good as I can get it. Unfortunetly, I wan't to blend black not white as the picture shows. This is what happens when I have a second ship on the screen. Notice that both ships are drawing into the alpha buffer, so it draws the decals on both ships. After step 3, I want to clear the alpha buffer for each ship. On here, between steps 2 and 3 IF I add the following line: glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); I get this:

Share this post


Link to post
Share on other sites
Advertisement
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!