Jump to content
  • Advertisement
Sign in to follow this  
KeeperMustDie

How to make transperent texture with mask?

This topic is 4256 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, can somebody show me how to make transperent texture with mask? Look here http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=20 this is how I rendering my texture. But when I using glColor4f(1.0f, 1.0f, 1.0f, 0.2f) it dosent works! Plz help!

Share this post


Link to post
Share on other sites
Advertisement
To make a transparent texture with a mask, you make your texture 32 bits (RGBA), then you define the alpha for each pixel in the "fourth" color byte (alpha, 0 is fully transparent, 255 is fully opaque), then before rendering your texture you code

glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA)

You have a lot of ways to combine your texture with the background color, this is done with glBlendFunc.

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.

GameDev.net 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!