PDA

View Full Version : Problems with Depth Buffer



Clayton
09-16-2003, 03:28 PM
I'm drawing a large amount of Spheres on the screen, and when I draw them in my standard manner, (Display list for each type, then calls for each of the spheres) everything works great. However, when I cap the spheres for slicing I group each type into a display list, cap that, and then call those display lists for each type. Unfortunately, I require clearing the depth buffer for each of the draws in order to prevent the stencil buffer from drawing the clipped spheres. ***Is there a definitive way to save and load the depth buffer*** so that I can only save the depths that are actually drawn?

mikael_aronsson
09-16-2003, 10:07 PM
glReadPixels

Mikael

roffe
09-16-2003, 10:20 PM
You might also want to look at
WGL_ARB_buffer_region (http://oss.sgi.com/projects/ogl-sample/registry/ARB/wgl_buffer_region.txt) if you're on a windows platform.

With it you can save/restore certain parts of a buffer(color/depth/stencil) into video or system memory.