Decrease the texture-flickering effect?

Hi, do you have an idea how you could possibly decrease the flickering effect, which occurs when 2 faces of an object are at the same position (or nearly same position) and overlap?

I guess you can’t “remove” the flickering, since it’s reasonable that the renderer has no clue which texture/face of the object he should render now. But maybe decreasing it somehow to an acceptable amount?

When it’s not possible I would need a very clever script that prevents the overlapping and moves the objects slightly till the effect is gone.

Yes there are scripts on the forums that do just what you’re asking. This issue comes up from time to time, particles, parallax scrolling backgrounds, etc.

Search around for z-fighting and you’ll find them.

Thanks! And nice vid =)

The problem is that I don’t know which surface needs to be in front, because they are moving around constantly. So I don’t know which object needs the offset.

I would have to detect the z-fighting and add the offset to the object that is closer to the camera. Workable idea?

(Many searching results suggest to decrease the far clip pane/near clip pane ratio but that doesn’t really work for me)

Let’s hear more of what you’re trying to do.

Most of the objects in the scene haven’t a fixed position or a fixed scale and are getting modified constantly by code. Many modifications are random, I don’t have controll of it.

It’s basically a big swirling soup of objects intersecting each other, which leads to uncontrollable flickering all over the place.

So, I guess there isn’t an easy solution for this that wouldn’t brake my project timeline ^^

But I want to try this approach:

But how should I detect z-fighting areas?

z-fighting occurs when two objects are very close together and the movement of the camera causes them to be constantly reevaluated in a way that makes them flicker.

If your objects are randomly moving and scaling around each other, that doesn’t really sound like z-fighting, it just sounds like objects randomly moving in front of each other.

If you can explain your scenario better it might be easier to suggest a solution.