Ambient Occlusion In Direct Lighting

I noticed that ambient occlusion is significantly weaker but not gone entirely in directly lit areas I can only assume that that was a kind of “artistic choice” would be great if you allowed users to control the amount of ao in directly lit areas:

a game going for realism might want it gone entirely while a stylized game might want it boosted:

anyway would be neat :slight_smile:

Directly lit area is also exposed to ambient light, thus ambient occlusion should produce some shadowing even in directly lit areas. UE4 is on correct side of things here. I don’t know why you’ve decided that AOs effect should only be visible in the shadow.

Just observing real life and photos on a daily basis for over 30 years … there is no such thing as “ambient-light” in real life btw there is only “light” (photons). Ambient light just like ao are rendering “tricks”.

I maintain that it would be neat for the users to be able to choose how much ao they want in directly lit areas for both realism and stylizations sake others have asked for this before too:

although with the intent of pushing it in the opposite direction but thats fine by me I am just arguing pro control the current look can still remain the default there is no problem with that.

check out the bottom of the counter apart from a bevel and some dirt I don’t see any ao (the left side in the shadow sure does though)

I am pretty sure that you do not have to observe photos for over 30 years to notice the effect, that ambient occlusion is designed to account for. Taking a walk though concrete jungle on a sunny day would be enough to notice that corners do receive less indirect light than flat surfaces. But gotta admit, that human eye is pretty bad tool to make conclusive measurements.Showing photos with reflective surfaces does not help the case either. Bounced light will make them appear brighter(Which you can also successfully achieve with baked bounce lighting in UE4).

You started your question, stating that it would be good to control AO intensity in shadowed and lit parts separately. I imply that it is pretty useless, as you already have all the set of artistic controls in this respect. There is simply no connection between ambient occlusion and direct light. You’d be surprised, but implementation of AO in the high-budget triple A game you are referencing in in your post is not much different.

Now on UE side of things, if you are getting shadowing in the corner, where you would expect none in a corresponding real-life scene, it simply means that in your UE4 scene, the balance between direct and indirect lighting is shifted towards the latter one, as compared to the real scenario. In other words, just crank up sun’s and lower skylight’s intensities.
Direct sunlight, AO disabled:

Direct sunlight, AO enabled:

Low intensity sunlight, high intensity skylight, AO disabled:

Low intensity sunlight, high intensity skylight, AO enabled:

In addition to that you have exposure controls and numerous post-processing techniques to achieve the picture you want.

I apologize for the 30 year comment that was very condescending of me. but your shots prove my point perfectly none of them pass the lighting “uncanny valley” test compared to the rockstar ao they just look wrong. and I suspect what makes the difference is that they have tighter and separate control and even if they dont this would be an opportunity for epic to dash ahead of rockstar games.

I agree with warby. Ambient Occlusion simulates darking effects in shadowed areas and should not be visible in direct lighting. The current implementation is in a stylised game especially more visible. The picture uses only dynamic lighting and the sun light has an intensity of 20:

“Any engine that supports deferred
rendering should allow access to a
buffer where the first lighting is

This is incredibly spot on and I wish Unreal Developers to acknowledge it, guys! :slight_smile:

Letting us dabble with actual GBuffers and the way they mix on top of each other would be immensly helpful and useful to fine tweak stuff.

I would even say that in directy lit room there sometimes happens sort of Ambient Illumination in the corners. Depending on the Normal under which the sun hits the spot.

I agree that Unreal’s AO is the much better than Unity’s as noted in one of the comments.

For example in these images it is visible that if I could mix 2 SSAOs on top of each with different radiuses it would give a more global (room-scale) ambient occlusion effect while preserving the details.


To elaborate on Deathrey’s comments…

UE4 is doing this correctly only to ambient lighting, like your image says “AO should only darken areas commonly refereed to as 'ambient lit”. This happens after the ambient lighting pass (skylights/baked lighting) and before the direct lighting pass. This is efficient and no artistic choice is involved.

Unity examples above happen after ALL lighting. Adding a tuner for masking out AO based on direct lighting is not efficient, depending on the engine may require additional space in the G-buffer.

In ue4 If your direct light is dim, it will not overpower the ambient, and your ambient shadow (AO) will be easily visible. You can absolutely see this effect in real life on an overcast day where the sun peaks through the clouds, or during sunset.