Compositing FAST-GI AO

Hi, i must suffer of amnesy…
I’m using this fast-gi configuration to boost up the overall lighting of a scene


but then I’m making a full composite using all passes like in here:


Now, obviously the result is not the same: the image comes out darker, as in the latter image i linked, there’s no AO contribution.

The question is: how should I mix the AO pass to obtain a 1:1 image with ehat I see in the preview and in the regular “beauty” pass???

I have just tested the behavior of AO with compositing and it appears that Blender cannot do what you are trying to do.

The AO pass treats every material as diffuse, which means it can’t be properly used for compositing, because it doesn’t take into account reflections or transparency and so will never look the exact same as the fast gi.

There might be a workaround though. Rather than using fast gi, you could instead go into your object’s materials and plug an AO node into the emission color of every material that’s mostly diffuse.The result of that should show up directly in the different render passes and if you need the diffuse occlusion, it will be present in the emit pass.

Ambient occlusion is a feature that hasn’t received lots of attention in Cycles, beacause it’s largely considered as obsolete. AO was invented at a time when renderers couldn’t produce detailed indirect light, so AO was used instead as a basic approximation of sky light and for creating the contact shadows that were missing back then.

Also, fast gi is included largely as a preview feature and doesn’t seem to have been thought for compositing.

AO is normally multiplied optionaly after the beauty pass. Helps with contact shadows and integration. There are several compositing techniques using utilities passes.

CG Compositing:

Yeah, I know that, but what I’d like to know, is how it is composited in the viewport and the final render, in the current implementation, so that I can replicate it in the compositor.
For the larger picture: I try to always denoise by passes, so I take each one of them, do stuff, and then recombine following the rule (direct+indirect)*color.
Everything is fine until I use fastGI, since I don’t know how to recombine it in the node-graph.

AO by itself isn’t part of the beauty pass it’s already there as an auxiliar to indirect passes calculation. Using divide operation you can remove it. Doesn’t matter if you’re using fast mode.

I don’t understand. If I can remove it “by divide” I should be able to add it with a multiply, shouldn’t I?
I can’t: the moment I multiply the imagine gets darker, while instead, the AO is added and makes the result brighter.
I tried adding 1 to AO pass and multiplying it but no luck, the result is different from the beauty pass and the preview

Did some diging about fast GI, yet didn’t found nothing about equations behind it. For Replace method math still the same but for Add method, found out by testing, that adding AO before diffuse color multiplication using mist pass as fac input will output a visually similar image. Also I was just getting better render time with Replace method, maybe the scene I tested wasn’t big enough.

Fast GI Add (Left is composite, right is rebuild):

Fast GI Replace (Left is composite, right is rebuild):

Thanks for testing. I’ll check this out as soon as I can.
Your scene lacks of transmission component. So it is to check how diffuse surfaces behind a glass will look.

Nope Lucas. Sadly your solution is not a solution.
I checked and it doesn’t work.
For more than one reason:
the beauty pass has AO added in glossy and transmission surfaces too. As it can be seen in your image, the mirror ball is dark, unaffected by AO. Put this into a large mirror and boom. The same goes if you have a glass in the scene. Everything behind it will not be boosted by AO.
Another thing is that if I add AO to direct diffuse, any not diffuse object in the view will show black diffuse color, and hten when I multiply it onto denoised diffDir+diffInd anything in those non-diffuse areas will get Back in Black :love_you_gesture:
I think I need to ask to devs on devTalk, to know what the math is. Thanks everybody anyway