1.Create widget component to custom blueprint.
2.Set widget component property “Render CustomDepth Pass” enable, add set stencil value 1.
3.Set “Project Settings-> Rendering-> Postprocssing->Custom Depth-Stencil Pass” “Enable with Stencil”
4.Add post process volume. Add custom material to blendables.
5.Render CustomDepth be ignored.
Thank you for submitting this post. I have reproduced this issue and logged a report for it here: Unreal Engine Issues and Bug Tracker (UE-44237)
You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.
I would like to add that this appears only for translucent widget material.
That’s because by default, translucent shaders don’t write to the CustomDepth pass.
To get widgets to render in CustomDepth with stencil, open up the “Widget3DPassThrough” master material and enable “Allow Custom Depth Writes.”