Jump to content
Happy Holidays! Limited Staff Responses: 1/20 - 1/31 ×

Guidance for z-fighting


VPG-NeilC
 Share

Recommended Posts

I was wondering if there's any guidance on reducing z-fighting?


In the past it's been a case of bringing objects very far forward to stop the flickering happening at a distance.
It seems really bad on the Vive Focus and so I wanted to know if anyone has a good way to fix this.

I've included a link to a small Unity 2017 project / apk which demonstrates this by teleporting the camera between 2 locations. The far location (which isn't all that far back) shows the z-fighting of the objects in the foreground. Press Space or click the touch pad to warp to the locations.

Camera clip plane is set to 0.01 / 250. The far clip is too close to use in our game but it shows that having a small far clip doesn't fix the issue.


https://tinyurl.com/yangbtlt


Any ideas?

Link to comment
Share on other sites

Here is an easy tips for your reference.

 

https://www.unity3dtips.com/unity-z-fighting-solutions/

 

Z-fighting happens because two or more surfaces are at the place with almost the same depth (looking from the camera).

The renderer pipeline need to check which surface is near, and which surface is far, but it fails to correctly distinguish this information.

Intuitively, there are two easy ways to reduce the z-fighting issue.

 

  • Separate these surfaces apart.

In the demo you shows, the z-fighting issue happens on the text and the board.

It’s easy to fix by moving the text forward a little bit, rather than putting it exactly on the board surface.

 

  • Increase the precision of depth buffer.

Increase precision of depth buffer also helps the rendering pipeline to distinguish nearer and further surfaces.

https://docs.unity3d.com/ScriptReference/Camera.SetTargetBuffers.html

 

Thanks, hope this helps.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...