[Bug] Custom Depth/Stencil doesn't work consistently when enabled from Blueprint
Summary: static meshes that should render to the CustomDepth and CustomStencil buffers fail to do so when they are occluded by other meshes. This ONLY occurs when said functionality is enabled from script rather than on the Static Mesh Component itself.
Apologies if this was already submitted but I couldn't find anything. I ran into this when upgrading my game from 4.15 -> 4.17.
Here's a fresh sample project (link) with a 100% repro (20/20 attempts).
My game has a lot of meshes that are visualized through walls using the CustomStencil feature after certain scripted conditions are met, but unfortunately this bug totally breaks that functionality. It seems like I can work around it by turning on custom depth on all my meshes, turning it off in script, and then turning it back on again when I need it enabled, but that's a pretty awkward workaround for the dozens of blueprints I need to do it for. Help would be appreciated, thanks!
asked Sep 04 '17 at 10:17 PM in Bug Reports
Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here
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.
answered Sep 21 '17 at 03:18 PM
Thomas G ♦♦ STAFF
I found workaround for this bug:
In c++ create function and call MarkRenderStateDirty() on your mesh component (after SetRenderCustomDepth()).
I found out that in 4.15 MarkRenderStateDirty was called everytime in SetRenderCustomDepth(), but why epic changed that?
answered Nov 22 '17 at 01:38 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here