The quickest way to bake AO to a complex Scene with multiple Meshes/Materials

Hello, I am new to this forum and new to advanced Blender :slight_smile:

I would like to bake ambient occlusion (more in the future) to a complex scene with many meshes and materials. I saw many tutorials that did not work for me :frowning:

So far I had different failed attempts:

  • when baking, the UV switches to one of the used textures and nothing happens to my created AO Image file → the baking did not work at all
  • The baking worked partially, but some parts of the scene are completely black (they should not :smiley: )
  • One attempt included creating an AO image texture for a clone of the scene that was stripped of all other textures. So a single AO texture was added and baked into the image texture file. The Mesh only had AO texturing afterward. Here I had the problem that I did not know how to merge my existing Mesh (with many materials and textures) to the resulting AO image texture… It seems I would need to combine it like a “Texture Layer” and an “AO Layer” that are blended together or something like that…
  • Somehow my bakes are only impacting those materials of my Scene that have a external texture file added to them… The Meshes that i created with blender based materials (no textures files used) semm to be uneffected by my AO baking

Is there a quick/simple way to bake AO to a Scene? (without manually add an image texture to every material for example…) I wish I could just export the AO that can be previewed in the render properties… :smiley:

Hope I am not making a fool of myself…
Thank you in advance!


My Scene: Many objects and even more materials (with some using textures)

Before we start, you will need to first understand the concepts of “UV unwrapping”, and how to have multiple UV maps on the same object and how to use them inside a material. If you don’t know those things, you have no chance of understanding how to complete the bake in your scene here, so go learn those first.


So, you have a scene that already has textures (which I assume are setup using UV mapping). This means that an occlusion bake will need to be done on a second UV set, so the existing texture isn’t disrupted. Add a second UV set to every object, that way the texturing you already have can be done using the first set and the occlusion can be done on the second.

Select the second UV set on every object. Make sure they are all unwrapped in that second UV set. Then select every object, go into edit mode on all of them at once and pack the UVs. That way, you have a UV layout where all the object can share the same texture without overlap.

Now, you need to go to the material editor (on any material from the room) and create a new, blank image texture. It will be used to receive the bake. Don’t connect that texture to anything yet, it just needs to be present in the material editor and selected, to tell Blender which texture you are baking to. Also, add a “UV map” node, plug it into the vector of the image texture and set it to the second UV set, where all the objects share the UV space.

Go to each material of the room, duplicate that setup and make sure they all are set to use that same blank texture you just created. Go into each material and make sure this disconnected image texture is selected and is the only thing selected on every material.

Now, select every object in the 3D scene and bake the occlusion. The occlusion settings in the “fast GI approximation” section in the render settings are used, even if fast GI is disabled. Each object will be baked one by one, so you might want to temporarily join them for the bake (or use a joined duplicate of the room).

After the bake, go to the UV editor and save the baked image to an external location (or pack it) so it’s saved. Now, go to every material and mix it with the existing color texture using a mix node set to “color” and “multiply”. Give each texture its appropriate UV set.


That texture must have been selected in the material editor.

There sadly isn’t. Blender’s baking system is old and under developped. The developpers do have plans to improve baking in the future.

Can I ask you why you want to bake AO on an entire scene? Maybe there is an other way and it’s not necessary?

Hello, I posted a similar question yesterday and still have some troubles regarding AO maps.

In my project there is a complex scene with many meshes and even more materials (~80). I managed to create a somewhat ok AO-bake to an image texture (see added image). Now I’d like to apply this AO map to my mesh and I don’t know how.

I created the AO map by cloning the scene → joining all objects to one → stripping all the materials → creating a single AO-material → bake AO to an Image texture → add that texture to the material

As you can see, I still have some trouble creating a good AO-map (door frame + radiator)

Is there a simple way to apply this AO-map to my mesh on the left? I would not want to handle every single material of the scene. Or is there a better way to do this in the first place (not creating a map on a clone without any materials somehow).

My goal is to export the Scene on the left with AO added to it (export as glb/gltf)

Thank you for any help! :slight_smile:

If you are going to use this in a game engine, does it not have a light baking feature?

Also would SSAO (in your target renderer) not be enough for your need?

There are a few ways to bake AO in Blender, but none is simple/straightforward TBH. I would first try to figure out a way to bake AO for each mesh (in batch mode) using BBB (instead of merging them etc.)

Thank you for your answer :slight_smile: I might try BBB and see if it creates the results i need.

The model is going to be used in a Babylon JS web app and the end goal is to create a way to export the scene (which can be edited in a 2D Mode), add visual effects as AO and import it to Babylon again. Babylon has an integrated SSAO feature, but performance is the key objective and the app is to be used on mobile as well. So sadly Babylons SSAO results in a bad performance and i’d like to bake this effect to the Scene before it is rendered.

Having to wait for the export → adding effects → import once for a couple of minutes would not be a problem as long as the performance is good after that. In the end I’ll have to automate all the work done in Blender (or any other rendering tool)

Good luck. BBB has its own particular way of organizing things, but once you get how it works I think it is a real time-saver.

Two random tips that may or may not be useful:

  • Create a new blend file just for BBB stuff.
  • Use presets (saves a text file) because you can’t specify file format and color mode per bake pass. (if it’s just AO, not applicable)
1 Like

There is no need to join all the objects just for baking AO. Cycles can handle all scene objects when baking AO. You can bake AO for every individual object and have separate AO maps.
Just remember to uncheck Only Local on the AO node before baking.

Thank you for your detailed answer! I’ll try it out right away :slight_smile:

Two of my posts got merged: The quickest way to bake AO to a complex Scene with multiple Meshes/Materials - #5 by Sarrus4x4

I need to render scenes with good lighting/shading and with a focus on performance. So i’d like to bake as much information as i can to the Meshes before they are finally rendered.

1 Like

Thank you,

in this case i’d have to apply the AO maps to all the different meshes separately right?
In the future, this whole process should be automated, so I need to find a way that i can script in some way.

Have you tried Lightmapper addon? It seems to be made to simplify similar scenarios.

1 Like

I don’t know what you mean by apply here.
AO node is part of the shader setup, and you can use it however you want. You can bake AO separately or as a part of diffuse map for example.
The question is do your web app is handling a separate AO map or can you just bake AO+diffuse channels together?

Those parts look black in the bake. In the case of an AO bake, that could mean the objects have their normals inverted.

1 Like

Hey all, I found the best solution for my Problem/Usecase :slight_smile:

It comes in the use of the following Plugin, which allows the user to bake Lighting and AO by the press of one button :heart_eyes: