Content is copyright © KatsBits™ 2000-2013. All Rights Reserved.
No part of this web site may be reproduced (except for personal use) without prior written permission from KatsBits.com. For more infomation on copyright click here.
How to bake ambient occlusion maps. It's quite simple to bake Ambient Occlusion maps (AO) using Blender, but, there are a couple of things that need to be done in order for it to work correctly and yield the best results possible. The following tutorial was written with Blender 2.46 in mind; the only major deviation for previous versions of Blender for AO baking is that UVW maps are now done in EDIT mode (TAB) instead of FACE EDIT mode (F) as previously.
For additional details beyond the basic 'how to' please see the 'Advanced user information' section at the bottom of the tutorial.
The mesh needs a material and that material needs a filled texture slot, AO baking relies on the presence of a texture image when done in relation to game/3D content creation. Select the mesh first, then go in to the 'Shading' buttons panel ("F5") and either create a new material or edit the default one that's present. Once done add a texture image slot by clicking on the "Texture-button" button ("F6") and again either add a new slot or edit the default one present (should be named "Tex" if present). Browse to the image, select and add it, it will then appear in the texture slot preview window (shown bottom left of the image below).
By default all the triangles of the mesh will be in what's 'reset' (shown below), this is of no use for AO baking and needs to be fixed by creating or rebuilding the UVW map so that it makes sense for the purpose of AO baking. To view the texture applied to the mesh in press "ALT+Z", that will switch display mode to "Textured View" ("Alt+Z" toggles between "Flat Shading" and "Textured" views of an object in the 3D view-port).
Baking an ambient occlusion map relies on a good UVW map being applied to the mesh. For Blender 2.46 this is all now done from the EDIT mode. Press TAB to enter EDIT mode. Once there press 'A' to select all (this may need to be done twice, once to clear isolated selected faces and then again to re-select all faces). With all faces now selected press 'U' to bring up the UVW mapping options pop-up, from here click "Unwrap" to unwrap the mesh to one single UVW map. The result should be something similar to the image below. It's important to make sure here that the UVW map stays within the bounds of the texture space; for best results make sure there are no stray UVW vertices outside the edge of the texture.
The default setting for ambient occlusion rendering will result is a gray scale image shaded to represent the physical characteristics of the mesh over which the textures is laid. Click on the "Shading" ("F5") to activate the additional relevant material buttons. Then click on the "World Buttons" button to open up the panels associated with ambient occlusion. In here find the panel titled "Amb Occ" and then click on the "Ambient Occlusion" button in that panel to turn on ambient occlusion; a series of button and sliders appear. Leave everything 'as is'. Make sure the mesh is selected (keep the mouse in the 3D view-port) and then press Ctrl+Alt+B to start the ambient occlusion rendering process.
The rendering process will then replace and gradually update the place-holder (checker image shown above) image initially assigned to the material with the gray scale AO baked version. Depending on the complexity and density of the mesh, this shouldn't take too long. The result will be a grainy gray scale image similar to below.
The results of an AO bake can be colour influenced, to do so means switching to a different light influence system that effects the AO bake by using the colours assigned to the 'World' itself. Leave everything as it was for the previous render, except, click the button marked "Sky Colour"; nothing will change but the colour sliders in the "World" panel will now be active and influence the results of the AO baked image. Change any of the "HoR", "HoG", "HoB" ("Horizon" RGB values) and/or the "ZeR", "ZeG", "ZeB" ("Zenith" RGB values) sliders to change the colour that will influence the subsequent AO bake. Press Ctrl+Alt+B to restart the AO render baking process again and watch the results. In the test render shown below the colour influence was shifted to blue which resulted in a baked AO image that had a blue tint to higher elevations. Change colours appropriately as required. This has no effect on render time.
Better quality results than those achieved using the default settings are possible by increasing the "Samples" value setting. Pre Blender 2.46 only 16 samples were available, however, 32 are now possible. Leave everything as is from the previous AO render and in the "Samples:" field either click on the ">" or "<" arrows, or, LMB+Hold+Drag in the "Samples:" field to increase or decrease the number of samples used in the AO bake. Press Ctrl+Alt+B to restart the AO bake process again. The result of increasing the samples used is a much better quality image in terms of the amount of 'noise' it produces; the higher the setting the better the quality, but, the slower the render time; using 16 or above samples results in significant amounts of time given over to the render process (relative to CPU speed).
Once the ambient occlusion map has been baked to the level of fidelity that's required it needs saving. It's best to use an image format that doesn't 'loss' compress the data in any way, so BMP, Raw TGA, TIFF are all viable alternatives; avoid using JPG wherever possible. The resulting AO baked images needs to be saved from the "UV/Image Edit" view-port (Shift+F10 if it's not visible). Click "Image" in the view-port 'header' bar and select "Save As..."; the file browse view will open with a number of buttons and text fields. In the header bar for this new window, look for and click on the drop-down option menu that displays an image 'type'; depending on the parent image (the image originally applied to the material and mesh) the drop down will be displaying "Targa", "Jpeg" or other 'title'. Click and select one of the loss-less formats (tga, bmp, tiff, etc.) and then click "Save Image". The newly created baked ambient occlusion map will be saved to that location. On saving the new AO map it will then become the active texture applied to the material and the UVW map of the mesh.
Baking ambient occlusion maps using Blender 3D