Bug when using Depth Fade node in Post process Material

I am using unreal engine 5.0.3 and when using the Depth Fade node in a Post Process Material, it creates a weird ghosting effect as you can see from the image below


This is the image for how I made the shader

Steps for reproducing the issue:

Step 1: Create a new project (it can be any project template) in UE 5.0.3 and give it a suitable name.

Step 2: In the new project, go to Content folder and create a new material and name it fog and open it.

Step 3: Make sure to set the material domain as post process and recreate the nodes from the image above to create the fog post process material and make sure to apply all changes.

Step 4: Go back to viewport and in here above the viewport you can see bunch of buttons and there is a button beside the Select Mode button that allows you to quickly add actors into your scene. Click it and navigate to Visual Effects and select PostProcessVolume

Step 5: Once you have added the PostProcessVolume you can scroll down in details and search for Post Process Materials under Rendering Features and add the fog material we had created before in the array.

Step 6: Scroll further down in details for Post Process Volume Settings and set Infinite Extent(Unbound) to True

Expected Behavior: The game should be creating this weird offset from the actual mesh as you can see from the image.

I also do want to mention that during my testing, some new projects that I created to test this issue had its bug somehow resolved. But when I tried to create the same project template once again and followed the same steps as mentioned above, the bug reappears. So just because you followed the steps above in one project and the bug didn’t appear doesn’t mean the bug is not there so try following the steps in a new project

Did you test it in 5.2?

No, I only tried testing this in UE 5.0.3. This issue shouldn’t be in this version of Unreal Engine either way, as I am already working on a project with UE 5.0.3, and upgrading the project to UE 5.2 would be difficult. I want to know if this issue is only happening to me or if others are able to reproduce it.

Epic doesn’t backport fixes to old versions of the engine so your only real option is to locate the source of the issue and backport the fix yourself, or work around it.

In the latter case, my first suggestion would be to see if it is dependent on the screen percentage, as this is a common source of problems for post process effects.

You should also try building the fog effect directly with the depth buffer rather than relying on the depth fade node.

1 Like

Thank you for taking the time to reply to me.

“Epic doesn’t backport fixes to old versions of the engine so your only real option is to locate the source of the issue and backport the fix yourself, or work around it.”

I didn’t know that; I thought Epic would still fix any bugs for older versions of Unreal Engine since there are no LTS (long-term support) versions of Unreal Engine like with Unity or Blender.

“In the latter case, my first suggestion would be to see if it is dependent on the screen percentage, as this is a common source of problems for post process effects.”

I tested this out, and sure enough, that did kind of fix the issue, but only in the viewport. The moment I try playing the level, the bug comes back.

“You should also try building the fog effect directly with the depth buffer rather than relying on the depth fade node.”

In the end, I decided to follow your advice and try working around this issue by creating a new fog material using the Scene Depth node instead. I assume this was what you were talking about.

Applying the material to a sphere looks like this

2 Likes

That is indeed what I meant, for what its worth if you’re going to use this as a surface material it is best to do the fog effect in the emissive output instead of basecolor, otherwise scenecolor will be clamped and affected by lighting.

1 Like

Once again, thanks for replying.

Here is the improved fog material after making some modifications based on your suggestion.

I think it looks good, and it’s now more similar to how the fog effect would be using the depth fade node. Thanks a lot for helping me.

1 Like

Hello everyone
This material not work for me.

Please, share your files.

Hi - I know this is really late, but thought I would post a solution that worked for me.