Questions tagged [z-buffer]
23 questions
7
votes
1 answer
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 GPUs still provide support for correct visibility…
GroverManheim
- 593
- 3
- 8
6
votes
4 answers
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 orders will have identical values in their z-buffers…
zfb
- 145
- 4
4
votes
1 answer
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. However, computing view-space $Z$ requires nonlinear…
lightxbulb
- 1,941
- 1
- 5
- 14
3
votes
1 answer
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 rendered properly. Moreover, the artifacts are…
Makogan
- 1,584
- 8
- 27
3
votes
3 answers
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 pixels in front of the other.
To illustrate my…
user5740
- 31
- 1
- 2
3
votes
1 answer
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 + \dfrac{1}{V2.z} * \lambda_2.
$
Here is my 1/z…
Jimmy Yang
- 167
- 7
2
votes
2 answers
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 factor of 100 approx) resolves the z-fighting…
2
votes
1 answer
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 by any of the triangles).
I've tried to…
HOANG GIANG
- 23
- 3
2
votes
1 answer
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 is fully visible.
Z-buffering works fine when…
Caspian Ahlberg
- 123
- 3
2
votes
2 answers
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 around what exactly the Z-buffer looks like in…
Carmo
- 23
- 2
2
votes
1 answer
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 transparent. For 2D objects (foreground and…
1
vote
1 answer
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 would I actually get the z value of each pixel ?
At…
3D clipping.
- 33
- 5
1
vote
0 answers
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 techniques to perform the task.
With silhouette edge I…
leone ruggiero
- 157
- 5
1
vote
1 answer
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 hand-made projection matrix emulating what…
Simon
- 173
- 2
- 7
1
vote
2 answers
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 me diagnose the problem, please?
(I thought this…
Paweł Pomierski
- 11
- 2