English: A screenshot from a program which uses that stencil buffer to change the color of shapes as they pass over other shapes. The stencil buffer is filled with 1s where-ever a white stripe is drawn and 0s elsewhere. Two versions of each oval, square, or triangle are then drawn, and the stencil buffer is used to decide per-pixel which object to draw. A black colored shape is drawn where the stencil buffer is 0, and a white shape is drawn where the buffer is 1.
A screenshot from a program where the stencil buffer is used to change the color of shapes as they pass over background shapes. The stencil buffer is filled with 1's where-ever a white stripe is drawn and 0's elsewhere. Two versions of each oval, square,
A screenshot from a program where the stencil buffer is used to change the color of shapes as they pass over background shapes. The stencil buffer is filled with 1's where-ever a white stripe is drawn and 0's elsewhere, then two versions of each oval, sq