Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

torturedfreak

Blending....

This topic is 5371 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''ve used blending successfully in the tutorials but am currently trying to expand on tutorial 10 to allow blending of individual areas of objects - this is working quite well although the objects that are supposed to be solid, although more opaque than those that are supposed to be transparent are still slightly transparent (about 0.7f or 0.8f). The code I''ve used for turning blending on and off for an object is... if(blend){ glColor4f(0.7f,0.7f,0.7f,0.5f); glEnable(GL_BLEND); glDisable(GL_DEPTH_TEST); } else{ glColor4f(0.7f,0.7f,0.7f,1.0f); glDisable(GL_BLEND); glEnable(GL_DEPTH_TEST); } can anyone help??? Andy

Share this post


Link to post
Share on other sites
Advertisement
I am not shure about your code but if the part with glColor4f the 4th # has to be 1 to have no blending and 0 is comleatly trasparent as in its invisable. And with disabling the depth test you don't need that to blend stuff. Thats only used for drawing objects on top of each other no matter if its behide something or not. Like what ever is drawn last will be on the top of what ever that was drawn before that.

edit ooops had got the 1 and 0 mixed up

[edited by - pipes clangor on November 6, 2003 2:48:41 AM]

Share this post


Link to post
Share on other sites

  • 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!