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)

1 Like

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.

1 Like

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)

https://i.gyazo.com/72a4a34b8156cd5af4f0618d46ec0d10.png

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:

https://i.gyazo.com/b028653016784f73427b0b0bf6c834bd.png

Annnnnnnnd voila:

https://i.gyazo.com/359ba73666dd42e401e1e408e5a83a28.png

Thanks for the info TheJamsh!

Just some follow-up since this is still the top result for the issue:

I was still having this problem in 5.2. Disabled Render in Main and disabled Render in Depth, but I had my Custom Depth on and a Stencil value. Object was visible in the render and coming up black.

Turns out it was because of the material I had applied to the mesh. The material was a SingleLayerWater Shading Model. This was because it was a child instance of the main water and I wanted to inherit the displacement. The good news is, in the instance there is a Material Property Overrides section and I changed the Shading Model to Unlit and now the object has disappeared!

1 Like