-
Notifications
You must be signed in to change notification settings - Fork 1
/
Changer.tscn
53 lines (38 loc) · 1.24 KB
/
Changer.tscn
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
[gd_scene load_steps=4 format=2]
[ext_resource path="res://Changer.gd" type="Script" id=1]
[sub_resource type="Shader" id=2]
code = "shader_type canvas_item;
uniform vec4 in_color:hint_color;
uniform vec4 out_color:hint_color;
uniform float in_out:hint_range(0.,1.)=0.;
uniform float position:hint_range(-1.5,1.) = 0.856;
uniform vec2 size = vec2(16., 16.);
void fragment(){
vec2 a = (1./SCREEN_PIXEL_SIZE) / size;
vec2 uv=UV;
uv *= a;
vec2 i_uv = floor(uv);
vec2 f_uv = fract(uv);
float wave = max(0.,i_uv.x/(a.x) - position);
vec2 center = f_uv*2.-1.;
float circle = length(center);
circle = 1. - step(wave,circle);
vec4 color = mix(in_color, out_color, step(0.5, in_out));
COLOR=vec4(circle) * color;
}"
[sub_resource type="ShaderMaterial" id=1]
shader = SubResource( 2 )
shader_param/in_color = Color( 1, 0.882353, 0, 1 )
shader_param/out_color = Color( 0.988235, 0.317647, 0.317647, 1 )
shader_param/in_out = 0.984
shader_param/position = 1.0
shader_param/size = Vector2( 30, 30 )
[node name="Changer" type="ColorRect"]
material = SubResource( 1 )
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Tween" type="Tween" parent="."]