Skip to main content

Questions tagged [z-buffer]

The tag has no usage guidance.

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

Problem using Decaling with Stencil to avoid Z-fighting

I need to create a decaling into a surface like a mesh, and to avoid Z-fighting I've been using Stencil Buffer to Turn-off depth test and make the decaling over the surface the Stencil Op permits. In ...
3 votes
3 answers
3k views

3ds max: Z-fighting when working with Large Objects

I had a z-fighting/z-clipping issue with a scene containing some very large objects yesterday in 3ds max. It can be seen in the image below: For some reason downscaling the scene significantly (a ...
1 vote
0 answers
184 views

Silhouette edge detection alternatives to Sobel

I'm trying to implement a silhouette detection algorithm in post-processing. I've come across solutions based on Sobel/Roberts cross/... filters and I was wondering if there are more accurate ...
3 votes
1 answer
550 views

Correct way to interpolate 1/z?

I have doubts on 1/z depth buffer interpolation. According to this website, the correct 1/z interpolation formula is $\dfrac{1}{P.z} = \dfrac{1}{V0.z} * \lambda_0 + \dfrac{1}{V1.z} * \lambda_1 + \...
0 votes
1 answer
282 views

Understanding gluUnProject

I was studying how the OpenGL's gluUnProject works. There is one thing I don't understand: is there any benefit of returning a ray instead of 3D point? One can use this function to get a ray not a 3D ...
0 votes
0 answers
66 views

Data type for coordinates

I am trying optimize routines for drawing primitive shapes for my custom 3D renderer. What is the best data type for representing a coordinate in 3D space? I thought that integer would be the best ...
1 vote
2 answers
2k views

OpenGL transparency - object behind is not rendered

I'm trying to implement voxel world using OpenGL (Core 3.3). I've come across a problem with transparency. It looks like sometimes GPU decides to not render stuff that would be important. Can you help ...
3 votes
1 answer
812 views

Layer rendering in Vulkan

I am writing a Vulkan video manipulation engine which has the following layers: Foreground (2D) Scene (3D) Background (2D) Note that each layer may have multiple objects, some of which may be ...
-1 votes
1 answer
171 views

Why we calculate z buffer value from plane equation $AX+BY+CZ+D=0$?

Suppose in perspective projection $(x, y, z)$ coordinate projects to point $(x_p, y_p, z_{vp})$ in projection plane $AX+BY+CZ+D=0$ where projection plane kept at $z_{vp}$ position. And the plane $AX+...
1 vote
1 answer
91 views

OpenGL in CodeBlocks with GNU GCC compiler not recognising some constants

I am writing basic code to; draw triangles, lines etc; to translate and orient them, and to project them in perspective, solving the occlusion problem using the depth buffer. Having had success with a ...
6 votes
4 answers
1k views

How will the z-buffers have the same values even if polygons are sent in different order?

I know when we use Z-buffer to eliminate the hidden faces, the polygons can be in any order. But my teacher said that this does not mean that two images generated by sending polygons in different ...
0 votes
0 answers
56 views

Obtaining sample position z value when using positions from depth buffer for SSAO

I was looking to implement SSAO; demonstrated on learnopeng (https://learnopengl.com/Advanced-Lighting/SSAO). While I have implemented the way they have done it i.e using a position texture for ...
0 votes
0 answers
121 views

Examples of cases where you write depth value in Fragment Shader?

I've very less knowledge when it comes to rasterization and typical rendering in games and other applications. So I was reading up on the rendering pipeline and found that the hardware could do early ...
0 votes
1 answer
417 views

Generate Hi-Z buffer using single PSO and single UAV

I'm currently implementing SSR in my engine and I've created Hi-Z buffer using multiple PSOs in way presented below: Create descriptor table with multiple UAV entries (this case - 3 entries for Mip 0,...
2 votes
1 answer
356 views

A solution to sprite visibility in a raycasting engine with variable wall heights?

I am writing a raycasting engine. At this point, I have added sprites, and I am using a z-buffer, with one stored length to a wall for the x coordinate of each ray. Below is an image of a sprite which ...
1 vote
1 answer
322 views

Objects in depth buffer are always black (0.0)

My problem is exactly what titles and screenshot below says - rendered object depth value is 0.0 in depth buffer. I'm using DirectX 12. Matrices: ...
2 votes
2 answers
693 views

What does the z-buffer look like in memory?

I am an amateur game developer, and I've been reading a lot on how computer graphics rendering works lately. I was reading on the Z-buffer recently and I can't quite seem to be able to wrap my head ...
4 votes
1 answer
2k views

Perspective correct interpolation z-buffer

While I was deriving expressions for perspective-correct linear interpolation on triangles, I reached the conclusion that the interpolation may be kept linear only if view-space $Z$ is available. ...
2 votes
1 answer
160 views

Z-buffering implementation with small triangles

For research purpose, I have to implement z-buffering algorithm to render 3D face models. But I got a problem that the triangles are too small to be rendered (i.e. there is no pixel covered completely ...
3 votes
1 answer
995 views

How to solve Z buffer artifacts

I am currently rendering a scene in the most standard fashion possible (triangle projection and Blinn-Phong for shading) However I am getting some artifacts: As you can see the lion head is not ...
2 votes
1 answer
2k views

How to implement Z-buffering?

I understand the theory behind z buffering - that I have to check for each pixel if its depth value is less than the one on z buffer or not, if yes then draw else not - but I don't understand how ...
3 votes
3 answers
3k views

How to understand Z-Fighting?

I searched for Z Buffer on Google and I discovered that's a 2 dimensional array used by the graphical card and whose aim is to enable the handling of two pixels' depth in order to display one of these ...
7 votes
1 answer
288 views

What modern real-time rendering applications still use fragment shader depth writes / late-Z?

It is pretty well known that writing depth in your fragment shader generally disables "early Z" test/write optimizations that modern GPUs rely on for fastness. Nonetheless, APIs still allow it and ...