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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
121 views

I'm making a 2.5D game in Pygame with an oblique top-down view, where you can see both the top and front sides of the objects/environment, similar to top-down JRPGs and 2D Zelda games: (Graphical ...
Sad Robot's user avatar
0 votes
1 answer
70 views

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 ...
philB's user avatar
  • 333
1 vote
2 answers
215 views

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 ...
eli3D's user avatar
  • 31
0 votes
1 answer
300 views

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 ...
Noideas's user avatar
  • 19
3 votes
0 answers
408 views

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
1 vote
0 answers
94 views

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
0 votes
0 answers
297 views

I am using OpenGL to render sprites, using an orthographic projection. Each sprite has a position: (x, y, ...
Eilan Laken's user avatar
0 votes
1 answer
152 views

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'...
Kuvaitt's user avatar
0 votes
1 answer
68 views

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 ...
philB's user avatar
  • 333
0 votes
0 answers
103 views

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 ...
philB's user avatar
  • 333
2 votes
0 answers
344 views

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
  • 149
1 vote
1 answer
796 views

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-...
HenriV's user avatar
  • 67
1 vote
1 answer
1k views

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 ...
HenriV's user avatar
  • 67
0 votes
2 answers
2k views

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 ...
Buretto's user avatar
  • 145
0 votes
1 answer
526 views

I forgot to write this C# code to enable depth from my camera: ...
OtakuFitness's user avatar
2 votes
1 answer
263 views

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
0 votes
1 answer
2k views

I wrote the following surface shader. The idea is to increase the Z depth value of vertices, after projection. ...
tigrou's user avatar
  • 3,279
-1 votes
1 answer
279 views

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. ...
S. M.'s user avatar
  • 117
2 votes
1 answer
283 views

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: ...
USSRCoder's user avatar
1 vote
0 answers
258 views

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
3 votes
1 answer
369 views

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. ...
Nagabhushan S N's user avatar
0 votes
0 answers
927 views

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:...
Ryan Peschel's user avatar
0 votes
2 answers
906 views

I've created a depth texture in OpenGL (using C#) as follows: ...
Grimelios's user avatar
  • 589
0 votes
1 answer
4k views

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 ...
Ohjurot's user avatar
1 vote
0 answers
147 views

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
1 answer
2k views

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 ...
Hillbilly Joe's user avatar
0 votes
0 answers
114 views

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 "...
Gardener's user avatar
  • 331
0 votes
0 answers
229 views

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 ...
lvella's user avatar
  • 153
0 votes
0 answers
71 views

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?
Szzzzb1's user avatar
2 votes
0 answers
35 views

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
  • 149
0 votes
0 answers
143 views

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 ...
Il'ya Zhenin's user avatar
2 votes
2 answers
598 views

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 ...
KIM CHANGJUN's user avatar
0 votes
0 answers
140 views

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,...
sdfsafasas's user avatar
1 vote
1 answer
535 views

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 ...
AaronHolland's user avatar
1 vote
1 answer
1k views

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 ...
Tomas's user avatar
  • 53
0 votes
1 answer
378 views

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 ...
Omer Eliyahu's user avatar
0 votes
1 answer
274 views

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 ...
Harry's user avatar
  • 690
0 votes
1 answer
199 views

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 ...
IanLarson's user avatar
  • 811
1 vote
3 answers
1k views

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,...
bzm3r's user avatar
  • 125
0 votes
1 answer
383 views

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 ...
rhughes's user avatar
  • 182
0 votes
1 answer
447 views

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 ...
user68854's user avatar
  • 307
1 vote
2 answers
972 views

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 ...
WraithNath's user avatar
1 vote
1 answer
58 views

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 ...
Ramachandra Junior's user avatar
0 votes
3 answers
3k views

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 ...
Kacper Kleczewski's user avatar
1 vote
0 answers
352 views

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
3 votes
1 answer
3k views

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
  • 1,029
2 votes
1 answer
2k views

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"...
Celtc's user avatar
  • 155
1 vote
1 answer
1k views

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: ...
Grimelios's user avatar
  • 589
4 votes
3 answers
4k views

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 ...
Michael Moon's user avatar
3 votes
0 answers
384 views

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