Frame buffer

From DmWiki

The frame buffer is a collection of buffers that correspond to what the user of a 3D application sees on the screen. It will be the size of the whole screen for full-screen applications, or the size of the window for windowed applications.

Although the user sees only the color of each pixel, the frame buffer actually stores much more information than this. A typical frame buffer contains the following:

  • Color buffer - this stores the RGB color of each pixel, and may also store an A (alpha) component, called the destination alpha.
  • Depth buffer - stores the depth of each pixel.
  • Stencil buffer - stores a numeric value at each pixel with an application-defined meaning.

Additional buffers may include an accumulation buffer and one or more auxiliary buffers, although these are not often used.

Typically, an application maintains at least two separate frame buffers - a technique called double buffering. While one frame buffer is displayed on the screen, the application renders to the other. Then the two are switched, so that the newly rendered image is displayed while the application renders a third frame. This reduces flicker, for if a single frame buffer was used the user would be able to see each frame being drawn. Some applications may have three or even more frame buffers (triple buffering); this improves the smoothness of animation at the cost of a little bit of lag in the controls.


DevMaster navigation