Jump to content
  • Advertisement
Sign in to follow this  
whitedragon101

transparency question

This topic is 4351 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 have tried a couple of blending tutorials for making 3D objects transparent. The main problem is when I try it with a large number of cubes in line (mostly red in colour) the colour becomes white. Is there any way around this?

Share this post


Link to post
Share on other sites
Advertisement
Experiment with different blending equations (glBlendFunc). You problably have a adding equation "GL_ADD" or something like that. Try other equations to achieve better results. Also, consult the Red Book for available constants.

Share this post


Link to post
Share on other sites
My current equation is:

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

which works for a small amount of objects, but once I start to rack up the number of cubes the cumulative colour becomes white.

Share this post


Link to post
Share on other sites
Replace GL_ONE_MINUS_SRC_ALPHA with

GL_ZERO; GL_ONE; GL_SRC_COLOR; GL_ONE_MINUS_SRC_COLOR; GL_SRC_ALPHA; GL_ONE_MINUS_SRC_ALPHA; GL_DST_ALPHA; GL_ONE_MINUS_DST_ALPHA

Now try with these different constants and see what results come out. Again check the redbook on Blending or the OpenGL programming guide.

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!