PDA

View Full Version : Trasparency without blending and alpha



Neelima
06-18-2004, 03:20 AM
Hi All,

I have taken some teapot data and I am trying to render it using OpenGL ES using vertex array. I can see that the teapot is looking trasparent, though I have disabled blending and alpha tests.

Can some one tell me if there is any other reason to see a transparent image. Could the order of the vertices have anything to with this ?

Thanks & regards,
Neelima

hmwill
06-18-2004, 07:18 AM
Is this refering to the reference implementation?

Neelima
06-18-2004, 07:34 PM
Hi,

I've taken the data from the KLimt teapot example and I am using the reference implementation for rendering. I've disabled blending.

The rim of top lid of the teapot is visible when the teapot is rotated upside down also...

Thanks & regards,
Neelima

core
06-19-2004, 04:17 AM
This seems to be a depth test issue.
Have you enabled it?

Neelima
06-20-2004, 09:56 PM
Hi !

I had not enabled the depth test . When I enable it with GL_LEQUAL or GL_GEQUAL as the depth func only part of the teapot is visible. But when I enable GL_NOTEQUAL, most of the teapot is visible with the same trasparency problem.

The same data is working fine in KLimt, the only difference being the commands used in KLimt are Vertex3fv and Normal3fv where as I am using VertexPointer and NormalPointer.

Thanks & regards,
Neelima

core
06-20-2004, 10:54 PM
Set the depth test function to GL_LESS (default):
glDepthFunc(GL_LESS);

Enable depth test:
glEnable(GL_DEPTH_TEST);

and, at every frame, remember to clear the depth buffer (and, if it's your case, color buffer :) )
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

Make you sure that the EGLConfig you are using has a depth buffer.

There's no matter how you are sending geometry data to the GL pipeline: glVertex* or glVertexPointer achieve the same effect.

Regards.

Neelima
06-21-2004, 07:28 PM
Dear Marco !

Thanks a lot :) It solved the problem. I wasnt clearing the depth buffer each time, that was probably responsible for the partial images in the later frames.
Enabling depth test & clearing properly solved the problem.

Thanks again :)

Best regards,
Neelima