Is it possible to use an objects ambient occlusion value as a mask?

In substance painter, the ambient occlusion value is often used to create some powerful masks. I’ve often wanted to do something similar with my unreal materials without exporting an ambient occlusion map from a third party software.

I want to access a model’s ambient occlusion value so that I can make masks in engine on my models. Is this already possible, or is there a simple node setup I could refer to?

This is the best I have been able to achieve and hopefully will illustrate what I’m trying to do.

Thanks for your help

Thanks, Ares, but im trying to find out if it’s possible to avoid having an ao texture altogether. I often use a bunch of coordinate nodes to generate procedural masks. For example Absolute world position node and masking in the z axis to get a gradient from the ground upward.

I want to find out if there is a node setup that could essentially generate an ao map of any object directly in engine without exporting from substance or mixer.

1 Like

Did you ever find an answer to this? I think I’ve been trying to solve the exact same problem.

I also have come CLOSE, using an odd setup, but there are some problems and limitations.

'm trying to create a Material (NOT a PPM) that can take advantage of AO per object

This is kinda the result I’m going for, where I can apply essentially a pencil shaded look where there’s AO. (image 1)

Currently the closest I’ve been able to get is using an odd setup with SoftOpacity in an Translucent material. (image 2)

The problem with that is it creates odd depth artifacts, where it’s not consistent what object is rendered in front of which, and when multiple objects are using this material, they no longer “intersect” - in image 1 the sphere and the cube are actually overlapping but the sphere renders in front.

The other problem is if the camera is at the wrong angle, it renders the faux AO really clipped (image 3)

If I use Scene Texture: AO, it’s not per object, it’s just pulling ALL the AO, and also renders any objects using that material as invisible (except for showing the AO through it) (image 4)

Again, I don’t want to use a Post Process Mat because I really need to be able to use this per object, not as a post filter affecting the screen (I don’t like how the Look of that stays static when the objects or camera in the scene are moving)

Curious to hear if you’ve figured out anything different!

Hey I figured this out - there’s a recent tutorial that covers this exactly!

You can purchase the project, but it’s actually updated a bit in this second tutorial where the camera moving doesn’t cause weirdness