Search Issue Tracker

Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.

Postponed

Votes

8

Found in

2017.4.0f1

2018.3.0a1

2019.1.0a1

2019.1.2f1

2019.2.0a1

2019.3.0a1

Issue ID

1160252

Regression

No

Canvas.BuildBatch occurs when moving the parent Game Object of a Canvas

IMGUI

-

How to reproduce:
1. Open the attached 'Canvas Bug Report.zip' project
2. Open Profiler
3. Play the "SampleScene' scene
4. Observe 'Canvas.BuildBatch' in Profiler

Expected result: Canvas.BuildBatch does not appear in Profiler
Actual result: Canvas.BuildBatch runs 100 times each frame, one time for each Canvas and takes roughly 10% of the project's performance

Reproducible: 2017.4.29f1, 2018.4.2f1, 2019.1.7f1, 2019.2.0b6, 2019.3.0a6

  1. Resolution Note (2019.3.X):

    Currently rendered objects final position are calculated by the canvas invmatrix. When a parent object is moved the canvas needs to update its invmatrix which causes the batches to be regenerated.

Comments (2)

  1. seanybaby2

    Dec 02, 2020 22:56

    This is a pretty major issue, surprised more people aren't noticing it. This basically make it so moving any nested canvases causes major FPS hits. We're having to gut all of our world space canvases and turn them into sprites as a result.

  2. nindim

    Nov 09, 2020 09:47

    I ran into this a while ago and now have a second use case where it would be great for this to be fixed/changed.

    1) Screen transitions. We should be able to move the canvas (or its parent object) on and off screen without triggering a rebuild. I have worked around this for now by moving the UI Camera in the opposite direction, but this means you need a Camera per UI page and involves a number of other rather dirty hacks (switching to world space at runtime, calculating the page width in world units etc).

    2) I have a need to physically move a UI page so it is temporarily rendered by another page's UI Camera (for sorting reasons). Moving the Canvas or its parent object will incur this batch rebuild and this causes a runtime stutter whenever the UI page is moved.

    Thanks,

    Niall

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.