I’m a fresh man on rendering work with Unreal, and try to use custom depth on my mobile game in deferred shading mode.
This is the simple material i used. It will limit my postprocess on target character.
It worked fine on PC, but when i preview with openGL, it failed.
I try to get the reason and begin debug with source code, find the direct reason is drawcall of custom depth is null
Track this problem i finally find the problem is from those code
Looks like with mobile, Unreal did some extra check and it return false, the check will go to this place
Problem sees clear, i set r.customDepth=3 and the second part of this if statement will success and I get the result i want.
But the first part of the statement, View.bHasCustomDepthPrimitives, looks like it will never be true on MobileshadingRenderer, and I don’t think keeping the r.customDepth with ECustomDepthMode::EnabledWithStencil is a good solution of my problem.
View.bHasCustomDepthPrimitives look like be set in function FRelevancePacket::Finalize(), which is later then the usage in FRelevancePacket::ComputeRelevance.
Sorry about the long story, my final question is, why this property looks like never work on mobileshadingRenderer? Do I have to set r.customDepth when I use custom depth on android platform?



