November 07, 2014

[Freebies] MAXScript: Rendering AO Pass Made Easy

As you all know, there are many ways to create an Ambient Occlusion Pass. We can use the default Ambient Occlusion Pass in Render Element, use the mr_shader_element with AO shader set on it, or use the Material Override and do the render. The first two is much faster to do, but resulting in solid black background image that might be quite annoying when in compositing process. The last one needs some steps to do before doing the render, but we can set the background to solid white.

MaxScript Render AO Pass
MAXScript: Rendering AO Pass made easy
So I took some time learning MAXScript and decided to create this simple one that might help me do the task. So, what does this script do? This script is actually doing the third method mentioned above, in automatic way:

  • switch the renderer to mental ray
  • remove all lights
  • turning off FG (to speed up render a little bit)
  • create an AO material and apply it on ALL objects (you might want to hidden the objects you don't want to render)
  • set the background environment to white
  • set the gamma to 1.0 (so you won't get a washed-out AO)
  • do the render
  • saving the file (only if you set the Save File on your Render Setting)
  • then set everything back as if nothing happened

One nice thing about this script is you don't need to worry about what render engine you use for your main renderer. As long as mental ray is (by default) come as one package with your 3ds Max, then this will work. When you run this script, it will render the AO pass and leave your scene back as it was before the rendering process.

The installation is very easy. First you need to download the .ms file (link available below). Run your max, click on MaxScript - Run Script, then browse the downloaded file. Nothing happened but don't be panic, click on Customize - Customize User Interface. Then click on Toolbars tab, choose Main UI on the Group dropdown menu, and find ariespranata on the Category.

You should find the renderAO in the Action as shown in image above. Just drag it to your toolbar on top and the button will be created automatically there. Just click on that render AO button, and new window will appear.

Render AO Pass parameter dialog
There are some parameters that you might want to set to define the quality of your AO pass. The parameter setting is actually the same as the mental ray AO shader and I guess they are pretty much self-explained.

The "-suffix Name" is the text that will be used as a -suffix in your filename. This will only apply when you check the Save File on your Render Setting. No worries, if this script find the same file name, it will ask your permission first whether to replace it or not. Say that you have a file named "Interior.jpg", then the AO will be saved as "Interior_AO.jpg" at the same directory.

DOWNLOAD: MAXScript: Render AO Pass
NOTE: you might need to temporarily turn off your ad blocker. If you find this script useful, I'd be very grateful if you share this blog post instead of the direct link. :)

MAXScript: Render AO Pass version release
ver 1.0
- Initial Release, tested and developed on Max 2011. Update: tested also on Max 2013 and 2015.

If you have some idea to improve this script, please comment below. I'd love to hear that and I'll try to improve this script in my free time.



  1. This comment has been removed by the author.

  2. cool thank you! How to render to texture in AO with this tool? Is possible?

    1. Hi, sorry but that feature is not available at this moment :)

  3. I found this to be very useful as I'm still new to all of this. It didn't set everything back as advertised, granted that could be due to the version I'm running (2012), but I just got around that by doing the AO pass last. Still, thanks for the script.

  4. Thanku soo much....

  5. God bless you for that sharing. It hepled me a lot, appreciate it. For those who are looking for good scripts or tools for 3ds max like this one I recommend to visit where you can find some. Once more, thx for the script.

  6. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. Tamilnadu Ration Card Download


  7. I found this to be very useful as I'm still new to all of this.

  8. God bless you for that sharing. It hepled me a lot, appreciate it.


Related Posts Plugin for WordPress, Blogger...