Describe the project you are working on:
Some simple 3d project.
Describe how this feature / enhancement will help your project:
Better visual quality, aswell as SSAO looking more like what you'd expect from it. It may also be a performance increase
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
This is a test implementation (not in godot) at the lowest usable quality in my case, which is 3 samples per pixel at 1/4* resolution. (Edit: I was able to push the quality a bit more by optimizing the sample offsets)
* Edit2: note that by 1/4 I mean half the width and height, so a quarter of the area / #pixels.


In comparison, at the lowest setting godot uses 8 samples per pixel at full resolution which looks like this:

Even on higher settings this doesn't improve much and isn't worth the performance impact in my opinion.
Describe implementation detail for your proposal (in code), if possible:
Using better sample distributions and filtering it's possible to improve the quality of SSAO a lot.
EDIT: I will upload a reference implementation here
If this enhancement will not be used often, can it be worked around with a few lines of script?:
no
Is there a reason why this should be core and not an add-on in the asset library?:
As it is an improvement of existing core functionality it doesn't make much sense to provide it as an addon.
Further notes:
I'd target this for 4.x or 4.0. I'm not sure if I'll have the time to integrate this into godot but providing a reference implementation shouldn't be a problem.
This will be great really!!! Right now the main problem with SSAO is that performance sucks, so please prioritize that if you want to improve it
The performance range should be fairly large with this, as both the sample count and resolution (full vs quarter) can be tweaked without affecting how optimal the algorithm works all that much.
Obviously there will be artifacts on low settings as there has to be some kind of quality trade-off.
Small update on the quality range:
Click to view pictures
This is the lowest possible setting, but at 2 samples/pixel and insufficient filtering you might as well keep it off.

This one is low-ish quality, but usable.

This is everything maxed out (16 samples, full resolution and best filtering).

This blog post may be useful. I know the current reconstruction of normals is quite poor. https://wickedengine.net/2019/09/22/improved-normal-reconstruction-from-depth
@clayjohn interesting. I assumed Godot uses the same normals that are used for lighting. Also thanks for sharing the article.
However, with SSAO this type of self shadowing can actually look pretty good as it pronounces the shape of the object a bit more. I haven't tried it on lower resolution SSAO, though, it may look pretty bad in that case.
Well. I'll leave it up to you. Your results are already looking very nice. Just thought the article may be useful. :)
@CptPotato Could you provide an example project here (or as a repository on GitHub)? Thanks in advance :slightly_smiling_face:
It doesn't matter if it's not Godot, it could still help another developer implement this in Godot.
@CptPotato Could you provide an example project here (or as a repository on GitHub)? Thanks in advance 馃檪
It doesn't matter if it's not Godot, it could still help another developer implement this in Godot.
I'll see if i can setup an implementation in SHADERed this weekend.
I've set up a repo where I'll upload the code as SHADERed project soon.
I'm currently still cleaning up the code and fixing / improving some things.
New SSAO has landed a while ago in the master聽branch, see Vulkan Progress Report #6.
@CptPotato Could you test the new implementation if you have some time? I could still notice some artifacting when the half-resolution project setting is enabled, but this is more of a bug than a feature request.
Note that this is only in 4.0 (Vulkan).
Most helpful comment
Small update on the quality range:
Click to view pictures
This is the lowest possible setting, but at 2 samples/pixel and insufficient filtering you might as well keep it off.

This one is low-ish quality, but usable.

This is everything maxed out (16 samples, full resolution and best filtering).
