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 make Product Images (if product has multiple photos) Swipeable with a finger using CSS?

How can I make Product Images (if product has multiple photos) Swipeable with a finger left/right using CSS or JS scripte in mobile version? How to make Product Images carousel slider use mobile left/right swipe? I have Stencil Theme "Meros" in…
0
votes
1 answer

How can I make a Stencil Buffer mask only where the mesh is drawn?

I was trying to mask a sprite using a stencil buffer and it works fine untill I add some transparency to it. The mask works using the whole texture, but I want it to work only where the quad is drawn. Here's a picture to illustrate what I'm…
Hemessfell
  • 53
  • 3
0
votes
0 answers

Cap outline in Threejs

I'm looking for the best way to render the outline for a cap of a sliced object. To illustrate what I mean let's use this example from threejs: https://threejs.org/examples/?q=clip#webgl_clipping_stencil and set it up such that we slice it only from…
SeeDoubleYou
  • 1,253
  • 2
  • 15
  • 25
0
votes
0 answers

How can I "mask" a particle effect using unity mask component

Image component can be masked as expected, but it doesn't work when it comes to particles. Problem I have tried changing stencil id to be the same as the id shown in mask component in my particle shader, still not work. After reading the source code…
0
votes
0 answers

Trying to draw liquid on floor in 2d (Opengl directly write array of byte into stencil buffer)

Currently I'm making 2d game with java libgdx. In my game I need to have multiple kinds of liquid to occupy floor of room. (something like splatoon but in 2d) Each liquid need track of what entity it is in touch with and should be able to change…
0
votes
1 answer

How to mask a shape with multiple masks

I want to mask a rectangle shape with two different shapes Shape 1 Which is in shape of a circle Shape 2 Which is in shape of rectangle This is the code for setting stencil mask for shape 1 glStencilOp(GL_REPLACE, GL_KEEP,…
Summit
  • 2,112
  • 2
  • 12
  • 36
0
votes
1 answer

shadow volume - non-manifold objects

I have doubts regarding the creation of shadow volumes for non-manifold objects, specially when the objects have dangling faces. For instance: (source: ricfow at www.dt.fee.unicamp.br) where we have a box (brown) and two connected faces (white) on…
ricfow
  • 91
  • 1
  • 4
0
votes
1 answer

Stop two shadows overlapping using the stencil buffer in OpenGL

I have two planar shadows of the same object coming from the same light source - one that casts on the floor and one to cast on the wall when the object is close enough. Everything works just fine as far as the shadows being cast, I'm using the…
AlexDLC
  • 1
  • 2
0
votes
2 answers

OpenGL ES / Vulkan: Per fragment stencil write/test (on Qualcomm Snapdragon XR2)

I would like to render two meshes, the first one writing into the stencil buffer and the second one testing against it. I want to do that on a per fragment level though (the fragment shader of the first object should define which value to write into…
0
votes
1 answer

problem with shadow volume using opengl

I cannot figure out a solution to my shadown projections using shadow volumes and stencil buffers. The problem can be viewed in: www.dt.fee.unicamp.br/~ricfow/shadowProblem.avi In this other…
ricfow
  • 91
  • 1
  • 4
0
votes
2 answers

Is it possible to clear stencil buffer within indirect draw call?

I want to implement stencil shadows, and not have to work with individual lights on CPU side (recording buffers that alternate pipelines for each light) - i want to do all the lights in one go. I see it being possible with compute shaders; however I…
user369070
  • 600
  • 1
  • 5
  • 9
0
votes
1 answer

Are masked sprites and Stencil Buffers in Unity only visible on one eye if deployed on HoloLens2?

Is it possible that Sprite Renderer in a HoloLens2 Unity Project, which are masked via a SpriteMask are only visible on one eye in the final HoloLens2 build (UWP via VisualStudio2019 deployed on HoloLens2 device). I also experienced the same…
SilverLife
  • 21
  • 4
0
votes
1 answer

Stencil Test doesn't seem to do anything

It seems that no matter what I do the stencil buffer has no effect on what I'm drawing. I'm drawing two rectangles, one is drawn over top of the other and slightly off of it. The part where they intersect is the only thing I want to be displayed. …
szMuzzyA
  • 136
  • 13
0
votes
1 answer

How to implement a Thrust version of a 1D stencil code?

Basically, is it possible to implement 1D stencil kernel shown below using pure Thrust? I want this implementation to be as efficient as possible which implies that Thrust should somehow know that there is a multiple access to the same elements and…
user3786219
  • 177
  • 1
  • 2
  • 11
0
votes
0 answers

Using stencil buffer in three.js

I am making a 3D scene using three.js, and try to use stencil buffer for cutting holes in the tetrahedron, for that I think a good idea to use the sphere, but for that, I don't find a good example which would explain to me how to do it, step by…
AnatoliyC
  • 57
  • 9