phoenix icon indicating copy to clipboard operation
phoenix copied to clipboard

Reduce the CPU usage when nothing is going on

Open ntadej opened this issue 4 years ago • 5 comments

It seems Phoenix keeps doing high-FPS rendering even if nothing is going on (no animation, no user action). It might be useful to prevent this and only re-render when needed.

ntadej avatar Jan 20 '21 12:01 ntadej

Actually this is a good point - thanks @ntadej. Let me ping @9inpachi since I know he has been modifying the animation loop recently and might have an idea of how feasible this is to do...

EdwardMoyse avatar Jan 20 '21 13:01 EdwardMoyse

Indeed. I also thought of implementing this after seeing a game that only renders when controls are used. We could have a similar render function only on either camera movement or when the animation runs. Let's keep this issue as a reminder of implementing this. Thanks @ntadej

9inpachi avatar Jan 20 '21 15:01 9inpachi

See #233 for an attempt.

9inpachi avatar Mar 22 '21 16:03 9inpachi

This is interesting: https://discoverthreejs.com/book/first-steps/animation-loop/

(see render on demand)

EdwardMoyse avatar Apr 14 '21 20:04 EdwardMoyse

(see render on demand)

We already have this in our ThreeManager. See this function. The hard part is to actually call it in tons of places and then manage every update.

9inpachi avatar Apr 15 '21 18:04 9inpachi