AO Texturing in Maya

Game Version: FS 2011 upwards
Programs required: Maya 3d Modelling | Photshop | GIMP


Modding Index | Vehicle Tutorials


Hi everyone and welcome to this tutorial on how to make an AO (ambient occlusion) texture on Maya. I'm talking about an AO texture , not AO render Wink First off, before you start learning how to make AO texture for your models, do you know what it is, what it does, what it changes ?

Here is a quick definition (from Wikipedia): Ambient Occlusion Definition

Every good model isn't perfect without a good texture, and that imply that you make an AO texure.

What you will need

Autodesk Maya, about any version should work, I use 2012 ; Adobe Photoshop, that's what I will use in the tutorial, but GIMP should work, I just don't know how

Step 1. Open the 3d mesh you want to AO texture

You will obviously need something to work on while doing this tutorial, if you want to try it for yourself. I will use something as simple as a cube, but keep in mind that the technique is the same for complicated objects, considering you have a good UV mapping of that mesh.

This is the beast I'll work on : Fig:1

Step 2. Baking the Ambient Occlusion

Now that you have your model selected, you need to bake the Ambient Occlusion to it. First off, select the rendering tab in the dropdown menu, top-left corner. Fig:2

On the top list, go to Lightning/Shading > Batch Bake (mental ray) , click the little box Fig:3

This window should pop-up : Fig:4

(if it doesn't, it's because you didn't click the little box)

To make sure that you start with a clean window, go to Edit > Reset Settings. Change the following lines :

Prefix > *Name of your choice ex: AO_Cube* Use bake set override > Tick Color mode > Occlusion File format > JPG (altough you can use TIFF or even BMP)

You can change the X/Y resolution to 1024, 2048, whatever you want to suit your needs.

To finish this step, click on Convert and Close. This is what you should have : Fig:5

Step 3. Exporting the AO texture

Open the Hypershade editor, found in Window > Rendering Editor > Hypershade. This should pop-up : Fig:6

On the top, select Texture instead of Material. Fig:7

Click on your texture that should appear if you followed this tutorial correctly Fig:8

Look in the Attribute Editor, on the right of your screen, to see the path where the file was saved (under File Attributes) Fig:9

My file is saved in Documents/Maya/Projects/Cube/RenderData/mentalray/lightMap/baked-blinn1SG-pCube1 . Your path should be the same, except for the “Cube” wich should be your project name.

Once you found that path, go and copy your AO texture to your desktop.

Once you found that path, go and copy your AO texture to your desktop.

Step 4. Making a good texture from our AO texture

We now have the baked AO texture. But I'm about 100% sure that you don't want that white AO texture for your tractor frame, wheel or rim. You need to “attach” a real texture/color to your AO texture.

In this example, I'm going to make a blue cube, but if you have a complex object like a tractor or implement, and that you have the correct UV map of it, it's the same thing that you have to do.

When you did the Step 2, the program created a UV map with AO of your object. In my case it's simply the cube unfolded, like we all did in primary school, but it you previously mapped your tractor or implement, it will be that UV map that will be AO textured (I don't know if this seems clear enough to you, but it doesn't matter, the manipulations are still the same).

Open Photoshop, and open your AO texture that you dragged to the desktop. You should have something like this (if you made a cube of course). Fig:10

Create a new layer, and paint if the color of your choice (blue in my case). Put the new layer (the one with the color) below the AO texture that we created in Maya.

In the dropdown menu just above the layers, select Multiply instead of Normal. This should merge your color to AO texture Fig:11

This is the result : Fig:12

IMPORTANT : If the object you are texturing is a more complex object than a cube (and I guess it is), it's the same thing. Instead of creating a layer that you paint in blue, like I did, you need to put your UV map in this layer. You can't start with a not-textured project like me if you are doing something more complex that requires UV mapping.

Let's say you were to make a cultivator, you need to 1) Make the mesh 2) Make the UV map, something like this : (Fig:13 –> This one is by Solanz, not me, but it's a great example 3) Follow this tutorial 4) Put the UV map from 2) in the layer in Photoshop. I really hope this is clear enough, if it's not feel free to post here below or to contact me.

Step 5. Applying your AO texture to your model

Almost done ! Your texture is ready to apply. In Photoshop, save the file as a PNG (or JPEG if you want to, doesn't really matters) to your desktop or wherever you want.

Go back to Maya, and select your cube object Right-click it, and hit Assign New Material. Select Blinn, Lambert or Phong depending on your project. Fig:14

Now, in the Attribute Editor on the right, click the little button beside Color Fig:15

In the window that pops-up, click on File, and beside Image Name click the folder icon Fig:16

Select your AO texture on the desktop, and you're done ! If you don't see the texture, press 6.

This is the AO textured cube : Fig:17

I hope that you liked the tutorial, don't forget to rate and comment. If you find any mistakes, please post below, I'm not an expert when it comes to AO texturing but I thought it was worth it to share this knowledge with you, so you can improve even the most basics models. Good luck, Marxtai

IMPORTANT : If the Batch Bake (mental ray) button is dull, and you can't click it, you might need to enable mental ray. To do this, go to Window>Settings/preferences/plug-in manager. Make sure that mayatomr.mll is loaded and auto-loaded (both boxes ticked).


Original Author: Marxtai | Date: July 30, 2012

Modding Index | Vehicle Tutorials