Baking ambient occlusion to alpha

Hello all,

This must be quite trivial, but I can’t figure out. Every time I try to bake ambient occlusion, Blender always bakes to an opaque image, with a solid white background. Is there a way to bake AO to an empty image, consisting only of alpha channel (so I can layer it on top of the texture UV layer)? It works when I bake lightmaps and shadowmaps, so I’m sure it’s possible somehow…

Thank you in advance.

Don’t think it’s possible. But I’m also curious how you do this with shadow maps.

(so I can layer it on top of the texture UV layer)

setting it to Multiply would get the same result.

Hmm, unless i don’t understand exactly, it’s possible in Blender (at least in the recent buildbot version i use)

In the UV/Image editor i create a new image, in the image setting i click on the color (black by default) as if i was going to change it, instead of changing the color i simply set the Alpha to 0 , making that new image fully transparent.

I assign this texture to a cube

I “simple” subsurf another cube and in sculpt mode draw a bit on it.

Then i bake the AO from the sculpted cube onto the normal cube (make sure “Clear” is not enabled), i obtain this :


The alpha transparency is still there apparently.

To test, i assign this texture on every side of a cube, and i obtain :

And indeed the alpha transparency is still exisiting, it has not been replaced by an opaque white or black.

I see…

In Blender, yes, but it’s not gonna work with the 3D engine I’m modelling for.

Your AO map itself still has opaque white background, just placed on a larger texture consisting only of alpha.

EDIT:

Okay, I found out what to do. I exported the AO map as a PNG image, loaded it in Gimp, used the “Color to alpha” tool to transform color value 255, 255, 255 to alpha, and got exactly what I wanted. Now I can layer it on top of the diffuse map, and it looks nice both in Blender and in my game engine.