« Blog Posting | Home | Walking Tour of Boston »

Individual Entry With Comments

August 20, 2006

Ambient Occlusion

Filed under 3D, Maya

Ambient Occlusion (AO) is a trendy shading method for 3D graphics. It is useful for showing off geometric detail. Most AO renders are a single color, usually white, with no texture. AO is a simplification of global illumination (GI). GI can be very time consuming, whereas AO is relatively quick. Here are a bunch of AO examples. Besides simulating the ambient shadows from GI, AO is also used for "rust shaders" and "dust shaders" since AO is darkest in crevices, where rust and dust are the most likely to exist.

I was using Maya 6.0 which did not have built-in support for AO. I was considering creating my own AO shader for Maya 6.0, but decided instead to just upgrade Maya. Now I'm running Maya 7.0 (with 8.0 on the way).

Maya's AO is accessed as a Mental Ray shader. To do an AO render, create an ambient occlusion texture (Maya->Window->Rendering Editors->HyperShade...->Create->Mental Ray Textures->Mib_amb_occlusion) and drag it with the middle mouse button and drop it on the object you want to render. The Connection Editor will pop up to ask you how to connect the Mib_amb_occlusion to the object. Select the "OutValue" of the Mib_amb_occlusion and the "Surface Shader" of the object. When you render, make sure you choose "mental ray" as the renderer to see the results.


Here are some pics of the window I did for the Bank of America Plaza. This picture is from below looking up at the window.






From the side.








I need to place those windows on the building. First I tried duplicating the window with an offset, which was very time consuming and left me thinking there has to be a better way.

Next I found a plug-in in Maya called "geometryPaint." To use geometryPaint, you pick an object to paint with and then use the "Artisan Brush" to paint the geometry on another object. It seems like this would work well, but I ran into a problem. I set the brush to paint my window at every vertex I touch. For interior windows this is fine, but windows on the edge are a problem. The brush uses the normal of the vertex to determine the orientation of the window. The normals for the interior vertices are correct. The normal for vertices on the edge are shared by two sides, so the brush averages the normals. This gives you windows at an angle...which is not what I want.

I could probably just paint the whole model and then go back and rotate the edge window correctly, but I'm going to try another approach...MEL (Maya Embedded Language) scripting.

Comments (2)

Kelvin Hickman:

I noticed a level of graininess in the images. Is that adjustable (i.e. does Mental Ray let you adjust the sampling rate)? I assume that a nice, soft shadow without the grains takes longer to render.


Yes, it is adjustable. I used 64 samples, but I guess I should have used more. 64 is very quick...like less than 10 seconds. I'll play with that the next time I do some renders.


This page contains a single entry from the blog posted on August 20, 2006 6:01 PM.

The previous post in this blog was Blog Posting.

The next post in this blog is Walking Tour of Boston.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.34