Limitation
AlphaTest pragma in Surface Shaders
In projects using the Built-in Render Pipeline, rendering objects with surface shaders which use alphatest pragma may cause Render nodes to output the alpha of those objects incorrectly, which will then be propagated to the subsequent nodes in the Compositor Graph.
One example of such shaders is the leaf shader used by Tree Editor in Unity.
To work around this issue, at the moment, we have to change the shader file by replacing
alphatest
with clip
.
Please refer to the following code snippet:
float _Cutoff;
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
o.Albedo = c.rgb;
o.Alpha = c.a;
clip(o.Alpha - _Cutoff);
}