All Questions
Tagged with depth-buffer unity
23
questions
1
vote
0
answers
33
views
How to pass two RenderBuffers into one RenderTexture?
I have a Unity URP project and in the Scriptable Render Pipeline, I would like to create a RenderTexture and pass the depth and color buffer of the camera object as ...
2
votes
0
answers
203
views
Is it possible to extract both the color and the depth texture from one RenderTexture and use it in a Shader?
I can access the same with duplicating the cameras AND the rendertextures, but that seems like a lot of overkill of just getting the depth buffer.
I don't need a very precise depth buffer, so it can ...
0
votes
2
answers
1k
views
How is depth buffer written to?
As far as I know you normally can't read and write to the same render target in the same shader pass. But if I understand correctly, depth tests rely on depth writes of things being drawn in the same ...
0
votes
1
answer
451
views
Why do I still get values from _CameraDepthTexture even if I didn't set depthTextureMode?
I forgot to write this C# code to enable depth from my camera:
...
0
votes
1
answer
1k
views
How to modify the z depth value inside the vertex function of a surface shader?
I wrote the following surface shader.
The idea is to increase the Z depth value of vertices, after projection.
...
1
vote
1
answer
2k
views
How to write depth texture and read values from it
I am new in Unity and specializing in another field. But now I have to rapidly study it for a new project. I will be very thankful if anyone explain me how to read values of the depth buffer.
I wrote ...
0
votes
0
answers
102
views
Punching holes through a texture and making them regenerate back again in an efficient way
I'm working on a prototype where the user can use the mouse to punch holes through a texture, making this texture see-through in that area for a certain amount of time. After that time, the hole will "...
0
votes
0
answers
42
views
How to always draw a child mesh in front of its parent mesh
I need to display a gizmo-like mesh at runtime, and it must be always in front of its target mesh. How can I achieve that?
0
votes
1
answer
161
views
How can I write an additive mesh shader that splits the RGB channels while accounting for depth?
I'm trying to create a sort of "hologram" effect. So far, what I have is an additive, three-pass shader that uses ColorMask for each pass to separate the RGB channels. The problem is that doing so ...
0
votes
1
answer
333
views
Depth Compositing - Background Not Being Rendered
I have a pre-rendered 3D scene which I am rendering as a background image. Over this, I am rendering an invisible version of this scene only into the depth buffer, so that any other 3D object will be ...
1
vote
2
answers
919
views
Tiled2Unity depth sorting issue with multiple layers
I have been struggling with an issue for a couple of days now trying to get depth sorting properly when using multiple layers in tiled.
My tiled map is set up as follows:
The sorting Layers I have ...
2
votes
1
answer
2k
views
Drawing a grid over a terrain using a mesh - Shader Depth and Z-Buffer
What I'm trying to achieve is rendering a (huge) tile grid over a terrain. For that I'm using a generated mesh of quads, one for every tile, whose vertices Y value is the same of the terrain to "shape"...
0
votes
1
answer
3k
views
Unity Custom Sprite Shader: Don't write transparent pixels into Depth Buffer
For performance reasons, i have to create my own billboards to replace some geometry. I modified the standard sprite shader to Cull Back and ...
2
votes
1
answer
5k
views
Simple cartoon water shader shoreline
I'm currently attempting to create a cartoon-ish water shader with a shoreline. After looking around trying to find out how other games do it i figured out it has something to do with getting the ...
0
votes
2
answers
2k
views
How to determine how far the background is behind a transparent object in a shader?
Is there a way to know how far away any object is behind a transparent object in a shader? Like making water fully transparent when close to shore.