[Cycles 2.8] Combining ambient occlusion and sun light


Let’s assume I have a quite large room with a window. There’s a sun object that shines through the window. Ambient Occlusion is turned on.
Is it possible to make a ceiling of my room invisible for ambient occlusion, but visible for the sun?

Hmm, I don’t know what you meant by “making the ceiling of the room invisible for ambient occlusion”, the AO is a process that affects the scene entirely, and you want to make it invisible just the ceiling? Not the floor?

You could however do that with layer views, just separate piece by piece and render the objects separately.

But I didn’t understand what are you trying to accomplish with that, might be an easier way to do what you want.

Ambient occlusion doesn’t do down like in your diagram.

Ambient occlusion is a way of simulating… you know the directionless light you get on an overcast day? That’s ambient occlusion. this is ambient occlusion: https://assetstorev1-prd-cdn.unity3d.com/key-image/b9302426-68a8-433d-a573-b127b4f4a737.jpg

You don’t really need it for cycles, which calculates indirect light. You can add ambient light… which does something similar… and you can have a ambient occlusion in compositing nodes…

1 Like

I’ll try to explain. I have a quite large room with a window. There’s a sun object that shines through the window. If I render from inside the room, I will get a very dark image. I don’t want it, so I need to add some artificial light inside the room. I turn AO on, but nothing changes, because the room has a ceiling, so AO can’t get through it. In order to fix this, I go to Cycles settings and turn “Shadow” off for ceiling:
Now AO ignores ceiling and the image is bright, but the problem is the sun also shines through the ceiling…

As far ai I understand, AO is a wrong solution here in general. It’s better to use point lights, although it’ll be quite tricky.

A few questions:

  1. Is your World texture black? This will become the color of the AO, so it then won’t add any light to the scene.
  2. Are you using Blender 2.8? If so, you can use the AO input within any shader you want AO to apply to.
  3. Is your AO radius way larger than the room? That would also explain why it’s black.
1 Like

If you have glass window, try replacing the glass with a transparency shader, as glass won’t let light ray pass without some basic trickery - search if that works.

AO doesn’t “quite” work the way you think. It basically does like this:

  1. Add a constant emission to everything in the scene - ambient light coming from everywhere.
  2. If pixel examined has geometry nearby, occlude it - make the ambient light darker.

If you need to remove your ceiling, it sounds like the ambient distance is too high.

Sunlight produces much more noise than if you add a sky texture as environment. This because the sky texture is able to reach more of the room (direct light) rather than the spot the sun shines on (indirect only for everything except that spot). If I absolutely need the sun (which has much more energy than the sky), I will render it out as a separate render and simply add it in post (anything emissive in scene turned off). But yeah, it’s so problematic I try to avoid it whenever possible.

You can use AO in combination with the above, but you have to lower the distance and factor, probably by a lot. By brightening things up with AO, the apparent noise can be reduced, although it does add to rendertimes. 2 bounces with AO is still faster than lots of bounces without AO. AO is a cheat and “unrealistic”, but it’s still useful. I wouldn’t use AO if serving a “light study” - the render should be as close as possible to any study material (can’t do that in Blender though afaik).

1 Like

As others have pointed out, AO doesn’t work the way you think.
Ambient Occlusion is a method to illuminate the whole scene and only occlude the edges and corners of the objects.

In order to brighten out your scene I recommend you to use an area light or a mesh light as big as the window posicioned just behind it, to “fake” an ambient light.

The sunlight is very strong, but is not very effective to produce indirect lightning, so the area light will be better for this purpose.

1 Like

Thanks everyone for your replies ans tips!