How to apply a post process DOF only to custom depth pass meshes?

Hey guys,

Wondering if I can get a bit of guidance here as im not that experienced with materials/post. I looked up a bunch of threads and videos and learned how to use custom depth to do basic things, like outlines/colouring a mesh a solid colour for example, but its not really what im looking to do.

I have a weapon scope, and I simply want to give it a small blur using DOF settings inside a post process. My plan was to attach a post process volume to the players first person camera, and setup some DOF settings on it, and then plug in a post process material to the volume, then switch on use custom depth pass for scope meshes.

Thing is, ive got no idea how to plug in values to do that.

ive managed to make my mask, but I dont understand one part specificially. If you plug in a scene texture post process you essentially see what you’d normally see, then adjusting parameters in your PP volume obviously changes what you’re seeing, like normal. But where do I just plug in my scene colour, because scenecolour isnt accepted in a PP domain material. How am I supposed to get an unaltered version of the scene to use alongside the post process alterered scene.

If someone could give me some advice on how to set up a material to do that it would be great!

Cheers in advance, I really appreciate your time!