Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Z fighting meshes

Discussion in 'General Graphics' started by awsapps, Oct 2, 2021.

  1. awsapps

    awsapps

    Joined:
    Jun 15, 2021
    Posts:
    74
    Hi, I know this is a common topic but I'm unable to find a simple solution for this.

    Recently I have downloaded an unity package that contains a 3d cubic mesh representing a solid floor.

    After "tiling" multiple of this meshes one near another, I get Z-fighting:


    upload_2021-10-2_14-2-36.png

    The problem is that, making it to fit perfectly is just impossible by hand,
    Is there an easy way to prevent the Z-fighting and or to align the meshes perfectly?

    Here are some related posts:
    https://www.unity3dtips.com/unity-z-fighting-solutions/
    https://answers.unity.com/questions/27519/z-fighting-problem.html

    PD: The mesh are soo tiny and changing the camera Far/Near makes the entire tiles invisible
    Thanks!
     
    Last edited: Oct 2, 2021
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,256
    With the mesh you want to move and the Move tool enabled, hold down the V key. A white square will show up at the center of the move gizmo. Move your mouse around and the gizmo will snap to the closest vertex. Hover over the corner vertex of your mesh, then click and drag inside that white square and you'll snap to other vertices in the scene.

    Set your scene camera to use Dynamic Clipping, and then use the F key to focus on the currently selected mesh to automatically set the near and far clipping range to useful ranges for the object(s) you're working with.