UE4 High Res Screenshot Custom Depth Mask Clipping

I’ve been doing some composite work in UE4, the final step of which is to use the High Resolution Screenshot tool to capture an image using the custom depth as a mask.

What this is supposed to do is capture only objects that are rendering with custom depth and mask out everything else. The result should be a nice rendering of only the custom depth objects and a transparent background, ready for compositing.

In practice, I was finding that I couldn’t even see my custom depth objects, as if there were a far clipping plane obscuring them.

Hmm, this is not what I was hoping for

The Setup

For each object that should exist in your mask, you have to select it and check the following option. You may have to do this in bulk depending on your scene.

An object is set to be rendered into the custom depth pass

Next you use the screenshot tool and enable Use Custom Depth as Mask.

Use custom depth as mask and you should only see the objects that you’ve selected

If you only see a purely green screen at this point, then read on.

The Solution

After a bit of sleuthing, I found a mask material provided by the engine, it calls a single material function:


If you open this function, you will see the nodes below.

We found you!

The constant that is circled is the maximum scene depth that the material will render. The default is 10,000, so anything beyond this distance will be lost. Increase this value to the maximum distance that your objects will be from the camera.


    • You may need to change the “View Options” (the eye icon on the bottom right of the content browser) to show engine content. Then select the “Engine” category in the content browser and search for it there.

Leave a Reply