少年修仙传客户端代码仓库
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
 
//Shader written by Alex Dixon
Shader "Spine/Special/SkeletonGhost" 
{
    Properties 
    {
        _Color ("Main Color", Color) = (1,1,1,1)
        _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {}
        _TextureFade ("Texture Fade Out", Range(0,1)) = 0
    }
    SubShader 
    {
    
      Tags {"Queue"="Transparent" "IgnoreProjector"="False" "RenderType"="Transparent"}
      Fog { Mode Off }
      Blend One OneMinusSrcAlpha
      ZWrite Off
      Cull Off
      
        Pass 
        {
            Tags {"LightMode" = "Always"}                      // This Pass tag is important or Unity may not give it the correct light information.
                   CGPROGRAM
                #pragma vertex vert
                #pragma fragment frag
                //#pragma multi_compile_fwdbase                       // This line tells Unity to compile this pass for forward base.
                
                #include "UnityCG.cginc"
                //#include "AutoLight.cginc"
                    
                   struct vertex_input
                   {
                       float4 vertex : POSITION;
                       float2 texcoord : TEXCOORD0;
                    float4 color : COLOR;
                   };
                
                struct vertex_output
                {
                    float4  pos         : SV_POSITION;
                    float2  uv          : TEXCOORD0;
                    float4 color : COLOR;
                };
                
                sampler2D _MainTex;
                fixed4 _Color;
                fixed _TextureFade;
                
                vertex_output vert (vertex_input v)
                {
                    vertex_output o;
                    o.pos = UnityObjectToClipPos( v.vertex);
                    o.uv = v.texcoord.xy;
                    o.color = v.color;
                    
                                 
                    return o;
                }
                
                fixed4 frag(vertex_output i) : COLOR
                {
                    fixed4 tex = tex2D(_MainTex, i.uv);
 
                    tex = fixed4(max(_TextureFade, tex.r), max(_TextureFade, tex.g), max(_TextureFade, tex.b), tex.a);
 
                    return tex * ((i.color * _Color) * tex.a);
 
 
 
                    //float finalAlpha = tex.a * i.color.a * _Color.a;
 
                    /*
                    TODO:  Add basic lighting stuff in later?
 
                    fixed4 c;
                    c.rgb = (UNITY_LIGHTMODEL_AMBIENT.rgb * tex.rgb);       // Ambient term. Only do this in Forward Base. It only needs calculating once.
                    c.rgb += tex.rgb; // Diffuse and specular.
                    //Unity 4: c.rgb = (UNITY_LIGHTMODEL_AMBIENT.rgb * tex.rgb * 2);       // Ambient term. Only do this in Forward Base. It only needs calculating once.
                    //Unity 4: c.rgb += (tex.rgb * _LightColor0.rgb * diff) * (atten * 2); // Diffuse and specular.
                    c.a = tex.a;  // + _LightColor0.a * atten;
 
                    return c;
                    */
                }
            ENDCG
        }
             
        
    }
    //FallBack "Transparent/Cutout/VertexLit"    // Use VertexLit's shadow caster/receiver passes.
}