#How can I manually control when to render?

8 messages · Page 1 of 1 (latest)

modern pollen
#

Hi everyone!

  • I'm using a 2D camera and all my visible entities are Sprites.
  • Most of the frames, no visible (within the camera bounds) sprite moves. Neither does the camera.
  • Still, when use Google Chrome profiler (my target platform is WASM), I can see Bevy spends part of the frame rendering. A big chunk of it because I have so many entities.
  • However, it's a big no-op, because the rendered frame is exactly the same as before. Nothing really moved.

My performance budget is very strict because I want to save as much battery as possible on portable devices.

How can I redraw the screen on demand, so I can refresh it only when some thing has moved?

#

I already asked about this with some more details [here](#rendering message)

ReactiveLowPower didn't help me because winit events & user input doesn't necessarily move anything to require a screen refresh.

rough osprey
#

you can't currently decouple rendering from update with bevy

sharp bay
#

Without a custom runner?

modern pollen
#

you mean, without creating my custom runner?

well, if possible I would use bevy_winit built-in runner

But if it isn't possible, then I will have to implement my own

#

I was asking first to confirm that there is no way to achieve this currently, before putting the effort on building a custom runner.

you can't currently decouple rendering from update with bevy

Should I then disable WinitPlugin and replace it by my own @rough osprey ? Or maybe use it but setting my own runner?

rough osprey
#

I don't know if there's a desire to merge that work though