Stencil buffer
Related terms: stencil test, mask
A per-pixel number stored next to the depth buffer. One draw writes a value into it, marking an area. Later draws are told to pass only where the stencil matches.
It works like masking tape. Portals, mirrors, outlines around selected objects and cut-out UI shapes are built with it.
- Further reading
- LearnOpenGL: stencil testing