Original Post
Hello, I want to use the stencil buffer to mask out parts of the screen while drawing my scene. But I don't understand how to setup the different renderstates. Almost all articles about "stencil" describe shadow volumes. Anyway, I want to draw a quad (or any shape) to the stencil buffer, then when I draw my scene it should only appear inside this quad. Can you help me to setup the stencil test in such a way?