Is this possible

You can start from here: .unrealengine.com/latest/INT/Engine/Rendering/PostProcessEffects/PostProcessMaterials/index.html

Can’t help you more though, never done before.

EDIT:
Tom Looman (also posts on forums) might be able to help you since he’s done similar custom depth materials. example: