Ambient Occlusion Vertex Baker
As a companion to Maya's built-in prelight tool, which allows baking of lighting to vertex colors, I created the Ambient Occlusion Vertex Baker to allow artists to quickly bake ambient occlusion (AO) data directly into the vertices of the mesh with a single-click
This approach to ambient occlusion has the advantages of being far more performant than a real-time ambient occlusion post-processing effect, allowing artists to visualize and control how ambient occlusion will effect their models prior to export, and being much more space-friendly than a pre-baked ambient occlusion texture map.
This approach to ambient occlusion has the advantages of being far more performant than a real-time ambient occlusion post-processing effect, allowing artists to visualize and control how ambient occlusion will effect their models prior to export, and being much more space-friendly than a pre-baked ambient occlusion texture map.
The ProcessThe process of baking the ambient occlusion begins with packing the UVs of each selected mesh.
During the packing process, the faces of the mesh are split up and organized so that each UV corresponds to a single pixel when the ambient occlusion data is baked to a map. With the packed UVs set up, an ambient occlusion material is applied to the mesh. This data from this material is then rendered directly to a temporary texture, which represents the ambient occlusion contribution as sampled at any given vertex. Having baked the ambient occlusion data to a texture, it becomes necessary to transfer this data to the mesh as vertex colors. The simplest way to do this is by abusing Maya's built-in Paint Vertex Color Tool. With the painting mode set to vertex face, the baked ambient occlusion map can be imported as an attribute map to a new vertex color set. At the end of the process, all temporary shading groups, materials, and files are deleted, leaving the user with only a new vertex color set representing ambient occlusion. |