I have been working on a model editor for the last 4 months and have OpenGL doing all of my rendering. I have used a 16-bit depth buffer because it runs considerably faster than a 24 or 32 bit depth buffer. I have made the zNear, zFar clipping planes equivalent to 2x the Models radius on either side of the model with zNear never going under 1.0 and zFar never getting closer than 10.0 + zNear. Here is my problem.
When rendering rather large models. Radius of over 100 units, I’m seeing the swimming effects on touching polygons. I realize why this happens and I have searched on a way to alleviate this, but most suggestions seem to hint that the only way to solve the problem would be to make zNear,zFar as close to the model is possible(done that), and that setting your Depth Buffer to a higher bit depth(would make a considerable performance hit), so I got to checking out various ways of setting the zNear,zFar clipping planes and came across this function-
void glDepthRange(GLclampd znear,GLclampd zfar)
Is this simply a quick and dirty method of changing the zNear,zFar clipping region? or something else entirely.
If someone knows if this or another way of changing the zNear,zFar clipping planes that is quick(i.e., not using a glPerspective call) and can be done while rendering, then I thought I could draw each Sub-Model(part of the model) seperately enclosing it in a zNear,zFar clipping region the size of the Sub-Model, thus increasing the Z buffer accuracy without hindering performance.