少年修仙传客户端代码仓库
client_Wu Xijin
2019-06-13 033958214c0b16d7e7b93cc821b018c295251867
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef SPRITE_SHADOWS_INCLUDED
#define SPRITE_SHADOWS_INCLUDED
 
#include "UnityCG.cginc"
 
////////////////////////////////////////
// Vertex structs
//
 
struct vertexInput
{
    float4 vertex : POSITION;
    float4 texcoord : TEXCOORD0;
};
 
struct vertexOutput
    V2F_SHADOW_CASTER;
    float4 texcoord : TEXCOORD1;
};
 
////////////////////////////////////////
// Vertex program
//
 
uniform sampler2D _MainTex;
uniform fixed4 _MainTex_ST;
 
vertexOutput vert(vertexInput v)
{
    vertexOutput o;
    TRANSFER_SHADOW_CASTER(o)
    o.texcoord = float4(TRANSFORM_TEX(v.texcoord, _MainTex), 0, 0);
    return o;
}
 
////////////////////////////////////////
// Fragment program
//
 
 
uniform fixed _ShadowAlphaCutoff;
 
fixed4 frag(vertexOutput IN) : COLOR 
{
    fixed4 texureColor = tex2D(_MainTex, IN.texcoord.xy);
    clip(texureColor.a - _ShadowAlphaCutoff);
    
    SHADOW_CASTER_FRAGMENT(IN)
}
 
#endif // SPRITE_SHADOWS_INCLUDED