Download

Custom Depth + (Disabled) Render in Main Pass = Black Actor?

Hi, when enabling CustomDepth on an actor for post processing, disabling Render in Main Pass turns the actor completely black.
It used to hide the actor while allowing the post process to exist (Ex: An outline around an invisible object).

Is this a bug or was it changed on purpose? Is there some other way to have the CustomDepth working while hiding the actor from view?

Thanks!

(Below shows the combination of Custom Depth + (Disabled) Render in Main Pass turning the actor black)

You have “Render In Depth Pass” checked still (beneath “Render in Main Pass”), so my guess is that it’s still occluding the pixels behind it and no instructions are running on those, so they’ll just be black.

Turning that off disables the custom depth all together. So the cube just vanishes instead of keeping custom depth + Postprocess enabled.

I’ve already done this years ago for my main character. A skeletal mesh not rendering in main pass was able to have an outline just fine.
However now attempting the same gives the black box. (I found a post about it 1-2 years ago too)

I’ve checked and unchecked just about every box in the actor with no success.

There has to be something I’m missing. Surely I’m not the only one in the last year or so trying to make outlines.

Just tested in 4.25 and it worked for me. “Render In Depth Pass” only affects the main depth pass in this case. If render in custom depth, you need a post-process material applied to the scene that actually does something with custom depth.

See here:

I’ve got an outline that vanishes with the box… BUT

I just realized it’s because the box stays in CustomDepth but disappears from SceneDepth, which was needed for the outlines!

The outline code used to use SceneDepth (taken from an official UE4 tutorial) so I replace most of the SceneDepths with a function that combines CustomDepth+SceneDepth:

Annnnnnnnd voila:

Thanks for the info TheJamsh!