Is there a way to make direct lighting not get rid of ambient occlusion?

Hello,

I would like to know if it’s possible to make ambient occlusion shadows persist even under direct lighting. I know that’s not the way light works but it’d be nice if I could achieve this effect somehow for stylistic purposes. So if there’s a way what would it be?

Nice question i realy want this effect too :slight_smile:

Hey Tryedz -

In your project’s world settings, what is the values you have set for the following:

Use Ambient Occlusion (True or False)
Direct Illumination Occlusion Factor
Indirect Illumination Occlusion Factor
Occlusion Factor

Let me know, I think we can get you close -

Eric Ketchum

Use Ambient Occlusion is set to true. I have Direct Illumination Occlusion Fraction se to 1.0 which is apparently the highest it can go, and the Indirect one set to 0.75. Ramping up the latter only darkens AO under indirect lighting of course, but changing the former to 1.0 (from the default 0.5) appears to do nothing.

Maybe I’m not getting it, but if you want a tweakable ambient occlusion that is always there, no matter which lighting conditions, couldn’t you just multiple the ambient occlusion texture with the rest of your base color, and plug it in the base color? Add some scalar parameters for brightness and contrast, and make a material instance where you can tweak all those settings.

Actually I saw this suggestion quite a few times and I really don’t understand why on Earth would you use SSAO or any postprocess AO when you could have baked textures that are way cheaper and precise. :slight_smile: For me SSAO is only good for cases when you have different objects that have no texture relation. Atm I’m working on a modular level that uses lots of intersecting pieces and SSAO would help a lot hiding the nasty corners. Except that it is killed by the directional light so I would really glad if somebody could give me any advice on the matter. Thanks! :slight_smile:

So I figured it out, I post it here in case somebody has the same issue.

You need to make a custom postprocess material. Just make a new material and do the same as you see on the attached screenshot.

Change the material domain to Post process, then scroll down to Post process material and change it to Before tonemapping. If you don’t do this, your new AO won’t get any AA and will look jaggy. Save it and create a Post process volume. In the Misc section look for the blendables, hit the plus sign and add your new material (as on the screenshot). Enjoy your new AO, don’t forget to tweak it in the PPVolume’s AO section. :slight_smile:

I know it’s an old post but…

You would want to use SSAO, HBAO or DFAO instead of relying on baked AO because of the reason you just mentioned. Baked AO only provides “self AO”, meaning no impact from close objects/situations. It creates inconsistencies.

Unless we’re talking about baking the AO via the lightmass settings. And that is way too costly in memory.

There are number of false information here, so just to clear things up:

  • there is no HBAO in UE officially
  • there is only one type of baked AO and you produce this with Lightmass (check “use ambient occlusion” in the World settings)
  • baked AO is NOT limited to self AO, set the “max occlusion distance” for the affected area
  • there is no additional cost for baked AO if you are already using static lighting, it is baked into the same shadowmaps

Personally I’m rather against using baked AO. AO in it’s nature is really just an afterthought for scenarios when the lighting system can’t produce shadowed ambient lighting. Mostly this is the case with dynamic lighting, so you want to use a fake system (SSAO, DFAO). But when it comes to static lighting, you don’t need to use a fake system, because Lightmass can produce nearly fully realistic shadows for the ambient lighting (Skylight).
Hope this clears up a bit. :slight_smile:

  • There is no HBAO “officially” meaning by default. Yes. But you could make it work (…).

  • You could bake self AO for your objects via Sb Painter or else. Hence my point; I thought that was what you meant.

  • Again referring to the 2nd point I thought you meant baking “self” AO and not the whole scene.

  • There is a potential additional cost for baked UE4 AO if you use it via the lightmass (lightmap) in the sense you might have to increase the lightmap resolution to get better results. Depending on your project it may not be the best solution vs SSAO.

Your point about static lighting is right but if you won’t use static lighting because you’ve got specific needs for dynamic things or night/day time cycle than you would indeed want to use SSAO, (HBAO) or DFAO.