I am trying a simple case which is testing the depth test on android
2.1 using opengl es2.0

I used:

//--------------------in init funtion
glDepthMask(true);
glDepthRangef (0.0f, 1.0f);

glClearDepthf( 0.0f );
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);


//-------------------in render funtion:

glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
glUseProgram(gProgram);
glActiveTexture ( GL_TEXTURE0 );
glBindTexture ( GL_TEXTURE_2D, texture[0] );
glUniformMatrix4fv(gModelMatrixLoc,1,0,ModelMatrix);
glDrawElements(GL_TRIANGLES,indicesSize,GL_UNSIGNED_SHORT,indices);

the depth test does not work at all. It seems that the system shows
everything in depth of -1.0f to 1.0f in the presenting order. Any idea
why? thanks.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to