Light Based Ambient Occlusion

Thanks to Master Zap, he informed us a while ago why just multiplying an ao over a beauty is a big no no. (

Fortunately in Mental Ray, the Mia material has a built in ao feature so we get an accurate ao without having to composite in post. But what if we wanted to composite in post, for the extra wiggle room, but we didn’t want the hassle of trying to get all of our render passes to come out correctly without ginormous render times (thanks for that one autodesk)? Well these two solutions are definitely the best and most accurate, there is another-less accurate-but moreso than just an A over B thing with a regular ao.

This is where light based AO comes into play. This method allows you to just multiply your ao over your beauty and not get ao where there obviously shouldn’t be any because of light direction.

DISCLAIMER: This still isn’t a correct workflow, it’s still a hack, but gives better results than the classic method.

HOW TO: You need to create a Surface Shader, an ambient occlusion, a clamp, and a surface luminance node.


light based ambient occlusion1.) Connect the outValue of the surfaceLuminace to the input R, G, B of the clamp node.

2.)Connect the output of the clamp node to the dark value of the mib_amb_occ

3.)Connect the outValue of the mib_amb_occ to the outColor of the surface shader

4.)Go to the clamp node and set the Max value to 1, 1, 1

-This clamps the value of the luminance to a value of 1. This way if you have lights with an intensity above 1, you won’t get weird artifacting and banding.


Regular Ambient Occlusion:

ambient occlusion

















Light based ambient occlusion with a spot light coming from camera right:

light based ao


  1. Thank you a lot for sharing this with all people.

  2. Manoj

    getting Sme artifacts.. but i thnk surface and ,mib connected to ramp the bets way to get it ..

Leave a Reply

Your email address will not be published.
Required fields are marked:*