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