SSAO properties not applied in my project

Hello!

I am using the SSAO2 Pipeline but I can’t set properties liek samples and strength on it in my code.

I copied my setup code into this playground: Babylon.js Playground
In the playground this code works. The samples and strengths are set to the correct values.

But in my environment (with a more complex surrounding setup) when I set the samples and strength nothing changes in the effect (also no value change in the inspector).

I am quite at a loss how to even start debugging that.
Any clues?

Thanks!

Do you have any console errors?

Nope, no error, warnings or other messages. It just does nothing.

Would you be able to share the project? Some more information on the way it is built? This could be related to side effects not loaded, but then I would expect some form of a console error, which you are saying are not present.

Sadly no.
It’s quite a big project with a bigg-ish build & content pipeline attached.
It’s one of those “Let’s just activate SSAO at the end” type of scenarios :smiley:

The best scenarios! and of course it should be working…

Are you using es6? @babylonjs/core?

I just found some Babylon warnings! But they don’t seem like a big issue?

[Violation] ‘setTimeout’ handler took 126ms - scene.ts:2303
[Violation] ‘setTimeout’ handler took 126ms - scene.ts:2303
[Violation] ‘load’ handler took 191ms - fileTools.ts:260

i doubt these are related

Is your SSAO pipeline visible in Inspector?

I have actually seen similar behaviour like you describe once in a project of my own , it was user error on my side , creating the ssao more than once I think. then adding it doesnt actually add , as it has one already. Then the changes to your code do nothing ( and dont update the inspector either ) because its not actually pointing to the ssao currently in use in the scene

1 Like

Yes it is. This is where i can see that the values are not set.

Yea, had something like that happen to me once as well :wink: But sadly not in this case. It’s just instantiated once.

Could you check if values are set or not at the end of your code adding

console.log(scene.postProcessRenderPipelineManager)

I went home yesterday, today I started the project up again and the values are set correctly. That smells a little bit like some race condition somewhere… I am not doing something fancy with threading or something (at least not to my knowledge). Makes it even harder to find. But thanks so far!

1 Like

Are you using latest as there were a few changes on post processes recently cc @Deltakosh as it might be related to async load of shaders ?

1 Like

Unfortunately with no repro I cannot help :frowning:

1 Like

Did you declare a camera in the 4th parameter?

1 Like

i had the impression ssao and fxaa were exclusionary at the moment
I think vignettes do the same thing
yall doin somethin special?

Yes, we are using the vignette feature. But I guess that was not the problem since the SSAO was applied (just very ugly because of too little samples :D)

Yes we did declare a camera as well. Did not change anything.

1 Like