Dirty lens effect with ssao

pg: https://www.babylonjs-playground.com/#N96NXC#2

Just click and drag. On my screen, there appears to be a dirty lens effect. Is this wai ? or did smthg break with 4.0 ?

Hi phaselock,

That does indeed look pretty funky; good catch! Paging Dr. @julien-moreau, who I think is the expert on this effect. :smiley:

2 Likes

@phaselock yeah so sorry it is a known limitation of the WebGL 1 SSAO today.
What you’ll have to do is playging with the radius and falloff values. These are related to the current scene (depth, camera max Z, etc.) so it must be configured for each scene.

Here is a playground working better: https://www.babylonjs-playground.com/#N96NXC#3

If you’re ok to target WebGL 2, you can use the SSAO 2 (SSAO2RenderingPipeline - Babylon.js Documentation) which works better: https://www.babylonjs-playground.com/#7D2QDD#0

1 Like

yh, ssao2 looks much better. This completely passed me by, bjs development is so quick. Guess I’ll have to settle for a very soft ssao, thks guys for the quick replies. Cheers ! :smiley:

2 Likes