SSAO not visible anymore after BabylonJS update

Hello,
i updated to the latest BabylonJS Version 6.11 and noticed that SSAO2 is no longer working. There are no errors or anything the effect is just not visible. It seems that the last working version is 6.4.1. That means the issue was introduced with version 6.5.0 .

After more debugging i found out that its releated to the RenderTargetTexture we are using. I created a playground here: Babylon.js Playground

Initially the SSAO is working. After 2 seconds the RTT will be rendered and the SSAO is broken.
We need to render the RTT on demand only in our app. Is this the correct approach for this or this there a better way which also works with the latest BabylonJs version?

If you switch to version 5.71.1 in the playground it works as expected.

cc @Evgeni_Popov

There has been some fixes for the prepass renderer, which unfortunately produces some side-effects as in your PG.

The prepass renderer does not work correctly for render targets at the time, so in your case the easiest fix is to set rtt.noPrePassRenderer = true;.

Note also that you can set rtt.activeCamera = rttCamera; and avoid messing with the scene properties:

Another fix is to call scene.prePassRenderer.markAsDirty(); after rtt.render(), but noPrePassRenderer = true is a better fix, it will avoid creating unused resources.

It is planned to improve support for the pre-pass rendering engine in the various parts of the engine.

1 Like

Thank you for the fast reply.