SSAORenderingPipeline doesnt appear to refresh after initial frame

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

SSAORenderingPipeline, configured exactly as per the tutorial,

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.

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

        engine.runRenderLoop(() => {

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

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

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.

cc @sebavan

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

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 ( and increasing the resolution of the SSAO reduced this effect greatly :slight_smile: I suspect it’s an artifact of the randomness + blurring of the post process.