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
 
Shader "Environment/Tree wind  Cull Off" {
    Properties{
        _BaseTex("BaseTex", 2D) = "white" {}
    _BodywindPower("Body windPower", Float) = 0.5
        _BodyWindAmpli("Body Wind Ampli", Float) = 1
        _SecondSpeed("SecondSpeed", Float) = 0.2
    }
 
        SubShader{
        Tags{
        "Queue" = "AlphaTest"
        "RenderType" = "TransparentCutout"
    }
        Pass{
        Name "FORWARD"
        Tags{
        "LightMode" = "ForwardBase"
    }
 
        Cull Off
 
        CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#define UNITY_PASS_FORWARDBASE
#include "UnityCG.cginc"
#pragma multi_compile_fwdbase_fullshadows
#pragma target 3.0
#pragma multi_compile_fog
 
    uniform float _BodywindPower;
    uniform float _BodyWindAmpli;
    uniform sampler2D _BaseTex;
    uniform float _SecondSpeed;
 
    struct VertexInput {
        float4 vertex : POSITION;
        float2 texcoord0 : TEXCOORD0;
        float4 color : COLOR;
    };
 
    struct VertexOutput {
        float4 pos : SV_POSITION;
        float2 uv0 : TEXCOORD0;
        float4 color : COLOR;
        UNITY_FOG_COORDS(n)
    };
 
    VertexOutput vert(VertexInput v) {
        VertexOutput o = (VertexOutput)0;
        o.uv0 = v.texcoord0;
        o.color = v.color;
 
        float windPower = _Time.y*_BodywindPower;
        float windSpeed = sin(((3.141592654*o.color.a) + (_SecondSpeed*_Time.y)));
        v.vertex.xyz += float3((sin(windPower)*_BodyWindAmpli*o.color.a*windSpeed*2.0),0.0,(cos(windPower)*(_BodyWindAmpli*0.5)*o.color.a*windSpeed));
 
        o.pos = UnityObjectToClipPos(v.vertex);
        UNITY_TRANSFER_FOG(o, o.pos);
        return o;
    }
 
    float4 frag(VertexOutput i) : COLOR{
        float4 color = tex2D(_BaseTex,i.uv0);
        clip(color.a - 0.5);
        UNITY_APPLY_FOG(i.fogCoord, color);
        return fixed4(color.rgb,1);
    }
 
        ENDCG
    }
    }
        FallBack "Diffuse"
}