I'm struggling to get my depth testing working correctly in an app.
Depth seems to be based entirely on draw order, as seen here: https://www.youtube.com/watch?v=YErS_loJW7w&feature=youtu.be
You can see in the video, the point cloud of Suzanne is in front of the Mesh model, but when rotated it ends up behind it.
I think the code below is everything relevant
// clear the render buffer....
GL.Enable(EnableCap.DepthTest);
GL.DepthMask(true);
GL.ClearColor(Color.Black);
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
// Render main 3d scene
GL.Enable(EnableCap.CullFace);
GL.CullFace(CullFaceMode.Back);
GL.Enable(EnableCap.DepthTest);
GL.Enable(EnableCap.DepthClamp);
GL.DepthFunc(DepthFunction.Always);
GL.DepthMask(true);
I was under the impression that enabling Depth testing would make this work correctly.
What's going wrong?