◄ Wiki / Graphics
stencil
A per-pixel scratchpad the GPU uses to mask off which pixels are allowed to be drawn.
Alongside the depth buffer, a stencil buffer stores a small integer per pixel. During rendering the GPU can test that value against a reference (with compare masks) and either draw or reject the pixel, and it can update the stored value too. This drives effects like outlines, mirrors, shadows, and clipping to arbitrary shapes.
See also
- texture samplingReading a smoothly-interpolated colour from a texture image inside a shader.
- swapchainA rotating queue of images the GPU draws into and then hands to the display one at a time.
- topologyHow a GPU interprets a list of vertices — as separate points, connected lines, or triangles.