When to use ambient occlusion?

What are some situations where it’s recommended to use ambient occlusion? I know what it is and I’ve experimented with it, but I don’t know what all the use cases are for it.

Are we talking about Cycles or Blender Internal?

Cycles, please!

AFAIK there are three possible ways to use AO with Cycles:

a) AO pass + compositing
A method I use from time to time to increase the contrast of e. g. surface details of rendered objects. The AO pass is multiplied over the rendered image (How to): The white areas of the AO pass leave the render unchanged, the black areas of the AO pass darken the image, giving more definition for tight spots.

b) AO shader
I use that now and then, too, e. g. to “cheat” with wall materials in interior renderings. Example:


Before and after example thread: The only difference between the render of that thread’s starter (#1) and mine (#3) is the AO shader setup for the wall material. The number of samples is identical!

c) AO in the world settings
Hardly use this at all, as I find this plain weird. This implementation doesn’t seem to do anything but boost the overall brightness of the image. Not exactly sure what this has to do with ambient occlusion:wink:

In general I tend to think that AO as a cheat and cheap replacement for advanced render techniques like global illumination is kind of superfluous in a GI pathtracer. But that’s of course just my 2 cents.

The AO in the World settings can be changed to Multiply blend mode instead of the default Add. In general AO is a cheap form of indirect lighting, suitable for game engines. I have seen a texture artist use it to map dirt and such into edges and corners though, rather than for just adjusting the lighting.

Thank you for the detailed response, IkariShinji. About this:

I recently created an indoor shot in Cycles (with no outside light coming in through a window). No matter how I arranged my indoor lighting, things just seemed to be too dark in the corners of objects. I turned up the world ambient occlusion to basically fake the overall light in the scene and it worked fine, but I’m not sure if that’s the recommended thing to do in that situation.

It wouldn’t make any sense to bring in a sun lamp in an indoor scene, right? From browsing the forums, it seems that Cycles tends to struggle with indoor scenes with no window light.

I could be wrong about all of this, but I’m genuinely curious as to how people handle indoor Cycles scenes – whether they turn up the AO or whether I just need smarter placement with my lighting.

In Cycles?

It can’t be set to multiply in Cycles. The way to get that is to enable the AO pass and composite it in as a ‘multiply’ mix node. You don’t even need to enable it in the world settings then. The distance factor still matters though.

And even though Cycles is a GI renderer I’ve seen some images where the artist set the bounce level to 1 (disabling bounce lighting). This way you still get the advantages of Cycles materials but the results are closer to BI in look (and faster than when GI is on). Then they add in the AO pass to give some ‘fake’ ambient lighting.

I guess you can think of it as adding an ambient light which it then occludes, before adding the effect to the image. Long time ago all we had was plain flat ambient light which was added to the image. Either as a global effect or to individual materials - both were horrific compared to an occluded version which does add more depth.

I’ve actually used that one more than the AO shader. I like how you use it though, will keep that one in mind.

Hmm, but isn’t that more or less what we’re stuck with at the moment with the world AO in Cycles? It seems to mainly add light to the scene, thereby mostly flattening out the scene lighting. The occlusion aspect in the world AO is pretty subtle and imho too easily overpowered by the added brightness.

Yup. I would only use it if I need ambient lighting to brighten up (just so slightly) the darkest areas while still having some cheap corner darkening, and only if noise/time/memory issues prevented me from using full GI/baking (happens all the time when I use GPU). It’s just a tool, not a solution :slight_smile:

I.e. make the default cube a small room, and place the light near a wall. Add strength 1 quadratic falloff node to it and render from camera placed inside room. Using 1536x960, 100 samples, I get these:
Direct only: 18 sec, but I can’t see much.
Limited GI: 38 sec, but very noise and still very very dark. Unusable.
Full GI: 2m 31 sec, very noisy but much better. Time cost is extreme though.
World AO (fact 0.01, dist 1): 19 sec and pretty much noiseless. That’s in this case only 1 second more than direct only. Results are not realistic, but better than if I were to use a completely flat ambient light which we used to back in the day - here I get to see the complete room and have darkened corners.

But yeah, I wouldn’t mind some additional controls to it, as the lighting is white. But still, I find it to have some “emergency uses” :slight_smile:

Thanks, CarlG. Yes, I was getting an incredible amount of grain in my shot along with too-dark corners, and global AO fixed both issues.