0

I've 2 sample files: good.blend and bad.blend.

Both have 2 parallel rectangles rotated along z axis and separated by same distance. In fact they're almost the same. However, both were created via different steps.

Why is it that only bad.blend shows z-fighting kind of effect. good.blend doesn't have any such effect. I tried rotating both in many ways, but only bad.blend shows the z-fighting.

good good

bad bad

Gorgious
  • 30,723
  • 2
  • 44
  • 101
AKV
  • 3
  • 3
  • 1
    Hi, would you mind adding as an [edit] the differences between the steps you took? Thanks :) – Timaroberts Dec 08 '20 at 07:16
  • one is orthographic view, the other one perspective, if you switch from othographic to perspective you will also have artifacts, and vice-versa. The faces are not overlapping so It doesn't explain why you have Z fighting though. That said the render is correct. – moonboots Dec 08 '20 at 07:58
  • good.blend I did basic steps on a new file. for bad.blend I was trying out this https://www.youtube.com/watch?v=TRVfplQ0AyU and saw the artifacts, so, worked backwards towards simpler objects but the artifacts didn't go away. – AKV Dec 11 '20 at 01:49
  • both are perspective view – AKV Dec 11 '20 at 01:50

2 Answers2

6

One of the parameters that affect Z fight in 3D view window is the distance between clip start and clip end of the camera view. This distance on the rendering camera can affect Eevee renders also, and should be set as short as possible.

josh sanfelici
  • 26,917
  • 2
  • 20
  • 40
  • I noticed good.blend had clip start = 0.001 m, clip end = 1000 m. Whereas, bad.blend had clip start = 0.000001 m, clip end = 1000 m. When I set the clip start to 0.001 m, it fixed the problem. Please note though that distance between start and end was always ~ 1000 m in both cases. – AKV Dec 11 '20 at 03:25
1

The z-buffer is limited. The scale at which the 3d engine is able to separate the objects that are coplanar, and very close together, depends largely on the settings for clip start and clip end.

If the clip range is very large, then there is less precision. The surfaces that are close together and fall beyond the precision of the z-buffer will be rendered as if they sharing the same plane. In other words, the 3d engine cannot differentiate very small differences, and the either of the surfaces will be rendered randomly.

Read the wikipedia article on Z-fighting for a deeper explanation.

susu
  • 14,002
  • 3
  • 25
  • 48