Mr J
12-02-2005, 12:25 PM
I have this simple code
void display(void) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDepthMask(GL_TRUE);
glDisable(GL_BLEND);
draw_opaque_geometry();
glDepthMask(GL_FALSE);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); draw_translucent_geometry();
glutSwapBuffers();}
It is working nicely, but I have some questioned but I don't really understand, I hope you can help me ...
Let say, the opaque object is a cone and the translucent object is the tube/cylinder. Actually, there is a list of cone and cover with the tube. Now, I want to play with the opacity of the object. Firstly, I changed the opacity of the tube and it is look good. so, I can see the cone inside properly. Secondly, I want to change the opacity of cone then it does not look like transparent because the cone was changed but it is not transparent like white color. Can you tell me what is the problem about ?
void display(void) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDepthMask(GL_TRUE);
glDisable(GL_BLEND);
draw_opaque_geometry();
glDepthMask(GL_FALSE);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); draw_translucent_geometry();
glutSwapBuffers();}
It is working nicely, but I have some questioned but I don't really understand, I hope you can help me ...
Let say, the opaque object is a cone and the translucent object is the tube/cylinder. Actually, there is a list of cone and cover with the tube. Now, I want to play with the opacity of the object. Firstly, I changed the opacity of the tube and it is look good. so, I can see the cone inside properly. Secondly, I want to change the opacity of cone then it does not look like transparent because the cone was changed but it is not transparent like white color. Can you tell me what is the problem about ?