next up previous contents
Next: 5 Occlusion Culling Up: 4 Geometry and Transformations Previous: 4.8.6 XOR Highlighting   Contents

4.9 Foreground Object Manipulation

The schemes for fast redrawless highlighting can be generalized to allow a limited form of manipulation of a selected depth buffered object (a foreground object) while avoiding full scene redraw. The main idea is that the entire scene except for the foreground object is drawn updating the color and depth buffers and copies of the depth and color buffers are made. Each time the foreground object is moved or modified, the back buffer and depth buffer are initialized using the saved copies and the foreground object is drawn as normal and is depth buffered .

This image-based technique is similar to the algorithm described for compositing images with depth in Section 8.7. In order for it to work it requires a method to efficiently save and restore the color and depth images for an intermediate form of the scene. If aux buffers or stereo color buffers are available these can be used to store the color buffer (using glCopyPixels()) and the depth buffer can be saved to the host, or if present, to a pixel buffer (PBuffer). Pbuffers are described in Section 13.1.5. It is particularly important that the contents of the depth buffer be saved and restored accurately. If some of the depth buffer values are truncated or rounded during the transfer, then the resulting image will not be the same as that produced by drawing the entire scene.

This technique works best when the geometric complexity of the scene is very large - so large that the time spent transferring the color and depth buffers is small compared to the amount of time that would be necessary to render the entire scene.


next up previous contents
Next: 5 Occlusion Culling Up: 4 Geometry and Transformations Previous: 4.8.6 XOR Highlighting   Contents
2001-01-10