SSAO messes with normal maps

I noticed this issue already in 4.8.0 hoping it would be fixed in 4.8.1 but it isn’t.

The SSAO is for some weird reason doing something on normal maps, it darkens it somehow and it blends in and out based on distance:

47991-wersdfsd.gif

Here it is with SSAO off:

This is on a landscape but it also happens on regular meshes.

Also, this SSAO glitch is still not fixed, maybe it is related: https://answers.unrealengine.com/questions/244646/ssao-wave-wobbling-glitch.html

Hi Davision -

The behavior you are showing is expected. SSAO will start to fill in more information from the normal map as you get closer to the object. You can (and should) adjust the Ambient Occlusion settings in the Post Process Volume (or Camera) to give the smooth transition that you are looking for as well as control the intensity of AO based on the normal map.

Thank You

Eric Ketchum

How can that be intended? I mean it doesn’t look like Ambient Occlusion, it looks just like dirty darken a certain direction of the normal map.

I tried playing around with the settings but nothing lets me “control the intensity of AO based on the normal map.” The fading in and out also remains very obvious no matter the distance values.
Is there any setting that just lets me turn off this normal map darkening by SSAO?

Hey Davision,

In order to control the SSAO, you need to edit the settings within your post process volume. The individual settings within the Ambient Occlusion of your post process volume are explained in the documentation below.

Ambient Occlusion

SSAO

Use these settings to find your desired Ambient Occlusion.

I tried all those settings, there is nothing that lets me get rid of the normal map darkening by SSAO behaviour. Even when changing the fade to something very smooth it remains very obvious.
Both issues make SSAO look really bad in my opinion.

Are you using an Ambient Occlusion texture sample for the material?

As Eric mentioned this behavior is expected as you get closer to the object. There are settings within the ‘World Settings’ tab that you can change to disable ambient occlusion relating to Lightmass. There are also settings within the ‘Project Settings’ tab to allow you to turn off your ambient occlusion.

Double-check to make sure you aren’t applying ambient occlusion in multiple places. There are settings within ‘Skylight’ actors that also allow for ambient occlusion. This deals with Distance Field AO in case you were using dynamic lighting and distance fields.

There is another issue, the normal map SSAO darkening fades out earlier then usual mesh SSAO. Also, no matter how i change the fade out distance values the fade is always very long and starts from a really close distance.

I’m using a texture sample AO in my post processing but I always check with the post processing material off since that fx is pretty heavy.

The Distance Field AO in my skylight is greyed out so that should be off.

I found a way now to turn off the normal darking AO:
In PostProcessAmbientOcclusion.usf in the shader folder:
Line 32, change this to 0: #define SSAO_NORMAL_AFFECTED 0
But the fading is then even more extreme with the mesh AO which might be because it is wip as it says in the comment:
// 0:does not use normals (slightly faster, lower quality, WIP = not finished), 1: uses normals (slower but higher quality)

The worst of all issues is this anyway and even though it was mentioned before it got fixed it isn’t so in 4.81:

I would appreciate any update you can give me on that issue as well.

Looking at all these issues is there any chance we can get the good old SSAO of UE3 in UE4? I shipped a game with that and using SSAO heavily with it and had no problems. Maybe it would be really easy to get that code over and it could be then a alternative that the user can set.

The other issue you are mentioning is directly related to the WIP, so that will continue to be improved upon. The issue you linked that Eric assisted you with has also been fixed internally, and should make it into 4.9. I say ‘should’ because there is no guarantee as the bugs that are integrated are based on priority which is determined by their importance by our developers.

Since there are multiple ways to implement Ambient Occlusion, more so than there were in UE3, we will most likely not be stepping backwards; however, this does not mean we are not trying hard to improve the AO implementations we have in place currently.

Thanks,

I have the same problem, besides mine is even darker (probably because stronger normal map) and it looks really bad… Is it possible to prevent (through editor, i don’t have C++ project) AO from affecting normal maps? If not, i will have to totally disable AO :frowning:

Try unchecking this option within your ‘Projects Settings’

Thanks, but this actually turns off this non-problematic part of AO (mostly around/below meshes) and it doesn’t change AO appearance on normal maps. Only totally disabling AO fixes the dark shadows on normal maps. So… Something like an inverse of this checkbox function would fix that (disable normal map AO, but leave the bigger shadows on ground around meshes)

Is you project using baked lighting, or is it fully dynamic?

If it is dynamic you can use a different AO method (the one I like to use with outdoor scenes) called Distance Field Ambient Occlusion. You will need to do some small preliminary set up, but it is a great new feature and provide accurate and performant results.

Distance Field Ambient Occlusion

Cheers,

My project uses baked lighting (with stationary light), but I’ll consider switching to DFAO. Sadly it costs 3x+ more than SSAO, but it definitely looks better. Well, I’ll play around with this one and test it’s performance hit… Thanks for the hint :slight_smile:

You can definitely still use it with Stationary lights! I would also take a look at the Skylight actor and it’s distance field ambient occlusion as well. One of my test beds are set up to have one dominant directional light as well as a skylight actor. I use the Ambient Occlusion within the Skylight actor as this is the ambient fill light for my outdoor scene. You can control it’s intensity directly which can yield some great results!

Actually it is just a shader file of the editor that you can simply edit with a texteditor, this is the path: UE4\Unreal Engine\4.8\Engine\Shaders\PostProcessAmbientOcclusion.usf

While DFAO is interesting I prefer SSAO since performance is better and I like to use it as another stylization effect on top that I could easily adjust. I’m aiming for a painterly look and not realistic.
Well, I just wait for the improved fixed SSAO.

Hey Davision,

I did some further investigation and reading in our documentation and discovered some settings that could be causing part of the issue. Like with all sliders, you will want to have the correct values relative to your project, but take a look at the documentation below as well as the image where I have highlighted some options within the ‘World Settings’ tab.

This will only apply if you are using Ambient Occlusion with lightmass (baked lighting and shadows), but hopefully are able to find some pertinent information within the documentation.

World Settings - Lightmass

Let me know if these were helpful.

I see this thread has been dead for years, but i’m seeing this problem, too. Exactly the same thing :frowning: