SSAO2 issue with camera

Hey,

Our project implemented SSAO2 rendering pipeline with skybox and worked fine. But now when we remove the skybox and rotate the camera (it is an arc rotate camera), the scene unable to clear the earlier frames of rotation. Just to demonstrate, I tried to use Avocado.glb model.

When I remove the camera attachment from SSAO2 pipeline, it works. But I lost the benefit of SSAO2 from the project. And I m kind of lost what to test or do to fix the issue? I need help!

Thanks in advance.

Are you able to setup a repro in the Playground? Does it work if you set true for the 4th parameter of the SSAO2 constructor?

Adding @CraigFeldspar who may have some inputs about this.

@Evgeni_Popov I m trying to repro in the playground and will share the link once I m done.

Yes I tried true value for forceGeometryBuffer and it works but the look is similar when I detach the camera from SSAO2. Beside this, on the description of forceGeometryBuffer - Set to true if you want to use the legacy geometry buffer renderer, what does legacy geometry buffer renderer mean? does it refer to SSAO? When I tried to use SSAO instead of SSAO2, I get similar look when I detach the camera from SSAO2 or when I provide true value for the forceGemetryBuffer value.

Thank you. hope will get more explanation sooner.

@Evgeni_Popov @CraigFeldspar - I was trying to look at the questions related to SSAO2 and found this question ( SSAO with HRD texture causes color precision loss - Bugs - Babylon.js (babylonjs.com)), I was having the same issue and thinking to raise the question on the forum but found my answer here. Surprisingly, the fix done on this pull request ( SSAO2: Allow to choose the texture type used by the post processes by Popov72 · Pull Request #10329 · BabylonJS/Babylon.js · GitHub) solve the issue I raised here as well. I m happy but not sure the relation and the how.

I test the change at your end using https://preview.babylonjs.com/babylon.js on my environment, hopefully this change will include in https://cdn.babylonjs.com/babylon.js soon.

The OTHER ISSUE I face is related to camera rotation when I attach the camera to SSO2RenderingPipleline. The camera movement have some pose or lag, it is not smooth like when I detach from the pipeline. I would be glad if I can get any suggestion.

Thank you in adavnce.

This looks like the scene is not properly cleared, any chance some post process could set scene.autoClear to false ?

I’m not sure I understand why this PR would fix the clearing problem as it only allows to change the texture format used by the SSAO post processes. Maybe it’s not this PR but another one that fixed the problem…

So you tested with the PREVIEW version and it worked, whereas it does not work with CDN? In that case it’s most probably another PR than the one you pointed to that fixed the problem, as there had been a lot of PRs applied after the CDN version has been shipped.

Note that the fix will never be back-reported to CDN: CDN is (currently) the 4.2 version and won’t never change. If you want the fix(es), you need to use the PREVIEW version.

Regarding your other issue, it may be that your are not at 60fps anymore / the fps fluctuates, as SSAO2 is quite a performance hog. We would need a repro in the Playground for more inputs.

It seems a PR in 5.0 fixed the problem, as @Yofetahe_Habtu reported.

1 Like

@Evgeni_Popov @CraigFeldspar Thank you for your answers.

@Evgeni_Popov yap definitely the other PR fix the issue I raised here, that is my bad. thanks for point out to use preview for now.

Related to the camera rotation issue, as you mentioned FPS value is very low and it is 17. For more detail information, here is the inspector screenshot.

So is there a way to enhance the FPS value? or what other alternative do I have?

Thank you so much.

I don’t see a way to improve things, all the time is spent on the GPU side… Try to display a single object: the fps you will get is the max fps you can reach with SSAO enabled.

However, those perf seem really bad: are you testing on a mobile?