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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
[gd_scene load_steps=7 format=2]
[ext_resource path="res://sample.png" type="Texture" id=1]
[ext_resource path="res://white.png" type="Texture" id=2]
[sub_resource type="Shader" id=1]
code = "shader_type canvas_item;
uniform float BarrelPower =1.1;
vec2 distort(vec2 p)
{
float angle = p.y / p.x;
float theta = atan(p.y,p.x);
float radius = pow(length(p), BarrelPower);
p.x = radius * cos(theta);
p.y = radius * sin(theta);
return 0.5 * (p + vec2(1.0,1.0));
}
void fragment()
{
vec2 xy = SCREEN_UV * 2.0;
xy.x -= 1.0;
xy.y -= 1.0;
float d = length(xy);
if(d < 1.5){
xy = distort(xy);
}
else{
xy = SCREEN_UV;
}
COLOR = texture(SCREEN_TEXTURE,xy);
}
"
[sub_resource type="ShaderMaterial" id=2]
render_priority = 0
shader = SubResource( 1 )
shader_param/BarrelPower = 1.1
_sections_unfolded = [ "shader_param" ]
[sub_resource type="Shader" id=3]
code = "shader_type canvas_item;
uniform float color_bleeding = 0.9;
uniform float bleeding_range = 2;
uniform float screen_width = 1024;
void fragment()
{
float pixel_size = 1.0/screen_width*bleeding_range;
vec4 color_left = texture(SCREEN_TEXTURE,SCREEN_UV - vec2(pixel_size, 0));
vec4 current_color = texture(SCREEN_TEXTURE,SCREEN_UV);
current_color = current_color*vec4(color_bleeding,0.5,0.25,1);
color_left = color_left*vec4(0.25,0.5,color_bleeding,1);
COLOR.rgba = (current_color + color_left);
}"
[sub_resource type="ShaderMaterial" id=4]
render_priority = 0
shader = SubResource( 3 )
shader_param/color_bleeding = null
shader_param/bleeding_range = null
shader_param/screen_width = null
[node name="Control" type="Control" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 40.0
margin_bottom = 40.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
_sections_unfolded = [ "Rect" ]
[node name="Sprite" type="Sprite" parent="." index="0"]
texture = ExtResource( 1 )
centered = false
_sections_unfolded = [ "Offset" ]
[node name="Shaders" type="Control" parent="." index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 40.0
margin_bottom = 40.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
[node name="Curvature" type="TextureRect" parent="Shaders" index="0"]
material = SubResource( 2 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 1024.0
margin_bottom = 600.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
texture = ExtResource( 2 )
expand = true
stretch_mode = 0
_sections_unfolded = [ "Material", "Mouse", "Rect" ]
[node name="ColorBleeding" type="TextureRect" parent="Shaders" index="1"]
material = SubResource( 4 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 1024.0
margin_bottom = 600.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
texture = ExtResource( 2 )
expand = true
stretch_mode = 0
_sections_unfolded = [ "Material", "Rect" ]
|