Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by QuantumCalzone · Apr 27, 2017 at 11:01 PM · uicanvasperformanceperformance optimization

Is multiple canvases for non changing ui elements better for performance?

Kind of a noob question. My game is 100% in unity's UI but it runs hot sometimes on mobile devices. I have only 1 canvas. Should I break up my UI into multiple canvases for elements that have no animation? Will that increase performance or am I better off with just 1?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image QuantumCalzone · May 03, 2017 at 11:39 PM 0
Share

thanks @Dadonik!

also a helpful link

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by DaDonik · Apr 28, 2017 at 07:51 AM

If anything inside a Canvas is changing, like changing the position of an UI element, or changing some text, the Canvas mesh has to be rebuilt. Depending on the complexity of your Canvas, this can result in 65535 vertices that have to be rebuilt per frame. You can seperate you UI into several Canvases, which i totally recommend, to minimize what needs to be rebuilt.

Regarding the device running hot: This can totally be the result of rendering 60fps. I had phones that ran hot with 60fps and not a lot to render at all. Try setting the Application.targetFrameRate to 30.0f. If your game is UI only, 30 fps should be fine i assume.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image QuantumCalzone · Apr 28, 2017 at 06:11 PM 0
Share

$$anonymous$$ay I ask, for example, if I was to build like Instagram in unity UI, which set up would be recommended?

Set Up #1 or Set Up #2

Just in case you're not familiar with Instagram, the yellow box would be a horizontal scroll rect (called stories) while the green box is a vertical scroll rect (the feed).

The stories scroll rect is, in fact, a child of the feed but because it can scroll would it not be better to have the be its own canvas? Or would it be better like v2 where all the scrolls are grouped under 1 canvas?

Thanks for your time!

avatar image DaDonik · Apr 28, 2017 at 06:32 PM 1
Share

Given the low amount of UI elements in both of these screenshots, i can't really imagine that your overheating issues come from rebuilding the Canvas. It really depends on how many scrollable items you have in those scrollviews. A Canvas can not have more than 65535 vertices and every character takes 4, so does every image, button, etc. So that limit should also be part of your decision. Generally i would tend to SetUp #1. It will take 3 drawcalls, because you have 3 Canvases, but that is not a problem at all. You will certainly save processing time when scrolling, even if it might not be noticable, depending on the amount of UI elements per Canvas. Better save then sorry =)

Have you tried changing Application.targetFrameRate? Note that Unity only allows either 30 or 60 fps on mobile devices, at least that was the case last time i tried setting the targetFrameRate. In theory that will split the heat your device exhausts in half...sort of.

avatar image QuantumCalzone DaDonik · Apr 28, 2017 at 06:42 PM 0
Share

thanks for your answer!

its been set to 30 fps from the beginning but I so have a fair amount of animated textures so im guessing thats the source of my problem and im trying to trim that fat on that.

avatar image
0

Answer by AdamAlexander · Apr 28, 2017 at 06:03 AM

I'm not sure I completely understand what you're asking here but I don't think it would make any difference to performance if you split your UI over multiple canvases. Normally I will only split my UI into multiple canvases because it made sense to organise them that way.

If you have lots of transparent ui pieces rendered over the top of each other that could potentially cause performance problems on mobile. But having multiple ui objects on one canvas I dont think so.

*Edit Looks like I'm wrong about this, but I would confirm that this is causing your performance issues with the profiler first, as there are other reasons your UI may be performing badly. I think splitting your canvases as a hard and fast rule would be premature optimisation.

Have you seen: https://unity3d.com/learn/tutorials/temas/best-practices/guide-optimizing-unity-ui

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

120 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can the UI system effectively manage dozens of frequently update sprites? 0 Answers

slow rendering and frozen frames in unity 2019.4.16f 3 Answers

Better way to make big 2D Game. UI Canvas, Transform calculation, animation 0 Answers

1 UI Text vs 2 UI Text 1 Answer

camera space performance/ aligncanvasrecttransformwithcamera 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges