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