Accessing DepthBuffer for post processing

Hello i currently have an issue.

I am trying to access to the depth buffer in a post-process shader (DirectX11 mode). like so:

But as you can see on my video there is a “bleeding” issue. My 3D scene is composed of a terrain with billboards on it and my camera is above the terrain in the video.

[video]https://www.youtube.com/watch?v=XLj1kDrTIcM[/video]

Here is the code i am using to display the depth buffer in the video.

float depth = Sample2D(DepthBuffer, iScreenPos).x; oColor = float4(depth, depth, depth, 1.0);

Thank you for your help !

I have fixed my issue by putting:

After

In the “Deferred.xml” RenderPath

Fixed :slight_smile: