Files
JJBB/Assets/Project/Shader/PlayerZClip.shader
2024-08-23 15:49:34 +08:00

57 lines
916 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 特殊的PlayerZ会根据Alpha数值进行AlphaClip
// 用于动画控制Alpha的情况
Shader "Zhanyou/Character/PlayerZClip"
{
Properties
{
_Clip("Clip Alpha", float) = 0.05
_Color("Clip Color", Color) = (0, 0, 0, 1)
}
Category
{
Tags { "Queue"="AlphaTest+51" "IgnoreProjector"="True" }
Blend Zero Zero
Cull Back
Lighting Off
ColorMask 0
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata_t
{
float4 vertex : POSITION;
};
struct v2f
{
float4 vertex : SV_POSITION;
};
uniform float _Clip;
uniform half4 _Color;
v2f vert (appdata_t v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
clip(_Color.a - _Clip);
return 0;
}
ENDCG
}
}
}
}