Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Strange horizontal line glitch in both editor and build?

Discussion in 'Editor & General Support' started by DanstaStudios, Jul 19, 2022.

  1. DanstaStudios

    DanstaStudios

    Joined:
    May 2, 2020
    Posts:
    41
    Hi there,

    I have noticed an odd bug in my game, there are these glitchy horizontal lines that seem to appear randomly, they look very bad! I have tried having a maximised window and a re-sizable window. The game is running the normal render pipeline with post processing.

    I will attach a video link.



    Many thanks
     
  2. DanstaStudios

    DanstaStudios

    Joined:
    May 2, 2020
    Posts:
    41
    Sorry, I know that they are hard to see in the video, you can just about make them out towards the end of the clip.

    Thanks again
     
  3. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,397
    I don't see it in video. Try enabling vsync and see if that helps
     
  4. DanstaStudios

    DanstaStudios

    Joined:
    May 2, 2020
    Posts:
    41
    Thanks. I tried all three settings and none of them worked?
     
  5. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,397
    Does it look like screen tearing? (google it)
    If so, google how to enable vsync properly in Unity, as that should fix it.
    If its not screen tearing make a screenshot with what you mean
     
  6. DanstaStudios

    DanstaStudios

    Joined:
    May 2, 2020
    Posts:
    41
    Thanks - it is not screen tearing.

    If you look at this screenshot of a tree closely, you can see black lines, these occur randomly

    screenshot.jpg
     
  7. DanstaStudios

    DanstaStudios

    Joined:
    May 2, 2020
    Posts:
    41
    They are very fast glitches on the screen - they are black horizontal lines which look awful - very difficult to get a good screenshot
     
  8. DanstaStudios

    DanstaStudios

    Joined:
    May 2, 2020
    Posts:
    41
    I have circled the glitch
     

    Attached Files:

  9. DanstaStudios

    DanstaStudios

    Joined:
    May 2, 2020
    Posts:
    41
    Has anyone seen this before?
     
  10. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,397
    What Unity version?
    Any custom shaders?
    Any physics based things?
     
  11. DanstaStudios

    DanstaStudios

    Joined:
    May 2, 2020
    Posts:
    41
    Unity 2020
    No custom shaders (that I can think of)
    No physics things
     
  12. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,397
    Did you update to the latest 2020 LTS?
     
  13. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,663
    Seems like these are purely horizontal, and they seem to happen at fixed intervals as you move forward. They also seem to quickly sweep from the back of the scene towards the camera.

    Very wild guess: if your trees/grass use mipmaps, these could just be the textures bleeding/wrapping around when transitioning between mipmap levels. That would explain the back to front sweep effect

    Start by hiding trees/grass. If these artifacts no longer appear, take a look at your leaves/grass textures: If you're using atlases, make sure to leave some padding in-between textures, and if you're not, make sure the textures wrap mode is set to "clamp" instead of "wrap".
     
  14. DanstaStudios

    DanstaStudios

    Joined:
    May 2, 2020
    Posts:
    41
    Thank you everyone - I am going to try your suggestions now.
     
  15. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    530
    You could also try using RenderDoc https://renderdoc.org/ or similar tool to analyze how one of the bad frames is drawn.
     
  16. DanstaStudios

    DanstaStudios

    Joined:
    May 2, 2020
    Posts:
    41
    Upgrading to Unity 2022 seems to fix it!

    Thanks for all your responses though.