Author Topic: z fighting problem  (Read 2420 times)

stucki

    Reputation: 32
z fighting problem
« on: August 03, 2011, 09:14:52 pm »
August 03, 2011, 09:14:52 pm
another issue i have in this larger project i am working on is the z-fighting.

when i zoom out to distance i have faces that become flickering even if they have a distance of 10 cm.( what is a lot, i thought )
 i could do adjusting with the depth offset paramenters. but if you have several materials doing the flicker dance it becomes rather tricky.

is there a minimum distance between two parellel faces that works from every distance, or better can you guys get this z fighting a little bit better means more precise  ?

best regards.

stucki




mapar

    Reputation: 2
Re: z fighting problem
« Reply #1 on: August 03, 2011, 09:29:00 pm »
August 03, 2011, 09:29:00 pm
I have also this problem in streets with strips.
it's important to resolve it.
I had to substract the strips from the road with boolean in 3ds max (one more long work and bad mesh)



stucki

    Reputation: 32
Re: z fighting problem
« Reply #2 on: August 05, 2011, 03:00:32 pm »
August 05, 2011, 03:00:32 pm
??

stucki

    Reputation: 32
Re: z fighting problem
« Reply #3 on: August 08, 2011, 12:09:10 pm »
August 08, 2011, 12:09:10 pm
??

Re: z fighting problem
« Reply #4 on: August 09, 2011, 01:15:09 pm »
August 09, 2011, 01:15:09 pm
Z-fighting is caused by a lack of mathematical accuracy in real-time 3D and it's present in most 3D engines to a certain extent. From a layman's perspective, it tends to get worse the further away the camera is from overlapping polygons.

There are two ways to deal with the problem.

In real-time presentations, you can adjust the Depth Offset of the material in question. Be very careful not to drag the slider too far though - you only need to adjust it as far as is necessary to make the z-fighting stop. This solution only tends to work if the camera is relatively close to the overlapping polygons.

In movies, you can get rid of z-fighting quite easily once you've made the clip (I assume you've zoomed out quite a lot and the camera is quite high up):

1) New effect -> Scene Effects -> Camera Clip Planes
2) Increase the "Near Plane" slider until the z-fighting is gone.

The rule of thumb is that the closer the "Near plane" is to the eye position and the greater the distance between the "Near" and "Far" camera clip planes is, the more z-fighting you're likely to encounter.

stucki

    Reputation: 32
Re: z fighting problem
« Reply #5 on: August 09, 2011, 01:57:14 pm »
August 09, 2011, 01:57:14 pm
thanks for this detailed answer !
i will try these aproaches.

is it possible to make it more accurate in the future ?

best regards
stucki



Re: z fighting problem
« Reply #6 on: August 09, 2011, 02:35:02 pm »
August 09, 2011, 02:35:02 pm
thanks for this detailed answer !
i will try these aproaches.

is it possible to make it more accurate in the future ?

best regards
stucki

Nope that's not possible because in most cases the polygons are on the exact same location so more accuracy would not really help. My guess is that more advanced raytracers simply detect that polygons are in the same space and give one of the two objects priority so you don't get any z-fighting. The GPU relies on a z-buffer so z-fighting will always remain. We could in theory modify the shader so it clips a polygon when it detects the current z-values are too close.

stucki

    Reputation: 32
Re: z fighting problem
« Reply #7 on: August 09, 2011, 03:29:54 pm »
August 09, 2011, 03:29:54 pm
i am aware of the problem with two faces on the same place.
i avoid this in all my models.

my problem comes from faces with a distance of 10 cm.In the distance this two faces have the z-fighting problem as well.

Re: z fighting problem
« Reply #8 on: August 09, 2011, 07:27:54 pm »
August 09, 2011, 07:27:54 pm
i am aware of the problem with two faces on the same place.
i avoid this in all my models.

my problem comes from faces with a distance of 10 cm.In the distance this two faces have the z-fighting problem as well.


The distance is dependent of the distance from camera. So near the camera z-fighting only occurs within 1mm for example while at 2 km it occurs within 1m