Menu
Forums
Login | Register

Home > Forums > OpenGL ES > about zbuffer Page :  1 
about zbuffer
Hi
I am a beginner about opengles. I have a problem about zbuffer, please help me

I have put below function in my project's init.
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);

But why zbuffer doesn't work.

When I draw two triangles. the program show in the order of draw code, instead of the order of z

Hi,

You need to specify what the depth buffer should be cleared with :

glClearDepth(1.0f);

You also need to make sure you clear the depth buffer at the start of each frame e.g.

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

Regards,
Grant
Ok,Thank you for your help


Home > Forums > OpenGL ES > about zbuffer Page :  1 

You need to be logged in to reply to this topic.


All Rights Reserved, © Zeus Communications, Multimedia & Development 2004-2005

Read the Disclaimer

Links