about zbuffer |
Author :
kittykx
Post Date :
2006-09-26 05:49
Posts :
6
|
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
|
Author :
grant
Post Date :
2006-09-26 20:43
Posts :
117
|
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 |
Author :
kittykx
Post Date :
2006-09-27 01:21
Posts :
6
|
Ok,Thank you for your help
|
All Rights Reserved, © Zeus Communications, Multimedia & Development 2004-2005