Skip to main content

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.

31 questions with no upvoted or accepted answers
5 votes
0 answers
1k views

OpenGL Depth Cubemap with Geometry Shader Not Rendering Correctly

I was having some trouble with cubemaps in OpenGL, and was hoping to get some help. I've been following a tutorial about point light shadow mapping using cubemaps, where a geometry shader is used to ...
kingsapo's user avatar
3 votes
0 answers
309 views

Avoiding z-fighting when reimplementing Freescape games

I need to avoid z-fighting in exactly co-planar surfaces that are too close to the other solids. I'm re-implementing the Freescape engine in ScummVM (all my code is open-source, available here), and ...
Gustavo Grieco's user avatar
3 votes
0 answers
363 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 ...
AJ Weeks's user avatar
  • 113
3 votes
1 answer
2k 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 ...
Greffin28's user avatar
  • 999
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 ...
Dirk Boer's user avatar
  • 139
2 votes
1 answer
195 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 ...
leone ruggiero's user avatar
2 votes
0 answers
32 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 ...
Dirk Boer's user avatar
  • 139
2 votes
0 answers
687 views

How do you tell OpenGL ES 2.0 to use a texture as the depth buffer?

I want to render a scene with an outline post processing effect in OpenGL ES 2.0. First I render all the opaque objects. Then I use a post processing shader for silhouette detection that uses the ...
Gabriel's user avatar
  • 21
2 votes
0 answers
267 views

Get Specific depth values in Kinect (XNA)

I'm currently trying to make a hand / finger tracking with a kinect in XNA. For this, I need to be able to specify the depth range I want my program to render. I've looked about, and I cannot see how ...
N0xus's user avatar
  • 1,001
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 ...
Fox1942's user avatar
  • 131
1 vote
0 answers
182 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 ...
Dmytro Brazhnyk's user avatar
1 vote
0 answers
112 views

OpenGL ES - render to texture - how to preserve original depth buffer

I render to texture and attach my own depth buffer that has texture target. However, after I finish rendering I would like to set original depth buffer back. To start rendering to texture I do: ...
Martin Perry's user avatar
  • 1,126
1 vote
0 answers
326 views

Improving Shadow

I need to improve the shadows in my scene. At a first look they don't look too bad: They look awful when the camera gets closer to them, showing weird artifacts. I would like to know what are the ...
Blue Bug's user avatar
  • 1,112
1 vote
0 answers
675 views

How to do Decal Clipping with OpenGL using Depth Buffer comparison?

Basically I'm already drawing decals on top of various flat surfaces and that works great. As soon as the decal approaches the edge of a surface, naturally it doesn't get clipped. Is there a way to ...
JBeurer's user avatar
  • 467
1 vote
0 answers
1k views

Why does reverse depth buffering provide more precision? (with DXGI_FORMAT_D24_UNORM_S8_UINT Datatype layout)

I lately came around methods optimizing the use of the depth buffer, as the easiest solution reverse depth buffering is mentioned but I cannot wrap my head around why I would be gaining a better depth ...
user5716904's user avatar

15 30 50 per page