like depth-buffering, enables and disables drawing on a per-fragment
Source: Down to Earth Style
stencil is first created, usually by rendering primitives
rendering uses the stencil to mask out portions of the screen
is often used in multi-pass rendering
to how a painter might limit drawing to a defined region using a stencil.
stencil buffer is stored as an additional buffer on the graphics card. Storage
is associated with each framebuffer pixel. If
enabled, the stencil buffer can be written to during rendering.
rendering other geometry, each fragment can be tested against the stencil
that pass the test are rendered
that fail the test are discarded
Create a mask in the stencil buffer and only draw objects in the masked area.
reflection off the ground plane, by multi-pass rendering.Source: O'Reilly