三国卡牌客户端基础资源仓库
hch
2025-09-12 a0935e244cf12d62f33d4fadd04df716c60e7ae6
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
// - Unlit + no shadow
// - Premultiplied Alpha Blending (One OneMinusSrcAlpha)
// - Double-sided, no depth
 
Shader "Spine/Special/SkeletonGhost" {
    Properties {
        _Color ("Main Color", Color) = (1,1,1,1)
        [NoScaleOffset] _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {}
        _TextureFade ("Texture Fade Out", Range(0,1)) = 0
        [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0
        [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default
    }
    SubShader {
        Tags {
            "Queue"="Transparent"
            "IgnoreProjector"="False"
            "RenderType"="Transparent"
        }
        Fog { Mode Off }
        Blend One OneMinusSrcAlpha
        ZWrite Off
        Cull Off
 
        Stencil {
            Ref[_StencilRef]
            Comp[_StencilComp]
            Pass Keep
        }
 
        Pass {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #include "UnityCG.cginc"
            sampler2D _MainTex;
            fixed4 _Color;
            fixed _TextureFade;
 
            struct VertexInput {
                float4 vertex : POSITION;
                float2 uv : TEXCOORD0;
                float4 color : COLOR;
            };
 
            struct VertexOutput {
                float4  pos : SV_POSITION;
                float2  uv : TEXCOORD0;
                float4 color : COLOR;
            };
 
            VertexOutput vert (VertexInput v) {
                VertexOutput o;
                o.pos = UnityObjectToClipPos(v.vertex);
                o.uv = v.uv;
                o.color = v.color;
                return o;
            }
 
            fixed4 frag (VertexOutput i) : SV_Target {
                fixed4 tc = tex2D(_MainTex, i.uv);
                tc = fixed4(max(_TextureFade, tc.r), max(_TextureFade, tc.g), max(_TextureFade, tc.b), tc.a);
                return tc * ((i.color * _Color) * tc.a);
            }
            ENDCG
        }
    }
}