shaders 2.2.3 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.js +1099 -1090
- package/dist/core/renderer.d.ts +26 -0
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/utilities/uvTransform.d.ts +1 -1
- package/dist/core/utilities/uvTransform.d.ts.map +1 -1
- package/dist/react/index.cjs +61 -61
- package/dist/react/index.js +6199 -6190
- package/dist/svelte/index.js +7567 -7558
- package/dist/vue/index.js +6407 -6397
- package/package.json +1 -1
package/dist/core/index.js
CHANGED
|
@@ -1,243 +1,243 @@
|
|
|
1
|
-
import { A as G, B as
|
|
2
|
-
import { n as
|
|
3
|
-
import { t as
|
|
1
|
+
import { A as G, B as Xn, D as R, E as Me, F as un, H as Yn, I as Ze, J as Hn, K as In, L as Wn, M as N, N as S, P as we, R as jn, S as ge, T as Rn, U as Qn, V as Jn, _ as xe, c as Kn, d as Q, g as en, h as nn, i as Zn, k as me, l as Tn, m as D, n as k, o as et, q as nt, s as tt, t as rt, v as c, w as ot, x as J, z as it } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { n as se, t as be } from "./edges-B-tVdqcI.js";
|
|
3
|
+
import { t as ro } from "./time-5uQ65blS.js";
|
|
4
4
|
import "./transformations-DBjTkQ5b.js";
|
|
5
|
-
import { n as
|
|
6
|
-
import { n as
|
|
5
|
+
import { n as at } from "./AngularBlur-BTUdXC0g.js";
|
|
6
|
+
import { n as st } from "./Ascii-Bu8ii7oo.js";
|
|
7
7
|
import "./colorMixing-DPZ-Td4U.js";
|
|
8
|
-
import { n as
|
|
9
|
-
import { n as
|
|
10
|
-
import { n as
|
|
11
|
-
import { n as
|
|
12
|
-
import { n as
|
|
13
|
-
import { n as
|
|
14
|
-
import { n as
|
|
15
|
-
import { n as
|
|
16
|
-
import { n as
|
|
17
|
-
import { n as
|
|
18
|
-
import { n as
|
|
19
|
-
import { n as
|
|
20
|
-
import { n as
|
|
21
|
-
import { n as
|
|
22
|
-
import { n as
|
|
23
|
-
import { n as
|
|
24
|
-
import { n as
|
|
25
|
-
import { n as
|
|
26
|
-
import { n as
|
|
8
|
+
import { n as lt } from "./Blob-C0G0efjG.js";
|
|
9
|
+
import { n as ct } from "./Blur-BzUO9yxF.js";
|
|
10
|
+
import { n as ft } from "./Bulge-BCXYAzig.js";
|
|
11
|
+
import { n as ut } from "./ChannelBlur-BEK1qzGn.js";
|
|
12
|
+
import { n as mt } from "./Checkerboard-BPkiSF5I.js";
|
|
13
|
+
import { n as dt } from "./ChromaFlow-AHO3C4o3.js";
|
|
14
|
+
import { n as ht } from "./ChromaticAberration-nVg3r1FK.js";
|
|
15
|
+
import { n as pt } from "./Circle-C8ltF4BZ.js";
|
|
16
|
+
import { n as gt } from "./CRTScreen-cJ3XHrI9.js";
|
|
17
|
+
import { n as bt } from "./CursorTrail-BeJGeovB.js";
|
|
18
|
+
import { n as vt } from "./DiffuseBlur-BdGvOoBw.js";
|
|
19
|
+
import { n as Ct } from "./Dither-CpN3vGSh.js";
|
|
20
|
+
import { n as Rt } from "./DotGrid-BFUzeSQw.js";
|
|
21
|
+
import { n as Tt } from "./Duotone-_nR_o3-g.js";
|
|
22
|
+
import { n as kt } from "./FilmGrain-BAKXXtLg.js";
|
|
23
|
+
import { n as yt } from "./FloatingParticles-Fv8JIzKk.js";
|
|
24
|
+
import { n as wt } from "./GlassTiles-5MyBj1ff.js";
|
|
25
|
+
import { n as Ut } from "./Glow-DvJj7BB7.js";
|
|
26
|
+
import { n as St } from "./Godrays-cUzAKVXn.js";
|
|
27
27
|
import "./TSLBase-BFMvTOak.js";
|
|
28
28
|
import "./ColorAdjustment-CKwpE_4M.js";
|
|
29
|
-
import { n as
|
|
30
|
-
import { n as
|
|
31
|
-
import { n as
|
|
32
|
-
import { n as
|
|
33
|
-
import { n as
|
|
34
|
-
import { n as
|
|
35
|
-
import { n as
|
|
36
|
-
import { n as
|
|
37
|
-
import { n as
|
|
38
|
-
import { n as
|
|
39
|
-
import { n as
|
|
40
|
-
import { n as
|
|
41
|
-
import { n as
|
|
42
|
-
import { n as
|
|
43
|
-
import { n as
|
|
44
|
-
import { n as
|
|
45
|
-
import { n as
|
|
46
|
-
import { n as
|
|
47
|
-
import { n as
|
|
48
|
-
import { n as
|
|
49
|
-
import { n as
|
|
50
|
-
import { n as
|
|
51
|
-
import { n as
|
|
52
|
-
import { n as
|
|
53
|
-
import { n as
|
|
54
|
-
import { n as
|
|
55
|
-
import { n as
|
|
56
|
-
import { n as
|
|
57
|
-
import { n as
|
|
58
|
-
import { n as
|
|
59
|
-
import { n as
|
|
60
|
-
import { WebGLRenderer as
|
|
61
|
-
|
|
29
|
+
import { n as Mt } from "./Grayscale-oWIF3PV5.js";
|
|
30
|
+
import { n as xt } from "./Grid-Bov7AA9m.js";
|
|
31
|
+
import { n as At } from "./GridDistortion-CWYom5Dw.js";
|
|
32
|
+
import { n as Dt } from "./Group-CPk-7fiA.js";
|
|
33
|
+
import { n as zt } from "./Halftone-F7fsdu7W.js";
|
|
34
|
+
import { n as Et } from "./HueShift-CiS4hdtk.js";
|
|
35
|
+
import { n as Ft } from "./ImageTexture-B3Q29OHX.js";
|
|
36
|
+
import { n as $t } from "./Invert-Cyc4JHWc.js";
|
|
37
|
+
import { n as Ot } from "./LinearBlur-BTC54qzk.js";
|
|
38
|
+
import { n as Bt } from "./LinearGradient-LEMeW0KM.js";
|
|
39
|
+
import { n as _t } from "./Liquify-D2nzMDzq.js";
|
|
40
|
+
import { n as Vt } from "./Pixelate-irPzmtQm.js";
|
|
41
|
+
import { n as qt } from "./PolarCoordinates-Ck5ZWrQO.js";
|
|
42
|
+
import { n as Gt } from "./Posterize-DICq_t96.js";
|
|
43
|
+
import { n as Lt } from "./ProgressiveBlur-BuORe3VH.js";
|
|
44
|
+
import { n as Nt } from "./RadialGradient-D0cN67jm.js";
|
|
45
|
+
import { n as Pt } from "./RectangularCoordinates-1LIDaeHR.js";
|
|
46
|
+
import { n as Xt } from "./Ripples-DH71sFJc.js";
|
|
47
|
+
import { n as Yt } from "./Saturation-DbSXtSeK.js";
|
|
48
|
+
import { n as Ht } from "./SimplexNoise-DPGC2OPJ.js";
|
|
49
|
+
import { n as It } from "./SineWave-CkWtnzHF.js";
|
|
50
|
+
import { n as Wt } from "./SolidColor-DaB-FHNX.js";
|
|
51
|
+
import { n as jt } from "./Spiral-CcyI8azF.js";
|
|
52
|
+
import { n as Qt } from "./Strands-Co4fkc05.js";
|
|
53
|
+
import { n as Jt } from "./Swirl-BoveqtNV.js";
|
|
54
|
+
import { n as Kt } from "./TiltShift-D53azmRe.js";
|
|
55
|
+
import { n as Zt } from "./Tritone-Cg1rX-hL.js";
|
|
56
|
+
import { n as er } from "./Twirl-raO5pe5X.js";
|
|
57
|
+
import { n as nr } from "./Vibrance-DtekSkcz.js";
|
|
58
|
+
import { n as tr } from "./WaveDistortion-C65qO_cZ.js";
|
|
59
|
+
import { n as rr } from "./ZoomBlur-B97ZjhXe.js";
|
|
60
|
+
import { WebGLRenderer as or } from "three";
|
|
61
|
+
Wn();
|
|
62
62
|
D();
|
|
63
|
-
function
|
|
64
|
-
const
|
|
65
|
-
return
|
|
63
|
+
function ir(e, n, l = 1) {
|
|
64
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
65
|
+
return S(k(c(n.rgb, t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
66
66
|
}
|
|
67
67
|
D();
|
|
68
|
-
var
|
|
69
|
-
const n = e.x,
|
|
70
|
-
return
|
|
71
|
-
},
|
|
72
|
-
const n = e.x,
|
|
73
|
-
return
|
|
74
|
-
},
|
|
75
|
-
const n = e.x,
|
|
76
|
-
return
|
|
77
|
-
},
|
|
78
|
-
const n = e.x,
|
|
79
|
-
return
|
|
68
|
+
var mn = (e) => N(e.x.mul(1.2249401).sub(e.y.mul(0.2249404)).sub(e.z.mul(0)), e.x.mul(-0.0420569).add(e.y.mul(1.0420571)).add(e.z.mul(0)), e.x.mul(-0.0196376).sub(e.y.mul(0.0786361)).add(e.z.mul(1.0982735))), ar = (e) => N(e.x.mul(0.8224621).add(e.y.mul(0.177538)).add(e.z.mul(0)), e.x.mul(0.0331941).add(e.y.mul(0.9668058)).add(e.z.mul(0)), e.x.mul(0.0170826).add(e.y.mul(0.0723974)).add(e.z.mul(0.9105199))), dn = (e) => {
|
|
69
|
+
const n = e.x, l = e.y, t = e.z, u = n.mul(0.4122214708).add(l.mul(0.5363325363)).add(t.mul(0.0514459929)), p = n.mul(0.2119034982).add(l.mul(0.6806995451).add(t.mul(0.1073969566))), h = n.mul(0.0883024619).add(l.mul(0.2817188376)).add(t.mul(0.6299787005)), d = J(u, Q(1 / 3)), T = J(p, Q(1 / 3)), U = J(h, Q(1 / 3));
|
|
70
|
+
return N(d.mul(0.2104542553).add(T.mul(0.793617785)).sub(U.mul(0.0040720468)), d.mul(1.9779984951).sub(T.mul(2.428592205)).add(U.mul(0.4505937099)), d.mul(0.0259040371).add(T.mul(0.7827717662)).sub(U.mul(0.808675766)));
|
|
71
|
+
}, sr = (e) => {
|
|
72
|
+
const n = e.x, l = e.y, t = e.z, u = n.add(l.mul(0.3963377774)).add(t.mul(0.2158037573)), p = n.sub(l.mul(0.1055613458)).sub(t.mul(0.0638541728)), h = n.sub(l.mul(0.0894841775)).sub(t.mul(1.291485548)), d = J(u, Q(3)), T = J(p, Q(3)), U = J(h, Q(3));
|
|
73
|
+
return N(d.mul(4.0767416621).sub(T.mul(3.3077115913)).add(U.mul(0.2309699292)), d.mul(-1.2684380046).add(T.mul(2.6097574011)).sub(U.mul(0.3413193965)), d.mul(-0.0041960863).sub(T.mul(0.7034186147)).add(U.mul(1.707614701)));
|
|
74
|
+
}, hn = (e) => {
|
|
75
|
+
const n = e.x, l = e.y, t = e.z;
|
|
76
|
+
return N(n, Rn(l.mul(l).add(t.mul(t))), Zn(t, l));
|
|
77
|
+
}, lr = (e) => {
|
|
78
|
+
const n = e.x, l = e.y, t = e.z;
|
|
79
|
+
return N(n, l.mul(tt(t)), l.mul(ot(t)));
|
|
80
80
|
};
|
|
81
|
-
function
|
|
82
|
-
const
|
|
83
|
-
return
|
|
81
|
+
function cr(e, n, l = 1) {
|
|
82
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = mn(N(e.r, e.g, e.b)), h = mn(N(n.r, n.g, n.b)), d = dn(p), T = dn(h), U = hn(d);
|
|
83
|
+
return S(ar(sr(lr(k(c(hn(T), t), c(U, c(e.a, R(1, t))))))), u);
|
|
84
84
|
}
|
|
85
85
|
D();
|
|
86
|
-
var
|
|
87
|
-
const n = e.x,
|
|
88
|
-
return
|
|
89
|
-
},
|
|
90
|
-
const n = e.x,
|
|
91
|
-
return
|
|
86
|
+
var pn = (e) => N(e.x.mul(1.2249401).sub(e.y.mul(0.2249404)).sub(e.z.mul(0)), e.x.mul(-0.0420569).add(e.y.mul(1.0420571)).add(e.z.mul(0)), e.x.mul(-0.0196376).sub(e.y.mul(0.0786361)).add(e.z.mul(1.0982735))), fr = (e) => N(e.x.mul(0.8224621).add(e.y.mul(0.177538)).add(e.z.mul(0)), e.x.mul(0.0331941).add(e.y.mul(0.9668058)).add(e.z.mul(0)), e.x.mul(0.0170826).add(e.y.mul(0.0723974)).add(e.z.mul(0.9105199))), gn = (e) => {
|
|
87
|
+
const n = e.x, l = e.y, t = e.z, u = n.mul(0.4122214708).add(l.mul(0.5363325363)).add(t.mul(0.0514459929)), p = n.mul(0.2119034982).add(l.mul(0.6806995451).add(t.mul(0.1073969566))), h = n.mul(0.0883024619).add(l.mul(0.2817188376)).add(t.mul(0.6299787005)), d = J(u, Q(1 / 3)), T = J(p, Q(1 / 3)), U = J(h, Q(1 / 3));
|
|
88
|
+
return N(d.mul(0.2104542553).add(T.mul(0.793617785)).sub(U.mul(0.0040720468)), d.mul(1.9779984951).sub(T.mul(2.428592205)).add(U.mul(0.4505937099)), d.mul(0.0259040371).add(T.mul(0.7827717662)).sub(U.mul(0.808675766)));
|
|
89
|
+
}, ur = (e) => {
|
|
90
|
+
const n = e.x, l = e.y, t = e.z, u = n.add(l.mul(0.3963377774)).add(t.mul(0.2158037573)), p = n.sub(l.mul(0.1055613458)).sub(t.mul(0.0638541728)), h = n.sub(l.mul(0.0894841775)).sub(t.mul(1.291485548)), d = J(u, Q(3)), T = J(p, Q(3)), U = J(h, Q(3));
|
|
91
|
+
return N(d.mul(4.0767416621).sub(T.mul(3.3077115913)).add(U.mul(0.2309699292)), d.mul(-1.2684380046).add(T.mul(2.6097574011)).sub(U.mul(0.3413193965)), d.mul(-0.0041960863).sub(T.mul(0.7034186147)).add(U.mul(1.707614701)));
|
|
92
92
|
};
|
|
93
|
-
function
|
|
94
|
-
const
|
|
95
|
-
return
|
|
93
|
+
function mr(e, n, l = 1) {
|
|
94
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = pn(N(e.r, e.g, e.b)), h = pn(N(n.r, n.g, n.b)), d = gn(p);
|
|
95
|
+
return S(fr(ur(k(c(gn(h), t), c(d, c(e.a, R(1, t)))))), u);
|
|
96
96
|
}
|
|
97
97
|
D();
|
|
98
|
-
function
|
|
99
|
-
const
|
|
100
|
-
return
|
|
98
|
+
function dr(e, n, l = 1) {
|
|
99
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
100
|
+
return S(k(c(c(e.rgb, n.rgb), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
101
101
|
}
|
|
102
102
|
D();
|
|
103
|
-
function
|
|
104
|
-
const
|
|
105
|
-
return
|
|
103
|
+
function hr(e, n, l = 1) {
|
|
104
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
105
|
+
return S(k(c(R(1, c(R(1, e.rgb), R(1, n.rgb))), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
106
106
|
}
|
|
107
107
|
D();
|
|
108
|
-
function
|
|
109
|
-
const
|
|
110
|
-
return
|
|
108
|
+
function pr(e, n, l = 1) {
|
|
109
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
110
|
+
return S(k(c(en(k(e.rgb, n.rgb), 1), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
111
111
|
}
|
|
112
112
|
D();
|
|
113
|
-
function
|
|
114
|
-
const
|
|
115
|
-
return
|
|
113
|
+
function gr(e, n, l = 1) {
|
|
114
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
115
|
+
return S(k(c(xe(c(2, c(e.rgb, n.rgb)), R(1, c(2, c(R(1, e.rgb), R(1, n.rgb)))), Me(0.5, e.rgb)), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
116
116
|
}
|
|
117
117
|
D();
|
|
118
|
-
function
|
|
119
|
-
const
|
|
120
|
-
return
|
|
118
|
+
function br(e, n, l = 1) {
|
|
119
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
120
|
+
return S(k(c(rt(R(e.rgb, n.rgb)), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
121
121
|
}
|
|
122
122
|
D();
|
|
123
|
-
function
|
|
124
|
-
const
|
|
125
|
-
return
|
|
123
|
+
function vr(e, n, l = 1) {
|
|
124
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
125
|
+
return S(k(c(xe(e.rgb, en(Kn(e.rgb, R(1, n.rgb)), 1), Me(1e-3, R(1, n.rgb))), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
126
126
|
}
|
|
127
127
|
D();
|
|
128
|
-
function
|
|
129
|
-
const
|
|
130
|
-
return
|
|
128
|
+
function Cr(e, n, l = 1) {
|
|
129
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
130
|
+
return S(k(c(R(k(e.rgb, n.rgb), c(2, c(e.rgb, n.rgb))), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
131
131
|
}
|
|
132
132
|
D();
|
|
133
|
-
function
|
|
134
|
-
return k(k(
|
|
133
|
+
function le(e) {
|
|
134
|
+
return k(k(c(e.r, 0.2126), c(e.g, 0.7152)), c(e.b, 0.0722));
|
|
135
135
|
}
|
|
136
136
|
D();
|
|
137
|
-
function
|
|
138
|
-
const
|
|
139
|
-
return
|
|
137
|
+
function Rr(e, n, l = 1) {
|
|
138
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = R(le(e.rgb), le(n.rgb));
|
|
139
|
+
return S(k(c(k(n.rgb, p), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
140
140
|
}
|
|
141
141
|
D();
|
|
142
|
-
function
|
|
143
|
-
const
|
|
144
|
-
return
|
|
142
|
+
function Tr(e, n, l = 1) {
|
|
143
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = le(e.rgb), h = le(n.rgb).div(k(p, 1e-4));
|
|
144
|
+
return S(k(c(c(e.rgb, h), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
145
145
|
}
|
|
146
146
|
D();
|
|
147
|
-
function
|
|
148
|
-
const
|
|
149
|
-
return
|
|
147
|
+
function kr(e, n, l = 1) {
|
|
148
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
149
|
+
return S(k(c(en(e.rgb, n.rgb), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
150
150
|
}
|
|
151
151
|
D();
|
|
152
|
-
function
|
|
153
|
-
const
|
|
154
|
-
return
|
|
152
|
+
function yr(e, n, l = 1) {
|
|
153
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
154
|
+
return S(k(c(nn(e.rgb, n.rgb), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
155
155
|
}
|
|
156
156
|
D();
|
|
157
|
-
function
|
|
158
|
-
const
|
|
159
|
-
return
|
|
157
|
+
function wr(e, n, l = 1) {
|
|
158
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
159
|
+
return S(k(c(xe(S(0, 0, 0, 1).rgb, nn(R(1, R(1, e.rgb).div(k(n.rgb, 1e-4))), 0), Me(1e-4, n.rgb)), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
160
160
|
}
|
|
161
161
|
D();
|
|
162
|
-
function
|
|
163
|
-
const
|
|
164
|
-
return
|
|
162
|
+
function Ur(e, n, l = 1) {
|
|
163
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
164
|
+
return S(k(c(nn(k(k(e.rgb, n.rgb), -1), 0), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
165
165
|
}
|
|
166
166
|
D();
|
|
167
|
-
function
|
|
168
|
-
const
|
|
169
|
-
return
|
|
167
|
+
function Sr(e, n, l = 1) {
|
|
168
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = k(c(2, c(e.rgb, n.rgb)), c(c(e.rgb, e.rgb), R(1, c(2, n.rgb)))), h = Rn(e.rgb);
|
|
169
|
+
return S(k(c(xe(p, k(c(2, c(e.rgb, R(1, n.rgb))), c(h, R(c(2, n.rgb), 1))), Me(0.5, n.rgb)), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
170
170
|
}
|
|
171
171
|
D();
|
|
172
|
-
function
|
|
173
|
-
const
|
|
174
|
-
return
|
|
172
|
+
function Mr(e, n, l = 1) {
|
|
173
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
174
|
+
return S(k(c(xe(c(2, c(e.rgb, n.rgb)), R(1, c(2, c(R(1, e.rgb), R(1, n.rgb)))), Me(0.5, n.rgb)), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
175
175
|
}
|
|
176
176
|
D();
|
|
177
|
-
function
|
|
178
|
-
const
|
|
179
|
-
return
|
|
177
|
+
function xr(e, n, l = 1) {
|
|
178
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = le(e.rgb), h = le(n.rgb), d = e.rgb.sub(p), T = n.rgb.sub(h), U = d.length();
|
|
179
|
+
return S(k(c(k(c(T.normalize(), U), p), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
180
180
|
}
|
|
181
181
|
D();
|
|
182
|
-
function
|
|
183
|
-
const
|
|
184
|
-
return
|
|
182
|
+
function Ar(e, n, l = 1) {
|
|
183
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = le(e.rgb), h = le(n.rgb), d = e.rgb.sub(p), T = n.rgb.sub(h);
|
|
184
|
+
return S(k(c(k(c(d.normalize(), T.length()), p), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
185
185
|
}
|
|
186
|
-
var
|
|
187
|
-
normal:
|
|
188
|
-
"normal-oklch":
|
|
189
|
-
"normal-oklab":
|
|
190
|
-
multiply:
|
|
191
|
-
screen:
|
|
192
|
-
linearDodge:
|
|
193
|
-
overlay:
|
|
194
|
-
difference:
|
|
195
|
-
colorDodge:
|
|
196
|
-
exclusion:
|
|
197
|
-
color:
|
|
198
|
-
luminosity:
|
|
199
|
-
darken:
|
|
200
|
-
lighten:
|
|
201
|
-
colorBurn:
|
|
202
|
-
linearBurn:
|
|
203
|
-
softLight:
|
|
204
|
-
hardLight:
|
|
205
|
-
hue:
|
|
206
|
-
saturation:
|
|
186
|
+
var bn = {
|
|
187
|
+
normal: ir,
|
|
188
|
+
"normal-oklch": cr,
|
|
189
|
+
"normal-oklab": mr,
|
|
190
|
+
multiply: dr,
|
|
191
|
+
screen: hr,
|
|
192
|
+
linearDodge: pr,
|
|
193
|
+
overlay: gr,
|
|
194
|
+
difference: br,
|
|
195
|
+
colorDodge: vr,
|
|
196
|
+
exclusion: Cr,
|
|
197
|
+
color: Rr,
|
|
198
|
+
luminosity: Tr,
|
|
199
|
+
darken: kr,
|
|
200
|
+
lighten: yr,
|
|
201
|
+
colorBurn: wr,
|
|
202
|
+
linearBurn: Ur,
|
|
203
|
+
softLight: Sr,
|
|
204
|
+
hardLight: Mr,
|
|
205
|
+
hue: xr,
|
|
206
|
+
saturation: Ar
|
|
207
207
|
};
|
|
208
|
-
function
|
|
209
|
-
return (
|
|
208
|
+
function j(e, n, l = "normal", t = 1) {
|
|
209
|
+
return (bn[l] || bn.normal)(e, n, t);
|
|
210
210
|
}
|
|
211
211
|
D();
|
|
212
|
-
function
|
|
213
|
-
const
|
|
214
|
-
return
|
|
212
|
+
function Dr(e, n) {
|
|
213
|
+
const l = c(e.a, n.a);
|
|
214
|
+
return S(e.rgb, l);
|
|
215
215
|
}
|
|
216
216
|
D();
|
|
217
|
-
function
|
|
218
|
-
const
|
|
219
|
-
return
|
|
217
|
+
function zr(e, n) {
|
|
218
|
+
const l = R(1, n.a), t = c(e.a, l);
|
|
219
|
+
return S(e.rgb, t);
|
|
220
220
|
}
|
|
221
221
|
D();
|
|
222
|
-
function
|
|
223
|
-
const
|
|
224
|
-
return
|
|
222
|
+
function Er(e, n) {
|
|
223
|
+
const l = N(0.2126, 0.7152, 0.0722), t = Tn(n.rgb, l), u = c(e.a, t);
|
|
224
|
+
return S(e.rgb, u);
|
|
225
225
|
}
|
|
226
226
|
D();
|
|
227
|
-
function
|
|
228
|
-
const
|
|
229
|
-
return
|
|
227
|
+
function Fr(e, n) {
|
|
228
|
+
const l = N(0.2126, 0.7152, 0.0722), t = R(1, Tn(n.rgb, l)), u = c(e.a, t);
|
|
229
|
+
return S(e.rgb, u);
|
|
230
230
|
}
|
|
231
|
-
var
|
|
232
|
-
alpha:
|
|
233
|
-
alphaInverted:
|
|
234
|
-
luminance:
|
|
235
|
-
luminanceInverted:
|
|
231
|
+
var vn = {
|
|
232
|
+
alpha: Dr,
|
|
233
|
+
alphaInverted: zr,
|
|
234
|
+
luminance: Er,
|
|
235
|
+
luminanceInverted: Fr
|
|
236
236
|
};
|
|
237
|
-
function
|
|
238
|
-
return (
|
|
237
|
+
function $r(e, n, l = "alpha") {
|
|
238
|
+
return (vn[l] || vn.alpha)(e, n);
|
|
239
239
|
}
|
|
240
|
-
var
|
|
240
|
+
var Or = class {
|
|
241
241
|
frameTimesMs = [];
|
|
242
242
|
maxSamples = 60;
|
|
243
243
|
targetFrameTime = 16.67;
|
|
@@ -259,8 +259,8 @@ var Bt = class {
|
|
|
259
259
|
this.frameTimesMs.push(e), this.frameTimesMs.length > this.maxSamples && this.frameTimesMs.shift(), this.totalFrameCount++, e > this.targetFrameTime && this.jankFrameCount++;
|
|
260
260
|
const n = performance.now();
|
|
261
261
|
if (this.lastFrameTimestamp > 0) {
|
|
262
|
-
const
|
|
263
|
-
this.frameIntervals.push(
|
|
262
|
+
const l = n - this.lastFrameTimestamp;
|
|
263
|
+
this.frameIntervals.push(l), this.frameIntervals.length > this.maxSamples && this.frameIntervals.shift();
|
|
264
264
|
}
|
|
265
265
|
this.lastFrameTimestamp = n, this.recordMemorySnapshot();
|
|
266
266
|
}
|
|
@@ -298,32 +298,32 @@ var Bt = class {
|
|
|
298
298
|
time: e,
|
|
299
299
|
bytes: n
|
|
300
300
|
});
|
|
301
|
-
const
|
|
302
|
-
this.memorySnapshots = this.memorySnapshots.filter((
|
|
301
|
+
const l = e - this.memoryWindowMs;
|
|
302
|
+
this.memorySnapshots = this.memorySnapshots.filter((t) => t.time > l);
|
|
303
303
|
}
|
|
304
304
|
/**
|
|
305
305
|
* Calculates memory growth rate in MB/sec
|
|
306
306
|
*/
|
|
307
307
|
calculateMemoryGrowthRate() {
|
|
308
308
|
if (this.memorySnapshots.length < 2) return null;
|
|
309
|
-
const e = this.memorySnapshots[0], n = this.memorySnapshots[this.memorySnapshots.length - 1],
|
|
310
|
-
return (n.bytes - e.bytes) / (1024 * 1024) /
|
|
309
|
+
const e = this.memorySnapshots[0], n = this.memorySnapshots[this.memorySnapshots.length - 1], l = (n.time - e.time) / 1e3;
|
|
310
|
+
return (n.bytes - e.bytes) / (1024 * 1024) / l;
|
|
311
311
|
}
|
|
312
312
|
/**
|
|
313
313
|
* Calculates standard deviation of frame times
|
|
314
314
|
*/
|
|
315
315
|
calculateStdDev(e) {
|
|
316
316
|
if (e.length === 0) return 0;
|
|
317
|
-
const n = e.reduce((
|
|
318
|
-
return Math.sqrt(
|
|
317
|
+
const n = e.reduce((t, u) => t + u, 0) / e.length, l = e.map((t) => Math.pow(t - n, 2)).reduce((t, u) => t + u, 0) / e.length;
|
|
318
|
+
return Math.sqrt(l);
|
|
319
319
|
}
|
|
320
320
|
/**
|
|
321
321
|
* Calculates 99th percentile frame time
|
|
322
322
|
*/
|
|
323
323
|
calculateP99(e) {
|
|
324
324
|
if (e.length === 0) return 0;
|
|
325
|
-
const n = [...e].sort((
|
|
326
|
-
return n[Math.min(
|
|
325
|
+
const n = [...e].sort((t, u) => t - u), l = Math.floor(n.length * 0.99);
|
|
326
|
+
return n[Math.min(l, n.length - 1)];
|
|
327
327
|
}
|
|
328
328
|
/**
|
|
329
329
|
* Calculates complexity score based on node structure
|
|
@@ -349,7 +349,7 @@ var Bt = class {
|
|
|
349
349
|
score: 0,
|
|
350
350
|
label: "N/A"
|
|
351
351
|
};
|
|
352
|
-
const n = this.frameTimesMs.reduce((U,
|
|
352
|
+
const n = this.frameTimesMs.reduce((U, _) => U + _, 0) / e, l = Math.min(n / 16.67 * 100, 100), t = this.calculateComplexityScore(), u = Math.min(t / 100 * 100, 100);
|
|
353
353
|
let p = 0;
|
|
354
354
|
this.lastGpuTime !== null && (p = Math.min(this.lastGpuTime / 16.67 * 100, 100));
|
|
355
355
|
const h = this.lastGpuTime !== null ? {
|
|
@@ -360,40 +360,40 @@ var Bt = class {
|
|
|
360
360
|
frame: 0.7,
|
|
361
361
|
gpu: 0,
|
|
362
362
|
complexity: 0.3
|
|
363
|
-
}, d = Math.round(
|
|
364
|
-
let
|
|
365
|
-
return d <= 20 ?
|
|
363
|
+
}, d = Math.round(l * h.frame + p * h.gpu + u * h.complexity);
|
|
364
|
+
let T;
|
|
365
|
+
return d <= 20 ? T = "Very Light" : d <= 40 ? T = "Light" : d <= 60 ? T = "Medium" : d <= 80 ? T = "Heavy" : T = "Very Heavy", {
|
|
366
366
|
score: Math.min(d, 100),
|
|
367
|
-
label:
|
|
367
|
+
label: T
|
|
368
368
|
};
|
|
369
369
|
}
|
|
370
370
|
/**
|
|
371
371
|
* Gets current performance statistics
|
|
372
372
|
*/
|
|
373
373
|
getStats(e) {
|
|
374
|
-
const n = this.frameTimesMs.length,
|
|
374
|
+
const n = this.frameTimesMs.length, l = this.frameIntervals.length > 0 ? 1e3 / (this.frameIntervals.reduce((z, E) => z + E, 0) / this.frameIntervals.length) : 0, t = n > 0 ? this.frameTimesMs.reduce((z, E) => z + E, 0) / n : 0, u = n > 0 ? Math.min(...this.frameTimesMs) : 0, p = n > 0 ? Math.max(...this.frameTimesMs) : 0, h = this.calculateP99(this.frameTimesMs), d = this.calculateStdDev(this.frameTimesMs), T = this.totalFrameCount > 0 ? this.jankFrameCount / this.totalFrameCount * 100 : 0, U = performance.memory, _ = U ? U.usedJSHeapSize / (1024 * 1024) : null, B = this.calculateMemoryGrowthRate(), K = t > 0 ? t / this.targetFrameTime * 100 : 0, P = e?.render?.calls ?? null, X = e?.programs?.length ?? null, L = e?.memory?.textures ?? null, ie = this.calculateIntensityScore();
|
|
375
375
|
return {
|
|
376
|
-
fps: Math.round(
|
|
377
|
-
avgFrameTime: Math.round(
|
|
378
|
-
minFrameTime: Math.round(
|
|
376
|
+
fps: Math.round(l),
|
|
377
|
+
avgFrameTime: Math.round(t * 100) / 100,
|
|
378
|
+
minFrameTime: Math.round(u * 100) / 100,
|
|
379
379
|
maxFrameTime: Math.round(p * 100) / 100,
|
|
380
380
|
p99FrameTime: Math.round(h * 100) / 100,
|
|
381
381
|
stdDevFrameTime: Math.round(d * 100) / 100,
|
|
382
382
|
jankCount: this.jankFrameCount,
|
|
383
|
-
jankPercent: Math.round(
|
|
383
|
+
jankPercent: Math.round(T * 10) / 10,
|
|
384
384
|
nodeCount: this.nodeCount,
|
|
385
385
|
rttNodeCount: this.rttNodeCount,
|
|
386
386
|
complexityScore: this.calculateComplexityScore(),
|
|
387
|
-
memoryUsedMB:
|
|
387
|
+
memoryUsedMB: _ !== null ? Math.round(_ * 100) / 100 : null,
|
|
388
388
|
memoryGrowthRate: B !== null ? Math.round(B * 1e3) / 1e3 : null,
|
|
389
389
|
cpuTime: this.lastCpuTime !== null ? Math.round(this.lastCpuTime * 100) / 100 : null,
|
|
390
390
|
gpuTime: this.lastGpuTime !== null ? Math.round(this.lastGpuTime * 100) / 100 : null,
|
|
391
|
-
budgetUsed: Math.round(
|
|
392
|
-
drawCalls:
|
|
393
|
-
shaderPrograms:
|
|
394
|
-
textureCount:
|
|
395
|
-
intensityScore:
|
|
396
|
-
intensityLabel:
|
|
391
|
+
budgetUsed: Math.round(K * 10) / 10,
|
|
392
|
+
drawCalls: P,
|
|
393
|
+
shaderPrograms: X,
|
|
394
|
+
textureCount: L,
|
|
395
|
+
intensityScore: ie.score,
|
|
396
|
+
intensityLabel: ie.label,
|
|
397
397
|
isRendering: this.isRendering
|
|
398
398
|
};
|
|
399
399
|
}
|
|
@@ -405,19 +405,19 @@ var Bt = class {
|
|
|
405
405
|
}
|
|
406
406
|
};
|
|
407
407
|
D();
|
|
408
|
-
var { vec2:
|
|
409
|
-
const
|
|
410
|
-
const
|
|
411
|
-
return
|
|
408
|
+
var { vec2: Ue, cos: Br, sin: _r, float: Vr, PI: qr } = me;
|
|
409
|
+
const oe = (e) => e ? e.offsetX !== 0 || e.offsetY !== 0 || e.rotation !== 0 || e.scale !== 1 || e.anchorX !== 0.5 || e.anchorY !== 0.5 : !1, Se = (e, n, l, t, u, p, h, d) => {
|
|
410
|
+
const T = t.mul(qr).div(Vr(180)), U = Br(T), _ = _r(T), B = Ue(p, h), K = e.sub(B).div(u), P = Ue(K.x.mul(d), K.y), X = Ue(P.x.mul(U).sub(P.y.mul(_)), P.x.mul(_).add(P.y.mul(U)));
|
|
411
|
+
return Ue(X.x.div(d), X.y).sub(Ue(n, l)).add(B);
|
|
412
412
|
};
|
|
413
|
-
var
|
|
414
|
-
createUniformsMap: () =>
|
|
415
|
-
updateUniformValue: () =>
|
|
413
|
+
var Gr = /* @__PURE__ */ nt({
|
|
414
|
+
createUniformsMap: () => Lr,
|
|
415
|
+
updateUniformValue: () => Nr
|
|
416
416
|
});
|
|
417
|
-
function
|
|
418
|
-
const
|
|
419
|
-
return Object.entries(e.props).forEach(([
|
|
420
|
-
const h = n[
|
|
417
|
+
function Lr(e, n, l) {
|
|
418
|
+
const t = {};
|
|
419
|
+
return Object.entries(e.props).forEach(([u, p]) => {
|
|
420
|
+
const h = n[u];
|
|
421
421
|
let d = h;
|
|
422
422
|
if (p.transform) {
|
|
423
423
|
const U = p.transform(h);
|
|
@@ -427,48 +427,48 @@ function Gt(e, n, a) {
|
|
|
427
427
|
const U = p.transform(d);
|
|
428
428
|
d = U?.node ?? U;
|
|
429
429
|
}
|
|
430
|
-
d == null && (console.error(`[Shaders] Uniform "${
|
|
431
|
-
propName:
|
|
430
|
+
d == null && (console.error(`[Shaders] Uniform "${u}" is null/undefined after fallback. PropConfig:`, {
|
|
431
|
+
propName: u,
|
|
432
432
|
initialValue: h,
|
|
433
433
|
default: p.default,
|
|
434
434
|
hasTransform: !!p.transform
|
|
435
435
|
}), d = 0);
|
|
436
|
-
const
|
|
437
|
-
typeof d == "string" &&
|
|
438
|
-
uniform:
|
|
436
|
+
const T = kn(d).setName(`${u}_${l}`);
|
|
437
|
+
typeof d == "string" && T.value === null && (T.value = d), t[u] = {
|
|
438
|
+
uniform: T,
|
|
439
439
|
transform: p.transform || void 0
|
|
440
440
|
};
|
|
441
|
-
}),
|
|
441
|
+
}), t;
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function Nr(e, n) {
|
|
444
444
|
if (e?.transform) {
|
|
445
|
-
const
|
|
446
|
-
e.uniform.value =
|
|
445
|
+
const l = e.transform(n), t = l?.data ?? l;
|
|
446
|
+
e.uniform.value = t;
|
|
447
447
|
} else e.uniform.value = n;
|
|
448
448
|
}
|
|
449
|
-
var
|
|
450
|
-
D(), { uniform:
|
|
449
|
+
var kn, yn = In({ "src/utilities/uniforms.ts": (() => {
|
|
450
|
+
D(), { uniform: kn } = me;
|
|
451
451
|
}) });
|
|
452
452
|
D();
|
|
453
|
-
var
|
|
453
|
+
var Cn = !1, Pr = /* @__PURE__ */ (() => {
|
|
454
454
|
let e = 0;
|
|
455
|
-
const n = /* @__PURE__ */ new Set(),
|
|
455
|
+
const n = /* @__PURE__ */ new Set(), l = (h) => {
|
|
456
456
|
n.forEach((d) => {
|
|
457
457
|
try {
|
|
458
458
|
d.onMouseMove(h);
|
|
459
|
-
} catch (
|
|
460
|
-
console.error("[Shaders] Error in mouse move handler:",
|
|
459
|
+
} catch (T) {
|
|
460
|
+
console.error("[Shaders] Error in mouse move handler:", T);
|
|
461
461
|
}
|
|
462
462
|
});
|
|
463
|
-
},
|
|
463
|
+
}, t = (h) => {
|
|
464
464
|
n.forEach((d) => {
|
|
465
465
|
try {
|
|
466
466
|
d.onTouchMove(h);
|
|
467
|
-
} catch (
|
|
468
|
-
console.error("[Shaders] Error in touch move handler:",
|
|
467
|
+
} catch (T) {
|
|
468
|
+
console.error("[Shaders] Error in touch move handler:", T);
|
|
469
469
|
}
|
|
470
470
|
});
|
|
471
|
-
},
|
|
471
|
+
}, u = () => {
|
|
472
472
|
n.forEach((h) => {
|
|
473
473
|
try {
|
|
474
474
|
h.onMouseUp();
|
|
@@ -486,11 +486,11 @@ var Tn = !1, Xt = /* @__PURE__ */ (() => {
|
|
|
486
486
|
});
|
|
487
487
|
};
|
|
488
488
|
return { register(h) {
|
|
489
|
-
return n.add(h), e++, e === 1 && (window.addEventListener("mousemove",
|
|
490
|
-
n.delete(h), e--, e === 0 && (window.removeEventListener("mousemove",
|
|
489
|
+
return n.add(h), e++, e === 1 && (window.addEventListener("mousemove", l), window.addEventListener("touchmove", t), window.addEventListener("mouseup", u), window.addEventListener("touchend", p)), () => {
|
|
490
|
+
n.delete(h), e--, e === 0 && (window.removeEventListener("mousemove", l), window.removeEventListener("touchmove", t), window.removeEventListener("mouseup", u), window.removeEventListener("touchend", p));
|
|
491
491
|
};
|
|
492
492
|
} };
|
|
493
|
-
})(),
|
|
493
|
+
})(), Xr = () => {
|
|
494
494
|
try {
|
|
495
495
|
{
|
|
496
496
|
const { MODE: e, DEV: n } = {
|
|
@@ -508,958 +508,950 @@ var Tn = !1, Xt = /* @__PURE__ */ (() => {
|
|
|
508
508
|
return !1;
|
|
509
509
|
}
|
|
510
510
|
};
|
|
511
|
-
function
|
|
512
|
-
let e = null, n,
|
|
511
|
+
function li() {
|
|
512
|
+
let e = null, n, l, t, u, p;
|
|
513
513
|
const h = {
|
|
514
514
|
nodes: /* @__PURE__ */ new Map(),
|
|
515
515
|
rootId: null,
|
|
516
516
|
idToNodeId: /* @__PURE__ */ new Map()
|
|
517
517
|
}, d = /* @__PURE__ */ new Map();
|
|
518
|
-
let
|
|
519
|
-
const
|
|
520
|
-
let
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
width:
|
|
524
|
-
height:
|
|
525
|
-
},
|
|
526
|
-
if (
|
|
527
|
-
const { width: o, height:
|
|
528
|
-
|
|
529
|
-
const
|
|
530
|
-
|
|
531
|
-
|
|
518
|
+
let T = null, U = null, _ = null, B = !1, K = !1, P = !1, X = null, L = !1, ie = !0, z = 0, E = 0, ne = !1, Ge = 0, Le = !1, Ae = 0.5, De = 0.5, ce = !1, ze = !1, Ee = null, ve = null, fe = !1;
|
|
519
|
+
const ae = new Or();
|
|
520
|
+
let te = [], Ne = !1, Fe = [], de = null, $e = [], he = null, tn = /* @__PURE__ */ new Set(), rn = /* @__PURE__ */ new Set(), Pe = 0, Ce = /* @__PURE__ */ new Set(), Xe = /* @__PURE__ */ new Set(), Re = null, Oe = !1;
|
|
521
|
+
const Ye = (i, r) => {
|
|
522
|
+
i <= 0 || r <= 0 || i === z && r === E || (Re = {
|
|
523
|
+
width: i,
|
|
524
|
+
height: r
|
|
525
|
+
}, Oe || (Oe = !0, requestAnimationFrame(() => {
|
|
526
|
+
if (Oe = !1, !Re) return;
|
|
527
|
+
const { width: o, height: f } = Re;
|
|
528
|
+
Re = null, z = o, E = f, P || (P = !0), n.setSize(o, f, !1);
|
|
529
|
+
const s = o / f, v = 2, b = v * s;
|
|
530
|
+
l.left = -b / 2, l.right = b / 2, l.top = v / 2, l.bottom = -v / 2, l.updateProjectionMatrix(), u.scale.set(b, v, 1), h.nodes.forEach((m) => {
|
|
531
|
+
m.transformUniforms?.aspectRatio && (m.transformUniforms.aspectRatio.value = s), m.resizeCallbacks.forEach((M) => {
|
|
532
532
|
try {
|
|
533
533
|
M({
|
|
534
534
|
width: o,
|
|
535
|
-
height:
|
|
535
|
+
height: f
|
|
536
536
|
});
|
|
537
|
-
} catch (
|
|
538
|
-
console.error("Error in resize callback:",
|
|
537
|
+
} catch (F) {
|
|
538
|
+
console.error("Error in resize callback:", F);
|
|
539
539
|
}
|
|
540
540
|
});
|
|
541
|
-
}),
|
|
541
|
+
}), Z().catch(console.warn);
|
|
542
542
|
})));
|
|
543
|
-
},
|
|
544
|
-
if (!n || !
|
|
545
|
-
const
|
|
546
|
-
if (!
|
|
547
|
-
let o,
|
|
548
|
-
if (
|
|
549
|
-
const
|
|
550
|
-
|
|
543
|
+
}, wn = () => B && !!n && !!t && !!l && !!p && z > 0 && E > 0 && L, Un = (i) => {
|
|
544
|
+
if (!n || !l || !u) return;
|
|
545
|
+
const r = i[0];
|
|
546
|
+
if (!r) return;
|
|
547
|
+
let o, f;
|
|
548
|
+
if (r.contentBoxSize) {
|
|
549
|
+
const s = Array.isArray(r.contentBoxSize) ? r.contentBoxSize[0] : r.contentBoxSize;
|
|
550
|
+
s ? (o = Math.round(s.inlineSize), f = Math.round(s.blockSize)) : (o = Math.round(r.contentRect.width), f = Math.round(r.contentRect.height));
|
|
551
551
|
} else
|
|
552
|
-
o = Math.round(
|
|
553
|
-
o === 0 ||
|
|
554
|
-
},
|
|
555
|
-
const
|
|
556
|
-
if (!
|
|
557
|
-
const o =
|
|
558
|
-
|
|
559
|
-
const
|
|
560
|
-
if (
|
|
561
|
-
if (
|
|
562
|
-
const { width:
|
|
563
|
-
|
|
552
|
+
o = Math.round(r.contentRect.width), f = Math.round(r.contentRect.height);
|
|
553
|
+
o === 0 || f === 0 || Ye(o, f);
|
|
554
|
+
}, Sn = (i) => {
|
|
555
|
+
const r = i[0];
|
|
556
|
+
if (!r) return;
|
|
557
|
+
const o = L;
|
|
558
|
+
L = r.isIntersecting;
|
|
559
|
+
const f = e?.getBoundingClientRect(), s = ne;
|
|
560
|
+
if (ne = L && !!f && f.width > 0 && f.height > 0, L && !o) {
|
|
561
|
+
if (Le = !0, e) {
|
|
562
|
+
const { width: v, height: b } = e.getBoundingClientRect(), m = Math.round(v), M = Math.round(b);
|
|
563
|
+
m > 0 && M > 0 && (z === 0 || E === 0 || m !== z || M !== E ? (Ye(m, M), !s && ne && ue()) : p && B && h.rootId && (p.needsUpdate = !0, ue(), Z().catch(console.warn)));
|
|
564
564
|
}
|
|
565
|
-
|
|
566
|
-
} else !
|
|
567
|
-
},
|
|
568
|
-
if (
|
|
569
|
-
for (const o of
|
|
565
|
+
ie && Je();
|
|
566
|
+
} else !L && o && Ke();
|
|
567
|
+
}, Mn = (i, r) => {
|
|
568
|
+
if (i.size !== r.size) return !1;
|
|
569
|
+
for (const o of i) if (!r.has(o)) return !1;
|
|
570
570
|
return !0;
|
|
571
|
-
},
|
|
572
|
-
|
|
573
|
-
const
|
|
574
|
-
return
|
|
575
|
-
},
|
|
576
|
-
|
|
571
|
+
}, Te = (i) => {
|
|
572
|
+
Pe++;
|
|
573
|
+
const r = et(i);
|
|
574
|
+
return Ce.add(r), r;
|
|
575
|
+
}, on = () => {
|
|
576
|
+
Xe.forEach((i) => {
|
|
577
577
|
try {
|
|
578
|
-
|
|
578
|
+
i?.renderTarget?.dispose && i.renderTarget.dispose();
|
|
579
579
|
} catch {
|
|
580
580
|
}
|
|
581
|
-
}),
|
|
581
|
+
}), Xe.clear();
|
|
582
582
|
};
|
|
583
|
-
let
|
|
584
|
-
const
|
|
585
|
-
if (!h.rootId || !p || ze
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
(
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
try {
|
|
611
|
-
p.dispose(), n.renderTarget && n.renderTarget.dispose();
|
|
612
|
-
} catch {
|
|
583
|
+
let pe = !1;
|
|
584
|
+
const ue = () => {
|
|
585
|
+
if (!(!h.rootId || !p || ze) && h.nodes.get(h.rootId)) {
|
|
586
|
+
if (z === 0 || E === 0) {
|
|
587
|
+
pe || (pe = !0, requestAnimationFrame(() => {
|
|
588
|
+
pe = !1, z > 0 && E > 0 && ue();
|
|
589
|
+
}));
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
ze = !0;
|
|
593
|
+
try {
|
|
594
|
+
Xe = new Set(Ce), Ce.clear();
|
|
595
|
+
const i = /* @__PURE__ */ new Set();
|
|
596
|
+
rn.clear(), h.nodes.forEach((o, f) => {
|
|
597
|
+
(o.requiresRTT || o.transformRTTActive) && rn.add(f);
|
|
598
|
+
}), Pe = 0;
|
|
599
|
+
const r = W(h.rootId, /* @__PURE__ */ new Set(), i);
|
|
600
|
+
if (r && p) {
|
|
601
|
+
const o = !Mn(tn, i), f = p.fragmentNode !== r;
|
|
602
|
+
if (o || Le || f) {
|
|
603
|
+
on();
|
|
604
|
+
try {
|
|
605
|
+
p.dispose(), n.renderTarget && n.renderTarget.dispose();
|
|
606
|
+
} catch {
|
|
607
|
+
}
|
|
608
|
+
const s = new un({ transparent: !0 });
|
|
609
|
+
s.fragmentNode = r, s.needsUpdate = !0, u.material = s, p = s, Le = !1, tn = i;
|
|
613
610
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
611
|
+
}
|
|
612
|
+
} catch (i) {
|
|
613
|
+
console.error("Error composing shader tree:", i);
|
|
614
|
+
} finally {
|
|
615
|
+
ze = !1;
|
|
618
616
|
}
|
|
619
|
-
|
|
620
|
-
} catch (t) {
|
|
621
|
-
console.error("Error composing shader tree:", t), console.log(`[Shaders Perf] FAILED after ${(performance.now() - s).toFixed(2)}ms`);
|
|
622
|
-
} finally {
|
|
623
|
-
ze = !1;
|
|
617
|
+
L && Z().catch(console.warn);
|
|
624
618
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
if (!t) return [];
|
|
619
|
+
}, Y = (i) => {
|
|
620
|
+
const r = d.get(i);
|
|
621
|
+
if (!r) return [];
|
|
629
622
|
const o = [];
|
|
630
|
-
for (const
|
|
631
|
-
const
|
|
632
|
-
|
|
623
|
+
for (const f of r) {
|
|
624
|
+
const s = h.nodes.get(f);
|
|
625
|
+
s && o.push(s);
|
|
633
626
|
}
|
|
634
627
|
return o;
|
|
635
|
-
},
|
|
636
|
-
for (const [
|
|
628
|
+
}, xn = (i) => {
|
|
629
|
+
for (const [r, o] of h.nodes.entries()) if (o.metadata.id === i) return r;
|
|
637
630
|
return null;
|
|
638
|
-
},
|
|
639
|
-
if (!
|
|
640
|
-
const
|
|
641
|
-
if (!b) return
|
|
642
|
-
if (
|
|
643
|
-
return console.error("Uh oh, looks like you've got a circular dependency in your shader masks."),
|
|
644
|
-
const
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
631
|
+
}, ee = (i, r, o, f, s) => {
|
|
632
|
+
if (!r.metadata.mask?.source) return i;
|
|
633
|
+
const v = r.metadata.mask.source, b = xn(v);
|
|
634
|
+
if (!b) return i;
|
|
635
|
+
if (f.has(b))
|
|
636
|
+
return console.error("Uh oh, looks like you've got a circular dependency in your shader masks."), i;
|
|
637
|
+
const m = new Set(f);
|
|
638
|
+
m.add(o);
|
|
639
|
+
const M = W(b, m);
|
|
640
|
+
let F = M;
|
|
641
|
+
s && (F = Te(M).sample(s));
|
|
642
|
+
const y = r.metadata.mask.type || "alpha";
|
|
643
|
+
return $r(i, F, y);
|
|
644
|
+
}, re = (i, r) => {
|
|
645
|
+
if (!r.metadata.transform || !r.transformUniforms || !oe(r.metadata.transform) && !r.transformRTTActive) return i;
|
|
646
|
+
const o = Te(i), f = Se(ge, r.transformUniforms.offsetX, r.transformUniforms.offsetY, r.transformUniforms.rotation, r.transformUniforms.scale, r.transformUniforms.anchorX, r.transformUniforms.anchorY, r.transformUniforms.aspectRatio);
|
|
647
|
+
return be(f, o.sample(f), o, r.transformUniforms.edges);
|
|
648
|
+
}, H = (i) => !!i.uvTransformFunc && i.requiresChild && i.metadata.blendMode === "normal" && (i.metadata.opacity === void 0 || i.metadata.opacity === 1) && i.metadata.visible !== !1 && !i.metadata.mask?.source && !(i.transformUniforms && i.metadata.transform && oe(i.metadata.transform)), Be = (i) => {
|
|
649
|
+
const r = [];
|
|
650
|
+
let o = i;
|
|
653
651
|
for (; o; ) {
|
|
654
|
-
const
|
|
655
|
-
if (!
|
|
656
|
-
|
|
657
|
-
const
|
|
658
|
-
if (
|
|
659
|
-
const
|
|
660
|
-
if (H(
|
|
652
|
+
const f = h.nodes.get(o);
|
|
653
|
+
if (!f || !H(f)) break;
|
|
654
|
+
r.push(f);
|
|
655
|
+
const s = Y(f.id);
|
|
656
|
+
if (s.length !== 1) break;
|
|
657
|
+
const v = s[0];
|
|
658
|
+
if (H(v)) o = v.id;
|
|
661
659
|
else break;
|
|
662
660
|
}
|
|
663
|
-
return
|
|
664
|
-
},
|
|
665
|
-
if (
|
|
666
|
-
const
|
|
661
|
+
return r;
|
|
662
|
+
}, An = (i) => {
|
|
663
|
+
if (i.length === 0) return null;
|
|
664
|
+
const r = i[i.length - 1], o = Y(r.id);
|
|
667
665
|
return o.length === 0 ? null : o.length === 1 ? o[0] : null;
|
|
668
|
-
},
|
|
669
|
-
if (!
|
|
670
|
-
const
|
|
671
|
-
if (
|
|
672
|
-
const o =
|
|
673
|
-
return o.acceptsUVContext && !o.requiresChild ? !0 : o.uvTransformFunc && H(o) ?
|
|
674
|
-
},
|
|
675
|
-
const
|
|
676
|
-
let
|
|
677
|
-
for (;
|
|
678
|
-
const
|
|
679
|
-
if (!
|
|
680
|
-
if (
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
f = c[0].id;
|
|
666
|
+
}, ke = (i) => {
|
|
667
|
+
if (!i.uvTransformFunc || !H(i)) return !1;
|
|
668
|
+
const r = Y(i.id);
|
|
669
|
+
if (r.length !== 1) return !1;
|
|
670
|
+
const o = r[0];
|
|
671
|
+
return o.acceptsUVContext && !o.requiresChild ? !0 : o.uvTransformFunc && H(o) ? ke(o) : !1;
|
|
672
|
+
}, _e = (i, r, o) => {
|
|
673
|
+
const f = [];
|
|
674
|
+
let s = i;
|
|
675
|
+
for (; s; ) {
|
|
676
|
+
const g = h.nodes.get(s);
|
|
677
|
+
if (!g) break;
|
|
678
|
+
if (f.length >= 2) return W(i, r, o, !0);
|
|
679
|
+
if (f.push(g), o && o.add(g.id), g.acceptsUVContext && !g.requiresChild) break;
|
|
680
|
+
const a = Y(s);
|
|
681
|
+
if (a.length !== 1) break;
|
|
682
|
+
s = a[0].id;
|
|
686
683
|
}
|
|
687
|
-
if (
|
|
688
|
-
const
|
|
689
|
-
let
|
|
690
|
-
for (let
|
|
691
|
-
const
|
|
692
|
-
|
|
693
|
-
uv:
|
|
694
|
-
uniforms:
|
|
695
|
-
viewportSize:
|
|
696
|
-
})),
|
|
684
|
+
if (f.length === 0) return S(0, 0, 0, 0);
|
|
685
|
+
const v = f[f.length - 1];
|
|
686
|
+
let b = ge;
|
|
687
|
+
for (let g = 0; g < f.length; g++) {
|
|
688
|
+
const a = f[g];
|
|
689
|
+
a.uvTransformFunc && (b = a.uvTransformFunc({
|
|
690
|
+
uv: b,
|
|
691
|
+
uniforms: a.uniforms,
|
|
692
|
+
viewportSize: we
|
|
693
|
+
})), a.transformUniforms && a.metadata.transform && oe(a.metadata.transform) && (b = Se(b, a.transformUniforms.offsetX, a.transformUniforms.offsetY, a.transformUniforms.rotation, a.transformUniforms.scale, a.transformUniforms.anchorX, a.transformUniforms.anchorY, a.transformUniforms.aspectRatio), a.transformUniforms.edges && (b = se(b, a.transformUniforms.edges)), a.transformRTTActive = !0);
|
|
697
694
|
}
|
|
698
|
-
for (let
|
|
699
|
-
const
|
|
700
|
-
if (!
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
},
|
|
704
|
-
|
|
705
|
-
},
|
|
706
|
-
|
|
707
|
-
},
|
|
708
|
-
|
|
695
|
+
for (let g = 0; g < f.length - 1; g++) {
|
|
696
|
+
const a = f[g];
|
|
697
|
+
if (!a.requiresChild) continue;
|
|
698
|
+
const A = (V) => {
|
|
699
|
+
a.cleanupCallbacks.push(V);
|
|
700
|
+
}, I = (V) => {
|
|
701
|
+
a.beforeRenderCallbacks.push(V);
|
|
702
|
+
}, x = (V) => {
|
|
703
|
+
a.afterRenderCallbacks.push(V);
|
|
704
|
+
}, w = (V) => {
|
|
705
|
+
a.resizeCallbacks.push(V);
|
|
709
706
|
};
|
|
710
|
-
|
|
707
|
+
a.cleanupCallbacks.forEach((V) => {
|
|
711
708
|
try {
|
|
712
|
-
|
|
713
|
-
} catch (
|
|
714
|
-
console.error("Error in cleanup callback:",
|
|
709
|
+
V();
|
|
710
|
+
} catch ($) {
|
|
711
|
+
console.error("Error in cleanup callback:", $);
|
|
715
712
|
}
|
|
716
|
-
}),
|
|
717
|
-
uniforms:
|
|
713
|
+
}), a.cleanupCallbacks = [], a.beforeRenderCallbacks = [], a.afterRenderCallbacks = [], a.resizeCallbacks = [], a.fragmentNodeFunc({
|
|
714
|
+
uniforms: a.uniforms ?? {},
|
|
718
715
|
childNode: void 0,
|
|
719
716
|
uvContext: void 0,
|
|
720
|
-
onCleanup:
|
|
721
|
-
onBeforeRender:
|
|
722
|
-
onAfterRender:
|
|
723
|
-
onResize:
|
|
717
|
+
onCleanup: A,
|
|
718
|
+
onBeforeRender: I,
|
|
719
|
+
onAfterRender: x,
|
|
720
|
+
onResize: w,
|
|
724
721
|
canvas: e,
|
|
725
722
|
dimensions: {
|
|
726
723
|
width: z,
|
|
727
|
-
height:
|
|
724
|
+
height: E
|
|
728
725
|
},
|
|
729
726
|
renderer: n
|
|
730
727
|
});
|
|
731
728
|
}
|
|
732
|
-
const
|
|
733
|
-
|
|
734
|
-
}, M = (
|
|
735
|
-
|
|
736
|
-
},
|
|
737
|
-
|
|
738
|
-
}, y = (
|
|
739
|
-
|
|
729
|
+
const m = (g) => {
|
|
730
|
+
v.cleanupCallbacks.push(g);
|
|
731
|
+
}, M = (g) => {
|
|
732
|
+
v.beforeRenderCallbacks.push(g);
|
|
733
|
+
}, F = (g) => {
|
|
734
|
+
v.afterRenderCallbacks.push(g);
|
|
735
|
+
}, y = (g) => {
|
|
736
|
+
v.resizeCallbacks.push(g);
|
|
740
737
|
};
|
|
741
|
-
|
|
738
|
+
v.cleanupCallbacks.forEach((g) => {
|
|
742
739
|
try {
|
|
743
|
-
|
|
744
|
-
} catch (
|
|
745
|
-
console.error("Error in cleanup callback:",
|
|
740
|
+
g();
|
|
741
|
+
} catch (a) {
|
|
742
|
+
console.error("Error in cleanup callback:", a);
|
|
746
743
|
}
|
|
747
|
-
}),
|
|
748
|
-
const
|
|
749
|
-
uniforms:
|
|
744
|
+
}), v.cleanupCallbacks = [], v.beforeRenderCallbacks = [], v.afterRenderCallbacks = [], v.resizeCallbacks = [];
|
|
745
|
+
const C = v.fragmentNodeFunc({
|
|
746
|
+
uniforms: v.uniforms ?? {},
|
|
750
747
|
childNode: void 0,
|
|
751
|
-
uvContext:
|
|
752
|
-
onCleanup:
|
|
748
|
+
uvContext: b,
|
|
749
|
+
onCleanup: m,
|
|
753
750
|
onBeforeRender: M,
|
|
754
|
-
onAfterRender:
|
|
751
|
+
onAfterRender: F,
|
|
755
752
|
onResize: y,
|
|
756
753
|
canvas: e,
|
|
757
754
|
dimensions: {
|
|
758
755
|
width: z,
|
|
759
|
-
height:
|
|
756
|
+
height: E
|
|
760
757
|
},
|
|
761
758
|
renderer: n
|
|
762
759
|
});
|
|
763
|
-
for (const
|
|
764
|
-
return
|
|
765
|
-
},
|
|
766
|
-
if (
|
|
767
|
-
const
|
|
768
|
-
let
|
|
769
|
-
if (
|
|
770
|
-
else
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
760
|
+
for (const g of f) if (g.uniforms.edges?.uniform) return be(b, C, null, g.uniforms.edges.uniform);
|
|
761
|
+
return C;
|
|
762
|
+
}, Ve = (i, r, o) => {
|
|
763
|
+
if (i.length === 0) return S(0, 0, 0, 0);
|
|
764
|
+
const f = An(i);
|
|
765
|
+
let s;
|
|
766
|
+
if (f) s = W(f.id, r, o);
|
|
767
|
+
else {
|
|
768
|
+
const F = i[i.length - 1];
|
|
769
|
+
if (Y(F.id).length === 0) return S(0, 0, 0, 0);
|
|
770
|
+
s = W(F.id, r, o);
|
|
771
|
+
}
|
|
772
|
+
const v = Te(s);
|
|
773
|
+
let b = ge;
|
|
774
|
+
for (let F = i.length - 1; F >= 0; F--) {
|
|
775
|
+
const y = i[F];
|
|
776
|
+
y.uvTransformFunc && (b = y.uvTransformFunc({
|
|
777
|
+
uv: b,
|
|
777
778
|
uniforms: y.uniforms,
|
|
778
|
-
viewportSize:
|
|
779
|
-
}), y.uniforms.edges?.uniform && (
|
|
779
|
+
viewportSize: we
|
|
780
|
+
}), y.uniforms.edges?.uniform && (b = se(b, y.uniforms.edges.uniform))), o && o.add(y.id);
|
|
780
781
|
}
|
|
781
|
-
const
|
|
782
|
-
return M.uniforms.edges?.uniform ?
|
|
783
|
-
},
|
|
782
|
+
const m = v.sample(b), M = i[0];
|
|
783
|
+
return M.uniforms.edges?.uniform ? be(b, m, v, M.uniforms.edges.uniform) : m;
|
|
784
|
+
}, He = (i, r) => {
|
|
784
785
|
const o = [];
|
|
785
|
-
for (let
|
|
786
|
-
const
|
|
787
|
-
if (!H(
|
|
788
|
-
o.push(
|
|
786
|
+
for (let f = r; f < i.length; f++) {
|
|
787
|
+
const s = i[f];
|
|
788
|
+
if (!H(s) || Y(s.id).length > 0) break;
|
|
789
|
+
o.push(s);
|
|
789
790
|
}
|
|
790
791
|
return o;
|
|
791
|
-
},
|
|
792
|
-
if (
|
|
793
|
-
const
|
|
794
|
-
let
|
|
795
|
-
for (let
|
|
796
|
-
const M =
|
|
797
|
-
M.uvTransformFunc && (
|
|
798
|
-
uv:
|
|
792
|
+
}, Ie = (i, r, o) => {
|
|
793
|
+
if (i.length === 0) return r;
|
|
794
|
+
const f = Te(r);
|
|
795
|
+
let s = ge;
|
|
796
|
+
for (let m = i.length - 1; m >= 0; m--) {
|
|
797
|
+
const M = i[m];
|
|
798
|
+
M.uvTransformFunc && (s = M.uvTransformFunc({
|
|
799
|
+
uv: s,
|
|
799
800
|
uniforms: M.uniforms,
|
|
800
|
-
viewportSize:
|
|
801
|
-
}), M.uniforms.edges?.uniform && (
|
|
801
|
+
viewportSize: we
|
|
802
|
+
}), M.uniforms.edges?.uniform && (s = se(s, M.uniforms.edges.uniform))), o && o.add(M.id);
|
|
802
803
|
}
|
|
803
|
-
const
|
|
804
|
-
return
|
|
805
|
-
},
|
|
806
|
-
const
|
|
807
|
-
let
|
|
808
|
-
for (let
|
|
809
|
-
const
|
|
810
|
-
|
|
804
|
+
const v = f.sample(s), b = i[i.length - 1];
|
|
805
|
+
return b.uniforms.edges?.uniform ? be(s, v, f, b.uniforms.edges.uniform) : v;
|
|
806
|
+
}, We = (i) => {
|
|
807
|
+
const r = [], o = [];
|
|
808
|
+
let f = !1;
|
|
809
|
+
for (let b = 0; b < i.length; b++) {
|
|
810
|
+
const m = i[b], M = Y(m.id).length > 0;
|
|
811
|
+
m.acceptsUVContext && !m.requiresChild && r.push(b), H(m) && !M && (o.push(b), r.length > 0 && (f = !0));
|
|
811
812
|
}
|
|
812
|
-
if (
|
|
813
|
-
const
|
|
814
|
-
for (let
|
|
815
|
-
const
|
|
816
|
-
if (
|
|
813
|
+
if (r.length === 0 || o.length === 0 || !f) return !1;
|
|
814
|
+
const s = Math.min(...r), v = Math.max(...o);
|
|
815
|
+
for (let b = s + 1; b < v; b++) {
|
|
816
|
+
const m = i[b];
|
|
817
|
+
if (m.requiresRTT && !H(m) && !(m.acceptsUVContext && !m.requiresChild)) return !1;
|
|
817
818
|
}
|
|
818
|
-
return o.length > 2
|
|
819
|
-
},
|
|
820
|
-
const
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
node: y,
|
|
830
|
-
index: u
|
|
819
|
+
return !(o.length > 2);
|
|
820
|
+
}, je = (i, r, o) => {
|
|
821
|
+
const f = [], s = [];
|
|
822
|
+
i.forEach((b, m) => {
|
|
823
|
+
const M = Y(b.id).length > 0;
|
|
824
|
+
H(b) && !M ? s.push({
|
|
825
|
+
node: b,
|
|
826
|
+
index: m
|
|
827
|
+
}) : b.acceptsUVContext && !b.requiresChild && !M && f.push({
|
|
828
|
+
node: b,
|
|
829
|
+
index: m
|
|
831
830
|
});
|
|
832
|
-
})
|
|
833
|
-
const
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
u.cleanupCallbacks.forEach((T) => {
|
|
831
|
+
});
|
|
832
|
+
for (const b of s) {
|
|
833
|
+
const m = b.node;
|
|
834
|
+
m.cleanupCallbacks.forEach((g) => {
|
|
837
835
|
try {
|
|
838
|
-
|
|
839
|
-
} catch (
|
|
840
|
-
console.error("Cleanup error:",
|
|
836
|
+
g();
|
|
837
|
+
} catch (a) {
|
|
838
|
+
console.error("Cleanup error:", a);
|
|
841
839
|
}
|
|
842
|
-
}),
|
|
843
|
-
const
|
|
844
|
-
|
|
845
|
-
uniforms:
|
|
840
|
+
}), m.cleanupCallbacks = [], m.beforeRenderCallbacks = [], m.afterRenderCallbacks = [], m.resizeCallbacks = [];
|
|
841
|
+
const M = (g) => m.cleanupCallbacks.push(g), F = (g) => m.beforeRenderCallbacks.push(g), y = (g) => m.afterRenderCallbacks.push(g), C = (g) => m.resizeCallbacks.push(g);
|
|
842
|
+
m.fragmentNodeFunc({
|
|
843
|
+
uniforms: m.uniforms ?? {},
|
|
846
844
|
childNode: void 0,
|
|
847
845
|
uvContext: void 0,
|
|
848
|
-
onCleanup:
|
|
849
|
-
onBeforeRender:
|
|
850
|
-
onAfterRender:
|
|
851
|
-
onResize:
|
|
846
|
+
onCleanup: M,
|
|
847
|
+
onBeforeRender: F,
|
|
848
|
+
onAfterRender: y,
|
|
849
|
+
onResize: C,
|
|
852
850
|
canvas: e,
|
|
853
851
|
dimensions: {
|
|
854
852
|
width: z,
|
|
855
|
-
height:
|
|
853
|
+
height: E
|
|
856
854
|
},
|
|
857
855
|
renderer: n
|
|
858
|
-
}), o && o.add(
|
|
856
|
+
}), o && o.add(m.id);
|
|
859
857
|
}
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
const
|
|
865
|
-
|
|
866
|
-
const
|
|
867
|
-
|
|
868
|
-
const
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
viewportSize: ye
|
|
880
|
-
})), q.transformUniforms && q.metadata.transform && fe(q.metadata.transform) && (S = Ue(S, q.transformUniforms.offsetX, q.transformUniforms.offsetY, q.transformUniforms.rotation, q.transformUniforms.scale, q.transformUniforms.anchorX, q.transformUniforms.anchorY, q.transformUniforms.aspectRatio), q.transformUniforms.edges && (S = ce(S, q.transformUniforms.edges)), q.transformRTTActive = !0), q.uniforms.edges?.uniform && (S = ce(S, q.uniforms.edges.uniform));
|
|
858
|
+
let v;
|
|
859
|
+
for (let b = 0; b < i.length; b++) {
|
|
860
|
+
const m = i[b];
|
|
861
|
+
if (m.metadata.visible === !1) continue;
|
|
862
|
+
const M = m.metadata.opacity ?? 1;
|
|
863
|
+
m.opacityUniform.value = M, o && o.add(m.id);
|
|
864
|
+
const F = Y(m.id).length > 0;
|
|
865
|
+
let y;
|
|
866
|
+
const C = f.find((g) => g.index === b);
|
|
867
|
+
if (C) {
|
|
868
|
+
const g = s.filter(($) => $.index > C.index).sort(($, O) => $.index - O.index).map(($) => $.node);
|
|
869
|
+
let a = ge;
|
|
870
|
+
for (let $ = g.length - 1; $ >= 0; $--) {
|
|
871
|
+
const O = g[$];
|
|
872
|
+
O.uvTransformFunc && (a = O.uvTransformFunc({
|
|
873
|
+
uv: a,
|
|
874
|
+
uniforms: O.uniforms,
|
|
875
|
+
viewportSize: we
|
|
876
|
+
})), O.transformUniforms && O.metadata.transform && oe(O.metadata.transform) && (a = Se(a, O.transformUniforms.offsetX, O.transformUniforms.offsetY, O.transformUniforms.rotation, O.transformUniforms.scale, O.transformUniforms.anchorX, O.transformUniforms.anchorY, O.transformUniforms.aspectRatio), O.transformUniforms.edges && (a = se(a, O.transformUniforms.edges)), O.transformRTTActive = !0), O.uniforms.edges?.uniform && (a = se(a, O.uniforms.edges.uniform));
|
|
881
877
|
}
|
|
882
|
-
|
|
878
|
+
C.node.transformUniforms && C.node.metadata.transform && oe(C.node.metadata.transform) && (a = Se(a, C.node.transformUniforms.offsetX, C.node.transformUniforms.offsetY, C.node.transformUniforms.rotation, C.node.transformUniforms.scale, C.node.transformUniforms.anchorX, C.node.transformUniforms.anchorY, C.node.transformUniforms.aspectRatio), C.node.transformUniforms.edges && (a = se(a, C.node.transformUniforms.edges)), C.node.transformRTTActive = !0), m.cleanupCallbacks.forEach(($) => {
|
|
883
879
|
try {
|
|
884
|
-
|
|
885
|
-
} catch (
|
|
886
|
-
console.error("Cleanup error:",
|
|
880
|
+
$();
|
|
881
|
+
} catch (O) {
|
|
882
|
+
console.error("Cleanup error:", O);
|
|
887
883
|
}
|
|
888
|
-
}),
|
|
889
|
-
const
|
|
890
|
-
let
|
|
891
|
-
uniforms:
|
|
884
|
+
}), m.cleanupCallbacks = [], m.beforeRenderCallbacks = [], m.afterRenderCallbacks = [], m.resizeCallbacks = [];
|
|
885
|
+
const A = ($) => m.cleanupCallbacks.push($), I = ($) => m.beforeRenderCallbacks.push($), x = ($) => m.afterRenderCallbacks.push($), w = ($) => m.resizeCallbacks.push($);
|
|
886
|
+
let V = m.fragmentNodeFunc({
|
|
887
|
+
uniforms: m.uniforms ?? {},
|
|
892
888
|
childNode: void 0,
|
|
893
|
-
uvContext:
|
|
894
|
-
onCleanup:
|
|
895
|
-
onBeforeRender:
|
|
896
|
-
onAfterRender:
|
|
897
|
-
onResize:
|
|
889
|
+
uvContext: a,
|
|
890
|
+
onCleanup: A,
|
|
891
|
+
onBeforeRender: I,
|
|
892
|
+
onAfterRender: x,
|
|
893
|
+
onResize: w,
|
|
898
894
|
canvas: e,
|
|
899
895
|
dimensions: {
|
|
900
896
|
width: z,
|
|
901
|
-
height:
|
|
897
|
+
height: E
|
|
902
898
|
},
|
|
903
899
|
renderer: n
|
|
904
900
|
});
|
|
905
|
-
if (
|
|
906
|
-
const
|
|
907
|
-
|
|
901
|
+
if (g.length > 0) {
|
|
902
|
+
const $ = g[0];
|
|
903
|
+
$.uniforms.edges?.uniform && (V = be(a, V, null, $.uniforms.edges.uniform));
|
|
908
904
|
}
|
|
909
|
-
|
|
905
|
+
y = ee(V, m, m.id, r, a);
|
|
910
906
|
} else {
|
|
911
|
-
if (
|
|
912
|
-
if (
|
|
913
|
-
if (
|
|
914
|
-
else if (H(
|
|
915
|
-
const
|
|
916
|
-
|
|
917
|
-
} else
|
|
918
|
-
const
|
|
919
|
-
if (
|
|
920
|
-
const
|
|
921
|
-
let
|
|
922
|
-
for (let
|
|
923
|
-
const
|
|
924
|
-
|
|
925
|
-
uv:
|
|
926
|
-
uniforms:
|
|
927
|
-
viewportSize:
|
|
928
|
-
})),
|
|
907
|
+
if (s.find((g) => g.index === b)) continue;
|
|
908
|
+
if (F) {
|
|
909
|
+
if (ke(m)) y = _e(m.id, r, o);
|
|
910
|
+
else if (H(m)) {
|
|
911
|
+
const a = Be(m.id);
|
|
912
|
+
a.length > 1 ? y = Ve(a, r, o) : y = W(m.id, r, o);
|
|
913
|
+
} else y = W(m.id, r, o);
|
|
914
|
+
const g = s.filter((a) => a.index > b).sort((a, A) => a.index - A.index).map((a) => a.node);
|
|
915
|
+
if (g.length > 0) {
|
|
916
|
+
const a = Te(y);
|
|
917
|
+
let A = ge;
|
|
918
|
+
for (let x = g.length - 1; x >= 0; x--) {
|
|
919
|
+
const w = g[x];
|
|
920
|
+
w.uvTransformFunc && (A = w.uvTransformFunc({
|
|
921
|
+
uv: A,
|
|
922
|
+
uniforms: w.uniforms,
|
|
923
|
+
viewportSize: we
|
|
924
|
+
})), w.transformUniforms && w.metadata.transform && oe(w.metadata.transform) && (A = Se(A, w.transformUniforms.offsetX, w.transformUniforms.offsetY, w.transformUniforms.rotation, w.transformUniforms.scale, w.transformUniforms.anchorX, w.transformUniforms.anchorY, w.transformUniforms.aspectRatio), w.transformUniforms.edges && (A = se(A, w.transformUniforms.edges)), w.transformRTTActive = !0), w.uniforms.edges?.uniform && (A = se(A, w.uniforms.edges.uniform));
|
|
929
925
|
}
|
|
930
|
-
|
|
931
|
-
const
|
|
932
|
-
|
|
926
|
+
y = a.sample(A);
|
|
927
|
+
const I = g[g.length - 1];
|
|
928
|
+
I.transformUniforms?.edges && (y = be(A, y, a, I.transformUniforms.edges));
|
|
933
929
|
}
|
|
934
930
|
} else {
|
|
935
|
-
|
|
931
|
+
m.cleanupCallbacks.forEach((w) => {
|
|
936
932
|
try {
|
|
937
|
-
|
|
938
|
-
} catch (
|
|
939
|
-
console.error("Cleanup error:",
|
|
933
|
+
w();
|
|
934
|
+
} catch (V) {
|
|
935
|
+
console.error("Cleanup error:", V);
|
|
940
936
|
}
|
|
941
|
-
}),
|
|
942
|
-
const
|
|
943
|
-
let
|
|
944
|
-
|
|
945
|
-
uniforms:
|
|
946
|
-
childNode:
|
|
947
|
-
onCleanup:
|
|
948
|
-
onBeforeRender:
|
|
949
|
-
onAfterRender:
|
|
950
|
-
onResize:
|
|
937
|
+
}), m.cleanupCallbacks = [], m.beforeRenderCallbacks = [], m.afterRenderCallbacks = [], m.resizeCallbacks = [];
|
|
938
|
+
const g = (w) => m.cleanupCallbacks.push(w), a = (w) => m.beforeRenderCallbacks.push(w), A = (w) => m.afterRenderCallbacks.push(w), I = (w) => m.resizeCallbacks.push(w);
|
|
939
|
+
let x = v;
|
|
940
|
+
m.requiresRTT && v !== void 0 && (x = j(S(0, 0, 0, 0), v, "normal", 1)), y = ee(re(m.fragmentNodeFunc({
|
|
941
|
+
uniforms: m.uniforms ?? {},
|
|
942
|
+
childNode: x,
|
|
943
|
+
onCleanup: g,
|
|
944
|
+
onBeforeRender: a,
|
|
945
|
+
onAfterRender: A,
|
|
946
|
+
onResize: I,
|
|
951
947
|
canvas: e,
|
|
952
948
|
dimensions: {
|
|
953
949
|
width: z,
|
|
954
|
-
height:
|
|
950
|
+
height: E
|
|
955
951
|
},
|
|
956
952
|
renderer: n
|
|
957
|
-
}),
|
|
953
|
+
}), m), m, m.id, r);
|
|
958
954
|
}
|
|
959
955
|
}
|
|
960
|
-
|
|
956
|
+
m.requiresChild && m.metadata.blendMode === "normal" && !F ? v = j(S(0, 0, 0, 0), y, "normal", m.opacityUniform) : v === void 0 ? v = j(S(1, 1, 1, 0), y, m.metadata.blendMode, m.opacityUniform) : v = j(v, y, m.metadata.blendMode, m.opacityUniform);
|
|
961
957
|
}
|
|
962
|
-
return
|
|
963
|
-
},
|
|
964
|
-
if (z === 0 ||
|
|
965
|
-
const
|
|
966
|
-
if (!
|
|
967
|
-
const
|
|
968
|
-
|
|
969
|
-
},
|
|
970
|
-
|
|
971
|
-
},
|
|
972
|
-
|
|
958
|
+
return v ?? S(0, 0, 0, 0);
|
|
959
|
+
}, W = (i, r = /* @__PURE__ */ new Set(), o, f = !1) => {
|
|
960
|
+
if (z === 0 || E === 0) return S(0, 0, 0, 0);
|
|
961
|
+
const s = h.nodes.get(i);
|
|
962
|
+
if (!s) return S(0, 0, 0, 0);
|
|
963
|
+
const v = (y) => {
|
|
964
|
+
s.cleanupCallbacks.push(y);
|
|
965
|
+
}, b = (y) => {
|
|
966
|
+
s.beforeRenderCallbacks.push(y);
|
|
967
|
+
}, m = (y) => {
|
|
968
|
+
s.afterRenderCallbacks.push(y);
|
|
973
969
|
}, M = (y) => {
|
|
974
|
-
|
|
975
|
-
},
|
|
976
|
-
if (
|
|
977
|
-
return
|
|
970
|
+
s.resizeCallbacks.push(y);
|
|
971
|
+
}, F = Y(i);
|
|
972
|
+
if (F.length === 0)
|
|
973
|
+
return s.requiresRTT && !ne ? S(0, 0, 0, 0) : (s.cleanupCallbacks.forEach((y) => {
|
|
978
974
|
try {
|
|
979
975
|
y();
|
|
980
|
-
} catch (
|
|
981
|
-
console.error("Error in cleanup callback:",
|
|
976
|
+
} catch (C) {
|
|
977
|
+
console.error("Error in cleanup callback:", C);
|
|
982
978
|
}
|
|
983
|
-
}),
|
|
984
|
-
uniforms:
|
|
979
|
+
}), s.cleanupCallbacks = [], s.beforeRenderCallbacks = [], s.afterRenderCallbacks = [], s.resizeCallbacks = [], ee(re(s.fragmentNodeFunc({
|
|
980
|
+
uniforms: s.uniforms ?? {},
|
|
985
981
|
childNode: void 0,
|
|
986
|
-
onCleanup:
|
|
987
|
-
onBeforeRender:
|
|
988
|
-
onAfterRender:
|
|
982
|
+
onCleanup: v,
|
|
983
|
+
onBeforeRender: b,
|
|
984
|
+
onAfterRender: m,
|
|
989
985
|
onResize: M,
|
|
990
986
|
canvas: e,
|
|
991
987
|
dimensions: {
|
|
992
988
|
width: z,
|
|
993
|
-
height:
|
|
989
|
+
height: E
|
|
994
990
|
},
|
|
995
991
|
renderer: n
|
|
996
|
-
}),
|
|
992
|
+
}), s), s, i, r));
|
|
997
993
|
{
|
|
998
|
-
const y = [...
|
|
999
|
-
if (
|
|
1000
|
-
if (!
|
|
1001
|
-
let
|
|
1002
|
-
for (let
|
|
1003
|
-
const
|
|
1004
|
-
let
|
|
1005
|
-
if (
|
|
1006
|
-
o && o.add(
|
|
1007
|
-
const
|
|
1008
|
-
let
|
|
1009
|
-
if (
|
|
1010
|
-
else if (
|
|
1011
|
-
else if (H(
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1014
|
-
} else
|
|
994
|
+
const y = [...F].sort((C, g) => C.metadata.renderOrder - g.metadata.renderOrder);
|
|
995
|
+
if (s.parentId === null) {
|
|
996
|
+
if (!f && We(y)) return ee(re(je(y, r, o), s), s, i, r);
|
|
997
|
+
let C;
|
|
998
|
+
for (let g = 0; g < y.length; g++) {
|
|
999
|
+
const a = y[g];
|
|
1000
|
+
let A;
|
|
1001
|
+
if (a.metadata.opacity === void 0 ? (A = 1, a.opacityUniform.value = A) : (A = a.metadata.opacity, a.opacityUniform.value = A), a.metadata.visible === !1) continue;
|
|
1002
|
+
o && o.add(a.id);
|
|
1003
|
+
const I = Y(a.id).length > 0;
|
|
1004
|
+
let x;
|
|
1005
|
+
if (I) if (f) x = W(a.id, r, o, !0);
|
|
1006
|
+
else if (ke(a)) x = _e(a.id, r, o);
|
|
1007
|
+
else if (H(a)) {
|
|
1008
|
+
const w = Be(a.id);
|
|
1009
|
+
w.length > 1 ? x = Ve(w, r, o) : x = W(a.id, r, o);
|
|
1010
|
+
} else x = W(a.id, r, o);
|
|
1015
1011
|
else {
|
|
1016
|
-
if (H(
|
|
1017
|
-
const
|
|
1018
|
-
if (
|
|
1019
|
-
|
|
1012
|
+
if (H(a) && a.requiresChild && C !== void 0) {
|
|
1013
|
+
const w = He(y, g);
|
|
1014
|
+
if (w.length > 1) {
|
|
1015
|
+
x = Ie(w, C, o), g += w.length - 1, C = x;
|
|
1020
1016
|
continue;
|
|
1021
1017
|
}
|
|
1022
1018
|
}
|
|
1023
|
-
if (
|
|
1019
|
+
if (a.requiresRTT && !ne) x = S(0, 0, 0, 0);
|
|
1024
1020
|
else {
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1027
|
-
},
|
|
1028
|
-
|
|
1029
|
-
},
|
|
1030
|
-
|
|
1031
|
-
},
|
|
1032
|
-
|
|
1021
|
+
const w = (q) => {
|
|
1022
|
+
a.cleanupCallbacks.push(q);
|
|
1023
|
+
}, V = (q) => {
|
|
1024
|
+
a.beforeRenderCallbacks.push(q);
|
|
1025
|
+
}, $ = (q) => {
|
|
1026
|
+
a.afterRenderCallbacks.push(q);
|
|
1027
|
+
}, O = (q) => {
|
|
1028
|
+
a.resizeCallbacks.push(q);
|
|
1033
1029
|
};
|
|
1034
|
-
let
|
|
1035
|
-
|
|
1030
|
+
let ye = C;
|
|
1031
|
+
a.requiresRTT && C !== void 0 && (ye = j(S(0, 0, 0, 0), C, "normal", 1)), a.cleanupCallbacks.forEach((q) => {
|
|
1036
1032
|
try {
|
|
1037
|
-
|
|
1038
|
-
} catch (
|
|
1039
|
-
console.error("Error in cleanup callback:",
|
|
1033
|
+
q();
|
|
1034
|
+
} catch (Pn) {
|
|
1035
|
+
console.error("Error in cleanup callback:", Pn);
|
|
1040
1036
|
}
|
|
1041
|
-
}),
|
|
1042
|
-
uniforms:
|
|
1043
|
-
childNode:
|
|
1044
|
-
onCleanup:
|
|
1045
|
-
onBeforeRender:
|
|
1046
|
-
onAfterRender:
|
|
1047
|
-
onResize:
|
|
1037
|
+
}), a.cleanupCallbacks = [], a.beforeRenderCallbacks = [], a.afterRenderCallbacks = [], a.resizeCallbacks = [], x = ee(re(a.fragmentNodeFunc({
|
|
1038
|
+
uniforms: a.uniforms ?? {},
|
|
1039
|
+
childNode: ye,
|
|
1040
|
+
onCleanup: w,
|
|
1041
|
+
onBeforeRender: V,
|
|
1042
|
+
onAfterRender: $,
|
|
1043
|
+
onResize: O,
|
|
1048
1044
|
canvas: e,
|
|
1049
1045
|
dimensions: {
|
|
1050
1046
|
width: z,
|
|
1051
|
-
height:
|
|
1047
|
+
height: E
|
|
1052
1048
|
},
|
|
1053
1049
|
renderer: n
|
|
1054
|
-
}),
|
|
1050
|
+
}), a), a, a.id, r);
|
|
1055
1051
|
}
|
|
1056
1052
|
}
|
|
1057
|
-
|
|
1053
|
+
a.requiresChild && a.metadata.blendMode === "normal" && !I ? C = j(S(0, 0, 0, 0), x, "normal", a.opacityUniform) : C === void 0 ? s.requiresRTT || A !== 1 ? C = j(S(1, 1, 1, 0), x, a.metadata.blendMode, a.opacityUniform) : C = x : C = j(C, x, a.metadata.blendMode, a.opacityUniform);
|
|
1058
1054
|
}
|
|
1059
|
-
return
|
|
1055
|
+
return s.requiresRTT && !ne ? S(0, 0, 0, 0) : (s.cleanupCallbacks.forEach((g) => {
|
|
1060
1056
|
try {
|
|
1061
|
-
|
|
1062
|
-
} catch (
|
|
1063
|
-
console.error("Error in cleanup callback:",
|
|
1057
|
+
g();
|
|
1058
|
+
} catch (a) {
|
|
1059
|
+
console.error("Error in cleanup callback:", a);
|
|
1064
1060
|
}
|
|
1065
|
-
}),
|
|
1066
|
-
uniforms:
|
|
1067
|
-
childNode:
|
|
1068
|
-
onCleanup:
|
|
1069
|
-
onBeforeRender:
|
|
1070
|
-
onAfterRender:
|
|
1061
|
+
}), s.cleanupCallbacks = [], s.beforeRenderCallbacks = [], s.afterRenderCallbacks = [], s.resizeCallbacks = [], ee(re(s.fragmentNodeFunc({
|
|
1062
|
+
uniforms: s.uniforms ?? {},
|
|
1063
|
+
childNode: C,
|
|
1064
|
+
onCleanup: v,
|
|
1065
|
+
onBeforeRender: b,
|
|
1066
|
+
onAfterRender: m,
|
|
1071
1067
|
onResize: M,
|
|
1072
1068
|
canvas: e,
|
|
1073
1069
|
dimensions: {
|
|
1074
1070
|
width: z,
|
|
1075
|
-
height:
|
|
1071
|
+
height: E
|
|
1076
1072
|
},
|
|
1077
1073
|
renderer: n
|
|
1078
|
-
}),
|
|
1074
|
+
}), s), s, i, r));
|
|
1079
1075
|
} else {
|
|
1080
|
-
if (!
|
|
1081
|
-
const
|
|
1082
|
-
return
|
|
1083
|
-
uniforms:
|
|
1084
|
-
childNode:
|
|
1085
|
-
onCleanup:
|
|
1086
|
-
onBeforeRender:
|
|
1087
|
-
onAfterRender:
|
|
1076
|
+
if (!f && We(y)) {
|
|
1077
|
+
const g = je(y, r, o);
|
|
1078
|
+
return ee(re(s.fragmentNodeFunc({
|
|
1079
|
+
uniforms: s.uniforms ?? {},
|
|
1080
|
+
childNode: g,
|
|
1081
|
+
onCleanup: v,
|
|
1082
|
+
onBeforeRender: b,
|
|
1083
|
+
onAfterRender: m,
|
|
1088
1084
|
onResize: M,
|
|
1089
1085
|
canvas: e,
|
|
1090
1086
|
dimensions: {
|
|
1091
1087
|
width: z,
|
|
1092
|
-
height:
|
|
1088
|
+
height: E
|
|
1093
1089
|
},
|
|
1094
1090
|
renderer: n
|
|
1095
|
-
}),
|
|
1091
|
+
}), s), s, i, r);
|
|
1096
1092
|
}
|
|
1097
|
-
let
|
|
1098
|
-
for (let
|
|
1099
|
-
const
|
|
1100
|
-
let
|
|
1101
|
-
if (
|
|
1102
|
-
o && o.add(
|
|
1103
|
-
const
|
|
1104
|
-
let
|
|
1105
|
-
if (
|
|
1106
|
-
else if (
|
|
1107
|
-
else if (H(
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1110
|
-
} else
|
|
1093
|
+
let C;
|
|
1094
|
+
for (let g = 0; g < y.length; g++) {
|
|
1095
|
+
const a = y[g];
|
|
1096
|
+
let A;
|
|
1097
|
+
if (a.metadata.opacity === void 0 ? (A = 1, a.opacityUniform.value = A) : (A = a.metadata.opacity, a.opacityUniform.value = A), a.metadata.visible === !1) continue;
|
|
1098
|
+
o && o.add(a.id);
|
|
1099
|
+
const I = Y(a.id).length > 0;
|
|
1100
|
+
let x;
|
|
1101
|
+
if (I) if (f) x = W(a.id, r, o, !0);
|
|
1102
|
+
else if (ke(a)) x = _e(a.id, r, o);
|
|
1103
|
+
else if (H(a)) {
|
|
1104
|
+
const w = Be(a.id);
|
|
1105
|
+
w.length > 1 ? x = Ve(w, r, o) : x = W(a.id, r, o);
|
|
1106
|
+
} else x = W(a.id, r, o);
|
|
1111
1107
|
else {
|
|
1112
|
-
if (H(
|
|
1113
|
-
const
|
|
1114
|
-
if (
|
|
1115
|
-
|
|
1108
|
+
if (H(a) && a.requiresChild && C !== void 0) {
|
|
1109
|
+
const w = He(y, g);
|
|
1110
|
+
if (w.length > 1) {
|
|
1111
|
+
x = Ie(w, C, o), g += w.length - 1, C = x;
|
|
1116
1112
|
continue;
|
|
1117
1113
|
}
|
|
1118
1114
|
}
|
|
1119
|
-
if (
|
|
1115
|
+
if (a.requiresRTT && !ne) x = S(0, 0, 0, 0);
|
|
1120
1116
|
else {
|
|
1121
|
-
const
|
|
1122
|
-
|
|
1123
|
-
},
|
|
1124
|
-
|
|
1125
|
-
},
|
|
1126
|
-
|
|
1127
|
-
},
|
|
1128
|
-
|
|
1117
|
+
const w = (q) => {
|
|
1118
|
+
a.cleanupCallbacks.push(q);
|
|
1119
|
+
}, V = (q) => {
|
|
1120
|
+
a.beforeRenderCallbacks.push(q);
|
|
1121
|
+
}, $ = (q) => {
|
|
1122
|
+
a.afterRenderCallbacks.push(q);
|
|
1123
|
+
}, O = (q) => {
|
|
1124
|
+
a.resizeCallbacks.push(q);
|
|
1129
1125
|
};
|
|
1130
|
-
let
|
|
1131
|
-
|
|
1132
|
-
uniforms:
|
|
1133
|
-
childNode:
|
|
1134
|
-
onCleanup:
|
|
1135
|
-
onBeforeRender:
|
|
1136
|
-
onAfterRender:
|
|
1137
|
-
onResize:
|
|
1126
|
+
let ye = C;
|
|
1127
|
+
a.requiresRTT && C !== void 0 && (ye = j(S(0, 0, 0, 0), C, "normal", 1)), a.cleanupCallbacks = [], a.beforeRenderCallbacks = [], a.afterRenderCallbacks = [], a.resizeCallbacks = [], x = ee(re(a.fragmentNodeFunc({
|
|
1128
|
+
uniforms: a.uniforms ?? {},
|
|
1129
|
+
childNode: ye,
|
|
1130
|
+
onCleanup: w,
|
|
1131
|
+
onBeforeRender: V,
|
|
1132
|
+
onAfterRender: $,
|
|
1133
|
+
onResize: O,
|
|
1138
1134
|
canvas: e,
|
|
1139
1135
|
dimensions: {
|
|
1140
1136
|
width: z,
|
|
1141
|
-
height:
|
|
1137
|
+
height: E
|
|
1142
1138
|
},
|
|
1143
1139
|
renderer: n
|
|
1144
|
-
}),
|
|
1140
|
+
}), a), a, a.id, r);
|
|
1145
1141
|
}
|
|
1146
1142
|
}
|
|
1147
|
-
|
|
1143
|
+
a.requiresChild && a.metadata.blendMode === "normal" && !I ? C = j(S(0, 0, 0, 0), x, "normal", a.opacityUniform) : C === void 0 ? s.requiresRTT || A !== 1 ? C = j(S(1, 1, 1, 0), x, a.metadata.blendMode, a.opacityUniform) : C = x : C = j(C, x, a.metadata.blendMode, a.opacityUniform);
|
|
1148
1144
|
}
|
|
1149
|
-
return
|
|
1145
|
+
return s.requiresRTT && !ne ? S(0, 0, 0, 0) : (s.cleanupCallbacks.forEach((g) => {
|
|
1150
1146
|
try {
|
|
1151
|
-
|
|
1152
|
-
} catch (
|
|
1153
|
-
console.error("Error in cleanup callback:",
|
|
1147
|
+
g();
|
|
1148
|
+
} catch (a) {
|
|
1149
|
+
console.error("Error in cleanup callback:", a);
|
|
1154
1150
|
}
|
|
1155
|
-
}),
|
|
1156
|
-
uniforms:
|
|
1157
|
-
childNode:
|
|
1158
|
-
onCleanup:
|
|
1159
|
-
onBeforeRender:
|
|
1160
|
-
onAfterRender:
|
|
1151
|
+
}), s.cleanupCallbacks = [], s.beforeRenderCallbacks = [], s.afterRenderCallbacks = [], s.resizeCallbacks = [], ee(re(s.fragmentNodeFunc({
|
|
1152
|
+
uniforms: s.uniforms ?? {},
|
|
1153
|
+
childNode: C,
|
|
1154
|
+
onCleanup: v,
|
|
1155
|
+
onBeforeRender: b,
|
|
1156
|
+
onAfterRender: m,
|
|
1161
1157
|
onResize: M,
|
|
1162
1158
|
canvas: e,
|
|
1163
1159
|
dimensions: {
|
|
1164
1160
|
width: z,
|
|
1165
|
-
height:
|
|
1161
|
+
height: E
|
|
1166
1162
|
},
|
|
1167
1163
|
renderer: n
|
|
1168
|
-
}),
|
|
1164
|
+
}), s), s, i, r));
|
|
1169
1165
|
}
|
|
1170
1166
|
}
|
|
1171
|
-
},
|
|
1172
|
-
if (
|
|
1173
|
-
const
|
|
1174
|
-
if (
|
|
1175
|
-
|
|
1167
|
+
}, an = (i, r, o, f, s = {}, v) => {
|
|
1168
|
+
if (r === null) {
|
|
1169
|
+
const C = te.findIndex((g) => g.id === i);
|
|
1170
|
+
if (C !== -1) {
|
|
1171
|
+
te.splice(C, 1);
|
|
1176
1172
|
return;
|
|
1177
1173
|
}
|
|
1178
|
-
|
|
1174
|
+
Qe(i);
|
|
1179
1175
|
return;
|
|
1180
1176
|
}
|
|
1181
|
-
if (!
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1184
|
-
id:
|
|
1185
|
-
fragmentNodeFunc:
|
|
1177
|
+
if (!Ne) {
|
|
1178
|
+
const C = te.findIndex((g) => g.id === i);
|
|
1179
|
+
C !== -1 ? te[C] = {
|
|
1180
|
+
id: i,
|
|
1181
|
+
fragmentNodeFunc: r,
|
|
1186
1182
|
parentId: o,
|
|
1187
|
-
metadata:
|
|
1188
|
-
uniforms:
|
|
1189
|
-
componentDefinition:
|
|
1190
|
-
} :
|
|
1191
|
-
id:
|
|
1192
|
-
fragmentNodeFunc:
|
|
1183
|
+
metadata: f,
|
|
1184
|
+
uniforms: s,
|
|
1185
|
+
componentDefinition: v
|
|
1186
|
+
} : te.push({
|
|
1187
|
+
id: i,
|
|
1188
|
+
fragmentNodeFunc: r,
|
|
1193
1189
|
parentId: o,
|
|
1194
|
-
metadata:
|
|
1195
|
-
uniforms:
|
|
1196
|
-
componentDefinition:
|
|
1190
|
+
metadata: f,
|
|
1191
|
+
uniforms: s,
|
|
1192
|
+
componentDefinition: v
|
|
1197
1193
|
});
|
|
1198
1194
|
return;
|
|
1199
1195
|
}
|
|
1200
|
-
let
|
|
1196
|
+
let b = 0;
|
|
1201
1197
|
if (o !== null) {
|
|
1202
|
-
const
|
|
1203
|
-
if (
|
|
1204
|
-
let
|
|
1205
|
-
for (const
|
|
1206
|
-
const
|
|
1207
|
-
|
|
1198
|
+
const C = d.get(o);
|
|
1199
|
+
if (C && C.size > 0) {
|
|
1200
|
+
let g = 0;
|
|
1201
|
+
for (const a of C) {
|
|
1202
|
+
const A = h.nodes.get(a);
|
|
1203
|
+
A && A.metadata.renderOrder > g && (g = A.metadata.renderOrder);
|
|
1208
1204
|
}
|
|
1209
|
-
|
|
1205
|
+
b = g + 1;
|
|
1210
1206
|
}
|
|
1211
1207
|
}
|
|
1212
|
-
const
|
|
1208
|
+
const m = G(f?.opacity !== void 0 ? f.opacity : 1);
|
|
1213
1209
|
let M;
|
|
1214
|
-
if (
|
|
1215
|
-
const
|
|
1210
|
+
if (f?.transform) {
|
|
1211
|
+
const C = z / Math.max(1, E);
|
|
1216
1212
|
M = {
|
|
1217
|
-
offsetX: G(
|
|
1218
|
-
offsetY: G(
|
|
1219
|
-
rotation: G(
|
|
1220
|
-
scale: G(
|
|
1221
|
-
anchorX: G(
|
|
1222
|
-
anchorY: G(
|
|
1223
|
-
edges: G(
|
|
1224
|
-
aspectRatio: G(
|
|
1213
|
+
offsetX: G(f.transform.offsetX),
|
|
1214
|
+
offsetY: G(f.transform.offsetY),
|
|
1215
|
+
rotation: G(f.transform.rotation),
|
|
1216
|
+
scale: G(f.transform.scale),
|
|
1217
|
+
anchorX: G(f.transform.anchorX),
|
|
1218
|
+
anchorY: G(f.transform.anchorY),
|
|
1219
|
+
edges: G(f.transform.edges === "stretch" ? 0 : f.transform.edges === "transparent" ? 1 : f.transform.edges === "mirror" ? 2 : 3),
|
|
1220
|
+
aspectRatio: G(C)
|
|
1225
1221
|
};
|
|
1226
1222
|
}
|
|
1227
|
-
const
|
|
1228
|
-
id:
|
|
1229
|
-
componentName:
|
|
1230
|
-
fragmentNodeFunc:
|
|
1223
|
+
const F = {
|
|
1224
|
+
id: i,
|
|
1225
|
+
componentName: v?.name || "Unknown",
|
|
1226
|
+
fragmentNodeFunc: r,
|
|
1231
1227
|
parentId: o,
|
|
1232
|
-
requiresRTT:
|
|
1233
|
-
requiresChild:
|
|
1234
|
-
opacityUniform:
|
|
1228
|
+
requiresRTT: v?.requiresRTT || !1,
|
|
1229
|
+
requiresChild: v?.requiresChild || !1,
|
|
1230
|
+
opacityUniform: m,
|
|
1235
1231
|
metadata: {
|
|
1236
|
-
blendMode:
|
|
1237
|
-
opacity:
|
|
1238
|
-
visible:
|
|
1239
|
-
id:
|
|
1240
|
-
mask:
|
|
1241
|
-
renderOrder:
|
|
1242
|
-
transform:
|
|
1232
|
+
blendMode: f?.blendMode || "normal",
|
|
1233
|
+
opacity: f?.opacity,
|
|
1234
|
+
visible: f?.visible !== !1,
|
|
1235
|
+
id: f?.id,
|
|
1236
|
+
mask: f?.mask,
|
|
1237
|
+
renderOrder: f?.renderOrder !== void 0 ? f?.renderOrder : b,
|
|
1238
|
+
transform: f?.transform
|
|
1243
1239
|
},
|
|
1244
|
-
uniforms:
|
|
1240
|
+
uniforms: s,
|
|
1245
1241
|
cleanupCallbacks: [],
|
|
1246
1242
|
beforeRenderCallbacks: [],
|
|
1247
1243
|
afterRenderCallbacks: [],
|
|
1248
1244
|
resizeCallbacks: [],
|
|
1249
1245
|
transformUniforms: M,
|
|
1250
1246
|
transformRTTActive: !1,
|
|
1251
|
-
uvTransformFunc:
|
|
1252
|
-
acceptsUVContext:
|
|
1247
|
+
uvTransformFunc: v?.uvTransformNode,
|
|
1248
|
+
acceptsUVContext: v?.acceptsUVContext || !1
|
|
1253
1249
|
};
|
|
1254
|
-
h.nodes.set(
|
|
1250
|
+
h.nodes.set(i, F), o === null && (h.rootId = i);
|
|
1255
1251
|
const y = d.get(o) || /* @__PURE__ */ new Set();
|
|
1256
|
-
y.add(
|
|
1257
|
-
|
|
1258
|
-
}))) : p && B && (
|
|
1259
|
-
|
|
1252
|
+
y.add(i), d.set(o, y), p && B && z > 0 && E > 0 ? (Fe.includes(i) || Fe.push(i), de === null && (de = requestAnimationFrame(() => {
|
|
1253
|
+
de = null, Fe = [], ue();
|
|
1254
|
+
}))) : p && B && (pe || (pe = !0, requestAnimationFrame(() => {
|
|
1255
|
+
pe = !1, z > 0 && E > 0 && ue();
|
|
1260
1256
|
})));
|
|
1261
|
-
},
|
|
1262
|
-
const
|
|
1263
|
-
if (!
|
|
1264
|
-
const
|
|
1265
|
-
if (!(!
|
|
1266
|
-
if (
|
|
1267
|
-
const { updateUniformValue:
|
|
1268
|
-
|
|
1269
|
-
} else
|
|
1270
|
-
|
|
1257
|
+
}, Dn = (i, r, o) => {
|
|
1258
|
+
const f = h.nodes.get(i);
|
|
1259
|
+
if (!f || !f.uniforms) return;
|
|
1260
|
+
const s = f.uniforms[r];
|
|
1261
|
+
if (!(!s || !s.uniform)) {
|
|
1262
|
+
if (s.transform) {
|
|
1263
|
+
const { updateUniformValue: v } = (yn(), Hn(Gr));
|
|
1264
|
+
v(s, o);
|
|
1265
|
+
} else s.uniform.value = o;
|
|
1266
|
+
L && Z();
|
|
1271
1267
|
}
|
|
1272
|
-
},
|
|
1273
|
-
const o = h.nodes.get(
|
|
1268
|
+
}, zn = (i, r) => {
|
|
1269
|
+
const o = h.nodes.get(i);
|
|
1274
1270
|
if (!o) return;
|
|
1275
|
-
let
|
|
1276
|
-
|
|
1277
|
-
const
|
|
1278
|
-
if (o.metadata.visible !==
|
|
1279
|
-
const
|
|
1280
|
-
if (o.metadata.transform =
|
|
1281
|
-
const
|
|
1271
|
+
let f = !1;
|
|
1272
|
+
r.blendMode !== void 0 && o.metadata.blendMode !== r.blendMode && (o.metadata.blendMode = r.blendMode, f = !0), r.opacity !== void 0 && o.metadata.opacity !== r.opacity && (o.metadata.opacity = r.opacity, o.opacityUniform.value = r.opacity), r.renderOrder !== void 0 && o.metadata.renderOrder !== r.renderOrder && (o.metadata.renderOrder = r.renderOrder, f = !0);
|
|
1273
|
+
const s = r.visible !== !1;
|
|
1274
|
+
if (o.metadata.visible !== s && (o.metadata.visible = s, f = !0), r.id !== void 0 && o.metadata.id !== r.id && (o.metadata.id = r.id, f = !0), r.mask !== void 0 && (o.metadata.mask?.source !== r.mask?.source || o.metadata.mask?.type !== r.mask?.type) && (o.metadata.mask = r.mask, f = !0), r.transform !== void 0) {
|
|
1275
|
+
const v = o.metadata.transform ? oe(o.metadata.transform) : !1, b = oe(r.transform);
|
|
1276
|
+
if (o.metadata.transform = r.transform, !o.transformUniforms && r.transform) {
|
|
1277
|
+
const m = z / Math.max(1, E);
|
|
1282
1278
|
o.transformUniforms = {
|
|
1283
|
-
offsetX: G(
|
|
1284
|
-
offsetY: G(
|
|
1285
|
-
rotation: G(
|
|
1286
|
-
scale: G(
|
|
1287
|
-
anchorX: G(
|
|
1288
|
-
anchorY: G(
|
|
1289
|
-
edges: G(
|
|
1290
|
-
aspectRatio: G(
|
|
1279
|
+
offsetX: G(r.transform.offsetX),
|
|
1280
|
+
offsetY: G(r.transform.offsetY),
|
|
1281
|
+
rotation: G(r.transform.rotation),
|
|
1282
|
+
scale: G(r.transform.scale),
|
|
1283
|
+
anchorX: G(r.transform.anchorX),
|
|
1284
|
+
anchorY: G(r.transform.anchorY),
|
|
1285
|
+
edges: G(r.transform.edges === "stretch" ? 0 : r.transform.edges === "transparent" ? 1 : r.transform.edges === "mirror" ? 2 : 3),
|
|
1286
|
+
aspectRatio: G(m)
|
|
1291
1287
|
};
|
|
1292
|
-
} else o.transformUniforms && (o.transformUniforms.offsetX.value =
|
|
1293
|
-
|
|
1288
|
+
} else o.transformUniforms && (o.transformUniforms.offsetX.value = r.transform.offsetX, o.transformUniforms.offsetY.value = r.transform.offsetY, o.transformUniforms.rotation.value = r.transform.rotation, o.transformUniforms.scale.value = r.transform.scale, o.transformUniforms.anchorX.value = r.transform.anchorX, o.transformUniforms.anchorY.value = r.transform.anchorY, o.transformUniforms.edges.value = r.transform.edges === "stretch" ? 0 : r.transform.edges === "transparent" ? 1 : r.transform.edges === "mirror" ? 2 : 3);
|
|
1289
|
+
b && !o.transformRTTActive && (o.transformRTTActive = !0, f = !0), !v && b && !o.transformRTTActive && (f = !0);
|
|
1294
1290
|
}
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
}))) :
|
|
1298
|
-
},
|
|
1299
|
-
if (!h.nodes.has(
|
|
1300
|
-
const
|
|
1301
|
-
if (
|
|
1302
|
-
|
|
1303
|
-
} catch (
|
|
1304
|
-
console.error(`Error executing cleanup callback for node ${
|
|
1291
|
+
f && p && B ? ($e.includes(i) || $e.push(i), he === null && (he = requestAnimationFrame(() => {
|
|
1292
|
+
he = null, $e = [], ue();
|
|
1293
|
+
}))) : L && Z();
|
|
1294
|
+
}, Qe = (i) => {
|
|
1295
|
+
if (!h.nodes.has(i)) return;
|
|
1296
|
+
const r = h.nodes.get(i);
|
|
1297
|
+
if (r && r.cleanupCallbacks.length > 0) for (const f of r.cleanupCallbacks) try {
|
|
1298
|
+
f();
|
|
1299
|
+
} catch (s) {
|
|
1300
|
+
console.error(`Error executing cleanup callback for node ${i}:`, s);
|
|
1305
1301
|
}
|
|
1306
|
-
const o =
|
|
1307
|
-
for (const
|
|
1308
|
-
if (h.rootId ===
|
|
1309
|
-
const
|
|
1310
|
-
|
|
1302
|
+
const o = Y(i);
|
|
1303
|
+
for (const f of o) Qe(f.id);
|
|
1304
|
+
if (h.rootId === i && (h.rootId = null), r) {
|
|
1305
|
+
const f = d.get(r.parentId);
|
|
1306
|
+
f && (f.delete(i), f.size === 0 && d.delete(r.parentId));
|
|
1311
1307
|
}
|
|
1312
|
-
h.nodes.delete(
|
|
1313
|
-
}, En = (
|
|
1314
|
-
const
|
|
1315
|
-
deltaTime:
|
|
1308
|
+
h.nodes.delete(i), p && B && ue();
|
|
1309
|
+
}, En = (i) => {
|
|
1310
|
+
const r = {
|
|
1311
|
+
deltaTime: i,
|
|
1316
1312
|
pointer: {
|
|
1317
|
-
x:
|
|
1313
|
+
x: Ae,
|
|
1318
1314
|
y: De
|
|
1319
1315
|
},
|
|
1320
|
-
pointerActive:
|
|
1316
|
+
pointerActive: ce,
|
|
1321
1317
|
dimensions: {
|
|
1322
1318
|
width: z,
|
|
1323
|
-
height:
|
|
1319
|
+
height: E
|
|
1324
1320
|
}
|
|
1325
1321
|
};
|
|
1326
|
-
for (const o of h.nodes.values()) if (o.beforeRenderCallbacks.length > 0) for (const
|
|
1327
|
-
|
|
1328
|
-
} catch (
|
|
1329
|
-
console.error(`Error executing before render callback for node ${o.id}:`,
|
|
1322
|
+
for (const o of h.nodes.values()) if (o.beforeRenderCallbacks.length > 0) for (const f of o.beforeRenderCallbacks) try {
|
|
1323
|
+
f(r);
|
|
1324
|
+
} catch (s) {
|
|
1325
|
+
console.error(`Error executing before render callback for node ${o.id}:`, s);
|
|
1330
1326
|
}
|
|
1331
|
-
},
|
|
1332
|
-
const
|
|
1333
|
-
deltaTime:
|
|
1327
|
+
}, Fn = (i) => {
|
|
1328
|
+
const r = {
|
|
1329
|
+
deltaTime: i,
|
|
1334
1330
|
pointer: {
|
|
1335
|
-
x:
|
|
1331
|
+
x: Ae,
|
|
1336
1332
|
y: De
|
|
1337
1333
|
},
|
|
1338
|
-
pointerActive:
|
|
1334
|
+
pointerActive: ce,
|
|
1339
1335
|
dimensions: {
|
|
1340
1336
|
width: z,
|
|
1341
|
-
height:
|
|
1337
|
+
height: E
|
|
1342
1338
|
}
|
|
1343
1339
|
};
|
|
1344
|
-
for (const o of h.nodes.values()) if (o.afterRenderCallbacks.length > 0) for (const
|
|
1345
|
-
|
|
1346
|
-
} catch (
|
|
1347
|
-
console.error(`Error executing after render callback for node ${o.id}:`,
|
|
1340
|
+
for (const o of h.nodes.values()) if (o.afterRenderCallbacks.length > 0) for (const f of o.afterRenderCallbacks) try {
|
|
1341
|
+
f(r);
|
|
1342
|
+
} catch (s) {
|
|
1343
|
+
console.error(`Error executing after render callback for node ${o.id}:`, s);
|
|
1348
1344
|
}
|
|
1349
|
-
},
|
|
1350
|
-
if (!
|
|
1351
|
-
const
|
|
1352
|
-
|
|
1345
|
+
}, Z = async () => {
|
|
1346
|
+
if (!wn()) return;
|
|
1347
|
+
const i = fe ? performance.now() : 0, r = i || performance.now(), o = Ge > 0 ? (r - Ge) / 1e3 : 0.016, f = Math.min(o, 0.1);
|
|
1348
|
+
Ge = r, fe && performance.mark("shader-cpu-start"), En(f);
|
|
1353
1349
|
try {
|
|
1354
1350
|
if (ze) return;
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
const w = g.get(n);
|
|
1364
|
-
if (w?.timestampQuery) {
|
|
1365
|
-
const M = w.timestampQuery.getResult();
|
|
1366
|
-
M != null && ie.recordGpuTime(M / 1e6);
|
|
1351
|
+
if (fe && performance.mark("shader-gpu-start"), n.render(t, l), Fn(f), fe) {
|
|
1352
|
+
if (performance.mark("shader-gpu-end"), n instanceof Ze) try {
|
|
1353
|
+
const s = n.backend;
|
|
1354
|
+
if (s && s.get && s.get(n)) {
|
|
1355
|
+
const v = s.get(n);
|
|
1356
|
+
if (v?.timestampQuery) {
|
|
1357
|
+
const b = v.timestampQuery.getResult();
|
|
1358
|
+
b != null && ae.recordGpuTime(b / 1e6);
|
|
1367
1359
|
}
|
|
1368
1360
|
}
|
|
1369
1361
|
} catch {
|
|
1370
1362
|
}
|
|
1371
1363
|
try {
|
|
1372
1364
|
performance.measure("shader-gpu-time", "shader-gpu-start", "shader-gpu-end");
|
|
1373
|
-
const
|
|
1374
|
-
|
|
1365
|
+
const s = performance.getEntriesByName("shader-gpu-time")[0];
|
|
1366
|
+
s && ae.recordGpuTime(s.duration), performance.clearMarks("shader-gpu-start"), performance.clearMarks("shader-gpu-end"), performance.clearMeasures("shader-gpu-time");
|
|
1375
1367
|
} catch {
|
|
1376
1368
|
}
|
|
1377
1369
|
}
|
|
1378
|
-
if (
|
|
1370
|
+
if (fe) {
|
|
1379
1371
|
performance.mark("shader-cpu-end");
|
|
1380
1372
|
try {
|
|
1381
1373
|
performance.measure("shader-cpu-time", "shader-cpu-start", "shader-cpu-end");
|
|
1382
|
-
const
|
|
1383
|
-
|
|
1374
|
+
const v = performance.getEntriesByName("shader-cpu-time")[0];
|
|
1375
|
+
v && ae.recordCpuTime(v.duration), performance.clearMarks("shader-cpu-start"), performance.clearMarks("shader-cpu-end"), performance.clearMeasures("shader-cpu-time");
|
|
1384
1376
|
} catch {
|
|
1385
1377
|
}
|
|
1386
|
-
const
|
|
1387
|
-
|
|
1378
|
+
const s = performance.now() - i;
|
|
1379
|
+
ae.recordFrame(s);
|
|
1388
1380
|
}
|
|
1389
|
-
} catch (
|
|
1390
|
-
console.error("Render frame error:",
|
|
1381
|
+
} catch (s) {
|
|
1382
|
+
console.error("Render frame error:", s);
|
|
1391
1383
|
}
|
|
1392
|
-
},
|
|
1393
|
-
const
|
|
1394
|
-
|
|
1395
|
-
},
|
|
1396
|
-
|
|
1397
|
-
const
|
|
1398
|
-
return
|
|
1399
|
-
},
|
|
1400
|
-
if (
|
|
1401
|
-
|
|
1402
|
-
const
|
|
1403
|
-
|
|
1384
|
+
}, $n = () => {
|
|
1385
|
+
const i = Math.max(0, h.nodes.size - 1), r = Pe;
|
|
1386
|
+
ae.updateNodeCounts(i, r);
|
|
1387
|
+
}, On = () => {
|
|
1388
|
+
$n();
|
|
1389
|
+
const i = n?.info;
|
|
1390
|
+
return ae.getStats(i);
|
|
1391
|
+
}, Je = () => {
|
|
1392
|
+
if (T || !ie || !L) return;
|
|
1393
|
+
ae.setRendering(!0);
|
|
1394
|
+
const i = () => {
|
|
1395
|
+
T = requestAnimationFrame(i), Z().catch(console.warn);
|
|
1404
1396
|
};
|
|
1405
|
-
|
|
1406
|
-
},
|
|
1407
|
-
|
|
1408
|
-
},
|
|
1397
|
+
i();
|
|
1398
|
+
}, Ke = () => {
|
|
1399
|
+
T && (cancelAnimationFrame(T), T = null), ae.setRendering(!1);
|
|
1400
|
+
}, sn = (i) => {
|
|
1409
1401
|
if (!e) return;
|
|
1410
|
-
let
|
|
1411
|
-
if ("touches" in
|
|
1412
|
-
if (
|
|
1413
|
-
|
|
1402
|
+
let r, o;
|
|
1403
|
+
if ("touches" in i) {
|
|
1404
|
+
if (i.touches.length === 0) return;
|
|
1405
|
+
r = i.touches[0].clientX, o = i.touches[0].clientY;
|
|
1414
1406
|
} else
|
|
1415
|
-
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1418
|
-
},
|
|
1419
|
-
!B || !e ||
|
|
1420
|
-
},
|
|
1421
|
-
!B || !e ||
|
|
1422
|
-
},
|
|
1423
|
-
B && (
|
|
1407
|
+
r = i.clientX, o = i.clientY;
|
|
1408
|
+
const f = e.getBoundingClientRect(), s = (r - f.left) / f.width, v = (o - f.top) / f.height;
|
|
1409
|
+
Ae = s, De = v;
|
|
1410
|
+
}, Bn = (i) => {
|
|
1411
|
+
!B || !e || sn(i);
|
|
1412
|
+
}, _n = (i) => {
|
|
1413
|
+
!B || !e || sn(i);
|
|
1414
|
+
}, Vn = () => {
|
|
1415
|
+
B && (ce = !1, Z().catch(console.warn));
|
|
1424
1416
|
}, qn = () => {
|
|
1425
|
-
B && (
|
|
1426
|
-
},
|
|
1427
|
-
|
|
1428
|
-
},
|
|
1429
|
-
|
|
1417
|
+
B && (ce = !1, Z().catch(console.warn));
|
|
1418
|
+
}, ln = () => {
|
|
1419
|
+
ce = !0, Z().catch(console.warn);
|
|
1420
|
+
}, cn = () => {
|
|
1421
|
+
ce = !0, Z().catch(console.warn);
|
|
1430
1422
|
}, Gn = () => {
|
|
1431
|
-
if (
|
|
1432
|
-
const
|
|
1433
|
-
|
|
1434
|
-
for (const { id:
|
|
1435
|
-
},
|
|
1436
|
-
if (B ||
|
|
1437
|
-
|
|
1438
|
-
const o =
|
|
1423
|
+
if (te.length === 0) return;
|
|
1424
|
+
const i = [...te];
|
|
1425
|
+
te = [];
|
|
1426
|
+
for (const { id: r, fragmentNodeFunc: o, parentId: f, metadata: s, uniforms: v, componentDefinition: b } of i) o && an(r, o, f, s, v, b);
|
|
1427
|
+
}, Ln = async ({ canvas: i, enablePerformanceTracking: r = !1 }) => {
|
|
1428
|
+
if (B || K) return;
|
|
1429
|
+
fe = r, K = !0, X = new AbortController();
|
|
1430
|
+
const o = X;
|
|
1439
1431
|
try {
|
|
1440
|
-
if (e =
|
|
1441
|
-
onMouseMove:
|
|
1442
|
-
onTouchMove:
|
|
1443
|
-
onMouseUp:
|
|
1432
|
+
if (e = i, t = new Qn(), t.background = null, l = new Xn(-1, 1, 1, -1, 0.1, 10), l.position.z = 1, l.lookAt(0, 0, 0), Ee = Pr.register({
|
|
1433
|
+
onMouseMove: Bn,
|
|
1434
|
+
onTouchMove: _n,
|
|
1435
|
+
onMouseUp: Vn,
|
|
1444
1436
|
onTouchEnd: qn
|
|
1445
|
-
}),
|
|
1446
|
-
|
|
1447
|
-
}, window.addEventListener("beforeunload",
|
|
1437
|
+
}), i.addEventListener("mousedown", ln), i.addEventListener("touchstart", cn), ve = () => {
|
|
1438
|
+
fn();
|
|
1439
|
+
}, window.addEventListener("beforeunload", ve), o.signal.aborted) return;
|
|
1448
1440
|
try {
|
|
1449
|
-
const
|
|
1450
|
-
canvas:
|
|
1441
|
+
const F = {
|
|
1442
|
+
canvas: i,
|
|
1451
1443
|
antialias: !0,
|
|
1452
1444
|
alpha: !0,
|
|
1453
1445
|
depth: !1,
|
|
1454
1446
|
powerPreference: "high-performance"
|
|
1455
1447
|
};
|
|
1456
|
-
if (
|
|
1457
|
-
} catch (
|
|
1448
|
+
if (fe && (F.forceWebGL = !1, F.requiredFeatures = ["timestamp-query"]), n = new Ze(F), await n.init(), o.signal.aborted) return;
|
|
1449
|
+
} catch (F) {
|
|
1458
1450
|
if (o.signal.aborted) return;
|
|
1459
|
-
console.warn("[Shaders] WebGPU initialization failed, falling back to WebGL:",
|
|
1451
|
+
console.warn("[Shaders] WebGPU initialization failed, falling back to WebGL:", F);
|
|
1460
1452
|
try {
|
|
1461
|
-
if (n = new
|
|
1462
|
-
canvas:
|
|
1453
|
+
if (n = new or({
|
|
1454
|
+
canvas: i,
|
|
1463
1455
|
antialias: !0,
|
|
1464
1456
|
alpha: !0,
|
|
1465
1457
|
depth: !1,
|
|
@@ -1472,38 +1464,38 @@ function cs() {
|
|
|
1472
1464
|
}
|
|
1473
1465
|
}
|
|
1474
1466
|
if (o.signal.aborted) return;
|
|
1475
|
-
n.setPixelRatio(Math.min(window.devicePixelRatio, 2)), n.outputColorSpace =
|
|
1476
|
-
const
|
|
1477
|
-
if (!
|
|
1467
|
+
n.setPixelRatio(Math.min(window.devicePixelRatio, 2)), n.outputColorSpace = Yn, p = new un({ transparent: !0 }), p.fragmentNode = S(0, 0, 0, 0), u = new it(new Jn(2, 2), p), t.add(u);
|
|
1468
|
+
const f = i.parentElement;
|
|
1469
|
+
if (!f) {
|
|
1478
1470
|
console.warn("[Shaders] Canvas has no parent element for resize observation");
|
|
1479
1471
|
return;
|
|
1480
1472
|
}
|
|
1481
|
-
U = new ResizeObserver(
|
|
1482
|
-
const
|
|
1483
|
-
|
|
1484
|
-
const { width:
|
|
1485
|
-
|
|
1486
|
-
} catch (
|
|
1487
|
-
console.error("[Shaders] Initialization error:",
|
|
1473
|
+
U = new ResizeObserver(Un), U.observe(f), _ = new IntersectionObserver(Sn, { threshold: 0 }), _.observe(i);
|
|
1474
|
+
const s = i.getBoundingClientRect();
|
|
1475
|
+
L = s.width > 0 && s.height > 0 && s.top < window.innerHeight && s.bottom > 0 && s.left < window.innerWidth && s.right > 0, ne = L && s.width > 0 && s.height > 0, ie = !0;
|
|
1476
|
+
const { width: v, height: b } = i.getBoundingClientRect(), m = Math.round(v), M = Math.round(b);
|
|
1477
|
+
m > 0 && M > 0 ? (Ye(m, M), P = !0, await Z()) : P = !1, ie && L && Je(), o.signal.aborted || (B = !0, Ne = !0, Gn());
|
|
1478
|
+
} catch (f) {
|
|
1479
|
+
console.error("[Shaders] Initialization error:", f);
|
|
1488
1480
|
} finally {
|
|
1489
|
-
|
|
1481
|
+
K = !1, X === o && (X = null);
|
|
1490
1482
|
}
|
|
1491
|
-
},
|
|
1492
|
-
!
|
|
1493
|
-
},
|
|
1494
|
-
if (
|
|
1483
|
+
}, Nn = () => {
|
|
1484
|
+
!Xr() || Cn || (console.warn("Shaders is running in development mode. Please purchase a license at https://shaders.com to use it in production."), Cn = !0);
|
|
1485
|
+
}, fn = () => {
|
|
1486
|
+
if (X && X.abort(), U && (U.disconnect(), U = null), _ && (_.disconnect(), _ = null), Ee && (Ee(), Ee = null), e && (e.removeEventListener("mousedown", ln), e.removeEventListener("touchstart", cn)), ve && (window.removeEventListener("beforeunload", ve), ve = null), Ke(), on(), Ce.forEach((i) => {
|
|
1495
1487
|
try {
|
|
1496
|
-
|
|
1488
|
+
i?.renderTarget?.dispose && i.renderTarget.dispose();
|
|
1497
1489
|
} catch {
|
|
1498
1490
|
}
|
|
1499
|
-
}),
|
|
1500
|
-
|
|
1491
|
+
}), Ce.clear(), h.nodes.clear(), h.rootId = null, h.idToNodeId.clear(), d.clear(), te = [], Ne = !1, Fe = [], de !== null && (cancelAnimationFrame(de), de = null), $e = [], he !== null && (cancelAnimationFrame(he), he = null), Re = null, Oe = !1, u) {
|
|
1492
|
+
t && t.remove(u);
|
|
1501
1493
|
try {
|
|
1502
|
-
|
|
1494
|
+
u.geometry && typeof u.geometry.dispose == "function" && u.geometry.dispose();
|
|
1503
1495
|
} catch {
|
|
1504
1496
|
}
|
|
1505
1497
|
try {
|
|
1506
|
-
|
|
1498
|
+
u.material instanceof jn && typeof u.material.dispose == "function" && u.material.dispose();
|
|
1507
1499
|
} catch {
|
|
1508
1500
|
}
|
|
1509
1501
|
}
|
|
@@ -1511,177 +1503,194 @@ function cs() {
|
|
|
1511
1503
|
n.dispose();
|
|
1512
1504
|
} catch {
|
|
1513
1505
|
}
|
|
1514
|
-
e = null, n = null,
|
|
1506
|
+
e = null, n = null, l = null, t = null, u = null, p = null, B = !1, K = !1, P = !1, X = null, z = 0, E = 0, L = !1, ie = !0, Ae = 0.5, De = 0.5, ce = !1;
|
|
1515
1507
|
};
|
|
1516
1508
|
return {
|
|
1517
|
-
initialize:
|
|
1518
|
-
cleanup:
|
|
1519
|
-
registerNode:
|
|
1520
|
-
removeNode:
|
|
1521
|
-
updateUniformValue:
|
|
1522
|
-
updateNodeMetadata:
|
|
1523
|
-
showLicenseWarning:
|
|
1509
|
+
initialize: Ln,
|
|
1510
|
+
cleanup: fn,
|
|
1511
|
+
registerNode: an,
|
|
1512
|
+
removeNode: Qe,
|
|
1513
|
+
updateUniformValue: Dn,
|
|
1514
|
+
updateNodeMetadata: zn,
|
|
1515
|
+
showLicenseWarning: Nn,
|
|
1524
1516
|
isInitialized: () => B,
|
|
1525
|
-
startAnimation:
|
|
1526
|
-
stopAnimation:
|
|
1527
|
-
getPerformanceStats:
|
|
1517
|
+
startAnimation: Je,
|
|
1518
|
+
stopAnimation: Ke,
|
|
1519
|
+
getPerformanceStats: On,
|
|
1528
1520
|
getNodeRegistry: () => ({ nodes: new Map(h.nodes) }),
|
|
1529
|
-
getRendererType: () => n ? n instanceof
|
|
1521
|
+
getRendererType: () => n ? n instanceof Ze ? "webgpu" : "webgl" : null,
|
|
1522
|
+
__testing: {
|
|
1523
|
+
isUVComposable: H,
|
|
1524
|
+
canSkipRTT: ke,
|
|
1525
|
+
hasUVPropagationOpportunity: We,
|
|
1526
|
+
needsTransformation: oe,
|
|
1527
|
+
findUVChain: Be,
|
|
1528
|
+
findSiblingUVChain: He,
|
|
1529
|
+
findChildNodes: Y,
|
|
1530
|
+
composeUVContextChain: _e,
|
|
1531
|
+
composeUVChain: Ve,
|
|
1532
|
+
composeSiblingUVChain: Ie,
|
|
1533
|
+
composeSiblingsWithUVContext: je,
|
|
1534
|
+
applyMaskIfNeeded: ee,
|
|
1535
|
+
applyNodeTransformation: re,
|
|
1536
|
+
getNodeRegistry: () => h,
|
|
1537
|
+
getParentToChildren: () => d
|
|
1538
|
+
}
|
|
1530
1539
|
};
|
|
1531
1540
|
}
|
|
1532
|
-
|
|
1533
|
-
function
|
|
1534
|
-
const n = /* @__PURE__ */ new Map(),
|
|
1541
|
+
yn();
|
|
1542
|
+
function ci(e) {
|
|
1543
|
+
const n = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), t = {
|
|
1535
1544
|
processingOrder: [],
|
|
1536
1545
|
maskSources: /* @__PURE__ */ new Map(),
|
|
1537
1546
|
circularDependencies: []
|
|
1538
1547
|
};
|
|
1539
|
-
return e.forEach((
|
|
1540
|
-
|
|
1541
|
-
}), e.forEach((
|
|
1542
|
-
if (
|
|
1543
|
-
const p =
|
|
1544
|
-
h ? (
|
|
1548
|
+
return e.forEach((u) => {
|
|
1549
|
+
u.elementId && n.set(u.elementId, u.id);
|
|
1550
|
+
}), e.forEach((u) => {
|
|
1551
|
+
if (u.mask?.source) {
|
|
1552
|
+
const p = u.mask.source.startsWith("#") ? u.mask.source.substring(1) : u.mask.source, h = n.get(p);
|
|
1553
|
+
h ? (l.has(u.id) || l.set(u.id, []), l.get(u.id)?.push(h), t.maskSources.set(u.id, h)) : console.warn(`Mask source "${p}" not found for node "${u.id}"`);
|
|
1545
1554
|
}
|
|
1546
|
-
}),
|
|
1555
|
+
}), t.processingOrder = Yr(l, t.circularDependencies), t;
|
|
1547
1556
|
}
|
|
1548
|
-
function
|
|
1549
|
-
const
|
|
1550
|
-
function p(d,
|
|
1551
|
-
if (
|
|
1552
|
-
if (
|
|
1553
|
-
const
|
|
1554
|
-
n.push(
|
|
1557
|
+
function Yr(e, n) {
|
|
1558
|
+
const l = [], t = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
|
|
1559
|
+
function p(d, T = []) {
|
|
1560
|
+
if (t.has(d)) return;
|
|
1561
|
+
if (u.has(d)) {
|
|
1562
|
+
const _ = [...T.slice(T.indexOf(d)), d];
|
|
1563
|
+
n.push(_);
|
|
1555
1564
|
return;
|
|
1556
1565
|
}
|
|
1557
|
-
|
|
1566
|
+
u.add(d), T.push(d);
|
|
1558
1567
|
const U = e.get(d) || [];
|
|
1559
|
-
for (const
|
|
1560
|
-
|
|
1568
|
+
for (const _ of U) p(_, [...T]);
|
|
1569
|
+
u.delete(d), t.add(d), l.push(d);
|
|
1561
1570
|
}
|
|
1562
|
-
for (const d of e.keys())
|
|
1571
|
+
for (const d of e.keys()) t.has(d) || p(d);
|
|
1563
1572
|
const h = new Set([...e.values()].flat());
|
|
1564
|
-
for (const d of h) !
|
|
1565
|
-
return
|
|
1573
|
+
for (const d of h) !t.has(d) && !e.has(d) && l.push(d);
|
|
1574
|
+
return l.reverse();
|
|
1566
1575
|
}
|
|
1567
1576
|
D();
|
|
1568
|
-
var { vec2:
|
|
1569
|
-
const
|
|
1577
|
+
var { vec2: Hr, fract: Ir, sin: Wr, dot: jr } = me;
|
|
1578
|
+
const Qr = (e) => Ir(Wr(jr(e, Hr(12.12345, 78.12345))).mul(40000.12345)), fi = (e = 0.03) => (n) => Qr(n).mul(e).mul(0.10012345);
|
|
1570
1579
|
D();
|
|
1571
|
-
var { vec2:
|
|
1572
|
-
const
|
|
1573
|
-
const { vec2:
|
|
1574
|
-
return e.add(
|
|
1580
|
+
var { vec2: Jr } = me;
|
|
1581
|
+
const ui = (e = Jr(0), n = 0.02, l = 1, t = 1) => {
|
|
1582
|
+
const { vec2: u, sin: p, cos: h, time: d } = me, T = t * 1.618033988749895, U = t * 2.718281828459045, _ = (Math.sin(t) + 2) * 5, B = (Math.cos(t) + 2) * 5, K = u(p(e.x.mul(l).mul(_).add(d.mul(0.1)).add(T)), h(e.y.mul(l).mul(_).add(d.mul(0.1)).add(U))), P = u(p(e.y.mul(l).mul(B).add(d.mul(0.05)).add(U)), h(e.x.mul(l).mul(B).add(d.mul(0.05)).add(T))), X = K.add(P).mul(n);
|
|
1583
|
+
return e.add(X);
|
|
1575
1584
|
};
|
|
1576
1585
|
D();
|
|
1577
|
-
const
|
|
1578
|
-
const { max: p, smoothstep: h, vec4: d } =
|
|
1586
|
+
const mi = (e, n, l = 0.6, t = 0.3, u = 1) => {
|
|
1587
|
+
const { max: p, smoothstep: h, vec4: d } = me, T = p(p(e.r, e.g), e.b), U = h(l, l + t, T).mul(u).mul(1);
|
|
1579
1588
|
return d(e.rgb.add(n.rgb.mul(U)), e.a);
|
|
1580
1589
|
};
|
|
1581
1590
|
D();
|
|
1582
|
-
const
|
|
1583
|
-
const { inset: n = 0.4, softness:
|
|
1584
|
-
return p(1).sub(h(p(1).sub(p(n)), p(1).sub(p(n)).add(p(
|
|
1591
|
+
const di = (e = {}) => {
|
|
1592
|
+
const { inset: n = 0.4, softness: l = 0.5, offsetX: t = 0, offsetY: u = 0 } = e, { float: p, smoothstep: h, uv: d } = me, T = d(), U = T.x.sub(0.5).sub(p(t)).mul(2), _ = T.y.sub(0.5).add(p(u)).mul(2), B = U.mul(U).add(_.mul(_)).sqrt();
|
|
1593
|
+
return p(1).sub(h(p(1).sub(p(n)), p(1).sub(p(n)).add(p(l)), B.mul(p(1).add(p(l)))));
|
|
1585
1594
|
};
|
|
1586
|
-
var
|
|
1595
|
+
var Kr = () => {
|
|
1587
1596
|
const e = {};
|
|
1588
1597
|
return Object.entries({
|
|
1589
|
-
AngularBlur:
|
|
1590
|
-
Ascii:
|
|
1591
|
-
Blob:
|
|
1592
|
-
Blur:
|
|
1593
|
-
Bulge:
|
|
1594
|
-
ChannelBlur:
|
|
1595
|
-
Checkerboard:
|
|
1596
|
-
ChromaFlow:
|
|
1597
|
-
ChromaticAberration:
|
|
1598
|
-
Circle:
|
|
1599
|
-
CRTScreen:
|
|
1600
|
-
CursorTrail:
|
|
1601
|
-
DiffuseBlur:
|
|
1602
|
-
Dither:
|
|
1603
|
-
DotGrid:
|
|
1604
|
-
Duotone:
|
|
1605
|
-
FilmGrain:
|
|
1606
|
-
FloatingParticles:
|
|
1607
|
-
GlassTiles:
|
|
1608
|
-
Glow:
|
|
1609
|
-
Godrays:
|
|
1610
|
-
Grayscale:
|
|
1611
|
-
Grid:
|
|
1612
|
-
GridDistortion:
|
|
1613
|
-
Group:
|
|
1614
|
-
Halftone:
|
|
1615
|
-
HueShift:
|
|
1616
|
-
ImageTexture:
|
|
1617
|
-
Invert:
|
|
1618
|
-
LinearBlur:
|
|
1619
|
-
LinearGradient:
|
|
1620
|
-
Liquify:
|
|
1621
|
-
Pixelate:
|
|
1622
|
-
PolarCoordinates:
|
|
1623
|
-
Posterize:
|
|
1624
|
-
ProgressiveBlur:
|
|
1625
|
-
RadialGradient:
|
|
1626
|
-
RectangularCoordinates:
|
|
1627
|
-
Ripples:
|
|
1628
|
-
Saturation:
|
|
1629
|
-
SimplexNoise:
|
|
1630
|
-
SineWave:
|
|
1631
|
-
SolidColor:
|
|
1632
|
-
Spiral:
|
|
1633
|
-
Strands:
|
|
1634
|
-
Swirl:
|
|
1635
|
-
TiltShift:
|
|
1636
|
-
Tritone:
|
|
1637
|
-
Twirl:
|
|
1638
|
-
Vibrance:
|
|
1639
|
-
WaveDistortion:
|
|
1640
|
-
ZoomBlur:
|
|
1641
|
-
}).forEach(([
|
|
1642
|
-
const
|
|
1643
|
-
|
|
1644
|
-
h.ui && (
|
|
1598
|
+
AngularBlur: at,
|
|
1599
|
+
Ascii: st,
|
|
1600
|
+
Blob: lt,
|
|
1601
|
+
Blur: ct,
|
|
1602
|
+
Bulge: ft,
|
|
1603
|
+
ChannelBlur: ut,
|
|
1604
|
+
Checkerboard: mt,
|
|
1605
|
+
ChromaFlow: dt,
|
|
1606
|
+
ChromaticAberration: ht,
|
|
1607
|
+
Circle: pt,
|
|
1608
|
+
CRTScreen: gt,
|
|
1609
|
+
CursorTrail: bt,
|
|
1610
|
+
DiffuseBlur: vt,
|
|
1611
|
+
Dither: Ct,
|
|
1612
|
+
DotGrid: Rt,
|
|
1613
|
+
Duotone: Tt,
|
|
1614
|
+
FilmGrain: kt,
|
|
1615
|
+
FloatingParticles: yt,
|
|
1616
|
+
GlassTiles: wt,
|
|
1617
|
+
Glow: Ut,
|
|
1618
|
+
Godrays: St,
|
|
1619
|
+
Grayscale: Mt,
|
|
1620
|
+
Grid: xt,
|
|
1621
|
+
GridDistortion: At,
|
|
1622
|
+
Group: Dt,
|
|
1623
|
+
Halftone: zt,
|
|
1624
|
+
HueShift: Et,
|
|
1625
|
+
ImageTexture: Ft,
|
|
1626
|
+
Invert: $t,
|
|
1627
|
+
LinearBlur: Ot,
|
|
1628
|
+
LinearGradient: Bt,
|
|
1629
|
+
Liquify: _t,
|
|
1630
|
+
Pixelate: Vt,
|
|
1631
|
+
PolarCoordinates: qt,
|
|
1632
|
+
Posterize: Gt,
|
|
1633
|
+
ProgressiveBlur: Lt,
|
|
1634
|
+
RadialGradient: Nt,
|
|
1635
|
+
RectangularCoordinates: Pt,
|
|
1636
|
+
Ripples: Xt,
|
|
1637
|
+
Saturation: Yt,
|
|
1638
|
+
SimplexNoise: Ht,
|
|
1639
|
+
SineWave: It,
|
|
1640
|
+
SolidColor: Wt,
|
|
1641
|
+
Spiral: jt,
|
|
1642
|
+
Strands: Qt,
|
|
1643
|
+
Swirl: Jt,
|
|
1644
|
+
TiltShift: Kt,
|
|
1645
|
+
Tritone: Zt,
|
|
1646
|
+
Twirl: er,
|
|
1647
|
+
Vibrance: nr,
|
|
1648
|
+
WaveDistortion: tr,
|
|
1649
|
+
ZoomBlur: rr
|
|
1650
|
+
}).forEach(([l, t]) => {
|
|
1651
|
+
const u = {};
|
|
1652
|
+
t.props && Object.entries(t.props).forEach(([p, h]) => {
|
|
1653
|
+
h.ui && (u[p] = {
|
|
1645
1654
|
ui: h.ui,
|
|
1646
1655
|
default: h.default,
|
|
1647
1656
|
description: h.description
|
|
1648
1657
|
});
|
|
1649
|
-
}), e[
|
|
1650
|
-
name:
|
|
1651
|
-
fileName:
|
|
1652
|
-
category:
|
|
1653
|
-
definition:
|
|
1654
|
-
propsMetadata:
|
|
1658
|
+
}), e[t.name] = {
|
|
1659
|
+
name: t.name,
|
|
1660
|
+
fileName: l,
|
|
1661
|
+
category: t.category || "Uncategorized",
|
|
1662
|
+
definition: t,
|
|
1663
|
+
propsMetadata: u
|
|
1655
1664
|
};
|
|
1656
1665
|
}), e;
|
|
1657
1666
|
};
|
|
1658
|
-
const
|
|
1659
|
-
function
|
|
1660
|
-
return Object.values(
|
|
1667
|
+
const qe = Kr();
|
|
1668
|
+
function hi() {
|
|
1669
|
+
return Object.values(qe);
|
|
1661
1670
|
}
|
|
1662
|
-
function
|
|
1663
|
-
return
|
|
1671
|
+
function pi(e) {
|
|
1672
|
+
return qe[e];
|
|
1664
1673
|
}
|
|
1665
|
-
function
|
|
1666
|
-
return Object.values(
|
|
1674
|
+
function gi(e) {
|
|
1675
|
+
return Object.values(qe).filter((n) => n.category === e);
|
|
1667
1676
|
}
|
|
1668
|
-
function
|
|
1669
|
-
const e = new Set(Object.values(
|
|
1677
|
+
function bi() {
|
|
1678
|
+
const e = new Set(Object.values(qe).map((n) => n.category));
|
|
1670
1679
|
return Array.from(e).sort();
|
|
1671
1680
|
}
|
|
1672
1681
|
export {
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1682
|
+
ro as createAnimatedTime,
|
|
1683
|
+
Lr as createUniformsMap,
|
|
1684
|
+
ui as distort,
|
|
1685
|
+
di as edgeMask,
|
|
1686
|
+
hi as getAllShaders,
|
|
1687
|
+
pi as getShaderByName,
|
|
1688
|
+
bi as getShaderCategories,
|
|
1689
|
+
gi as getShadersByCategory,
|
|
1690
|
+
mi as glow,
|
|
1691
|
+
fi as grain,
|
|
1692
|
+
ci as resolveMaskDependencies,
|
|
1693
|
+
qe as shaderRegistry,
|
|
1694
|
+
li as shaderRenderer,
|
|
1695
|
+
Nr as updateUniformValue
|
|
1687
1696
|
};
|