Questions tagged [depth-buffer]
Depth buffer stores a depth (z-coordinate) of a rendered pixel of a 3D scene. Depth buffer is used in Z-buffering (management of image depth coordinates). Because of this depth buffer is often called Z-buffer.
172 questions
0
votes
1
answer
68
views
How to create array of Depthstencil2D from texture2Darray
I have already done someting like this for texturecube but here I don't understand what I'm doing wrong. I have the first chance exception error message.
Below how I proceed:
create a texture for ...
0
votes
1
answer
292
views
How to prevent Sprite3D from clipping into nearby objects?
Gotot 4.2
Sprite3D is very useful for representing 2D objects within the gameworld. However, when billboarded (Y-billboard), 3D Sprites are prone to clipping into the floor/walls/other 3D models they ...
1
vote
0
answers
94
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 ...
0
votes
1
answer
151
views
How to change layer depth according to player location?
I would like to change the layer depth of objects, so that the player can go behind them. Right now it looks like this when the player is behind the object:
The problem is that the layer depth doesn'...
0
votes
0
answers
102
views
Is it possible to activate/deactivate depth writes in geometry shader?
I'm trying to achieve rendering to multiple targets with multiple viewports. Currently it does not work possibly because I have a single depth buffer so a first write to it with a specific viewport ...
1
vote
1
answer
793
views
Graphical issue when using a depth pre-pass
I have implemented the Z pre-pass technique into my engine, leading to a 2x performance improvement in a test scene.
However, the technique darkens the objects (but not the skybox), introduces z-...
0
votes
2
answers
2k
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 ...
2
votes
1
answer
262
views
Depth func LESS EQUAL not working as expected
How is it possible that a fragment is generated, passes the depth test but isn't written to the current render target?
This is the pixel history I see if I capture a frame in RenderDoc:
The fragment ...
-1
votes
1
answer
278
views
Drawback of painters algorithm:
We know that to scan convert any polygon first we need to pass any 4 tests of Painter's algorithm.
Suppose I have two polygon S1 and S2, which order is S1->S2.we see that all 4 tests are failed. ...
1
vote
0
answers
257
views
Z-Fighting mitigation performance overhead
Which of following approaches will have less performance overhead(using threejs renderer)?
I am currently have an issue with z-fight for distant objects, while my near/far plane is already set to most ...
0
votes
0
answers
921
views
For drawing many layered 2D tiles, should one use the painter's algorithm, or Z-buffering?
Sorry if this question doesn't make sense, I'm still very new to WebGL / OpenGL.
Basically, I'm trying to draw a tilemap similar to the one in Stardew Valley. Here's a screenshot from that game: https:...
0
votes
1
answer
4k
views
Howto use the depth buffer in DirectX 12
To make things short: I am trying to bind and use a depth buffer in D3D12, but it is not working. The depth buffer gets created and bound properly (I can see it in nsight graphics) but does only take ...
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
227
views
Implementing W-buffering in modern GPU
I was trying to figure out how perspective projection matrix works, and somehow I ended up in this rabbit hole of depth buffer precision.
It seems to be some interest in a depth buffer where the ...
2
votes
0
answers
35
views
Cheap way to soften contactpoint of character with ground
The view of my game is always semi topdown. I'm trying to make the contactpoint between characters and the floorplane more grounded without rendering hundreds of sprites.
One thing that I think could ...
2
votes
2
answers
596
views
z ordering in directx11
Hi recently i am trying to implement z ordering system into my directx framework.
So every object will have z order property(int), and this value will have higher priority than depth checking for ...
1
vote
1
answer
532
views
Can't get Direct3D11 depth buffer to work
I can't get the depth buffer to work correctly. I am rendering 2 cubes in a single Draw function, and from one angle it looks great
But swing the camera around to view the opposite sides, and I ...
0
votes
1
answer
378
views
XNA 4.0 How to change GraphicsDevice Default DepthStencilState Value
I want to change one of the deafult values of my GraphicsDevice to that:
GraphicsDevice.DepthStencilState.DepthBufferEnable = true;
But I know only to change it ...
0
votes
1
answer
197
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
380
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
972
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 in ...
0
votes
3
answers
3k
views
OpenGL ES 2.0 Shadow Mapping - depth only FBO not working due to GL_FRAMEBUFFER_INCOMPLETE_ATTACHMEN
I am trying to add simple shadow mapping to my friends gles 2.0 app. It is based on gles 2.0 and PowerVR SDK.
The problem I encounter is that FBO is not valid due to ...
3
votes
1
answer
3k
views
Difference between linear and logarithmic z-buffer
I've searched about this topic for awhile and i couldn't find it on google. I've come across several ways to avoid z-fighting which are linear z-buffer, logarithmic z-buffer and reversed z-buffer. I ...
1
vote
1
answer
1k
views
How do I write to a 16-bit depth buffer using Monogame and HLSL?
I'm working on shadow mapping. Part of the implementation involves drawing 3D models to a depth buffer with recommended 16-bit depth. To that end, I'm first creating a render target as follows:
...
3
votes
0
answers
384
views
Reading depth buffer result in only two values
I am attempting to add an SSAO post processing shader to my deferred rendering engine. I am running into problems with reading from the depth buffer. In the images linked below you can see the depth ...