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.

0 votes
1 answer
53 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 ...
Noideas's user avatar
  • 17
0 votes
0 answers
22 views

The perspective projection change the sign of z

I have an issue, I am drawing a cube in 3d. I am using z-buffer for hidden surfaces removal. But the hidden faces are drawn (i see the inside of the cube). After some research And I found that this ...
Abdel Majid Kansoussi'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
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
0 votes
0 answers
102 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, ...
Eilan Laken's user avatar
0 votes
1 answer
73 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'...
Markus's user avatar
  • 1
0 votes
1 answer
30 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 ...
philB's user avatar
  • 139
0 votes
0 answers
120 views

Set depth value in fragment shader

I'm making a simple 2D renderer and I want to avoid redrawing as much as possible. My Vertex layout has the 2d position and a float depth value. I want to assign a depth value to each of them after ...
FrameBuffer's user avatar
0 votes
0 answers
58 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 ...
philB's user avatar
  • 139
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
1 vote
1 answer
366 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-...
HenriV's user avatar
  • 45
0 votes
1 answer
718 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 ...
HenriV's user avatar
  • 45
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 ...
Buretto's user avatar
  • 125
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: ...
OtakuFitness's user avatar
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
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. ...
tigrou's user avatar
  • 3,214
-1 votes
1 answer
191 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. ...
S. M.'s user avatar
  • 117
2 votes
1 answer
203 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: ...
USSRCoder's user avatar
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
3 votes
1 answer
271 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. ...
Nagabhushan S N's user avatar
0 votes
0 answers
756 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:...
Ryan Peschel's user avatar
0 votes
1 answer
674 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: ...
Grimelios's user avatar
  • 579
0 votes
1 answer
3k 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 ...
Ohjurot'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
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 ...
Hillbilly Joe's user avatar
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 "...
Gardener's user avatar
  • 331
0 votes
0 answers
142 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 ...
lvella's user avatar
  • 153
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?
Szzzzb1'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
0 votes
0 answers
115 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 ...
Il'ya Zhenin's user avatar

15 30 50 per page
1
2 3 4 5 6