Background turns black / transparent using Depth of Field when exporting to PNG or EXR sequence

Hello everyone,

When I add depth of field to post-processing, an mp4 and jpg sequence exports just fine (all sequences are converted to H264 MP4 unless otherwise noted).
Software specs: Unity 2019.2.12f1 Cinemachine 2.3.4 Unity Recorder 2.0.3 Post-Processing 2.1.7

JPG Sequence (this exports the same as when exporting directly to MP4 from Recorder)

But something strange happens when exporting to PNG and EXR sequences. The background seems to be treated as transparent. This happens whether “focus tracks target” is on or off. The same issue arises.

EXR Sequence

PNG Sequence

Here’s a single frame

JPG (correct):

PNG:

EXR (Alpha import):

EXR (Transparent import):

There seems to be no way to treat this from the Unity Recorder (version 2.0.3) window. The “capture alpha” box is greyed out. Is this fixed in some other version of Recorder?

There also seems to be no way to control this from the Media Encoder export settings. I tried both 422 and H264

Any ideas? I’d like to keep using PNG export, but this won’t be an option if I can’t use depth of field post-processing.

Comp specs:
Alienware 17 Intel i7
Windows 10 64-bit
NVIDIA GeForce GTX 1080


Hey @ericjacobus ! Thank you for reporting this issue, it’s indeed not the expected behavior.

I’ll open bug report internally to get this fixed but in the meantime switching your Recorder capture mode from “Game View” to “Targeted Camera” should do the trick.

Let us know us know how that goes for you, cheers!

1 Like

Hi,
I am using HDRP, and I have changed the colour to be R16G16B16A16 in graphics settings, but I do not have access to the Capture Alpha button, it is not visible.

Any ideas would be welcomed please :slight_smile: