Video icon 64
Want to learn graphic design? Start your free trial today.
Advertisement

Three Ways to Generate Ambient Occlusion in 3ds Max

by
Student iconAre you a student? Get a yearly Tuts+ subscription for $45 →
Final product image
What You'll Be Creating

1. AO with Mental Ray

Step 1

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.

Step 2

I have also added and positioned several Omni lights in the scene.

Step 3

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.

Step 4

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.

Step 5

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.

Step 6

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.

Step 7

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.

Step 8

Click on the Surface map slot and select Ambient/ Reflective Occlusion from the list.



Step 9

Set the Samples to 128, Spread to 1 and the Max Distance to 20. You can play with these values in your case.

Step 10

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.

Step 11

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

Step 1

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.

Step 2

This opens the Light Lister window. Here turn off all the lights by unchecking the boxes under On.

Step 3

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.

Step 4

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.

Step 5

Press F9 to render the frame, and you'll get the Ambient Occlusion map.

3. AO through MAXScript

Step 1

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.

Step 2

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.

Step 3

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.

Step 4

With the default values selected, click on the Preview AO button. It will immediately show the preview in the small window.

Step 5

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.

Step 6

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.

Step 7

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.

Conclusion

I hope 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.


Advertisement