Frame buffers: Color, depth, and stencil. You can find real good explanation of this topic in chatper 10 of the free OpenGL red book

satya - Fri Aug 31 2012 14:34:08 GMT-0400 (Eastern Daylight Time)

opengl stencil buffer

opengl stencil buffer

Search for: opengl stencil buffer

satya - Fri Aug 31 2012 14:38:48 GMT-0400 (Eastern Daylight Time)

what is a stencil buffer from wiki book

what is a stencil buffer from wiki book

satya - Fri Aug 31 2012 14:43:14 GMT-0400 (Eastern Daylight Time)

More on stencil buffer an article at livejournal

More on stencil buffer an article at livejournal

satya - Fri Aug 31 2012 14:45:16 GMT-0400 (Eastern Daylight Time)

the two functions


glStencilFunc
glStencilOp

satya - Fri Aug 31 2012 14:53:45 GMT-0400 (Eastern Daylight Time)

This is a real good explanation of buffers

This is a real good explanation of buffers

satya - Fri Aug 31 2012 14:55:44 GMT-0400 (Eastern Daylight Time)

to quote from there:

Each fragment has coordinate data which corresponds to a pixel, as well as color and depth values

satya - Fri Aug 31 2012 14:59:09 GMT-0400 (Eastern Daylight Time)

This is important to clarify buffers (From the book above)

Then each fragment undergoes a series of tests and operations, some of which have been previously described (See "Blending" in Chapter 6) and others that are discussed in this chapter. If the tests and operations are survived, the fragment values are ready to become pixels. To draw these pixels, you need to know what color they are, which is the information that's stored in the color buffer. Whenever data is stored uniformly for each pixel, such storage for all the pixels is called a buffer. Different buffers might contain different amounts of data per pixel, but within a given buffer, each pixel is assigned the same amount of data. A buffer that stores a single bit of information about pixels is called a bitplane.

satya - Fri Aug 31 2012 15:01:02 GMT-0400 (Eastern Daylight Time)

A given type of buffer contains a given type of values for ALL pixels

A given type of buffer contains a given type of values for ALL pixels. For example a color buffer contains color values for all pixels. A depth buffer contains depth information for all pixels. A stencil buffer contains stencil information for all pixels.

satya - Fri Aug 31 2012 15:07:40 GMT-0400 (Eastern Daylight Time)

Here is, leaving no doubt, what a color buffer is (from the book again)

As an example of a buffer, let's look more closely at the color buffer, which holds the color information that's to be displayed on the screen. Assume that the screen is 1280 pixels wide and 1024 pixels high and that it's a full 24-bit color screen - in other words, there are 224 (or 16,777,216) different colors that can be displayed. Since 24 bits translates to 3 bytes (8 bits/byte), the color buffer in this example has to store at least 3 bytes of data for each of the 1,310,720 (1280*1024) pixels on the screen. A particular hardware system might have more or fewer pixels on the physical screen as well as more or less color data per pixel. Any particular color buffer, however, has the same amount of data saved for each pixel on the screen.

satya - Fri Aug 31 2012 15:08:05 GMT-0400 (Eastern Daylight Time)

All these buffers are called 'frame buffers'


color
depth
stencil

satya - Fri Aug 31 2012 15:11:19 GMT-0400 (Eastern Daylight Time)

So is there only one color buffer?

Apparently not. If it is a stereo image, apparently you have a left side and a right side buffer. If you are using double buffering then there is the front buffer and back buffer.

satya - Fri Aug 31 2012 15:15:39 GMT-0400 (Eastern Daylight Time)

Again, what is a depth buffer

It is a buffer containing depth values for each pixel. Each value indicates how far the pixel is in the 'z' direction.

satya - Fri Aug 31 2012 15:17:33 GMT-0400 (Eastern Daylight Time)

Now, what is a stencil buffer

A stencil buffer holds a fixed number of bits for each pixel. You can then apply logic to either display that pixel or not. This is called a stencil buffer because it emulates the process when a child paints over a cut-out card board only the scene that is not covered by the card-board becomes visible.

satya - Mon Sep 03 2012 12:15:31 GMT-0400 (Eastern Daylight Time)

Here is how Randi Rost et all defines the framebuffer

The region of graphics memory that is modified as a result of OpenGL rendering.