hide random home http://www.sgi.com/tech/openGL/paper/subsection3_4_5.html (Silicon Surf Promotional CD, 01/1995)



Next: 4.6 Per-Fragment Operations Up: 4 The OpenGL Pipeline Previous: 4.4 Texturing and Fog

4.5 The Framebuffer

The destination of rasterized fragments is the framebuffer, where the results of OpenGL rendering may be displayed. In OpenGL, the framebuffer consists of a rectangular array of pixels corresponding to the window allocated for OpenGL rendering. Each pixel is simply a set of some number of bits. Corresponding bits from each pixel in the framebuffer are grouped together into a bitplane; each bitplane contains a single bit from each pixel.

The bitplanes are grouped into several logical buffers: the color, depth, stencil, and accumulation buffers. The color buffer is where fragment color information is placed. The depth buffer is where fragment depth information is placed, and is typically used to effect hidden surface removal through -buffering. The stencil buffer contains values each of which may be updated whenever a corresponding fragment reaches the framebuffer. Stencil values are useful in multi-pass algorithms, in which a scene is rendered several times, to achieve such effects as CSG (union, intersection, and difference) operations on a number of objects and capping of objects sliced by clip planes.

The accumulation buffer is also useful in multipass algorithms; it can be manipulated so that it averages values stored in the color buffer. This can effect such effects as full-screen anti-aliasing (by jittering the viewpoint for each pass), depth-of-field (by jittering the angle of view), and motion blur (by stepping the scene in time)[2]. Multi-pass algorithms are simple to implement in OpenGL, because only a small number of parameters must be manipulated before each pass, and changing the values of these parameters is both efficient and without side effects on the values of other parameters that must remain constant.

OpenGL supports both double-buffering and stereo, so the color buffer is further subdivided into four buffers: the front left &right buffers and the back left &right buffers. The front buffers are those that are typically displayed while the back buffers (in a double-buffered application) are being used to compose the next frame. A monoscopic application would use only the left buffers. In addition, there may be some number of auxiliary buffers (these are never displayed) into which fragments may be rendered. Any of the buffers may be individually enabled or disabled for fragment writing.

A particular copy of OpenGL may not provide depth, stencil, accumulation, or auxiliary buffers. Further, only some subset of the left &right front and left &right back buffers may be present. Different buffers may be available (each with varying numbers of bits) depending on the platform and window system on which OpenGL is running. Every window system must, however, provide at least one window type with a front (left) color buffer, and depth, stencil, and accumulation buffers. This guarantees a minimum configuration that a programmer may assume is present no matter where an OpenGL program is run.



Next: 4.6 Per-Fragment Operations Up: 4 The OpenGL Pipeline Previous: 4.4 Texturing and Fog


segal@asd.sgi.com
Fri Sep 23 16:08:14 PDT 1994