Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Unity UI Weird anti-aliasing bug in game view

Discussion in '2017.1 Beta' started by Noisecrime, Jul 6, 2017.

  1. Noisecrime


    Apr 7, 2010

    I've been working on a project in 2017.1.0f1 that uses the Unity UI exclusively. I have two elements that need a connecting line draw between them often diagonally. I use a Image component with a width of 1 and a height value that will connect the ends of the line to the elements, then rotate the line so it connects the ends to the center of each element.

    Problem is in the game window ( top image) and builds this UI line is badly aliased, yet in scene view ( bottom image) its perfectly smooth! I'm using 8X MSSA with AllowMSAA enabled on the main camera and a canvas set to ScreenSpace - Overlay.

    UI Line Antialias bug.png

    If I switch the canvas to ScreenSpace - Camera then it appears the line is correctly anti-aliased, unfortunately since the line is dynamic, the code I have to correctly size and place it breaks, i'm unsure why and too tired to fix it atm.

    In summary though, screenspace - Overlay SHOULD be affected by MSAA settings and it would appear it is not.

    Did some further testing and unsurprisingly, to me at least, this used to work perfectly but was broken in the Unity 5.6 update, most likely due to the changes as to how MSAA is implemented. This has already seriously broken another project taking over a week to fix and seems to cause issues with many multi-camera, multiple-render project set ups. Even if you are lucky and it doesn't break a project it can add a overhead due to the excessive resolve.AA calls that now happen between multi-camera set ups.

    Reported as bug - case 927346 'UI - Components ( e.g. Image component) no longer anti-aliased in game view with Screenspace - Overlay canvas'

    I would stress though that whilst switching to ScreenSpace - Camera is a form of workaround, it can cause more issues such as breaking existing code and as such is just not a good solution to something that used to work perfectly prior to 5.6 and now doesn't.
    Last edited: Jul 6, 2017
    jazznazz and Shizola like this.