207 questions
1
vote
1
answer
155
views
clipping plane in threejs with different stencilRef
I need to clip an object in a ThreeJS scene using multiple clipping planes.
I used the example – it's a great example with the Depth Peeling / Stencil Volume method, but I need to do the same thing ...
0
votes
0
answers
61
views
How can I limit drawing area in Metal?
I am writing an application to paint on SVG images. I am combining Macaw and Metal. But I am facing a problem that I am limited to painting only white areas in the SVG image. I am using black and ...
2
votes
1
answer
82
views
How would I store the depth information for multiple color targets if my OpenGL FBO allows multiple color attachments but only one depth attachment?
If OpenGL FBOs have a provision for multiple colour targets with GL_COLOR_ATTACHMENT0 to GL_COLOR_ATTACHMENT31 but only one depth/stencil target with GL_DEPTH_STENCIL_ATTACHMENT, then how would I be ...
0
votes
1
answer
114
views
OpenGL: How do you use the stencil buffer to discard fragments closer than polygons drawn to stencil buffer?
In the engine I'm working with, I'm drawing some polygons to be used as a stencil for a portal of sorts, and I want to clip depth to it, in the sense that anything I draw after setting up the stencil, ...
1
vote
0
answers
655
views
How to Achieve See-Through Effect in Unity URP
I am using Unity 2022.3.16f with the URP, and I want to create an effect where you can see through object A to object B, as shown in the attached image:
Here is the shader code for object A:
Shader &...
0
votes
1
answer
502
views
Does Vulkan require a depth buffer attachment to perform a depth bounds test?
The behavior I'm hoping to achieve here is to have my fragment shader write to gl_FragDepth and for a depth bounds test to be performed on that value before going on to a stencil test.
There are a few ...
0
votes
1
answer
938
views
Using Stencil Shader to mask object, regardless of being occluded by mask in Unity URP
I'm working in Unity URP, and I'm unfortunately struggling a bit with stencil shaders. I was wondering if someone would be able to identify where I'm making a misstep:
Essentially, what I'm trying to ...
1
vote
1
answer
295
views
Webgpu text rendering with 2d clipping mask
I am new to WebGPU, and I am trying to combine those two examples and put the text behind a mask:
WebGPU Text Rendering and How to create a 2d clipping mask in webgpu?
This is what I have tried so far,...
0
votes
1
answer
209
views
Is it possible to fill in Stencil Buffer programmatically via fragment shader in Metal?
Do stencil buffer can only be filled in by some hard-coded rules during geometry drawing (like depth buffer), or is it possible to fill it in completely programmatically with the help of full-screen ...
1
vote
1
answer
202
views
Can I solve this OpenGL problem with the depth/stencil buffers
I'm trying to render meshes with the points and edges as black lines and points, similar to a modeling engine like blender. I have 3 separate draw routines to draw points, lines, and faces (each face ...
-1
votes
1
answer
130
views
Legacy OpenGL - Blending textures on water reflections produced with stencil test
I'm forced to use legacy OpenGL and no shaders for an academic project (yes..).
I'm rendering a 3D world with mountains and water. My goal (and problem) is to draw the skydome as reflection on the ...
3
votes
0
answers
182
views
How to enable antialias/multisampling when rendering to framebuffer with stencil buffer for webgl2?
I add samples: 4 and change gl.RGBA to gl.RGBA4 to enable antialias of first framebuffer attachment:
const framebufferInfo = twgl.createFramebufferInfo(gl, [
{ format: gl.RGBA4, type: gl....
1
vote
1
answer
280
views
Why webgpu stencil buffer 2d clipping result invisible when antialias enabled?
Here is normal stencil buffer 2d clipping result and one extra triangle:
const code = `
struct VSIn {
@location(0) pos: vec4f,
};
struct VSOut {
@builtin(position) pos: vec4f,
};
@vertex fn ...
3
votes
1
answer
787
views
How to create a 2d clipping mask in webgpu?
I've been investigating a webgpu way to create a clipping mask.
Here is what I tried:
const pipeline1 = device.createRenderPipeline({
vertex: {
module: basicShaderModule,
entryPoint: '...
0
votes
0
answers
120
views
Using a second z-buffer as a stencil buffer (depth-stencil test)
Here's my situation:
I'm using OpenGLES 3.0.
I'm doing z-buffer shadow casting. HOWEVER, I also have some cuts in the scene that are done with a stencil buffer, i.e. to dig "holes" in the ...