Search Unity

Question [SOLVED] Procgen Terrain Seams

Discussion in 'Scripting' started by thesupersoup, Nov 18, 2022.

  1. thesupersoup

    thesupersoup

    Joined:
    Nov 27, 2017
    Posts:
    70
    There's some visible seams in my procgen terrain I'd like to get rid of. The shadow seams are visible both in Editor scene camera and Game camera, while the texture seams are visible only in Game camera. Already tried using
    Wrap Mode: Clamp
    and enabling/disabling mipmaps as far as the texture seams go with minimal if any effect.
     

    Attached Files:

  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,697
    Look up leaky light shadows
     
  3. thesupersoup

    thesupersoup

    Joined:
    Nov 27, 2017
    Posts:
    70
    Ok, so after some investigation, here are my solutions:
    1. The texture seams were caused by pixels bleeding over from one texture to the next on the texture atlas. This happened regardless of using Clamp->Point settings, compression settings, etc. The only solution was to add padding in the atlas. So now I group like next to like and leave some gaps that I can use for transparent sprites like icons and such later.
    2. As Kurt mentioned, some of the seams were related to lighting and shadows. Since I'm using URP, I had to edit the Shadow Bias settings in the Light to some really, really low values to stop light from bleeding through minuscule seams in the mesh. Which has it's own problems. One more workable solution is to increase the "depth" of your mesh, if possible. I can't, so I'll be tinkering with Shadow Bias values or perhaps rolling a separate lighting solution.
      • Alternatively, you can enable Two Sided shadow casting on the mesh. That seems to clean up the leaky light quite a bit without disrupting the sacred Shadow Bias values.
     
    Last edited: Nov 29, 2022