Advertisement Jump to content
Sign in to follow this  

Masking with Alpha Layer and Blending Black

This topic is 4962 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
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!