A Stencil Buffer is an improvement on the Z-Buffer, and allows depth information to be stored at values of 1, 2, 4, and 6 levels.
The stencil buffer is not the same buffer as the Z buffer and depth buffer. The stencil buffer is used to restrict drawing to certain portions of the screen.
an additional buffer of per-pixel information, much like a z-buffer
Memory (bitplanes) that is used for additional per-fragment testing, along with the depth buffer. The stencil test may be used for masking regions, capping solid geometry, and overlapping translucent polygons.
The section of the graphics memory that stores the stencil data. Stencil data can be used to mask pixels for a variety of reasons, such as stippling patterns for lines, simple shadows and more.
The stencil buffer is used to eliminate certain pixels from being drawn. The stencil buffer acts the same way as a cardboard stencil used with a can of spray paint. You can 'draw' values into the stencil buffer using the normal rendering primitives. Then a stencil test can be defined and stenciling enabled.
A stencil buffer is an extra buffer, in addition to the color buffer (pixel buffer) and depth buffer (z-buffer) found on modern computer graphics hardware. The buffer is per pixel, and works on integer values, usually with a depth of one byte per pixel. The depth buffer and stencil buffer often share the same area in the RAM of the graphics hardware.