Originally posted by DFrey: I don’t fully understand what your first question is about, sorry. But for your second question, disable depth writes with glDepthMask(GL_FALSE);
To make you understand the problem just set up your perspective matrix as I do and render a few triangles off in the z distance by about 5000…
I’m trying to figure out a way to turn the distance check off!
It sounds like you are experiencing problems with depth-buffer precision. A couple of options that come to mind are:
minimize the distance between the near & far clip planes, either by bringing the far clip plane closer to your viewpoint or moving the near clip plane out a bit
Originally posted by Mongoose: I’m trying to figure out a way to turn the distance check off!
That can’t be done (the distance check, by the way, is clipping).
Instead, disable GL_DEPTH_TEST and draw the skybox/skydome safely within your near/far clip planes. For example, if you have near and far of 1 and 1000, drawing a sphere of radius 30 is definitely safe.
The depth information is still used for other things, such as fog and perspective correction, but for perspective correction, only the ratios of W values matter, not their absolute values.
Note that disabling GL_DEPTH_TEST automatically turns off depth writes. If you want to write to depth but not test it, you need to enable GL_DEPTH_TEST and set the DepthFunc to GL_ALWAYS, with the DepthMask set to GL_TRUE.