Questions tagged [stencil-buffer]

The stencil buffer is a concept implemented in various 3D graphics APIs used for performing "stencil" operations, used to minimize rasterization of hidden pixels or to implement various effects.

Resources:

202 questions
0
votes
0 answers

How can I write a different value to "Stencil Buffer"?

I'm writing a 2D UI library with OpenGL. Now, I want to make parent view clips it's children by "Stencil Test", I need test it's parent layer value, and write the layer value belong it self for next test. For example test 0, and write 1. test 0,…
wudijimao
  • 53
  • 6
0
votes
1 answer

Will asking stencil buffer of the drawing buffer add performance cost (WebGL)?

var gl = canvas.getContext('webgl', { stencil: true }); According to WebGL Spec, this line of code will ask the drawing buffer to have a stencil buffer of at least 8 bits. But will that add any performance cost? Is it suitable to always asking one…
shrekshao
  • 388
  • 4
  • 12
0
votes
1 answer

Libgdx Stencil Buffer overlap

I have a question about using the Stencil Buffer with OpenGL and libgdx As example I need to draw to circles with overlap. The code of render method is here: Gdx.gl.glClearColor(1f, 1f, 1f, 1f); Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT |…
0
votes
0 answers

Why is stencil buffer not working after page reload on Chrome?

Are there any clues about the reason why the following website fails to color continents after page reload on Chrome? http://opensciencemap.org/map/ Some clues: No problem with page reloads on Firefox and Safari. No problem with page reloads on on…
Izumi Kawashima
  • 1,197
  • 11
  • 25
0
votes
1 answer

Not able to get stencil to work

Was trying to get Stencil to work in my app. I use Sprites to render content on to the Device. Content could be movies, pictures or text. Can I set the stencil buffer using these Sprites, which can be used in later passes to stencil out other…
Trainee4Life
  • 2,203
  • 2
  • 22
  • 38
0
votes
1 answer

Read depth values while stencil testing(same texture)

I know that it is a very bad idea to read/write from/to the same texture/location, because this would result in undefined behaviour. But in my case, if depth testing is disabled and I read the depth values in a shader, is it ok to do the stencil…
karl88
  • 341
  • 2
  • 13
0
votes
1 answer

OpenGLES 3.0, Android: How to draw intersection of two objects

I am currently working on a project using OpenGL-ES 3.0 for Android. In my project, I have drawn a 3d human head, whose centroid lies at the origin. I also have a cylinder, with the center of one of its faces lying on the origin. The cylinder…
brohan322
  • 358
  • 1
  • 12
0
votes
1 answer

OpenGL Stencil: Availability of GL_REPLACE_VALUE_AMD

OpenGL Stenciling, seperating ref from value written? In the answer to this question, a vender specific extension GL_REPLACE_VALUE_AMD is able to do exactly what I'm struggling to do in OpenGL, but I'm worried it will limit what computers and…
Anne Quinn
  • 12,609
  • 8
  • 54
  • 101
0
votes
0 answers

Union of N intersecting translucent 3D objects

I confused with the problem of intersecting translucent 3D objects. I have a plenty of translucent objects which (potentially) can intersect each other. So, when I'm displayng them, in the case of intersection happened, I can see common parts of…
tema
  • 1,115
  • 14
  • 33
0
votes
0 answers

Using the Stencil Buffer to cut out windows

I am trying to use the stencil buffer to cut two windows in a solid box. The windows are two rectangles (composed of 2 triangles). But the OpenGL stencil buffer flags seem difficult to decipher. Here is what I am…
Joe
  • 81
  • 1
  • 7
0
votes
1 answer

OpenGL / SDL2 : stencil buffer bits always 0 on PC

I'm writing an app using SDL2 / OpenGL, and doing some stencil operations. Everything works as expected on Mac, however on PC the stenciling doesn't work. Upon closer inspection I realized that the following code provides different outcomes on my…
benitosub
  • 123
  • 1
  • 8
0
votes
1 answer

Attach StencilBuffer to default Framebuffer

As it turns out, the default framebuffer of OpenGL does not nesseccarily contain space to perform stencil operations on. Can I attach it manually, or am I forced to use a cusomized framebuffer for this kind of operation?
salbeira
  • 2,375
  • 5
  • 26
  • 40
0
votes
1 answer

Stencil problems on different devices

I'm trying to use stencil test in my android opengl application. The code is pretty usual. Smth like that: gl.glStencilFunc(GL10.GL_ALWAYS, 1, 0xff); gl.glStencilOp(GL10.GL_KEEP, GL10.GL_REPLACE, GL10.GL_REPLACE); //...drawing a thing to stencil…
T.Vert
  • 279
  • 2
  • 13
0
votes
1 answer

OpenGL Stencil - Exclude transparent pixels

I have this texture that I want to use as as mask using the Stencil buffer : Then I want to draw an image IMG on the screen which should appear only where the above image is visible (where there's color), thus excluding transparent pixels above the…
Mickäel A.
  • 9,012
  • 5
  • 54
  • 71
0
votes
1 answer

Outlining a 3D model using Stencil-buffer

First I'd like to mention that I found what I believe to be the exact same question, unfortunately without an answer, here: Java Using OpenGL Stencil to create Outline I will post my code below, but first here is the problem: from this capture**,…
Philippe
  • 21
  • 4