Join Adam Crespi for an in-depth discussion in this video Creating an ambient-occlusion override material, part of Rendering Exteriors in 3ds Max.
Compositing is an important part of our pipeline in producing our exterior renderings. In a compositing solution, or a compositing pipeline, we'll render out often a beauty pass or full color, full light rendering as well as a number of other images that we'll lay together in a compositing package such as Adobe After Effects, or The Foundry's Nuke. What I'm going to do, is set up an ambient occlusion override material. And this'll allow me to get an ambient occlusion render that can then layover my beauty pass.
Ambient occlusion is the blocking of bounced light by adjacent objects. Here's how this works. At some point, light has bounced around enough it is ambient in the scene, it is not from anywhere specific. Adjacent objects block some of that bounced light giving us corner darkness, or proximity shadows, we can think of it. What ambient occlusion does is add gravity to things, making all the fine detail pop out and making everything sit down and appear to be in contact. What I'll do, is use an override material on this scene.
And I'll set it up in the Render Setup dialogue. I'll click on the Render Setup button and I'll go over to the Processing tab. In the Processing tab under material override I'll check Enable. And where it says, None for the material, I'll click on that None bar and I'm going to make a new material. Under Mental Ray. I'll scroll down and pick a Mental Ray material and click OK. This Mental Ray material is exactly nothing. Not just a blank Arch & Design, but really, exactly nothing.
I'll press M to pull up my Material Editor. I'm going to drag this material in. What I'll do, is pull it over here from the Render Setup, dragging it across as an instance into View 1. Now I can edit this material and whatever I do here will change over in that processing slot. In this material, what I'll do is to double-click and rename it, calling it AO, for ambient occlusion, General. Now I'll get my ambient occlusion shader in. I'll go under my Mental Ray maps, in Maps and then Mental Ray, and pick my ambient reflective occlusion material.
I'll drag this onto the Surface Shader of my Mental Ray material. And now this material exactly does not react to light. Because I put the ambient occlusion material into the surface, there's no capacity in this material for highlight or shadow. It can only show where there's ambient occlusion. Now I'll show what this looks like. I'll close my slate and run a quick render. Before I do that though, I'll go into Global Illumination and turn off Final Gather, scroll up. And in Caustics and Global Illumination, turn off the Photon Mapping.
We don't actually need any of those things, or any lights for our ambient occlusion override. I'll also press 8, and go into my Environment dialog, turn off my physical sky, and turn off my exposure. Again, we don't need any of those things for ambient occlusion. Now, run a render and see how it looks. I had it still set to a region, so I'll expand this out to a full view and we'll get a good idea of the ambient occlusion in the scene. What we see initially, is that, everything occludes everything, and we get odd, dark speckles all over our image.
Here's what's going on. I'll press M to pull up that Material Editor. Double-click on the ambient occlusion material to see it here in the Material Parameter Editor. And we can see its bright and dark values. What we're seeing with ambient occlusion then, is that when there is no occlusion, it's white. When there's full inclusion its black. And the max distance is set to zero. This doesn't mean, don't do anything. It means, everybody in the pool. Our ambient occlusion is happening, no matter how far apart things are. And it's giving some darkness in places it shouldn't be.
What I'll do, is bring up this max distance to, let's try 96. I'll also bring up the samples to 64 for better quality, and I'll run another render. Ambient occlusion is a fast rendering, there's no bounce light, there's no ray tracing, really. It's just, where is the occlusion, and how far should it go? This is much better, all the darkness is gone, and instead I've got all of my fine detail really popping out here in the image. I'll bring up the samples a little bit more, and then I'm ready to really tweak that occlusion further.
I'll bring up my samples to 128 so I get some really good clarity on it. In ambient occlusion then, we have a spread and a fall off. The spread determines, in that zone of occlusion. How does it spread? Does it cluster in the corners or spread out into that distance? Fall off then is the rate at which it transitions from bright to dark. Right now it's a linear fall off. And pulling this up or down affects how that darkness spreads. What I'll do is take the spread down to 0.5 and try another render first.
What we're seeing is that that occlusion got darker and tighter in the corners. It's not spreading across those walls nearly as much and its still picking out the fine detail. Now I'll bring the fall off down, and we'll get a different look entirely. When the fall off is at 0.5, we get an inverse square fall off, meaning the occlusion dies off fairly quickly. This is working nicely. I've gone to great length in my image to light up different surfaces, so I don't want my occlusion to artificially darken them. However, I am getting some good grounding darkness in all of my details.
My block wall and my steps are really going to stand out, as is my curb and even the middle of the, leaf clusters on the yuccas. I can continue to tweak this, and I can also bring up my anti-aliasing quality if needed, because I'm seeing some artifacts around the windows. This is a simple ambient occlusion override, and this can really be a terrific plus when you lay it over a beauty image.
- Creating exterior materials
- Adding luster to glass and subtle detail to wood and siding
- Positioning the sun with the Daylight system
- Lighting using HDR imagery
- Lighting interior spaces
- Fine-tuning the photographic exposure
- Rendering and optimizing rendering
- Creating an ambient-occlusion rendering pass with custom materials
- Setting up additional rendering passes for compositing purposes
- Compositing and adding post effects in Nuke and After Effects