Jump to content
  • Advertisement
Sign in to follow this  

transparency question

This topic is 4264 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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!