# SSAO properties not applied in my project

**URL:** <https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799>\
**Category:** Questions\
**Tags:** postprocessing\
**Created:** [August 14, 2024, 11:45am UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799 "2024-08-14T11:45:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrmmatricks](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrmmatricks/32/35472_2.png) [@mrmmatricks](https://forum.babylonjs.com/u/mrmmatricks)\
**Post date:** [August 14, 2024, 11:45am UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/1 "2024-08-14T11:45:13Z")

</div>

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](https://www.babylonjs-playground.com/#XDMGGH)  
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!

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [August 14, 2024, 12:16pm UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/2 "2024-08-14T12:16:03Z")

</div>

Do you have any console errors?

---

<div class="post-metadata">

**Author:** ![mrmmatricks](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrmmatricks/32/35472_2.png) [@mrmmatricks](https://forum.babylonjs.com/u/mrmmatricks)\
**Post date:** [August 14, 2024, 12:25pm UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/3 "2024-08-14T12:25:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [August 14, 2024, 12:31pm UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/4 "2024-08-14T12:31:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mrmmatricks](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrmmatricks/32/35472_2.png) [@mrmmatricks](https://forum.babylonjs.com/u/mrmmatricks)\
**Post date:** [August 14, 2024, 12:53pm UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/5 "2024-08-14T12:53:03Z")

</div>

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 😃

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [August 14, 2024, 12:56pm UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/6 "2024-08-14T12:56:25Z")

</div>

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

Are you using es6? @babylonjs/core?

---

<div class="post-metadata">

**Author:** ![mrmmatricks](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrmmatricks/32/35472_2.png) [@mrmmatricks](https://forum.babylonjs.com/u/mrmmatricks)\
**Post date:** [August 14, 2024, 12:58pm UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/7 "2024-08-14T12:58:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [August 14, 2024, 12:59pm UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/8 "2024-08-14T12:59:12Z")

</div>

i doubt these are related

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [August 14, 2024, 1:16pm UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/9 "2024-08-14T13:16:50Z")

</div>

Is your SSAO pipeline visible in Inspector?

---

<div class="post-metadata">

**Author:** ![shaderbytes](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shaderbytes/32/174_2.png) [@shaderbytes](https://forum.babylonjs.com/u/shaderbytes)\
**Post date:** [August 14, 2024, 2:15pm UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/11 "2024-08-14T14:15:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mrmmatricks](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrmmatricks/32/35472_2.png) [@mrmmatricks](https://forum.babylonjs.com/u/mrmmatricks)\
**Post date:** [August 14, 2024, 7:08pm UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/12 "2024-08-14T19:08:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mrmmatricks](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrmmatricks/32/35472_2.png) [@mrmmatricks](https://forum.babylonjs.com/u/mrmmatricks)\
**Post date:** [August 14, 2024, 7:09pm UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/13 "2024-08-14T19:09:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [August 14, 2024, 7:16pm UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/14 "2024-08-14T19:16:13Z")

</div>

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

```auto
console.log(scene.postProcessRenderPipelineManager)

```

---

<div class="post-metadata">

**Author:** ![mrmmatricks](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrmmatricks/32/35472_2.png) [@mrmmatricks](https://forum.babylonjs.com/u/mrmmatricks)\
**Post date:** [August 15, 2024, 4:04pm UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/15 "2024-08-15T16:04:34Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [August 15, 2024, 4:53pm UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/16 "2024-08-15T16:53:14Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [August 15, 2024, 5:20pm UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/17 "2024-08-15T17:20:08Z")

</div>

Unfortunately with no repro I cannot help ☹

---

<div class="post-metadata">

**Author:** ![11128](https://avatars.discourse-cdn.com/v4/letter/1/d07c76/32.png) [@11128](https://forum.babylonjs.com/u/11128)\
**Post date:** [August 16, 2024, 1:52am UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/18 "2024-08-16T01:52:27Z")

</div>

Did you declare a camera in the 4th parameter?

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/4/4463ac6587b3e080f557169839c24e0c41a22c66.png)

---

<div class="post-metadata">

**Author:** ![withADoveInOneHand](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/withadoveinonehand/32/1243_2.png) [@withADoveInOneHand](https://forum.babylonjs.com/u/withADoveInOneHand)\
**Post date:** [August 16, 2024, 5:34am UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/19 "2024-08-16T05:34:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mrmmatricks](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrmmatricks/32/35472_2.png) [@mrmmatricks](https://forum.babylonjs.com/u/mrmmatricks)\
**Post date:** [August 19, 2024, 8:23am UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/20 "2024-08-19T08:23:18Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![mrmmatricks](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrmmatricks/32/35472_2.png) [@mrmmatricks](https://forum.babylonjs.com/u/mrmmatricks)\
**Post date:** [August 19, 2024, 8:24am UTC](https://forum.babylonjs.com/t/ssao-properties-not-applied-in-my-project/52799/21 "2024-08-19T08:24:18Z")

</div>

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