Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: MikeMoki on February 15, 2013, 04:38:21 PM

Title: Animation within a UIPanel and performance
Post by: MikeMoki on February 15, 2013, 04:38:21 PM
I was wondering the best approach for animating postion / scale of UIWidgets that are under a UIPanel.  Application requires a lot of movement and scale changes that will be happening every frame.  Currently hitting a performance bottleneck with UIPanel.LateUpdate and specifically the UpdateTransforms method while animating a few dozen widgets.  Are there any tricks to making this more performant or is this just not a good use case for NGUI?

Thanks!
Title: Re: Animation within a UIPanel and performance
Post by: ArenMook on February 16, 2013, 01:58:23 AM
Adjusting transform of panels = cheap. Adjusting transform of widgets = expensive. Group changing things into their own panels so that their updates don't affect other widgets, and animate panels instead of widgets whenever possible.
Title: Re: Animation within a UIPanel and performance
Post by: mixd on February 18, 2013, 01:50:16 AM
Try Futile:
https://github.com/MattRix/Futile

Doesn't seem to differ much from NGUI in terms of the core technique they use to render things, so it seems completely possible to free NGUI of this limitation someday.

Check it out -- very cool engine. I'm finding that NGUI really isn't suited for 2D games due to UpdateTransforms, which is unfortunate because it is always nicer to use a single library.

With Futile, I can get 15,000 2D objects (60,000 verts) on the screen all at once, all animating at the same time. Not that you'd need that many objects in a single game view, but point is, it's fast -- just not as convenient for simple UI. (Forgot to mention this is on an iPhone 4s)
Title: Re: Animation within a UIPanel and performance
Post by: mixd on February 18, 2013, 03:18:52 PM
Aren -- was hoping to get your take on this, and wonder if NGUI might someday re-implement its core drawing functions to have performance comparable to something like Futile? Would love to be able to use NGUI as my sole 2D library in all projects! (Like for an RTS or TD game or something)
Title: Re: Animation within a UIPanel and performance
Post by: ArenMook on February 18, 2013, 05:05:04 PM
There have already been some changes inside Unity itself that make the UI faster (4.1). The only other thing that would improve its performance would be a more clever way of filling the draw buffer -- but that's on the theory list for the time being.
Title: Re: Animation within a UIPanel and performance
Post by: mixd on February 21, 2013, 07:23:37 PM
Hmm. Have you looked into Futile? It's really in a different realm of performance. Yet effectively renders the same way as NGUI. See absolutely no reason why NGUI couldn't also be this fast. Gotta be a core difference somewhere. We are talking many orders of magnitude, especially when there are only a few objects moving on a large mesh.