Using Dynamic AO as a mask in a texture

How can I use Dynamic AO like the generated AO as a mask in a material? Or is there another way to get this type of masking in a material? It has to be dynamic. A pre-baked texture will not work.

You can’t, dynamic AO is a post process, it has nothing to do with the actual material.

ok, is it possible to render 2 different buffers of an object and then blend them using the AO buffer as a Post effect?

It should technically be possible, don’t know if the engine supports it. You would render a pass for each material and then combine them.