SSAO per material, is that even possible?

Hi there,
For a project, we have a room with a wardrobe.
The room has lightmap baked so it looks gorgeus.
But the wardrobe doesn’t, because it is dynamic and should be able to be opened and changed in many ways.

So we thought to use SSAO in order to make the wardrobe pops visually (if not using anything, it looks so flat).
But SSAO is not needed in the room and only in the wardrobe.

My coding guy told me SSAO works at scene level, so you have it or not, that’s all.
But I’d like to be completely sure there is absolutely no other way to do it, and that’s why I’m asking here.
So, is there any way to create a SSAO effect per material (or object)?

Thanks in advance!

You can use a second camera to render the meshes that should not receive SSAO and use the technic described in this post to make it work:

As an example:

2 Likes

Thank you so much @Evgeni_Popov
I’m passing that information to my colleage @paleRider and will get you back with some feedback.

Hi @Evgeni_Popov, looks like we meet again here:

On the technique you are describing to @joie, regarding it is using a post-process, I’m a little afraid about the performance penalty I guess it will bring to the scene. Isn´t it?

Hey @paleRider !

If you are already using at least one post process for the 2nd camera, it won’t add any perf penalty because you don’t need to create the “pass” post process, you can attach the RTT to the existing post process. Otherwise, you will indeed have an additional post process, but that just copies the texture to the framebuffer, which should not be too performance heavy. But you should of course test the changes and see if it’s acceptable to you.

Hi there, @Evgeni_Popov:

I apologize for the delay in this reply, but we’ve been very busy with other parts of our current development.

This said, I’m going to give it a shot to these techniques, and let you know about any issues we can find, if any.

Best regards.