Search Unity

Scroller is slow.

Discussion in 'General Graphics' started by ZYSHAQ, Aug 20, 2018.

  1. ZYSHAQ

    ZYSHAQ

    Joined:
    Jun 26, 2015
    Posts:
    76
    Hi,
    I am making an app with unity, and the scroller element, is just not smooth. Well, it's smooth on unity but when I deploy the app on the phone its slow. I am using Mask elements on 2D sprites and read before I should go for Mask2D but I am not sure how to use it or if it would make a difference.
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281
    Mask uses a shader to hide elements outside of the area which can be quite costly on mobile platforms. Mask2D does a very simple check to see if the rectangles are outside and clip them if they are. It's much faster but won't support non-rectangle masks(e.g a circle).
    If you are using a simple rectangular scroll view them a Mask2D should provide a performance improvement.
    Just remove the Mask component and add the Mask2D in place of it.
     
    ZYSHAQ likes this.
  3. ZYSHAQ

    ZYSHAQ

    Joined:
    Jun 26, 2015
    Posts:
    76
    "but won't support non-rectangle masks(e.g a circle)." Thanks for the advice.
     
    karl_jones likes this.