1
NGUI 3 Support / Weird performance drop on UIPanels
« on: February 16, 2015, 08:18:03 AM »
We've been working on a game project for a while now, which is about to be wrapped up. However, we are now running into a strange problem that seems to be NGUI-related. Let me first explain the setup.
Our game uses several different NGUI objects (meaning seperate UIRoot components) in different places of the game. We have our main game GUI which is one NGUI object, then there's our in-game menu which is another and an effects object for fading to/from black, showing load screens, etc. When we came around to creating the credits for our game, these were also created in a separate NGUI object that we instantiated when needed. This all worked well for a long period of time (and still does), but at some point we noticed that after showing the credits of our game, we experienced a very drastic increase in computation time for UIPanels.
I started trying to narrow it down by using the Profiler.BeginSample method and eventually figured out that it was calling the method FillDrawCall that seemed to be taking a huge hit. There was no more calls to this method than before the slow down, but suddenly it took like 10-20 ms longer pr. call to this function. At the same time, the Profiler also reported the camera using a lot of time each frame on a process named "Mesh.CreateVBO".
I've tried to find information on this behaviour and found others that had reported something similar on this board, but not with a solution that works for us. The strange thing is that this frame rate drop does not happen when using any of or other NGUI objects. No matter how much we go back and forth between levels, in-game menu and main menu, there never seem to be any performance problems. It only happens after we've shown the credits, which are basically nothing but a panel containing several labels that fade in and out. What's even weirder is that the performance issue doesn't happen if we only show part of our credits (like for instance only the first five labels), so it doesn't seem to be actually instantiating the object that's causing it. I also tried integrating the credits as a part of our 'effects UI', since this one is pretty much always active in the game, but the problem is exactly the same.
I know it might sound very confusing, but generally, I'd just like to know what could cause the dramatic increase in calling FillDrawCall, or get some hints and inputs on where to start looking for the error. I feel like I've tried a lot of stuff to find out why this is happening and how to fix it, but as said, it only seems to happen after having shown some amount of credits. The credits objects are deleted after use and there are no other objects leaking. Any help would be much appreciated.
Our game uses several different NGUI objects (meaning seperate UIRoot components) in different places of the game. We have our main game GUI which is one NGUI object, then there's our in-game menu which is another and an effects object for fading to/from black, showing load screens, etc. When we came around to creating the credits for our game, these were also created in a separate NGUI object that we instantiated when needed. This all worked well for a long period of time (and still does), but at some point we noticed that after showing the credits of our game, we experienced a very drastic increase in computation time for UIPanels.
I started trying to narrow it down by using the Profiler.BeginSample method and eventually figured out that it was calling the method FillDrawCall that seemed to be taking a huge hit. There was no more calls to this method than before the slow down, but suddenly it took like 10-20 ms longer pr. call to this function. At the same time, the Profiler also reported the camera using a lot of time each frame on a process named "Mesh.CreateVBO".
I've tried to find information on this behaviour and found others that had reported something similar on this board, but not with a solution that works for us. The strange thing is that this frame rate drop does not happen when using any of or other NGUI objects. No matter how much we go back and forth between levels, in-game menu and main menu, there never seem to be any performance problems. It only happens after we've shown the credits, which are basically nothing but a panel containing several labels that fade in and out. What's even weirder is that the performance issue doesn't happen if we only show part of our credits (like for instance only the first five labels), so it doesn't seem to be actually instantiating the object that's causing it. I also tried integrating the credits as a part of our 'effects UI', since this one is pretty much always active in the game, but the problem is exactly the same.
I know it might sound very confusing, but generally, I'd just like to know what could cause the dramatic increase in calling FillDrawCall, or get some hints and inputs on where to start looking for the error. I feel like I've tried a lot of stuff to find out why this is happening and how to fix it, but as said, it only seems to happen after having shown some amount of credits. The credits objects are deleted after use and there are no other objects leaking. Any help would be much appreciated.