0
\$\begingroup\$

I'm about to release my second game in the next couple of days. A tester now reported that he has a flicker issue running the game on Linux. It´s related to objects like the water, the hex tiles and object on top of the hextiles. In Windows everything works like a charm but on Linux all the graphics flicker. I think it´s a graphical problem related to the Z-buffer since the flicking objects all have the same world space position. I´m using the URP and created all the shader by Unity Shader Graph. Does anyone know how I can fix the issue?

This it how it looks: Flickering issue on Linux (Ubuntu)

Any kind of help is appreciated! Thanks in advance!

\$\endgroup\$
2
  • \$\begingroup\$ Can you walk us through how these objects are set up in your scene? Different combinations of components and spatial layout can require different solutions. \$\endgroup\$
    – DMGregory
    Jan 31 at 19:48
  • \$\begingroup\$ Is anyone aware of why this would happen on a linux build but not on the windows build? Is there some opengl setting that must be tweaked to resemble how direct x deals with such rendering issues? Like the author of this thread I have encountered the same in my work. Developed a simulator on windows and have been switching over to ubuntu 18.04 LTS for a variety of reasons (which Unity officially supports). On 4 different computers now I have seen horrendous terrain flicker when I never saw any in months of dev on windows. I have tried starting \$\endgroup\$
    – Squirtle
    Jun 13 at 19:55
0
\$\begingroup\$

Here are some ways to fix Z-buffer:

  1. Physically move the objects further apart. Simply increasing the distance between the fighting objects should fix z-fighting in most cases. This is the most obvious solution but sadly not always possible depending on the situation, but if it is then always try increasing distances between objects if there’s no disadvantage from doing so.

  2. Increase the near clipping plane and decrease the far clipping plane of the camera. The lower the range of your camera clipping planes the more the depth buffers precision isn’t wasted.

  3. Nudge the shader depth offset to force an object to be rendered on top. Sometimes you may want an object inside another object but still want one forced on top. (such as graffiti on walls, dirt on ground etc) In these cases you can adjust the shader offset. This will offset the rendering of the rendered object without physically moving the vertices.

I found this from here.

\$\endgroup\$
3
  • \$\begingroup\$ Already tried the tipps on unity3dtips.com/unity-z-fighting-solutions but they did not help \$\endgroup\$
    – Yheeky
    Jan 31 at 19:38
  • \$\begingroup\$ @noobprogrammer, please remember to cite your sources when copying content from an existing document. If you don't, it looks like you're trying to plagiarize and take credit for someone else's work. \$\endgroup\$
    – DMGregory
    Jan 31 at 19:49
  • \$\begingroup\$ @DMGregory Ok, doing it now \$\endgroup\$ Feb 1 at 1:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.