Advertisement

Blending....

Started by November 05, 2003 07:27 PM
0 comments, last by torturedfreak 21 years, 4 months ago
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
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]
---------------------------The pipes clangor all the time.

This topic is closed to new replies.

Advertisement