Agent Harness · VibeGit
Agent Harness Публичная копия обвязки агентной разработки: гейты, journeys, скиллы и шаблоны. Без ключей и личных данных.
agent-harness / tools / spells-assets / ue / spells / light / aurora-veil.js 388 строк · изменён 6 нояб., 03:45
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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
import * as THREE from 'three' ;
import { U , COMMON_GLSL , FX_VERT_HEAD , FX_FRAG_HEAD , FX_OUT_GLSL , FX_BLENDING } from '../../vfx/common.js' ;
import { instanced } from '../../vfx/Ribbons.js' ;
_a _b
sstep
fx
motes
sparkle
rain
body topC fringe poolCol
vBody vTop vFringe
cB cT cF
p
p cB p cT p cF
cB p cT p cF p
body cB topC cT fringe cF
vBody body body body vTop topC topC topC vFringe fringe fringe fringe
poolCol body fringe
cB
body
pos idx
j j j i i i pos i j
j j j i i i
a j i b a c2 a d2 c2
idx a b d2 a d2 c2
geo
geo pos
geo idx
a0 geo a1 geo a2 geo a3 geo
geo
mat
vBody vTop vFringe
mesh geo mat
mesh
mesh
fx mesh
k d k k k
d d d
d d d
d
h k
_a k d h y
_b k d h y
key key key
p d c
name
d
c c c p
c d fx c d c c
d c c
d d
d
d d d
d p
d d d d d
d fx d fx d
i i i
k d i i
k p k p k p k
k d d d p
k fx k k
i d
k fx
k k k k body k k k i
d fx
d d d topC d
d d d c
d fx
d
name
p
fx
fx
fx poolCol p
i i d i
k d i
d k k
sparkle _a sparkle _b sparkle
sparkle p k
d fx
d d d d d d p d d d d
name d
p d c p
d
foldT fringeT sigI sigR
c
k c c
k
d k
d
sigR k sigI k
motes d d motes k
motes k p dt
c
t c c
t
i i d i d i d i t i i
foldT t
fringeT t
d t
sigI t
t c c
i i d i d i
t
foldT fringeT t
d
d t
sigR t sigI t
d d dt d
d foldT d dt
d fringeT d dt
d dt p d
d dt p d
d d sigR d sigI d d
d live c
i i d i
k d i
k
slide d i k breath d i d k
d k k d
_a _b slide _b _a slide slide
k _a k _b
k k k p breath
d
d d p d p
d p
d dt
live d
d
i i d i
k d i
d k
_a _a _b _b
k c i
fx
live i i d i
k d i
d k k d
rain _a rain _b rain
rain p k k dt
live dm fx
r dm d dm d
r p dm dm dt
d d d
a0 a1 a2 a3 p
m
d
d d
i i d m i
k d i
k
o m
o k o o k o k
o d o d o k d o k
o k o p d o d i o d i
o d k p o k o d o p
m
mat p
geo m
mesh m
m a0 a1 a2 a3
const
MAX_CASTS
=
16
,
MAX_CURTAINS
=
4
,
MAX_INST
=
16
,
COLS
=
112
,
ROWS
=
9
;
const
V0
=
-
0.15
,
V1
=
1.2
;
const
CURTAIN_VERT
=
`
in vec4 aP0; // centre xyz, length m
in vec4 aP1; // axis xz, lower border y, height m
in vec4 aP2; // seed, fold amplitude m, fold clock, ray clock
in vec4 aP3; // energy, reveal 0..1, fringe, rays
out vec3 vW;
out vec3 vN;
out vec2 vUV;
out float vS;
out float vViewZ;
out vec4 vP2;
out vec4 vP3;
// three travelling waves along the sheet: a long S, a medium fold, small curls
float fold(float s, float tau, float ph, out float d) {
const float k0 = 0.17, k1 = 0.43, k2 = 1.05;
float x0 = k0 * s + tau * 0.31 + ph, x1 = k1 * s - tau * 0.83 + ph * 2.3, x2 = k2 * s + tau * 1.7 + ph * 4.1;
d = 1.6 * k0 * cos(x0) + 1.25 * k1 * cos(x1) + 0.45 * k2 * cos(x2);
return 1.6 * sin(x0) + 1.25 * sin(x1) + 0.45 * sin(x2);
}
void main() {
vUV = position.xy; vP2 = aP2; vP3 = aP3; vW = vec3(0.0); vN = vec3(0.0, 0.0, 1.0); vS = 0.0; vViewZ = 1.0;
if (aP3.x <= 0.0 || aP3.y <= 0.0) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
float u = position.x, v = position.y, L = aP0.w;
float s = (u - 0.5) * L;
vec3 ax = vec3(aP1.x, 0.0, aP1.y), pp = vec3(-aP1.y, 0.0, aP1.x);
// the top lags the bottom a little and swings wider
float A = aP2.y * (1.0 + 0.3 * v), df;
float f = fold(s, aP2.z - v * 0.8, aP2.x, df) * A;
df *= A;
// a gentle bow away from the caster at the ends
float b = 0.24 * L * (u - 0.5) * (u - 0.5), db = 0.48 * (u - 0.5);
vec3 w = aP0.xyz + ax * s + pp * (f + b);
// small curls ripple along the lower border
w.y = aP1.z + (0.22 * sin(s * 0.9 - aP2.z * 1.7 + aP2.x) + 0.1 * sin(s * 2.7 + aP2.z * 3.1)) * (1.0 - v) + v * aP1.w;
vN = normalize(pp - ax * (df + db));
vW = w; vS = s;
vec4 view = viewMatrix * vec4(w, 1.0);
vViewZ = -view.z;
gl_Position = projectionMatrix * view;
} `
;
const
CURTAIN_FRAG
=
`
uniform vec3 uAvBody;
uniform vec3 uAvTop;
uniform vec3 uAvFringe;
uniform float uAvScale;
uniform float uAvVeil;
in vec3 vW;
in vec3 vN;
in vec2 vUV;
in float vS;
in float vViewZ;
in vec4 vP2;
in vec4 vP3;
float vnoise(float x) { float i = floor(x), f = fract(x); f = f * f * (3.0 - 2.0 * f); return mix(hash11(i), hash11(i + 1.0), f); }
void main() {
float u = vUV.x, v = vUV.y;
float E = vP3.x, reveal = vP3.y, fringe = vP3.z, rays = vP3.w, drift = vP2.w;
// unrolls from the middle outwards, soft ends
float du = abs(u - 0.5) * 2.0;
float ends = smoothstep(1.0, 0.6, du) * smoothstep(reveal * 1.2, reveal * 1.2 - 0.3, du);
if (ends <= 0.0) discard;
// rays: drifting noise along the sheet (metres), sharpened into thin vertical streaks
float x = vS + vP2.x * 17.0;
float r = vnoise(x * 1.7 + drift) * 0.5 + vnoise(x * 4.3 - drift * 1.7 + 7.0) * 0.33 + vnoise(x * 11.0 + drift * 2.9 + 3.0) * 0.17;
r = smoothstep(0.18, 0.82, r) * (0.82 + 0.36 * vnoise(x * 27.0 + drift * 4.0)); // fine striation
float sharp = 1.5 + 2.0 * rays;
float ray = mix(0.8, pow(r, sharp) * (0.6 + sharp), min(rays, 1.0));
// some rays reach much higher than others
float top = 0.4 + 0.6 * vnoise(x * 0.8 + drift * 0.4 + 11.0);
// altitude: razor lower border, bright green base falling off upward, magenta-purple tops
float border = smoothstep(0.0, 0.025, v);
float body = exp(-v * 1.5 / top) * (0.45 + 0.55 * exp(-v * 5.0));
float upper = smoothstep(0.4, 0.75, v) * smoothstep(top + 0.3, top - 0.1, v);
// rays carry the green high; the faint red-purple only shows where the green has died away, and
// each ray frays out upward at its own height
float fray = 0.55 + 0.45 * vnoise(x * 6.0 + v * 9.0 - drift * 3.0);
vec3 col = uAvBody * body * (0.2 + 0.8 * ray) + uAvTop * upper * (0.15 + 0.85 * ray) * fray * 0.07;
col = col * border + uAvFringe * exp(-v * v * 1800.0) * fringe * (0.5 + ray) * 0.6;
// pulsating patches
float cell = floor(x * 0.55);
float puls = 0.78 + 0.22 * sin(uTime * (1.2 + 2.2 * hash11(cell)) + hash11(cell + 5.0) * 6.283);
// a thin glowing sheet: path length through it ~ 1 / |cos|, so folds seen edge-on blaze
float nv = abs(dot(vN, normalize(cameraPosition - vW)));
float edge = clamp(0.32 / sqrt(nv * nv + 0.03), 0.35, 1.8);
float soft = softFade(vViewZ, 0.6);
vec3 e = col * (E * ends * puls * edge * uAvScale) * soft;
// the veil: a thin dusk-blue dimming of the sky around the curtains so they read in daylight
// dimming most where the sheet glows, so it never reads as a dark panel
float a = uAvVeil * min(E, 1.0) * ends * smoothstep(-0.15, 0.06, v) * smoothstep(0.95, 0.3, v) * soft * (0.3 + 0.7 * min(body * (0.4 + ray), 1.0));
fxOut(vec3(0.006, 0.01, 0.03), a, e, vec2(0.0), vViewZ);
} `
;
const
=
new
THREE. Vector3
(
)
,
=
new
THREE. Vector3
(
)
;
const
UP
=
new
THREE. Vector3
(
0
,
1
,
0
)
;
const
=
THREE
.
MathUtils
.
smoothstep
;
const
LAYOUT
=
[
[
0
,
0
,
0
,
1
,
1
,
1
]
,
[
-
2.8
,
0.12
,
0.6
,
0.85
,
0.8
,
0.7
]
,
[
2.6
,
-
0.14
,
1.2
,
0.9
,
0.72
,
0.8
]
,
[
-
5.4
,
0.05
,
2.3
,
0.8
,
0.9
,
0.55
]
,
]
;
export
default
{
id
:
'aurora-veil'
,
name
:
'Aurora Veil'
,
element
:
'light'
,
order
:
20
,
hue
:
'#2dff8a'
,
shape
:
'area'
,
params
:
{
curtains
:
3
,
length
:
18
,
height
:
8
,
base
:
3.4
,
fold
:
1
,
rays
:
1
,
speed
:
1
,
duration
:
5.5
,
intensity
:
1
,
light
:
1
,
precipitation
:
1
,
veil
:
1
,
color
:
'#19ff66'
,
top
:
'#b23cff'
,
fringe
:
'#ff3fa8'
,
}
,
ranges
:
{
curtains
:
[
1
,
MAX_CURTAINS
,
1
]
,
length
:
[
8
,
26
,
0.1
]
,
height
:
[
4
,
14
,
0.1
]
,
base
:
[
2.5
,
8
,
0.05
]
,
fold
:
[
0
,
2.5
,
0.01
]
,
rays
:
[
0
,
2
,
0.01
]
,
speed
:
[
0.2
,
3
,
0.01
]
,
duration
:
[
2
,
12
,
0.1
]
,
intensity
:
[
0.1
,
3
,
0.01
]
,
light
:
[
0
,
3
,
0.01
]
,
precipitation
:
[
0
,
3
,
0.01
]
,
veil
:
[
0
,
2
,
0.01
]
,
}
,
presets
:
{
substorm
:
{
curtains
:
4
,
fold
:
1.7
,
rays
:
1.6
,
speed
:
2
,
intensity
:
1.4
,
light
:
1.3
}
,
'quiet arc'
:
{
curtains
:
1
,
length
:
24
,
fold
:
0.45
,
rays
:
0.6
,
speed
:
0.45
,
duration
:
8
,
intensity
:
0.8
}
,
'blood aurora'
:
{
color
:
'#ff2b47'
,
top
:
'#a01cff'
,
fringe
:
'#ffb0d0'
,
rays
:
1.3
}
,
}
,
timing
:
{
charge
:
1.2
,
impact
:
1
,
linger
:
5.5
}
,
kinds
:
{
rain
:
{
style
:
'glow'
,
drag
:
1.5
,
gravity
:
0.6
,
curl
:
1.1
,
curlScale
:
0.6
,
forceResponse
:
0.8
,
life
:
[
2.2
,
3.6
]
,
size
:
[
0.022
,
0.008
]
,
stretch
:
0.04
,
emissive
:
4
,
color
:
[
'#d8fff0'
,
'#2dff8a'
]
,
alpha
:
[
1
,
0
]
,
fadeIn
:
0.25
,
fadeOut
:
0.5
}
,
}
,
create
(
fx
)
{
const
S
=
this
,
P
=
.
particles
;
const
=
P
.
emitter
(
'light.mote'
,
{
shape
:
'ring'
,
radius
:
2.4
,
spread
:
0.3
}
)
;
const
=
P
.
emitter
(
'arcane.sparkle'
,
{
shape
:
'line'
,
radius
:
0.25
,
spread
:
1.2
}
)
;
const
=
P
.
emitter
(
'aurora-veil.rain'
,
{
shape
:
'line'
,
radius
:
0.35
,
spread
:
0.35
}
)
;
const
=
new
THREE. Color
(
)
,
=
new
THREE. Color
(
)
,
=
new
THREE. Color
(
)
,
=
new
THREE. Color
(
)
;
const
=
new
THREE. Vector3
(
)
,
=
new
THREE. Vector3
(
)
,
=
new
THREE. Vector3
(
)
;
let
=
''
,
=
''
,
=
''
;
function
syncColors
(
)
{
const
=
S
.
params
;
if
(
.
color
===
&&
.
top
===
&&
.
fringe
===
)
return
;
=
.
color
;
=
.
top
;
=
.
fringe
;
.
set
(
)
;
.
set
(
)
;
.
set
(
)
;
.
set
(
.
r
,
.
g
,
.
b
)
;
.
set
(
.
r
,
.
g
,
.
b
)
;
.
set
(
.
r
,
.
g
,
.
b
)
;
.
copy
(
)
.
lerp
(
,
0.15
)
;
P
.
setKind
(
'aurora-veil.rain'
,
{
color
:
[
'#e0fff2'
,
]
}
)
;
}
const
SIG
=
{
pos
:
new
THREE. Vector3
(
)
,
normal
:
new
THREE. Vector3
(
0
,
1
,
0
)
,
radius
:
2.4
,
color
:
,
intensity
:
0
,
reveal
:
0
,
rotation
:
0
,
style
:
'holy'
,
seed
:
0
}
;
const
SPLAT
=
{
x
:
0
,
z
:
0
,
x2
:
0
,
z2
:
0
,
radius
:
1.6
,
width
:
1.6
,
corruption
:
0
,
pattern
:
'line'
,
seed
:
0
}
;
const
=
[
]
,
=
[
]
;
for
(
let
=
0
;
<=
ROWS
;
++
)
for
(
let
=
0
;
<=
COLS
;
++
)
.
push
(
/
COLS
,
V0
+
(
V1
-
V0
)
*
/
ROWS
,
0
)
;
for
(
let
=
0
;
<
ROWS
;
++
)
for
(
let
=
0
;
<
COLS
;
++
)
{
const
=
*
(
COLS
+
1
)
+
,
=
+
1
,
=
+
COLS
+
1
,
=
+
1
;
.
push
(
,
,
,
,
,
)
;
}
const
=
new
THREE. InstancedBufferGeometry
(
)
;
.
setAttribute
(
'position'
,
new
THREE. Float32BufferAttribute
(
,
3
)
)
;
.
setIndex
(
)
;
const
=
instanced
(
,
'aP0'
,
MAX_INST
)
,
=
instanced
(
,
'aP1'
,
MAX_INST
)
,
=
instanced
(
,
'aP2'
,
MAX_INST
)
,
=
instanced
(
,
'aP3'
,
MAX_INST
)
;
.
instanceCount
=
0
;
const
=
new
THREE. RawShaderMaterial
(
{
glslVersion
:
THREE
.
GLSL3
,
side
:
THREE
.
DoubleSide
,
...
FX_BLENDING
,
uniforms
:
{
...
U
,
uAvBody
:
{
value
:
}
,
uAvTop
:
{
value
:
}
,
uAvFringe
:
{
value
:
}
,
uAvScale
:
{
value
:
6
}
,
uAvVeil
:
{
value
:
0.4
}
}
,
vertexShader
:
FX_VERT_HEAD
+
COMMON_GLSL
+
CURTAIN_VERT
,
fragmentShader
:
FX_FRAG_HEAD
+
COMMON_GLSL
+
FX_OUT_GLSL
+
CURTAIN_FRAG
,
}
)
;
const
=
new
THREE. Mesh
(
,
)
;
.
frustumCulled
=
false
;
.
visible
=
false
;
.
scenes
.
fx
.
add
(
)
;
const
ST
=
Array
.
from
(
{
length
:
MAX_CASTS
}
,
(
)
=>
(
{
on
:
false
,
centre
:
new
THREE. Vector3
(
)
,
dir
:
new
THREE. Vector3
(
)
,
axis
:
new
THREE. Vector3
(
)
,
n
:
0
,
E
:
0
,
fold
:
0
,
fringe
:
0
,
tau
:
0
,
drift
:
0
,
driftV
:
0
,
rise
:
0
,
splatT
:
0
,
sigil
:
null
,
topLight
:
null
,
vortex
:
null
,
cur
:
Array
.
from
(
{
length
:
MAX_CURTAINS
}
,
(
)
=>
(
{
c
:
new
THREE. Vector3
(
)
,
y0
:
0
,
H
:
0
,
L
:
0
,
w
:
1
,
seed
:
0
,
reveal
:
0
,
light
:
null
,
}
)
)
,
}
)
)
;
function
release
(
d
)
{
for
(
const
of
.
cur
)
{
.
light
?.
release
(
)
;
.
light
=
null
;
.
reveal
=
0
;
}
.
sigil
?.
release
(
)
;
.
topLight
?.
release
(
)
;
.
vortex
?.
release
(
)
;
.
sigil
=
.
topLight
=
.
vortex
=
null
;
.
on
=
false
;
}
function
borderEnds
(
d, k, y
)
{
const
=
.
L
*
0.42
;
.
copy
(
.
c
)
.
addScaledVector
(
.
axis
,
-
)
.
setY
(
)
;
.
copy
(
.
c
)
.
addScaledVector
(
.
axis
,
)
.
setY
(
)
;
}
syncColors
(
)
;
return
{
onParam
(
key
)
{
if
(
===
'color'
||
===
'top'
||
===
'fringe'
)
syncColors
(
)
;
}
,
phase
(
c, name
)
{
const
=
S
.
params
,
=
ST
[
.
index
]
;
syncColors
(
)
;
if
(
===
'charge'
)
{
.
on
=
true
;
.
durations
.
charge
=
1.2
;
.
durations
.
impact
=
1
;
.
durations
.
linger
=
.
duration
;
if
(
.
target
>=
0
)
.
centre
.
copy
(
.
dummies
[
.
target
]
.
pos
)
.
setY
(
0
)
;
else
.
centre
.
set
(
.
to
.
x
,
0
,
.
to
.
z
)
;
.
dir
.
set
(
.
dir
.
x
,
0
,
.
dir
.
z
)
;
if
(
.
dir
.
lengthSq
(
)
<
1e-6
)
.
dir
.
set
(
0
,
0
,
-
1
)
;
.
dir
.
normalize
(
)
;
.
axis
.
set
(
-
.
dir
.
z
,
0
,
.
dir
.
x
)
;
.
n
=
Math
.
round
(
.
curtains
)
;
.
E
=
0
;
.
fold
=
0.35
;
.
fringe
=
0
;
.
rise
=
0
;
.
splatT
=
0
;
.
tau
=
.
rand
(
)
*
20
;
.
drift
=
.
rand
(
)
*
20
;
.
driftV
=
0.3
;
for
(
let
=
0
;
<
MAX_CURTAINS
;
++
)
{
const
=
.
cur
[
]
,
L
=
LAYOUT
[
]
;
.
L
=
.
length
*
L
[
4
]
;
.
H
=
.
height
*
L
[
3
]
;
.
y0
=
.
base
+
L
[
2
]
;
.
w
=
L
[
5
]
;
.
c
.
copy
(
.
centre
)
.
addScaledVector
(
.
dir
,
L
[
0
]
)
.
addScaledVector
(
.
axis
,
L
[
1
]
*
.
length
)
;
.
seed
=
.
rand
(
)
*
10
;
.
reveal
=
0
;
.
light
=
null
;
if
(
<
.
n
)
{
.
light
=
.
lights
.
acquire
(
)
;
if
(
.
light
)
{
.
light
.
type
=
1
;
.
light
.
intensity
=
0
;
.
light
.
color
.
copy
(
)
;
.
light
.
range
=
.
y0
+
6
;
.
light
.
shadow
=
===
0
;
}
}
}
.
topLight
=
.
lights
.
acquire
(
)
;
if
(
.
topLight
)
{
.
topLight
.
intensity
=
0
;
.
topLight
.
color
.
copy
(
)
;
.
topLight
.
range
=
16
;
}
SIG
.
pos
.
set
(
.
centre
.
x
,
0.02
,
.
centre
.
z
)
;
SIG
.
intensity
=
0
;
SIG
.
reveal
=
0
;
SIG
.
rotation
=
.
tau
;
SIG
.
seed
=
.
seed
%
1000
;
.
sigil
=
.
sigils
.
acquire
(
SIG
)
;
.
vortex
=
null
;
}
else
if
(
===
'impact'
)
{
const
I
=
.
intensity
;
.
flash
(
0.1
*
I
)
;
.
rig
.
shake
(
0.16
,
6
)
;
.
pool
?.
flash
(
,
0.5
*
I
*
.
light
)
;
for
(
let
=
0
;
<
.
n
;
++
)
{
const
=
.
cur
[
]
;
borderEnds
(
,
,
.
y0
)
;
.
pos
.
copy
(
)
;
.
p
.
copy
(
)
;
.
vel
.
set
(
0
,
-
0.6
,
0
)
;
.
burst
(
220
*
.
precipitation
*
.
w
)
;
}
.
vortex
=
.
forces
.
acquire
(
)
;
if
(
.
vortex
)
{
.
vortex
.
type
=
1
;
.
vortex
.
pos
.
copy
(
.
centre
)
;
.
vortex
.
dir
.
copy
(
UP
)
;
.
vortex
.
w
=
.
base
+
2
;
.
vortex
.
p
[
0
]
=
2
;
.
vortex
.
p
[
1
]
=
0
;
.
vortex
.
p
[
2
]
=
0
;
.
vortex
.
p
[
3
]
=
0.25
;
}
}
else
if
(
===
'done'
)
release
(
)
;
}
,
update
(
c, dt
)
{
const
=
S
.
params
,
=
ST
[
.
index
]
,
I
=
.
intensity
;
if
(
!
.
on
)
return
;
let
Et
=
0
,
=
0.35
,
=
0
,
=
0
,
=
1
;
if
(
.
phase
===
'charge'
)
{
const
=
.
t
/
.
durations
.
charge
;
Et
=
0.55
*
sstep
(
,
0
,
0.9
)
;
.
cur
[
0
]
.
reveal
=
sstep
(
,
0
,
0.85
)
;
.
driftV
=
0.3
;
=
sstep
(
,
0
,
0.8
)
;
=
(
0.5
+
1.3
*
)
*
I
;
.
pos
.
set
(
.
centre
.
x
,
0.05
,
.
centre
.
z
)
;
.
vel
.
set
(
0
,
2
+
3
*
,
0
)
;
.
rate
(
380
*
*
.
precipitation
,
)
;
}
else
if
(
.
phase
===
'impact'
)
{
const
=
.
t
/
.
durations
.
impact
;
Et
=
<
0.3
?
1.8
:
1.25
;
for
(
let
=
0
;
<
.
n
;
++
)
.
cur
[
]
.
reveal
=
Math
.
max
(
.
cur
[
]
.
reveal
,
sstep
(
,
0.06
*
,
0.45
+
0.13
*
)
)
;
=
1.2
+
0.8
*
(
1
-
sstep
(
,
0.2
,
1
)
)
;
=
1
-
0.6
*
;
.
driftV
=
0.6
+
4
*
(
1
-
sstep
(
,
0
,
0.8
)
)
;
=
(
1.0
+
1.0
*
(
1
-
)
)
*
I
;
}
else
{
const
=
.
t
/
.
durations
.
linger
;
for
(
let
=
0
;
<
.
n
;
++
)
.
cur
[
]
.
reveal
=
1
;
Et
=
1.15
*
(
1
-
sstep
(
,
0.55
,
1
)
)
;
=
1.2
;
=
0.35
*
(
1
-
)
;
.
driftV
=
0.6
;
.
rise
=
1.6
*
sstep
(
,
0.45
,
1
)
;
=
1
-
sstep
(
,
0.1
,
0.6
)
;
=
1.0
*
I
*
(
1
-
sstep
(
,
0
,
0.4
)
)
;
}
.
E
+=
(
Et
-
.
E
)
*
(
1
-
Math
.
exp
(
-
/
(
Et
>
.
E
?
0.12
:
0.6
)
)
)
;
.
fold
+=
(
-
.
fold
)
*
(
1
-
Math
.
exp
(
-
/
0.3
)
)
;
.
fringe
+=
(
-
.
fringe
)
*
(
1
-
Math
.
exp
(
-
/
0.15
)
)
;
.
tau
+=
*
.
speed
*
(
0.5
+
0.6
*
.
fold
)
;
.
drift
+=
*
.
speed
*
.
driftV
;
if
(
.
sigil
)
{
.
sigil
.
reveal
=
;
.
sigil
.
intensity
=
;
.
sigil
.
rotation
=
.
tau
*
0.15
;
}
const
E
=
.
E
,
=
.
phase
!==
'charge'
;
for
(
let
=
0
;
<
.
n
;
++
)
{
const
=
.
cur
[
]
;
if
(
!
.
light
)
continue
;
const
=
0.22
*
Math
.
sin
(
.
tau
*
0.35
+
*
2.1
+
.
seed
)
,
=
0.7
+
0.3
*
Math
.
sin
(
.
tau
*
0.9
+
*
1.7
)
*
Math
.
sin
(
.
tau
*
0.37
+
.
seed
)
;
borderEnds
(
,
,
.
y0
+
.
rise
-
0.2
)
;
.
lerp
(
,
0.18
+
)
;
.
lerp
(
,
(
0.18
-
)
/
(
0.82
-
)
)
;
.
light
.
pos
.
copy
(
)
;
.
light
.
end
.
copy
(
)
;
.
light
.
intensity
=
4.5
*
E
*
.
w
*
.
reveal
*
I
*
.
light
*
;
}
if
(
.
topLight
)
{
.
topLight
.
pos
.
copy
(
.
centre
)
.
setY
(
.
base
+
.
rise
+
.
height
*
0.55
)
;
.
topLight
.
intensity
=
2.2
*
E
*
I
*
.
light
;
}
.
splatT
-=
;
if
(
&&
.
splatT
<=
0
&&
E
>
0.3
)
{
.
splatT
=
0.35
;
for
(
let
=
0
;
<
.
n
;
++
)
{
const
=
.
cur
[
]
;
borderEnds
(
,
,
0
)
;
SPLAT
.
x
=
.
x
;
SPLAT
.
z
=
.
z
;
SPLAT
.
x2
=
.
x
;
SPLAT
.
z2
=
.
z
;
SPLAT
.
corruption
=
-
0.25
*
E
*
.
reveal
;
SPLAT
.
seed
=
(
.
seed
+
*
13
)
%
100
;
.
ground
.
splat
(
SPLAT
)
;
}
}
if
(
)
for
(
let
=
0
;
<
.
n
;
++
)
{
const
=
.
cur
[
]
;
borderEnds
(
,
,
.
y0
+
.
rise
)
;
.
pos
.
copy
(
)
;
.
p
.
copy
(
)
;
.
vel
.
set
(
0
,
-
0.9
,
0
)
;
.
rate
(
90
*
.
precipitation
*
E
*
.
w
*
.
reveal
,
)
;
}
if
(
&&
E
>
0.3
)
for
(
const
of
.
dummies
)
{
const
=
Math
.
hypot
(
.
pos
.
x
-
.
centre
.
x
,
.
pos
.
z
-
.
centre
.
z
)
;
if
(
<
.
length
*
0.5
)
.
status
.
corrupt
=
Math
.
max
(
0
,
.
status
.
corrupt
-
*
0.9
*
E
)
;
}
if
(
.
vortex
)
{
.
vortex
.
p
[
1
]
=
5
*
E
;
.
vortex
.
p
[
2
]
=
1.4
*
E
;
}
}
,
tick
(
)
{
syncColors
(
)
;
const
A0
=
.
array
,
A1
=
.
array
,
A2
=
.
array
,
A3
=
.
array
,
=
S
.
params
;
let
=
0
;
for
(
const
of
ST
)
{
if
(
!
.
on
||
.
E
<
0.002
)
continue
;
for
(
let
=
0
;
<
.
n
&&
<
MAX_INST
;
++
)
{
const
=
.
cur
[
]
;
if
(
.
reveal
<
0.002
)
continue
;
const
=
*
4
;
A0
[
]
=
.
c
.
x
;
A0
[
+
1
]
=
0
;
A0
[
+
2
]
=
.
c
.
z
;
A0
[
+
3
]
=
.
L
;
A1
[
]
=
.
axis
.
x
;
A1
[
+
1
]
=
.
axis
.
z
;
A1
[
+
2
]
=
.
y0
+
.
rise
;
A1
[
+
3
]
=
.
H
;
A2
[
]
=
.
seed
;
A2
[
+
1
]
=
1.1
*
.
fold
*
.
fold
;
A2
[
+
2
]
=
.
tau
+
*
3.1
;
A2
[
+
3
]
=
.
drift
+
*
5.3
;
A3
[
]
=
.
E
*
.
w
*
.
intensity
;
A3
[
+
1
]
=
.
reveal
;
A3
[
+
2
]
=
.
fringe
;
A3
[
+
3
]
=
.
rays
;
++
;
}
}
.
uniforms
.
uAvVeil
.
value
=
0.65
*
.
veil
;
.
instanceCount
=
;
.
visible
=
>
0
;
if
(
>
0
)
.
needsUpdate
=
.
needsUpdate
=
.
needsUpdate
=
.
needsUpdate
=
true
;
}
,
}
;
}
,
}
;