shaders 2.2.2 → 2.2.3
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 +368 -366
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/react/index.cjs +62 -62
- package/dist/react/index.js +3136 -3134
- package/dist/svelte/index.js +2922 -2920
- package/dist/vue/index.js +3354 -3352
- package/package.json +1 -1
package/dist/core/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { n as ce, t as
|
|
1
|
+
import { A as G, B as Yn, D as C, E as xe, F as dn, H as In, I as Je, J as Hn, K as Wn, L as jn, M as X, N as x, P as ye, R as Qn, S as Ce, T as kn, U as Jn, V as Kn, _ as Me, c as Zn, d as Z, g as Ke, h as Ze, i as er, k as pe, l as wn, m as D, n as k, o as nr, q as rr, s as tr, t as or, v as i, w as sr, x as ee, z as ar } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { n as ce, t as Re } from "./edges-B-tVdqcI.js";
|
|
3
3
|
import { t as oo } from "./time-5uQ65blS.js";
|
|
4
4
|
import "./transformations-DBjTkQ5b.js";
|
|
5
5
|
import { n as ir } from "./AngularBlur-BTUdXC0g.js";
|
|
@@ -29,8 +29,8 @@ import "./ColorAdjustment-CKwpE_4M.js";
|
|
|
29
29
|
import { n as Mr } from "./Grayscale-oWIF3PV5.js";
|
|
30
30
|
import { n as Ar } from "./Grid-Bov7AA9m.js";
|
|
31
31
|
import { n as $r } from "./GridDistortion-CWYom5Dw.js";
|
|
32
|
-
import { n as
|
|
33
|
-
import { n as
|
|
32
|
+
import { n as Dr } from "./Group-CPk-7fiA.js";
|
|
33
|
+
import { n as zr } from "./Halftone-F7fsdu7W.js";
|
|
34
34
|
import { n as Fr } from "./HueShift-CiS4hdtk.js";
|
|
35
35
|
import { n as Er } from "./ImageTexture-B3Q29OHX.js";
|
|
36
36
|
import { n as Or } from "./Invert-Cyc4JHWc.js";
|
|
@@ -58,132 +58,132 @@ import { n as rt } from "./Vibrance-DtekSkcz.js";
|
|
|
58
58
|
import { n as tt } from "./WaveDistortion-C65qO_cZ.js";
|
|
59
59
|
import { n as ot } from "./ZoomBlur-B97ZjhXe.js";
|
|
60
60
|
import { WebGLRenderer as st } from "three";
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
jn();
|
|
62
|
+
D();
|
|
63
63
|
function at(e, n, a = 1) {
|
|
64
64
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
65
65
|
return x(k(i(n.rgb, r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
var
|
|
69
|
-
const n = e.x, a = e.y, r = e.z, m = n.mul(0.4122214708).add(a.mul(0.5363325363)).add(r.mul(0.0514459929)), p = n.mul(0.2119034982).add(a.mul(0.6806995451).add(r.mul(0.1073969566))), h = n.mul(0.0883024619).add(a.mul(0.2817188376)).add(r.mul(0.6299787005)), d = ee(m, Z(1 / 3)), R = ee(p, Z(1 / 3)),
|
|
70
|
-
return
|
|
67
|
+
D();
|
|
68
|
+
var hn = (e) => X(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))), it = (e) => X(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))), pn = (e) => {
|
|
69
|
+
const n = e.x, a = e.y, r = e.z, m = n.mul(0.4122214708).add(a.mul(0.5363325363)).add(r.mul(0.0514459929)), p = n.mul(0.2119034982).add(a.mul(0.6806995451).add(r.mul(0.1073969566))), h = n.mul(0.0883024619).add(a.mul(0.2817188376)).add(r.mul(0.6299787005)), d = ee(m, Z(1 / 3)), R = ee(p, Z(1 / 3)), U = ee(h, Z(1 / 3));
|
|
70
|
+
return X(d.mul(0.2104542553).add(R.mul(0.793617785)).sub(U.mul(0.0040720468)), d.mul(1.9779984951).sub(R.mul(2.428592205)).add(U.mul(0.4505937099)), d.mul(0.0259040371).add(R.mul(0.7827717662)).sub(U.mul(0.808675766)));
|
|
71
71
|
}, lt = (e) => {
|
|
72
|
-
const n = e.x, a = e.y, r = e.z, m = n.add(a.mul(0.3963377774)).add(r.mul(0.2158037573)), p = n.sub(a.mul(0.1055613458)).sub(r.mul(0.0638541728)), h = n.sub(a.mul(0.0894841775)).sub(r.mul(1.291485548)), d = ee(m, Z(3)), R = ee(p, Z(3)),
|
|
73
|
-
return
|
|
74
|
-
},
|
|
72
|
+
const n = e.x, a = e.y, r = e.z, m = n.add(a.mul(0.3963377774)).add(r.mul(0.2158037573)), p = n.sub(a.mul(0.1055613458)).sub(r.mul(0.0638541728)), h = n.sub(a.mul(0.0894841775)).sub(r.mul(1.291485548)), d = ee(m, Z(3)), R = ee(p, Z(3)), U = ee(h, Z(3));
|
|
73
|
+
return X(d.mul(4.0767416621).sub(R.mul(3.3077115913)).add(U.mul(0.2309699292)), d.mul(-1.2684380046).add(R.mul(2.6097574011)).sub(U.mul(0.3413193965)), d.mul(-0.0041960863).sub(R.mul(0.7034186147)).add(U.mul(1.707614701)));
|
|
74
|
+
}, gn = (e) => {
|
|
75
75
|
const n = e.x, a = e.y, r = e.z;
|
|
76
|
-
return
|
|
76
|
+
return X(n, kn(a.mul(a).add(r.mul(r))), er(r, a));
|
|
77
77
|
}, ct = (e) => {
|
|
78
78
|
const n = e.x, a = e.y, r = e.z;
|
|
79
|
-
return
|
|
79
|
+
return X(n, a.mul(tr(r)), a.mul(sr(r)));
|
|
80
80
|
};
|
|
81
81
|
function ft(e, n, a = 1) {
|
|
82
|
-
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p =
|
|
83
|
-
return x(it(lt(ct(k(i(
|
|
82
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = hn(X(e.r, e.g, e.b)), h = hn(X(n.r, n.g, n.b)), d = pn(p), R = pn(h), U = gn(d);
|
|
83
|
+
return x(it(lt(ct(k(i(gn(R), r), i(U, i(e.a, C(1, r))))))), m);
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
var
|
|
87
|
-
const n = e.x, a = e.y, r = e.z, m = n.mul(0.4122214708).add(a.mul(0.5363325363)).add(r.mul(0.0514459929)), p = n.mul(0.2119034982).add(a.mul(0.6806995451).add(r.mul(0.1073969566))), h = n.mul(0.0883024619).add(a.mul(0.2817188376)).add(r.mul(0.6299787005)), d = ee(m, Z(1 / 3)), R = ee(p, Z(1 / 3)),
|
|
88
|
-
return
|
|
85
|
+
D();
|
|
86
|
+
var bn = (e) => X(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))), mt = (e) => X(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))), vn = (e) => {
|
|
87
|
+
const n = e.x, a = e.y, r = e.z, m = n.mul(0.4122214708).add(a.mul(0.5363325363)).add(r.mul(0.0514459929)), p = n.mul(0.2119034982).add(a.mul(0.6806995451).add(r.mul(0.1073969566))), h = n.mul(0.0883024619).add(a.mul(0.2817188376)).add(r.mul(0.6299787005)), d = ee(m, Z(1 / 3)), R = ee(p, Z(1 / 3)), U = ee(h, Z(1 / 3));
|
|
88
|
+
return X(d.mul(0.2104542553).add(R.mul(0.793617785)).sub(U.mul(0.0040720468)), d.mul(1.9779984951).sub(R.mul(2.428592205)).add(U.mul(0.4505937099)), d.mul(0.0259040371).add(R.mul(0.7827717662)).sub(U.mul(0.808675766)));
|
|
89
89
|
}, ut = (e) => {
|
|
90
|
-
const n = e.x, a = e.y, r = e.z, m = n.add(a.mul(0.3963377774)).add(r.mul(0.2158037573)), p = n.sub(a.mul(0.1055613458)).sub(r.mul(0.0638541728)), h = n.sub(a.mul(0.0894841775)).sub(r.mul(1.291485548)), d = ee(m, Z(3)), R = ee(p, Z(3)),
|
|
91
|
-
return
|
|
90
|
+
const n = e.x, a = e.y, r = e.z, m = n.add(a.mul(0.3963377774)).add(r.mul(0.2158037573)), p = n.sub(a.mul(0.1055613458)).sub(r.mul(0.0638541728)), h = n.sub(a.mul(0.0894841775)).sub(r.mul(1.291485548)), d = ee(m, Z(3)), R = ee(p, Z(3)), U = ee(h, Z(3));
|
|
91
|
+
return X(d.mul(4.0767416621).sub(R.mul(3.3077115913)).add(U.mul(0.2309699292)), d.mul(-1.2684380046).add(R.mul(2.6097574011)).sub(U.mul(0.3413193965)), d.mul(-0.0041960863).sub(R.mul(0.7034186147)).add(U.mul(1.707614701)));
|
|
92
92
|
};
|
|
93
93
|
function dt(e, n, a = 1) {
|
|
94
|
-
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p =
|
|
95
|
-
return x(mt(ut(k(i(
|
|
94
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = bn(X(e.r, e.g, e.b)), h = bn(X(n.r, n.g, n.b)), d = vn(p);
|
|
95
|
+
return x(mt(ut(k(i(vn(h), r), i(d, i(e.a, C(1, r)))))), m);
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
D();
|
|
98
98
|
function ht(e, n, a = 1) {
|
|
99
99
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
100
100
|
return x(k(i(i(e.rgb, n.rgb), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
101
101
|
}
|
|
102
|
-
|
|
102
|
+
D();
|
|
103
103
|
function pt(e, n, a = 1) {
|
|
104
104
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
105
105
|
return x(k(i(C(1, i(C(1, e.rgb), C(1, n.rgb))), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
D();
|
|
108
108
|
function gt(e, n, a = 1) {
|
|
109
109
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
110
110
|
return x(k(i(Ke(k(e.rgb, n.rgb), 1), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
111
111
|
}
|
|
112
|
-
|
|
112
|
+
D();
|
|
113
113
|
function bt(e, n, a = 1) {
|
|
114
114
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
115
115
|
return x(k(i(Me(i(2, i(e.rgb, n.rgb)), C(1, i(2, i(C(1, e.rgb), C(1, n.rgb)))), xe(0.5, e.rgb)), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
116
116
|
}
|
|
117
|
-
|
|
117
|
+
D();
|
|
118
118
|
function vt(e, n, a = 1) {
|
|
119
119
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
120
120
|
return x(k(i(or(C(e.rgb, n.rgb)), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
D();
|
|
123
123
|
function Ct(e, n, a = 1) {
|
|
124
124
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
125
|
-
return x(k(i(Me(e.rgb, Ke(
|
|
125
|
+
return x(k(i(Me(e.rgb, Ke(Zn(e.rgb, C(1, n.rgb)), 1), xe(1e-3, C(1, n.rgb))), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
D();
|
|
128
128
|
function Rt(e, n, a = 1) {
|
|
129
129
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
130
130
|
return x(k(i(C(k(e.rgb, n.rgb), i(2, i(e.rgb, n.rgb))), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
131
131
|
}
|
|
132
|
-
|
|
132
|
+
D();
|
|
133
133
|
function me(e) {
|
|
134
134
|
return k(k(i(e.r, 0.2126), i(e.g, 0.7152)), i(e.b, 0.0722));
|
|
135
135
|
}
|
|
136
|
-
|
|
136
|
+
D();
|
|
137
137
|
function Tt(e, n, a = 1) {
|
|
138
138
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = C(me(e.rgb), me(n.rgb));
|
|
139
139
|
return x(k(i(k(n.rgb, p), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
D();
|
|
142
142
|
function kt(e, n, a = 1) {
|
|
143
143
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = me(e.rgb), h = me(n.rgb).div(k(p, 1e-4));
|
|
144
144
|
return x(k(i(i(e.rgb, h), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
D();
|
|
147
147
|
function wt(e, n, a = 1) {
|
|
148
148
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
149
149
|
return x(k(i(Ke(e.rgb, n.rgb), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
D();
|
|
152
152
|
function yt(e, n, a = 1) {
|
|
153
153
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
154
154
|
return x(k(i(Ze(e.rgb, n.rgb), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
D();
|
|
157
157
|
function St(e, n, a = 1) {
|
|
158
158
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
159
159
|
return x(k(i(Me(x(0, 0, 0, 1).rgb, Ze(C(1, C(1, e.rgb).div(k(n.rgb, 1e-4))), 0), xe(1e-4, n.rgb)), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
160
160
|
}
|
|
161
|
-
|
|
161
|
+
D();
|
|
162
162
|
function Ut(e, n, a = 1) {
|
|
163
163
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
164
164
|
return x(k(i(Ze(k(k(e.rgb, n.rgb), -1), 0), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
D();
|
|
167
167
|
function xt(e, n, a = 1) {
|
|
168
|
-
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = k(i(2, i(e.rgb, n.rgb)), i(i(e.rgb, e.rgb), C(1, i(2, n.rgb)))), h =
|
|
168
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = k(i(2, i(e.rgb, n.rgb)), i(i(e.rgb, e.rgb), C(1, i(2, n.rgb)))), h = kn(e.rgb);
|
|
169
169
|
return x(k(i(Me(p, k(i(2, i(e.rgb, C(1, n.rgb))), i(h, C(i(2, n.rgb), 1))), xe(0.5, n.rgb)), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
170
170
|
}
|
|
171
|
-
|
|
171
|
+
D();
|
|
172
172
|
function Mt(e, n, a = 1) {
|
|
173
173
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
174
174
|
return x(k(i(Me(i(2, i(e.rgb, n.rgb)), C(1, i(2, i(C(1, e.rgb), C(1, n.rgb)))), xe(0.5, n.rgb)), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
175
175
|
}
|
|
176
|
-
|
|
176
|
+
D();
|
|
177
177
|
function At(e, n, a = 1) {
|
|
178
|
-
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = me(e.rgb), h = me(n.rgb), d = e.rgb.sub(p), R = n.rgb.sub(h),
|
|
179
|
-
return x(k(i(k(i(R.normalize(),
|
|
178
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = me(e.rgb), h = me(n.rgb), d = e.rgb.sub(p), R = n.rgb.sub(h), U = d.length();
|
|
179
|
+
return x(k(i(k(i(R.normalize(), U), p), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
180
180
|
}
|
|
181
|
-
|
|
181
|
+
D();
|
|
182
182
|
function $t(e, n, a = 1) {
|
|
183
183
|
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = me(e.rgb), h = me(n.rgb), d = e.rgb.sub(p), R = n.rgb.sub(h);
|
|
184
184
|
return x(k(i(k(i(d.normalize(), R.length()), p), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
185
185
|
}
|
|
186
|
-
var
|
|
186
|
+
var Cn = {
|
|
187
187
|
normal: at,
|
|
188
188
|
"normal-oklch": ft,
|
|
189
189
|
"normal-oklab": dt,
|
|
@@ -206,36 +206,36 @@ var Rn = {
|
|
|
206
206
|
saturation: $t
|
|
207
207
|
};
|
|
208
208
|
function K(e, n, a = "normal", r = 1) {
|
|
209
|
-
return (
|
|
209
|
+
return (Cn[a] || Cn.normal)(e, n, r);
|
|
210
210
|
}
|
|
211
|
-
|
|
212
|
-
function
|
|
211
|
+
D();
|
|
212
|
+
function Dt(e, n) {
|
|
213
213
|
const a = i(e.a, n.a);
|
|
214
214
|
return x(e.rgb, a);
|
|
215
215
|
}
|
|
216
|
-
|
|
217
|
-
function
|
|
216
|
+
D();
|
|
217
|
+
function zt(e, n) {
|
|
218
218
|
const a = C(1, n.a), r = i(e.a, a);
|
|
219
219
|
return x(e.rgb, r);
|
|
220
220
|
}
|
|
221
|
-
|
|
221
|
+
D();
|
|
222
222
|
function Ft(e, n) {
|
|
223
|
-
const a =
|
|
223
|
+
const a = X(0.2126, 0.7152, 0.0722), r = wn(n.rgb, a), m = i(e.a, r);
|
|
224
224
|
return x(e.rgb, m);
|
|
225
225
|
}
|
|
226
|
-
|
|
226
|
+
D();
|
|
227
227
|
function Et(e, n) {
|
|
228
|
-
const a =
|
|
228
|
+
const a = X(0.2126, 0.7152, 0.0722), r = C(1, wn(n.rgb, a)), m = i(e.a, r);
|
|
229
229
|
return x(e.rgb, m);
|
|
230
230
|
}
|
|
231
|
-
var
|
|
232
|
-
alpha:
|
|
233
|
-
alphaInverted:
|
|
231
|
+
var Rn = {
|
|
232
|
+
alpha: Dt,
|
|
233
|
+
alphaInverted: zt,
|
|
234
234
|
luminance: Ft,
|
|
235
235
|
luminanceInverted: Et
|
|
236
236
|
};
|
|
237
237
|
function Ot(e, n, a = "alpha") {
|
|
238
|
-
return (
|
|
238
|
+
return (Rn[a] || Rn.alpha)(e, n);
|
|
239
239
|
}
|
|
240
240
|
var Bt = class {
|
|
241
241
|
frameTimesMs = [];
|
|
@@ -349,7 +349,7 @@ var Bt = class {
|
|
|
349
349
|
score: 0,
|
|
350
350
|
label: "N/A"
|
|
351
351
|
};
|
|
352
|
-
const n = this.frameTimesMs.reduce((
|
|
352
|
+
const n = this.frameTimesMs.reduce((U, V) => U + V, 0) / e, a = Math.min(n / 16.67 * 100, 100), r = this.calculateComplexityScore(), m = Math.min(r / 100 * 100, 100);
|
|
353
353
|
let p = 0;
|
|
354
354
|
this.lastGpuTime !== null && (p = Math.min(this.lastGpuTime / 16.67 * 100, 100));
|
|
355
355
|
const h = this.lastGpuTime !== null ? {
|
|
@@ -371,7 +371,7 @@ var Bt = class {
|
|
|
371
371
|
* Gets current performance statistics
|
|
372
372
|
*/
|
|
373
373
|
getStats(e) {
|
|
374
|
-
const n = this.frameTimesMs.length, a = this.frameIntervals.length > 0 ? 1e3 / (this.frameIntervals.reduce((z,
|
|
374
|
+
const n = this.frameTimesMs.length, a = this.frameIntervals.length > 0 ? 1e3 / (this.frameIntervals.reduce((z, F) => z + F, 0) / this.frameIntervals.length) : 0, r = n > 0 ? this.frameTimesMs.reduce((z, F) => z + F, 0) / n : 0, m = 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), R = this.totalFrameCount > 0 ? this.jankFrameCount / this.totalFrameCount * 100 : 0, U = performance.memory, V = U ? U.usedJSHeapSize / (1024 * 1024) : null, B = this.calculateMemoryGrowthRate(), ne = r > 0 ? r / this.targetFrameTime * 100 : 0, Y = e?.render?.calls ?? null, I = e?.programs?.length ?? null, N = e?.memory?.textures ?? null, ae = this.calculateIntensityScore();
|
|
375
375
|
return {
|
|
376
376
|
fps: Math.round(a),
|
|
377
377
|
avgFrameTime: Math.round(r * 100) / 100,
|
|
@@ -389,9 +389,9 @@ var Bt = class {
|
|
|
389
389
|
cpuTime: this.lastCpuTime !== null ? Math.round(this.lastCpuTime * 100) / 100 : null,
|
|
390
390
|
gpuTime: this.lastGpuTime !== null ? Math.round(this.lastGpuTime * 100) / 100 : null,
|
|
391
391
|
budgetUsed: Math.round(ne * 10) / 10,
|
|
392
|
-
drawCalls:
|
|
393
|
-
shaderPrograms:
|
|
394
|
-
textureCount:
|
|
392
|
+
drawCalls: Y,
|
|
393
|
+
shaderPrograms: I,
|
|
394
|
+
textureCount: N,
|
|
395
395
|
intensityScore: ae.score,
|
|
396
396
|
intensityLabel: ae.label,
|
|
397
397
|
isRendering: this.isRendering
|
|
@@ -404,11 +404,11 @@ var Bt = class {
|
|
|
404
404
|
this.frameTimesMs = [], this.frameIntervals = [], this.lastFrameTimestamp = 0, this.jankFrameCount = 0, this.totalFrameCount = 0, this.memorySnapshots = [], this.lastCpuTime = null, this.lastGpuTime = null;
|
|
405
405
|
}
|
|
406
406
|
};
|
|
407
|
-
|
|
407
|
+
D();
|
|
408
408
|
var { vec2: Se, cos: Pt, sin: _t, float: Vt, PI: Lt } = pe;
|
|
409
409
|
const fe = (e) => e.offsetX !== 0 || e.offsetY !== 0 || e.rotation !== 0 || e.scale !== 1 || e.anchorX !== 0.5 || e.anchorY !== 0.5, Ue = (e, n, a, r, m, p, h, d) => {
|
|
410
|
-
const R = r.mul(Lt).div(Vt(180)),
|
|
411
|
-
return Se(
|
|
410
|
+
const R = r.mul(Lt).div(Vt(180)), U = Pt(R), V = _t(R), B = Se(p, h), ne = e.sub(B).div(m), Y = Se(ne.x.mul(d), ne.y), I = Se(Y.x.mul(U).sub(Y.y.mul(V)), Y.x.mul(V).add(Y.y.mul(U)));
|
|
411
|
+
return Se(I.x.div(d), I.y).sub(Se(n, a)).add(B);
|
|
412
412
|
};
|
|
413
413
|
var qt = /* @__PURE__ */ rr({
|
|
414
414
|
createUniformsMap: () => Gt,
|
|
@@ -420,12 +420,12 @@ function Gt(e, n, a) {
|
|
|
420
420
|
const h = n[m];
|
|
421
421
|
let d = h;
|
|
422
422
|
if (p.transform) {
|
|
423
|
-
const
|
|
424
|
-
d =
|
|
423
|
+
const U = p.transform(h);
|
|
424
|
+
d = U?.node ?? U;
|
|
425
425
|
}
|
|
426
426
|
if (d == null && (d = p.default, p.transform && d !== null && d !== void 0)) {
|
|
427
|
-
const
|
|
428
|
-
d =
|
|
427
|
+
const U = p.transform(d);
|
|
428
|
+
d = U?.node ?? U;
|
|
429
429
|
}
|
|
430
430
|
d == null && (console.error(`[Shaders] Uniform "${m}" is null/undefined after fallback. PropConfig:`, {
|
|
431
431
|
propName: m,
|
|
@@ -433,7 +433,7 @@ function Gt(e, n, a) {
|
|
|
433
433
|
default: p.default,
|
|
434
434
|
hasTransform: !!p.transform
|
|
435
435
|
}), d = 0);
|
|
436
|
-
const R =
|
|
436
|
+
const R = yn(d).setName(`${m}_${a}`);
|
|
437
437
|
typeof d == "string" && R.value === null && (R.value = d), r[m] = {
|
|
438
438
|
uniform: R,
|
|
439
439
|
transform: p.transform || void 0
|
|
@@ -446,11 +446,11 @@ function Nt(e, n) {
|
|
|
446
446
|
e.uniform.value = r;
|
|
447
447
|
} else e.uniform.value = n;
|
|
448
448
|
}
|
|
449
|
-
var
|
|
450
|
-
|
|
449
|
+
var yn, Sn = Wn({ "src/utilities/uniforms.ts": (() => {
|
|
450
|
+
D(), { uniform: yn } = pe;
|
|
451
451
|
}) });
|
|
452
|
-
|
|
453
|
-
var
|
|
452
|
+
D();
|
|
453
|
+
var Tn = !1, Xt = /* @__PURE__ */ (() => {
|
|
454
454
|
let e = 0;
|
|
455
455
|
const n = /* @__PURE__ */ new Set(), a = (h) => {
|
|
456
456
|
n.forEach((d) => {
|
|
@@ -515,17 +515,17 @@ function cs() {
|
|
|
515
515
|
rootId: null,
|
|
516
516
|
idToNodeId: /* @__PURE__ */ new Map()
|
|
517
517
|
}, d = /* @__PURE__ */ new Map();
|
|
518
|
-
let R = null,
|
|
518
|
+
let R = null, U = null, V = null, B = !1, ne = !1, Y = !1, I = null, N = !1, ae = !0, z = 0, F = 0, te = !1, qe = 0, Ae = !1, $e = 0.5, De = 0.5, ue = !1, ze = !1, Fe = null, Te = null, de = !1;
|
|
519
519
|
const ie = new Bt();
|
|
520
|
-
let oe = [],
|
|
521
|
-
const
|
|
522
|
-
s <= 0 || t <= 0 || s === z && t ===
|
|
520
|
+
let oe = [], Ge = !1, Ee = [], ge = null, Oe = [], be = null, en = /* @__PURE__ */ new Set(), nn = /* @__PURE__ */ new Set(), Be = 0, ke = /* @__PURE__ */ new Set(), Ne = /* @__PURE__ */ new Set(), we = null, Pe = !1;
|
|
521
|
+
const Xe = (s, t) => {
|
|
522
|
+
s <= 0 || t <= 0 || s === z && t === F || (we = {
|
|
523
523
|
width: s,
|
|
524
524
|
height: t
|
|
525
525
|
}, Pe || (Pe = !0, requestAnimationFrame(() => {
|
|
526
|
-
if (Pe = !1, !
|
|
527
|
-
const { width: o, height: l } =
|
|
528
|
-
|
|
526
|
+
if (Pe = !1, !we) return;
|
|
527
|
+
const { width: o, height: l } = we;
|
|
528
|
+
we = null, z = o, F = l, Y || (Y = !0), n.setSize(o, l, !1);
|
|
529
529
|
const f = o / l, b = 2, g = b * f;
|
|
530
530
|
a.left = -g / 2, a.right = g / 2, a.top = b / 2, a.bottom = -b / 2, a.updateProjectionMatrix(), m.scale.set(g, b, 1), h.nodes.forEach((w) => {
|
|
531
531
|
w.transformUniforms?.aspectRatio && (w.transformUniforms.aspectRatio.value = f), w.resizeCallbacks.forEach((M) => {
|
|
@@ -534,13 +534,13 @@ function cs() {
|
|
|
534
534
|
width: o,
|
|
535
535
|
height: l
|
|
536
536
|
});
|
|
537
|
-
} catch (
|
|
538
|
-
console.error("Error in resize callback:",
|
|
537
|
+
} catch (E) {
|
|
538
|
+
console.error("Error in resize callback:", E);
|
|
539
539
|
}
|
|
540
540
|
});
|
|
541
541
|
}), re().catch(console.warn);
|
|
542
542
|
})));
|
|
543
|
-
},
|
|
543
|
+
}, Un = () => B && !!n && !!r && !!a && !!p && z > 0 && F > 0 && N, xn = (s) => {
|
|
544
544
|
if (!n || !a || !m) return;
|
|
545
545
|
const t = s[0];
|
|
546
546
|
if (!t) return;
|
|
@@ -550,68 +550,68 @@ function cs() {
|
|
|
550
550
|
f ? (o = Math.round(f.inlineSize), l = Math.round(f.blockSize)) : (o = Math.round(t.contentRect.width), l = Math.round(t.contentRect.height));
|
|
551
551
|
} else
|
|
552
552
|
o = Math.round(t.contentRect.width), l = Math.round(t.contentRect.height);
|
|
553
|
-
o === 0 || l === 0 ||
|
|
554
|
-
},
|
|
553
|
+
o === 0 || l === 0 || Xe(o, l);
|
|
554
|
+
}, Mn = (s) => {
|
|
555
555
|
const t = s[0];
|
|
556
556
|
if (!t) return;
|
|
557
|
-
const o =
|
|
558
|
-
|
|
557
|
+
const o = N;
|
|
558
|
+
N = t.isIntersecting;
|
|
559
559
|
const l = e?.getBoundingClientRect(), f = te;
|
|
560
|
-
if (te =
|
|
560
|
+
if (te = N && !!l && l.width > 0 && l.height > 0, N && !o) {
|
|
561
561
|
if (Ae = !0, e) {
|
|
562
562
|
const { width: b, height: g } = e.getBoundingClientRect(), w = Math.round(b), M = Math.round(g);
|
|
563
|
-
w > 0 && M > 0 && (z === 0 ||
|
|
563
|
+
w > 0 && M > 0 && (z === 0 || F === 0 || w !== z || M !== F ? (Xe(w, M), !f && te && he()) : p && B && h.rootId && (p.needsUpdate = !0, he(), re().catch(console.warn)));
|
|
564
564
|
}
|
|
565
565
|
ae && je();
|
|
566
|
-
} else !
|
|
567
|
-
},
|
|
566
|
+
} else !N && o && Qe();
|
|
567
|
+
}, An = (s, t) => {
|
|
568
568
|
if (s.size !== t.size) return !1;
|
|
569
569
|
for (const o of s) if (!t.has(o)) return !1;
|
|
570
570
|
return !0;
|
|
571
|
-
},
|
|
571
|
+
}, _e = (s) => {
|
|
572
572
|
Be++;
|
|
573
|
-
const t =
|
|
574
|
-
return
|
|
573
|
+
const t = nr(s);
|
|
574
|
+
return ke.add(t), t;
|
|
575
575
|
}, rn = () => {
|
|
576
|
-
|
|
576
|
+
Ne.forEach((s) => {
|
|
577
577
|
try {
|
|
578
578
|
s?.renderTarget?.dispose && s.renderTarget.dispose();
|
|
579
579
|
} catch {
|
|
580
580
|
}
|
|
581
|
-
}),
|
|
581
|
+
}), Ne.clear();
|
|
582
582
|
};
|
|
583
583
|
let ve = !1;
|
|
584
584
|
const he = () => {
|
|
585
|
-
if (!h.rootId || !p ||
|
|
586
|
-
if (z === 0 ||
|
|
585
|
+
if (!h.rootId || !p || ze || !h.nodes.get(h.rootId)) return;
|
|
586
|
+
if (z === 0 || F === 0) {
|
|
587
587
|
ve || (ve = !0, requestAnimationFrame(() => {
|
|
588
|
-
ve = !1, z > 0 &&
|
|
588
|
+
ve = !1, z > 0 && F > 0 && he();
|
|
589
589
|
}));
|
|
590
590
|
return;
|
|
591
591
|
}
|
|
592
|
-
|
|
592
|
+
ze = !0;
|
|
593
593
|
const s = performance.now();
|
|
594
594
|
console.log("[Shaders Perf] Starting updateMaterial()");
|
|
595
595
|
try {
|
|
596
596
|
const t = performance.now();
|
|
597
|
-
|
|
597
|
+
Ne = new Set(ke), ke.clear(), console.log(`[Shaders Perf] Texture management: ${(performance.now() - t).toFixed(2)}ms`);
|
|
598
598
|
const o = /* @__PURE__ */ new Set(), l = performance.now();
|
|
599
599
|
nn.clear(), h.nodes.forEach((g, w) => {
|
|
600
600
|
(g.requiresRTT || g.transformRTTActive) && nn.add(w);
|
|
601
601
|
}), console.log(`[Shaders Perf] RTT tracking rebuild: ${(performance.now() - l).toFixed(2)}ms (${h.nodes.size} nodes)`), Be = 0;
|
|
602
|
-
const f = performance.now(), b =
|
|
602
|
+
const f = performance.now(), b = j(h.rootId, /* @__PURE__ */ new Set(), o);
|
|
603
603
|
if (console.log(`[Shaders Perf] composeNodeTree: ${(performance.now() - f).toFixed(2)}ms (RTT ops: ${Be})`), b && p) {
|
|
604
|
-
const g =
|
|
604
|
+
const g = !An(en, o), w = p.fragmentNode !== b;
|
|
605
605
|
if (g || Ae || w) {
|
|
606
606
|
console.log(`[Shaders Perf] Recompilation needed: compositionChanged=${g}, nodeChanged=${w}, needsRefresh=${Ae}`);
|
|
607
607
|
const M = performance.now();
|
|
608
608
|
rn(), console.log(`[Shaders Perf] Texture disposal: ${(performance.now() - M).toFixed(2)}ms`);
|
|
609
|
-
const
|
|
609
|
+
const E = performance.now();
|
|
610
610
|
try {
|
|
611
611
|
p.dispose(), n.renderTarget && n.renderTarget.dispose();
|
|
612
612
|
} catch {
|
|
613
613
|
}
|
|
614
|
-
console.log(`[Shaders Perf] Material disposal: ${(performance.now() -
|
|
614
|
+
console.log(`[Shaders Perf] Material disposal: ${(performance.now() - E).toFixed(2)}ms`);
|
|
615
615
|
const y = performance.now(), u = new dn({ transparent: !0 });
|
|
616
616
|
u.fragmentNode = b, u.needsUpdate = !0, console.log(`[Shaders Perf] Material creation: ${(performance.now() - y).toFixed(2)}ms`), m.material = u, p = u, Ae = !1, en = o;
|
|
617
617
|
} else console.log("[Shaders Perf] No recompilation needed (composition unchanged)");
|
|
@@ -620,10 +620,10 @@ function cs() {
|
|
|
620
620
|
} catch (t) {
|
|
621
621
|
console.error("Error composing shader tree:", t), console.log(`[Shaders Perf] FAILED after ${(performance.now() - s).toFixed(2)}ms`);
|
|
622
622
|
} finally {
|
|
623
|
-
|
|
623
|
+
ze = !1;
|
|
624
624
|
}
|
|
625
|
-
|
|
626
|
-
},
|
|
625
|
+
N && re().catch(console.warn);
|
|
626
|
+
}, W = (s) => {
|
|
627
627
|
const t = d.get(s);
|
|
628
628
|
if (!t) return [];
|
|
629
629
|
const o = [];
|
|
@@ -632,45 +632,45 @@ function cs() {
|
|
|
632
632
|
f && o.push(f);
|
|
633
633
|
}
|
|
634
634
|
return o;
|
|
635
|
-
},
|
|
635
|
+
}, $n = (s) => {
|
|
636
636
|
for (const [t, o] of h.nodes.entries()) if (o.metadata.id === s) return t;
|
|
637
637
|
return null;
|
|
638
638
|
}, se = (s, t, o, l) => {
|
|
639
639
|
if (!t.metadata.mask?.source) return s;
|
|
640
|
-
const f = t.metadata.mask.source, b =
|
|
640
|
+
const f = t.metadata.mask.source, b = $n(f);
|
|
641
641
|
if (!b) return s;
|
|
642
642
|
if (l.has(b))
|
|
643
643
|
return console.error("Uh oh, looks like you've got a circular dependency in your shader masks."), s;
|
|
644
644
|
const g = new Set(l);
|
|
645
|
-
return g.add(o), Ot(s,
|
|
645
|
+
return g.add(o), Ot(s, j(b, g), t.metadata.mask.type || "alpha");
|
|
646
646
|
}, le = (s, t) => {
|
|
647
647
|
if (!t.metadata.transform || !t.transformUniforms || !fe(t.metadata.transform) && !t.transformRTTActive) return s;
|
|
648
|
-
const o =
|
|
649
|
-
return
|
|
650
|
-
},
|
|
648
|
+
const o = _e(s), l = Ue(Ce, t.transformUniforms.offsetX, t.transformUniforms.offsetY, t.transformUniforms.rotation, t.transformUniforms.scale, t.transformUniforms.anchorX, t.transformUniforms.anchorY, t.transformUniforms.aspectRatio);
|
|
649
|
+
return Re(l, o.sample(l), o, t.transformUniforms.edges);
|
|
650
|
+
}, H = (s) => !!s.uvTransformFunc && s.requiresChild && s.metadata.blendMode === "normal" && (s.metadata.opacity === void 0 || s.metadata.opacity === 1) && s.metadata.visible !== !1 && !s.metadata.mask?.source && !(s.transformUniforms && s.metadata.transform && fe(s.metadata.transform)), Ye = (s) => {
|
|
651
651
|
const t = [];
|
|
652
652
|
let o = s;
|
|
653
653
|
for (; o; ) {
|
|
654
654
|
const l = h.nodes.get(o);
|
|
655
|
-
if (!l || !
|
|
655
|
+
if (!l || !H(l)) break;
|
|
656
656
|
t.push(l);
|
|
657
|
-
const f =
|
|
657
|
+
const f = W(l.id);
|
|
658
658
|
if (f.length !== 1) break;
|
|
659
659
|
const b = f[0];
|
|
660
|
-
if (
|
|
660
|
+
if (H(b)) o = b.id;
|
|
661
661
|
else break;
|
|
662
662
|
}
|
|
663
663
|
return t;
|
|
664
664
|
}, Dn = (s) => {
|
|
665
665
|
if (s.length === 0) return null;
|
|
666
|
-
const t = s[s.length - 1], o =
|
|
666
|
+
const t = s[s.length - 1], o = W(t.id);
|
|
667
667
|
return o.length === 0 ? null : o.length === 1 ? o[0] : null;
|
|
668
|
-
},
|
|
669
|
-
if (!s.uvTransformFunc || !
|
|
670
|
-
const t =
|
|
668
|
+
}, Ve = (s) => {
|
|
669
|
+
if (!s.uvTransformFunc || !H(s)) return !1;
|
|
670
|
+
const t = W(s.id);
|
|
671
671
|
if (t.length !== 1) return !1;
|
|
672
672
|
const o = t[0];
|
|
673
|
-
return o.acceptsUVContext && !o.requiresChild ? !0 : o.uvTransformFunc &&
|
|
673
|
+
return o.acceptsUVContext && !o.requiresChild ? !0 : o.uvTransformFunc && H(o) ? Ve(o) : !1;
|
|
674
674
|
}, Ie = (s, t, o) => {
|
|
675
675
|
const l = [];
|
|
676
676
|
let f = s;
|
|
@@ -678,9 +678,9 @@ function cs() {
|
|
|
678
678
|
const v = h.nodes.get(f);
|
|
679
679
|
if (!v) break;
|
|
680
680
|
if (l.length >= 2)
|
|
681
|
-
return console.log(`[Shaders Perf] UV chain depth limit reached (${l.length}), falling back to RTT`),
|
|
681
|
+
return console.log(`[Shaders Perf] UV chain depth limit reached (${l.length}), falling back to RTT`), j(s, t, o, !0);
|
|
682
682
|
if (l.push(v), o && o.add(v.id), v.acceptsUVContext && !v.requiresChild) break;
|
|
683
|
-
const c =
|
|
683
|
+
const c = W(f);
|
|
684
684
|
if (c.length !== 1) break;
|
|
685
685
|
f = c[0].id;
|
|
686
686
|
}
|
|
@@ -692,26 +692,26 @@ function cs() {
|
|
|
692
692
|
c.uvTransformFunc && (g = c.uvTransformFunc({
|
|
693
693
|
uv: g,
|
|
694
694
|
uniforms: c.uniforms,
|
|
695
|
-
viewportSize:
|
|
695
|
+
viewportSize: ye
|
|
696
696
|
})), c.transformUniforms && c.metadata.transform && fe(c.metadata.transform) && (g = Ue(g, c.transformUniforms.offsetX, c.transformUniforms.offsetY, c.transformUniforms.rotation, c.transformUniforms.scale, c.transformUniforms.anchorX, c.transformUniforms.anchorY, c.transformUniforms.aspectRatio), c.transformUniforms.edges && (g = ce(g, c.transformUniforms.edges)), c.transformRTTActive = !0);
|
|
697
697
|
}
|
|
698
698
|
for (let v = 0; v < l.length - 1; v++) {
|
|
699
699
|
const c = l[v];
|
|
700
700
|
if (!c.requiresChild) continue;
|
|
701
|
-
const $ = (
|
|
702
|
-
c.cleanupCallbacks.push(
|
|
703
|
-
}, P = (
|
|
704
|
-
c.beforeRenderCallbacks.push(
|
|
705
|
-
}, T = (
|
|
706
|
-
c.afterRenderCallbacks.push(
|
|
707
|
-
},
|
|
708
|
-
c.resizeCallbacks.push(
|
|
701
|
+
const $ = (O) => {
|
|
702
|
+
c.cleanupCallbacks.push(O);
|
|
703
|
+
}, P = (O) => {
|
|
704
|
+
c.beforeRenderCallbacks.push(O);
|
|
705
|
+
}, T = (O) => {
|
|
706
|
+
c.afterRenderCallbacks.push(O);
|
|
707
|
+
}, S = (O) => {
|
|
708
|
+
c.resizeCallbacks.push(O);
|
|
709
709
|
};
|
|
710
|
-
c.cleanupCallbacks.forEach((
|
|
710
|
+
c.cleanupCallbacks.forEach((O) => {
|
|
711
711
|
try {
|
|
712
|
-
|
|
713
|
-
} catch (
|
|
714
|
-
console.error("Error in cleanup callback:",
|
|
712
|
+
O();
|
|
713
|
+
} catch (Q) {
|
|
714
|
+
console.error("Error in cleanup callback:", Q);
|
|
715
715
|
}
|
|
716
716
|
}), c.cleanupCallbacks = [], c.beforeRenderCallbacks = [], c.afterRenderCallbacks = [], c.resizeCallbacks = [], c.fragmentNodeFunc({
|
|
717
717
|
uniforms: c.uniforms ?? {},
|
|
@@ -720,11 +720,11 @@ function cs() {
|
|
|
720
720
|
onCleanup: $,
|
|
721
721
|
onBeforeRender: P,
|
|
722
722
|
onAfterRender: T,
|
|
723
|
-
onResize:
|
|
723
|
+
onResize: S,
|
|
724
724
|
canvas: e,
|
|
725
725
|
dimensions: {
|
|
726
726
|
width: z,
|
|
727
|
-
height:
|
|
727
|
+
height: F
|
|
728
728
|
},
|
|
729
729
|
renderer: n
|
|
730
730
|
});
|
|
@@ -733,7 +733,7 @@ function cs() {
|
|
|
733
733
|
b.cleanupCallbacks.push(v);
|
|
734
734
|
}, M = (v) => {
|
|
735
735
|
b.beforeRenderCallbacks.push(v);
|
|
736
|
-
},
|
|
736
|
+
}, E = (v) => {
|
|
737
737
|
b.afterRenderCallbacks.push(v);
|
|
738
738
|
}, y = (v) => {
|
|
739
739
|
b.resizeCallbacks.push(v);
|
|
@@ -751,69 +751,69 @@ function cs() {
|
|
|
751
751
|
uvContext: g,
|
|
752
752
|
onCleanup: w,
|
|
753
753
|
onBeforeRender: M,
|
|
754
|
-
onAfterRender:
|
|
754
|
+
onAfterRender: E,
|
|
755
755
|
onResize: y,
|
|
756
756
|
canvas: e,
|
|
757
757
|
dimensions: {
|
|
758
758
|
width: z,
|
|
759
|
-
height:
|
|
759
|
+
height: F
|
|
760
760
|
},
|
|
761
761
|
renderer: n
|
|
762
762
|
});
|
|
763
|
-
for (const v of l) if (v.uniforms.edges?.uniform) return
|
|
763
|
+
for (const v of l) if (v.uniforms.edges?.uniform) return Re(g, u, null, v.uniforms.edges.uniform);
|
|
764
764
|
return u;
|
|
765
765
|
}, He = (s, t, o) => {
|
|
766
766
|
if (s.length === 0) return x(0, 0, 0, 0);
|
|
767
767
|
const l = Dn(s);
|
|
768
768
|
let f;
|
|
769
|
-
if (l) f =
|
|
769
|
+
if (l) f = j(l.id, t, o);
|
|
770
770
|
else return x(0, 0, 0, 0);
|
|
771
|
-
const b =
|
|
771
|
+
const b = _e(f);
|
|
772
772
|
let g = Ce;
|
|
773
|
-
for (let
|
|
774
|
-
const y = s[
|
|
773
|
+
for (let E = s.length - 1; E >= 0; E--) {
|
|
774
|
+
const y = s[E];
|
|
775
775
|
y.uvTransformFunc && (g = y.uvTransformFunc({
|
|
776
776
|
uv: g,
|
|
777
777
|
uniforms: y.uniforms,
|
|
778
|
-
viewportSize:
|
|
778
|
+
viewportSize: ye
|
|
779
779
|
}), y.uniforms.edges?.uniform && (g = ce(g, y.uniforms.edges.uniform))), o && o.add(y.id);
|
|
780
780
|
}
|
|
781
781
|
const w = b.sample(g), M = s[0];
|
|
782
|
-
return M.uniforms.edges?.uniform ?
|
|
782
|
+
return M.uniforms.edges?.uniform ? Re(g, w, b, M.uniforms.edges.uniform) : w;
|
|
783
783
|
}, tn = (s, t) => {
|
|
784
784
|
const o = [];
|
|
785
785
|
for (let l = t; l < s.length; l++) {
|
|
786
786
|
const f = s[l];
|
|
787
|
-
if (!
|
|
787
|
+
if (!H(f) || W(f.id).length > 0) break;
|
|
788
788
|
o.push(f);
|
|
789
789
|
}
|
|
790
790
|
return o;
|
|
791
791
|
}, on = (s, t, o) => {
|
|
792
792
|
if (s.length === 0) return t;
|
|
793
|
-
const l =
|
|
793
|
+
const l = _e(t);
|
|
794
794
|
let f = Ce;
|
|
795
795
|
for (let w = s.length - 1; w >= 0; w--) {
|
|
796
796
|
const M = s[w];
|
|
797
797
|
M.uvTransformFunc && (f = M.uvTransformFunc({
|
|
798
798
|
uv: f,
|
|
799
799
|
uniforms: M.uniforms,
|
|
800
|
-
viewportSize:
|
|
800
|
+
viewportSize: ye
|
|
801
801
|
}), M.uniforms.edges?.uniform && (f = ce(f, M.uniforms.edges.uniform))), o && o.add(M.id);
|
|
802
802
|
}
|
|
803
803
|
const b = l.sample(f), g = s[s.length - 1];
|
|
804
|
-
return g.uniforms.edges?.uniform ?
|
|
804
|
+
return g.uniforms.edges?.uniform ? Re(f, b, l, g.uniforms.edges.uniform) : b;
|
|
805
805
|
}, sn = (s) => {
|
|
806
806
|
const t = [], o = [];
|
|
807
807
|
let l = !1;
|
|
808
808
|
for (let g = 0; g < s.length; g++) {
|
|
809
|
-
const w = s[g], M =
|
|
810
|
-
w.acceptsUVContext && !w.requiresChild && t.push(g),
|
|
809
|
+
const w = s[g], M = W(w.id).length > 0;
|
|
810
|
+
w.acceptsUVContext && !w.requiresChild && t.push(g), H(w) && !M && (o.push(g), t.length > 0 && (l = !0));
|
|
811
811
|
}
|
|
812
812
|
if (t.length === 0 || o.length === 0 || !l) return !1;
|
|
813
813
|
const f = Math.min(...t), b = Math.max(...o);
|
|
814
814
|
for (let g = f + 1; g < b; g++) {
|
|
815
815
|
const w = s[g];
|
|
816
|
-
if (w.requiresRTT && !
|
|
816
|
+
if (w.requiresRTT && !H(w) && !(w.acceptsUVContext && !w.requiresChild)) return !1;
|
|
817
817
|
}
|
|
818
818
|
return o.length > 2 ? (console.log(`[Shaders Perf] Too many distortions in sibling group (${o.length}), skipping UV propagation`), !1) : !0;
|
|
819
819
|
}, an = (s, t, o) => {
|
|
@@ -821,8 +821,8 @@ function cs() {
|
|
|
821
821
|
console.log(`[Shaders Perf] composeSiblingsWithUVContext (${s.length} children)`);
|
|
822
822
|
const f = performance.now(), b = [], g = [];
|
|
823
823
|
s.forEach((y, u) => {
|
|
824
|
-
const v =
|
|
825
|
-
|
|
824
|
+
const v = W(y.id).length > 0;
|
|
825
|
+
H(y) && !v ? g.push({
|
|
826
826
|
node: y,
|
|
827
827
|
index: u
|
|
828
828
|
}) : y.acceptsUVContext && !y.requiresChild && !v && b.push({
|
|
@@ -836,8 +836,8 @@ function cs() {
|
|
|
836
836
|
u.cleanupCallbacks.forEach((T) => {
|
|
837
837
|
try {
|
|
838
838
|
T();
|
|
839
|
-
} catch (
|
|
840
|
-
console.error("Cleanup error:",
|
|
839
|
+
} catch (S) {
|
|
840
|
+
console.error("Cleanup error:", S);
|
|
841
841
|
}
|
|
842
842
|
}), u.cleanupCallbacks = [], u.beforeRenderCallbacks = [], u.afterRenderCallbacks = [], u.resizeCallbacks = [];
|
|
843
843
|
const v = (T) => u.cleanupCallbacks.push(T), c = (T) => u.beforeRenderCallbacks.push(T), $ = (T) => u.afterRenderCallbacks.push(T), P = (T) => u.resizeCallbacks.push(T);
|
|
@@ -852,114 +852,116 @@ function cs() {
|
|
|
852
852
|
canvas: e,
|
|
853
853
|
dimensions: {
|
|
854
854
|
width: z,
|
|
855
|
-
height:
|
|
855
|
+
height: F
|
|
856
856
|
},
|
|
857
857
|
renderer: n
|
|
858
858
|
}), o && o.add(u.id);
|
|
859
859
|
}
|
|
860
860
|
console.log(`[Shaders Perf] Callback registration: ${(performance.now() - w).toFixed(2)}ms (${g.length} distortions)`);
|
|
861
861
|
const M = performance.now();
|
|
862
|
-
let
|
|
862
|
+
let E;
|
|
863
863
|
for (let y = 0; y < s.length; y++) {
|
|
864
864
|
const u = s[y];
|
|
865
865
|
if (u.metadata.visible === !1) continue;
|
|
866
866
|
const v = u.metadata.opacity ?? 1;
|
|
867
867
|
u.opacityUniform.value = v, o && o.add(u.id);
|
|
868
|
-
const c =
|
|
868
|
+
const c = W(u.id).length > 0;
|
|
869
869
|
let $;
|
|
870
870
|
const P = b.find((T) => T.index === y);
|
|
871
871
|
if (P) {
|
|
872
872
|
const T = g.filter((_) => _.index > P.index).sort((_, q) => _.index - q.index).map((_) => _.node);
|
|
873
|
-
let
|
|
873
|
+
let S = Ce;
|
|
874
874
|
for (let _ = T.length - 1; _ >= 0; _--) {
|
|
875
875
|
const q = T[_];
|
|
876
|
-
q.uvTransformFunc && (
|
|
877
|
-
uv:
|
|
876
|
+
q.uvTransformFunc && (S = q.uvTransformFunc({
|
|
877
|
+
uv: S,
|
|
878
878
|
uniforms: q.uniforms,
|
|
879
|
-
viewportSize:
|
|
880
|
-
})), q.transformUniforms && q.metadata.transform && fe(q.metadata.transform) && (
|
|
879
|
+
viewportSize: ye
|
|
880
|
+
})), q.transformUniforms && q.metadata.transform && fe(q.metadata.transform) && (S = Ue(S, q.transformUniforms.offsetX, q.transformUniforms.offsetY, q.transformUniforms.rotation, q.transformUniforms.scale, q.transformUniforms.anchorX, q.transformUniforms.anchorY, q.transformUniforms.aspectRatio), q.transformUniforms.edges && (S = ce(S, q.transformUniforms.edges)), q.transformRTTActive = !0), q.uniforms.edges?.uniform && (S = ce(S, q.uniforms.edges.uniform));
|
|
881
881
|
}
|
|
882
|
-
P.node.transformUniforms && P.node.metadata.transform && fe(P.node.metadata.transform) && (
|
|
882
|
+
P.node.transformUniforms && P.node.metadata.transform && fe(P.node.metadata.transform) && (S = Ue(S, P.node.transformUniforms.offsetX, P.node.transformUniforms.offsetY, P.node.transformUniforms.rotation, P.node.transformUniforms.scale, P.node.transformUniforms.anchorX, P.node.transformUniforms.anchorY, P.node.transformUniforms.aspectRatio), P.node.transformUniforms.edges && (S = ce(S, P.node.transformUniforms.edges)), P.node.transformRTTActive = !0), u.cleanupCallbacks.forEach((_) => {
|
|
883
883
|
try {
|
|
884
884
|
_();
|
|
885
885
|
} catch (q) {
|
|
886
886
|
console.error("Cleanup error:", q);
|
|
887
887
|
}
|
|
888
888
|
}), u.cleanupCallbacks = [], u.beforeRenderCallbacks = [], u.afterRenderCallbacks = [], u.resizeCallbacks = [];
|
|
889
|
-
const
|
|
889
|
+
const O = (_) => u.cleanupCallbacks.push(_), Q = (_) => u.beforeRenderCallbacks.push(_), J = (_) => u.afterRenderCallbacks.push(_), A = (_) => u.resizeCallbacks.push(_);
|
|
890
890
|
let L = u.fragmentNodeFunc({
|
|
891
891
|
uniforms: u.uniforms ?? {},
|
|
892
892
|
childNode: void 0,
|
|
893
|
-
uvContext:
|
|
894
|
-
onCleanup:
|
|
895
|
-
onBeforeRender:
|
|
896
|
-
onAfterRender:
|
|
897
|
-
onResize:
|
|
893
|
+
uvContext: S,
|
|
894
|
+
onCleanup: O,
|
|
895
|
+
onBeforeRender: Q,
|
|
896
|
+
onAfterRender: J,
|
|
897
|
+
onResize: A,
|
|
898
898
|
canvas: e,
|
|
899
899
|
dimensions: {
|
|
900
900
|
width: z,
|
|
901
|
-
height:
|
|
901
|
+
height: F
|
|
902
902
|
},
|
|
903
903
|
renderer: n
|
|
904
904
|
});
|
|
905
905
|
if (T.length > 0) {
|
|
906
906
|
const _ = T[0];
|
|
907
|
-
_.uniforms.edges?.uniform && (L =
|
|
907
|
+
_.uniforms.edges?.uniform && (L = Re(S, L, null, _.uniforms.edges.uniform));
|
|
908
908
|
}
|
|
909
909
|
$ = se(L, u, u.id, t);
|
|
910
910
|
} else {
|
|
911
911
|
if (g.find((T) => T.index === y)) continue;
|
|
912
912
|
if (c) {
|
|
913
|
-
if (
|
|
914
|
-
else if (
|
|
915
|
-
const
|
|
916
|
-
|
|
917
|
-
} else $ =
|
|
918
|
-
const T = g.filter((
|
|
913
|
+
if (Ve(u)) $ = Ie(u.id, t, o);
|
|
914
|
+
else if (H(u)) {
|
|
915
|
+
const S = Ye(u.id);
|
|
916
|
+
S.length > 1 ? $ = He(S, t, o) : $ = j(u.id, t, o);
|
|
917
|
+
} else $ = j(u.id, t, o);
|
|
918
|
+
const T = g.filter((S) => S.index > y).sort((S, O) => S.index - O.index).map((S) => S.node);
|
|
919
919
|
if (T.length > 0) {
|
|
920
|
-
const
|
|
921
|
-
let
|
|
922
|
-
for (let
|
|
923
|
-
const
|
|
924
|
-
|
|
925
|
-
uv:
|
|
926
|
-
uniforms:
|
|
927
|
-
viewportSize:
|
|
928
|
-
})),
|
|
920
|
+
const S = _e($);
|
|
921
|
+
let O = Ce;
|
|
922
|
+
for (let J = T.length - 1; J >= 0; J--) {
|
|
923
|
+
const A = T[J];
|
|
924
|
+
A.uvTransformFunc && (O = A.uvTransformFunc({
|
|
925
|
+
uv: O,
|
|
926
|
+
uniforms: A.uniforms,
|
|
927
|
+
viewportSize: ye
|
|
928
|
+
})), A.transformUniforms && A.metadata.transform && fe(A.metadata.transform) && (O = Ue(O, A.transformUniforms.offsetX, A.transformUniforms.offsetY, A.transformUniforms.rotation, A.transformUniforms.scale, A.transformUniforms.anchorX, A.transformUniforms.anchorY, A.transformUniforms.aspectRatio), A.transformUniforms.edges && (O = ce(O, A.transformUniforms.edges)), A.transformRTTActive = !0), A.uniforms.edges?.uniform && (O = ce(O, A.uniforms.edges.uniform));
|
|
929
929
|
}
|
|
930
|
-
$ =
|
|
930
|
+
$ = S.sample(O);
|
|
931
|
+
const Q = T[T.length - 1];
|
|
932
|
+
Q.transformUniforms?.edges && ($ = Re(O, $, S, Q.transformUniforms.edges));
|
|
931
933
|
}
|
|
932
934
|
} else {
|
|
933
|
-
u.cleanupCallbacks.forEach((
|
|
935
|
+
u.cleanupCallbacks.forEach((A) => {
|
|
934
936
|
try {
|
|
935
|
-
|
|
937
|
+
A();
|
|
936
938
|
} catch (L) {
|
|
937
939
|
console.error("Cleanup error:", L);
|
|
938
940
|
}
|
|
939
941
|
}), u.cleanupCallbacks = [], u.beforeRenderCallbacks = [], u.afterRenderCallbacks = [], u.resizeCallbacks = [];
|
|
940
|
-
const T = (
|
|
941
|
-
let
|
|
942
|
-
u.requiresRTT &&
|
|
942
|
+
const T = (A) => u.cleanupCallbacks.push(A), S = (A) => u.beforeRenderCallbacks.push(A), O = (A) => u.afterRenderCallbacks.push(A), Q = (A) => u.resizeCallbacks.push(A);
|
|
943
|
+
let J = E;
|
|
944
|
+
u.requiresRTT && E !== void 0 && (J = K(x(0, 0, 0, 0), E, "normal", 1)), $ = se(le(u.fragmentNodeFunc({
|
|
943
945
|
uniforms: u.uniforms ?? {},
|
|
944
|
-
childNode:
|
|
946
|
+
childNode: J,
|
|
945
947
|
onCleanup: T,
|
|
946
|
-
onBeforeRender:
|
|
947
|
-
onAfterRender:
|
|
948
|
-
onResize:
|
|
948
|
+
onBeforeRender: S,
|
|
949
|
+
onAfterRender: O,
|
|
950
|
+
onResize: Q,
|
|
949
951
|
canvas: e,
|
|
950
952
|
dimensions: {
|
|
951
953
|
width: z,
|
|
952
|
-
height:
|
|
954
|
+
height: F
|
|
953
955
|
},
|
|
954
956
|
renderer: n
|
|
955
957
|
}), u), u, u.id, t);
|
|
956
958
|
}
|
|
957
959
|
}
|
|
958
|
-
u.requiresChild && u.metadata.blendMode === "normal" && !c ?
|
|
960
|
+
u.requiresChild && u.metadata.blendMode === "normal" && !c ? E = K(x(0, 0, 0, 0), $, "normal", u.opacityUniform) : E === void 0 ? E = K(x(1, 1, 1, 0), $, u.metadata.blendMode, u.opacityUniform) : E = K(E, $, u.metadata.blendMode, u.opacityUniform);
|
|
959
961
|
}
|
|
960
|
-
return console.log(`[Shaders Perf] Node processing: ${(performance.now() - M).toFixed(2)}ms`), console.log(`[Shaders Perf] TOTAL composeSiblingsWithUVContext: ${(performance.now() - l).toFixed(2)}ms`),
|
|
961
|
-
},
|
|
962
|
-
if (z === 0 ||
|
|
962
|
+
return console.log(`[Shaders Perf] Node processing: ${(performance.now() - M).toFixed(2)}ms`), console.log(`[Shaders Perf] TOTAL composeSiblingsWithUVContext: ${(performance.now() - l).toFixed(2)}ms`), E ?? x(0, 0, 0, 0);
|
|
963
|
+
}, j = (s, t = /* @__PURE__ */ new Set(), o, l = !1) => {
|
|
964
|
+
if (z === 0 || F === 0) return x(0, 0, 0, 0);
|
|
963
965
|
const f = h.nodes.get(s);
|
|
964
966
|
if (!f) return x(0, 0, 0, 0);
|
|
965
967
|
const b = (y) => {
|
|
@@ -970,8 +972,8 @@ function cs() {
|
|
|
970
972
|
f.afterRenderCallbacks.push(y);
|
|
971
973
|
}, M = (y) => {
|
|
972
974
|
f.resizeCallbacks.push(y);
|
|
973
|
-
},
|
|
974
|
-
if (
|
|
975
|
+
}, E = W(s);
|
|
976
|
+
if (E.length === 0)
|
|
975
977
|
return f.requiresRTT && !te ? x(0, 0, 0, 0) : (f.cleanupCallbacks.forEach((y) => {
|
|
976
978
|
try {
|
|
977
979
|
y();
|
|
@@ -988,12 +990,12 @@ function cs() {
|
|
|
988
990
|
canvas: e,
|
|
989
991
|
dimensions: {
|
|
990
992
|
width: z,
|
|
991
|
-
height:
|
|
993
|
+
height: F
|
|
992
994
|
},
|
|
993
995
|
renderer: n
|
|
994
996
|
}), f), f, s, t));
|
|
995
997
|
{
|
|
996
|
-
const y = [...
|
|
998
|
+
const y = [...E].sort((u, v) => u.metadata.renderOrder - v.metadata.renderOrder);
|
|
997
999
|
if (f.parentId === null) {
|
|
998
1000
|
if (!l && sn(y)) return se(le(an(y, t, o), f), f, s, t);
|
|
999
1001
|
let u;
|
|
@@ -1002,35 +1004,35 @@ function cs() {
|
|
|
1002
1004
|
let $;
|
|
1003
1005
|
if (c.metadata.opacity === void 0 ? ($ = 1, c.opacityUniform.value = $) : ($ = c.metadata.opacity, c.opacityUniform.value = $), c.metadata.visible === !1) continue;
|
|
1004
1006
|
o && o.add(c.id);
|
|
1005
|
-
const P =
|
|
1007
|
+
const P = W(c.id).length > 0;
|
|
1006
1008
|
let T;
|
|
1007
|
-
if (P) if (l) T =
|
|
1008
|
-
else if (
|
|
1009
|
-
else if (
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1012
|
-
} else T =
|
|
1009
|
+
if (P) if (l) T = j(c.id, t, o, !0);
|
|
1010
|
+
else if (Ve(c)) T = Ie(c.id, t, o);
|
|
1011
|
+
else if (H(c)) {
|
|
1012
|
+
const S = Ye(c.id);
|
|
1013
|
+
S.length > 1 ? T = He(S, t, o) : T = j(c.id, t, o);
|
|
1014
|
+
} else T = j(c.id, t, o);
|
|
1013
1015
|
else {
|
|
1014
|
-
if (
|
|
1015
|
-
const
|
|
1016
|
-
if (
|
|
1017
|
-
T = on(
|
|
1016
|
+
if (H(c) && c.requiresChild && u !== void 0) {
|
|
1017
|
+
const S = tn(y, v);
|
|
1018
|
+
if (S.length > 1) {
|
|
1019
|
+
T = on(S, u, o), v += S.length - 1, u = T;
|
|
1018
1020
|
continue;
|
|
1019
1021
|
}
|
|
1020
1022
|
}
|
|
1021
1023
|
if (c.requiresRTT && !te) T = x(0, 0, 0, 0);
|
|
1022
1024
|
else {
|
|
1023
|
-
const
|
|
1025
|
+
const S = (L) => {
|
|
1024
1026
|
c.cleanupCallbacks.push(L);
|
|
1025
|
-
},
|
|
1027
|
+
}, O = (L) => {
|
|
1026
1028
|
c.beforeRenderCallbacks.push(L);
|
|
1027
|
-
},
|
|
1029
|
+
}, Q = (L) => {
|
|
1028
1030
|
c.afterRenderCallbacks.push(L);
|
|
1029
|
-
},
|
|
1031
|
+
}, J = (L) => {
|
|
1030
1032
|
c.resizeCallbacks.push(L);
|
|
1031
1033
|
};
|
|
1032
|
-
let
|
|
1033
|
-
c.requiresRTT && u !== void 0 && (
|
|
1034
|
+
let A = u;
|
|
1035
|
+
c.requiresRTT && u !== void 0 && (A = K(x(0, 0, 0, 0), u, "normal", 1)), c.cleanupCallbacks.forEach((L) => {
|
|
1034
1036
|
try {
|
|
1035
1037
|
L();
|
|
1036
1038
|
} catch (_) {
|
|
@@ -1038,15 +1040,15 @@ function cs() {
|
|
|
1038
1040
|
}
|
|
1039
1041
|
}), c.cleanupCallbacks = [], c.beforeRenderCallbacks = [], c.afterRenderCallbacks = [], c.resizeCallbacks = [], T = se(le(c.fragmentNodeFunc({
|
|
1040
1042
|
uniforms: c.uniforms ?? {},
|
|
1041
|
-
childNode:
|
|
1042
|
-
onCleanup:
|
|
1043
|
-
onBeforeRender:
|
|
1044
|
-
onAfterRender:
|
|
1045
|
-
onResize:
|
|
1043
|
+
childNode: A,
|
|
1044
|
+
onCleanup: S,
|
|
1045
|
+
onBeforeRender: O,
|
|
1046
|
+
onAfterRender: Q,
|
|
1047
|
+
onResize: J,
|
|
1046
1048
|
canvas: e,
|
|
1047
1049
|
dimensions: {
|
|
1048
1050
|
width: z,
|
|
1049
|
-
height:
|
|
1051
|
+
height: F
|
|
1050
1052
|
},
|
|
1051
1053
|
renderer: n
|
|
1052
1054
|
}), c), c, c.id, t);
|
|
@@ -1070,7 +1072,7 @@ function cs() {
|
|
|
1070
1072
|
canvas: e,
|
|
1071
1073
|
dimensions: {
|
|
1072
1074
|
width: z,
|
|
1073
|
-
height:
|
|
1075
|
+
height: F
|
|
1074
1076
|
},
|
|
1075
1077
|
renderer: n
|
|
1076
1078
|
}), f), f, s, t));
|
|
@@ -1087,7 +1089,7 @@ function cs() {
|
|
|
1087
1089
|
canvas: e,
|
|
1088
1090
|
dimensions: {
|
|
1089
1091
|
width: z,
|
|
1090
|
-
height:
|
|
1092
|
+
height: F
|
|
1091
1093
|
},
|
|
1092
1094
|
renderer: n
|
|
1093
1095
|
}), f), f, s, t);
|
|
@@ -1098,45 +1100,45 @@ function cs() {
|
|
|
1098
1100
|
let $;
|
|
1099
1101
|
if (c.metadata.opacity === void 0 ? ($ = 1, c.opacityUniform.value = $) : ($ = c.metadata.opacity, c.opacityUniform.value = $), c.metadata.visible === !1) continue;
|
|
1100
1102
|
o && o.add(c.id);
|
|
1101
|
-
const P =
|
|
1103
|
+
const P = W(c.id).length > 0;
|
|
1102
1104
|
let T;
|
|
1103
|
-
if (P) if (l) T =
|
|
1104
|
-
else if (
|
|
1105
|
-
else if (
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1108
|
-
} else T =
|
|
1105
|
+
if (P) if (l) T = j(c.id, t, o, !0);
|
|
1106
|
+
else if (Ve(c)) T = Ie(c.id, t, o);
|
|
1107
|
+
else if (H(c)) {
|
|
1108
|
+
const S = Ye(c.id);
|
|
1109
|
+
S.length > 1 ? T = He(S, t, o) : T = j(c.id, t, o);
|
|
1110
|
+
} else T = j(c.id, t, o);
|
|
1109
1111
|
else {
|
|
1110
|
-
if (
|
|
1111
|
-
const
|
|
1112
|
-
if (
|
|
1113
|
-
T = on(
|
|
1112
|
+
if (H(c) && c.requiresChild && u !== void 0) {
|
|
1113
|
+
const S = tn(y, v);
|
|
1114
|
+
if (S.length > 1) {
|
|
1115
|
+
T = on(S, u, o), v += S.length - 1, u = T;
|
|
1114
1116
|
continue;
|
|
1115
1117
|
}
|
|
1116
1118
|
}
|
|
1117
1119
|
if (c.requiresRTT && !te) T = x(0, 0, 0, 0);
|
|
1118
1120
|
else {
|
|
1119
|
-
const
|
|
1121
|
+
const S = (L) => {
|
|
1120
1122
|
c.cleanupCallbacks.push(L);
|
|
1121
|
-
},
|
|
1123
|
+
}, O = (L) => {
|
|
1122
1124
|
c.beforeRenderCallbacks.push(L);
|
|
1123
|
-
},
|
|
1125
|
+
}, Q = (L) => {
|
|
1124
1126
|
c.afterRenderCallbacks.push(L);
|
|
1125
|
-
},
|
|
1127
|
+
}, J = (L) => {
|
|
1126
1128
|
c.resizeCallbacks.push(L);
|
|
1127
1129
|
};
|
|
1128
|
-
let
|
|
1129
|
-
c.requiresRTT && u !== void 0 && (
|
|
1130
|
+
let A = u;
|
|
1131
|
+
c.requiresRTT && u !== void 0 && (A = K(x(0, 0, 0, 0), u, "normal", 1)), c.cleanupCallbacks = [], c.beforeRenderCallbacks = [], c.afterRenderCallbacks = [], c.resizeCallbacks = [], T = se(le(c.fragmentNodeFunc({
|
|
1130
1132
|
uniforms: c.uniforms ?? {},
|
|
1131
|
-
childNode:
|
|
1132
|
-
onCleanup:
|
|
1133
|
-
onBeforeRender:
|
|
1134
|
-
onAfterRender:
|
|
1135
|
-
onResize:
|
|
1133
|
+
childNode: A,
|
|
1134
|
+
onCleanup: S,
|
|
1135
|
+
onBeforeRender: O,
|
|
1136
|
+
onAfterRender: Q,
|
|
1137
|
+
onResize: J,
|
|
1136
1138
|
canvas: e,
|
|
1137
1139
|
dimensions: {
|
|
1138
1140
|
width: z,
|
|
1139
|
-
height:
|
|
1141
|
+
height: F
|
|
1140
1142
|
},
|
|
1141
1143
|
renderer: n
|
|
1142
1144
|
}), c), c, c.id, t);
|
|
@@ -1160,7 +1162,7 @@ function cs() {
|
|
|
1160
1162
|
canvas: e,
|
|
1161
1163
|
dimensions: {
|
|
1162
1164
|
width: z,
|
|
1163
|
-
height:
|
|
1165
|
+
height: F
|
|
1164
1166
|
},
|
|
1165
1167
|
renderer: n
|
|
1166
1168
|
}), f), f, s, t));
|
|
@@ -1176,7 +1178,7 @@ function cs() {
|
|
|
1176
1178
|
We(s);
|
|
1177
1179
|
return;
|
|
1178
1180
|
}
|
|
1179
|
-
if (!
|
|
1181
|
+
if (!Ge) {
|
|
1180
1182
|
const u = oe.findIndex((v) => v.id === s);
|
|
1181
1183
|
u !== -1 ? oe[u] = {
|
|
1182
1184
|
id: s,
|
|
@@ -1207,22 +1209,22 @@ function cs() {
|
|
|
1207
1209
|
g = v + 1;
|
|
1208
1210
|
}
|
|
1209
1211
|
}
|
|
1210
|
-
const w =
|
|
1212
|
+
const w = G(l?.opacity !== void 0 ? l.opacity : 1);
|
|
1211
1213
|
let M;
|
|
1212
1214
|
if (l?.transform) {
|
|
1213
|
-
const u = z / Math.max(1,
|
|
1215
|
+
const u = z / Math.max(1, F);
|
|
1214
1216
|
M = {
|
|
1215
|
-
offsetX:
|
|
1216
|
-
offsetY:
|
|
1217
|
-
rotation:
|
|
1218
|
-
scale:
|
|
1219
|
-
anchorX:
|
|
1220
|
-
anchorY:
|
|
1221
|
-
edges:
|
|
1222
|
-
aspectRatio:
|
|
1217
|
+
offsetX: G(l.transform.offsetX),
|
|
1218
|
+
offsetY: G(l.transform.offsetY),
|
|
1219
|
+
rotation: G(l.transform.rotation),
|
|
1220
|
+
scale: G(l.transform.scale),
|
|
1221
|
+
anchorX: G(l.transform.anchorX),
|
|
1222
|
+
anchorY: G(l.transform.anchorY),
|
|
1223
|
+
edges: G(l.transform.edges === "stretch" ? 0 : l.transform.edges === "transparent" ? 1 : l.transform.edges === "mirror" ? 2 : 3),
|
|
1224
|
+
aspectRatio: G(u)
|
|
1223
1225
|
};
|
|
1224
1226
|
}
|
|
1225
|
-
const
|
|
1227
|
+
const E = {
|
|
1226
1228
|
id: s,
|
|
1227
1229
|
componentName: b?.name || "Unknown",
|
|
1228
1230
|
fragmentNodeFunc: t,
|
|
@@ -1249,25 +1251,25 @@ function cs() {
|
|
|
1249
1251
|
uvTransformFunc: b?.uvTransformNode,
|
|
1250
1252
|
acceptsUVContext: b?.acceptsUVContext || !1
|
|
1251
1253
|
};
|
|
1252
|
-
h.nodes.set(s,
|
|
1254
|
+
h.nodes.set(s, E), o === null && (h.rootId = s);
|
|
1253
1255
|
const y = d.get(o) || /* @__PURE__ */ new Set();
|
|
1254
|
-
y.add(s), d.set(o, y), p && B && z > 0 &&
|
|
1256
|
+
y.add(s), d.set(o, y), p && B && z > 0 && F > 0 ? (Ee.includes(s) || Ee.push(s), ge === null && (ge = requestAnimationFrame(() => {
|
|
1255
1257
|
ge = null, Ee = [], he();
|
|
1256
1258
|
}))) : p && B && (ve || (ve = !0, requestAnimationFrame(() => {
|
|
1257
|
-
ve = !1, z > 0 &&
|
|
1259
|
+
ve = !1, z > 0 && F > 0 && he();
|
|
1258
1260
|
})));
|
|
1259
|
-
},
|
|
1261
|
+
}, zn = (s, t, o) => {
|
|
1260
1262
|
const l = h.nodes.get(s);
|
|
1261
1263
|
if (!l || !l.uniforms) return;
|
|
1262
1264
|
const f = l.uniforms[t];
|
|
1263
1265
|
if (!(!f || !f.uniform)) {
|
|
1264
1266
|
if (f.transform) {
|
|
1265
|
-
const { updateUniformValue: b } = (
|
|
1267
|
+
const { updateUniformValue: b } = (Sn(), Hn(qt));
|
|
1266
1268
|
b(f, o);
|
|
1267
1269
|
} else f.uniform.value = o;
|
|
1268
|
-
|
|
1270
|
+
N && re();
|
|
1269
1271
|
}
|
|
1270
|
-
},
|
|
1272
|
+
}, Fn = (s, t) => {
|
|
1271
1273
|
const o = h.nodes.get(s);
|
|
1272
1274
|
if (!o) return;
|
|
1273
1275
|
let l = !1;
|
|
@@ -1276,23 +1278,23 @@ function cs() {
|
|
|
1276
1278
|
if (o.metadata.visible !== f && (o.metadata.visible = f, l = !0), t.id !== void 0 && o.metadata.id !== t.id && (o.metadata.id = t.id, l = !0), t.mask !== void 0 && (o.metadata.mask?.source !== t.mask?.source || o.metadata.mask?.type !== t.mask?.type) && (o.metadata.mask = t.mask, l = !0), t.transform !== void 0) {
|
|
1277
1279
|
const b = o.metadata.transform ? fe(o.metadata.transform) : !1, g = fe(t.transform);
|
|
1278
1280
|
if (o.metadata.transform = t.transform, !o.transformUniforms && t.transform) {
|
|
1279
|
-
const w = z / Math.max(1,
|
|
1281
|
+
const w = z / Math.max(1, F);
|
|
1280
1282
|
o.transformUniforms = {
|
|
1281
|
-
offsetX:
|
|
1282
|
-
offsetY:
|
|
1283
|
-
rotation:
|
|
1284
|
-
scale:
|
|
1285
|
-
anchorX:
|
|
1286
|
-
anchorY:
|
|
1287
|
-
edges:
|
|
1288
|
-
aspectRatio:
|
|
1283
|
+
offsetX: G(t.transform.offsetX),
|
|
1284
|
+
offsetY: G(t.transform.offsetY),
|
|
1285
|
+
rotation: G(t.transform.rotation),
|
|
1286
|
+
scale: G(t.transform.scale),
|
|
1287
|
+
anchorX: G(t.transform.anchorX),
|
|
1288
|
+
anchorY: G(t.transform.anchorY),
|
|
1289
|
+
edges: G(t.transform.edges === "stretch" ? 0 : t.transform.edges === "transparent" ? 1 : t.transform.edges === "mirror" ? 2 : 3),
|
|
1290
|
+
aspectRatio: G(w)
|
|
1289
1291
|
};
|
|
1290
1292
|
} else o.transformUniforms && (o.transformUniforms.offsetX.value = t.transform.offsetX, o.transformUniforms.offsetY.value = t.transform.offsetY, o.transformUniforms.rotation.value = t.transform.rotation, o.transformUniforms.scale.value = t.transform.scale, o.transformUniforms.anchorX.value = t.transform.anchorX, o.transformUniforms.anchorY.value = t.transform.anchorY, o.transformUniforms.edges.value = t.transform.edges === "stretch" ? 0 : t.transform.edges === "transparent" ? 1 : t.transform.edges === "mirror" ? 2 : 3);
|
|
1291
1293
|
g && !o.transformRTTActive && (o.transformRTTActive = !0, l = !0), !b && g && !o.transformRTTActive && (l = !0);
|
|
1292
1294
|
}
|
|
1293
1295
|
l && p && B ? (Oe.includes(s) || Oe.push(s), be === null && (be = requestAnimationFrame(() => {
|
|
1294
1296
|
be = null, Oe = [], he();
|
|
1295
|
-
}))) :
|
|
1297
|
+
}))) : N && re();
|
|
1296
1298
|
}, We = (s) => {
|
|
1297
1299
|
if (!h.nodes.has(s)) return;
|
|
1298
1300
|
const t = h.nodes.get(s);
|
|
@@ -1301,24 +1303,24 @@ function cs() {
|
|
|
1301
1303
|
} catch (f) {
|
|
1302
1304
|
console.error(`Error executing cleanup callback for node ${s}:`, f);
|
|
1303
1305
|
}
|
|
1304
|
-
const o =
|
|
1306
|
+
const o = W(s);
|
|
1305
1307
|
for (const l of o) We(l.id);
|
|
1306
1308
|
if (h.rootId === s && (h.rootId = null), t) {
|
|
1307
1309
|
const l = d.get(t.parentId);
|
|
1308
1310
|
l && (l.delete(s), l.size === 0 && d.delete(t.parentId));
|
|
1309
1311
|
}
|
|
1310
1312
|
h.nodes.delete(s), p && B && he();
|
|
1311
|
-
},
|
|
1313
|
+
}, En = (s) => {
|
|
1312
1314
|
const t = {
|
|
1313
1315
|
deltaTime: s,
|
|
1314
1316
|
pointer: {
|
|
1315
1317
|
x: $e,
|
|
1316
|
-
y:
|
|
1318
|
+
y: De
|
|
1317
1319
|
},
|
|
1318
1320
|
pointerActive: ue,
|
|
1319
1321
|
dimensions: {
|
|
1320
1322
|
width: z,
|
|
1321
|
-
height:
|
|
1323
|
+
height: F
|
|
1322
1324
|
}
|
|
1323
1325
|
};
|
|
1324
1326
|
for (const o of h.nodes.values()) if (o.beforeRenderCallbacks.length > 0) for (const l of o.beforeRenderCallbacks) try {
|
|
@@ -1326,17 +1328,17 @@ function cs() {
|
|
|
1326
1328
|
} catch (f) {
|
|
1327
1329
|
console.error(`Error executing before render callback for node ${o.id}:`, f);
|
|
1328
1330
|
}
|
|
1329
|
-
},
|
|
1331
|
+
}, On = (s) => {
|
|
1330
1332
|
const t = {
|
|
1331
1333
|
deltaTime: s,
|
|
1332
1334
|
pointer: {
|
|
1333
1335
|
x: $e,
|
|
1334
|
-
y:
|
|
1336
|
+
y: De
|
|
1335
1337
|
},
|
|
1336
1338
|
pointerActive: ue,
|
|
1337
1339
|
dimensions: {
|
|
1338
1340
|
width: z,
|
|
1339
|
-
height:
|
|
1341
|
+
height: F
|
|
1340
1342
|
}
|
|
1341
1343
|
};
|
|
1342
1344
|
for (const o of h.nodes.values()) if (o.afterRenderCallbacks.length > 0) for (const l of o.afterRenderCallbacks) try {
|
|
@@ -1345,16 +1347,16 @@ function cs() {
|
|
|
1345
1347
|
console.error(`Error executing after render callback for node ${o.id}:`, f);
|
|
1346
1348
|
}
|
|
1347
1349
|
}, re = async () => {
|
|
1348
|
-
if (!
|
|
1349
|
-
const s = de ? performance.now() : 0, t = s || performance.now(), o =
|
|
1350
|
-
|
|
1350
|
+
if (!Un()) return;
|
|
1351
|
+
const s = de ? performance.now() : 0, t = s || performance.now(), o = qe > 0 ? (t - qe) / 1e3 : 0.016, l = Math.min(o, 0.1);
|
|
1352
|
+
qe = t, de && performance.mark("shader-cpu-start"), En(l);
|
|
1351
1353
|
try {
|
|
1352
|
-
if (
|
|
1354
|
+
if (ze) return;
|
|
1353
1355
|
de && performance.mark("shader-gpu-start");
|
|
1354
1356
|
const f = performance.now();
|
|
1355
1357
|
n.render(r, a);
|
|
1356
1358
|
const b = performance.now() - f;
|
|
1357
|
-
if (b > 20 && console.log(`[Shaders Perf] renderer.render(): ${b.toFixed(2)}ms`), b > 100 && console.warn(`[Shaders Perf] ⚠️ SLOW RENDER! Likely GPU shader compilation: ${b.toFixed(0)}ms`),
|
|
1359
|
+
if (b > 20 && console.log(`[Shaders Perf] renderer.render(): ${b.toFixed(2)}ms`), b > 100 && console.warn(`[Shaders Perf] ⚠️ SLOW RENDER! Likely GPU shader compilation: ${b.toFixed(0)}ms`), On(l), de) {
|
|
1358
1360
|
if (performance.mark("shader-gpu-end"), n instanceof Je) try {
|
|
1359
1361
|
const g = n.backend;
|
|
1360
1362
|
if (g && g.get && g.get(n)) {
|
|
@@ -1387,15 +1389,15 @@ function cs() {
|
|
|
1387
1389
|
} catch (f) {
|
|
1388
1390
|
console.error("Render frame error:", f);
|
|
1389
1391
|
}
|
|
1390
|
-
},
|
|
1392
|
+
}, Bn = () => {
|
|
1391
1393
|
const s = Math.max(0, h.nodes.size - 1), t = Be;
|
|
1392
1394
|
ie.updateNodeCounts(s, t);
|
|
1393
|
-
},
|
|
1394
|
-
|
|
1395
|
+
}, Pn = () => {
|
|
1396
|
+
Bn();
|
|
1395
1397
|
const s = n?.info;
|
|
1396
1398
|
return ie.getStats(s);
|
|
1397
1399
|
}, je = () => {
|
|
1398
|
-
if (R || !ae || !
|
|
1400
|
+
if (R || !ae || !N) return;
|
|
1399
1401
|
ie.setRendering(!0);
|
|
1400
1402
|
const s = () => {
|
|
1401
1403
|
R = requestAnimationFrame(s), re().catch(console.warn);
|
|
@@ -1412,49 +1414,49 @@ function cs() {
|
|
|
1412
1414
|
} else
|
|
1413
1415
|
t = s.clientX, o = s.clientY;
|
|
1414
1416
|
const l = e.getBoundingClientRect(), f = (t - l.left) / l.width, b = (o - l.top) / l.height;
|
|
1415
|
-
$e = f,
|
|
1416
|
-
},
|
|
1417
|
+
$e = f, De = b;
|
|
1418
|
+
}, _n = (s) => {
|
|
1417
1419
|
!B || !e || cn(s);
|
|
1418
|
-
},
|
|
1420
|
+
}, Vn = (s) => {
|
|
1419
1421
|
!B || !e || cn(s);
|
|
1420
|
-
},
|
|
1422
|
+
}, Ln = () => {
|
|
1421
1423
|
B && (ue = !1, re().catch(console.warn));
|
|
1422
|
-
},
|
|
1424
|
+
}, qn = () => {
|
|
1423
1425
|
B && (ue = !1, re().catch(console.warn));
|
|
1424
1426
|
}, fn = () => {
|
|
1425
1427
|
ue = !0, re().catch(console.warn);
|
|
1426
1428
|
}, mn = () => {
|
|
1427
1429
|
ue = !0, re().catch(console.warn);
|
|
1428
|
-
},
|
|
1430
|
+
}, Gn = () => {
|
|
1429
1431
|
if (oe.length === 0) return;
|
|
1430
1432
|
const s = [...oe];
|
|
1431
1433
|
oe = [];
|
|
1432
1434
|
for (const { id: t, fragmentNodeFunc: o, parentId: l, metadata: f, uniforms: b, componentDefinition: g } of s) o && ln(t, o, l, f, b, g);
|
|
1433
|
-
},
|
|
1435
|
+
}, Nn = async ({ canvas: s, enablePerformanceTracking: t = !1 }) => {
|
|
1434
1436
|
if (B || ne) return;
|
|
1435
|
-
de = t, ne = !0,
|
|
1436
|
-
const o =
|
|
1437
|
+
de = t, ne = !0, I = new AbortController();
|
|
1438
|
+
const o = I;
|
|
1437
1439
|
try {
|
|
1438
|
-
if (e = s, r = new
|
|
1439
|
-
onMouseMove:
|
|
1440
|
-
onTouchMove:
|
|
1441
|
-
onMouseUp:
|
|
1442
|
-
onTouchEnd:
|
|
1443
|
-
}), s.addEventListener("mousedown", fn), s.addEventListener("touchstart", mn),
|
|
1440
|
+
if (e = s, r = new Jn(), r.background = null, a = new Yn(-1, 1, 1, -1, 0.1, 10), a.position.z = 1, a.lookAt(0, 0, 0), Fe = Xt.register({
|
|
1441
|
+
onMouseMove: _n,
|
|
1442
|
+
onTouchMove: Vn,
|
|
1443
|
+
onMouseUp: Ln,
|
|
1444
|
+
onTouchEnd: qn
|
|
1445
|
+
}), s.addEventListener("mousedown", fn), s.addEventListener("touchstart", mn), Te = () => {
|
|
1444
1446
|
un();
|
|
1445
|
-
}, window.addEventListener("beforeunload",
|
|
1447
|
+
}, window.addEventListener("beforeunload", Te), o.signal.aborted) return;
|
|
1446
1448
|
try {
|
|
1447
|
-
const
|
|
1449
|
+
const E = {
|
|
1448
1450
|
canvas: s,
|
|
1449
1451
|
antialias: !0,
|
|
1450
1452
|
alpha: !0,
|
|
1451
1453
|
depth: !1,
|
|
1452
1454
|
powerPreference: "high-performance"
|
|
1453
1455
|
};
|
|
1454
|
-
if (de && (
|
|
1455
|
-
} catch (
|
|
1456
|
+
if (de && (E.forceWebGL = !1, E.requiredFeatures = ["timestamp-query"]), n = new Je(E), await n.init(), o.signal.aborted) return;
|
|
1457
|
+
} catch (E) {
|
|
1456
1458
|
if (o.signal.aborted) return;
|
|
1457
|
-
console.warn("[Shaders] WebGPU initialization failed, falling back to WebGL:",
|
|
1459
|
+
console.warn("[Shaders] WebGPU initialization failed, falling back to WebGL:", E);
|
|
1458
1460
|
try {
|
|
1459
1461
|
if (n = new st({
|
|
1460
1462
|
canvas: s,
|
|
@@ -1470,38 +1472,38 @@ function cs() {
|
|
|
1470
1472
|
}
|
|
1471
1473
|
}
|
|
1472
1474
|
if (o.signal.aborted) return;
|
|
1473
|
-
n.setPixelRatio(Math.min(window.devicePixelRatio, 2)), n.outputColorSpace =
|
|
1475
|
+
n.setPixelRatio(Math.min(window.devicePixelRatio, 2)), n.outputColorSpace = In, p = new dn({ transparent: !0 }), p.fragmentNode = x(0, 0, 0, 0), m = new ar(new Kn(2, 2), p), r.add(m);
|
|
1474
1476
|
const l = s.parentElement;
|
|
1475
1477
|
if (!l) {
|
|
1476
1478
|
console.warn("[Shaders] Canvas has no parent element for resize observation");
|
|
1477
1479
|
return;
|
|
1478
1480
|
}
|
|
1479
|
-
|
|
1481
|
+
U = new ResizeObserver(xn), U.observe(l), V = new IntersectionObserver(Mn, { threshold: 0 }), V.observe(s);
|
|
1480
1482
|
const f = s.getBoundingClientRect();
|
|
1481
|
-
|
|
1483
|
+
N = f.width > 0 && f.height > 0 && f.top < window.innerHeight && f.bottom > 0 && f.left < window.innerWidth && f.right > 0, te = N && f.width > 0 && f.height > 0, ae = !0;
|
|
1482
1484
|
const { width: b, height: g } = s.getBoundingClientRect(), w = Math.round(b), M = Math.round(g);
|
|
1483
|
-
w > 0 && M > 0 ? (
|
|
1485
|
+
w > 0 && M > 0 ? (Xe(w, M), Y = !0, await re()) : Y = !1, ae && N && je(), o.signal.aborted || (B = !0, Ge = !0, Gn());
|
|
1484
1486
|
} catch (l) {
|
|
1485
1487
|
console.error("[Shaders] Initialization error:", l);
|
|
1486
1488
|
} finally {
|
|
1487
|
-
ne = !1,
|
|
1489
|
+
ne = !1, I === o && (I = null);
|
|
1488
1490
|
}
|
|
1489
|
-
},
|
|
1490
|
-
!Yt() ||
|
|
1491
|
+
}, Xn = () => {
|
|
1492
|
+
!Yt() || Tn || (console.warn("Shaders is running in development mode. Please purchase a license at https://shaders.com to use it in production."), Tn = !0);
|
|
1491
1493
|
}, un = () => {
|
|
1492
|
-
if (
|
|
1494
|
+
if (I && I.abort(), U && (U.disconnect(), U = null), V && (V.disconnect(), V = null), Fe && (Fe(), Fe = null), e && (e.removeEventListener("mousedown", fn), e.removeEventListener("touchstart", mn)), Te && (window.removeEventListener("beforeunload", Te), Te = null), Qe(), rn(), ke.forEach((s) => {
|
|
1493
1495
|
try {
|
|
1494
1496
|
s?.renderTarget?.dispose && s.renderTarget.dispose();
|
|
1495
1497
|
} catch {
|
|
1496
1498
|
}
|
|
1497
|
-
}),
|
|
1499
|
+
}), ke.clear(), h.nodes.clear(), h.rootId = null, h.idToNodeId.clear(), d.clear(), oe = [], Ge = !1, Ee = [], ge !== null && (cancelAnimationFrame(ge), ge = null), Oe = [], be !== null && (cancelAnimationFrame(be), be = null), we = null, Pe = !1, m) {
|
|
1498
1500
|
r && r.remove(m);
|
|
1499
1501
|
try {
|
|
1500
1502
|
m.geometry && typeof m.geometry.dispose == "function" && m.geometry.dispose();
|
|
1501
1503
|
} catch {
|
|
1502
1504
|
}
|
|
1503
1505
|
try {
|
|
1504
|
-
m.material instanceof
|
|
1506
|
+
m.material instanceof Qn && typeof m.material.dispose == "function" && m.material.dispose();
|
|
1505
1507
|
} catch {
|
|
1506
1508
|
}
|
|
1507
1509
|
}
|
|
@@ -1509,25 +1511,25 @@ function cs() {
|
|
|
1509
1511
|
n.dispose();
|
|
1510
1512
|
} catch {
|
|
1511
1513
|
}
|
|
1512
|
-
e = null, n = null, a = null, r = null, m = null, p = null, B = !1, ne = !1,
|
|
1514
|
+
e = null, n = null, a = null, r = null, m = null, p = null, B = !1, ne = !1, Y = !1, I = null, z = 0, F = 0, N = !1, ae = !0, $e = 0.5, De = 0.5, ue = !1;
|
|
1513
1515
|
};
|
|
1514
1516
|
return {
|
|
1515
|
-
initialize:
|
|
1517
|
+
initialize: Nn,
|
|
1516
1518
|
cleanup: un,
|
|
1517
1519
|
registerNode: ln,
|
|
1518
1520
|
removeNode: We,
|
|
1519
|
-
updateUniformValue:
|
|
1520
|
-
updateNodeMetadata:
|
|
1521
|
-
showLicenseWarning:
|
|
1521
|
+
updateUniformValue: zn,
|
|
1522
|
+
updateNodeMetadata: Fn,
|
|
1523
|
+
showLicenseWarning: Xn,
|
|
1522
1524
|
isInitialized: () => B,
|
|
1523
1525
|
startAnimation: je,
|
|
1524
1526
|
stopAnimation: Qe,
|
|
1525
|
-
getPerformanceStats:
|
|
1527
|
+
getPerformanceStats: Pn,
|
|
1526
1528
|
getNodeRegistry: () => ({ nodes: new Map(h.nodes) }),
|
|
1527
1529
|
getRendererType: () => n ? n instanceof Je ? "webgpu" : "webgl" : null
|
|
1528
1530
|
};
|
|
1529
1531
|
}
|
|
1530
|
-
|
|
1532
|
+
Sn();
|
|
1531
1533
|
function fs(e) {
|
|
1532
1534
|
const n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), r = {
|
|
1533
1535
|
processingOrder: [],
|
|
@@ -1553,8 +1555,8 @@ function It(e, n) {
|
|
|
1553
1555
|
return;
|
|
1554
1556
|
}
|
|
1555
1557
|
m.add(d), R.push(d);
|
|
1556
|
-
const
|
|
1557
|
-
for (const V of
|
|
1558
|
+
const U = e.get(d) || [];
|
|
1559
|
+
for (const V of U) p(V, [...R]);
|
|
1558
1560
|
m.delete(d), r.add(d), a.push(d);
|
|
1559
1561
|
}
|
|
1560
1562
|
for (const d of e.keys()) r.has(d) || p(d);
|
|
@@ -1562,23 +1564,23 @@ function It(e, n) {
|
|
|
1562
1564
|
for (const d of h) !r.has(d) && !e.has(d) && a.push(d);
|
|
1563
1565
|
return a.reverse();
|
|
1564
1566
|
}
|
|
1565
|
-
|
|
1567
|
+
D();
|
|
1566
1568
|
var { vec2: Ht, fract: Wt, sin: jt, dot: Qt } = pe;
|
|
1567
1569
|
const Jt = (e) => Wt(jt(Qt(e, Ht(12.12345, 78.12345))).mul(40000.12345)), ms = (e = 0.03) => (n) => Jt(n).mul(e).mul(0.10012345);
|
|
1568
|
-
|
|
1570
|
+
D();
|
|
1569
1571
|
var { vec2: Kt } = pe;
|
|
1570
1572
|
const us = (e = Kt(0), n = 0.02, a = 1, r = 1) => {
|
|
1571
|
-
const { vec2: m, sin: p, cos: h, time: d } = pe, R = r * 1.618033988749895,
|
|
1572
|
-
return e.add(
|
|
1573
|
+
const { vec2: m, sin: p, cos: h, time: d } = pe, R = r * 1.618033988749895, U = r * 2.718281828459045, V = (Math.sin(r) + 2) * 5, B = (Math.cos(r) + 2) * 5, ne = m(p(e.x.mul(a).mul(V).add(d.mul(0.1)).add(R)), h(e.y.mul(a).mul(V).add(d.mul(0.1)).add(U))), Y = m(p(e.y.mul(a).mul(B).add(d.mul(0.05)).add(U)), h(e.x.mul(a).mul(B).add(d.mul(0.05)).add(R))), I = ne.add(Y).mul(n);
|
|
1574
|
+
return e.add(I);
|
|
1573
1575
|
};
|
|
1574
|
-
|
|
1576
|
+
D();
|
|
1575
1577
|
const ds = (e, n, a = 0.6, r = 0.3, m = 1) => {
|
|
1576
|
-
const { max: p, smoothstep: h, vec4: d } = pe, R = p(p(e.r, e.g), e.b),
|
|
1577
|
-
return d(e.rgb.add(n.rgb.mul(
|
|
1578
|
+
const { max: p, smoothstep: h, vec4: d } = pe, R = p(p(e.r, e.g), e.b), U = h(a, a + r, R).mul(m).mul(1);
|
|
1579
|
+
return d(e.rgb.add(n.rgb.mul(U)), e.a);
|
|
1578
1580
|
};
|
|
1579
|
-
|
|
1581
|
+
D();
|
|
1580
1582
|
const hs = (e = {}) => {
|
|
1581
|
-
const { inset: n = 0.4, softness: a = 0.5, offsetX: r = 0, offsetY: m = 0 } = e, { float: p, smoothstep: h, uv: d } = pe, R = d(),
|
|
1583
|
+
const { inset: n = 0.4, softness: a = 0.5, offsetX: r = 0, offsetY: m = 0 } = e, { float: p, smoothstep: h, uv: d } = pe, R = d(), U = R.x.sub(0.5).sub(p(r)).mul(2), V = R.y.sub(0.5).add(p(m)).mul(2), B = U.mul(U).add(V.mul(V)).sqrt();
|
|
1582
1584
|
return p(1).sub(h(p(1).sub(p(n)), p(1).sub(p(n)).add(p(a)), B.mul(p(1).add(p(a)))));
|
|
1583
1585
|
};
|
|
1584
1586
|
var Zt = () => {
|
|
@@ -1608,8 +1610,8 @@ var Zt = () => {
|
|
|
1608
1610
|
Grayscale: Mr,
|
|
1609
1611
|
Grid: Ar,
|
|
1610
1612
|
GridDistortion: $r,
|
|
1611
|
-
Group:
|
|
1612
|
-
Halftone:
|
|
1613
|
+
Group: Dr,
|
|
1614
|
+
Halftone: zr,
|
|
1613
1615
|
HueShift: Fr,
|
|
1614
1616
|
ImageTexture: Er,
|
|
1615
1617
|
Invert: Or,
|
|
@@ -1653,18 +1655,18 @@ var Zt = () => {
|
|
|
1653
1655
|
};
|
|
1654
1656
|
}), e;
|
|
1655
1657
|
};
|
|
1656
|
-
const
|
|
1658
|
+
const Le = Zt();
|
|
1657
1659
|
function ps() {
|
|
1658
|
-
return Object.values(
|
|
1660
|
+
return Object.values(Le);
|
|
1659
1661
|
}
|
|
1660
1662
|
function gs(e) {
|
|
1661
|
-
return
|
|
1663
|
+
return Le[e];
|
|
1662
1664
|
}
|
|
1663
1665
|
function bs(e) {
|
|
1664
|
-
return Object.values(
|
|
1666
|
+
return Object.values(Le).filter((n) => n.category === e);
|
|
1665
1667
|
}
|
|
1666
1668
|
function vs() {
|
|
1667
|
-
const e = new Set(Object.values(
|
|
1669
|
+
const e = new Set(Object.values(Le).map((n) => n.category));
|
|
1668
1670
|
return Array.from(e).sort();
|
|
1669
1671
|
}
|
|
1670
1672
|
export {
|
|
@@ -1679,7 +1681,7 @@ export {
|
|
|
1679
1681
|
ds as glow,
|
|
1680
1682
|
ms as grain,
|
|
1681
1683
|
fs as resolveMaskDependencies,
|
|
1682
|
-
|
|
1684
|
+
Le as shaderRegistry,
|
|
1683
1685
|
cs as shaderRenderer,
|
|
1684
1686
|
Nt as updateUniformValue
|
|
1685
1687
|
};
|