I’m having as many other the issues of broke prefabs so I did manually “fix” the minimun needed to run so I could give it a rough test to the beta and see if I could see something else “broken”.
I noticed game was running super low on editor, on 2018.2 for tested setup I should be gettin like 115 fps, I was getting 30 or so, launched profiler and saw this:
For some reason, it is taking a hell of effort to render text. it does not matter if its dynamic or stati text. My UI is mainly text so may be if there where mor images it would be them…
As I’ve uploaded the project to a server I will wait a bit and see if anyone suggest something and if not I’ll report a bug and link to the project for repro.
How does the “Canvas.SendWillRenderCanvases” compare to earlier versions of Unity? In 2018.3 it shows 3.19ms, how fast is it if you repeat the same test with 2018.2?
Hey. Are you perhaps making a change to the layout every frame? If I remember correctly changing your UI causes the entire canvas to build, so if you have a lot of objects this can cause a lag spike. Are you doing something to the text every frame? can you show us the your UI hierarchy?
I took an screenshot of it running in editor: 2018.2.0f8 (I was using f2 till today but it runs same), but you can se canvas hit even in editor is small, vs 14ms of the 2018.3 editor.
//-------------------------------------------------------------------
Yes I’m updating txt every frame, its the timer up in teh middle. I thought of it also, but dissabling just the timer seemed not to make a dramatic difference.
I’ll try to see if I’ve any kind of Update canvases called accidentally, but I believe that should also clog the profiler in 2018.2.
Layout wise not sure what changes caould cause full refresh, but yes as the milisecs change value the text move a little, but as I said, it won´t skyrocket from 30 to 100 just dissalbing timer, tonight I’ll look again in depth to see if I manage to catch cause and see if its fixable or should be reported. The strange thing tho is I’m the only one, but may be the prefabs issue is holding many (if not all) ppl to port their projects and allow testing for such things.
If this used to work, then please submit a bug report for it. If possible, with the project attached. You can also share read access to your repository, instead of uploading the project through the bug reporter.
Edit:
I see you already uploaded the project in a prior report. In that case please refer to that case in the new report.
Hey, sure but I believe this is the same issue https://discussions.unity.com/t/715111
I posted in there notes for your team to reach out my project, that is already accesible to your staff for another issue.
I can send you PM with acces data if that eases things.
edit: OK
edit2 Unity QA notified me this to be same as
** (Case 1081996) **
@TokyoWarfareProject So i looked into your issue as well because your perf loss didn’t make sense to me in terms of the other case.
So “good” news, the issue is due to your scene set up. There is one canvas object that has 2 CanvasScaler component on it. Remove one and all should go back to normal. There should be no case where both are required as they write to the same value on the Canvas, and that was exactly the cause of the issue.
In pre 18.3 the CanvasScaler would track the “previousScaleFactor” locally and only write to the canvas if the local value changed. In 18.3 and beyond this check has moved to the Canvas itself as it fixes some other bugs around the CanvasScaler not setting values at proper times. What happens now is both CanvasScallers on this Canvas are fighting with each other. The first is set to ConstantPixelSize and sets the ScaleFactor to 1. The second is ScaleWithScreenSize and sets the ScaleFactor to 0.47. The canvas gets the first value sees its different and sets the value then sends out the appropriate message. That message is OnRectTransformDiemensionsChanged which tells all children elements that they need to rebuild both the Geo and layout. In your case changing the geo is expensive as you are using the Outline component on your text thus you saw a improvement when you removed your text. Its ok for one off updates but constant its noticeable.
I’m not sure why we ever allowed multiple of the CanvasScaler component so i’ve added the tag to disallow that but i dont think it removes any current duplication so you’ll have to do that manually.
Indeed AWESOME news!!! I likely accidentally droped that second canvas and overlooked as the canvas object is not something I modify.
I’ll check the performance hit of the outlines, still I see a bit of an overkill impact they where having even if it was twice. Probalby that is further solved by now. This, and the aparently fixed preba import paves the way to proper beta testing for me. I badly whant to test 3.4.2 physix as the experimental 3.4.1 editor was showing waaaaaaaaaay more stable behaviour with joints even at double the timestep.