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 ...
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 ...
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 ...
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'...
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 ...
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 ...
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, ...
0 votes
1 answer
1k views

Direct3D11 Depth buffer problem

Encountered a strange error when using Direct3D11, feature level 10.0. If the depth buffer texture is created with the format DXGI_FORMAT_R24G8_TYPELESS, bind flag D3D11_BIND_DEPTH_STENCIL | ...
0 votes
2 answers
2k views

How to determine how far the background is behind a transparent object in a shader?

Is there a way to know how far away any object is behind a transparent object in a shader? Like making water fully transparent when close to shore.
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 ...
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 ...
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 ...
0 votes
1 answer
2k views

Why distant objects are being drawn in front of close objects?

I am rendering two cubes in the space using XNA 4.0 and the layering of objects only works from certain angles. Here is what I see from the front angle (everything ok) Here is what I see from behind ...
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 ...
4 votes
2 answers
4k views

color individual triangles on a mesh in Unity?

I am trying to use Unity to display a model and color some triangles on the model to high light those parts of the model. I have created a scene, with a camera, a light source and a cube. After the ...

15 30 50 per page
1
2 3 4 5
12