Join Aaron F. Ross for an in-depth discussion in this video Applying ambient occlusion, part of 3ds Max: Advanced Materials.
- [Narrator] Our example of baking maps using render to texture is an ambient occlusion pass. Ambient occlusion is the way light doesn't reach into the crevices and cracks on an object. And that will work well for us if we want to, for example, cause the cracks to be a different color. If the target renderer supports ambient occlusion in the shader tree, we can use that, but for example, ART, does not. If we want that special effect then we would need to render ambient occlusion out to a bitmap, and then use that bitmap in the ART material.
We can do that using Mental Ray. Right now I've got no materials on the object. Let's go ahead and open up a Material Editor. And create a new standard Material, and that will be compatible with Mental Ray. Under Materials, Scan line, Standard. Drag that over, double click it and let's call it AO Standard. We don't need to change anything here. The specular highlights are at zero, all we need is a self-illumination of 100%.
Here's the self illumination amount. Just crank that up. And now there will be no shading on the model. No lighting will appear in our baked texture. And now we will create our ambient occlusion note and that's going to be found under Maps, Mental Ray. And it's called Ambient/reflective occlusion. Drag that over, and connect it's output to the diffuse color of the AO Standard material.
Now we can assign that material, select these three objects, just drag a rectangle. And with that material node selected, we can click assign material to selection. And the objects just turn a flat color, and that's because the viewport doesn't understand this ambient occlusion effect. We can press F4 in the viewport and see wireframe. Now let's adjust the ambient occlusion parameters, double-click on that node, and we have several of these that we want to play with. First is Spread.
Spread is not the distance across which the effect will spread. Spread is actually the directionality of light. Imagine that we have light coming from everywhere in this scene. The Spread value allows us to determine whether light is coming from just above, or above and below the model. If you want perfectly spherical light, then set the Spread to a value of one. Max distance is the distance that rays will travel across the model, and it is responsible for achieving, basically the dynamic range between black to white across a certain distance.
I set that to a value of 15 centimeters. Then we have the Fall off, and that's basically contrast. Increase that up to a value of five. And up at the top is the Quality or Samples. The render to texture dialogue actually has a basic ambient occlusion path built right into it. However, you do not have access to these parameters under those conditions. And that's why I'm going to the trouble of building this shader, is because I can set these values the way I want them, and also make sure I won't get any graininess in the rendered texture.
So I'll set the Samples up to 64. Let's do a test render of this just using Mental Ray and the active camera. With focus on that physical camera, click on Render Production. Alright and that's our ambient occlusion effect. We're not seeing any lighting on the model because it's perfectly self-illuminated.
- Streamlining material editor workflow
- Managing XREFs and materials
- Laying out a scene for material testing
- Using the Physical Material
- Controlling highlights with Roughness
- Directing reflections and refractions
- Simulating translucency and scattering
- Building a shading network
- Combining and color correcting maps
- Baking maps such as ambient occlusion
- Procedural mapping with Substance
- Using relief maps: bump, normal, and displacement