To correctly set this up, choose setEGLConfigChooser(true) or simple do not call the function.
_______________________________________________________________________________
Hello, my name is Nick and I'm new to this forum. Hopefully this will help me to learn OpenGL and Android!
Lately I've had problems with depth testing in opengl (only with rectangular primitives oddly enough).
So I have a texture cube. And for some reason only the insides of the cube appear, meaning that the external faces are culled. Why these are culled I believe has to do with depth testing.
FYI: I have not messed around with culling settings. I'm using the defaults which means nothing will cull. (Both faces of a normal are seen).
So even though It can't be culling, theoretically it shouldn't be depth testing either. On other applications I made (that have no errors with depth), I follow the same procedure:
First I set up depth clearing like such:
- Code: Select all
gl.glClearDepthf(1);
gl.glClear(GL10.GL_COLOR_BUFFER_BIT|GL10.GL_DEPTH_BUFFER_BIT);
Next I enable depth testing:
- Code: Select all
gl.glEnable(GL10.GL_DEPTH_TEST);
So theoretically this should work since it does with my non-Android applications.
Another note is that the order of vertices (even though I believe they are correct since they match other apps I made), does not matter. Remember culling doesn't take effect.
Help is greatly appreciated for this. And I hope this helps other having similar problems. After spending some time looking online. I found that this made be some problem with rectangles. (pairs of triangles)
I have other shapes in my scene (a single triangle and a pentagon) that do not interfere with depth testing. They render correctly.
continued to 2nd post...

