@genome-spy/app 0.83.1 → 0.84.0
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/{agentApi-AxdD95yY.js → agentApi-DHXYZVvQ.js} +5401 -7147
- package/dist/agentApi.es.js +3145 -3039
- package/dist/agentShared.es.js +18 -18
- package/dist/bmFontMetrics-CuNB-kNN.js +31 -0
- package/dist/clipOptions-Dqco1p8b.js +377 -0
- package/dist/{componentStyles-BzJWWojD.js → componentStyles-FsNmIb22.js} +5 -1
- package/dist/{debug-DJKug_38.js → debug-D6FqxKEj.js} +7 -5
- package/dist/{debug-CI7POTMx.js → debug-aHQsa6hU.js} +10 -10
- package/dist/dialog.es.js +1 -1
- package/dist/framebufferReadback-Bje9lHb7.js +1993 -0
- package/dist/framebufferReadback-CC0D6Haw.js +147 -0
- package/dist/index.es.js +3755 -3392
- package/dist/index.js +730 -609
- package/dist/metadataChannels-DV62inJh.js +19 -0
- package/dist/raster-9uKYMjHZ.js +53 -0
- package/dist/raster-BofBWXbe.js +54 -0
- package/dist/schema.json +765 -4113
- package/dist/svg-CvsT1Y2V.js +1793 -0
- package/dist/svg-DRgWfcsL.js +1793 -0
- package/dist/svgNumber-C6aRPc8Z.js +11 -0
- package/dist/twgl-full.module-BNEMlXRV.js +1849 -0
- package/dist/viewIdentityRegistry-AEQpJTDm.js +92 -0
- package/dist/{viewIdentityRegistry-CcQdL0Z8.js → viewIdentityRegistry-Dl7rR4Ay.js} +1 -1
- package/dist/viewRenderingContext-HtpqwS_x.js +120 -0
- package/dist/{viewIdentityRegistry-EH5-Noyz.js → viewSelectors-BhW4mTR1.js} +1801 -2242
- package/dist/{metadataChannels-fGQOmJj0.js → viewSelectors-Bwzj10Qz.js} +1674 -2043
- package/dist/{viewUtils-Cybv1tu-.js → viewUtils-DMNiWslc.js} +1885 -3738
- package/package.json +5 -5
|
@@ -0,0 +1,1849 @@
|
|
|
1
|
+
import { _ as e } from "./clipOptions-Dqco1p8b.js";
|
|
2
|
+
//#region ../../node_modules/d3-array/src/identity.js
|
|
3
|
+
function t(e) {
|
|
4
|
+
return e;
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region ../../node_modules/d3-array/src/group.js
|
|
8
|
+
function n(e, ...n) {
|
|
9
|
+
return i(e, t, t, n);
|
|
10
|
+
}
|
|
11
|
+
function r(e, ...n) {
|
|
12
|
+
return i(e, Array.from, t, n);
|
|
13
|
+
}
|
|
14
|
+
function i(t, n, r, i) {
|
|
15
|
+
return (function t(a, o) {
|
|
16
|
+
if (o >= i.length) return r(a);
|
|
17
|
+
let s = new e(), c = i[o++], l = -1;
|
|
18
|
+
for (let e of a) {
|
|
19
|
+
let t = c(e, ++l, a), n = s.get(t);
|
|
20
|
+
n ? n.push(e) : s.set(t, [e]);
|
|
21
|
+
}
|
|
22
|
+
for (let [e, n] of s) s.set(e, t(n, o));
|
|
23
|
+
return n(s);
|
|
24
|
+
})(t, 0);
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region ../../node_modules/twgl.js/dist/4.x/twgl-full.module.js
|
|
28
|
+
var a = 5120, o = 5121, s = 5122, c = 5123, l = 5124, u = 5125, d = 5126, f = 32819, p = 32820, m = 33635, h = 5131, ee = 33640, te = 35899, g = 35902, ne = 36269, re = 34042, ie = {};
|
|
29
|
+
{
|
|
30
|
+
let e = ie;
|
|
31
|
+
e[a] = Int8Array, e[o] = Uint8Array, e[s] = Int16Array, e[c] = Uint16Array, e[l] = Int32Array, e[u] = Uint32Array, e[d] = Float32Array, e[f] = Uint16Array, e[p] = Uint16Array, e[m] = Uint16Array, e[h] = Uint16Array, e[ee] = Uint32Array, e[te] = Uint32Array, e[g] = Uint32Array, e[ne] = Uint32Array, e[re] = Uint32Array;
|
|
32
|
+
}
|
|
33
|
+
function ae(e) {
|
|
34
|
+
if (e instanceof Int8Array) return a;
|
|
35
|
+
if (e instanceof Uint8Array || e instanceof Uint8ClampedArray) return o;
|
|
36
|
+
if (e instanceof Int16Array) return s;
|
|
37
|
+
if (e instanceof Uint16Array) return c;
|
|
38
|
+
if (e instanceof Int32Array) return l;
|
|
39
|
+
if (e instanceof Uint32Array) return u;
|
|
40
|
+
if (e instanceof Float32Array) return d;
|
|
41
|
+
throw Error("unsupported typed array type");
|
|
42
|
+
}
|
|
43
|
+
function oe(e) {
|
|
44
|
+
if (e === Int8Array) return a;
|
|
45
|
+
if (e === Uint8Array || e === Uint8ClampedArray) return o;
|
|
46
|
+
if (e === Int16Array) return s;
|
|
47
|
+
if (e === Uint16Array) return c;
|
|
48
|
+
if (e === Int32Array) return l;
|
|
49
|
+
if (e === Uint32Array) return u;
|
|
50
|
+
if (e === Float32Array) return d;
|
|
51
|
+
throw Error("unsupported typed array type");
|
|
52
|
+
}
|
|
53
|
+
function se(e) {
|
|
54
|
+
let t = ie[e];
|
|
55
|
+
if (!t) throw Error("unknown gl type");
|
|
56
|
+
return t;
|
|
57
|
+
}
|
|
58
|
+
var ce = typeof SharedArrayBuffer < "u" ? function(e) {
|
|
59
|
+
return e && e.buffer && (e.buffer instanceof ArrayBuffer || e.buffer instanceof SharedArrayBuffer);
|
|
60
|
+
} : function(e) {
|
|
61
|
+
return e && e.buffer && e.buffer instanceof ArrayBuffer;
|
|
62
|
+
};
|
|
63
|
+
function le(...e) {
|
|
64
|
+
console.error(...e);
|
|
65
|
+
}
|
|
66
|
+
function ue(...e) {
|
|
67
|
+
console.warn(...e);
|
|
68
|
+
}
|
|
69
|
+
function de(e, t) {
|
|
70
|
+
return typeof WebGLBuffer < "u" && t instanceof WebGLBuffer;
|
|
71
|
+
}
|
|
72
|
+
function fe(e, t) {
|
|
73
|
+
return typeof WebGLRenderbuffer < "u" && t instanceof WebGLRenderbuffer;
|
|
74
|
+
}
|
|
75
|
+
function pe(e, t) {
|
|
76
|
+
return typeof WebGLTexture < "u" && t instanceof WebGLTexture;
|
|
77
|
+
}
|
|
78
|
+
function me(e, t) {
|
|
79
|
+
return typeof WebGLSampler < "u" && t instanceof WebGLSampler;
|
|
80
|
+
}
|
|
81
|
+
var he = 35044, _ = 34962, ge = 34963, _e = 34660, ve = 5120, ye = 5121, be = 5122, xe = 5123, Se = 5124, Ce = 5125, we = 5126, Te = { attribPrefix: "" };
|
|
82
|
+
function Ee(e, t, n, r, i) {
|
|
83
|
+
e.bindBuffer(t, n), e.bufferData(t, r, i || he);
|
|
84
|
+
}
|
|
85
|
+
function De(e, t, n, r) {
|
|
86
|
+
if (de(e, t)) return t;
|
|
87
|
+
n ||= _;
|
|
88
|
+
let i = e.createBuffer();
|
|
89
|
+
return Ee(e, n, i, t, r), i;
|
|
90
|
+
}
|
|
91
|
+
function Oe(e) {
|
|
92
|
+
return e === "indices";
|
|
93
|
+
}
|
|
94
|
+
function ke(e) {
|
|
95
|
+
return e instanceof Int8Array || e instanceof Uint8Array;
|
|
96
|
+
}
|
|
97
|
+
function Ae(e) {
|
|
98
|
+
return e === Int8Array || e === Uint8Array;
|
|
99
|
+
}
|
|
100
|
+
function je(e) {
|
|
101
|
+
return e.length ? e : e.data;
|
|
102
|
+
}
|
|
103
|
+
var Me = /coord|texture/i, Ne = /color|colour/i;
|
|
104
|
+
function Pe(e, t) {
|
|
105
|
+
let n;
|
|
106
|
+
if (n = Me.test(e) ? 2 : Ne.test(e) ? 4 : 3, t % n > 0) throw Error(`Can not guess numComponents for attribute '${e}'. Tried ${n} but ${t} values is not evenly divisible by ${n}. You should specify it.`);
|
|
107
|
+
return n;
|
|
108
|
+
}
|
|
109
|
+
function Fe(e, t) {
|
|
110
|
+
return e.numComponents || e.size || Pe(t, je(e).length);
|
|
111
|
+
}
|
|
112
|
+
function Ie(e, t) {
|
|
113
|
+
if (ce(e)) return e;
|
|
114
|
+
if (ce(e.data)) return e.data;
|
|
115
|
+
Array.isArray(e) && (e = { data: e });
|
|
116
|
+
let n = e.type;
|
|
117
|
+
return n ||= Oe(t) ? Uint16Array : Float32Array, new n(e.data);
|
|
118
|
+
}
|
|
119
|
+
function Le(e, t) {
|
|
120
|
+
let n = {};
|
|
121
|
+
return Object.keys(t).forEach(function(r) {
|
|
122
|
+
if (!Oe(r)) {
|
|
123
|
+
let i = t[r], a = i.attrib || i.name || i.attribName || Te.attribPrefix + r;
|
|
124
|
+
if (i.value) {
|
|
125
|
+
if (!Array.isArray(i.value) && !ce(i.value)) throw Error("array.value is not array or typedarray");
|
|
126
|
+
n[a] = { value: i.value };
|
|
127
|
+
} else {
|
|
128
|
+
let t, o, s, c;
|
|
129
|
+
if (i.buffer && i.buffer instanceof WebGLBuffer) t = i.buffer, c = i.numComponents || i.size, o = i.type, s = i.normalize;
|
|
130
|
+
else if (typeof i == "number" || typeof i.data == "number") {
|
|
131
|
+
let n = i.data || i, a = i.type || Float32Array, l = n * a.BYTES_PER_ELEMENT;
|
|
132
|
+
o = oe(a), s = i.normalize === void 0 ? Ae(a) : i.normalize, c = i.numComponents || i.size || Pe(r, n), t = e.createBuffer(), e.bindBuffer(_, t), e.bufferData(_, l, i.drawType || he);
|
|
133
|
+
} else {
|
|
134
|
+
let n = Ie(i, r);
|
|
135
|
+
t = De(e, n, void 0, i.drawType), o = ae(n), s = i.normalize === void 0 ? ke(n) : i.normalize, c = Fe(i, r);
|
|
136
|
+
}
|
|
137
|
+
n[a] = {
|
|
138
|
+
buffer: t,
|
|
139
|
+
numComponents: c,
|
|
140
|
+
type: o,
|
|
141
|
+
normalize: s,
|
|
142
|
+
stride: i.stride || 0,
|
|
143
|
+
offset: i.offset || 0,
|
|
144
|
+
divisor: i.divisor === void 0 ? void 0 : i.divisor,
|
|
145
|
+
drawType: i.drawType
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}), e.bindBuffer(_, null), n;
|
|
150
|
+
}
|
|
151
|
+
function Re(e, t, n, r) {
|
|
152
|
+
n = Ie(n), r === void 0 ? Ee(e, _, t.buffer, n, t.drawType) : (e.bindBuffer(_, t.buffer), e.bufferSubData(_, r, n));
|
|
153
|
+
}
|
|
154
|
+
function ze(e, t) {
|
|
155
|
+
return t === ve || t === ye ? 1 : t === be || t === xe ? 2 : t === Se || t === Ce || t === we ? 4 : 0;
|
|
156
|
+
}
|
|
157
|
+
var Be = [
|
|
158
|
+
"position",
|
|
159
|
+
"positions",
|
|
160
|
+
"a_position"
|
|
161
|
+
];
|
|
162
|
+
function Ve(e, t) {
|
|
163
|
+
let n, r;
|
|
164
|
+
for (r = 0; r < Be.length && (n = Be[r], !(n in t || (n = Te.attribPrefix + n, n in t))); ++r);
|
|
165
|
+
r === Be.length && (n = Object.keys(t)[0]);
|
|
166
|
+
let i = t[n];
|
|
167
|
+
if (!i.buffer) return 1;
|
|
168
|
+
e.bindBuffer(_, i.buffer);
|
|
169
|
+
let a = e.getBufferParameter(_, _e);
|
|
170
|
+
e.bindBuffer(_, null);
|
|
171
|
+
let o = a / ze(e, i.type), s = i.numComponents || i.size, c = o / s;
|
|
172
|
+
if (c % 1 != 0) throw Error(`numComponents ${s} not correct for length ${length}`);
|
|
173
|
+
return c;
|
|
174
|
+
}
|
|
175
|
+
function He(e, t, n) {
|
|
176
|
+
let r = Le(e, t), i = Object.assign({}, n || {});
|
|
177
|
+
i.attribs = Object.assign({}, n ? n.attribs : {}, r);
|
|
178
|
+
let a = t.indices;
|
|
179
|
+
if (a) {
|
|
180
|
+
let t = Ie(a, "indices");
|
|
181
|
+
i.indices = De(e, t, ge), i.numElements = t.length, i.elementType = ae(t);
|
|
182
|
+
} else i.numElements ||= Ve(e, i.attribs);
|
|
183
|
+
return i;
|
|
184
|
+
}
|
|
185
|
+
function v(e) {
|
|
186
|
+
return !!e.texStorage2D;
|
|
187
|
+
}
|
|
188
|
+
var Ue = function() {
|
|
189
|
+
let e = {}, t = {};
|
|
190
|
+
function n(n) {
|
|
191
|
+
let r = n.constructor.name;
|
|
192
|
+
if (!e[r]) {
|
|
193
|
+
for (let e in n) if (typeof n[e] == "number") {
|
|
194
|
+
let r = t[n[e]];
|
|
195
|
+
t[n[e]] = r ? `${r} | ${e}` : e;
|
|
196
|
+
}
|
|
197
|
+
e[r] = !0;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return function(e, r) {
|
|
201
|
+
return n(e), t[r] || (typeof r == "number" ? `0x${r.toString(16)}` : r);
|
|
202
|
+
};
|
|
203
|
+
}(), y = {
|
|
204
|
+
textureColor: new Uint8Array([
|
|
205
|
+
128,
|
|
206
|
+
192,
|
|
207
|
+
255,
|
|
208
|
+
255
|
|
209
|
+
]),
|
|
210
|
+
textureOptions: {},
|
|
211
|
+
crossOrigin: void 0
|
|
212
|
+
}, b = ce, We = function() {
|
|
213
|
+
let e;
|
|
214
|
+
return function() {
|
|
215
|
+
return e ||= typeof document < "u" && document.createElement ? document.createElement("canvas").getContext("2d") : null, e;
|
|
216
|
+
};
|
|
217
|
+
}(), Ge = 6406, x = 6407, S = 6408, Ke = 6409, qe = 6410, C = 6402, Je = 34041, Ye = 33071, Xe = 9728, Ze = 9729, w = 3553, T = 34067, E = 32879, D = 35866, Qe = 34069, $e = 34070, et = 34071, tt = 34072, nt = 34073, rt = 34074, it = 10241, at = 10240, O = 10242, ot = 10243, st = 32882, ct = 33082, lt = 33083, ut = 33084, dt = 33085, ft = 3317, pt = 3314, mt = 32878, ht = 3316, gt = 3315, _t = 32877, vt = 37443, yt = 37441, bt = 37440, xt = 33321, St = 36756, Ct = 33325, wt = 33326, Tt = 33330, Et = 33329, Dt = 33338, Ot = 33337, kt = 33340, At = 33339, jt = 33323, Mt = 36757, Nt = 33327, Pt = 33328, Ft = 33336, It = 33335, Lt = 33332, Rt = 33331, zt = 33334, Bt = 33333, Vt = 32849, Ht = 35905, Ut = 36194, Wt = 36758, Gt = 35898, Kt = 35901, qt = 34843, Jt = 34837, Yt = 36221, Xt = 36239, Zt = 36215, Qt = 36233, $t = 36209, en = 36227, tn = 32856, nn = 35907, rn = 36759, an = 32855, on = 32854, sn = 32857, cn = 34842, ln = 34836, un = 36220, dn = 36238, fn = 36975, pn = 36214, mn = 36232, hn = 36226, gn = 36208, _n = 33189, vn = 33190, yn = 36012, bn = 36013, xn = 35056, k = 5120, A = 5121, Sn = 5122, j = 5123, Cn = 5124, M = 5125, N = 5126, wn = 32819, Tn = 32820, En = 33635, P = 5131, F = 36193, Dn = 33640, On = 35899, kn = 35902, An = 36269, jn = 34042, I = 33319, L = 33320, R = 6403, z = 36244, B = 36248, V = 36249, Mn = {};
|
|
218
|
+
{
|
|
219
|
+
let e = Mn;
|
|
220
|
+
e[Ge] = { numColorComponents: 1 }, e[Ke] = { numColorComponents: 1 }, e[qe] = { numColorComponents: 2 }, e[x] = { numColorComponents: 3 }, e[S] = { numColorComponents: 4 }, e[R] = { numColorComponents: 1 }, e[z] = { numColorComponents: 1 }, e[I] = { numColorComponents: 2 }, e[L] = { numColorComponents: 2 }, e[x] = { numColorComponents: 3 }, e[B] = { numColorComponents: 3 }, e[S] = { numColorComponents: 4 }, e[V] = { numColorComponents: 4 }, e[C] = { numColorComponents: 1 }, e[Je] = { numColorComponents: 2 };
|
|
221
|
+
}
|
|
222
|
+
var Nn;
|
|
223
|
+
function Pn(e) {
|
|
224
|
+
if (!Nn) {
|
|
225
|
+
let e = {};
|
|
226
|
+
e[Ge] = {
|
|
227
|
+
textureFormat: Ge,
|
|
228
|
+
colorRenderable: !0,
|
|
229
|
+
textureFilterable: !0,
|
|
230
|
+
bytesPerElement: [
|
|
231
|
+
1,
|
|
232
|
+
2,
|
|
233
|
+
2,
|
|
234
|
+
4
|
|
235
|
+
],
|
|
236
|
+
type: [
|
|
237
|
+
A,
|
|
238
|
+
P,
|
|
239
|
+
F,
|
|
240
|
+
N
|
|
241
|
+
]
|
|
242
|
+
}, e[Ke] = {
|
|
243
|
+
textureFormat: Ke,
|
|
244
|
+
colorRenderable: !0,
|
|
245
|
+
textureFilterable: !0,
|
|
246
|
+
bytesPerElement: [
|
|
247
|
+
1,
|
|
248
|
+
2,
|
|
249
|
+
2,
|
|
250
|
+
4
|
|
251
|
+
],
|
|
252
|
+
type: [
|
|
253
|
+
A,
|
|
254
|
+
P,
|
|
255
|
+
F,
|
|
256
|
+
N
|
|
257
|
+
]
|
|
258
|
+
}, e[qe] = {
|
|
259
|
+
textureFormat: qe,
|
|
260
|
+
colorRenderable: !0,
|
|
261
|
+
textureFilterable: !0,
|
|
262
|
+
bytesPerElement: [
|
|
263
|
+
2,
|
|
264
|
+
4,
|
|
265
|
+
4,
|
|
266
|
+
8
|
|
267
|
+
],
|
|
268
|
+
type: [
|
|
269
|
+
A,
|
|
270
|
+
P,
|
|
271
|
+
F,
|
|
272
|
+
N
|
|
273
|
+
]
|
|
274
|
+
}, e[x] = {
|
|
275
|
+
textureFormat: x,
|
|
276
|
+
colorRenderable: !0,
|
|
277
|
+
textureFilterable: !0,
|
|
278
|
+
bytesPerElement: [
|
|
279
|
+
3,
|
|
280
|
+
6,
|
|
281
|
+
6,
|
|
282
|
+
12,
|
|
283
|
+
2
|
|
284
|
+
],
|
|
285
|
+
type: [
|
|
286
|
+
A,
|
|
287
|
+
P,
|
|
288
|
+
F,
|
|
289
|
+
N,
|
|
290
|
+
En
|
|
291
|
+
]
|
|
292
|
+
}, e[S] = {
|
|
293
|
+
textureFormat: S,
|
|
294
|
+
colorRenderable: !0,
|
|
295
|
+
textureFilterable: !0,
|
|
296
|
+
bytesPerElement: [
|
|
297
|
+
4,
|
|
298
|
+
8,
|
|
299
|
+
8,
|
|
300
|
+
16,
|
|
301
|
+
2,
|
|
302
|
+
2
|
|
303
|
+
],
|
|
304
|
+
type: [
|
|
305
|
+
A,
|
|
306
|
+
P,
|
|
307
|
+
F,
|
|
308
|
+
N,
|
|
309
|
+
wn,
|
|
310
|
+
Tn
|
|
311
|
+
]
|
|
312
|
+
}, e[C] = {
|
|
313
|
+
textureFormat: C,
|
|
314
|
+
colorRenderable: !0,
|
|
315
|
+
textureFilterable: !1,
|
|
316
|
+
bytesPerElement: [2, 4],
|
|
317
|
+
type: [M, j]
|
|
318
|
+
}, e[xt] = {
|
|
319
|
+
textureFormat: R,
|
|
320
|
+
colorRenderable: !0,
|
|
321
|
+
textureFilterable: !0,
|
|
322
|
+
bytesPerElement: [1],
|
|
323
|
+
type: [A]
|
|
324
|
+
}, e[St] = {
|
|
325
|
+
textureFormat: R,
|
|
326
|
+
colorRenderable: !1,
|
|
327
|
+
textureFilterable: !0,
|
|
328
|
+
bytesPerElement: [1],
|
|
329
|
+
type: [k]
|
|
330
|
+
}, e[Ct] = {
|
|
331
|
+
textureFormat: R,
|
|
332
|
+
colorRenderable: !1,
|
|
333
|
+
textureFilterable: !0,
|
|
334
|
+
bytesPerElement: [4, 2],
|
|
335
|
+
type: [N, P]
|
|
336
|
+
}, e[wt] = {
|
|
337
|
+
textureFormat: R,
|
|
338
|
+
colorRenderable: !1,
|
|
339
|
+
textureFilterable: !1,
|
|
340
|
+
bytesPerElement: [4],
|
|
341
|
+
type: [N]
|
|
342
|
+
}, e[Tt] = {
|
|
343
|
+
textureFormat: z,
|
|
344
|
+
colorRenderable: !0,
|
|
345
|
+
textureFilterable: !1,
|
|
346
|
+
bytesPerElement: [1],
|
|
347
|
+
type: [A]
|
|
348
|
+
}, e[Et] = {
|
|
349
|
+
textureFormat: z,
|
|
350
|
+
colorRenderable: !0,
|
|
351
|
+
textureFilterable: !1,
|
|
352
|
+
bytesPerElement: [1],
|
|
353
|
+
type: [k]
|
|
354
|
+
}, e[Lt] = {
|
|
355
|
+
textureFormat: z,
|
|
356
|
+
colorRenderable: !0,
|
|
357
|
+
textureFilterable: !1,
|
|
358
|
+
bytesPerElement: [2],
|
|
359
|
+
type: [j]
|
|
360
|
+
}, e[Rt] = {
|
|
361
|
+
textureFormat: z,
|
|
362
|
+
colorRenderable: !0,
|
|
363
|
+
textureFilterable: !1,
|
|
364
|
+
bytesPerElement: [2],
|
|
365
|
+
type: [Sn]
|
|
366
|
+
}, e[zt] = {
|
|
367
|
+
textureFormat: z,
|
|
368
|
+
colorRenderable: !0,
|
|
369
|
+
textureFilterable: !1,
|
|
370
|
+
bytesPerElement: [4],
|
|
371
|
+
type: [M]
|
|
372
|
+
}, e[Bt] = {
|
|
373
|
+
textureFormat: z,
|
|
374
|
+
colorRenderable: !0,
|
|
375
|
+
textureFilterable: !1,
|
|
376
|
+
bytesPerElement: [4],
|
|
377
|
+
type: [Cn]
|
|
378
|
+
}, e[jt] = {
|
|
379
|
+
textureFormat: I,
|
|
380
|
+
colorRenderable: !0,
|
|
381
|
+
textureFilterable: !0,
|
|
382
|
+
bytesPerElement: [2],
|
|
383
|
+
type: [A]
|
|
384
|
+
}, e[Mt] = {
|
|
385
|
+
textureFormat: I,
|
|
386
|
+
colorRenderable: !1,
|
|
387
|
+
textureFilterable: !0,
|
|
388
|
+
bytesPerElement: [2],
|
|
389
|
+
type: [k]
|
|
390
|
+
}, e[Nt] = {
|
|
391
|
+
textureFormat: I,
|
|
392
|
+
colorRenderable: !1,
|
|
393
|
+
textureFilterable: !0,
|
|
394
|
+
bytesPerElement: [8, 4],
|
|
395
|
+
type: [N, P]
|
|
396
|
+
}, e[Pt] = {
|
|
397
|
+
textureFormat: I,
|
|
398
|
+
colorRenderable: !1,
|
|
399
|
+
textureFilterable: !1,
|
|
400
|
+
bytesPerElement: [8],
|
|
401
|
+
type: [N]
|
|
402
|
+
}, e[Ft] = {
|
|
403
|
+
textureFormat: L,
|
|
404
|
+
colorRenderable: !0,
|
|
405
|
+
textureFilterable: !1,
|
|
406
|
+
bytesPerElement: [2],
|
|
407
|
+
type: [A]
|
|
408
|
+
}, e[It] = {
|
|
409
|
+
textureFormat: L,
|
|
410
|
+
colorRenderable: !0,
|
|
411
|
+
textureFilterable: !1,
|
|
412
|
+
bytesPerElement: [2],
|
|
413
|
+
type: [k]
|
|
414
|
+
}, e[Dt] = {
|
|
415
|
+
textureFormat: L,
|
|
416
|
+
colorRenderable: !0,
|
|
417
|
+
textureFilterable: !1,
|
|
418
|
+
bytesPerElement: [4],
|
|
419
|
+
type: [j]
|
|
420
|
+
}, e[Ot] = {
|
|
421
|
+
textureFormat: L,
|
|
422
|
+
colorRenderable: !0,
|
|
423
|
+
textureFilterable: !1,
|
|
424
|
+
bytesPerElement: [4],
|
|
425
|
+
type: [Sn]
|
|
426
|
+
}, e[kt] = {
|
|
427
|
+
textureFormat: L,
|
|
428
|
+
colorRenderable: !0,
|
|
429
|
+
textureFilterable: !1,
|
|
430
|
+
bytesPerElement: [8],
|
|
431
|
+
type: [M]
|
|
432
|
+
}, e[At] = {
|
|
433
|
+
textureFormat: L,
|
|
434
|
+
colorRenderable: !0,
|
|
435
|
+
textureFilterable: !1,
|
|
436
|
+
bytesPerElement: [8],
|
|
437
|
+
type: [Cn]
|
|
438
|
+
}, e[Vt] = {
|
|
439
|
+
textureFormat: x,
|
|
440
|
+
colorRenderable: !0,
|
|
441
|
+
textureFilterable: !0,
|
|
442
|
+
bytesPerElement: [3],
|
|
443
|
+
type: [A]
|
|
444
|
+
}, e[Ht] = {
|
|
445
|
+
textureFormat: x,
|
|
446
|
+
colorRenderable: !1,
|
|
447
|
+
textureFilterable: !0,
|
|
448
|
+
bytesPerElement: [3],
|
|
449
|
+
type: [A]
|
|
450
|
+
}, e[Ut] = {
|
|
451
|
+
textureFormat: x,
|
|
452
|
+
colorRenderable: !0,
|
|
453
|
+
textureFilterable: !0,
|
|
454
|
+
bytesPerElement: [3, 2],
|
|
455
|
+
type: [A, En]
|
|
456
|
+
}, e[Wt] = {
|
|
457
|
+
textureFormat: x,
|
|
458
|
+
colorRenderable: !1,
|
|
459
|
+
textureFilterable: !0,
|
|
460
|
+
bytesPerElement: [3],
|
|
461
|
+
type: [k]
|
|
462
|
+
}, e[Gt] = {
|
|
463
|
+
textureFormat: x,
|
|
464
|
+
colorRenderable: !1,
|
|
465
|
+
textureFilterable: !0,
|
|
466
|
+
bytesPerElement: [
|
|
467
|
+
12,
|
|
468
|
+
6,
|
|
469
|
+
4
|
|
470
|
+
],
|
|
471
|
+
type: [
|
|
472
|
+
N,
|
|
473
|
+
P,
|
|
474
|
+
On
|
|
475
|
+
]
|
|
476
|
+
}, e[Kt] = {
|
|
477
|
+
textureFormat: x,
|
|
478
|
+
colorRenderable: !1,
|
|
479
|
+
textureFilterable: !0,
|
|
480
|
+
bytesPerElement: [
|
|
481
|
+
12,
|
|
482
|
+
6,
|
|
483
|
+
4
|
|
484
|
+
],
|
|
485
|
+
type: [
|
|
486
|
+
N,
|
|
487
|
+
P,
|
|
488
|
+
kn
|
|
489
|
+
]
|
|
490
|
+
}, e[qt] = {
|
|
491
|
+
textureFormat: x,
|
|
492
|
+
colorRenderable: !1,
|
|
493
|
+
textureFilterable: !0,
|
|
494
|
+
bytesPerElement: [12, 6],
|
|
495
|
+
type: [N, P]
|
|
496
|
+
}, e[Jt] = {
|
|
497
|
+
textureFormat: x,
|
|
498
|
+
colorRenderable: !1,
|
|
499
|
+
textureFilterable: !1,
|
|
500
|
+
bytesPerElement: [12],
|
|
501
|
+
type: [N]
|
|
502
|
+
}, e[Yt] = {
|
|
503
|
+
textureFormat: B,
|
|
504
|
+
colorRenderable: !1,
|
|
505
|
+
textureFilterable: !1,
|
|
506
|
+
bytesPerElement: [3],
|
|
507
|
+
type: [A]
|
|
508
|
+
}, e[Xt] = {
|
|
509
|
+
textureFormat: B,
|
|
510
|
+
colorRenderable: !1,
|
|
511
|
+
textureFilterable: !1,
|
|
512
|
+
bytesPerElement: [3],
|
|
513
|
+
type: [k]
|
|
514
|
+
}, e[Zt] = {
|
|
515
|
+
textureFormat: B,
|
|
516
|
+
colorRenderable: !1,
|
|
517
|
+
textureFilterable: !1,
|
|
518
|
+
bytesPerElement: [6],
|
|
519
|
+
type: [j]
|
|
520
|
+
}, e[Qt] = {
|
|
521
|
+
textureFormat: B,
|
|
522
|
+
colorRenderable: !1,
|
|
523
|
+
textureFilterable: !1,
|
|
524
|
+
bytesPerElement: [6],
|
|
525
|
+
type: [Sn]
|
|
526
|
+
}, e[$t] = {
|
|
527
|
+
textureFormat: B,
|
|
528
|
+
colorRenderable: !1,
|
|
529
|
+
textureFilterable: !1,
|
|
530
|
+
bytesPerElement: [12],
|
|
531
|
+
type: [M]
|
|
532
|
+
}, e[en] = {
|
|
533
|
+
textureFormat: B,
|
|
534
|
+
colorRenderable: !1,
|
|
535
|
+
textureFilterable: !1,
|
|
536
|
+
bytesPerElement: [12],
|
|
537
|
+
type: [Cn]
|
|
538
|
+
}, e[tn] = {
|
|
539
|
+
textureFormat: S,
|
|
540
|
+
colorRenderable: !0,
|
|
541
|
+
textureFilterable: !0,
|
|
542
|
+
bytesPerElement: [4],
|
|
543
|
+
type: [A]
|
|
544
|
+
}, e[nn] = {
|
|
545
|
+
textureFormat: S,
|
|
546
|
+
colorRenderable: !0,
|
|
547
|
+
textureFilterable: !0,
|
|
548
|
+
bytesPerElement: [4],
|
|
549
|
+
type: [A]
|
|
550
|
+
}, e[rn] = {
|
|
551
|
+
textureFormat: S,
|
|
552
|
+
colorRenderable: !1,
|
|
553
|
+
textureFilterable: !0,
|
|
554
|
+
bytesPerElement: [4],
|
|
555
|
+
type: [k]
|
|
556
|
+
}, e[an] = {
|
|
557
|
+
textureFormat: S,
|
|
558
|
+
colorRenderable: !0,
|
|
559
|
+
textureFilterable: !0,
|
|
560
|
+
bytesPerElement: [
|
|
561
|
+
4,
|
|
562
|
+
2,
|
|
563
|
+
4
|
|
564
|
+
],
|
|
565
|
+
type: [
|
|
566
|
+
A,
|
|
567
|
+
Tn,
|
|
568
|
+
Dn
|
|
569
|
+
]
|
|
570
|
+
}, e[on] = {
|
|
571
|
+
textureFormat: S,
|
|
572
|
+
colorRenderable: !0,
|
|
573
|
+
textureFilterable: !0,
|
|
574
|
+
bytesPerElement: [4, 2],
|
|
575
|
+
type: [A, wn]
|
|
576
|
+
}, e[sn] = {
|
|
577
|
+
textureFormat: S,
|
|
578
|
+
colorRenderable: !0,
|
|
579
|
+
textureFilterable: !0,
|
|
580
|
+
bytesPerElement: [4],
|
|
581
|
+
type: [Dn]
|
|
582
|
+
}, e[cn] = {
|
|
583
|
+
textureFormat: S,
|
|
584
|
+
colorRenderable: !1,
|
|
585
|
+
textureFilterable: !0,
|
|
586
|
+
bytesPerElement: [16, 8],
|
|
587
|
+
type: [N, P]
|
|
588
|
+
}, e[ln] = {
|
|
589
|
+
textureFormat: S,
|
|
590
|
+
colorRenderable: !1,
|
|
591
|
+
textureFilterable: !1,
|
|
592
|
+
bytesPerElement: [16],
|
|
593
|
+
type: [N]
|
|
594
|
+
}, e[un] = {
|
|
595
|
+
textureFormat: V,
|
|
596
|
+
colorRenderable: !0,
|
|
597
|
+
textureFilterable: !1,
|
|
598
|
+
bytesPerElement: [4],
|
|
599
|
+
type: [A]
|
|
600
|
+
}, e[dn] = {
|
|
601
|
+
textureFormat: V,
|
|
602
|
+
colorRenderable: !0,
|
|
603
|
+
textureFilterable: !1,
|
|
604
|
+
bytesPerElement: [4],
|
|
605
|
+
type: [k]
|
|
606
|
+
}, e[fn] = {
|
|
607
|
+
textureFormat: V,
|
|
608
|
+
colorRenderable: !0,
|
|
609
|
+
textureFilterable: !1,
|
|
610
|
+
bytesPerElement: [4],
|
|
611
|
+
type: [Dn]
|
|
612
|
+
}, e[pn] = {
|
|
613
|
+
textureFormat: V,
|
|
614
|
+
colorRenderable: !0,
|
|
615
|
+
textureFilterable: !1,
|
|
616
|
+
bytesPerElement: [8],
|
|
617
|
+
type: [j]
|
|
618
|
+
}, e[mn] = {
|
|
619
|
+
textureFormat: V,
|
|
620
|
+
colorRenderable: !0,
|
|
621
|
+
textureFilterable: !1,
|
|
622
|
+
bytesPerElement: [8],
|
|
623
|
+
type: [Sn]
|
|
624
|
+
}, e[hn] = {
|
|
625
|
+
textureFormat: V,
|
|
626
|
+
colorRenderable: !0,
|
|
627
|
+
textureFilterable: !1,
|
|
628
|
+
bytesPerElement: [16],
|
|
629
|
+
type: [Cn]
|
|
630
|
+
}, e[gn] = {
|
|
631
|
+
textureFormat: V,
|
|
632
|
+
colorRenderable: !0,
|
|
633
|
+
textureFilterable: !1,
|
|
634
|
+
bytesPerElement: [16],
|
|
635
|
+
type: [M]
|
|
636
|
+
}, e[_n] = {
|
|
637
|
+
textureFormat: C,
|
|
638
|
+
colorRenderable: !0,
|
|
639
|
+
textureFilterable: !1,
|
|
640
|
+
bytesPerElement: [2, 4],
|
|
641
|
+
type: [j, M]
|
|
642
|
+
}, e[vn] = {
|
|
643
|
+
textureFormat: C,
|
|
644
|
+
colorRenderable: !0,
|
|
645
|
+
textureFilterable: !1,
|
|
646
|
+
bytesPerElement: [4],
|
|
647
|
+
type: [M]
|
|
648
|
+
}, e[yn] = {
|
|
649
|
+
textureFormat: C,
|
|
650
|
+
colorRenderable: !0,
|
|
651
|
+
textureFilterable: !1,
|
|
652
|
+
bytesPerElement: [4],
|
|
653
|
+
type: [N]
|
|
654
|
+
}, e[xn] = {
|
|
655
|
+
textureFormat: Je,
|
|
656
|
+
colorRenderable: !0,
|
|
657
|
+
textureFilterable: !1,
|
|
658
|
+
bytesPerElement: [4],
|
|
659
|
+
type: [jn]
|
|
660
|
+
}, e[bn] = {
|
|
661
|
+
textureFormat: Je,
|
|
662
|
+
colorRenderable: !0,
|
|
663
|
+
textureFilterable: !1,
|
|
664
|
+
bytesPerElement: [4],
|
|
665
|
+
type: [An]
|
|
666
|
+
}, Object.keys(e).forEach(function(t) {
|
|
667
|
+
let n = e[t];
|
|
668
|
+
n.bytesPerElementMap = {}, n.bytesPerElement.forEach(function(e, t) {
|
|
669
|
+
let r = n.type[t];
|
|
670
|
+
n.bytesPerElementMap[r] = e;
|
|
671
|
+
});
|
|
672
|
+
}), Nn = e;
|
|
673
|
+
}
|
|
674
|
+
return Nn[e];
|
|
675
|
+
}
|
|
676
|
+
function Fn(e, t) {
|
|
677
|
+
let n = Pn(e);
|
|
678
|
+
if (!n) throw "unknown internal format";
|
|
679
|
+
let r = n.bytesPerElementMap[t];
|
|
680
|
+
if (r === void 0) throw "unknown internal format";
|
|
681
|
+
return r;
|
|
682
|
+
}
|
|
683
|
+
function H(e) {
|
|
684
|
+
let t = Pn(e);
|
|
685
|
+
if (!t) throw "unknown internal format";
|
|
686
|
+
return {
|
|
687
|
+
format: t.textureFormat,
|
|
688
|
+
type: t.type[0]
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
function In(e) {
|
|
692
|
+
return (e & e - 1) == 0;
|
|
693
|
+
}
|
|
694
|
+
function Ln(e, t, n, r) {
|
|
695
|
+
if (!v(e)) return In(t) && In(n);
|
|
696
|
+
let i = Pn(r);
|
|
697
|
+
if (!i) throw "unknown internal format";
|
|
698
|
+
return i.colorRenderable && i.textureFilterable;
|
|
699
|
+
}
|
|
700
|
+
function Rn(e) {
|
|
701
|
+
let t = Pn(e);
|
|
702
|
+
if (!t) throw "unknown internal format";
|
|
703
|
+
return t.textureFilterable;
|
|
704
|
+
}
|
|
705
|
+
function zn(e, t, n) {
|
|
706
|
+
return b(t) ? ae(t) : n || A;
|
|
707
|
+
}
|
|
708
|
+
function Bn(e, t, n, r, i) {
|
|
709
|
+
if (i % 1 != 0) throw "can't guess dimensions";
|
|
710
|
+
if (!n && !r) {
|
|
711
|
+
let e = Math.sqrt(i / (t === T ? 6 : 1));
|
|
712
|
+
e % 1 == 0 ? (n = e, r = e) : (n = i, r = 1);
|
|
713
|
+
} else if (!r) {
|
|
714
|
+
if (r = i / n, r % 1) throw "can't guess dimensions";
|
|
715
|
+
} else if (!n && (n = i / r, n % 1)) throw "can't guess dimensions";
|
|
716
|
+
return {
|
|
717
|
+
width: n,
|
|
718
|
+
height: r
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
function U(e, t) {
|
|
722
|
+
t.colorspaceConversion !== void 0 && e.pixelStorei(vt, t.colorspaceConversion), t.premultiplyAlpha !== void 0 && e.pixelStorei(yt, t.premultiplyAlpha), t.flipY !== void 0 && e.pixelStorei(bt, t.flipY);
|
|
723
|
+
}
|
|
724
|
+
function Vn(e) {
|
|
725
|
+
e.pixelStorei(ft, 4), v(e) && (e.pixelStorei(pt, 0), e.pixelStorei(mt, 0), e.pixelStorei(ht, 0), e.pixelStorei(gt, 0), e.pixelStorei(_t, 0));
|
|
726
|
+
}
|
|
727
|
+
function Hn(e, t, n, r) {
|
|
728
|
+
r.minMag && (n.call(e, t, it, r.minMag), n.call(e, t, at, r.minMag)), r.min && n.call(e, t, it, r.min), r.mag && n.call(e, t, at, r.mag), r.wrap && (n.call(e, t, O, r.wrap), n.call(e, t, ot, r.wrap), (t === E || me(e, t)) && n.call(e, t, st, r.wrap)), r.wrapR && n.call(e, t, st, r.wrapR), r.wrapS && n.call(e, t, O, r.wrapS), r.wrapT && n.call(e, t, ot, r.wrapT), r.minLod && n.call(e, t, ct, r.minLod), r.maxLod && n.call(e, t, lt, r.maxLod), r.baseLevel && n.call(e, t, ut, r.baseLevel), r.maxLevel && n.call(e, t, dt, r.maxLevel);
|
|
729
|
+
}
|
|
730
|
+
function Un(e, t, n) {
|
|
731
|
+
let r = n.target || w;
|
|
732
|
+
e.bindTexture(r, t), Hn(e, r, e.texParameteri, n);
|
|
733
|
+
}
|
|
734
|
+
function Wn(e) {
|
|
735
|
+
return e ||= y.textureColor, b(e) ? e : new Uint8Array([
|
|
736
|
+
e[0] * 255,
|
|
737
|
+
e[1] * 255,
|
|
738
|
+
e[2] * 255,
|
|
739
|
+
e[3] * 255
|
|
740
|
+
]);
|
|
741
|
+
}
|
|
742
|
+
function Gn(e, t, n, r, i, a) {
|
|
743
|
+
n ||= y.textureOptions, a ||= S;
|
|
744
|
+
let o = n.target || w;
|
|
745
|
+
if (r ||= n.width, i ||= n.height, e.bindTexture(o, t), Ln(e, r, i, a)) e.generateMipmap(o);
|
|
746
|
+
else {
|
|
747
|
+
let t = Rn(a) ? Ze : Xe;
|
|
748
|
+
e.texParameteri(o, it, t), e.texParameteri(o, at, t), e.texParameteri(o, O, Ye), e.texParameteri(o, ot, Ye);
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
function W(e) {
|
|
752
|
+
return e.auto === !0 || e.auto === void 0 && e.level === void 0;
|
|
753
|
+
}
|
|
754
|
+
function Kn(e, t) {
|
|
755
|
+
return t ||= {}, t.cubeFaceOrder || [
|
|
756
|
+
Qe,
|
|
757
|
+
$e,
|
|
758
|
+
et,
|
|
759
|
+
tt,
|
|
760
|
+
nt,
|
|
761
|
+
rt
|
|
762
|
+
];
|
|
763
|
+
}
|
|
764
|
+
function qn(e, t) {
|
|
765
|
+
let n = Kn(e, t).map(function(e, t) {
|
|
766
|
+
return {
|
|
767
|
+
face: e,
|
|
768
|
+
ndx: t
|
|
769
|
+
};
|
|
770
|
+
});
|
|
771
|
+
return n.sort(function(e, t) {
|
|
772
|
+
return e.face - t.face;
|
|
773
|
+
}), n;
|
|
774
|
+
}
|
|
775
|
+
function Jn(e, t, n, r) {
|
|
776
|
+
r ||= y.textureOptions;
|
|
777
|
+
let i = r.target || w, a = r.level || 0, o = n.width, s = n.height, c = r.internalFormat || r.format || S, l = H(c), u = r.format || l.format, d = r.type || l.type;
|
|
778
|
+
if (U(e, r), e.bindTexture(i, t), i === T) {
|
|
779
|
+
let l = n.width, f = n.height, p, m;
|
|
780
|
+
if (l / 6 === f) p = f, m = [
|
|
781
|
+
0,
|
|
782
|
+
0,
|
|
783
|
+
1,
|
|
784
|
+
0,
|
|
785
|
+
2,
|
|
786
|
+
0,
|
|
787
|
+
3,
|
|
788
|
+
0,
|
|
789
|
+
4,
|
|
790
|
+
0,
|
|
791
|
+
5,
|
|
792
|
+
0
|
|
793
|
+
];
|
|
794
|
+
else if (f / 6 === l) p = l, m = [
|
|
795
|
+
0,
|
|
796
|
+
0,
|
|
797
|
+
0,
|
|
798
|
+
1,
|
|
799
|
+
0,
|
|
800
|
+
2,
|
|
801
|
+
0,
|
|
802
|
+
3,
|
|
803
|
+
0,
|
|
804
|
+
4,
|
|
805
|
+
0,
|
|
806
|
+
5
|
|
807
|
+
];
|
|
808
|
+
else if (l / 3 == f / 2) p = l / 3, m = [
|
|
809
|
+
0,
|
|
810
|
+
0,
|
|
811
|
+
1,
|
|
812
|
+
0,
|
|
813
|
+
2,
|
|
814
|
+
0,
|
|
815
|
+
0,
|
|
816
|
+
1,
|
|
817
|
+
1,
|
|
818
|
+
1,
|
|
819
|
+
2,
|
|
820
|
+
1
|
|
821
|
+
];
|
|
822
|
+
else if (l / 2 == f / 3) p = l / 2, m = [
|
|
823
|
+
0,
|
|
824
|
+
0,
|
|
825
|
+
1,
|
|
826
|
+
0,
|
|
827
|
+
0,
|
|
828
|
+
1,
|
|
829
|
+
1,
|
|
830
|
+
1,
|
|
831
|
+
0,
|
|
832
|
+
2,
|
|
833
|
+
1,
|
|
834
|
+
2
|
|
835
|
+
];
|
|
836
|
+
else throw "can't figure out cube map from element: " + (n.src ? n.src : n.nodeName);
|
|
837
|
+
let h = We();
|
|
838
|
+
h ? (h.canvas.width = p, h.canvas.height = p, o = p, s = p, qn(e, r).forEach(function(t) {
|
|
839
|
+
let r = m[t.ndx * 2 + 0] * p, i = m[t.ndx * 2 + 1] * p;
|
|
840
|
+
h.drawImage(n, r, i, p, p, 0, 0, p, p), e.texImage2D(t.face, a, c, u, d, h.canvas);
|
|
841
|
+
}), h.canvas.width = 1, h.canvas.height = 1) : typeof createImageBitmap < "u" && (o = p, s = p, qn(e, r).forEach(function(l) {
|
|
842
|
+
let f = m[l.ndx * 2 + 0] * p, h = m[l.ndx * 2 + 1] * p;
|
|
843
|
+
e.texImage2D(l.face, a, c, p, p, 0, u, d, null), createImageBitmap(n, f, h, p, p, {
|
|
844
|
+
premultiplyAlpha: "none",
|
|
845
|
+
colorSpaceConversion: "none"
|
|
846
|
+
}).then(function(n) {
|
|
847
|
+
U(e, r), e.bindTexture(i, t), e.texImage2D(l.face, a, c, u, d, n), W(r) && Gn(e, t, r, o, s, c);
|
|
848
|
+
});
|
|
849
|
+
}));
|
|
850
|
+
} else if (i === E || i === D) {
|
|
851
|
+
let t = Math.min(n.width, n.height), r = Math.max(n.width, n.height), o = r / t;
|
|
852
|
+
if (o % 1 != 0) throw "can not compute 3D dimensions of element";
|
|
853
|
+
let s = +(n.width === r), l = +(n.height === r);
|
|
854
|
+
e.pixelStorei(ft, 1), e.pixelStorei(pt, n.width), e.pixelStorei(mt, 0), e.pixelStorei(_t, 0), e.texImage3D(i, a, c, t, t, t, 0, u, d, null);
|
|
855
|
+
for (let r = 0; r < o; ++r) {
|
|
856
|
+
let o = r * t * s, c = r * t * l;
|
|
857
|
+
e.pixelStorei(ht, o), e.pixelStorei(gt, c), e.texSubImage3D(i, a, 0, 0, r, t, t, 1, u, d, n);
|
|
858
|
+
}
|
|
859
|
+
Vn(e);
|
|
860
|
+
} else e.texImage2D(i, a, c, u, d, n);
|
|
861
|
+
W(r) && Gn(e, t, r, o, s, c), Un(e, t, r);
|
|
862
|
+
}
|
|
863
|
+
function G() {}
|
|
864
|
+
function Yn(e) {
|
|
865
|
+
if (typeof document < "u") {
|
|
866
|
+
let t = document.createElement("a");
|
|
867
|
+
return t.href = e, t.hostname === location.hostname && t.port === location.port && t.protocol === location.protocol;
|
|
868
|
+
} else {
|
|
869
|
+
let t = new URL(location.href).origin;
|
|
870
|
+
return new URL(e, location.href).origin === t;
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
function Xn(e, t) {
|
|
874
|
+
return t === void 0 && !Yn(e) ? "anonymous" : t;
|
|
875
|
+
}
|
|
876
|
+
function Zn(e, t, n) {
|
|
877
|
+
n ||= G;
|
|
878
|
+
let r;
|
|
879
|
+
if (t = t === void 0 ? y.crossOrigin : t, t = Xn(e, t), typeof Image < "u") {
|
|
880
|
+
r = new Image(), t !== void 0 && (r.crossOrigin = t);
|
|
881
|
+
let i = function() {
|
|
882
|
+
r.removeEventListener("error", a), r.removeEventListener("load", o), r = null;
|
|
883
|
+
}, a = function() {
|
|
884
|
+
let t = "couldn't load image: " + e;
|
|
885
|
+
le(t), n(t, r), i();
|
|
886
|
+
}, o = function() {
|
|
887
|
+
n(null, r), i();
|
|
888
|
+
};
|
|
889
|
+
return r.addEventListener("error", a), r.addEventListener("load", o), r.src = e, r;
|
|
890
|
+
} else if (typeof ImageBitmap < "u") {
|
|
891
|
+
let i, a, o = function() {
|
|
892
|
+
n(i, a);
|
|
893
|
+
}, s = {};
|
|
894
|
+
t && (s.mode = "cors"), fetch(e, s).then(function(e) {
|
|
895
|
+
if (!e.ok) throw e;
|
|
896
|
+
return e.blob();
|
|
897
|
+
}).then(function(e) {
|
|
898
|
+
return createImageBitmap(e, {
|
|
899
|
+
premultiplyAlpha: "none",
|
|
900
|
+
colorSpaceConversion: "none"
|
|
901
|
+
});
|
|
902
|
+
}).then(function(e) {
|
|
903
|
+
a = e, setTimeout(o);
|
|
904
|
+
}).catch(function(e) {
|
|
905
|
+
i = e, setTimeout(o);
|
|
906
|
+
}), r = null;
|
|
907
|
+
}
|
|
908
|
+
return r;
|
|
909
|
+
}
|
|
910
|
+
function Qn(e) {
|
|
911
|
+
return typeof ImageBitmap < "u" && e instanceof ImageBitmap || typeof ImageData < "u" && e instanceof ImageData || typeof HTMLElement < "u" && e instanceof HTMLElement;
|
|
912
|
+
}
|
|
913
|
+
function $n(e, t, n) {
|
|
914
|
+
return Qn(e) ? (setTimeout(function() {
|
|
915
|
+
n(null, e);
|
|
916
|
+
}), e) : Zn(e, t, n);
|
|
917
|
+
}
|
|
918
|
+
function er(e, t, n) {
|
|
919
|
+
n ||= y.textureOptions;
|
|
920
|
+
let r = n.target || w;
|
|
921
|
+
if (e.bindTexture(r, t), n.color === !1) return;
|
|
922
|
+
let i = Wn(n.color);
|
|
923
|
+
if (r === T) for (let t = 0; t < 6; ++t) e.texImage2D(Qe + t, 0, S, 1, 1, 0, S, A, i);
|
|
924
|
+
else r === E || r === D ? e.texImage3D(r, 0, S, 1, 1, 1, 0, S, A, i) : e.texImage2D(r, 0, S, 1, 1, 0, S, A, i);
|
|
925
|
+
}
|
|
926
|
+
function tr(e, t, n, r) {
|
|
927
|
+
return r ||= G, n ||= y.textureOptions, er(e, t, n), n = Object.assign({}, n), $n(n.src, n.crossOrigin, function(i, a) {
|
|
928
|
+
i ? r(i, t, a) : (Jn(e, t, a, n), r(null, t, a));
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
function nr(e, t, n, r) {
|
|
932
|
+
r ||= G;
|
|
933
|
+
let i = n.src;
|
|
934
|
+
if (i.length !== 6) throw "there must be 6 urls for a cubemap";
|
|
935
|
+
let a = n.level || 0, o = n.internalFormat || n.format || S, s = H(o), c = n.format || s.format, l = n.type || A, u = n.target || w;
|
|
936
|
+
if (u !== T) throw "target must be TEXTURE_CUBE_MAP";
|
|
937
|
+
er(e, t, n), n = Object.assign({}, n);
|
|
938
|
+
let d = 6, f = [], p = Kn(e, n), m;
|
|
939
|
+
function h(i) {
|
|
940
|
+
return function(s, p) {
|
|
941
|
+
--d, s ? f.push(s) : p.width === p.height ? (U(e, n), e.bindTexture(u, t), d === 5 ? Kn().forEach(function(t) {
|
|
942
|
+
e.texImage2D(t, a, o, c, l, p);
|
|
943
|
+
}) : e.texImage2D(i, a, o, c, l, p), W(n) && e.generateMipmap(u)) : f.push("cubemap face img is not a square: " + p.src), d === 0 && r(f.length ? f : void 0, t, m);
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
m = i.map(function(e, t) {
|
|
947
|
+
return $n(e, n.crossOrigin, h(p[t]));
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
function rr(e, t, n, r) {
|
|
951
|
+
r ||= G;
|
|
952
|
+
let i = n.src, a = n.internalFormat || n.format || S, o = H(a), s = n.format || o.format, c = n.type || A, l = n.target || D;
|
|
953
|
+
if (l !== E && l !== D) throw "target must be TEXTURE_3D or TEXTURE_2D_ARRAY";
|
|
954
|
+
er(e, t, n), n = Object.assign({}, n);
|
|
955
|
+
let u = i.length, d = [], f, p = n.level || 0, m = n.width, h = n.height, ee = i.length, te = !0;
|
|
956
|
+
function g(i) {
|
|
957
|
+
return function(o, g) {
|
|
958
|
+
if (--u, o) d.push(o);
|
|
959
|
+
else {
|
|
960
|
+
if (U(e, n), e.bindTexture(l, t), te) {
|
|
961
|
+
te = !1, m = n.width || g.width, h = n.height || g.height, e.texImage3D(l, p, a, m, h, ee, 0, s, c, null);
|
|
962
|
+
for (let t = 0; t < ee; ++t) e.texSubImage3D(l, p, 0, 0, t, m, h, 1, s, c, g);
|
|
963
|
+
} else {
|
|
964
|
+
let t = g, n;
|
|
965
|
+
(g.width !== m || g.height !== h) && (n = We(), t = n.canvas, n.canvas.width = m, n.canvas.height = h, n.drawImage(g, 0, 0, m, h)), e.texSubImage3D(l, p, 0, 0, i, m, h, 1, s, c, t), n && t === n.canvas && (n.canvas.width = 0, n.canvas.height = 0);
|
|
966
|
+
}
|
|
967
|
+
W(n) && e.generateMipmap(l);
|
|
968
|
+
}
|
|
969
|
+
u === 0 && r(d.length ? d : void 0, t, f);
|
|
970
|
+
};
|
|
971
|
+
}
|
|
972
|
+
f = i.map(function(e, t) {
|
|
973
|
+
return $n(e, n.crossOrigin, g(t));
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
function ir(e, t, n, r) {
|
|
977
|
+
r ||= y.textureOptions;
|
|
978
|
+
let i = r.target || w;
|
|
979
|
+
e.bindTexture(i, t);
|
|
980
|
+
let a = r.width, o = r.height, s = r.depth, c = r.level || 0, l = r.internalFormat || r.format || S, u = H(l), d = r.format || u.format, f = r.type || zn(e, n, u.type);
|
|
981
|
+
b(n) ? n instanceof Uint8ClampedArray && (n = new Uint8Array(n.buffer)) : n = new (se(f))(n);
|
|
982
|
+
let p = Fn(l, f), m = n.byteLength / p;
|
|
983
|
+
if (m % 1) throw "length wrong size for format: " + Ue(e, d);
|
|
984
|
+
let h;
|
|
985
|
+
if (i === E || i === D) if (!a && !o && !s) {
|
|
986
|
+
let e = Math.cbrt(m);
|
|
987
|
+
if (e % 1 != 0) throw "can't guess cube size of array of numElements: " + m;
|
|
988
|
+
a = e, o = e, s = e;
|
|
989
|
+
} else a && (!o || !s) ? (h = Bn(e, i, o, s, m / a), o = h.width, s = h.height) : o && (!a || !s) ? (h = Bn(e, i, a, s, m / o), a = h.width, s = h.height) : (h = Bn(e, i, a, o, m / s), a = h.width, o = h.height);
|
|
990
|
+
else h = Bn(e, i, a, o, m), a = h.width, o = h.height;
|
|
991
|
+
if (Vn(e), e.pixelStorei(ft, r.unpackAlignment || 1), U(e, r), i === T) {
|
|
992
|
+
let t = p / n.BYTES_PER_ELEMENT, i = m / 6 * t;
|
|
993
|
+
qn(e, r).forEach((t) => {
|
|
994
|
+
let r = i * t.ndx, s = n.subarray(r, r + i);
|
|
995
|
+
e.texImage2D(t.face, c, l, a, o, 0, d, f, s);
|
|
996
|
+
});
|
|
997
|
+
} else i === E || i === D ? e.texImage3D(i, c, l, a, o, s, 0, d, f, n) : e.texImage2D(i, c, l, a, o, 0, d, f, n);
|
|
998
|
+
return {
|
|
999
|
+
width: a,
|
|
1000
|
+
height: o,
|
|
1001
|
+
depth: s,
|
|
1002
|
+
type: f
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
function ar(e, t, n) {
|
|
1006
|
+
let r = n.target || w;
|
|
1007
|
+
e.bindTexture(r, t);
|
|
1008
|
+
let i = n.level || 0, a = n.internalFormat || n.format || S, o = H(a), s = n.format || o.format, c = n.type || o.type;
|
|
1009
|
+
if (U(e, n), r === T) for (let t = 0; t < 6; ++t) e.texImage2D(Qe + t, i, a, n.width, n.height, 0, s, c, null);
|
|
1010
|
+
else r === E || r === D ? e.texImage3D(r, i, a, n.width, n.height, n.depth, 0, s, c, null) : e.texImage2D(r, i, a, n.width, n.height, 0, s, c, null);
|
|
1011
|
+
}
|
|
1012
|
+
function or(e, t, n) {
|
|
1013
|
+
n ||= G, t ||= y.textureOptions;
|
|
1014
|
+
let r = e.createTexture(), i = t.target || w, a = t.width || 1, o = t.height || 1, s = t.internalFormat || S;
|
|
1015
|
+
e.bindTexture(i, r), i === T && (e.texParameteri(i, O, Ye), e.texParameteri(i, ot, Ye));
|
|
1016
|
+
let c = t.src;
|
|
1017
|
+
if (c) if (typeof c == "function" && (c = c(e, t)), typeof c == "string") tr(e, r, t, n);
|
|
1018
|
+
else if (b(c) || Array.isArray(c) && (typeof c[0] == "number" || Array.isArray(c[0]) || b(c[0]))) {
|
|
1019
|
+
let n = ir(e, r, c, t);
|
|
1020
|
+
a = n.width, o = n.height;
|
|
1021
|
+
} else Array.isArray(c) && (typeof c[0] == "string" || Qn(c[0])) ? i === T ? nr(e, r, t, n) : rr(e, r, t, n) : (Jn(e, r, c, t), a = c.width, o = c.height);
|
|
1022
|
+
else ar(e, r, t);
|
|
1023
|
+
return W(t) && Gn(e, r, t, a, o, s), Un(e, r, t), r;
|
|
1024
|
+
}
|
|
1025
|
+
function sr(e, t, n, r, i, a) {
|
|
1026
|
+
r ||= n.width, i ||= n.height, a ||= n.depth;
|
|
1027
|
+
let o = n.target || w;
|
|
1028
|
+
e.bindTexture(o, t);
|
|
1029
|
+
let s = n.level || 0, c = n.internalFormat || n.format || S, l = H(c), u = n.format || l.format, d, f = n.src;
|
|
1030
|
+
if (d = f && (b(f) || Array.isArray(f) && typeof f[0] == "number") ? n.type || zn(e, f, l.type) : n.type || l.type, o === T) for (let t = 0; t < 6; ++t) e.texImage2D(Qe + t, s, c, r, i, 0, u, d, null);
|
|
1031
|
+
else o === E || o === D ? e.texImage3D(o, s, c, r, i, a, 0, u, d, null) : e.texImage2D(o, s, c, r, i, 0, u, d, null);
|
|
1032
|
+
}
|
|
1033
|
+
var cr = ue, lr = 33984, ur = 35048, dr = 34962, fr = 34963, pr = 35345, mr = 35718, hr = 35721, gr = 35971, _r = 35382, vr = 35396, yr = 35398, br = 35392, xr = 35395, Sr = 5126, Cr = 35664, wr = 35665, Tr = 35666, Er = 5124, Dr = 35667, Or = 35668, kr = 35669, Ar = 35670, jr = 35671, Mr = 35672, Nr = 35673, Pr = 35674, Fr = 35675, Ir = 35676, Lr = 35678, Rr = 35680, zr = 35679, Br = 35682, Vr = 35685, Hr = 35686, Ur = 35687, Wr = 35688, Gr = 35689, Kr = 35690, qr = 36289, Jr = 36292, Yr = 36293, Xr = 5125, Zr = 36294, Qr = 36295, $r = 36296, ei = 36298, ti = 36299, ni = 36300, ri = 36303, ii = 36306, ai = 36307, oi = 36308, si = 36311, ci = 3553, li = 34067, ui = 32879, di = 35866, K = {};
|
|
1034
|
+
function fi(e, t) {
|
|
1035
|
+
return K[t].bindPoint;
|
|
1036
|
+
}
|
|
1037
|
+
function pi(e, t) {
|
|
1038
|
+
return function(n) {
|
|
1039
|
+
e.uniform1f(t, n);
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
function mi(e, t) {
|
|
1043
|
+
return function(n) {
|
|
1044
|
+
e.uniform1fv(t, n);
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
function hi(e, t) {
|
|
1048
|
+
return function(n) {
|
|
1049
|
+
e.uniform2fv(t, n);
|
|
1050
|
+
};
|
|
1051
|
+
}
|
|
1052
|
+
function gi(e, t) {
|
|
1053
|
+
return function(n) {
|
|
1054
|
+
e.uniform3fv(t, n);
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
function _i(e, t) {
|
|
1058
|
+
return function(n) {
|
|
1059
|
+
e.uniform4fv(t, n);
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
function vi(e, t) {
|
|
1063
|
+
return function(n) {
|
|
1064
|
+
e.uniform1i(t, n);
|
|
1065
|
+
};
|
|
1066
|
+
}
|
|
1067
|
+
function yi(e, t) {
|
|
1068
|
+
return function(n) {
|
|
1069
|
+
e.uniform1iv(t, n);
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
1072
|
+
function bi(e, t) {
|
|
1073
|
+
return function(n) {
|
|
1074
|
+
e.uniform2iv(t, n);
|
|
1075
|
+
};
|
|
1076
|
+
}
|
|
1077
|
+
function xi(e, t) {
|
|
1078
|
+
return function(n) {
|
|
1079
|
+
e.uniform3iv(t, n);
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
1082
|
+
function Si(e, t) {
|
|
1083
|
+
return function(n) {
|
|
1084
|
+
e.uniform4iv(t, n);
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
function Ci(e, t) {
|
|
1088
|
+
return function(n) {
|
|
1089
|
+
e.uniform1ui(t, n);
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
function wi(e, t) {
|
|
1093
|
+
return function(n) {
|
|
1094
|
+
e.uniform1uiv(t, n);
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
function Ti(e, t) {
|
|
1098
|
+
return function(n) {
|
|
1099
|
+
e.uniform2uiv(t, n);
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
function Ei(e, t) {
|
|
1103
|
+
return function(n) {
|
|
1104
|
+
e.uniform3uiv(t, n);
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
function Di(e, t) {
|
|
1108
|
+
return function(n) {
|
|
1109
|
+
e.uniform4uiv(t, n);
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
function Oi(e, t) {
|
|
1113
|
+
return function(n) {
|
|
1114
|
+
e.uniformMatrix2fv(t, !1, n);
|
|
1115
|
+
};
|
|
1116
|
+
}
|
|
1117
|
+
function ki(e, t) {
|
|
1118
|
+
return function(n) {
|
|
1119
|
+
e.uniformMatrix3fv(t, !1, n);
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
function Ai(e, t) {
|
|
1123
|
+
return function(n) {
|
|
1124
|
+
e.uniformMatrix4fv(t, !1, n);
|
|
1125
|
+
};
|
|
1126
|
+
}
|
|
1127
|
+
function ji(e, t) {
|
|
1128
|
+
return function(n) {
|
|
1129
|
+
e.uniformMatrix2x3fv(t, !1, n);
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
1132
|
+
function Mi(e, t) {
|
|
1133
|
+
return function(n) {
|
|
1134
|
+
e.uniformMatrix3x2fv(t, !1, n);
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
function Ni(e, t) {
|
|
1138
|
+
return function(n) {
|
|
1139
|
+
e.uniformMatrix2x4fv(t, !1, n);
|
|
1140
|
+
};
|
|
1141
|
+
}
|
|
1142
|
+
function Pi(e, t) {
|
|
1143
|
+
return function(n) {
|
|
1144
|
+
e.uniformMatrix4x2fv(t, !1, n);
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
function Fi(e, t) {
|
|
1148
|
+
return function(n) {
|
|
1149
|
+
e.uniformMatrix3x4fv(t, !1, n);
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
function Ii(e, t) {
|
|
1153
|
+
return function(n) {
|
|
1154
|
+
e.uniformMatrix4x3fv(t, !1, n);
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
function q(e, t, n, r) {
|
|
1158
|
+
let i = fi(e, t);
|
|
1159
|
+
return v(e) ? function(t) {
|
|
1160
|
+
let a, o;
|
|
1161
|
+
pe(e, t) ? (a = t, o = null) : (a = t.texture, o = t.sampler), e.uniform1i(r, n), e.activeTexture(lr + n), e.bindTexture(i, a), e.bindSampler(n, o);
|
|
1162
|
+
} : function(t) {
|
|
1163
|
+
e.uniform1i(r, n), e.activeTexture(lr + n), e.bindTexture(i, t);
|
|
1164
|
+
};
|
|
1165
|
+
}
|
|
1166
|
+
function J(e, t, n, r, i) {
|
|
1167
|
+
let a = fi(e, t), o = new Int32Array(i);
|
|
1168
|
+
for (let e = 0; e < i; ++e) o[e] = n + e;
|
|
1169
|
+
return v(e) ? function(t) {
|
|
1170
|
+
e.uniform1iv(r, o), t.forEach(function(t, r) {
|
|
1171
|
+
e.activeTexture(lr + o[r]);
|
|
1172
|
+
let i, s;
|
|
1173
|
+
pe(e, t) ? (i = t, s = null) : (i = t.texture, s = t.sampler), e.bindSampler(n, s), e.bindTexture(a, i);
|
|
1174
|
+
});
|
|
1175
|
+
} : function(t) {
|
|
1176
|
+
e.uniform1iv(r, o), t.forEach(function(t, n) {
|
|
1177
|
+
e.activeTexture(lr + o[n]), e.bindTexture(a, t);
|
|
1178
|
+
});
|
|
1179
|
+
};
|
|
1180
|
+
}
|
|
1181
|
+
K[Sr] = {
|
|
1182
|
+
Type: Float32Array,
|
|
1183
|
+
size: 4,
|
|
1184
|
+
setter: pi,
|
|
1185
|
+
arraySetter: mi
|
|
1186
|
+
}, K[Cr] = {
|
|
1187
|
+
Type: Float32Array,
|
|
1188
|
+
size: 8,
|
|
1189
|
+
setter: hi,
|
|
1190
|
+
cols: 2
|
|
1191
|
+
}, K[wr] = {
|
|
1192
|
+
Type: Float32Array,
|
|
1193
|
+
size: 12,
|
|
1194
|
+
setter: gi,
|
|
1195
|
+
cols: 3
|
|
1196
|
+
}, K[Tr] = {
|
|
1197
|
+
Type: Float32Array,
|
|
1198
|
+
size: 16,
|
|
1199
|
+
setter: _i,
|
|
1200
|
+
cols: 4
|
|
1201
|
+
}, K[Er] = {
|
|
1202
|
+
Type: Int32Array,
|
|
1203
|
+
size: 4,
|
|
1204
|
+
setter: vi,
|
|
1205
|
+
arraySetter: yi
|
|
1206
|
+
}, K[Dr] = {
|
|
1207
|
+
Type: Int32Array,
|
|
1208
|
+
size: 8,
|
|
1209
|
+
setter: bi,
|
|
1210
|
+
cols: 2
|
|
1211
|
+
}, K[Or] = {
|
|
1212
|
+
Type: Int32Array,
|
|
1213
|
+
size: 12,
|
|
1214
|
+
setter: xi,
|
|
1215
|
+
cols: 3
|
|
1216
|
+
}, K[kr] = {
|
|
1217
|
+
Type: Int32Array,
|
|
1218
|
+
size: 16,
|
|
1219
|
+
setter: Si,
|
|
1220
|
+
cols: 4
|
|
1221
|
+
}, K[Xr] = {
|
|
1222
|
+
Type: Uint32Array,
|
|
1223
|
+
size: 4,
|
|
1224
|
+
setter: Ci,
|
|
1225
|
+
arraySetter: wi
|
|
1226
|
+
}, K[Zr] = {
|
|
1227
|
+
Type: Uint32Array,
|
|
1228
|
+
size: 8,
|
|
1229
|
+
setter: Ti,
|
|
1230
|
+
cols: 2
|
|
1231
|
+
}, K[Qr] = {
|
|
1232
|
+
Type: Uint32Array,
|
|
1233
|
+
size: 12,
|
|
1234
|
+
setter: Ei,
|
|
1235
|
+
cols: 3
|
|
1236
|
+
}, K[$r] = {
|
|
1237
|
+
Type: Uint32Array,
|
|
1238
|
+
size: 16,
|
|
1239
|
+
setter: Di,
|
|
1240
|
+
cols: 4
|
|
1241
|
+
}, K[Ar] = {
|
|
1242
|
+
Type: Uint32Array,
|
|
1243
|
+
size: 4,
|
|
1244
|
+
setter: vi,
|
|
1245
|
+
arraySetter: yi
|
|
1246
|
+
}, K[jr] = {
|
|
1247
|
+
Type: Uint32Array,
|
|
1248
|
+
size: 8,
|
|
1249
|
+
setter: bi,
|
|
1250
|
+
cols: 2
|
|
1251
|
+
}, K[Mr] = {
|
|
1252
|
+
Type: Uint32Array,
|
|
1253
|
+
size: 12,
|
|
1254
|
+
setter: xi,
|
|
1255
|
+
cols: 3
|
|
1256
|
+
}, K[Nr] = {
|
|
1257
|
+
Type: Uint32Array,
|
|
1258
|
+
size: 16,
|
|
1259
|
+
setter: Si,
|
|
1260
|
+
cols: 4
|
|
1261
|
+
}, K[Pr] = {
|
|
1262
|
+
Type: Float32Array,
|
|
1263
|
+
size: 32,
|
|
1264
|
+
setter: Oi,
|
|
1265
|
+
rows: 2,
|
|
1266
|
+
cols: 2
|
|
1267
|
+
}, K[Fr] = {
|
|
1268
|
+
Type: Float32Array,
|
|
1269
|
+
size: 48,
|
|
1270
|
+
setter: ki,
|
|
1271
|
+
rows: 3,
|
|
1272
|
+
cols: 3
|
|
1273
|
+
}, K[Ir] = {
|
|
1274
|
+
Type: Float32Array,
|
|
1275
|
+
size: 64,
|
|
1276
|
+
setter: Ai,
|
|
1277
|
+
rows: 4,
|
|
1278
|
+
cols: 4
|
|
1279
|
+
}, K[Vr] = {
|
|
1280
|
+
Type: Float32Array,
|
|
1281
|
+
size: 32,
|
|
1282
|
+
setter: ji,
|
|
1283
|
+
rows: 2,
|
|
1284
|
+
cols: 3
|
|
1285
|
+
}, K[Hr] = {
|
|
1286
|
+
Type: Float32Array,
|
|
1287
|
+
size: 32,
|
|
1288
|
+
setter: Ni,
|
|
1289
|
+
rows: 2,
|
|
1290
|
+
cols: 4
|
|
1291
|
+
}, K[Ur] = {
|
|
1292
|
+
Type: Float32Array,
|
|
1293
|
+
size: 48,
|
|
1294
|
+
setter: Mi,
|
|
1295
|
+
rows: 3,
|
|
1296
|
+
cols: 2
|
|
1297
|
+
}, K[Wr] = {
|
|
1298
|
+
Type: Float32Array,
|
|
1299
|
+
size: 48,
|
|
1300
|
+
setter: Fi,
|
|
1301
|
+
rows: 3,
|
|
1302
|
+
cols: 4
|
|
1303
|
+
}, K[Gr] = {
|
|
1304
|
+
Type: Float32Array,
|
|
1305
|
+
size: 64,
|
|
1306
|
+
setter: Pi,
|
|
1307
|
+
rows: 4,
|
|
1308
|
+
cols: 2
|
|
1309
|
+
}, K[Kr] = {
|
|
1310
|
+
Type: Float32Array,
|
|
1311
|
+
size: 64,
|
|
1312
|
+
setter: Ii,
|
|
1313
|
+
rows: 4,
|
|
1314
|
+
cols: 3
|
|
1315
|
+
}, K[Lr] = {
|
|
1316
|
+
Type: null,
|
|
1317
|
+
size: 0,
|
|
1318
|
+
setter: q,
|
|
1319
|
+
arraySetter: J,
|
|
1320
|
+
bindPoint: ci
|
|
1321
|
+
}, K[Rr] = {
|
|
1322
|
+
Type: null,
|
|
1323
|
+
size: 0,
|
|
1324
|
+
setter: q,
|
|
1325
|
+
arraySetter: J,
|
|
1326
|
+
bindPoint: li
|
|
1327
|
+
}, K[zr] = {
|
|
1328
|
+
Type: null,
|
|
1329
|
+
size: 0,
|
|
1330
|
+
setter: q,
|
|
1331
|
+
arraySetter: J,
|
|
1332
|
+
bindPoint: ui
|
|
1333
|
+
}, K[Br] = {
|
|
1334
|
+
Type: null,
|
|
1335
|
+
size: 0,
|
|
1336
|
+
setter: q,
|
|
1337
|
+
arraySetter: J,
|
|
1338
|
+
bindPoint: ci
|
|
1339
|
+
}, K[qr] = {
|
|
1340
|
+
Type: null,
|
|
1341
|
+
size: 0,
|
|
1342
|
+
setter: q,
|
|
1343
|
+
arraySetter: J,
|
|
1344
|
+
bindPoint: di
|
|
1345
|
+
}, K[Jr] = {
|
|
1346
|
+
Type: null,
|
|
1347
|
+
size: 0,
|
|
1348
|
+
setter: q,
|
|
1349
|
+
arraySetter: J,
|
|
1350
|
+
bindPoint: di
|
|
1351
|
+
}, K[Yr] = {
|
|
1352
|
+
Type: null,
|
|
1353
|
+
size: 0,
|
|
1354
|
+
setter: q,
|
|
1355
|
+
arraySetter: J,
|
|
1356
|
+
bindPoint: li
|
|
1357
|
+
}, K[ei] = {
|
|
1358
|
+
Type: null,
|
|
1359
|
+
size: 0,
|
|
1360
|
+
setter: q,
|
|
1361
|
+
arraySetter: J,
|
|
1362
|
+
bindPoint: ci
|
|
1363
|
+
}, K[ti] = {
|
|
1364
|
+
Type: null,
|
|
1365
|
+
size: 0,
|
|
1366
|
+
setter: q,
|
|
1367
|
+
arraySetter: J,
|
|
1368
|
+
bindPoint: ui
|
|
1369
|
+
}, K[ni] = {
|
|
1370
|
+
Type: null,
|
|
1371
|
+
size: 0,
|
|
1372
|
+
setter: q,
|
|
1373
|
+
arraySetter: J,
|
|
1374
|
+
bindPoint: li
|
|
1375
|
+
}, K[ri] = {
|
|
1376
|
+
Type: null,
|
|
1377
|
+
size: 0,
|
|
1378
|
+
setter: q,
|
|
1379
|
+
arraySetter: J,
|
|
1380
|
+
bindPoint: di
|
|
1381
|
+
}, K[ii] = {
|
|
1382
|
+
Type: null,
|
|
1383
|
+
size: 0,
|
|
1384
|
+
setter: q,
|
|
1385
|
+
arraySetter: J,
|
|
1386
|
+
bindPoint: ci
|
|
1387
|
+
}, K[ai] = {
|
|
1388
|
+
Type: null,
|
|
1389
|
+
size: 0,
|
|
1390
|
+
setter: q,
|
|
1391
|
+
arraySetter: J,
|
|
1392
|
+
bindPoint: ui
|
|
1393
|
+
}, K[oi] = {
|
|
1394
|
+
Type: null,
|
|
1395
|
+
size: 0,
|
|
1396
|
+
setter: q,
|
|
1397
|
+
arraySetter: J,
|
|
1398
|
+
bindPoint: li
|
|
1399
|
+
}, K[si] = {
|
|
1400
|
+
Type: null,
|
|
1401
|
+
size: 0,
|
|
1402
|
+
setter: q,
|
|
1403
|
+
arraySetter: J,
|
|
1404
|
+
bindPoint: di
|
|
1405
|
+
};
|
|
1406
|
+
function Li(e, t) {
|
|
1407
|
+
return function(n) {
|
|
1408
|
+
if (n.value) switch (e.disableVertexAttribArray(t), n.value.length) {
|
|
1409
|
+
case 4:
|
|
1410
|
+
e.vertexAttrib4fv(t, n.value);
|
|
1411
|
+
break;
|
|
1412
|
+
case 3:
|
|
1413
|
+
e.vertexAttrib3fv(t, n.value);
|
|
1414
|
+
break;
|
|
1415
|
+
case 2:
|
|
1416
|
+
e.vertexAttrib2fv(t, n.value);
|
|
1417
|
+
break;
|
|
1418
|
+
case 1:
|
|
1419
|
+
e.vertexAttrib1fv(t, n.value);
|
|
1420
|
+
break;
|
|
1421
|
+
default: throw Error("the length of a float constant value must be between 1 and 4!");
|
|
1422
|
+
}
|
|
1423
|
+
else e.bindBuffer(dr, n.buffer), e.enableVertexAttribArray(t), e.vertexAttribPointer(t, n.numComponents || n.size, n.type || Sr, n.normalize || !1, n.stride || 0, n.offset || 0), n.divisor !== void 0 && e.vertexAttribDivisor(t, n.divisor);
|
|
1424
|
+
};
|
|
1425
|
+
}
|
|
1426
|
+
function Y(e, t) {
|
|
1427
|
+
return function(n) {
|
|
1428
|
+
if (n.value) if (e.disableVertexAttribArray(t), n.value.length === 4) e.vertexAttrib4iv(t, n.value);
|
|
1429
|
+
else throw Error("The length of an integer constant value must be 4!");
|
|
1430
|
+
else e.bindBuffer(dr, n.buffer), e.enableVertexAttribArray(t), e.vertexAttribIPointer(t, n.numComponents || n.size, n.type || Er, n.stride || 0, n.offset || 0), n.divisor !== void 0 && e.vertexAttribDivisor(t, n.divisor);
|
|
1431
|
+
};
|
|
1432
|
+
}
|
|
1433
|
+
function Ri(e, t) {
|
|
1434
|
+
return function(n) {
|
|
1435
|
+
if (n.value) if (e.disableVertexAttribArray(t), n.value.length === 4) e.vertexAttrib4uiv(t, n.value);
|
|
1436
|
+
else throw Error("The length of an unsigned integer constant value must be 4!");
|
|
1437
|
+
else e.bindBuffer(dr, n.buffer), e.enableVertexAttribArray(t), e.vertexAttribIPointer(t, n.numComponents || n.size, n.type || Xr, n.stride || 0, n.offset || 0), n.divisor !== void 0 && e.vertexAttribDivisor(t, n.divisor);
|
|
1438
|
+
};
|
|
1439
|
+
}
|
|
1440
|
+
function zi(e, t, n) {
|
|
1441
|
+
let r = n.size, i = n.count;
|
|
1442
|
+
return function(n) {
|
|
1443
|
+
e.bindBuffer(dr, n.buffer);
|
|
1444
|
+
let a = n.size || n.numComponents || r, o = a / i, s = n.type || Sr, c = K[s].size * a, l = n.normalize || !1, u = n.offset || 0, d = c / i;
|
|
1445
|
+
for (let r = 0; r < i; ++r) e.enableVertexAttribArray(t + r), e.vertexAttribPointer(t + r, o, s, l, c, u + d * r), n.divisor !== void 0 && e.vertexAttribDivisor(t + r, n.divisor);
|
|
1446
|
+
};
|
|
1447
|
+
}
|
|
1448
|
+
var X = {};
|
|
1449
|
+
X[Sr] = {
|
|
1450
|
+
size: 4,
|
|
1451
|
+
setter: Li
|
|
1452
|
+
}, X[Cr] = {
|
|
1453
|
+
size: 8,
|
|
1454
|
+
setter: Li
|
|
1455
|
+
}, X[wr] = {
|
|
1456
|
+
size: 12,
|
|
1457
|
+
setter: Li
|
|
1458
|
+
}, X[Tr] = {
|
|
1459
|
+
size: 16,
|
|
1460
|
+
setter: Li
|
|
1461
|
+
}, X[Er] = {
|
|
1462
|
+
size: 4,
|
|
1463
|
+
setter: Y
|
|
1464
|
+
}, X[Dr] = {
|
|
1465
|
+
size: 8,
|
|
1466
|
+
setter: Y
|
|
1467
|
+
}, X[Or] = {
|
|
1468
|
+
size: 12,
|
|
1469
|
+
setter: Y
|
|
1470
|
+
}, X[kr] = {
|
|
1471
|
+
size: 16,
|
|
1472
|
+
setter: Y
|
|
1473
|
+
}, X[Xr] = {
|
|
1474
|
+
size: 4,
|
|
1475
|
+
setter: Ri
|
|
1476
|
+
}, X[Zr] = {
|
|
1477
|
+
size: 8,
|
|
1478
|
+
setter: Ri
|
|
1479
|
+
}, X[Qr] = {
|
|
1480
|
+
size: 12,
|
|
1481
|
+
setter: Ri
|
|
1482
|
+
}, X[$r] = {
|
|
1483
|
+
size: 16,
|
|
1484
|
+
setter: Ri
|
|
1485
|
+
}, X[Ar] = {
|
|
1486
|
+
size: 4,
|
|
1487
|
+
setter: Y
|
|
1488
|
+
}, X[jr] = {
|
|
1489
|
+
size: 8,
|
|
1490
|
+
setter: Y
|
|
1491
|
+
}, X[Mr] = {
|
|
1492
|
+
size: 12,
|
|
1493
|
+
setter: Y
|
|
1494
|
+
}, X[Nr] = {
|
|
1495
|
+
size: 16,
|
|
1496
|
+
setter: Y
|
|
1497
|
+
}, X[Pr] = {
|
|
1498
|
+
size: 4,
|
|
1499
|
+
setter: zi,
|
|
1500
|
+
count: 2
|
|
1501
|
+
}, X[Fr] = {
|
|
1502
|
+
size: 9,
|
|
1503
|
+
setter: zi,
|
|
1504
|
+
count: 3
|
|
1505
|
+
}, X[Ir] = {
|
|
1506
|
+
size: 16,
|
|
1507
|
+
setter: zi,
|
|
1508
|
+
count: 4
|
|
1509
|
+
};
|
|
1510
|
+
function Bi(e) {
|
|
1511
|
+
let t = e.name;
|
|
1512
|
+
return t.startsWith("gl_") || t.startsWith("webgl_");
|
|
1513
|
+
}
|
|
1514
|
+
var Vi = /(\.|\[|]|\w+)/g, Hi = (e) => e >= "0" && e <= "9";
|
|
1515
|
+
function Ui(e, t, n, r) {
|
|
1516
|
+
let i = e.split(Vi).filter((e) => e !== ""), a = 0, o = "";
|
|
1517
|
+
for (;;) {
|
|
1518
|
+
let e = i[a++];
|
|
1519
|
+
o += e;
|
|
1520
|
+
let s = Hi(e[0]), c = s ? parseInt(e) : e;
|
|
1521
|
+
if (s && (o += i[a++]), a === i.length) {
|
|
1522
|
+
n[c] = t;
|
|
1523
|
+
break;
|
|
1524
|
+
} else {
|
|
1525
|
+
let e = i[a++], t = e === "[", s = n[c] || (t ? [] : {});
|
|
1526
|
+
n[c] = s, n = s, r[o] = r[o] || function(e) {
|
|
1527
|
+
return function(t) {
|
|
1528
|
+
ta(e, t);
|
|
1529
|
+
};
|
|
1530
|
+
}(s), o += e;
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
function Wi(e, t) {
|
|
1535
|
+
let n = 0;
|
|
1536
|
+
function r(t, r, i) {
|
|
1537
|
+
let a = r.name.endsWith("[0]"), o = r.type, s = K[o];
|
|
1538
|
+
if (!s) throw Error(`unknown type: 0x${o.toString(16)}`);
|
|
1539
|
+
let c;
|
|
1540
|
+
if (s.bindPoint) {
|
|
1541
|
+
let t = n;
|
|
1542
|
+
n += r.size, c = a ? s.arraySetter(e, o, t, i, r.size) : s.setter(e, o, t, i, r.size);
|
|
1543
|
+
} else c = s.arraySetter && a ? s.arraySetter(e, i) : s.setter(e, i);
|
|
1544
|
+
return c.location = i, c;
|
|
1545
|
+
}
|
|
1546
|
+
let i = {}, a = {}, o = e.getProgramParameter(t, mr);
|
|
1547
|
+
for (let n = 0; n < o; ++n) {
|
|
1548
|
+
let o = e.getActiveUniform(t, n);
|
|
1549
|
+
if (Bi(o)) continue;
|
|
1550
|
+
let s = o.name;
|
|
1551
|
+
s.endsWith("[0]") && (s = s.substr(0, s.length - 3));
|
|
1552
|
+
let c = e.getUniformLocation(t, o.name);
|
|
1553
|
+
if (c) {
|
|
1554
|
+
let e = r(t, o, c);
|
|
1555
|
+
i[s] = e, Ui(s, e, a, i);
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
return i;
|
|
1559
|
+
}
|
|
1560
|
+
function Gi(e, t) {
|
|
1561
|
+
let n = {}, r = e.getProgramParameter(t, gr);
|
|
1562
|
+
for (let i = 0; i < r; ++i) {
|
|
1563
|
+
let r = e.getTransformFeedbackVarying(t, i);
|
|
1564
|
+
n[r.name] = {
|
|
1565
|
+
index: i,
|
|
1566
|
+
type: r.type,
|
|
1567
|
+
size: r.size
|
|
1568
|
+
};
|
|
1569
|
+
}
|
|
1570
|
+
return n;
|
|
1571
|
+
}
|
|
1572
|
+
function Ki(e, t) {
|
|
1573
|
+
let n = e.getProgramParameter(t, mr), r = [], i = [];
|
|
1574
|
+
for (let a = 0; a < n; ++a) {
|
|
1575
|
+
i.push(a), r.push({});
|
|
1576
|
+
let n = e.getActiveUniform(t, a);
|
|
1577
|
+
r[a].name = n.name;
|
|
1578
|
+
}
|
|
1579
|
+
[
|
|
1580
|
+
["UNIFORM_TYPE", "type"],
|
|
1581
|
+
["UNIFORM_SIZE", "size"],
|
|
1582
|
+
["UNIFORM_BLOCK_INDEX", "blockNdx"],
|
|
1583
|
+
["UNIFORM_OFFSET", "offset"]
|
|
1584
|
+
].forEach(function(n) {
|
|
1585
|
+
let a = n[0], o = n[1];
|
|
1586
|
+
e.getActiveUniforms(t, i, e[a]).forEach(function(e, t) {
|
|
1587
|
+
r[t][o] = e;
|
|
1588
|
+
});
|
|
1589
|
+
});
|
|
1590
|
+
let a = {}, o = e.getProgramParameter(t, _r);
|
|
1591
|
+
for (let n = 0; n < o; ++n) {
|
|
1592
|
+
let r = e.getActiveUniformBlockName(t, n), i = {
|
|
1593
|
+
index: e.getUniformBlockIndex(t, r),
|
|
1594
|
+
usedByVertexShader: e.getActiveUniformBlockParameter(t, n, vr),
|
|
1595
|
+
usedByFragmentShader: e.getActiveUniformBlockParameter(t, n, yr),
|
|
1596
|
+
size: e.getActiveUniformBlockParameter(t, n, br),
|
|
1597
|
+
uniformIndices: e.getActiveUniformBlockParameter(t, n, xr)
|
|
1598
|
+
};
|
|
1599
|
+
i.used = i.usedByVertexShader || i.usedByFragmentShader, a[r] = i;
|
|
1600
|
+
}
|
|
1601
|
+
return {
|
|
1602
|
+
blockSpecs: a,
|
|
1603
|
+
uniformData: r
|
|
1604
|
+
};
|
|
1605
|
+
}
|
|
1606
|
+
var qi = /\[\d+\]\.$/, Ji = (e, t) => ((e + (t - 1)) / t | 0) * t;
|
|
1607
|
+
function Yi(e, t, n, r) {
|
|
1608
|
+
if (t || n) {
|
|
1609
|
+
r ||= 1;
|
|
1610
|
+
let t = e.length / 4;
|
|
1611
|
+
return function(n) {
|
|
1612
|
+
let i = 0, a = 0;
|
|
1613
|
+
for (let o = 0; o < t; ++o) {
|
|
1614
|
+
for (let t = 0; t < r; ++t) e[i++] = n[a++];
|
|
1615
|
+
i += 4 - r;
|
|
1616
|
+
}
|
|
1617
|
+
};
|
|
1618
|
+
} else return function(t) {
|
|
1619
|
+
t.length ? e.set(t) : e[0] = t;
|
|
1620
|
+
};
|
|
1621
|
+
}
|
|
1622
|
+
function Xi(e, t, n, r) {
|
|
1623
|
+
let i = n.blockSpecs, a = n.uniformData, o = i[r];
|
|
1624
|
+
if (!o) return cr("no uniform block object named:", r), {
|
|
1625
|
+
name: r,
|
|
1626
|
+
uniforms: {}
|
|
1627
|
+
};
|
|
1628
|
+
let s = new ArrayBuffer(o.size), c = e.createBuffer(), l = o.index;
|
|
1629
|
+
e.bindBuffer(pr, c), e.uniformBlockBinding(t, o.index, l);
|
|
1630
|
+
let u = r + ".";
|
|
1631
|
+
qi.test(u) && (u = u.replace(qi, "."));
|
|
1632
|
+
let d = {}, f = {}, p = {};
|
|
1633
|
+
return o.uniformIndices.forEach(function(e) {
|
|
1634
|
+
let t = a[e], n = t.name;
|
|
1635
|
+
n.startsWith(u) && (n = n.substr(u.length));
|
|
1636
|
+
let r = n.endsWith("[0]");
|
|
1637
|
+
r && (n = n.substr(0, n.length - 3));
|
|
1638
|
+
let i = K[t.type], o = i.Type, c = r ? Ji(i.size, 16) * t.size : i.size * t.size, l = new o(s, t.offset, c / o.BYTES_PER_ELEMENT);
|
|
1639
|
+
d[n] = l;
|
|
1640
|
+
let m = Yi(l, r, i.rows, i.cols);
|
|
1641
|
+
f[n] = m, Ui(n, m, p, f);
|
|
1642
|
+
}), {
|
|
1643
|
+
name: r,
|
|
1644
|
+
array: s,
|
|
1645
|
+
asFloat: new Float32Array(s),
|
|
1646
|
+
buffer: c,
|
|
1647
|
+
uniforms: d,
|
|
1648
|
+
setters: f
|
|
1649
|
+
};
|
|
1650
|
+
}
|
|
1651
|
+
function Zi(e, t, n) {
|
|
1652
|
+
return Xi(e, t.program, t.uniformBlockSpec, n);
|
|
1653
|
+
}
|
|
1654
|
+
function Qi(e, t, n) {
|
|
1655
|
+
let r = (t.uniformBlockSpec || t).blockSpecs[n.name];
|
|
1656
|
+
if (r) {
|
|
1657
|
+
let t = r.index;
|
|
1658
|
+
return e.bindBufferRange(pr, t, n.buffer, n.offset || 0, n.array.byteLength), !0;
|
|
1659
|
+
}
|
|
1660
|
+
return !1;
|
|
1661
|
+
}
|
|
1662
|
+
function $i(e, t, n) {
|
|
1663
|
+
Qi(e, t, n) && e.bufferData(pr, n.array, ur);
|
|
1664
|
+
}
|
|
1665
|
+
function ea(e, t) {
|
|
1666
|
+
let n = e.setters;
|
|
1667
|
+
for (let e in t) {
|
|
1668
|
+
let r = n[e];
|
|
1669
|
+
if (r) {
|
|
1670
|
+
let n = t[e];
|
|
1671
|
+
r(n);
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
function ta(e, t) {
|
|
1676
|
+
for (let n in t) {
|
|
1677
|
+
let r = e[n];
|
|
1678
|
+
typeof r == "function" ? r(t[n]) : ta(e[n], t[n]);
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
function na(e, ...t) {
|
|
1682
|
+
let n = e.uniformSetters || e, r = t.length;
|
|
1683
|
+
for (let e = 0; e < r; ++e) {
|
|
1684
|
+
let r = t[e];
|
|
1685
|
+
if (Array.isArray(r)) {
|
|
1686
|
+
let e = r.length;
|
|
1687
|
+
for (let t = 0; t < e; ++t) na(n, r[t]);
|
|
1688
|
+
} else for (let e in r) {
|
|
1689
|
+
let t = n[e];
|
|
1690
|
+
t && t(r[e]);
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
function ra(e, t) {
|
|
1695
|
+
let n = {}, r = e.getProgramParameter(t, hr);
|
|
1696
|
+
for (let i = 0; i < r; ++i) {
|
|
1697
|
+
let r = e.getActiveAttrib(t, i);
|
|
1698
|
+
if (Bi(r)) continue;
|
|
1699
|
+
let a = e.getAttribLocation(t, r.name), o = X[r.type], s = o.setter(e, a, o);
|
|
1700
|
+
s.location = a, n[r.name] = s;
|
|
1701
|
+
}
|
|
1702
|
+
return n;
|
|
1703
|
+
}
|
|
1704
|
+
function ia(e, t) {
|
|
1705
|
+
for (let n in t) {
|
|
1706
|
+
let r = e[n];
|
|
1707
|
+
r && r(t[n]);
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
function aa(e, t, n) {
|
|
1711
|
+
n.vertexArrayObject ? e.bindVertexArray(n.vertexArrayObject) : (ia(t.attribSetters || t, n.attribs), n.indices && e.bindBuffer(fr, n.indices));
|
|
1712
|
+
}
|
|
1713
|
+
function oa(e, t) {
|
|
1714
|
+
let n = {
|
|
1715
|
+
program: t,
|
|
1716
|
+
uniformSetters: Wi(e, t),
|
|
1717
|
+
attribSetters: ra(e, t)
|
|
1718
|
+
};
|
|
1719
|
+
return v(e) && (n.uniformBlockSpec = Ki(e, t), n.transformFeedbackInfo = Gi(e, t)), n;
|
|
1720
|
+
}
|
|
1721
|
+
var sa = 4, ca = 5123;
|
|
1722
|
+
function la(e, t, n, r, i, a) {
|
|
1723
|
+
n = n === void 0 ? sa : n;
|
|
1724
|
+
let o = t.indices, s = t.elementType, c = r === void 0 ? t.numElements : r;
|
|
1725
|
+
i = i === void 0 ? 0 : i, s || o ? a === void 0 ? e.drawElements(n, c, s === void 0 ? ca : t.elementType, i) : e.drawElementsInstanced(n, c, s === void 0 ? ca : t.elementType, i, a) : a === void 0 ? e.drawArrays(n, i, c) : e.drawArraysInstanced(n, i, c, a);
|
|
1726
|
+
}
|
|
1727
|
+
var ua = 36160, Z = 36161, da = 3553, fa = 5121, pa = 6402, ma = 6408, ha = 33190, ga = 36012, _a = 35056, va = 36013, ya = 32854, ba = 32855, xa = 36194, Sa = 33189, Ca = 6401, wa = 36168, Ta = 34041, Ea = 36064, Da = 36096, Oa = 36128, ka = 33306, Aa = 33071, ja = 9729, Ma = [{
|
|
1728
|
+
format: ma,
|
|
1729
|
+
type: fa,
|
|
1730
|
+
min: ja,
|
|
1731
|
+
wrap: Aa
|
|
1732
|
+
}, { format: Ta }], Q = {};
|
|
1733
|
+
Q[Ta] = ka, Q[Ca] = Oa, Q[wa] = Oa, Q[pa] = Da, Q[Sa] = Da, Q[ha] = Da, Q[ga] = Da, Q[_a] = ka, Q[va] = ka;
|
|
1734
|
+
function Na(e, t) {
|
|
1735
|
+
return Q[e] || Q[t];
|
|
1736
|
+
}
|
|
1737
|
+
var $ = {};
|
|
1738
|
+
$[ya] = !0, $[ba] = !0, $[xa] = !0, $[Ta] = !0, $[Sa] = !0, $[Ca] = !0, $[wa] = !0;
|
|
1739
|
+
function Pa(e) {
|
|
1740
|
+
return $[e];
|
|
1741
|
+
}
|
|
1742
|
+
function Fa(e) {
|
|
1743
|
+
return e >= Ea && e < 36096;
|
|
1744
|
+
}
|
|
1745
|
+
function Ia(e, t, n, r) {
|
|
1746
|
+
let i = ua, a = e.createFramebuffer();
|
|
1747
|
+
e.bindFramebuffer(i, a), n ||= e.drawingBufferWidth, r ||= e.drawingBufferHeight, t ||= Ma;
|
|
1748
|
+
let o = [], s = {
|
|
1749
|
+
framebuffer: a,
|
|
1750
|
+
attachments: [],
|
|
1751
|
+
width: n,
|
|
1752
|
+
height: r
|
|
1753
|
+
};
|
|
1754
|
+
return t.forEach(function(t, a) {
|
|
1755
|
+
let c = t.attachment, l = t.samples, u = t.format, d = t.attachmentPoint || Na(u, t.internalFormat);
|
|
1756
|
+
if (d ||= Ea + a, Fa(d) && o.push(d), !c) if (l !== void 0 || Pa(u)) c = e.createRenderbuffer(), e.bindRenderbuffer(Z, c), l > 1 ? e.renderbufferStorageMultisample(Z, l, u, n, r) : e.renderbufferStorage(Z, u, n, r);
|
|
1757
|
+
else {
|
|
1758
|
+
let i = Object.assign({}, t);
|
|
1759
|
+
i.width = n, i.height = r, i.auto === void 0 && (i.auto = !1, i.min = i.min || i.minMag || ja, i.mag = i.mag || i.minMag || ja, i.wrapS = i.wrapS || i.wrap || Aa, i.wrapT = i.wrapT || i.wrap || Aa), c = or(e, i);
|
|
1760
|
+
}
|
|
1761
|
+
if (fe(e, c)) e.framebufferRenderbuffer(i, d, Z, c);
|
|
1762
|
+
else if (pe(e, c)) t.layer === void 0 ? e.framebufferTexture2D(i, d, t.target || da, c, t.level || 0) : e.framebufferTextureLayer(i, d, c, t.level || 0, t.layer);
|
|
1763
|
+
else throw Error("unknown attachment type");
|
|
1764
|
+
s.attachments.push(c);
|
|
1765
|
+
}), e.drawBuffers && e.drawBuffers(o), s;
|
|
1766
|
+
}
|
|
1767
|
+
function La(e, t, n, r, i) {
|
|
1768
|
+
r ||= e.drawingBufferWidth, i ||= e.drawingBufferHeight, t.width = r, t.height = i, n ||= Ma, n.forEach(function(n, a) {
|
|
1769
|
+
let o = t.attachments[a], s = n.format, c = n.samples;
|
|
1770
|
+
if (c !== void 0 || fe(e, o)) e.bindRenderbuffer(Z, o), c > 1 ? e.renderbufferStorageMultisample(Z, c, s, r, i) : e.renderbufferStorage(Z, s, r, i);
|
|
1771
|
+
else if (pe(e, o)) sr(e, o, n, r, i);
|
|
1772
|
+
else throw Error("unknown attachment type");
|
|
1773
|
+
});
|
|
1774
|
+
}
|
|
1775
|
+
function Ra(e, t, n) {
|
|
1776
|
+
let r = e.createVertexArray();
|
|
1777
|
+
return e.bindVertexArray(r), t.length || (t = [t]), t.forEach(function(t) {
|
|
1778
|
+
aa(e, t, n);
|
|
1779
|
+
}), e.bindVertexArray(null), {
|
|
1780
|
+
numElements: n.numElements,
|
|
1781
|
+
elementType: n.elementType,
|
|
1782
|
+
vertexArrayObject: r
|
|
1783
|
+
};
|
|
1784
|
+
}
|
|
1785
|
+
var za = { addExtensionsToContext: !0 }, Ba = /^(.*?)_/;
|
|
1786
|
+
function Va(e, t) {
|
|
1787
|
+
Ue(e, 0);
|
|
1788
|
+
let n = e.getExtension(t);
|
|
1789
|
+
if (n) {
|
|
1790
|
+
let r = {}, i = Ba.exec(t)[1], a = "_" + i;
|
|
1791
|
+
for (let t in n) {
|
|
1792
|
+
let o = n[t], s = typeof o == "function", c = s ? i : a, l = t;
|
|
1793
|
+
t.endsWith(c) && (l = t.substring(0, t.length - c.length)), e[l] === void 0 ? s ? e[l] = function(e) {
|
|
1794
|
+
return function() {
|
|
1795
|
+
return e.apply(n, arguments);
|
|
1796
|
+
};
|
|
1797
|
+
}(o) : (e[l] = o, r[l] = o) : !s && e[l] !== o && ue(l, e[l], o, t);
|
|
1798
|
+
}
|
|
1799
|
+
r.constructor = { name: n.constructor.name }, Ue(r, 0);
|
|
1800
|
+
}
|
|
1801
|
+
return n;
|
|
1802
|
+
}
|
|
1803
|
+
var Ha = [
|
|
1804
|
+
"ANGLE_instanced_arrays",
|
|
1805
|
+
"EXT_blend_minmax",
|
|
1806
|
+
"EXT_color_buffer_float",
|
|
1807
|
+
"EXT_color_buffer_half_float",
|
|
1808
|
+
"EXT_disjoint_timer_query",
|
|
1809
|
+
"EXT_disjoint_timer_query_webgl2",
|
|
1810
|
+
"EXT_frag_depth",
|
|
1811
|
+
"EXT_sRGB",
|
|
1812
|
+
"EXT_shader_texture_lod",
|
|
1813
|
+
"EXT_texture_filter_anisotropic",
|
|
1814
|
+
"OES_element_index_uint",
|
|
1815
|
+
"OES_standard_derivatives",
|
|
1816
|
+
"OES_texture_float",
|
|
1817
|
+
"OES_texture_float_linear",
|
|
1818
|
+
"OES_texture_half_float",
|
|
1819
|
+
"OES_texture_half_float_linear",
|
|
1820
|
+
"OES_vertex_array_object",
|
|
1821
|
+
"WEBGL_color_buffer_float",
|
|
1822
|
+
"WEBGL_compressed_texture_atc",
|
|
1823
|
+
"WEBGL_compressed_texture_etc1",
|
|
1824
|
+
"WEBGL_compressed_texture_pvrtc",
|
|
1825
|
+
"WEBGL_compressed_texture_s3tc",
|
|
1826
|
+
"WEBGL_compressed_texture_s3tc_srgb",
|
|
1827
|
+
"WEBGL_depth_texture",
|
|
1828
|
+
"WEBGL_draw_buffers"
|
|
1829
|
+
];
|
|
1830
|
+
function Ua(e) {
|
|
1831
|
+
for (let t = 0; t < Ha.length; ++t) Va(e, Ha[t]);
|
|
1832
|
+
}
|
|
1833
|
+
function Wa(e, t) {
|
|
1834
|
+
let n = [
|
|
1835
|
+
"webgl2",
|
|
1836
|
+
"webgl",
|
|
1837
|
+
"experimental-webgl"
|
|
1838
|
+
], r = null;
|
|
1839
|
+
for (let i = 0; i < n.length; ++i) if (r = e.getContext(n[i], t), r) {
|
|
1840
|
+
za.addExtensionsToContext && Ua(r);
|
|
1841
|
+
break;
|
|
1842
|
+
}
|
|
1843
|
+
return r;
|
|
1844
|
+
}
|
|
1845
|
+
function Ga(e, t) {
|
|
1846
|
+
return Wa(e, t);
|
|
1847
|
+
}
|
|
1848
|
+
//#endregion
|
|
1849
|
+
export { $i as _, oa as a, r as b, Ra as c, v as d, La as f, ir as g, aa as h, Ia as i, la as l, ea as m, Qi as n, or as o, Re as p, He as r, Zi as s, Ua as t, Ga as u, na as v, n as y };
|