Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Performance spike on Canvas.SendWillRenderCanvases when moving a panel

Discussion in 'UGUI & TextMesh Pro' started by CremaGames, Dec 1, 2014.

  1. Alpacatron

    Alpacatron

    Joined:
    Apr 11, 2016
    Posts:
    2
    My problem was very simiar to yours, the solution was changing the canvas to SCREEN SPACE-OVERLAY, that increased my fps from 15 to 120 fps when moving the camera, i hope that help someone with the same problem..
     
    IgorAherne, leni8ec and Tethys like this.
  2. hosamre94

    hosamre94

    Joined:
    Jan 18, 2017
    Posts:
    2
    I have similar issue. and My solution was switching all my texts from dynamic to static.
     
    IgorAherne and leni8ec like this.
  3. fazhom

    fazhom

    Joined:
    Jan 18, 2013
    Posts:
    10
    removing outline and shadow on a simple label on weapon bar had also a huge effect for me

    It may be important: this text as well as 2 others that were causing huge pikes had an animation component. I have outline and shadows on other texts on the same canvas and, removing the shadow or outline component didn't have the same impact as the animated ones
     
    Last edited: Feb 23, 2017
    leni8ec and Tethys like this.
  4. MESSI007

    MESSI007

    Joined:
    Feb 18, 2017
    Posts:
    4
    i think that's because we are changing somthing in canvas so fast , like 0.1 periode,
    i decreased the periode of changing the alpha of a button , and the translation of the camera (in the same coroutine)
    since that this problem appearing evrey time i start the game (cause my coroutine just finished when it complete the camera path)
     
  5. webster

    webster

    Joined:
    Jun 8, 2013
    Posts:
    21
    2017.1p5 Having this problem. Thanks for all the tips above, I've tried a few, will try them all.
     
  6. Marrt

    Marrt

    Joined:
    Feb 7, 2012
    Posts:
    613
    Having problems too, i tracked it down to this:

    Per frame, I am setting anchors on 9 RectTransforms that contain one tiled image each

    target.anchorMin = anchors.min;
    target.anchorMax = anchors.max;

    this takes 75% of my frame time, 10ms (violet)
    upload_2017-11-4_22-11-24.png

    - These 10ms decrease to about 2ms if i change the image from tiled to single
    - the time increases when i move the camera
    - screenspace is overlay

    version 2017.2.0f3
     
    Last edited: Nov 4, 2017
    Mikael-H likes this.
  7. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    So from what I have gathered from this thread is:

    - Disable pixel perfect
    - Watch out for outline (I have noticed it has a significant effect on execution time, but none on GC alloc)
    - Set fonts to not be dynamic
    - Watch out for tiled ui sprites

    My own experiments point to content size fitters and layout groups. These both take up a lot of time AND generate garbage. If anyone know of some kind of clever optimization like making them only do their work once and then not do anything until there is a change or similar I'd like to know.
     
    TigerHix, MGGDev and vexe like this.
  8. Zynigma

    Zynigma

    Joined:
    Sep 23, 2012
    Posts:
    22
    As with @Mikael-H, a combination of of these affected me. Changing the fonts from dynamic wasn't fun, but it showed improvement along with removing the outlines. At the moment trying to use dynamic fonts for menus and static fonts for gameplay. Thanks all.
     
    Mikael-H likes this.
  9. danBourquin

    danBourquin

    Joined:
    Nov 16, 2016
    Posts:
    34
    I had a similar issue.
    The problem for me was a TextMeshPro (UI) with a lot of text changing every frame (debug console). The issue was about the "Auto Size" option. Every frame the component adjust the text size and it was a huge performance issue.

    I fix it by disabling the "Auto Size" option and set a small font size value.
     
    Neil-Corre likes this.