Home Technical Talk

Tut: Baking AO Maps Using a Normal Map

polycounter lvl 18
Offline / Send Message
AstroZombie polycounter lvl 18
The following procedure covers creating an Ambient Occlusion or "shadow map" using a normal map and low poly mesh in 3ds max 8. This may be old news for some of you, but it is a technique I learned recently so I thought that I would share.

Some may ask "why not just use your high poly mesh and a projection modifier to generate your AO map?" The advantage of the procedure covered here is that you will recieve highlights and shadows from any normal details added in Photoshop that were not in your high poly mesh.

I did not discover this procedure, but am just sharing the knowledge I acquired elsewhere here:

1. Create an omni light, and place it at [0,0,0].

2. In the “Advanced Effects” tab for your omni light, check the “Ambient Only” checkbox

3. Open your material browser and create a new material with a diffuse material set to medium grey (R=128,G=128,B=128).

4. Click the "bump map" slot for your material and select "normal bump." In the "normal map" slot select "bitmap" and choose your normal map. Apply this material to your mesh.

5. Assign Mental Ray as your renderer; Rendering > Render (or just hit F10) > Assign Renderer > Production: ... > mental ray Renderer.

6. Go back to your material browser and create a mental ray material. Under "Basic Shaders > Surface" select "Ambient / Reflective Occlusion."

7. In your omni light’s Advanced Effects, check the Projector Map checkbox. Choose the Ambient Occlusion material.

8. Create a plane and place it beneath your mesh.

9. Select your geometry, go to Rendering>Render to Texture. In the Output, Add both Normal Map and Ambient Occlusion. The finished Ambient Occlusion map should now include shadows cast by the normal map.

Replies

  • kat
    Offline / Send Message
    kat polycounter lvl 17
    Pictures? I don't have Max so would be interesting to seeing the results. *nudge nudge*
  • Rick Stirling
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    I don't like the results - I played with it this afternoon.

    It's quite similar to a system I use, but instead of metal ray I use a lightdome. It's scripted, so it created the (multisub) material by duplicating the main material and erasing the spec and diffuse maps. It renders much faster and I think the results are nicer.

    Obviously I can't show any of the results, but heres a quick run down for scripters:

    Built your light dome and add a few spots if you like. Group all these lights and save the file. The reason I group the lights is to make scene cleanup easier - at the end I use select $lightgroup and then delete $ to clean up the scene.

    Copy your material, change the bump to normal bump and set the set the spec and diffuse to UNDEFINED, and set the diffuse colour to 127 127 127 - most of this is exposed int he max listener window for scripting.

    You can automate it by counting the number of submaterials and then running a loop. When maxscript is used to change a multi material the listern window reports a diffent command for sub 1 than all the other subs, leaving out the[subid].

    To automate the normal bump, grab the filepath to the texture, set the bump to be normalbump, then pop the path back in.
  • skrubbles
    Offline / Send Message
    skrubbles polycounter lvl 18
    I know this is an old thread, but I just stumbled across it. I tested this process out a few minutes ago and the result were a lot nicer than I thought they'd be... not top notch, but definitely usable.

    This is great info... thank you a bunch AstroZombie. And Rick, I haven't tried you're method yet but I'll give it a try in the future.

    Basically just dug this up to say THANK YOU smile.gif
Sign In or Register to comment.