What can glStencil do?

I wonder what a stencil buffer is and what it can do.

+7
c ++ c opengl
source share
3 answers

http://en.wikipedia.org/wiki/Stencil_buffer

In principle, stencil buffers allow you to draw only the parts β€œmarked” in the stencil buffer, rejecting pixels where this β€œmark” does not have a specific value.

Used for clip rendering in non-rectangular shapes and for shadow volumes .

+5
source share

Shadows, mirrors, reflections, masking polygons in Doom3 style, cropping polygons, displaying scene complexity and much more. There are many things you can do.

For more information, visit francis hill "Computer Graphics Using OpenGL" or the "OpenGL Programming Guide".

+1
source share

You can make Doom 3-style with their help.

If you feel lazy and don't want to triangulate your simple ones, you can draw them using the stencil buffer.

0
source share

All Articles