-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmain.tres
317 lines (233 loc) · 10.3 KB
/
main.tres
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
[gd_resource type="VisualShader" load_steps=26 format=3 uid="uid://c7d7kiigmb7le"]
[sub_resource type="VisualShaderNodeColorParameter" id="VisualShaderNodeColorParameter_jw5th"]
parameter_name = "shallow_water"
default_value_enabled = true
default_value = Color(0, 1, 1, 1)
[sub_resource type="VisualShaderNodeMix" id="VisualShaderNodeMix_mhput"]
default_input_values = [0, Vector3(0, 0, 0), 1, Vector3(1, 1, 1), 2, Vector3(0.5, 0.5, 0.5)]
op_type = 3
[sub_resource type="VisualShaderNodeExpression" id="VisualShaderNodeExpression_go6ns"]
size = Vector2(501.944, 279.904)
expression = "vec3 duv = vec3(4.0 / 514.0, 4.0 / 514.0, 0);
float v1 = texture(sim, UV - duv.xz).y;
float v2 = texture(sim, UV + duv.xz).y;
float v3 = texture(sim, UV - duv.zy).y;
float v4 = texture(sim, UV + duv.zy).y;
normal = normalize(vec3(v1 - v2, v3 - v4, 0.3));"
[sub_resource type="VisualShaderNodeFloatParameter" id="VisualShaderNodeFloatParameter_vgm6i"]
parameter_name = "refraction_strength"
default_value_enabled = true
default_value = 0.1
[sub_resource type="VisualShaderNodeVectorOp" id="VisualShaderNodeVectorOp_gtxtt"]
operator = 2
[sub_resource type="VisualShaderNodeVectorOp" id="VisualShaderNodeVectorOp_3rlhy"]
[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_6hhsi"]
input_name = "screen_uv"
[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_2eja0"]
source = 1
[sub_resource type="VisualShaderNodeMix" id="VisualShaderNodeMix_4ytv7"]
default_input_values = [0, Vector3(0, 0, 0), 1, Vector3(1, 1, 1), 2, Vector3(0.5, 0.5, 0.5)]
op_type = 3
[sub_resource type="VisualShaderNodeFloatConstant" id="VisualShaderNodeFloatConstant_cfocs"]
constant = 0.8
[sub_resource type="VisualShaderNodeTexture2DParameter" id="VisualShaderNodeTexture2DParameter_75g8n"]
parameter_name = "simulation"
[sub_resource type="VisualShaderNodeLinearSceneDepth" id="VisualShaderNodeLinearSceneDepth_27hr3"]
[sub_resource type="VisualShaderNodeExpression" id="VisualShaderNodeExpression_bxgl8"]
size = Vector2(512.6, 290.56)
expression = "float d = linear_depth;
d = d + VERTEX.z;
depth = exp(-d * murkiness);"
[sub_resource type="VisualShaderNodeFloatParameter" id="VisualShaderNodeFloatParameter_sltt4"]
parameter_name = "murkiness"
default_value_enabled = true
default_value = 0.3
[sub_resource type="VisualShaderNodeFloatFunc" id="VisualShaderNodeFloatFunc_j7mde"]
function = 31
[sub_resource type="VisualShaderNodeColorParameter" id="VisualShaderNodeColorParameter_gdx0b"]
parameter_name = "deep_water"
default_value_enabled = true
default_value = Color(0, 0, 1, 1)
[sub_resource type="VisualShaderNodeVectorOp" id="VisualShaderNodeVectorOp_h5i5w"]
[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_olx2s"]
input_name = "uv"
[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_8m7pd"]
expanded_output_ports = [0]
source = 5
[sub_resource type="VisualShaderNodeTexture2DParameter" id="VisualShaderNodeTexture2DParameter_ftg52"]
parameter_name = "simulation2"
[sub_resource type="VisualShaderNodeFloatOp" id="VisualShaderNodeFloatOp_i3a4y"]
operator = 2
[sub_resource type="VisualShaderNodeFloatParameter" id="VisualShaderNodeFloatParameter_obi6f"]
parameter_name = "amplitude"
default_value_enabled = true
default_value = 0.5
[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_x27ti"]
input_name = "normal"
[sub_resource type="VisualShaderNodeVectorOp" id="VisualShaderNodeVectorOp_f3fno"]
operator = 2
[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_pmb68"]
input_name = "vertex"
[resource]
code = "shader_type spatial;
render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_lambert, specular_schlick_ggx;
uniform sampler2D simulation2;
uniform float amplitude = 0.5;
uniform float refraction_strength = 0.10000000149012;
uniform sampler2D simulation;
uniform sampler2D screen_tex_frg_17 : hint_screen_texture;
uniform vec4 deep_water : source_color = vec4(0.000000, 0.000000, 1.000000, 1.000000);
uniform vec4 shallow_water : source_color = vec4(0.000000, 1.000000, 1.000000, 1.000000);
uniform float murkiness = 0.30000001192093;
uniform sampler2D depth_tex_frg_21 : hint_depth_texture;
void vertex() {
// Input:9
vec3 n_out9p0 = VERTEX;
// Input:7
vec3 n_out7p0 = NORMAL;
// Input:2
vec2 n_out2p0 = UV;
vec4 n_out3p0;
// Texture2D:3
n_out3p0 = texture(simulation2, n_out2p0);
float n_out3p1 = n_out3p0.r;
// FloatParameter:6
float n_out6p0 = amplitude;
// FloatOp:5
float n_out5p0 = n_out3p1 * n_out6p0;
// VectorOp:8
vec3 n_out8p0 = n_out7p0 * vec3(n_out5p0);
// VectorOp:10
vec3 n_out10p0 = n_out9p0 + n_out8p0;
// Output:0
VERTEX = n_out10p0;
}
void fragment() {
// FloatParameter:13
float n_out13p0 = refraction_strength;
vec3 n_out12p0;
// Expression:12
n_out12p0 = vec3(0.0, 0.0, 0.0);
{
vec3 duv = vec3(4.0 / 514.0, 4.0 / 514.0, 0);
float v1 = texture(simulation, UV - duv.xz).y;
float v2 = texture(simulation, UV + duv.xz).y;
float v3 = texture(simulation, UV - duv.zy).y;
float v4 = texture(simulation, UV + duv.zy).y;
n_out12p0 = normalize(vec3(v1 - v2, v3 - v4, 0.3));
}
// VectorOp:14
vec3 n_out14p0 = vec3(n_out13p0) * n_out12p0;
// Input:16
vec2 n_out16p0 = SCREEN_UV;
// VectorOp:15
vec3 n_out15p0 = n_out14p0 + vec3(n_out16p0, 0.0);
vec4 n_out17p0;
// Texture2D:17
n_out17p0 = texture(screen_tex_frg_17, vec2(n_out15p0.xy));
// ColorParameter:9
vec4 n_out9p0 = deep_water;
// ColorParameter:10
vec4 n_out10p0 = shallow_water;
// FloatParameter:7
float n_out7p0 = murkiness;
float n_out21p0;
// LinearSceneDepth:21
{
float __log_depth = textureLod(depth_tex_frg_21, SCREEN_UV, 0.0).x;
vec4 __depth_view = INV_PROJECTION_MATRIX * vec4(SCREEN_UV * 2.0 - 1.0, __log_depth, 1.0);
__depth_view.xyz /= __depth_view.w;
n_out21p0 = -__depth_view.z;
}
float n_out6p0;
// Expression:6
n_out6p0 = 0.0;
{
float d = n_out21p0;
d = d + VERTEX.z;
n_out6p0 = exp(-d * n_out7p0);
}
// Mix:11
vec3 n_out11p0 = mix(vec3(n_out9p0.xyz), vec3(n_out10p0.xyz), vec3(n_out6p0));
// FloatConstant:19
float n_out19p0 = 0.800000;
// Mix:18
vec3 n_out18p0 = mix(vec3(n_out17p0.xyz), n_out11p0, vec3(n_out19p0));
// FloatFunc:8
float n_out8p0 = 1.0 - n_out6p0;
// Output:0
ALBEDO = n_out18p0;
ALPHA = n_out8p0;
NORMAL = n_out12p0;
}
"
graph_offset = Vector2(-1091.11, -508.067)
nodes/vertex/0/position = Vector2(660, 40)
nodes/vertex/2/node = SubResource("VisualShaderNodeInput_olx2s")
nodes/vertex/2/position = Vector2(-820, 100)
nodes/vertex/3/node = SubResource("VisualShaderNodeTexture_8m7pd")
nodes/vertex/3/position = Vector2(-380, 120)
nodes/vertex/4/node = SubResource("VisualShaderNodeTexture2DParameter_ftg52")
nodes/vertex/4/position = Vector2(-820, 220)
nodes/vertex/5/node = SubResource("VisualShaderNodeFloatOp_i3a4y")
nodes/vertex/5/position = Vector2(0, 280)
nodes/vertex/6/node = SubResource("VisualShaderNodeFloatParameter_obi6f")
nodes/vertex/6/position = Vector2(-400, 380)
nodes/vertex/7/node = SubResource("VisualShaderNodeInput_x27ti")
nodes/vertex/7/position = Vector2(-140, 140)
nodes/vertex/8/node = SubResource("VisualShaderNodeVectorOp_f3fno")
nodes/vertex/8/position = Vector2(200, 140)
nodes/vertex/9/node = SubResource("VisualShaderNodeInput_pmb68")
nodes/vertex/9/position = Vector2(60, 0)
nodes/vertex/10/node = SubResource("VisualShaderNodeVectorOp_h5i5w")
nodes/vertex/10/position = Vector2(380, 40)
nodes/vertex/connections = PackedInt32Array(2, 0, 3, 0, 4, 0, 3, 2, 3, 1, 5, 0, 6, 0, 5, 1, 7, 0, 8, 0, 5, 0, 8, 1, 9, 0, 10, 0, 8, 0, 10, 1, 10, 0, 0, 0)
nodes/fragment/0/position = Vector2(960, -40)
nodes/fragment/6/node = SubResource("VisualShaderNodeExpression_bxgl8")
nodes/fragment/6/position = Vector2(-440, 400)
nodes/fragment/6/size = Vector2(512.6, 290.56)
nodes/fragment/6/input_ports = "0,0,murkiness;1,0,linear_depth;"
nodes/fragment/6/output_ports = "0,0,depth;"
nodes/fragment/6/expression = "float d = linear_depth;
d = d + VERTEX.z;
depth = exp(-d * murkiness);"
nodes/fragment/7/node = SubResource("VisualShaderNodeFloatParameter_sltt4")
nodes/fragment/7/position = Vector2(-720, 360)
nodes/fragment/8/node = SubResource("VisualShaderNodeFloatFunc_j7mde")
nodes/fragment/8/position = Vector2(140, 440)
nodes/fragment/9/node = SubResource("VisualShaderNodeColorParameter_gdx0b")
nodes/fragment/9/position = Vector2(-500, -80)
nodes/fragment/10/node = SubResource("VisualShaderNodeColorParameter_jw5th")
nodes/fragment/10/position = Vector2(-500, 120)
nodes/fragment/11/node = SubResource("VisualShaderNodeMix_mhput")
nodes/fragment/11/position = Vector2(2.72259, 77.1215)
nodes/fragment/12/node = SubResource("VisualShaderNodeExpression_go6ns")
nodes/fragment/12/position = Vector2(-380, -460)
nodes/fragment/12/size = Vector2(501.944, 279.904)
nodes/fragment/12/input_ports = "0,8,sim;"
nodes/fragment/12/output_ports = "0,4,normal;"
nodes/fragment/12/expression = "vec3 duv = vec3(4.0 / 514.0, 4.0 / 514.0, 0);
float v1 = texture(sim, UV - duv.xz).y;
float v2 = texture(sim, UV + duv.xz).y;
float v3 = texture(sim, UV - duv.zy).y;
float v4 = texture(sim, UV + duv.zy).y;
normal = normalize(vec3(v1 - v2, v3 - v4, 0.3));"
nodes/fragment/13/node = SubResource("VisualShaderNodeFloatParameter_vgm6i")
nodes/fragment/13/position = Vector2(-100, -740)
nodes/fragment/14/node = SubResource("VisualShaderNodeVectorOp_gtxtt")
nodes/fragment/14/position = Vector2(283.757, -573.388)
nodes/fragment/15/node = SubResource("VisualShaderNodeVectorOp_3rlhy")
nodes/fragment/15/position = Vector2(540, -560)
nodes/fragment/16/node = SubResource("VisualShaderNodeInput_6hhsi")
nodes/fragment/16/position = Vector2(220, -380)
nodes/fragment/17/node = SubResource("VisualShaderNodeTexture_2eja0")
nodes/fragment/17/position = Vector2(720, -440)
nodes/fragment/18/node = SubResource("VisualShaderNodeMix_4ytv7")
nodes/fragment/18/position = Vector2(720, -200)
nodes/fragment/19/node = SubResource("VisualShaderNodeFloatConstant_cfocs")
nodes/fragment/19/position = Vector2(520, -220)
nodes/fragment/20/node = SubResource("VisualShaderNodeTexture2DParameter_75g8n")
nodes/fragment/20/position = Vector2(-780, -440)
nodes/fragment/21/node = SubResource("VisualShaderNodeLinearSceneDepth_27hr3")
nodes/fragment/21/position = Vector2(-640, 580)
nodes/fragment/connections = PackedInt32Array(7, 0, 6, 0, 6, 0, 8, 0, 9, 0, 11, 0, 10, 0, 11, 1, 12, 0, 0, 8, 13, 0, 14, 0, 12, 0, 14, 1, 14, 0, 15, 0, 16, 0, 15, 1, 15, 0, 17, 0, 17, 0, 18, 0, 11, 0, 18, 1, 19, 0, 18, 2, 20, 0, 12, 0, 21, 0, 6, 1, 6, 0, 11, 2, 18, 0, 0, 0, 8, 0, 0, 1)