Next: 2.3.5 Stereo Up: 2.3 Ancillary Buffers Previous: 2.3.3 The Accumulation Buffer

3.2 Double Buffering

Double buffering means having two sets of image buffers, one front visible buffer and another back non-visible buffer. Unlike simple 2D, 3D images may take substantially more time to generate. And depth, alpha, and accumulation buffers all mean that the image being drawn at any moment might be quite different from the final image. It would be quite distracting for the viewer to see each scene while it was ``under construction'' and would destroy the illusion of a smoothly animated scene. Double buffering allows for one image to be rendered while another is being displayed.

OpenGL supports this notion. The glDrawBuffer routine can be used to determine to what buffer primitives should be drawn. A window system specific routine is available to make the back buffer visible.

Double buffering is often achieved by rendering the non-visible image buffer into memory and then quickly copying the buffers contents to screen memory. A better alternative is to build hardware that actually supports two sets of image buffers. Then the cost of a buffer swap can be extremely low since no data has to be copied. Instead, the video controller can just change to scanning image pixels out of the other buffer.


mjk@asd.sgi.com
Wed Oct 19 18:06:42 PDT 1994