Refraction issue with PP depth-based fog

Hi everyone! While working on a post-process fog material I faced a problem with incorrect refraction rendering. I seem to have tried everything I can, but the image is still “duplicated” with distorted image and fog contours, instead of including refraction in the depth pass. I’ve tried everything, hoping to find some sort of refraction pass to apply to the SceneTexture depth output node, but no luck. I’m really hoping someone can help!


On the left side of the image, there is a plane with refraction material between the camera and the objects

By the way, I found that Exponential Height Fog behaves correctly in this regard, but unfortunately, I can’t use this solution because I need exactly post-process material (split-screen 2P game, with different fogs on different parts of the level). Again, unfortunately, I’m not good enough in C++ to understand exactly how this actor works and then repeat the logic of the material.


The result I would like to get using Post-Process material