I recently started to learn how to program ‘pure’ openGl commands and rendering in Java, and I started to fiddle around in 3D space with VBOs and rendering multiple objects from one VBO.
I quickly came to notice one peculiar thing about how not enabling GL_DEPTH_TEST when rendering many 3D cubes in a grid-like formation creates a issue that I had came across with a project on Codea, which makes draworder actually affect the outcome of the scene.
But by simply enabling GL_DEPTH_TEST before all rendering eliminates the issue completely, which concludes, why is this not enabled in Codea by default?
This is how an 2D array of cubes look like with no Depth testing(All cubes are rotated 45 degrees to make them more visible):
http://gyazo.com/7f0f7bddc2e03b32476ddb66bbf016fd
One of those cubes has a green top and 4 white sides.
And this is with Depth testing enabled:
http://gyazo.com/a44c6b2a857f74a3ece3dfa73d100041
It might be hard to see on those images but the latter is how it should look like in the first place.
The Depth testing seems to be the Z depth value thing that openGl checks for each fragment to see if the next one is closer to the camera than the current fragment, and this seems to be disabled by default in Codeas’ openGl context. Am I right? Or is this feature not present on the openGl version that Codea uses?