<p>Short answer: Move your near clip plane further away.</p>

<p>Depth buffer precision is very sensitive to the near clip plane distance.</p>

<p>Complicated answer: Use different math in your view projection. There are a few techniques that can help, some of them are outlined here:</p>

<p><a href="https://developer.nvidia.com/content/depth-precision-visualized" rel="noreferrer">https://developer.nvidia.com/content/depth-precision-visualized</a></p>

CC BY-SA 4.0
2018-07-17T01:32:09.820Z
2018-07-17T01:37:22.940Z
2018-07-17T01:37:22.940Z
Chifti Saidi
<p>I am currently rendering a scene in the most standard fashion possible (triangle projection and Blinn-Phong for shading)</p>
<p>However I am getting some artifacts:</p>
<p><a href="https://i.sstatic.net/n87Fg.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/n87Fg.png" alt="enter image description here" /></a></p>
<p>As you can see the lion head is not rendered properly. Moreover, the artifacts are flickering, but the proportion of how much they flicker is proportional to the distance to the lion. That is to say. If you are close to the lion there are no artifacts. But the farther away you go the more artifacts appear. I believe this is due to Z buffer imprecision. How can I solve this?</p>

CC BY-SA 4.0
2018-07-16T03:09:50.933Z
What distance do you use for your near & far clip planes?
PaulHK
CC BY-SA 4.0
2018-07-16T11:19:29.007Z
There are a few ways of solving this, as PaulHK mentioned, tweaking the near plane of your camera projection can help solving depth precision issues, other solutions: reversed z and logarithmic depth buffer. Here is a nice article that shows the precision of the different algorithms: https://developer.nvidia.com/content/depth-precision-visualized
Nacho
CC BY-SA 4.0
2018-07-16T18:49:40.343Z
Planar distance is at 2000 for far and 0.01 for near
Makogan
<opengl><antialiasing><buffers><artifacts><z-buffer>
How to solve Z buffer artifacts
Makogan
# How to solve Z buffer artifacts

(Asked by: username_0 on 2018-07-14)

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:

[![enter image description here](https://i.sstatic.net/n87Fg.png)](https://i.sstatic.net/n87Fg.png)

As you can see the lion head is not rendered properly. Moreover, the artifacts are flickering, but the proportion of how much they flicker is proportional to the distance to the lion. That is to say. If you are close to the lion there are no artifacts. But the farther away you go the more artifacts appear. I believe this is due to Z buffer imprecision. How can I solve this?

**Tags:** opengl, antialiasing, buffers, artifacts, z-buffer

> **Comments:**
> **username_1**: What distance do you use for your near & far clip planes?  
> **username_2**: There are a few ways of solving this, as username_1 mentioned, tweaking the near plane of your camera projection can help solving depth precision issues, other solutions: reversed z and logarithmic depth buffer. Here is a nice article that shows the precision of the different algorithms: https://developer.nvidia.com/content/depth-precision-visualized  
> **username_0**: Planar distance is at 2000 for far and 0.01 for near  

---

## 1 answers

### Answer by username_3 on 2018-07-17. Score: 5 | Accepted answer

Short answer: Move your near clip plane further away.

Depth buffer precision is very sensitive to the near clip plane distance.

Complicated answer: Use different math in your view projection. There are a few techniques that can help, some of them are outlined here:

<https://developer.nvidia.com/content/depth-precision-visualized>


---

