Search Unity

Question Strange black lines on the edges of the meshes.

Discussion in 'General Graphics' started by Odhurs, Jan 31, 2023.

  1. Odhurs

    Odhurs

    Joined:
    Feb 11, 2021
    Posts:
    8
    Hello !

    I have an issue with my terrain and the objects that surround it (terrain, rock, trees, ...). They have strange black lines at the edge.

    It seems to be due to an intersection or a too tight angle. For instance, the more obtuse the angle on the ground, the darker the "shading".

    upload_2023-2-1_0-0-12.png

    When I look a bit deeper, they seem to be related to the mesh. But I don't see what I could have changed that caused this.

    upload_2023-2-1_0-0-48.png

    Thank you in advance for any advice or ideas you may have :)
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,634
    Do you have ambient occlusion enabled? Could be that.

    Could also be a texture problem. Texture sampling is not pinpoint accurate, so if you have dark color around your texture islands it can bleed through. Just as an experiment, try disabling mipmaps on that texture and see if that makes any difference.

    If the dark line corresponds with the edge of the texture that you're using, try setting the "wrap mode" to "clamp"
     
    Odhurs likes this.
  3. Odhurs

    Odhurs

    Joined:
    Feb 11, 2021
    Posts:
    8
    Hi,

    Thank you for your reply!

    I don't have an ambient occlusion activated. Should it be?

    I have done the steps you suggested but without success. I have deactivated my mipmaps and I have set my wrap mode to clamp.

    Here are some new shots to help you find clues :

    BL_NoMatterTheTexture.png BL_StopOnlyOnEdge.png

    You can see from the first one that it doesn't just affect the texture of the rock but also the texture of the dirt.
    On the second one, you can see that it stops right where it is "bent".

    Also, the black lines are not shown when you are far away. But the closer you are, the more visible and opaque the lines are :
    BL_GrassTexture.png

    King regards,
    Dorian
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    This is absolutely a screen space ambient occlusion post process that's doing this. If this is BIRP, it'll be in a post process profile. If this is HDRP then it's enabled globally in the HDRP pipeline asset's camera settings. If this is for the URP then it's a Render Feature in the URP Renderer settings asset.
     
    arkano22 and Odhurs like this.
  5. Odhurs

    Odhurs

    Joined:
    Feb 11, 2021
    Posts:
    8
    You were right ! Thank you :D


    In my Forward Renderer, I had settings that were enabled (I don't know how I managed to do that):

    BL_AmbiantOcclusion.png

    I don't know what they are but I don't need them !

    Have a great day guys :)
     
  6. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,634
    ambient occlusion is the digital version of smearing shoe polish on your plastic models. :p



    Useful when you have a lot of fine surface details and you want them to "pop". It's basically the opposite of what you're trying to do- make everything look smooth and hide the seams.
     
  7. Odhurs

    Odhurs

    Joined:
    Feb 11, 2021
    Posts:
    8
    Yes indeed! If used properly, it can have a good impact on the rendering.
    Thanks, I understand better the principle of ambient occlusion! I'm not ready to forget this one :D