45 lines
1,020 B
Text
45 lines
1,020 B
Text
|
Shader "Depth Mask/Unlit Transparent (CG)" {
|
||
|
Properties {
|
||
|
_Color ("Main Color (A=Opacity)", Vector) = (1,1,1,1)
|
||
|
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
|
||
|
}
|
||
|
SubShader {
|
||
|
Tags { "IGNOREPROJECTOR" = "true" "QUEUE" = "Transparent+2" }
|
||
|
Pass {
|
||
|
Tags { "IGNOREPROJECTOR" = "true" "QUEUE" = "Transparent+2" }
|
||
|
Blend DstColor Zero, DstColor Zero
|
||
|
ZTest Less
|
||
|
Fog {
|
||
|
Mode Off
|
||
|
}
|
||
|
CGPROGRAM
|
||
|
#pragma vertex vert
|
||
|
#pragma fragment frag
|
||
|
#include "UnityCG.cginc"
|
||
|
struct appdata {
|
||
|
float4 vertex : POSITION;
|
||
|
float2 texcoord : TEXCOORD0;
|
||
|
};
|
||
|
struct v2f {
|
||
|
float4 vertex : SV_POSITION;
|
||
|
float2 texcoord : TEXCOORD0;
|
||
|
};
|
||
|
float4 _MainTex_ST;
|
||
|
v2f vert(appdata v)
|
||
|
{
|
||
|
v2f o;
|
||
|
o.vertex = UnityObjectToClipPos(v.vertex);
|
||
|
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||
|
return o;
|
||
|
}
|
||
|
sampler2D _MainTex;
|
||
|
fixed4 _Color;
|
||
|
fixed4 frag(v2f i) : SV_Target
|
||
|
{
|
||
|
return tex2D(_MainTex, i.texcoord) * _Color;
|
||
|
}
|
||
|
ENDCG
|
||
|
}
|
||
|
}
|
||
|
Fallback "Diffuse"
|
||
|
}
|