Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Weird graphical glitches on generated mesh (thin lines / "seams")

Discussion in 'General Graphics' started by Multiainen, Jun 27, 2020.

  1. Multiainen

    Multiainen

    Joined:
    Oct 9, 2019
    Posts:
    16
    Hey, hope this is the right section for this question. I'm working on a procedural terrain generation script with generated meshes as chunks, and everything works more or less as intended aside from this strange graphical glitch:

    upload_2020-6-27_20-59-53.png upload_2020-6-27_21-0-3.png upload_2020-6-27_21-0-15.png

    These faint lines appear along the X and Z axis on some of the terrain chunks. The lines run through several subsequent chunks, sometimes more broad and blurry (1st and 3rd image), sometimes as very thin seam-like lines (2nd image, a crossing of two). Seams between meshes are out of question, as the lines actually run through the centre of the chunks. They also appear seemingly at random; most chunks, regardless of the terrain on them, don't seem to have this issue.

    It's not the worst thing in the world, but they're definitely noticeable enough in the in-game view (a tilted top-down strategic camera) that I'd like to fix it. Anyone happen to have seen something like this before, or otherwise have an idea on what might be causing a glitch like this? (If it helps, I'm using the universal render pipeline and a basic shader to display the texture, which is a gradient applied to the heightmap. I've also recalculated the normals already, so I assume that's not the issue. I can post the code too if necessary, I assume it's rather a problem with lighting or something of the sort though.)