PDA

View Full Version : transparency



developman
10-31-2000, 03:34 AM
hi guys, i would like to draw a double sized quads with alpha component.
My problem is that my quad is just transparent in one side http://www.opengl.org/discussion_boards/ubb/frown.gif

i do:

glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glDepthFunc(GL_LESS);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glBegin(GL_QUADS);
glColor4f(0.5f, 0.5f, 0.5f, 0.5f);
glVertex3fv(First);
glVertex3fv(Second);
glVertex3fv(Third);
glVertex3fv(Fourth);
glEnd();

I thought that if i used the front and back polygonmode, it should work ???

Thanks for u'r help

edotorpedo
10-31-2000, 03:44 AM
Try setting glDepthMask to false, before you draw your quad.
After you have drawn the quad, you can set it back to true again.

I think this works, but I'm not sure.

Edo

developman
10-31-2000, 03:48 AM
I have tried but it doesn't work too ...
I tried glDephtMask(0) before the code i sent and glDephtMask(1) after...

Any other suggestion ?

jc
10-31-2000, 04:59 AM
test

10-31-2000, 08:49 AM
where is the alpha func defined ......

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);


?

Michael Steinberg
11-02-2000, 04:00 PM
Well, if its just invisible from one side, try to
glDisable( GL_CULL_FACE );
or something in that why. Perhaps that will help you out.

jc
11-02-2000, 09:58 PM
I think u must use two quads, because one quad has one normal and when u light a scene, it's with normals...