Artefacts on Depth Map

Hello Everyone,

I am working on creating high-quality depth maps for a scene, aiming for precision and detail. However, I am encountering artefacts on some meshes when the bounding limits of the scene are very large.

  • Here are the artefacts (note the lines on the front face of the cube):
    Screenshot 2024-08-29 at 12.54.12 PM

I have attempted several approaches to resolve this issue:

  • Optimising MinZ/MaxZ
    ScreenRecording2024-08-29at12.03.07AM-ezgif.com-crop

  • Using Logarithmic Depth Map
    Screenshot 2024-08-29 at 12.54.23 PM

  • Using Dithering & Blur
    Screenshot 2024-08-29 at 12.55.11 PM

  • Using Coloured DepthMaps
    Screenshot 2024-08-29 at 12.55.31 PM

Despite these efforts, I have not been able to significantly reduce the line artefacts.

I also noticed that these artefacts appear on faces that are close to perpendicular (but not exactly 90 degrees) to the camera’s view direction. I suspect this may be due to the lack of shading on those faces. Here is a diagram to illustrate the issue:

Here is the Playground that renders all the varieties of depth maps:

(Check all the depth textures in debugger)

Is there a way to remove or mitigate these artifacts through any of the following methods, or a combination of them?

  • Depth map format
  • Optimizing MinZ/MaxZ
  • Post-processing techniques
  • Any other approach

Thank you for your assistance!

1 Like

This reminds me some friends tracking a bug with banding effect. It turned out, source was not the culprit but screen output was 8bits per component (instead of 10), so banding appears.
I would try to eliminate this quantization by doing a 2d graph of values. Export a line where banding appears (glread pixels then export to csv, do not make a screenshot, obviously) and display values using a spread sheet like Excel. Just to be sure values are linear. My guess is they are.

2 Likes

hahaha yes. At least, that’s a path I would eliminate (or not) :smiley:

1 Like