4.20.2 Stencils & CustomDepth not working
I think i have found out the problem in Engine Version 4.20.2. While Enabling RenderCustomDepth in the Editor enables the flag "bRenderCustomDepth" in the primitive component, and it works just fine. Now if we use these functions
The functions call a game thread function and enqueues Render thread function to set the variable "bRenderCustomDepth" in Render thread (IDK why). The functions used for this are
This for some reason does not work. But if i set the bRenderCustomDepth Directly as in previous engine version like this
This works and stencils now work properly. The only place this flag "bRenderCustomDepth" is used is in "SceneVisibility.cpp" in line 1831 and 1994. I am not sure if these places are in a function called by the render thread. Would like to know from a UE4 staff about this. But for now setting it from the game thread works fine without crashes in the editor. (Will check built version later).
Follow this question
Once you sign in you will be able to subscribe for any updates here