Search Unity

Help with Holes/Cracks in Unity's Tessellation Shader

Discussion in 'Shaders' started by Mr_Admirals, Dec 8, 2018.

  1. Mr_Admirals

    Mr_Admirals

    Joined:
    May 13, 2017
    Posts:
    86
    Hello,

    I'm fairly new to Shaders and am following several tutorials to implement snow displacement. My current issue is that when I raise the displacement value, holes/cracks end up appearing in my mesh. Now, I've searched google for a solution to this and saw that there are several good methods to counteract this, but was unable to find any good tutorials or explanations.

    Does anyone have any pointers on how to deal with this issue?

    Thanks
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,222
    Cracks will appear at vertex splits. So if you have UV islands, or different "smoothing" (separate verts) then that'll cause cracks. To fix such a thing you'd probably want to figure out what you want to compromise on.
     
  3. Mr_Admirals

    Mr_Admirals

    Joined:
    May 13, 2017
    Posts:
    86
    Thanks for the reply.

    That's strange. I don't have any UV islands. I'm working with a plane I distorted slightly in Blender to look like terrain.
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    8,138
    Hard edges in mesh normals can also cause the problem.

    Can you show a picture of the mesh with and without displacement?
     
  5. Mr_Admirals

    Mr_Admirals

    Joined:
    May 13, 2017
    Posts:
    86
    Yes.

    upload_2018-12-8_22-37-41.png
    upload_2018-12-8_22-38-49.png
    upload_2018-12-8_22-40-11.png upload_2018-12-8_22-43-13.png
     

    Attached Files:

  6. Mr_Admirals

    Mr_Admirals

    Joined:
    May 13, 2017
    Posts:
    86
    Your comment of hard edges causing a problem made me go back into blender and change my face normals to be smooth rather than flat. This appears to have fixed the problem. Let me know if you have any additional thoughts though.
     
  7. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    8,138
    Yeah, it was definitely the hard edges. Your displacement is being done using the vertex normals, and if there’s an edge the obvious result would be it could push apart. If you displace in world or object space, ignoring the vertex normals, you can avoid these issues as well.
     
unityunity