Stencilbuffer

The stencil buffer (german stencil - stencil buffer - buffer) is in computer graphics, in addition to a color buffer and depth buffer existing part of the framebuffer. Each pixel is assigned a value in the stencil buffer. The task of Stencilbuffers is to limit the acquisition of fragments into the framebuffer on regions with certain properties of Stencilwerte. The settled property is set by the Stencilfunction. In what kind of stencil value is modified during the processing of a fragment is defined by the Stenciloperation which can be set differently depending on the output of the stencil and of the Z- test.

Applications

In the simplest case, the rendering area is limited by the stencil buffer. This can be used for example in a car or flight simulation to mask the cockpit, so as not to render parts of the scene that are located behind the cockpit. Another such application is the prevention of Z fighting in presenting coplanar planes ( triangles). With the help of Stencilbuffers also mirror can be displayed, in which the mirrored scene is rendered in the original only within the mirror frame.

The close links between the stencil and the Z- buffer in the graphics pipeline and in particular the ability to set the increment or decrement as Stenciloperation, but also allows the implementation of a range of more complex procedures. One of the most important is the shadow volume algorithm for generating the shade of the point light sources. Processes of this type usually require to render the scene, or parts of the scene more times in order to use the intermediate results in the stencil buffer in the formation of an image can immediately. Therefore, they are requesting the graphics hardware is usually strong.

History

The stencil buffer in its current form, there is the introduction of SGI Silicon Graphics Indigo by around since the early 1990s. The first programming interface, which supported the stencil buffer, was the proprietary IRIS GL, followed by OpenGL 1.0 in 1992. Since version 6.0 contains Direct3D commands to use the Stencilbuffers.

Since 1998, the stencil buffer collection was designed for the gaming market in graphics hardware, especially with the appearance of the Riva TNT Nvidia and ATI Rage 128. All the more recent such products since it is also supported. Technically show these products to date of Stencil and Z Buffer the same memory area on the graphics hardware, with a size of 32 bits per pixel. The Z-buffer case has a depth of 24 bits per pixel, for the stencil buffer fall off the remaining 8 bits per pixel.

747797
de