elroy
06-20-2000, 09:04 AM
I have a couple of questions on the depth buffer.
First, explanation of what I'm doing. Nothing special really. I have a mesh that I'm using to display a random terrain. Basically x and z are a fixed grid with y being a hieght map. I have done this before on other applications and it has worked correctly. The difference here is the coordiante system is quite large. The range of x and z is around 1 million, but the mesh is quite reasonable 40x40 grid. The problem is it appears that on the edge of the grid the z buffer isn't working.
Also just to clarify, I use
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glDepthFunc(GL_LEQUAL)
(I've also tried GL_LESS).
So my questions.
What does gl use to normalize the z values? What i'm doing isn't any different than I've done before but I've always used a smaller coordinate system. Does GL use the near and far clipping planes to normalize the z value in the buffer? I know that the z buffer can vary between 0 and 1.0.
The effect I see isn't the case of adjacent pixels overriding each other. It is more a case of triangles that are several grid units apart overwriting each other.
Any thoughts or ideas would be appreicated.
First, explanation of what I'm doing. Nothing special really. I have a mesh that I'm using to display a random terrain. Basically x and z are a fixed grid with y being a hieght map. I have done this before on other applications and it has worked correctly. The difference here is the coordiante system is quite large. The range of x and z is around 1 million, but the mesh is quite reasonable 40x40 grid. The problem is it appears that on the edge of the grid the z buffer isn't working.
Also just to clarify, I use
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glDepthFunc(GL_LEQUAL)
(I've also tried GL_LESS).
So my questions.
What does gl use to normalize the z values? What i'm doing isn't any different than I've done before but I've always used a smaller coordinate system. Does GL use the near and far clipping planes to normalize the z value in the buffer? I know that the z buffer can vary between 0 and 1.0.
The effect I see isn't the case of adjacent pixels overriding each other. It is more a case of triangles that are several grid units apart overwriting each other.
Any thoughts or ideas would be appreicated.