I render a surface with some lines located mostly underneath the surface. They are close to the surface but not directly on/in it. When I am quite close to the surface with the camera everything looks fine (some parts of the lines actually go up through the surface so this is correct):
However, the farther I move away with the camera the more the lines that are located underneath the surface start to come through. There is NO depth bias applied to any materials.
Alright, thanks for your answer. Maybe I am not understanding Z-fighting correctly but how can it be Z-fighting when the primitives do not have the same Z value (there is really some space between the surface and the lines)? Or is it a precision issue?
Z fighting happens when the value is the same... in the z buffer.
Z precision is horrible once you get a little far away from the camera. To put into context two objects 10 meters away from each other, both around 20.000 meters away from camera will map to the same depth value and will Z fight.
Reverse Z drastically diminishes Z fighting because it distributes precision over distance much better.
With regular Z, 50% of the available precision is wasted between the near plane and 2x near plane. So if your near plane is 0.1, you get sub-nanometer precision between 0.1 and 0.2 meters and garbage precision between 0.2 and the far plane