Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What can glStencil do?

Tags:

c++

c

opengl

I'm wondering what the stencil buffer is and what it can do.

like image 476
jmasterx Avatar asked Jun 20 '10 04:06

jmasterx


People also ask

What is the importance of stenciling?

It helps children to manoeuvre vertical, horizontal and circular strokes, learning to form shapes, letter or numbers. Kids drawing with stencils keep them busy with drawing and coloring. In addition, they also paint and cut. These activities engage bilateral coordination.

What is best to use with stencils?

Use painter's tape or spray adhesive to secure the stencil to the surface, so it doesn't move. Spray adhesive will guarantee security that the stencil won't move, or the brush won't catch the edge and result in paint bleed underneath. Lightly spray adhesive to the back of the stencil and position on the surface.

Who uses a stencil?

Stencil are used widely in many industries, one such being textile industry where it is used in silk screening, a type of textile printing. Stencils have been made popular by graffiti artists who use it to make graffiti quickly and easily. They use graffiti as a means to express themselves.

Why do artists use stencils?

The key advantage of a stencil is that it can be used to rapidly and repeatedly produce a relatively intricate design. Stained glass artists have used stencils for hundreds of years to paint a repeating border design or add an intricate design to a background.


2 Answers

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

Basically, the stencil buffers allows you to draw only in parts "marked" in the stencil buffer, rejecting pixels where this "mark" doesn't have certain value.

Is used to clip rendering in non-rectangular shapes, and to do shadow volumes.

like image 89
Dr. Snoopy Avatar answered Oct 19 '22 14:10

Dr. Snoopy


Doom3-style shadows, mirrors, reflections, masking polygons, clipping polygons, displaying scene depth complexity, and several other things. There are quite a lot of things you can do.

Check francis hill's "Computer Graphics using OpenGL" or "The OpenGL programming guide" for more info.

like image 39
SigTerm Avatar answered Oct 19 '22 12:10

SigTerm