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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Scroll Rect / Text Mesh Pro FPS drop when scrolling

Discussion in 'UGUI & TextMesh Pro' started by Maniczombie, Jun 26, 2017.

  1. Maniczombie

    Maniczombie

    Joined:
    Oct 19, 2012
    Posts:
    15
    So I'm creating an android app for work that contains specification sheets for menu items. Problem is when scrolling, fps dips dramatically. I'm using the Unity Scroll Rect with Buttons which use Text Mesh Pro UGUI for text. Does anyone have any ideas how I can fix this?

    In the image below you can see in the profiler when I scroll down how the fps dips.

    Thanks.

     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    I believe there is bug in Unity related to a rounding issue when the RectTransform Anchor mode is set to Stretch mode where Unity thinks the size of the RectTransform has changed where it reality it has not.

    The implication of this rounding error ends up forcing the text object to all be re-layout when in fact they do not need to.

    Basically, when scrolling around, the text objects (assuming you are not changing them each frame) should be static. To determine if this is the case here, see if using Deep Profile if you can see if the text objects are getting regenerated as you scroll around (they should not). If they are, check your width and height of the RectTransforms and try to use rounded values. Ie. don't use 250.124. Again for testing, use a width and height of something like 250. We are just trying to determine if this is the rounding issue.
     
  3. Maniczombie

    Maniczombie

    Joined:
    Oct 19, 2012
    Posts:
    15
    Could you please walk me through the process step by step? I've never used profiler before. From what I understood, I tried changing the rect transform to not be stretched with a width and height of 250 but still get the drop in performance.
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    If you run the project in the Editor and enable the Deep Profile option in the Profiler, you should be able to expand the SendWillRenderCanvases and see if the text objects are getting regenerated as you scroll around.

    Alternatively, you can always provide me with a Repro of the project which I can look at. If that is easier for you, please make sure you PM me a private link to the Repro or submit a bug report which includes the repro project and provide me with the case #.
     
  5. Maniczombie

    Maniczombie

    Joined:
    Oct 19, 2012
    Posts:
    15
    Here is what I found when scrolling the view, though I don't understand much of it. Will send you the project in PM., Thanks
     
  6. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Thank you for providing the Repro project. I'll try to take a look at it tonight.