Ambient Occlusion Baking with 3DS Max.

Download as PDF

This guide aims to explain a few issues regarding Ambient Occlusion (AO) baking that aren't adressed much elsewhere, as well as show some to actually bake AO in 3DS Max.

Ambient Occlusion baking is the act of rendering the global occlusion of an object, to a texture, via its UV coordinates, This means your object must be completely unwrapped before you can attemp baking AO. It's actually even necessary to keep AO baking in mind when UV'ing your model, mostly in regard to overlapping and sharing UV space. In general, you can't share UV space when you bake AO, but there are many ways around this. I'll go over the problems and discuss a solution.

Overlapped rendering

The first problem is straight forward: if a pixel of a texture is used twice by a polygon's UV coordinates, your baking process will write to that pixel twice, overwriting previous information. This isn't always a problem, but can result in weird facetted bakes that are completely unuseable. Since you should always strive to make the most out of your UV space, uniquely unwrapping the otherwise overlapping parts is not a solution for this. The baking process is clearly the only problem here. The solution is to offset your overlapping parts. You move one or more of the overlapping parts (so there's only one polygon occupying the UV space) exactly 1 UV unit aside. This makes sure there is no more overwriting. Out of bounds texture coordinates are wrapped back during texture lookups, but not during rendering to texture, fixing our problem. This offsetting is made easy when you use the Unwraptools v1.50 from sloft.net, which has a move type-in that allows you to move selected vertixes for exactly 1 unit.

Example of artifacts due to overlapped rendering

Offset UV coordinates with Unwraptools 1.50

Non-symmetrical AO sharing

Symmetrical objects can easily share AO texturespace, al you have to do is mirror their UV coordinates. Problems arise when the AO baked onto the texture, is not correct for each side. Imagine a car bumper, where each half shares the same texturespace. Now if there is some sort of detail in front of only one half of the bumper, you might end up with a black spot on the other half of your texture, even though there is no occluding geometry there. In such a simple case, it's enough to only bake the half without occluding geometry and trade off some accuracy in your AO maps. More complex problems arise when you have object that are really different in terms of occlusion, use the same space. Depending on how wrong the bake is, you might even have to completely overpaint small parts of you baked AO. Just try to keep it really generic in terms of occlusion, just some simple shading that works for all geometry using the texturespace.

Illustration of problems with non-symmetrical models unwrapped symmetrically. The right image shows the corrected version.

Baking Methods

Now that these things are done and over with, we can go over to the main focus of this article: AO baking methods in 3DS Max. I presume you already know how to use the Render-to-texture interface and know your way around some rendersettings in Max. For Vray, rollouts are the bars you can click to expand their content.
The rendertimes I list for each example are with a 3.3Ghz Intel quadcore cpu, the difference in speed might be a lot bigger with slower CPU's.

Method 1: Scanline with Skylight and LightTracer.

This is one of the simplest methods to which everyone has access.

Downsides of this method are that it's not especially fast, and that intersecting geometry is not anti-aliased when rendering the sections to texture (can look ugly). I personally never use it because of this.

Method 2: Mental Ray AO element

This method is even simpler to set up and doesn't require any materials.

Downsides: Quite slow if you want decent quality (more than 64 samples), especially slow if you want it noise-free.

Method 3: Mental Ray AO material

This method yields the same results, it's just different to set up.

Downsides: same as MR AO element, bit more work to set up and you need to overwrite your object's materials.

Method 4: VrayDirt

For this method you need the Vray renderengine, at least v1.50.

This method is actually the fastest one I know. It's not really accurate however, since it's not full occlusion as it only looks at geometry and doesn't do any raytracing like the previous methods. I think it's one of the most straightforward ones to render, yet you still have all the extra control over quality that Vray offers.

Method 5: Vray Irradiance Map

This one also requires Vray. It's quite difficult and long to set up compared to other methods.

This method is my preferred way for full quality renders. It's slower than all the others, but allows full control over pretty much everything. Unlike the scanline and MR methods, you can change pretty much every setting. This method is also not limited to using Irradiance Map as the primary bounce engine, you can try and use other ones just as well, there's a lot of stuff there to use. Might want to read these tutorials if you decide to do so (they have taught me a lot!).