Unity CG "shadow catcher"着色器在 iOS 中未显示



我在两个飞机上有这个着色器。它使它们透明,只显示他们收到的阴影。但是,在iOS上编译并运行它使阴影消失了,我无法弄清楚原因。有什么想法吗?

Shader "FX/Matte Shadow" {
Properties {
    _Color ("Main Color", Color) = (1,1,1,1)
    _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
    _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
}

SubShader {
    Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
    LOD 200
    Blend Zero SrcColor

CGPROGRAM
    #pragma surface surf ShadowOnly alphatest:_Cutoff

fixed4 _Color;
struct Input {
    float2 uv_MainTex;
};

inline fixed4 LightingShadowOnly (SurfaceOutput s, fixed3 lightDir, fixed atten)
{
    fixed4 c;

    c.rgb = s.Albedo*atten;
    c.a = s.Alpha;
    return c;
}

void surf (Input IN, inout SurfaceOutput o) {
    fixed4 c = _Color;
    o.Albedo = c.rgb;
    o.Alpha = 1;
}
ENDCG
}
Fallback "Transparent/Cutout/VertexLit"
}

此着色器的工作正常。我的问题是,在测试iOS设备上的AR-APP时,远距离的剪裁平面不会一直驶向墙壁。糟糕。

最新更新