Any way to get scene behind a mesh in a Post Process material?

This looks to me like not being technically possible (with current features), but I would like to ask to be sure before I drop the idea.
What I would need is if I have an object in the scene, turn “Render Custom Depth” for this object to be able to “select it” in post processing, then distort it in some crazy way and then to be able to “compose” it back on the original scene/image. For the composting part I would basically need the scene without the object rendered.

Is there currently a way how to do that?

Thanks

Hey -

You should be able to remove the mesh from the Main pass and then add it back in through a Post Process which would allow you to control its visibility. There are currently some issues with Custom Depth in 4.4.3, so I will run some tests in 4.5 and see if I can replicate.

Thank You

Eric Ketchum

Thanks, I will look into that.