• 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
1
Question by Deadcow_ · Sep 08, 2015 at 06:13 PM · uiimagealphafadeslow

Unity 5.2 Canvas.RenderOverlays serious fps hit

Hello. To fade in/out (cinematographic effect, when the screen smoothly turns black) the screen I use Canvas with black image on it, and smoothly lerp CanvasGroup Alpha value over time. Updated Unity to 5.2 just now and this system turned into a massive performance hit. alt text

As you may see, that purple spikes represent FadeIn and FadeOut. Game plays like in slide-show during this translations. I had read over Upgrade Guide but foud nothing helpful...

2015-09-08-21-03-35.png (103.4 kB)
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 adamonline45 · Sep 08, 2015 at 06:47 PM 0
Share

Ins$$anonymous$$d of messing with the canvas' alpha, lerp the image's color property to/from full-alpha and see if that helps.

avatar image Deadcow_ adamonline45 · Oct 13, 2015 at 08:13 AM 0
Share

Tried it just now. Result is the same :( I'll try to use Sprite overlay ins$$anonymous$$d of UI.Image. $$anonymous$$ay be that will help.

2 Replies

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

Answer by Deadcow_ · Oct 16, 2015 at 07:28 AM

Okay, I still don't know how to deal with huge images dynamic transparency (which is causing the hit) but in my case just had replaced UI.Image with Sprite and all went fine

Edit: Fixed in 5.3.6: https://issuetracker.unity3d.com/issues/waitingforjob-spike

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 arlefreak · Jun 07, 2016 at 06:26 PM 1
Share

Here is the bug report, fixed on Unity version 5.3.6 https://issuetracker.unity3d.com/issues/waitingforjob-spike

avatar image
0

Answer by Pundek · Oct 03, 2015 at 02:37 PM

I've the same problem here.... alt text


sem-titulo.png (244.6 kB)
Comment
Add comment · Show 5 · 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 Pundek · Oct 02, 2015 at 08:15 PM 0
Share

Here is the script that i use to change the alpha of a canvasgroup:

     private IEnumerator GoInCanvasEffect(CanvasGroup _canvasgroup, float _alphaSpeedFactor = 1f, bool _interactable = true, Selectable _nextButton = null)
     {
         #region GO IN CANVAS GROUP
         if(_canvasgroup.gameObject == null)
         {
             return true;
         }
 //        Debug.Log("Put on Screen: " + _canvasgroup.name);
         _canvasgroup.gameObject.SetActive(true);
         
         float alpha = _canvasgroup.alpha;
         float lerpFactor = 0;
         while(_canvasgroup.alpha < 1)
         {
             lerpFactor += _alphaSpeedFactor * Time.unscaledDeltaTime;
             _canvasgroup.alpha = $$anonymous$$athf.Lerp(alpha , 1.0f, lerpFactor);
             yield return new WaitForEndOfFrame();
             if(_canvasgroup.alpha >= 0.99f) _canvasgroup.alpha = 1.0f;
         }
 
         yield return StartCoroutine(CoroutineUtil.WaitForRealSeconds(0.1f));
 //        yield return new WaitForSeconds(0.1F);
         _canvasgroup.blocksRaycasts = _interactable;
         _canvasgroup.interactable = _interactable;

         }
         #endregion
     }


avatar image Deadcow_ · Oct 12, 2015 at 08:58 PM 0
Share

Do you have any luck to fix this? I'm still use the old Unity version, because this bug still there since 5.2

avatar image Twistplay · Oct 17, 2015 at 11:20 AM 0
Share

We are seeing the same issue too, but in our case on a Text object in the UI, so replacing with UIImage is not an option in our case. Only happened when we moved up to Unity 5.2.x

Has anyone tried it with one of the patched versions of Unity? 5.2.1p1 does mention a fix to some UI performance regressions, but not clear if it's the same issue.

I also observe that if you switch the profiler to the timeline view, it is waiting on a canvas sort job during the spike.

avatar image Deadcow_ Twistplay · Oct 18, 2015 at 07:23 AM 0
Share

The problem was there in latest 5.2.1p4.

avatar image Twistplay Deadcow_ · Oct 19, 2015 at 06:26 PM 0
Share

Has anyone made a small reproducible version to log an issue with Unity support? Concerned that a fix isn't going to make it into 5.2.2 otherwise ...

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

34 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

Related Questions

Fade in with CrossFadeAlpha 1 Answer

How to make a "Click to Continue" text message? 1 Answer

[4.6 UI] Image fading - How to? 2 Answers

Add smooth parts to UI.Image 1 Answer

Unity web player slow response to first interaction 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