Power saving mode

Hi!
If you didn’t know yet, you can save power and help save our planet :earth_africa: by stopping the render loop if the user is idle for example. It’s not applicable in all situations obviously. In my scene I just need to update the shadows (I’m doing it every 5 minutes) if there is no user interaction. Simply call engine.stopRenderLoop() to stop and engine.runRenderLoop(() => { scene.render() }) to start. And it’s a quite good idea to detach the mouse from your canvas when stopping the render loop and reattach it when starting it again to prevent unwanted movement after the loop restarts, because the engine is still reacting to the mouse it is just not rendering the output.

EDIT: To make more sense, the last frame stays displayed on the canvas even when you stop the render loop :slight_smile:

Running render loop:
image

Render loop stopped:
image

Quite huge difference. :heartpulse: :earth_americas:

8 Likes

Oh man, I like your precision and the philosophy in your answers!l But the most I like the little puns, the twists and a bit of trolling :joy::+1::sunglasses: keep them coming…

EDIT: hopefully I get your answers right! Spock out. :vulcan_salute:

1 Like

My son was a member of a junior research team at NASA and they’ve discovered a new asteroid using distributed computing, distributed minds, I mean they did a lot of manual work, but the paradox here is, that I had to let him use all our compatible devices to make the background computations 24/7, so this is the opposite case. The distributed approach significantly raised my power bill… Now that’s a paradox on your paradox :rofl:

Would it make sense to run a BabylonJS powered app on a render farm? Is it possible? Quite interesting topic I believe. I was once discussing with David, whether it’s a good idea to render multiple layers on multiple cores, output each to a different canvas and then join them at the end. Parallax rendering?

2 Likes

I am with the Dinos :joy:

I believe, we have all have a mutated XYZ chromosome :joy: so basically we are the new XYZ-Man :joy:

P.S. there can be multiple active render loops! engine.activeRenderLoops.

P.P.S. engine.stopRenderLoop(func); can take a param to stop just one render loop.

:robot: powering down

1 Like