I just noticed that taking a screenshot with Tools.CreateScreenshotUsingRenderTarget does not work.
And this error is only happening if SSAO2 is enabled.
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);
The SSAO2 doesn’t look right with Babylon version > 5.0.
And what i noticed is that this only happens when the screenshot resolution is defined on Babylon > 5.0.
If you remove the defined resolution on the Tools.CreateScreenshotUsingRenderTarget() the SSO2 will look fine on Babylon > 5.0 too.
Is it possible to make this work with any defined resolution? It would really help us in generating screenshots with any resolution we need.
Thank you, and I hope there is a solution for it soon.