Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
1
Question by Mhyshka · Feb 08, 2016 at 08:54 PM · uitextoptimizationdrawcalls

uGUI Text draw calls

Hi,

I've got the following UI : alt text

I'm optimizing draw calls.

And as you can see, 15 draw calls. High for what i'm displaying. ( Already Spritepacked, only one font. )

I investigated, and i think the uGUI text are causing me troubles.

Here is the same view without the text :

alt text

From 15 to 3 draw calls.

In the cell widget ( prefab ), deleting the text GO and making a brand new one fixed the issue.

In every other label, even if i make a brand new one, the frame debugger stops on it and ALWAYS use one draw call to draw ONE label.

Looks like the text rendering is done exaclty in the hierarchy's order, without any optimization.

I can't find what's the problem about my texts.

Any idea?

Alex.

total.png (174.0 kB)
nolabel.png (104.4 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by hexagonius · Feb 08, 2016 at 09:06 PM

From my understanding, you need to consider 3 facts here

  • The UI is rendered in hierarchical order

  • dynamic text is written to a texture with appropriate size

  • for batching to work, material and texture atlas hehe to be the same

so what I think you'd need to do is ordering your visuals. batches sprites first, texts last

Comment
Add comment · Show 1 · 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 Mhyshka · Feb 08, 2016 at 09:26 PM 0
Share

It does work if i place all my texts at the end of the hierarchy. But i'm using layouts and this is not something i can do, is it?

eg : With a vertical layout with title at top, you can't put your texts at the end of the hierarchy, can you?

edit: by the way, with the default "UI\Button" which contains a image and a text, this issue doesn't occurs. ( Label that aren't at the end of the hierarchy still are rendered all at the same time if they aren't overlapping. )

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

52 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

Related Questions

Draw calls and text on UGUI 0 Answers

Best optimization for multiple UI Canvas from prefabs 0 Answers

GUI/Text Asset for Unity? 0 Answers

Simple Game Over script 2 Answers

Set default text color when extending Text component 1 Answer


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