Files
JJBB/Assets/Project/Shader/TargetSelect.shader

77 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2024-08-23 15:49:34 +08:00
Shader "Zhanyou/TargetSelect"
{
Properties
{
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_Color("Color", color) = (1, 1, 1, 1)
}
SubShader {
Tags {"Queue"="AlphaTest+53" "IgnoreProjector"="True" "RenderType"="Transparent"}
ZWrite Off
ZTest Off
Blend SrcAlpha OneMinusSrcAlpha
CGINCLUDE
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#pragma multi_compile_fog
#include "UnityCG.cginc"
struct appdata_t {
float4 vertex : POSITION;
float2 texcoord : TEXCOORD0;
};
struct v2f {
float4 vertex : SV_POSITION;
half2 texcoord : TEXCOORD0;
};
sampler2D _MainTex;
float4 _MainTex_ST;
fixed4 _Color;
v2f vert (appdata_t v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
fixed4 col = _Color;
col.a = tex2D(_MainTex, i.texcoord).a;
return col;
}
ENDCG
//Pass
//{
// Stencil {
// Ref 1
// Comp GEqual
// }
//
// CGPROGRAM
// ENDCG
//}
Pass
{
//Stencil {
// Ref 1
// Comp NotEqual
//}
ZTest Always
CGPROGRAM
ENDCG
}
}
}