Vision cone using post process material

Hello guys.

I’m trying to make a dynamic vision cone using post process materials.

I’ve manage to calculate the cone in the material from player location and forward vector with a desired angle and max range.
Everything inside this will return a value 1 or 0 (where 1 = Outside the cone / 0 = Inside the cone). It’s then plugged in a lerp node in the alpha pin.
Then lerp pin A is "SceneTextuce:PostProcessInput0 * DarkeningFactor (Basically a value between 0 and 1 to control how much we darken the orginal material outside the cone)
Lerp pin B is only the “SceneTexture:ProcessInput0”

It works pretty well, but as you can see, it’s not dynamic with meshes and don’t darken behind them from the player location.

It’s all done from comparing the player location with the node “Absolute world position”.
(see image 3)

I tried to check if a custom depth was closer (Image 2, From the 2 upper red node) to the player location than the absolute world position value by getting the distance between player location and absolute and checking the stencil behind but it doesn’t have any effect.
I think I’m probably doing it wrong but I don’t really understand how to get the occlusion dynamically from the character when there is the wall inside the cone.