Hey, we are trying to add support of multi-canvases in the Babylon.js editor but we are facing a problem.
When using SSAO2 or Motion blur post-process (maybe other may generate this bug too), the rendering is broken: try to move the camera on the first canvas to see the problem. On line 79, try to change the camera the motion blur post-process is attached on.
I think it is connected with the active camera, because when adding motion blur, it is the camera that is setup for motion blur that becomes active in all views. And if you setup a camera in motion blur that is used as a camera with attachment control, then the behavior of all views breaks, because it does not find the camera.
I do not think that there is an easy solution unfortunately and this might require to rely on the scene graph later. Currently I think you might need two copies of the scene cc @Evgeni_Popov
Is there an easy way to basically create a new scene that is not just a copy but is synchronized with another one? If a mesh is added or moved in the first scene, do we need to manually synchronize it to take effect on the second scene?
The multi-view feature is based on changing the active camera for each view and calling renderFrame, which is incompatible with frame graphs. We will have to think about supporting the multi-view feature with frame graphs, maybe by registering a graph with each view, instead of registering a camera?
Thatās interesting what you say @Evgeni_Popov. In that case, the bug we have maybe it can be fixed easily. It looks like the geometry buffer renderer or prepass renderer are not cleared properly or something like that. calling renderFrame with camera1 and SSAO2 then calling renderFrame with camera2 and the same SSAO2 pipeline should work in theory. Resources are flushed or cleaned between 2 renderFrame, do you agree?
However, SSAO2 can currently only use the default geometry buffer renderer. In your case, you would have to pass the instance you want to use, which is not possible.
We could perhaps allow an existing instance to be passed for the forceGeometryBuffer constructor parameterā¦
Awesome !! thanks a lot that would help a lot for sure
But for the initial problem, @Soullnik if you are available tell me if Iām wrong, I encounter the problem when the main camera has SSAO2 (with geometry buffer renderer) and the second camera has 0 post-process. Passing a custom geometry buffer renderer may be awesome to prepare the future but will not fix the current problem we face.
Hey everyone, I am arriving a little later to the discussion. Recently, I tried the same as @Soullnik mentioned but creating a viewport to display a PiP camera. I want to add this feature to the editor.
I am facing the same issue, I can see the viewport but if the scene has SSAO2 or motion blur enabled the viewport disappears. Even if I turn off the processing pipeline in the camera.