How to stop render loop in playground?

I remember this used to be easier, but for some reason I cannot figure this out: https://playground.babylonjs.com/#02A9VX#1

Calling engine.stopRenderLoop() at the top of createScene seems to have no effect. If I call engine.stopRenderLoop() asynchronously, it seems to work, but subsequent scene.render() calls don’t seem to actually render. Is there something I am missing in that playground?

Seem to have been able to fix by called await scene.whenReadyAsync(); before rendering, which makes sense.

Still seems strange that the top level engine.stopRenderLoop() has no effect. PG: Start render loop before creating scene by BlakeOne · Pull Request #11783 · BabylonJS/Babylon.js · GitHub

The PG from @Blake’s PR still works:

In your PG you call scene.render() a single time and I’m not sure it has ever worked when there’s no engine render loop(?).

I’m not trying to render continuously, just a single time. This PG fixed my issue: https://playground.babylonjs.com/#02A9VX#3

1 Like

Yes, calling executeWhenReady (or readyWhenAsync) after everything has been setup is the way to be sure that all objects are ready to be rendered.

2 Likes