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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Z-Fighting and Z-Depth issues on IOS

Discussion in 'iOS and tvOS' started by Willy-The-Kid, Jul 13, 2015.

  1. Willy-The-Kid

    Willy-The-Kid

    Joined:
    May 11, 2015
    Posts:
    32
    Hello guys,

    I just noticed that there is an IOS section in this forum. This is my Original Post in general section.

    As a summary this is my issues :
    • Mesh in the back are rendered in front of closer meshs.
    • Inside a unique mesh, some of the front faces are rendered in the back of the mesh.

    This is the solutions I explored so far :

    • Change all materials used to : Mobile/Unlit
    • Verify that there is no alpha on any png texture
    • Turn texture to 24 png (no alpha)
    • Turn texture to tga (no alpha)
    • Change Camera settings
      • Increase Near clipping plane up to 2 (can't go up that without loosing some of my scene
      • Decrease Far clipping plane down to 20 (can't go under without loosing some of my scene
      • Changed Rendering Path to "Forward
      • Activated / Deactivated Occlusion Culling
    • Changed camera orientation so objects close to camera have higher Z position, and objects far from camera have lower Z position
    • Placed trees on one layer and character on another one
    • Created my own shader
    In all this, only the shader changes affected rendering. I managed to get all objects rendered in the right depth on the scene but there is still issue into each mesh where some front faces are rendered in the back. Also, not that to get this "improvement" I had to use a Transparent shader and get all my objects (whitout any alpha) get calculated as if they are actually using alpha. So I guess this is not a fix at all as this practice is not optimized at all.

    Any help is welcome.
     
  2. Willy-The-Kid

    Willy-The-Kid

    Joined:
    May 11, 2015
    Posts:
    32
    Ok got it fixed by creating a new project from scratch. All is working well now and I can use shaders given zith unity without any trouble. All mesh are rendered correctly. All Z-Fighting is gone.