Questions tagged [stencil-buffer]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
28
votes
3answers
13k views

What is a stencil buffer?

Wikipedia states that a stencil buffer is some arbitrary buffer a shader can use. However, it hints that it's used for clipping, or otherwise "tightly binding" the depth and pixel buffers, slightly ...
6
votes
2answers
3k views

Uses for Stencil Buffer

I've been doing OpenGL tutorials using LearnOpenGL. Currently I'm reading about Stencil Buffers and in his example he uses a Stencil Buffer to draw an outline around an object. I've also read that it ...
5
votes
0answers
122 views

How much processing power does stenciling actually save?

For example, let's assume I'm rendering cascaded shadow mapping, but for whatever reason, instead of one of the typical approach, I do the following: Render the lowest resolution shadowmap Copy part ...
4
votes
0answers
175 views

selectively setting stencil value based on vertex property in vertex shader

Just like the question says. Is it possible to selectively set the value of the stencil buffer based on a property of a vertex, like the value of its normal, during its vertex processing phase? ...
3
votes
1answer
401 views

Incorrect values written in stencil buffer

I am trying to pick objects on mouse click. For this I have followed this tutorial, and tried to use the stencil buffer for this purpose. Inside "game" loop I am trying to draw 10 (5 pairs) 'pick'...
2
votes
3answers
323 views

Fast clipping without clearing stencil buffer

I'm writing an OpenGL application that runs on a Raspberry Pi, i.e., a quite resource-limited system. Essentially, a few quads with RGBA textures are overlayed/alpha blended on top of each other with ...
1
vote
1answer
67 views

Layer rendering in Vulkan

I am writing a Vulkan video manipulation engine which has the following layers: Foreground (2D) Scene (3D) Background (2D) Note that each layer may have multiple objects, some of which may be ...
1
vote
0answers
393 views

3D model outline using stencil buffer

I'm trying to outline a 3D model in WebGL. I've tried using a stencil buffer techique with glLineWidth and glPolygonMode. However, Mozilla's WebGL reference says that the minimum and maximum widths of ...