lcy
2025-01-02 c867ea92cce28ea0ceb312ef8e2f8e7e0888b1d6
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
Shader "Effect/Alpha Twinkle"
{
    Properties
    {
        //_MainTex("MainTexture", 2D) = "white" {}
        _Color("Color",Color) = (1,1,1,1)
        _Speed("Speed",Float) = 100
    }
 
        Subshader
    {
        LOD 100
 
        Tags{
        "Queue" = "Transparent"
        "RenderType" = "Transparent"
        "IgnoreProjector" = "True"
        "LightMode" = "Always"
        "ForceNoShadowCasting" = "True"
    }
 
        Pass
    {
        ZWrite Off
        Blend SrcAlpha One
        Cull Back
        Lighting Off
        Fog{ Mode Off }
 
        CGPROGRAM
    #pragma target 3.0
    #pragma vertex vert
    #pragma fragment frag
 
    #pragma multi_compile QUALITY_LOW QUALITY_MED QUALITY_HGH
    #pragma fragmentoption ARB_precision_hint_fastest
    #pragma exclude_renderers flash 
 
    #include "UnityCG.cginc"
 
        struct VertInput
    {
        float4 vertex : POSITION;
        float4 color:COLOR;
    };
 
    struct vertShader
    {
        float4 pos : SV_POSITION;
        float2 uv:TEXCOORD0;
        float4 color : COLOR;
    };
 
    // properties
    uniform sampler2D _MainTex;
    uniform float4 _Color;
    float _Speed;
 
    vertShader vert(VertInput v)
    {
        vertShader o;
        o.pos = UnityObjectToClipPos(v.vertex);
        o.color = _Color*v.color;
 
        return o;
    }
 
    fixed4 frag(vertShader i) : SV_Target{
        fixed3 outcolor = i.color.rgb;
        fixed a = sin(_Time.x*_Speed)*0.5+0.5;
        return fixed4(outcolor,a);
    }
 
        ENDCG
    }
    }
        //FallBack "Diffuse"
}