I'm looking for a way to reduce rendering time for my Game Over scene. A quick look of the scene components is like this:
All yellow objects are UIButton, texts are all UIText, white areas are all UIImage (including the background). The friend list is a Facebook friends list contained inside a Scroll View. All object are inside a Canvas that resizes to the camera.
I noticed the problem firsthand when playing the game on Android. This game over scene is running at 15fps (while the main game play scenes are all running at nearly 60fps). The phone is a HTC One. On my cheap LG phone the game simply crashes at this scene.
Profiler shows Camera.Render() taking 70~90% of each game loop.
The iPhone5 & 6 on the hand is quite interesting, fps show no real difference between gameplay scenes and the gameover scene, both running smoothly at ~120fps. Still Camera.Render() was taking 40~50% of each loop in GameOver scene vs ~20% on GamePlay scenes.
Quite strange considering the fact that HTC One specs and iPhone 5's are quite similar.
I think the problem is because of the large number of UI Components on the GameOver Scene, since sprites on gameplay scenes are all batched (it's a 2d game). So I suppose I must find a way to reduce draw call on all those UI components. I thought this should be a common problem, but strange enough I've been searching for weeks without a sounding solution that actually work.
- I've tried to check all UI objects static: doesn't show any notice-able change. On the other hand, Scroll View's contents are what's taking the bulk of the rendering (a long friend list), and I can't mark them as static because they do move.
- Canvas pixel perfect off: already done that from the beginning.
- Move the Scroll View to a separate Canvas: only improve performance when I'm actually scrolling scroll view, otherwise no change. And - could be I did something wrong - the scroll view doesn't work on Android anymore.
TL;DR; Question: Please guide me to reduce rendering time on scenes with lots of UI elements.