next up previous contents
Next: 4.9 Foreground Object Manipulation Up: 4.8 Picking and Highlighting Previous: 4.8.5 Highlighting   Contents

4.8.6 XOR Highlighting

Another efficient highlighting technique is to overdraw with an XOR logic operation. An advantage of using XOR is that the highlighting and restoration operations can be done independently of the original object color. The most significant bit of each of the color components can be XORed to produce a large difference between the highlight color and the original color. Drawing a second time restores the original color.

A second advantage of the XOR method is that depth testing can be disabled to allow the non-visible surfaces to poke through occluding objects. The highlight can be later removed without needing to redraw the occluders.

One should also be careful of interactions between the picking and highlighting methods. For example, a picking mechanism that uses the color or depth buffer can not be mixed with a highlighting algorithm that relies on the contents of those buffers remaining intact between highlighting operations.

A useful hybrid scheme for combining color buffer tagging with locate-highlight on visible surfaces is to share the depth buffer between the picking and highlighting operations and to use the front color buffer for highlighting operations and the back color buffer for locate operations. Each time the viewing or modeling transformations change, the scene is redrawn updating both color buffers and locate-highlight operations are performed using the same buffers until another modeling or viewing change requires a redraw. This type of algorithm can be very effective for achieving interactive rates for complex models since very little geometry needs to be rendered between modeling and viewing changes.


next up previous contents
Next: 4.9 Foreground Object Manipulation Up: 4.8 Picking and Highlighting Previous: 4.8.5 Highlighting   Contents
2001-01-10