unity3D 查看墙后面的对象 的 Shader

来源:互联网 发布:技校计算机专业软件 编辑:程序博客网 时间:2024/05/30 23:25

Shader "Pat/VisibleBehindObjects" {Properties {_MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {}}SubShader {     CGPROGRAM#pragma surface surf BlinnPhong alphasampler2D _MainTex;struct Input {float2 uv_MainTex;};void surf (Input IN, inout SurfaceOutput o){fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);}ENDCG}Category {    SubShader     {    Tags    {    "Queue"="Overlay"    "IgnoreProjector"="True"    "RenderType"="Transparent"    }       Pass        {            ZTest Greater                        AlphaTest Greater 0.5SetTexture [_MainTex]{ combine texture }        }        Pass         {            ZTest Less                        AlphaTest Greater 0.5SetTexture [_MainTex]{ combine texture }        }    }}Fallback "Transparent/VertexLit"}