1
NGUI 3 Support / Re: DrawCall Rebuild Causing Performance Issue
« on: August 23, 2016, 10:22:48 AM »Quote
How many widgets do you have per card? You can try having nested panels in there, say one panel per card. Moving panels is very efficient, so you will effectively eliminate all draw call filling altogether.
Thank you ArenMook! The performance is much better now.
Each of my "card" contain 16 widget, so I used to have about 1600 widgets in one panel. After splitting the panel there is no more spike for the FillAllDrawcalls. On my Samsung S3 it runs at around 15 FPS when dragging -- not perfect but acceptable.
By the way, when I was using the "one big panel" method, I noticed the "FillAllDrawcall" function sometime get called even I do nothing. It appear the offscreen widget movement or alpha change also trigger this function. Is it possible to optimize it by checking the isVisible parameter in the "UpdateWidgets()" function? (As shown in the code below at the last line)
Will it have any side effect?
- // Copy from UIPanel.UpdateWidgets
- if (!mRebuild)
- {
- // Find an existing draw call, if possible
- if (w.drawCall != null) w.drawCall.isDirty = true;
- else FindDrawCall(w);
- // ^- Can we change this line to:
- // else if(w.isVisible) FindDrawCall(w)
- }

