47 lines
No EOL
1.1 KiB
Text
47 lines
No EOL
1.1 KiB
Text
Shader "_Custom/SilhouetteShader" {
|
|
Properties {
|
|
_MainTex ("Texture", 2D) = "white" {}
|
|
_Color ("Color", Vector) = (1,1,1,1)
|
|
}
|
|
SubShader {
|
|
LOD 100
|
|
Tags { "IGNOREPROJECTOR" = "true" "QUEUE" = "Transparent" "RenderType" = "Transparent" }
|
|
Pass {
|
|
LOD 100
|
|
Tags { "IGNOREPROJECTOR" = "true" "QUEUE" = "Transparent" "RenderType" = "Transparent" }
|
|
Blend SrcAlpha OneMinusSrcAlpha, SrcAlpha OneMinusSrcAlpha
|
|
ZWrite Off
|
|
Cull 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
|
|
{
|
|
fixed4 var;
|
|
var.w = min(tex2D(_MainTex, i.texcoord).w, _Color.w);
|
|
var.xyz = _Color.xyz;
|
|
return var;
|
|
}
|
|
ENDCG
|
|
}
|
|
}
|
|
} |