Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    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:
    12,329
    Hard edges in mesh normals can also cause the problem.

    Can you show a picture of the mesh with and without displacement?
     
    dmi3ich likes this.
  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:
    12,329
    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.
     
    Feirun1 likes this.