-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathripple.shader
75 lines (37 loc) · 1.04 KB
/
ripple.shader
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 "Unite-2019/Ripple"{
Properties{
_MainTex("Texture",2D)="white"{}
_Scale("Scale",float)=1
_Frequency("Frequency",float)=1
_Speed("Speed",float)=1
}
SubShader{
Tags { "RenderType"="Opaque"}
LOD 100
CGPROGRAM
#pragma surface surf Lambert vertex:vert
sampler2D _MainTex;
float4 _Scale;
float _Speed;
float _Frequency;
//struct
struct Input {
float2 uv_MainTex;
//float3 customValue;
};
void vert(inout appdata_full v)
{
half offset= v.vertex.x + v.vertex.z;
half val = _Scale* sin(_Time.w * _Speed + offset*_Frequency);
v.vertex.y+=val;
}
//function
void surf (Input IN, inout SurfaceOutput o) {
half4 color = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo=color.rgb;
o.Alpha=color.a;
}
ENDCG
}
Fallback "Diffuse"
}