General Blender - how to bake AO maps (and land a rocket on the moon) ?

Dirk Steffen

Porsche Factory Jackass™
Premium
In my little learning project I became again stuck badly with Blender.

I am running the current v2.8 and just cannot figure out a way to create AO maps and bake them into textures within Blender.

So far I have kind of figured out how to do the whole thing manually (UV mapping in Blender, creating AO maps in Content Manager, merging AO and texture maps in Photoshop) but I would love to do the whole process in Blender entirely.

My biggest problems are:

1)
AO maps in Blender come out with extreme deep shadows (entirely useless for AO) and I just cannot figure out how to influence the rendering in Blender to tone down the shadows)

2)
Light source - what light source ???
I moved around the spotlight -> no change in how the shadows are rendered
I created a second light source -> no change
I literally moved THE SUN and a spotlight INSIDE an instrument pod to see how this effects rendering of the instrument interior -> NO CHANGE

I am stuck :-(
 
Could you post pictures of your ao map issues? Also ambient occlusion iirc doesn't use the lights in blender. There are lots of tutorials about blender and ao maps in youtube as well. Have you tried following those? Ao maps can be added easily on top of textures in gimp with using multiply or burn modes, probably same in photoshop.
 
Zwischenablage01.jpg

AO baking somehow got worse in 2.8 compared to before, but I get these results with those settings there on the right. Important is that you got a simple ground plane to reflect the light.
 
Could you post pictures of your ao map issues? Also ambient occlusion iirc doesn't use the lights in blender. There are lots of tutorials about blender and ao maps in youtube as well. Have you tried following those? Ao maps can be added easily on top of textures in gimp with using multiply or burn modes, probably same in photoshop.

Yes, I spend several days now to figure this out but ran into a wall not getting further.
The issue with most tutorials about Blender is that in v2.8 the UI had some significant changes and most tutorials are specific to earlier versions whcih for a Blender beginner are pretty much impossible to follow with v2.8 (a lot of the controls have moved).

I know how to do it in Photoshop (Gimp I use only as a crutch as I don't have a PS license for Windows and use Gimp on the PC only as a quick patch up app but I am sure it works just as fine merging diffuse and AO textures).

My goal though is different:
- I want to completely get rid of the manual AO process outside of Blender as I like to set everything up procedurally to avoid having to do do-overs every time I change a detail and re-export the project
- no Photoshop / Gimp, no Content Manager after Blender is the goal
- set up materials, nodes and simply re-unwrap once I change an object and re-bake within Blender

I am sure it can be done this way, I am just not very clear yet how - but getting there sloooowly ;-)

View attachment 389880
AO baking somehow got worse in 2.8 compared to before, but I get these results with those settings there on the right. Important is that you got a simple ground plane to reflect the light.

This is PRECISELY super helpful!
Thanks so much for sharing these settings - the results look fantastic, exactly what I am after!
I will be giving these settings a try and see if I can get similar results.
When baking AO for objects that are somewhat "hidden" within the car (say parts in dark places in the cockpit or engine bay), is it best for such results to isolate the individual object completely or can AO be baked with the objects in situ ?

I would like to take a group of small objects from all over the cockpit, unwrap them on a single 4K texture as a group and bake them like that rather then doing piece by piece.

Is this wishful thinking on my part (read: AO not working well?)
 
You can setup a complex node setup material and bake those into textures. One of the annoying things in blender is that there are so many things which other objects can interfere with the bake. If you have completely black areas it is usually sign of overlapping objects. Some object somewhere could be set to visible. Eye icon and the monitor icon don't hide objects from bakes. Only the disable in renders icon does (camera icon). Same with collections. You need to manually disable everything in renders so they don't block your bake.
 
There is no light source for AO, it just calculates what percent of directions are blocked by other objects and puts that into the texture. So any objects that are renderable (as above, these may be hidden in the viewport)

One very annoying part of 2.80 is you can no longer bake part of an object, every material gets baked to its active texture. My workaround for this is an extra node that looks like this.
nTd5wHo.png

It's just a 1x1 texture that's selected (orange outline) instead of the regular baked texture. Blender still spends time baking this but it's less than if you used a high resolution texture. So I only leave the material I'm actually working on the AO for with an active texture.

Blender hides the actual AO settings in a different tab from the bakes:
3TNHpHs.png

I believe factor is the maximum it can be occluded (ie. 1.0 means black). Distance is how far it tests rays; on 2.79 I used about 0.5m, but on 2.80 it seems like Cycles requires much larger values to actually generate dark enough maps.
V0CpGuW.png

I found 128 samples too noisy so I have AO sampling at 1024. Takes a while using my 1070 so you might not want to go that high. This is still noisier than 2.79 internal renderer was with 16 samples, I guess they use different methods of counting.


VAO-patch is not really a tool for original content, it's for conversions from sources that don't texture everything.
 
Absolutely awesome help guys!

You can setup a complex node setup material and bake those into textures. One of the annoying things in blender is that there are so many things which other objects can interfere with the bake. If you have completely black areas it is usually sign of overlapping objects. Some object somewhere could be set to visible. Eye icon and the monitor icon don't hide objects from bakes. Only the disable in renders icon does (camera icon). Same with collections. You need to manually disable everything in renders so they don't block your bake.
Thanks for the tip - I make a mental note to always double check for dark areas caused by overlooked mesh issues - completely forgot about that ;-)
The dark areas I had experienced luckily were caused by me using the compelte default world render settings, cleverly completely hidden (they really belong into the AO Bake tab, thanks for the hint @Stereo I would have never figured this out in a hundred years!

And what's the difference between adding a vao patch later?
VAO patches (tracks and now cars (?!) are really great and I love what Ilja is constantly coming up with.

In my case they really don't help though.
I would like to incrementally (read: perpetual tinkering) work on a car and piece by piece bring the objects in to shape, texture it as I learn and as I improve say a texture on an object I want to have the exact AO bake settings already in place and saved and be able to have repeatable results (AO baking in different builds with the exact same settings.

It seems so far that with Blender this is possible and it saves a lot of work going through the external AO baking process on each test build just to test something out.It also easily allows to change settings and save them easily which is much more cumbersome with an external command line bakery for VAO patches.

There is no light source for AO, it just calculates what percent of directions are blocked by other objects and puts that into the texture. So any objects that are renderable (as above, these may be hidden in the viewport)

One very annoying part of 2.80 is you can no longer bake part of an object, every material gets baked to its active texture. My workaround for this is an extra node that looks like this.
nTd5wHo.png

It's just a 1x1 texture that's selected (orange outline) instead of the regular baked texture. Blender still spends time baking this but it's less than if you used a high resolution texture. So I only leave the material I'm actually working on the AO for with an active texture.

Blender hides the actual AO settings in a different tab from the bakes:
3TNHpHs.png

I believe factor is the maximum it can be occluded (ie. 1.0 means black). Distance is how far it tests rays; on 2.79 I used about 0.5m, but on 2.80 it seems like Cycles requires much larger values to actually generate dark enough maps.
V0CpGuW.png

I found 128 samples too noisy so I have AO sampling at 1024. Takes a while using my 1070 so you might not want to go that high. This is still noisier than 2.79 internal renderer was with 16 samples, I guess they use different methods of counting.


VAO-patch is not really a tool for original content, it's for conversions from sources that don't texture everything.

Wow - really great tips and tricks here!
Thanks so much for sharing!

The issue with the essential AO bake settings hidden in world settings is something no Blender beginner will ever possible find ;-)

I found with using @AccAkut and your settings when setting this in"World Properties":
2020-07-19 233909 screenshot.jpg

I get about similar nice mild grey results (but still much more noise which I am still trying to find out how to avoid).

When using even much lower settings as "Factor" (as low as 0.01) and the default (?) Distance of 10m I get bad results (extremely noisy and still dark black shadows).
When using Factor: 0.5 and Distance 0.5m the results look much more what I want to achieve (still not as nice what I currently get out of Content Manager + Photoshop) but I am getting there at some point.


Question:

What does the "Ambient Occlusion" node do which is available in the node editor?
I tried to variate some settings wildly but did not see any response in the resulting baked texture (neither when trying to mirror the settings in "World Properties" and AO Bake nor when wildly deviating from them - ti seems the AO node properties are overruled by the AO bake in the World and Render tabs on the right ?
Am I understanding the AO node wrong ?
I thought I could use it to individually per material be able to fine tune AO (different settings for each material) ?

AO node in material node editor (default settings it comes with):
2020-07-19 234748 screenshot.jpg
 
Did you use the AO node I posted above at all (old, new /blender versions should eb the same about this I suppose ?) ?

What does it do?
I couldn't get any reaction out of it and don't understand what it is supposed to be doing at all (I was actually hoping I could manipulate AOper material individually with it, so I can have more precise control what causes shadows on objects where it matters but I couldn't make it work at all).

[EDIT]:

Scratch that question ;-)

I just found the best short explanation on the internet how to use this AO node in Blender - he drank A LOT OF COFFEE before filming the video but nevertheless, it answers all my AO node questions perfectly ;-)

Maybe it is useful for some people:

 
Last edited:
Did you use the AO node I posted above at all (old, new /blender versions should eb the same about this I suppose ?) ?

What does it do?
I couldn't get any reaction out of it and don't understand what it is supposed to be doing at all (I was actually hoping I could manipulate AOper material individually with it, so I can have more precise control what causes shadows on objects where it matters but I couldn't make it work at all).

[EDIT]:

Scratch that question ;-)

I just found the best short explanation on the internet how to use this AO node in Blender - he drank A LOT OF COFFEE before filming the video but nevertheless, it answers all my AO node questions perfectly ;-)

Maybe it is useful for some people:

No joke, I often turn down replay speed when watching these tutorials
 
Yes, Blender 2.8 is a bit difficult now and it's also difficult to find the right help. However, there is help especially because you can still use tutorials related to Cycles and from there you can then track down where the functions went in 2.8 UI.

I personally would suggest to have one blend template for AO baking. So that you can just add your model and bake textures as you need. Also preparing a separate mesh for AO really helps (e.g. you can avoid bad clipping) and don't forget to add planes below objects to simulate ground AO bounce (not for rotating objects of course! you can use a plane in right angle to the rotation axis instead but probably best is to use no plane here at all).

Anyhow, nothing more to add as it seems everything was already answered before :thumbsup:

Oh, last but not least: This is gold! Thank you for the lol @AccAkut :roflmao:
2020-07-20_21-17.png
 
Back
Top