jmasterx
jmasterx

Reputation: 54113

What can glStencil do?

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

Upvotes: 8

Views: 1617

Answers (3)

SigTerm
SigTerm

Reputation: 26409

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.

Upvotes: 1

Dr. Snoopy
Dr. Snoopy

Reputation: 56357

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.

Upvotes: 6

genpfault
genpfault

Reputation: 52083

You can do Doom 3-style shadowing with them.

If you're feeling lazy and don't want to triangulate your simple polygons you can draw them using the stencil buffer.

Upvotes: 0

Related Questions