三国卡牌客户端基础资源仓库
hch
21 小时以前 cdac25a8e4f91a4663bf5f80994538dd263b757c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef SKELETON_LIT_COMMON_SHADOW_INCLUDED
#define SKELETON_LIT_COMMON_SHADOW_INCLUDED
 
#include "UnityCG.cginc"
struct v2f { 
    V2F_SHADOW_CASTER;
    float4 uvAndAlpha : TEXCOORD1;
};
 
uniform float4 _MainTex_ST;
 
v2f vertShadow(appdata_base v, float4 vertexColor : COLOR) {
    v2f o;
    TRANSFER_SHADOW_CASTER(o)
    o.uvAndAlpha.xy = TRANSFORM_TEX(v.texcoord, _MainTex);
    o.uvAndAlpha.z = 0;
    o.uvAndAlpha.a = vertexColor.a;
    return o;
}
 
uniform sampler2D _MainTex;
uniform fixed SHADOW_CUTOFF;
 
float4 fragShadow (v2f i) : SV_Target {
    fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy);
    clip(texcol.a * i.uvAndAlpha.a - SHADOW_CUTOFF);
    SHADOW_CASTER_FRAGMENT(i)
}
 
#endif