depth buffer

Two questions…

  1. Is there anyway to read directly from or write directly to the depth buffer. In particular I would be using a GeForce card, ie. hardware accelarated and not software implementation.

  2. Is there any way to increase the resolution of the depth buffer. I have heard of this w-buffer as opposed to a conventional z-buffer. This is supposed to give greater resolution at greater distances. (does it?) Is it possible to implement this under hardware accelarated OpenGL? My problem is polygon depth fighting with each other when close to each other at great distances. I need more resolution at a greater distance.



1/ drawpixels/readpixels with GL_DEPTH_COMPONENT
also you can draw the geometry with glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE)
so nothing gets drawn , but the depth info gets written

  1. Depending on what your scenes look like, this might be of some use:
  • Tom

Quick FIX:
Use glScalef(0.3, 0.3, 0.3) before positioning your camera and rendering your scene.
And use glEnable(GL_NORMALIZE) to keep the normals…normal. (I know it’s slow, but it helps).

This will allow you to have much larger scenes without the problems with the z-buffer, because in the world of opengl it will actually be a very small scene, but very dense.