# SSAORenderingPipeline doesnt appear to refresh after initial frame

**URL:** <https://forum.babylonjs.com/t/ssaorenderingpipeline-doesnt-appear-to-refresh-after-initial-frame/32585>\
**Category:** Bugs\
**Created:** [July 28, 2022, 10:48pm UTC](https://forum.babylonjs.com/t/ssaorenderingpipeline-doesnt-appear-to-refresh-after-initial-frame/32585 "2022-07-28T22:48:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brechindo](https://avatars.discourse-cdn.com/v4/letter/b/e95f7d/32.png) [@brechindo](https://forum.babylonjs.com/u/brechindo)\
**Post date:** [July 28, 2022, 10:48pm UTC](https://forum.babylonjs.com/t/ssaorenderingpipeline-doesnt-appear-to-refresh-after-initial-frame/32585/1 "2022-07-28T22:48:39Z")

</div>

(Making a separate bug for this. Note this is original SSAORenderingPipeline and not the newer SSAO2RenderingPipeline).

SSAORenderingPipeline, configured exactly as per the tutorial,

> **[Using the SSAO Rendering Pipeline | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/postProcesses/SSAORenderPipeline)**
>
> Learn how to the SSAO Rendering Pipeline in Babylon.js.

suffers what Ill describe as a dirty ghost layer, as if the SSAO pass were run once and then cached instead of being recalculated per frame.

` var ssao = new SSAORenderingPipeline('ssaopipeline', scene, 0.75, [camera]);`

Not easily visible in still form, but you can see it when the camera rotates or zooms because the ghost layer appears attached to the camera. Shown here with ssao.totalStrength = 2.0 to exaggerate the layer for visibility.

[https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/c/4cf9874aa67a828270e59303b6f663c8b075ce02.mp4](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/c/4cf9874aa67a828270e59303b6f663c8b075ce02.mp4)

The code has only the single ArcRotateCamera, nothing fancy being done there.  
Render loop is nothing more than

```auto
        engine.runRenderLoop(() => {
            scene.render();
        });

```

Babylon.js v5.16.0 - WebGL2 - Parallel shader compilation

1. renderer: “ANGLE (NVIDIA, NVIDIA GeForce RTX 3080 Direct3D11 vs\_5\_0 ps\_5\_0, D3D11)”
2. vendor: “Google Inc. (NVIDIA)”
3. version: “WebGL 2.0 (OpenGL ES 3.0 Chromium)”

(All these on Windows 10)

Brave Version 1.41.100 Chromium: 103.0.5060.134 (Official Build) (64-bit)  
Chrome (looks the same) Version 103.0.5060.134 (Official Build) (64-bit)  
Firefox 103.0 (64-bit)  
Edge Version 103.0.1264.77 (Official build) (64-bit)  
Opera Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36 OPR/89.0.4447.71

---

<div class="post-metadata">

**Author:** ![brechindo](https://avatars.discourse-cdn.com/v4/letter/b/e95f7d/32.png) [@brechindo](https://forum.babylonjs.com/u/brechindo)\
**Post date:** [July 29, 2022, 12:01am UTC](https://forum.babylonjs.com/t/ssaorenderingpipeline-doesnt-appear-to-refresh-after-initial-frame/32585/2 "2022-07-29T00:01:38Z")

</div>

Incidentally, Ive now realized that even this public demo suffers the bug:

> **[Babylon.js Playground](https://playground.babylonjs.com/#N96NXC)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

At default totalStrength=1.0 it’s simply hard to notice, although you can find it once you know what to look for. Increase totalStrength to 2.0 and the problem becomes obvious. Have to move the camera around to realize it’s there though.

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [July 29, 2022, 1:48pm UTC](https://forum.babylonjs.com/t/ssaorenderingpipeline-doesnt-appear-to-refresh-after-initial-frame/32585/3 "2022-07-29T13:48:01Z")

</div>

cc @sebavan

---

<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 1, 2022, 2:21pm UTC](https://forum.babylonjs.com/t/ssaorenderingpipeline-doesnt-appear-to-refresh-after-initial-frame/32585/4 "2022-08-01T14:21:13Z")

</div>

This is strange indeed, @julien-moreau might know about this one as IIRC he was the main author for it ?

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [August 31, 2022, 2:08pm UTC](https://forum.babylonjs.com/t/ssaorenderingpipeline-doesnt-appear-to-refresh-after-initial-frame/32585/5 "2022-08-31T14:08:17Z")

</div>

Just adding this as a follow up in case anyone wonders, there was a very similar question recently: [What’s the dirty when using SSAO (ambient occlusion) post-process? - Questions - Babylon.js (babylonjs.com)](https://forum.babylonjs.com/t/whats-the-dirty-when-using-ssao-ambient-occlusion-post-process/33459/2) and increasing the resolution of the SSAO reduced this effect greatly 🙂 I suspect it’s an artifact of the randomness + blurring of the post process.
