If this kind of global effect, you can set it into player camera. Just explore camera settings in your character class.
I’m not get for what you need it, but here is example.
In project settings find Rendering->PostProcessing->Custom Depth-Stencil Pass and set it to EnabledWithStencil.
Place any object into scene and in it’s Render settings check Render CustomDepth Pass and set CustomDepth Stencil Value to, for example, 10.
Create post process material like this:
Open your player character blueprint, select camera component and in it’s properties find PostProcess Materials and set this material as asset.
Start game and check results.