#Optimize Rendering of 2D Scene

1 messages · Page 1 of 1 (latest)

mellow condor
#

How do I optimize the rendering of a 2d scene?

Here is where I stand and what I've tried:

I have a decently sized static scene consisting entirely of control nodes. Think labels, buttons, TextureRects, containers etc.

This scene is pretty heavy on mobile devices, causing heat buildup and high power draw. However, with low processor mode enabled, all of these performance issues disappear :-).

Now to the issue: as soon as a dynamic element, such as a TextureRect with a "shine" shader, is added to the scene, all the savings that low processor mode brings go out the window.

I tried putting the TextureRect into its own SubViewport to prevent it from causing redraws on the rest of the scene, but that had no effect.

 - ... other stuff
  - SubViewportContainer
    - SubViewport
      - TextureRect_With_Shader

So my question is, how do I isolate the rendering of a dynamic element so the entire rest of the Scene does not need to be redrawn every frame?

#

Here are some tests I did on an iphone 16 with data collected using xCode's diagnostic tools. The tl;dr interpretation of the data is my post above, but perhaps I am misinterpreting😀 . Note that the display power draw is constant, so we can use it to calculate how much cpu/gpu load has changed across different scenarios. FPS was always capped at 45.

Static 2d scene without tweens/shaders:
 - cpu load: 54%
 - app power draw % breakdown on iphone, as shown by xcode
    - display:  39.5
    - cpu:      36.5
    - gpu:      24

Same scene (+ low processor mode):
 - cpu load: 3%
 - power draw % breakdown
    - display:  81.5
    - cpu:      17
    - gpu:      1.5

Same scene but also contains TextureRect with shine shader (+ low processor mode):
 - cpu load: 55%
 - power draw % breakdown
    - display:  39
    - cpu:      37.2
    - gpu:      23.8

Same scene containing TextureRect with shine shader in its own SubViewport (+ low processor mode):
 - expectation: same performance as scene consisting only of TextureRect with shader (see next benchmark)
 - reality: exactly the same performance figues as without SubViewport (benchmark above), indicating whole scene redraw

Scene consisting only of said TextureRect with shine shader (+ low processor mode):
 - cpu load: 22%
 - power draw % breakdown
    - display:  44.9
    - cpu:      45.5
    - gpu:      9.6
valid sentinel
#

Have you looked into using the Profiler? It can help with spotting slow/heavy performance/elements.

You mention control nodes, labels, etc.. Have you enabled shadow on your labels? There was an issue with label shadows, which got fixed & merged in 4.5.beta1.
Yesterday, a new beta came out, maybe try that one: 4.5.beta6.
Or test turning (label) shadows off.