Support => NGUI 3 Support => Topic started by: r.pedra on March 18, 2014, 05:17:11 AM
Title: Atlas Maker Popup is a CPU eater?
Post by: r.pedra on March 18, 2014, 05:17:11 AM
Hi, I noticed something with the Atlas Maker. I snapped it into the Unity main window and it is often displayed. Everytime the Atlas Maker is displayed Unity needs 70% of CPU and when i switch on another tab of my layout in Unity, it gets back to a normal value. I attached some screenshots to illustrates what I'm saying. (Same thing seems to happen with the Font maker)
Is this normal? Or is this something that you can optimize?
Title: Re: Atlas Maker Popup is a CPU eater?
Post by: Seith on March 18, 2014, 06:18:07 AM
That's weird I just noticed the same thing this morning in my project. The way I saw what was happening was by opening Unity's Profiler and checking "Profile Editor". The UIAtlas window was causing a lot of CPU work as it was constantly listening for changes and image file selection. So I closed the UIAtlas window and everything went back to normal.
I have always had the UIAtlas up in my layout and it never caused any problem before. But I had noticed something was wrong since the last NGUI update (or maybe the one before); Unity was slower than usual and "acting busy". It's just a coincidence that I managed to find out where that was coming from and I saw your message one hour later... :)
Title: Re: Atlas Maker Popup is a CPU eater?
Post by: ArenMook on March 18, 2014, 03:23:16 PM
Interesting... I will look into this when I return from GDC.
Title: Re: Atlas Maker Popup is a CPU eater?
Post by: Nicki on March 18, 2014, 06:50:51 PM
Sounds like something is going heavy work in a OnGUI script in UIAtlasMaker or something like that.
Title: Re: Atlas Maker Popup is a CPU eater?
Post by: r.pedra on March 27, 2014, 06:43:47 AM
UP (In case the GDC erased your internal brain memory :P )
Title: Re: Atlas Maker Popup is a CPU eater?
Post by: ArenMook on March 27, 2014, 07:25:25 AM
It did! Thanks for the reminder.
You can fix it by modifying UIAtlasMaker.OnSelectAtlas function to this:
void OnSelectAtlas (Object obj)
{
if(NGUISettings.atlas!= obj)
{
NGUISettings.atlas= obj as UIAtlas;
Repaint();
}
}
Title: Re: Atlas Maker Popup is a CPU eater?
Post by: r.pedra on March 28, 2014, 08:08:49 AM
Hi, it worked yesterday but today it's still eating my cpu. DockAera.OnGUI have a 10ms cycle and 75.5Kb of allocation.(Still happening only when Atlas Maker is open). It's falling to 1.4ms when I have the Atlas setted to None and nothing selected.(But my CPU is still at 80% )
Title: Re: Atlas Maker Popup is a CPU eater?
Post by: ArenMook on March 28, 2014, 08:39:46 AM
Likely the Font Maker this time, not the atlas maker. It has the same exact function with the same problem.