You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
952 B
Plaintext
39 lines
952 B
Plaintext
Shader "Custom/ShadowSprite"
|
|
{
|
|
Properties {
|
|
_Color ("Color", Color) = (1,1,1,1)
|
|
[PerRendererData]_MainTex ("Sprite Texture", 2D) = "white" {}
|
|
_Cutoff("Shadow alpha cutoff", Range(0,1)) = 0.5
|
|
}
|
|
SubShader {
|
|
Tags
|
|
{
|
|
"Queue"="Geometry"
|
|
"RenderType"="TransparentCutout"
|
|
}
|
|
LOD 200
|
|
Cull Off
|
|
|
|
CGPROGRAM
|
|
#pragma surface surf Lambert addshadow fullforwardshadows
|
|
#pragma target 3.0
|
|
|
|
sampler2D _MainTex;
|
|
fixed4 _Color;
|
|
fixed _Cutoff;
|
|
|
|
struct Input
|
|
{
|
|
float2 uv_MainTex;
|
|
};
|
|
|
|
void surf (Input IN, inout SurfaceOutput o) {
|
|
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
|
|
o.Albedo = c.rgb;
|
|
o.Alpha = c.a;
|
|
clip(o.Alpha - _Cutoff);
|
|
}
|
|
ENDCG
|
|
}
|
|
FallBack "Diffuse"
|
|
} |