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)
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.
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:
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!