I know that works, but the way I wrote it I have full control over my game loop and it needs to support Babylon WebGL as well.
In the docs you mention you want Babylon WebGPU to be backward compatible. Is there a reason direct calls to render() won’t work with WebGPU, or will this be supported in the future?
I think it deserves a mention in the Breaking Changes page at the least.
some context: the project is https://tuggowar.io.The goal is to enable WebGPU in the Electron build of the game.
Some housekeeping is not done when you don’t use runRenderLoop (engine.beginFrame / engine.endFrame are not called for eg). Also, the multi views (canvas) support won’t work, as well as VR as I can see there are some calls to VR functions in the engine._renderLoop wrapper.
So, not using runRenderLoop may work in your case but I’m not sure it is an officially supported way of doing things. @Deltakosh?
In any case, WebGPU needs at the minimum that beginFrame / endFrame be called: you can try to surround your scene.render() call by engine.beginFrame() and engine.endFrame() and see if that works.
For reference, here’s the render loop wrapper of Engine:
ok, I had no idea. I’ve been calling scene.render() for a long time now .
I can understand having to call another function that does more than just call scene.render(), but it seems like it should be supported for the user of Babylon to decide the moment and frequency with which to render.
But that’s up to you, I’m sure I will find a way to do that.