Turning on Depth Buffer makes everything disappear !
I finally got to use textures on Android using OpenGL ES, and I found that its turn I started using the Depth buffer for some proper rendering. The moment I uncommented
gl.glEnable(GL10.GL_DEPTH_BUFFER);
The object disappeared and became invisible. Not even a pixel of the object was visible. Then a colleague of mine gave me a hint about clearing buffers !
Uffff ! I corrected the line
"gl.glClear(GL10.GL_COLOR_BUFFER_BIT);"
--to--
"gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);"
and everything was fine again !
gl.glEnable(GL10.GL_DEPTH_BUFFER);
The object disappeared and became invisible. Not even a pixel of the object was visible. Then a colleague of mine gave me a hint about clearing buffers !
Uffff ! I corrected the line
"gl.glClear(GL10.GL_COLOR_BUFFER_BIT);"
--to--
"gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);"
and everything was fine again !
Comments
Post a Comment