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.
173 questions
1
vote
1
answer
58
views
How does one efficiently render depth from an "Isometric" perspective?
I should start by clarifying that when I say "Isometric" I am talking more broadly about top-down games that use a "cheat" to display things on a z-axis, rather than being limited ...
1
vote
2
answers
212
views
Can't write DepthBuffer — result is completely white
I am new to DX12 and I am currently trying to get the depth buffer to work. I have done pretty much everything identical to blog posts I've seen online. I can also see that the ...
3
votes
0
answers
406
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 ...
0
votes
0
answers
296
views
Order-independent rendering of 2D sprites
I am using OpenGL to render sprites, using an orthographic projection.
Each sprite has a position: (x, y, ...
0
votes
1
answer
68
views
About possibly using Depthstencil 2D array in multiplerendertarget mode
I'm rendering in forward mode my scene with its depth buffer and because I'm using animated characters I'm plannig to find a way to use multiple rendertargets to do the directional shadow pass at the ...
2
votes
0
answers
340
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 ...
1
vote
1
answer
1k
views
How to execute early depth test
I have trouble applying early depth test in my engine, to prevent fragment shader to be (fully) executed for fragments that will be overwritten anyway, because other fragments, drawn later, will be in ...
0
votes
1
answer
525
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
2k
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.
...
2
votes
1
answer
279
views
How to get rid of intersections between terrain and road strip drawn on top?
When I draw a road as is (stencil:off, depth:on,less), the results are like this - ;
Then I tried adding stencil a test for the road:
...
3
votes
1
answer
368
views
Is it possible to record video, depth map and 6D pose of any games?
I'm not a game developer, but a researcher working on improving video quality in various contexts. For my current problem, I need to collect videos which have both RGB data as well as depth data. ...
0
votes
2
answers
904
views
Why does reading my depth texture in GLSL return less than one?
I've created a depth texture in OpenGL (using C#) as follows:
...
1
vote
0
answers
146
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:
...
0
votes
0
answers
114
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
69
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
0
answers
143
views
How to get depth buffer from PUBG?
I have no any experience in game development, I'm doing some research on machine learning tasks and for my project I need to know how to get depth buffer. I tried to google but haven't found relevant ...
0
votes
0
answers
139
views
Part of the back side of a transparent object disappears
I did some blending and culling to get the image below.
As you can see, it is messed up. On the right side of the image, only the front side of the mesh shows. On the left side of this image, it works,...
1
vote
1
answer
1k
views
glReadPixels with GL_DEPTH_COMPONENT into PBO is slow
I need to read depth buffer back to cpu memory. It may be few frames old, so I use glReadPixels with a buffer bound to GL_PIXEL_PACK_BUFFER. I use several buffers and ping-pong them. Finally, I read ...
0
votes
1
answer
273
views
World position reconstruction from depth fails when viewport size does not match window size
I'm facing very strange issue. My code for world pos reconstruction works correctly when the viewport size is equal to window size (or framebuffer size in other words). Below is the part for ...
1
vote
3
answers
1k
views
Why do we need a depth buffer to display a single 3D cube?
According to a Vulkan tutorial I am following, I will need to create a depth buffer in order to display a 3D cube:
However, as far as I understand, depth buffers are used for the Z-buffering technique,...
0
votes
1
answer
446
views
How to use depth buffer for z-level rendering in roguelikes?
Developer of the game explains how z-buffer works in Dwarf Fortress (loosely quoted):
"If you clear the buffer every single frame, it kills the game. You have sort of a depth of field. You say I need ...
1
vote
1
answer
58
views
Where do the buffer values come from when rendering?
In the textbook I am reading, it talks about fragment tests that are performed when rendering.
All of these tests involve comparing the current fragment x value (x can be alpha, color, etc.) with a ...
1
vote
0
answers
352
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 ...
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"...
4
votes
3
answers
4k
views
Ray tracing and Z buffering in graphics
I am a high school student taking computer science as a subject, and someone who is very interested in the game development industry. I am currently writing an essay on Raytracing and Z-buffering by ...