From the course: 3ds Max: Tips, Tricks and Techniques

Faking GI with an Arnold ambient occlusion filter - 3ds Max Tutorial

From the course: 3ds Max: Tips, Tricks and Techniques

Faking GI with an Arnold ambient occlusion filter

- [Instructor] Previously in this weekly series, I demonstrated how to save render time by disabling global illumination diffuse rays in the Arnold renderer. Instead I used an Arnold sky dome to provide an even, ambient light. That movie was titled Approximating Global Illumination in Arnold. This week I'll build on that technique by adding an ambient occlusion light filter. Here's the image rendered without the light filter and here it is with the light filter applied. So I'll switch bath and forth between those two images a few times so you can see the difference. This is actually the original use case for ambient occlusion way back in the 90s. A flat even wash of illumination is added to the scene and the distance between surfaces determines how much of that ambient light is blocked or occluded. The result is darker shading in the corners of rooms, the crevices in and between objects and anywhere the ambient light would be blocked. The rendering is not as realistic as global illumination, but it's much faster. If you're rendering high resolution images or animation, you may not want to wait for many hours to render a single frame. Now here's an image that was rendered with two diffuse rays or two bounces. It looks good but is fairly grainy. I had to decrease the diffuse sampling up to six to get this level of quality, which resulted in a render time of over 40 minutes. Now again, take a look at the same scene rendered with no diffuse rays and the scene wide ambient occlusion effect. Again, this doesn't look as realistic, but it rendered in five minutes instead of 40. I was able to use the default value for diffuse samples which is only two, so the trade off is clear. Disabling diffuse bounces and using ambient occlusion makes the image less realistic, but it renders an order of magnitude more quickly. This technique relies on an ambient occlusion light filter for Arnold which is not part of the standard MAXtoA installation. Mike Farnsworth at Solid Angle kindly developed this light filter for Arnold 5 and Mads Drischler complied it for MAXtoA, so thank you Mike and thank you Mads. We need to install the light filter in the program file directory, so let's go to Windows Explorer. In the exercise files I provided for this weekly series, I've created a custom folder called plugins. Inside there is a descriptive folder, ambient occlusion light filter for Arnold 5. Go inside there and there is a plugin DLL file, AO light filter dot DLL. Select it, right click, and copy it. Now go into your program files. It'll be on your system drive, program files, Autodesk, 3ds Max version number, plugins. Inside plugins you'll find MAXtoA. Go in there and paste the file in here. Right click and paste. You may need to click trough a prompt or even provide a password. Now we've saved into the program files directory. We also need to create a Windows environment variable. One way to get there is to right click on the computer icon in my case labeled this PC and then go to its properties. Click on advanced system settings and then click environment variables. We need to create a new environment variable. Click the new button and type it in just exactly as you see it here in all capitals, Arnold underscore plugin underscore path. The variable value will be the path to the file we just copied. We can go back to the Windows Explorer window and if that path is displayed, we can just right click at the end of it and choose copy address as text and go back to our environment variables, paste that into the variable value, click there, and then right click, choose paste. Now the path is pasted in. We can click okay, click okay to exit the environment variables. Click okay to exit system properties and now with the file in the right place and the environment variable created for the current user, we can now launch 3ds Max. In this scene, I've got all lights turned off so that we can most clearly see the effect of the ambient occlusion light filter. Let's create an Arnold sky dome. To create it most cleanly, we'll turn on 3D snaps, go to the create panel, lights, from the pull down list, choose Arnold, click the Arnold light button, and in the front view port, click and drag from top to bottom to create the light and its target. Release the mouse, right click to exit creation mode, go to the modify panel and change the type over to sky dome. Let's take a look at this in an active shade rendering. I've got that set up already. Click active shade on the main toolbar and it's overexposed. We can go into the light parameters. Under color intensity, reduce the exposure down to its minimum of negative five. Now we have light coming through the windows. We actually don't want this. We want an overall wash, so let's turn off cast shadows. Scroll down a little bit more. In shadow, disable cast shadows. Now we have an even flat wash over the entire shot. This is exactly the condition we want for a true ambient light. We can fine tune this a little bit by changing its color temperature. Scroll back up a little bit. In color intensity, change the color over to the type of texture and we need to supply a map. Click the no map button. In the material map browser, go into the maps OSL section and you'll see black body. Select that and click okay. Now we need to adjust the parameters, so let's open up the material editor and drag that map over into the materiel editor view, choose instance, double click it, and rename the node. We'll call it sky dome color. We just need to change the minimum and maximum values here for the color temperature. Let's set them both to a value of 4,800 degrees Kelvin. That's giving us a little warmer color because the camera is currently set to 5,000. Now we're ready to add the Arnold light filter. With the light still selected, go back to the modify panel. From the modifier list, choose Arnold light filter. We need to assign a map. We see that it actually appears in the list here under maps, Arnold, AO light filter. So one way we could create this would be to simply open that up and drag it into the material editor view and then click on its output, hold down the mouse, drag it over to the modify panel and drop it on the no map button and then in the instance copy map dialogue, choose instance, click okay. Then double click on that node and rename it ambient occlusion. Let's see what this looks like. Here is our active shade rendering still running and all we need to do to enable or disable it is turn this modifier on or off. So with it turned off, we have the flat illumination and then turn it back on again, we can see the ambient occlusion blocking some of the light. Let's change the far clip value to a value of 10 and now we can see that we're only seeing the occlusion effect where surfaces are close to one another. Okay, that looks pretty good. We can turn on our ceiling lights. Close the material editor, select one of those lights, and turn it on in its light properties and our active shade updates and we can see the effect of global illumination being faked. Now we can render an animation in 1/10 of the time and have less grain, although we would be sacrificing some realism. That's how to use an ambient occlusion Arnold light filter to fake diffuse global illumination in Arnold 5.

Contents