Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 TruffelsAndOranges · Jul 05, 2015 at 08:56 PM · user interface

Huge lag spike when activating a UI.Text GameObject.

Basically I activate (using SetActive(true)) a UI.Text GameObject when the player touches a book. When this happens the first time I get a huge performance hit visible in the profiler: Canvas.SendWillRenderCanvases() (46.4%) : Font.CacheFontForText (8.4%)!

Why? Can I avoid this?

Comment
Add comment · Show 2
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 TruffelsAndOranges · Jul 05, 2015 at 09:19 PM 0
Share

I tried making a script that reactivates the UI.Text GameObject, but this will then cause a:

CanvasUpdateRegistry.PerformUpdate() (77.0%) -> Graphic.Rebuild() -> Text.UpdateGeometry()!

How can the UI be so expensive? This seems horrible. o.o

avatar image TruffelsAndOranges · Jul 05, 2015 at 09:20 PM 0
Share

Basically I'm on Windows 7 with a 3.5GHz processor and 970 GTX and I get horrendous FPS drops due to a SINGLE UI.Text! ...

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by SpaceBird_ · Jul 05, 2015 at 09:41 PM

It might be because the canvas your text is on has pixel perfect checked. Pixel perfect can cause performance issues in some cases.

Comment
Add comment · Show 2 · 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 TruffelsAndOranges · Jul 05, 2015 at 10:38 PM 0
Share

I dont have pixel perfect checked since I'm using World UI scale mode.

avatar image Aurko · Oct 19, 2016 at 03:23 PM 0
Share

You tip saved my project at last moment, Thank a LOT... :D

avatar image
1

Answer by $$anonymous$$ · Jul 05, 2015 at 10:48 PM

Check font settings of the text you use on your UI.Text.

Having insanely high 'Font size' increases the generated font texture and that might yield to what's happening to you. Check the character set as well.

I usually go with Font size : 64 Rendering mode : smooth Character : ASCII default set

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 TruffelsAndOranges · Jul 05, 2015 at 10:52 PM 0
Share

The font size was not the problem.

However, I cannot find "Rendering mode: Smooth". Where can I find this?

avatar image $$anonymous$$ · Jul 05, 2015 at 11:59 PM 0
Share

You can find it when you actually select the font asset (not UI.Text). Try this. Create a new UI.Text it shows that the selected Font (under 'Character' section) is 'Arial'. Change that to your custom font (Drag a font file to unity and select that as the font for UI.Text). If you go to that newly imported font asset, in import settings you would find Rendering mode.

avatar image TruffelsAndOranges · Jul 06, 2015 at 11:21 AM 0
Share

Thanks! :)

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

22 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

Related Questions

UI System for Non-minimal User Interfaces 0 Answers

Simple UI not appearing once deployed to iOS (4.6.2) 1 Answer

Universal Method of finding pixel dimensions of UI elements 1 Answer

Set InputField non-interactable without clearing text 1 Answer

Slider and Input Field Value Updates 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