URP DepthPrepass exploration&Shader does not display problem analysis
Causes of the above problems
-
yes RenderFeature need Depth Texture / Normal Texture -
Camera selected DepthTexture (Forced opening or Pipeline Asset check DepthTexture) DepthPrimingMode && Forward Rendering && RenderType Base && CameraType != Reflection
-
Not open Depth Priming Mode : -
If there is no special statement, use ZTest LessEqual Elimination of slice elements by means of -
Not used Depth Texture
-
-
open Depth Priming Mode : -
Default Use ZTest Equal , combined Depth Texture To eliminate slice elements -
Optimization of Overdraw for opaque queues
-
Specified Pass and calling time
-
DepthOnlyPass: DepthOnly -
DepthNormalOnlyPass: DepthNormals / DepthNormalsOnly
if(requiresDepthPrepass) { if(renderPassInputs.requiresNormalsTexture) { if(this.actualRenderingMode == RenderingMode. Deferred) { //Other contents are omitted m_DepthNormalPrepass.Setup(xxx); }else { m_DepthNormalPrepass.Setup(xxx); } EnqueuePass(m_DepthNormalPrepass); }else { if(this.actualRenderingMode != RenderingMode.Deferred) { m_DepthPrepass.Setup(xxx); EnqueuePass(m_DepthPrepass); } } }
What's the usage?
Solution to initial problems
It doesn't matter
A safe approach