I’m unable to see the mesh rendered into Custom Depth while I have a translucent material applied. This does work with any opaque material.
Nasty workaround is to create a blueprint with second copy of mesh (gets works when animation gets involved) that is only drawn into custom depth and not main pass and has a simple opaque material applied.
There is a property called “Allow Custom Depth Writes” within “Translucency”. Set it to true and it will compile additional shaders to enable custom depth.
It has not been mentioned before, but I want to point out that you need to set the “Opacity Mask Clip Value” of the Material properties to something you can work with. For example. Currently in UE4 4.20, this value is set to 0.33. If you use the technique above with a translucent material set to 0.32 in opacity, the post processing material will not show.
In my case, i need to show only the outline of a completely transparent material, so I had to set this value to 0.0.
Since this thread coming up in Google… As of engine version 5.03 looks like messing with the “Opacity Clip Mask Value” is no longer needed. The field is read-only unless using a Masked material.
If you: (1) have “Translucency >> Enable Custom Depth Writes == true” and (2) a value greater than .333 going into your Opacity, then the object will work with depth buffer highlighting.
something close to this topic is when translucent mat is shown, scene depth is wrong from the texture sampler. “Allow Custom Depth Writes” dosent help this.
Any idea about how to get the right scene depth while tranparent object is on?