Ok, so back at it again.
I just noticed that taking a screenshot with Tools.CreateScreenshotUsingRenderTarget does not work.
And this error is only happening if SSAO2 is enabled.
Please take a look at the following playground and let me know if this bug can be soon fixed or if there is a workaround to it.
I do not think the pipeline can be used on renderTarget, can you change the canvas size, use createScreenShot instead ?
cc @CraigFeldspar in case he knows why we can not use it in RTT ?
Thank you for your response.
Ok, but why can the pipeline be used on renderTarget on BabylonJS version < 5.0 and not on BabylonJS version > 5.0?
On the playground example that I posted above you can just switch the Babylon version to 4.2.1 and you will see that the pipeline can actually be used on renderTarget. Meaning that the screenshot gets generated with SSAO2 just fine.
Thank you, and I hope there is a solution for this.
Screenshot tools directly call
render on the RTT without the prepass textures being rendered. Outside of the normal
scene.render pipeline, prepass can have an undefined behavior.
4.2.1 version of babylon uses the geometrybufferrenderer, so if you want to replicate that behavior, use @sebavan’s suggestion :
BABYLON.SSAO2RenderingPipeline("ssao", scene, ssaoRatio, undefined, true);
Actually it works just fine.