I am facing a problem on an Android Application using GLSurfaceView.
The problem seems to happen only, when quite alot of objects are drawn.
Although most of the time, the depth test seems to work, there are some positions of the camera, when glitches appear. That is, objects in the back appear infront of nearer objects.
In order to track the problem, i visualized the depths (gl_FragCoord.z) within the pixel shader (z, pow(z,20), pow(z,80)). (the whiter the further away, red = really near)
Here is a combined image to show the problem. (alot of jeeps aligned in a x,z grid with a plane as bottom)
On the left all is working fine. The mid shows the "bug", the right image is the visualization of the fragment.z value for the mid image.

The fragment depths seems to be OK, but not properly used for visibility determination.
Is it possible, that the z-buffer gets corrupt/overflown/deactivated somehow?
Can a low framerate lead to a silent disabling of the depthbuffer?
Z-Fighting does only appear between objects that are near to each other, right? So in general a far away object should still not appear in front of a near one?
I don't know if it is a problem within my camera implementation, an android specific problem, or a general opengl thing.
Any help is appreciated :-)
buddysk
(The quadMesh on the floor is 40x40 centered around 0, near plane 0.1, far plane 100 (problem also appears for nearplan 1, far plane 1000))
(I sometimes notice, that a frame changes between the first draw and the succeeding ones. Is openGL allowed to drop drawing calls? And I "remember" to have once read that it is not guaranteed, that all drawing commands are executed within one batch?! Maybe there are two frames rendered and combined afterwards?! (just a wild guess))









