Get a free year on Tuts+ this month when you purchase a Siteground hosting plan from $3.95/mo
1. AO with Mental Ray
I have made a very simple scene for this demonstration. This scene contains a teapot, a box and a sphere. I have also applied some materials and set the rendering engine to Mental Ray.
I have also added and positioned several Omni lights in the scene.
I have chosen Mental Ray Shadow Map as the shadow type. And in the Mental Ray Shadow Map rollout, I have set the Map Size to 2048 and the Samples to 24.
Press the F10 key to open the Render Setup window. In the Renderer tab, set the Minimum value to 4 and the Maximum value to 16. And select Mitchell for the Filter Type.
Now render the scene. It looks nice, but the depth is still missing. However the shadows are soft. We can enhance the overall look by adding an Ambient Occlusion pass while compositing.
In general words, Ambient Occlusion (AO) is a method of creating soft shadows around the corners where objects meet. It gives an extra sense of depth and realism. Look at the image below for a before and after comparison.
Let’s see how we can generate an Ambient Occlusion pass using Mental Ray. Press M to open the Material Editor. Pick an empty slot and click on Standard, then choose Mental Ray from the list.
Click on the Surface map slot and select Ambient/ Reflective Occlusion from the list.
Set the Samples to 128, Spread to 1 and the Max Distance to 20. You can play with these values in your case.
Press F10 to open the Render Setup. Go to the Processing tab and enable the Material Override option. Then select the Ambient Occlusion material slot and drag and drop it onto the Material Override channel.
Now press F9 to render the frame. This is the rendered frame with the Ambient Occlusion pass. You can see the soft shadows around the corners where the objects meet.
2. AO with the Scanline Renderer
If you want Ambient Occlusion using the Scanline renderer, then you need to use a trick. First, disable all the lights in the scene. To do this, go to Tools > Light Lister.
This opens the Light Lister window. Here turn off all the lights by unchecking the boxes under On.
Go to Lights >Standard Lights and generate a Skylight in the scene by clicking and dragging in the viewport. Turn on its Cast Shadow option.
Press M to open the Material Editor. Pick an empty slot and select a pure white for the Diffuse color. And then apply this white material to all the objects in the scene.
Press F9 to render the frame, and you'll get the Ambient Occlusion map.
3. AO through MAXScript
Michele Marcelli has written a very useful script for creating Ambient Occlusion. You can go to www.scriptspot.com to get the script. The best thing about it is that the script is FREE to use.
Download and install the script. Normally you have to put the script into the Scripts folder of the 3ds Max root directory. Now back in 3ds Max, go to MAXScript > Run Script. This opens the browser, here select the script and click on Open.
The script window opens with a warning message. It says that you need to change the renderer from Scanline to Mental Ray. Click on OK. It will automatically change the rendering engine to Mental Ray.
With the default values selected, click on the Preview AO button. It will immediately show the preview in the small window.
If you are satisfied with the preview, click on the Render VFB button. This will show you the final result. The output result looks good, but is a bit grainy. So we need to tweak some values.
Increase the Sample rate to 256. Now, first click on Preview and then click on the Render VFB button. The rendered frame is much clearer and smoother than it was before.
Previously this script was only capable of rendering a single frame, but with the updated version, you can now render all of the active timeline frames.
you have enjoyed these three ways to create Ambient Occlusion in 3ds Max. The
script written by Michele Marcelli is the fastest way to get the Ambient
Occlusion. The script is totally FREE to use, however if you find it useful,
you can donate an amount to the creator of the script as a return gesture.
This is only a matter of choice.