Bake Ambient Occlusion
Compute the Ambient Occlusion (AO) influence between each selected object, and bake it in textures. This action can be useful to improve performances and AO accuracy by avoiding using realtime GI or SSAO post-processing.
Parameters
Parameter | Type | Description |
---|---|---|
storageMethod | StorageMethod | Define how to store the ambient occlusion. As a texture or in the vertex color. |
mapsResolution | AOMapDimensions | Generated texture size, per mesh. |
resolution | Int32 | Custom resolution for generated textures size per mesh. |
samplesPerPixel | SamplesPerPixel | Number of rays used to calculate the occlusion value for each pixel in the rendered image. Increasing this value will improve the quality and accuracy of the ambient occlusion effect by providing more detailed and smoother maps of shadows and shading, reducing the need for a denoiser. However, higher samples per pixel lead to longer processing times. |
samples | Int32 | Custom Samples per pixel value. |
denoiseIntensity (Denoiser) | DenoiseIntensity | Adjusts the strength of noise reduction in the output AO values. Higher settings provide a cleaner result by reducing graininess but may slightly soften fine details. Select based on your desired balance between clarity and detail preservation. |
groundIncidence | Boolean | A fictive plane will be used to simulate the ground incidence on the object. |
advancedUVParameters (Advanced) | AdvancedUVParameters | |
forceUVGeneration (Recreate UVs) | Boolean | Override existing UVs. |
uvChannel (UV Channel) | Int32 | Useful if you use custom lit shaders. Otherwise keep 0. |
padding (Padding) | Int32 | Increase it to prevent mipmaps light bleeding. |
bentNormals (Bent Normal maps) | Boolean | Bent normal at a given surface point corresponds to the axis of the cone defined by non-occluded directions. It's automatically applied for HDRP/Lit materials. |
advancedVertexColorParameters (Advanced) | AdvancedVertexColorParameters | |
storageMode (Apply Mode) | VertexColorStorageMode | Override RGB channels or multiply existing color with AO value. |
singularizeInstances | Boolean | Whether to singularize meshes that are shared between multiple GameObjects. |
Additional Information
Ambient Occlusion (AO) enhances visual realism by simulating subtle shadowing effects caused by nearby geometry. Baking AO information into textures is a common optimization strategy in real-time 3D applications, striking a balance between visual quality, performance, and artistic control. This allows you to create detailed, realistic models without sacrificing runtime performance.
The Bake Ambient Occlusion action enables you to generate AO maps directly in the Unity Editor—without requiring advanced artistic skills or external DCC tools.
When baking AO: If the original material is shared by multiple objects, the action automatically creates a material variant to preserve existing assignments.
- The resulting texture is automatically repacked based on the active render pipeline used.
- The texture is saved in the Scene, Prefab, or as a separate asset according to the
Save Assets in
project setting.
Toolkit BakeAO vs Unity’s Native Lightmapper
Why use the Asset Transformer Toolkit's BakeAO feature instead of Unity's built-in Lightmapper? Unity’s Lightmapper is powerful, but it has workflow limitations for interactive or configurator-style projects:
- Requires objects to be static.
- Light is baked per scene.
- Results are difficult to tweak.
- Iteration times can be slow.
Example: In the image below, AO baked with the Lightmapper remains on the floor after moving the shoe, creating unrealistic artifacts.
Advantages of baking AO maps into materials:
- AO is embedded in the object, so it does not require static objects.
- Maps can be reused across multiple instance and scenes.
- AO can be split per subcomponent, enabling modular configurations.
Limitations:
- No Global Illumination stored, meaning less realism (only contact shadows are simulated).
Example: The shoe can be moved freely while retaining AO detail baked into its material.
The Bake Ambient Occlusion
action solves user challenges effectively with per MeshRenderer baking, through simple parameters (see above).
Storing AO Data
As a texture Map
The most common method is to store AO values in a dedicated texture. Unity’s Standard Lit materials support AO by default, and the texture will be automatically assigned when using the Standard Lit Shader in the Built-in Render Pipeline, URP, or HDRP.
If the AO slot cannot be detected in the material’s shader, the texture will be saved in your project folder. The exact path is logged in the Console.
In Vertex Color
To reduce memory usage, you can store AO values directly in the vertex color data instead of in a texture. This approach is ideal for very low-end devices (e.g., HMI systems, mobile devices) and allows the use of simple vertex color shaders. In the advanced settings, you can choose to:
- Multiply AO with existing vertex colors.
- Override RGB vertex data entirely with AO value (useful for custom shaders).
To display and debug the result, you can use the vertex color draw mode
Note
- Mesh topology strongly affects baked AO quality. Extremely thin triangles may cause visible interpolation artifacts.
- As the data is stored in the mesh, instantiated Mesh will have incorrect data backed. You may want to activate
singularize instances
option in the advanced settings.
Ambient Occlusion stored in vertex colors.
Ground incidence
The Ground Incidence option adds a virtual plane beneath your object during AO computation, simulating shadowing from the ground plane.
Influence of the ground on baked AO results.
Bent normal
The bent normal at a given surface point corresponds to the axis of the cone defined by non-occluded directions. It is used in advanced shadowing techniques like the HDRP/Lit shader, in which it helps to reduce Skybox and LightProbe diffuse reflection bleeding.
Bent normals are baked alonside AO, then converted into a tangent space and object space textures. In HDRP, this option is activated by default. The texture is applied accordingly to your normal space mode setting. Then the Specular Occlusion Mode is automatically set to From AO and Bent Normals.
Specular Occlusion comparison.
Troubleshooting & Guidance
The action's UI displays helpful messages to guide users in resolving the most common issues:
- UV channel not populated.
- UVs not normalized.
- UV overlap.
- SkinnedMesh checking.
- Non-standard Lit shader without AO property.
- Too many maps to bake.
Limitations
- Automatic AO/Bent Normal texture assignment is not supported for custom shaders (textures are stored in the project instead).
- No support for Alpha Clipping Threshold in AO baking (planned feature).
- Incorrect results for material with tilling values.