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