Hi, I’m facing an issue, where I need to read from the depth texture in custom Image effect (with custom Renderer Feature for Blit), but only default Lit opaque material which is renderer with the default Forward Renderer (and not with the Renderer Features) seems to be writing into the depth texture. I even tried to use the custom shader below with no success. Has anyone worked this out? Thanks, Adam
Shader "MaskDepth" {
Properties { }
SubShader
{
Tags {"RenderType" = "TransparentCutout" "IgnoreProjector" = "True" "Queue" = "Transparent" "RenderPipeline" = "UniversalPipeline"}
Pass
{
Name "DepthOnly"
Tags{"LightMode" = "DepthOnly"}
ZWrite On
ColorMask 0
HLSLPROGRAM
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d11_9x
#pragma target 2.0
#pragma vertex DepthOnlyVertex
#pragma fragment DepthOnlyFragment
#include "Packages/com.unity.render-pipelines.universal/Shaders/UnlitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/DepthOnlyPass.hlsl"
ENDHLSL
}
}
FallBack "Hidden/InternalErrorShader"
}
Edit: I’m using Unity 2019.3.0b4 with URP 7.1.2
Edit 2: “RenderType” = “Opaque” in the custom shader solved my issue