rukai / rukaidata

Uses brawllib_rs to display frame data of characters
https://rukaidata.com
MIT License
8 stars 1 forks source link

Full CPU/GPU usage even when paused (brawllib_rs) #24

Open jagoly opened 2 years ago

jagoly commented 2 years ago

Right now, rukaidata will always re-draw the viewport, even if the animation is paused, and the camera and options have not changed. This means that cpu and gpu utilisation is very high whenever a subaction is open.

For me, using a laptop, this is pretty annoying since I have to always remember to switch to a different tab before alt-tabbing away from firefox. Often I forget and am only reminded when my legs start to get warm :(

I believe that it should be not too hard to change it so that the viewport only gets rendered when something has changed. I had a quick look into trying to do this myself, but for now at least it's beyond my extremely basic rust knowledge.

Thanks again for the tool!

rukai commented 2 years ago

Thanks for the report.

The rukaidata javascript renderer will be replaced by the brawllib renderer running over wasm soon. It's already accessible behind the --wasm flag,

So no point fixing the issue in the javascript renderer but the wasm renderer probably has the same issue. The solution would be to only redraw when a https://docs.rs/winit/0.25.0/winit/event/enum.Event.html#variant.RedrawRequested is received