render.SetStencilFailOperation
Example
This is one of the most useful things stencils can do - not render something to the screen and then allow you to draw with the shape it would have been if it had rendered.
You can see in the output screenshot that a partially obscured entity will still write its entire shape to the stencil buffer.
From Lex's Stencil Tutorial.
Output: 
