So we can say basically that on demand rendering is safe when we:
- disable paralell shader compilation:
engine.getCaps().parallelShaderCompile = null
- kill the render when the scene is ready:
scene.onSceneReadyObservable.addOnce(() => engine.stopRenderLoop())
- we have to call
scene.render()
when we want to render the changes to the scene
This PG renders the changes one by one:
This PG renders the changes all at once:
Observables will not work because they needs the render loop to be running. So in case we change the camera we need to set forceRender = true
as well and we can’t use the camera.onViewMatrixChangedObservable