Ambient Occlusion is a feature which is supported by nearly all up to date game engines. However this is a global effect and will only affect real existing geometry. If you have a material that is faking geometry, by using bumpoffset or parallax occlusion mapping for example, and want to achieve the same effect on that material you can make use of ambient occlusion maps.
Ambient occlusion maps can be either baked in 3D modeling programs, like 3dsmax, Maya or Blender, from a high poly mesh to a low poly mesh. Or beeing generated out of ohoto ressources with programs like Crazy Bump, Njob or Shader Map Pro.
Adding ao maps via ps/gimp
The easiest way of using ao maps in gimp/ps is to add them in a new layer and change the layer blending to "multiply". This will cause those areas of the texture to become darker, where the ao map is not white. The actual greyscale will cause some spots of the base texture to become darker than others.
Another possibility is to create a layer copy of the texture and lowering its brightness. The ambient occlusion is then beeing used as a layer mask and controls the blending between both textures.
This method allows changes without touching the ao map itself. You can also give the texture copy a certain color hue or modifiy it in different ways if you want to.
Adding ao maps inside the editor
To add ao maps in the material editor you will usually use a multiply node (shortcut: "m"+"leftclick") and connect it to the diffuse as well as to the ao texture sample. This works quite similar to the layer multiply with gimp or photoshop.
In some cases you won't be satisfied with the result. This is where you have to do some changes to the ao map. For example by changing it's brightness, what can be done by multiplying the texture sample with a Constant node (shortcut: "1"+"leftclick"). Values <1 will lower the brightness whilst values bigger than one will make the image brighter. Or by changing the contrast. Therefore you will have to add a Power node and use a Constant node as Exp(onent) input. Again, vaules <1 will result in less contrast and values >1 increasing the contrast.
If you brighten the ao texture sample (=multiply by >1) make sure to plug it into a constant clamp node (max=1) before the diffuse multiply. Otherwise some parts of the diffuse texture will be brightened, what is usually not what you want to achieve.
Sometimes you don't have the posibility to create ambient occlusion maps or you just think it's not worth the effort. In those cases it is often possible to use a (modified) height map as replacement for an ao map. In analogy to the examples above you can adjust the height maps brightness and contrast to fit your needs. But there is one downside: height maps will usually have parts with a dark grey or even black, what makes the result somehow odd looking. To avoid this you can add a constant clamp node and set its minimum value to anything >0 and <1. A value of 0.5 for example causes medium grey to be the overall darkest color in the height map.
Conclusion
Ambient conclusion maps can help alot to identify the geometry represented by a material. Espacially if normal maps have no visible effect they are of great use. . To be more exact normal maps cause a less visual effect the more the angle between material surface and its lighting source is close to 90°. To demonstrate this here are 2 pictures of comparison where the sun is nearly at it the zenith.
1) normal map only, no ao map
2) normal map + ao map
On looking closely you can see that the top of each stone has the same brightness on both screenshots. Only the ground and the stones lower parts are darker if using the ambient occlusion map.
-- Edited by mAlkAv!An on Monday 31st of October 2011 01:46:02 PM