How to render AO pass with alpha channel in Blender 2.8?

Hallo everybody;
there is a way to render AO pass with alpha channel?
Thanks for e reply!

I checked in EEVEE:
As far as I see there are two options: hold outs and cryptomatte
You set the film on transparent, and in compositor you use Alpha Over.
Pass AO needs to be enabled. And if you go for cryptomatte that as well, which is possible in Blender 2.92 - EEVEE. For hold-out you add a plane in the background, move the plane in a collection and give the collection a hold-out

Okay, but what happen in Cycles…?
Any ideas?

I realise my solution is most likely not what you are looking for. So you want the “AO-shadows” to be black and all the rest tranparent, right?

Here what I got so far. No special passes, but with shader nodes in Cycles.

1 Like

Updated previous post. Is that what you are looking for? So, in the example, the cube has an intrusion, and only there is AO.

Yes, I’d like AO Shadows black (greyscale…) and rest transparent.
Let me try, but tell me: do you create a new collection with the copy of the extruded cube, with a Grey material and then did you create the node as above, right?

No need to put the cube in a collection. I just gave the cube the material as shown in the screenshot.
The color (grey) doesn’t matter it seems; I didn’t put any lights in the scene.

I did it, but I can’t see any transparency…
can you give me the simple scene?
And I notice also, you don’t have any AO in the extruded part of the cube, or am I wrong?

In properties panel > Render Tab > Film, did you enable transparent film there?
I will check later if I can provide a simple scene (having dinner time at the moment)

Yes, I enabled it
I share my scene
AO_with_Alpha.blend (115.1 KB)

See you later and thank you, of course!

Here the scene back. If you render that out, you will see the render as in my screenshot. Forgot what I did exactly, but I remember I turned also the environment light off, and pasted my material.
AO_with_Alpha.blend (152.0 KB)

You might think that you see the cube in the render, but it is the intrusion in the cube.

Okay, but AO are also in the all superface of cube…

When I render the scen out, I got this:

What you see there is only the intrusion in the cube. The rest of the cube is transparent.
If you want a scene wide render with AO, I guess you have to apply materials to all objects.
There is no AO on the other faces of the cube, because there is no geometry that occludes. Would change if you make a plane under the cube.

But I realise now, that you only want AO on visible geometry. As it is now, it looks like an Xray AO. So we need an extra node, I guess something with light paths

If you try in EEVEE you can see where are the right AO…

Right! You can see the AO in the two faces occluded. And AO are also near the edges even if there are any occlusions…

So far I don’t get it to work with nodes it seems. Hopefully some-one else has an idea. Otherwise you just have to render out the AO pass and composit the white into alpha, if that works wel enough.

Okay, thanks for now!

1 Like

Hi Peetie, I am trying in EEVEE to catch the AO, can you please show the Compositor nodes for the first solution?
I still didn’t install Blender 2.92