Why mesh is flickering while moving the camera?

Hello,

I have a problem with my 3d model that is being loaded from a .bpb file. Whenever i am close to some meshes, they start to flicker (i will try to post a GIF/video). I tried fixing it using some answers regarding the far near clip pane on the camera but i got no result. Could you give me some solutions?

Unity version: 2021.3.6f1
Build: WebGL

Link for video: Imgur: The magic of the Internet

Hi, this common flickering is called Z-fighting. (click the link for detailed explanation)

I suggest keeping a very small gap between two faces (something like 0.0001).

Thanks for the link, now i know what is causing this issue.
Is there a way to set the small gap using the shader?

Theoretically you can move these vertices in vertex shader, but it’s hard to identify the faces which have z-fighting.

You can try editing the “.bpb” file.

For example, assume there’s a paper z-fighting with the floor, just move the paper up a little bit.

there is Offset:

adding this line helps in many cases:
Offset -1, -1

but of course requires you to then use that separate custom shader…

if its easy to modify that model, could fix it there (either remove overlapping areas, or move one up/down)

Offset worked on some cases but didn’t cover all, i will try to modify the bpb file and come back.