@needle-tools/gltf-progressive 3.1.0-next.f550970 → 3.1.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/gltf-progressive.js +288 -307
- package/gltf-progressive.min.js +7 -7
- package/gltf-progressive.umd.cjs +6 -6
- package/lib/extension.js +6 -35
- package/lib/lods.manager.js +0 -4
- package/lib/utils.internal.js +2 -2
- package/package.json +2 -2
package/gltf-progressive.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var u = (o, t, e) => (
|
|
1
|
+
var Ye = Object.defineProperty;
|
|
2
|
+
var He = (o, t, e) => t in o ? Ye(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
|
|
3
|
+
var u = (o, t, e) => (He(o, typeof t != "symbol" ? t + "" : t, e), e), Be = (o, t, e) => {
|
|
4
4
|
if (!t.has(o))
|
|
5
5
|
throw TypeError("Cannot " + e);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
7
|
+
var y = (o, t, e) => (Be(o, t, "read from private field"), e ? e.call(o) : t.get(o)), H = (o, t, e) => {
|
|
8
8
|
if (t.has(o))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
t instanceof WeakSet ? t.add(o) : t.set(o, e);
|
|
11
|
-
},
|
|
12
|
-
import { BufferGeometry as
|
|
11
|
+
}, q = (o, t, e, s) => (Be(o, t, "write to private field"), s ? s.call(o, e) : t.set(o, e), e);
|
|
12
|
+
import { BufferGeometry as xe, Mesh as se, Texture as oe, TextureLoader as Qe, Matrix4 as Ge, Clock as je, MeshStandardMaterial as Je, Sphere as Ze, Box3 as Ee, Vector3 as W } from "three";
|
|
13
13
|
import { GLTFLoader as Ce } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
14
|
-
import { MeshoptDecoder as
|
|
15
|
-
import { DRACOLoader as
|
|
16
|
-
import { KTX2Loader as
|
|
17
|
-
const
|
|
18
|
-
globalThis.GLTF_PROGRESSIVE_VERSION =
|
|
14
|
+
import { MeshoptDecoder as et } from "three/examples/jsm/libs/meshopt_decoder.module.js";
|
|
15
|
+
import { DRACOLoader as tt } from "three/examples/jsm/loaders/DRACOLoader.js";
|
|
16
|
+
import { KTX2Loader as st } from "three/examples/jsm/loaders/KTX2Loader.js";
|
|
17
|
+
const rt = "";
|
|
18
|
+
globalThis.GLTF_PROGRESSIVE_VERSION = rt;
|
|
19
19
|
console.debug("[gltf-progressive] version -");
|
|
20
|
-
let
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
fetch(
|
|
20
|
+
let V = "https://www.gstatic.com/draco/versioned/decoders/1.5.7/", re = "https://www.gstatic.com/basis-universal/versioned/2021-04-15-ba1c3e4/";
|
|
21
|
+
const it = V, nt = re, Re = new URL(V + "draco_decoder.js");
|
|
22
|
+
Re.searchParams.append("range", "true");
|
|
23
|
+
fetch(Re, {
|
|
24
24
|
method: "GET",
|
|
25
25
|
headers: {
|
|
26
26
|
Range: "bytes=0-1"
|
|
27
27
|
}
|
|
28
28
|
}).catch((o) => {
|
|
29
|
-
console.debug(`Failed to fetch remote Draco decoder from ${
|
|
29
|
+
console.debug(`Failed to fetch remote Draco decoder from ${V} (offline: ${typeof navigator < "u" ? navigator.onLine : "unknown"})`), V === it && ot("./include/draco/"), re === nt && at("./include/ktx2/");
|
|
30
30
|
}).finally(() => {
|
|
31
|
-
|
|
31
|
+
Fe();
|
|
32
32
|
});
|
|
33
|
-
function
|
|
34
|
-
|
|
33
|
+
function ot(o) {
|
|
34
|
+
V = o, I && I[Pe] != V ? (console.debug("Updating Draco decoder path to " + o), I[Pe] = V, I.setDecoderPath(V), I.preload()) : console.debug("Setting Draco decoder path to " + o);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
re = o,
|
|
36
|
+
function at(o) {
|
|
37
|
+
re = o, U && U.transcoderPath != re ? (console.debug("Updating KTX2 transcoder path to " + o), U.setTranscoderPath(re), U.init()) : console.debug("Setting KTX2 transcoder path to " + o);
|
|
38
38
|
}
|
|
39
39
|
const Pe = Symbol("dracoDecoderPath");
|
|
40
|
-
let
|
|
41
|
-
function
|
|
42
|
-
|
|
40
|
+
let I, Le, U;
|
|
41
|
+
function Fe() {
|
|
42
|
+
I || (I = new tt(), I[Pe] = V, I.setDecoderPath(V), I.setDecoderConfig({ type: "js" }), I.preload()), U || (U = new st(), U.setTranscoderPath(re), U.init()), Le || (Le = et);
|
|
43
43
|
}
|
|
44
44
|
function Ue(o) {
|
|
45
|
-
return
|
|
45
|
+
return Fe(), o ? U.detectSupport(o) : o !== null && console.warn("No renderer provided to detect ktx2 support - loading KTX2 textures might fail"), { dracoLoader: I, ktx2Loader: U, meshoptDecoder: Le };
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
o.dracoLoader || o.setDRACOLoader(
|
|
47
|
+
function Ne(o) {
|
|
48
|
+
o.dracoLoader || o.setDRACOLoader(I), o.ktx2Loader || o.setKTX2Loader(U), o.meshoptDecoder || o.setMeshoptDecoder(Le);
|
|
49
49
|
}
|
|
50
50
|
const Te = /* @__PURE__ */ new WeakMap();
|
|
51
|
-
function
|
|
51
|
+
function ze(o, t) {
|
|
52
52
|
let e = Te.get(o);
|
|
53
53
|
e ? e = Object.assign(e, t) : e = t, Te.set(o, e);
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
function
|
|
55
|
+
const De = Ce.prototype.load;
|
|
56
|
+
function lt(...o) {
|
|
57
57
|
const t = Te.get(this);
|
|
58
58
|
let e = o[0];
|
|
59
59
|
const s = new URL(e, window.location.href);
|
|
@@ -61,9 +61,9 @@ function ut(...o) {
|
|
|
61
61
|
const r = (t == null ? void 0 : t.progressive) !== void 0 ? t.progressive : !0, i = t != null && t.usecase ? t.usecase : "default";
|
|
62
62
|
r ? this.requestHeader.Accept = `*/*;progressive=allowed;usecase=${i}` : this.requestHeader.Accept = `*/*;usecase=${i}`, e = s.toString();
|
|
63
63
|
}
|
|
64
|
-
return o[0] = e,
|
|
64
|
+
return o[0] = e, De == null ? void 0 : De.call(this, ...o);
|
|
65
65
|
}
|
|
66
|
-
Ce.prototype.load =
|
|
66
|
+
Ce.prototype.load = lt;
|
|
67
67
|
de("debugprogressive");
|
|
68
68
|
function de(o) {
|
|
69
69
|
if (typeof window > "u")
|
|
@@ -71,7 +71,7 @@ function de(o) {
|
|
|
71
71
|
const e = new URL(window.location.href).searchParams.get(o);
|
|
72
72
|
return e == null || e === "0" || e === "false" ? !1 : e === "" ? !0 : e;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function ut(o, t) {
|
|
75
75
|
if (t === void 0 || t.startsWith("./") || t.startsWith("http") || o === void 0)
|
|
76
76
|
return t;
|
|
77
77
|
const e = o.lastIndexOf("/");
|
|
@@ -84,10 +84,10 @@ function dt(o, t) {
|
|
|
84
84
|
return t;
|
|
85
85
|
}
|
|
86
86
|
let ae;
|
|
87
|
-
function
|
|
87
|
+
function dt() {
|
|
88
88
|
return ae !== void 0 || (ae = /iPhone|iPad|iPod|Android|IEMobile/i.test(navigator.userAgent), de("debugprogressive") && console.log("[glTF Progressive]: isMobileDevice", ae)), ae;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function ct() {
|
|
91
91
|
if (typeof window > "u")
|
|
92
92
|
return !1;
|
|
93
93
|
const o = new URL(window.location.href), t = o.hostname === "localhost" || /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(o.hostname);
|
|
@@ -113,8 +113,8 @@ class ft {
|
|
|
113
113
|
}
|
|
114
114
|
add(t, e) {
|
|
115
115
|
this._running.has(t) || (this._running.set(t, e), e.finally(() => {
|
|
116
|
-
this._running.delete(t), this.debug && console.debug(`[PromiseQueue]: Promise finished
|
|
117
|
-
}), this.debug && console.debug(`[PromiseQueue]:
|
|
116
|
+
this._running.delete(t), this.debug && console.debug(`[PromiseQueue]: Promise for key ${t} finished, running: ${this._running.size}, waiting: ${this._queue.length}`);
|
|
117
|
+
}), this.debug && console.debug(`[PromiseQueue]: Adding promise for key ${t}, running: ${this._running.size}, waiting: ${this._queue.length}`));
|
|
118
118
|
}
|
|
119
119
|
internalUpdate() {
|
|
120
120
|
const t = this.maxConcurrent - this._running.size;
|
|
@@ -129,7 +129,7 @@ class ft {
|
|
|
129
129
|
}
|
|
130
130
|
const ht = typeof window > "u" && typeof document > "u", Ae = Symbol("needle:raycast-mesh");
|
|
131
131
|
function ce(o) {
|
|
132
|
-
return (o == null ? void 0 : o[Ae]) instanceof
|
|
132
|
+
return (o == null ? void 0 : o[Ae]) instanceof xe ? o[Ae] : null;
|
|
133
133
|
}
|
|
134
134
|
function gt(o, t) {
|
|
135
135
|
if ((o.type === "Mesh" || o.type === "SkinnedMesh") && !ce(o)) {
|
|
@@ -155,14 +155,14 @@ function pt(o = !0) {
|
|
|
155
155
|
}
|
|
156
156
|
let le = null;
|
|
157
157
|
function mt(o) {
|
|
158
|
-
const t = new
|
|
158
|
+
const t = new xe();
|
|
159
159
|
for (const e in o.attributes)
|
|
160
160
|
t.setAttribute(e, o.getAttribute(e));
|
|
161
161
|
return t.setIndex(o.getIndex()), t;
|
|
162
162
|
}
|
|
163
|
-
const j = new Array(),
|
|
163
|
+
const j = new Array(), x = de("debugprogressive");
|
|
164
164
|
let me, te = -1;
|
|
165
|
-
if (
|
|
165
|
+
if (x) {
|
|
166
166
|
let o = function() {
|
|
167
167
|
te += 1, te >= t && (te = -1), console.log(`Toggle LOD level [${te}]`);
|
|
168
168
|
}, t = 6;
|
|
@@ -173,14 +173,14 @@ if (y) {
|
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
175
|
function qe(o) {
|
|
176
|
-
if (
|
|
176
|
+
if (x)
|
|
177
177
|
if (Array.isArray(o))
|
|
178
178
|
for (const t of o)
|
|
179
179
|
qe(t);
|
|
180
180
|
else
|
|
181
181
|
o && "wireframe" in o && (o.wireframe = me === !0);
|
|
182
182
|
}
|
|
183
|
-
const X = "NEEDLE_progressive", Oe = Symbol("needle-progressive-texture"),
|
|
183
|
+
const X = "NEEDLE_progressive", Oe = Symbol("needle-progressive-texture"), D = class {
|
|
184
184
|
constructor(t, e) {
|
|
185
185
|
u(this, "parser");
|
|
186
186
|
u(this, "url");
|
|
@@ -192,10 +192,10 @@ const X = "NEEDLE_progressive", Oe = Symbol("needle-progressive-texture"), O = c
|
|
|
192
192
|
const e = (n = (s = this.parser.json.meshes[t]) == null ? void 0 : s.extensions) == null ? void 0 : n[X];
|
|
193
193
|
return e ? (this._isLoadingMesh = !0, this.parser.getDependency("mesh", t).then((r) => {
|
|
194
194
|
var i;
|
|
195
|
-
return this._isLoadingMesh = !1, r &&
|
|
195
|
+
return this._isLoadingMesh = !1, r && D.registerMesh(this.url, e.guid, r, (i = e.lods) == null ? void 0 : i.length, 0, e), r;
|
|
196
196
|
})) : null;
|
|
197
197
|
});
|
|
198
|
-
|
|
198
|
+
x && console.log("Progressive extension registered for", e), this.parser = t, this.url = e;
|
|
199
199
|
}
|
|
200
200
|
/** The name of the extension */
|
|
201
201
|
get name() {
|
|
@@ -223,7 +223,7 @@ const X = "NEEDLE_progressive", Oe = Symbol("needle-progressive-texture"), O = c
|
|
|
223
223
|
this.getMaterialMinMaxLODsCount(a, e);
|
|
224
224
|
return t[n] = e, e;
|
|
225
225
|
}
|
|
226
|
-
if (
|
|
226
|
+
if (x === "verbose" && console.log("getMaterialMinMaxLODsCount", t), t.type === "ShaderMaterial" || t.type === "RawShaderMaterial") {
|
|
227
227
|
const a = t;
|
|
228
228
|
for (const l of Object.keys(a.uniforms)) {
|
|
229
229
|
const c = a.uniforms[l].value;
|
|
@@ -241,9 +241,9 @@ const X = "NEEDLE_progressive", Oe = Symbol("needle-progressive-texture"), O = c
|
|
|
241
241
|
const d = s.lodInfos.get(c.key);
|
|
242
242
|
if (d && d.lods) {
|
|
243
243
|
l.min_count = Math.min(l.min_count, d.lods.length), l.max_count = Math.max(l.max_count, d.lods.length);
|
|
244
|
-
for (let
|
|
245
|
-
const f = d.lods[
|
|
246
|
-
f.width && (l.lods[
|
|
244
|
+
for (let p = 0; p < d.lods.length; p++) {
|
|
245
|
+
const f = d.lods[p];
|
|
246
|
+
f.width && (l.lods[p] = l.lods[p] || { min_height: 1 / 0, max_height: 0 }, l.lods[p].min_height = Math.min(l.lods[p].min_height, f.height), l.lods[p].max_height = Math.max(l.lods[p].max_height, f.height));
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
}
|
|
@@ -308,15 +308,15 @@ const X = "NEEDLE_progressive", Oe = Symbol("needle-progressive-texture"), O = c
|
|
|
308
308
|
return Promise.resolve(null);
|
|
309
309
|
for (const i of j)
|
|
310
310
|
(s = i.onBeforeGetLODMesh) == null || s.call(i, t, e);
|
|
311
|
-
return t["LOD:requested level"] = e,
|
|
311
|
+
return t["LOD:requested level"] = e, D.getOrLoadLOD(n, e).then((i) => {
|
|
312
312
|
if (Array.isArray(i)) {
|
|
313
313
|
const a = r.index || 0;
|
|
314
314
|
i = i[a];
|
|
315
315
|
}
|
|
316
|
-
return t["LOD:requested level"] === e && (delete t["LOD:requested level"], i && n != i && ((i == null ? void 0 : i.isBufferGeometry) ? t.geometry = i :
|
|
316
|
+
return t["LOD:requested level"] === e && (delete t["LOD:requested level"], i && n != i && ((i == null ? void 0 : i.isBufferGeometry) ? t.geometry = i : x && console.error("Invalid LOD geometry", i))), i;
|
|
317
317
|
}).catch((i) => (console.error("Error loading mesh LOD", t, i), null));
|
|
318
318
|
} else
|
|
319
|
-
|
|
319
|
+
x && console.error("Invalid call to assignMeshLOD: Request mesh LOD but the object is not a mesh", t);
|
|
320
320
|
return Promise.resolve(null);
|
|
321
321
|
}
|
|
322
322
|
static assignTextureLOD(t, e = 0) {
|
|
@@ -374,59 +374,45 @@ const X = "NEEDLE_progressive", Oe = Symbol("needle-progressive-texture"), O = c
|
|
|
374
374
|
return Promise.resolve(null);
|
|
375
375
|
}
|
|
376
376
|
static assignTextureLODForSlot(t, e, s, n) {
|
|
377
|
-
return (t == null ? void 0 : t.isTexture) !== !0 ? Promise.resolve(null) : n === "glyphMap" ? Promise.resolve(t) :
|
|
377
|
+
return (t == null ? void 0 : t.isTexture) !== !0 ? Promise.resolve(null) : n === "glyphMap" ? Promise.resolve(t) : D.getOrLoadLOD(t, e).then((r) => {
|
|
378
378
|
if (Array.isArray(r))
|
|
379
|
-
return
|
|
379
|
+
return null;
|
|
380
380
|
if ((r == null ? void 0 : r.isTexture) === !0) {
|
|
381
381
|
if (r != t && s && n) {
|
|
382
382
|
const i = s[n];
|
|
383
|
-
if (i && !
|
|
383
|
+
if (i && !x) {
|
|
384
384
|
const a = this.getAssignedLODInformation(i);
|
|
385
385
|
if (a && (a == null ? void 0 : a.level) < e)
|
|
386
|
-
return
|
|
386
|
+
return x === "verbose" && console.warn("Assigned texture level is already higher: ", a.level, e, s, i, r), null;
|
|
387
387
|
}
|
|
388
388
|
s[n] = r;
|
|
389
389
|
}
|
|
390
390
|
return r;
|
|
391
391
|
} else
|
|
392
|
-
|
|
392
|
+
x == "verbose" && console.warn("No LOD found for", t, e);
|
|
393
393
|
return null;
|
|
394
394
|
}).catch((r) => (console.error("Error loading LOD", t, r), null));
|
|
395
395
|
}
|
|
396
|
-
// private _isLoadingTexture;
|
|
397
|
-
// loadTexture = (textureIndex: number) => {
|
|
398
|
-
// if (this._isLoadingTexture) return null;
|
|
399
|
-
// const ext = this.parser.json.textures[textureIndex]?.extensions?.[EXTENSION_NAME] as NEEDLE_ext_progressive_texture;
|
|
400
|
-
// if (!ext) return null;
|
|
401
|
-
// this._isLoadingTexture = true;
|
|
402
|
-
// return this.parser.getDependency("texture", textureIndex).then(tex => {
|
|
403
|
-
// this._isLoadingTexture = false;
|
|
404
|
-
// if (tex) {
|
|
405
|
-
// NEEDLE_progressive.registerTexture(this.url, tex as Texture, ext.lods?.length, textureIndex, ext);
|
|
406
|
-
// }
|
|
407
|
-
// return tex;
|
|
408
|
-
// });
|
|
409
|
-
// }
|
|
410
396
|
afterRoot(t) {
|
|
411
397
|
var e, s;
|
|
412
|
-
return
|
|
398
|
+
return x && console.log("AFTER", this.url, t), (e = this.parser.json.textures) == null || e.forEach((n, r) => {
|
|
413
399
|
var i;
|
|
414
400
|
if (n != null && n.extensions) {
|
|
415
401
|
const a = n == null ? void 0 : n.extensions[X];
|
|
416
402
|
if (a) {
|
|
417
403
|
if (!a.lods) {
|
|
418
|
-
|
|
404
|
+
x && console.warn("Texture has no LODs", a);
|
|
419
405
|
return;
|
|
420
406
|
}
|
|
421
407
|
let l = !1;
|
|
422
408
|
for (const c of this.parser.associations.keys())
|
|
423
409
|
if (c.isTexture === !0) {
|
|
424
410
|
const d = this.parser.associations.get(c);
|
|
425
|
-
(d == null ? void 0 : d.textures) === r && (l = !0,
|
|
411
|
+
(d == null ? void 0 : d.textures) === r && (l = !0, D.registerTexture(this.url, c, (i = a.lods) == null ? void 0 : i.length, r, a));
|
|
426
412
|
}
|
|
427
413
|
l || this.parser.getDependency("texture", r).then((c) => {
|
|
428
414
|
var d;
|
|
429
|
-
c &&
|
|
415
|
+
c && D.registerTexture(this.url, c, (d = a.lods) == null ? void 0 : d.length, r, a);
|
|
430
416
|
});
|
|
431
417
|
}
|
|
432
418
|
}
|
|
@@ -437,7 +423,7 @@ const X = "NEEDLE_progressive", Oe = Symbol("needle-progressive-texture"), O = c
|
|
|
437
423
|
for (const a of this.parser.associations.keys())
|
|
438
424
|
if (a.isMesh) {
|
|
439
425
|
const l = this.parser.associations.get(a);
|
|
440
|
-
(l == null ? void 0 : l.meshes) === r &&
|
|
426
|
+
(l == null ? void 0 : l.meshes) === r && D.registerMesh(this.url, i.guid, a, i.lods.length, l.primitives, i);
|
|
441
427
|
}
|
|
442
428
|
}
|
|
443
429
|
}
|
|
@@ -445,114 +431,114 @@ const X = "NEEDLE_progressive", Oe = Symbol("needle-progressive-texture"), O = c
|
|
|
445
431
|
}
|
|
446
432
|
static async getOrLoadLOD(t, e) {
|
|
447
433
|
var a, l, c, d;
|
|
448
|
-
const s =
|
|
434
|
+
const s = x == "verbose", n = t.userData.LODS;
|
|
449
435
|
if (!n)
|
|
450
|
-
return
|
|
436
|
+
return null;
|
|
451
437
|
const r = n == null ? void 0 : n.key;
|
|
452
438
|
let i;
|
|
453
439
|
if (t.isTexture === !0) {
|
|
454
|
-
const
|
|
455
|
-
|
|
440
|
+
const p = t;
|
|
441
|
+
p.source && p.source[Oe] && (i = p.source[Oe]);
|
|
456
442
|
}
|
|
457
|
-
if (i || (i =
|
|
443
|
+
if (i || (i = D.lodInfos.get(r)), i) {
|
|
458
444
|
if (e > 0) {
|
|
459
445
|
let w = !1;
|
|
460
|
-
const
|
|
461
|
-
if (
|
|
446
|
+
const M = Array.isArray(i.lods);
|
|
447
|
+
if (M && e >= i.lods.length ? w = !0 : M || (w = !0), w)
|
|
462
448
|
return this.lowresCache.get(r);
|
|
463
449
|
}
|
|
464
|
-
const
|
|
465
|
-
if (!
|
|
466
|
-
return
|
|
467
|
-
const f =
|
|
450
|
+
const p = Array.isArray(i.lods) ? (a = i.lods[e]) == null ? void 0 : a.path : i.lods;
|
|
451
|
+
if (!p)
|
|
452
|
+
return x && !i["missing:uri"] && (i["missing:uri"] = !0, console.warn("Missing uri for progressive asset for LOD " + e, i)), null;
|
|
453
|
+
const f = ut(n.url, p);
|
|
468
454
|
if (f.endsWith(".glb") || f.endsWith(".gltf")) {
|
|
469
455
|
if (!i.guid)
|
|
470
456
|
return console.warn("missing pointer for glb/gltf texture", i), null;
|
|
471
|
-
const w = f + "_" + i.guid,
|
|
472
|
-
if (
|
|
457
|
+
const w = f + "_" + i.guid, M = this.previouslyLoaded.get(w);
|
|
458
|
+
if (M !== void 0) {
|
|
473
459
|
s && console.log(`LOD ${e} was already loading/loaded: ${w}`);
|
|
474
|
-
let
|
|
475
|
-
`,
|
|
476
|
-
if (
|
|
477
|
-
return
|
|
460
|
+
let h = await M.catch((C) => (console.error(`Error loading LOD ${e} from ${f}
|
|
461
|
+
`, C), null)), L = !1;
|
|
462
|
+
if (h == null || (h instanceof oe && t instanceof oe ? (l = h.image) != null && l.data || (c = h.source) != null && c.data ? h = this.copySettings(t, h) : (L = !0, this.previouslyLoaded.delete(w)) : h instanceof xe && t instanceof xe && ((d = h.attributes.position) != null && d.array || (L = !0, this.previouslyLoaded.delete(w)))), !L)
|
|
463
|
+
return h;
|
|
478
464
|
}
|
|
479
|
-
const
|
|
480
|
-
if (!
|
|
481
|
-
return
|
|
482
|
-
const
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
let
|
|
486
|
-
if (
|
|
487
|
-
const
|
|
488
|
-
|
|
465
|
+
const A = await this.queue.slot(f);
|
|
466
|
+
if (!A.use)
|
|
467
|
+
return x && console.log(`LOD ${e} was aborted: ${f}`), null;
|
|
468
|
+
const b = i, R = new Promise(async (h, L) => {
|
|
469
|
+
const C = new Ce();
|
|
470
|
+
Ne(C), x && (await new Promise((v) => setTimeout(v, 1e3)), s && console.warn("Start loading (delayed) " + f, b.guid));
|
|
471
|
+
let N = f;
|
|
472
|
+
if (b && Array.isArray(b.lods)) {
|
|
473
|
+
const v = b.lods[e];
|
|
474
|
+
v.hash && (N += "?v=" + v.hash);
|
|
489
475
|
}
|
|
490
|
-
const S = await
|
|
491
|
-
`,
|
|
476
|
+
const S = await C.loadAsync(N).catch((v) => (console.error(`Error loading LOD ${e} from ${f}
|
|
477
|
+
`, v), h(null)));
|
|
492
478
|
if (!S)
|
|
493
|
-
return
|
|
479
|
+
return h(null);
|
|
494
480
|
const ee = S.parser;
|
|
495
|
-
s && console.log("Loading finished " + f,
|
|
496
|
-
let
|
|
481
|
+
s && console.log("Loading finished " + f, b.guid);
|
|
482
|
+
let B = 0;
|
|
497
483
|
if (S.parser.json.textures) {
|
|
498
|
-
let
|
|
484
|
+
let v = !1;
|
|
499
485
|
for (const m of S.parser.json.textures) {
|
|
500
486
|
if (m != null && m.extensions) {
|
|
501
|
-
const
|
|
502
|
-
if (
|
|
503
|
-
|
|
487
|
+
const g = m == null ? void 0 : m.extensions[X];
|
|
488
|
+
if (g != null && g.guid && g.guid === b.guid) {
|
|
489
|
+
v = !0;
|
|
504
490
|
break;
|
|
505
491
|
}
|
|
506
492
|
}
|
|
507
|
-
|
|
493
|
+
B++;
|
|
508
494
|
}
|
|
509
|
-
if (
|
|
510
|
-
let m = await ee.getDependency("texture",
|
|
511
|
-
return m &&
|
|
495
|
+
if (v) {
|
|
496
|
+
let m = await ee.getDependency("texture", B);
|
|
497
|
+
return m && D.assignLODInformation(n.url, m, r, e, void 0), s && console.log('change "' + t.name + '" → "' + m.name + '"', f, B, m, w), t instanceof oe && (m = this.copySettings(t, m)), m && (m.guid = b.guid), h(m);
|
|
512
498
|
} else
|
|
513
|
-
|
|
499
|
+
x && console.warn("Could not find texture with guid", b.guid, S.parser.json);
|
|
514
500
|
}
|
|
515
|
-
if (
|
|
516
|
-
let
|
|
501
|
+
if (B = 0, S.parser.json.meshes) {
|
|
502
|
+
let v = !1;
|
|
517
503
|
for (const m of S.parser.json.meshes) {
|
|
518
504
|
if (m != null && m.extensions) {
|
|
519
|
-
const
|
|
520
|
-
if (
|
|
521
|
-
|
|
505
|
+
const g = m == null ? void 0 : m.extensions[X];
|
|
506
|
+
if (g != null && g.guid && g.guid === b.guid) {
|
|
507
|
+
v = !0;
|
|
522
508
|
break;
|
|
523
509
|
}
|
|
524
510
|
}
|
|
525
|
-
|
|
511
|
+
B++;
|
|
526
512
|
}
|
|
527
|
-
if (
|
|
528
|
-
const m = await ee.getDependency("mesh",
|
|
529
|
-
if (s && console.log(`Loaded Mesh "${m.name}"`, f,
|
|
530
|
-
const
|
|
531
|
-
return
|
|
513
|
+
if (v) {
|
|
514
|
+
const m = await ee.getDependency("mesh", B);
|
|
515
|
+
if (s && console.log(`Loaded Mesh "${m.name}"`, f, B, m, w), m.isMesh === !0) {
|
|
516
|
+
const g = m.geometry;
|
|
517
|
+
return D.assignLODInformation(n.url, g, r, e, 0), h(g);
|
|
532
518
|
} else {
|
|
533
|
-
const
|
|
519
|
+
const g = new Array();
|
|
534
520
|
for (let _ = 0; _ < m.children.length; _++) {
|
|
535
|
-
const
|
|
536
|
-
if (
|
|
537
|
-
const
|
|
538
|
-
|
|
521
|
+
const G = m.children[_];
|
|
522
|
+
if (G.isMesh === !0) {
|
|
523
|
+
const E = G.geometry;
|
|
524
|
+
D.assignLODInformation(n.url, E, r, e, _), g.push(E);
|
|
539
525
|
}
|
|
540
526
|
}
|
|
541
|
-
return g
|
|
527
|
+
return h(g);
|
|
542
528
|
}
|
|
543
529
|
} else
|
|
544
|
-
|
|
530
|
+
x && console.warn("Could not find mesh with guid", b.guid, S.parser.json);
|
|
545
531
|
}
|
|
546
|
-
return
|
|
532
|
+
return h(null);
|
|
547
533
|
});
|
|
548
|
-
return this.previouslyLoaded.set(w, R),
|
|
534
|
+
return this.previouslyLoaded.set(w, R), A.use(R), await R;
|
|
549
535
|
} else if (t instanceof oe) {
|
|
550
536
|
s && console.log("Load texture from uri: " + f);
|
|
551
|
-
const
|
|
552
|
-
return
|
|
537
|
+
const M = await new Qe().loadAsync(f);
|
|
538
|
+
return M ? (M.guid = i.guid, M.flipY = !1, M.needsUpdate = !0, M.colorSpace = t.colorSpace, s && console.log(i, M)) : x && console.warn("failed loading", f), M;
|
|
553
539
|
}
|
|
554
540
|
} else
|
|
555
|
-
|
|
541
|
+
x && console.warn(`Can not load LOD ${e}: no LOD info found for "${r}" ${t.name}`, t.type);
|
|
556
542
|
return null;
|
|
557
543
|
}
|
|
558
544
|
static assignLODInformation(t, e, s, n, r) {
|
|
@@ -560,55 +546,50 @@ const X = "NEEDLE_progressive", Oe = Symbol("needle-progressive-texture"), O = c
|
|
|
560
546
|
return;
|
|
561
547
|
e.userData || (e.userData = {});
|
|
562
548
|
const i = new yt(t, s, n, r);
|
|
563
|
-
e.userData.LODS = i
|
|
549
|
+
e.userData.LODS = i;
|
|
564
550
|
}
|
|
565
551
|
static getAssignedLODInformation(t) {
|
|
566
|
-
var e
|
|
567
|
-
return
|
|
552
|
+
var e;
|
|
553
|
+
return ((e = t == null ? void 0 : t.userData) == null ? void 0 : e.LODS) || null;
|
|
568
554
|
}
|
|
569
555
|
// private static readonly _copiedTextures: WeakMap<Texture, Texture> = new Map();
|
|
570
556
|
static copySettings(t, e) {
|
|
571
|
-
return e ? (
|
|
557
|
+
return e ? (x && console.warn(`Copy texture settings
|
|
572
558
|
`, t.uuid, `
|
|
573
559
|
`, e.uuid), e = e.clone(), e.offset = t.offset, e.repeat = t.repeat, e.colorSpace = t.colorSpace, e.magFilter = t.magFilter, e.minFilter = t.minFilter, e.wrapS = t.wrapS, e.wrapT = t.wrapT, e.flipY = t.flipY, e.anisotropy = t.anisotropy, e.mipmaps || (e.generateMipmaps = t.generateMipmaps), e) : t;
|
|
574
560
|
}
|
|
575
561
|
};
|
|
576
|
-
let
|
|
562
|
+
let P = D;
|
|
577
563
|
/**
|
|
578
564
|
* Register a texture with LOD information
|
|
579
565
|
*/
|
|
580
|
-
u(
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
y && console.error("gltf-progressive: Called register texture without texture");
|
|
566
|
+
u(P, "registerTexture", (t, e, s, n, r) => {
|
|
567
|
+
if (x && console.log("> Progressive: register texture", n, e.name, e.uuid, e, r), !e) {
|
|
568
|
+
x && console.error("gltf-progressive: Register texture without texture");
|
|
584
569
|
return;
|
|
585
570
|
}
|
|
586
|
-
if (y) {
|
|
587
|
-
const P = ((a = e.image) == null ? void 0 : a.width) || ((c = (l = e.source) == null ? void 0 : l.data) == null ? void 0 : c.width) || 0, M = ((d = e.image) == null ? void 0 : d.height) || ((f = (h = e.source) == null ? void 0 : h.data) == null ? void 0 : f.height) || 0;
|
|
588
|
-
console.log(`> Progressive: register texture[${n}] "${e.name || e.uuid}", Current: ${P}x${M}, Max: ${(w = r.lods[0]) == null ? void 0 : w.width}x${(v = r.lods[0]) == null ? void 0 : v.height}, uuid: ${e.uuid}`, r, e);
|
|
589
|
-
}
|
|
590
571
|
e.source && (e.source[Oe] = r);
|
|
591
572
|
const i = r.guid;
|
|
592
|
-
|
|
573
|
+
D.assignLODInformation(t, e, i, s, n), D.lodInfos.set(i, r), D.lowresCache.set(i, e);
|
|
593
574
|
}), /**
|
|
594
575
|
* Register a mesh with LOD information
|
|
595
576
|
*/
|
|
596
|
-
u(
|
|
577
|
+
u(P, "registerMesh", (t, e, s, n, r, i) => {
|
|
597
578
|
var c;
|
|
598
579
|
const a = s.geometry;
|
|
599
580
|
if (!a) {
|
|
600
|
-
|
|
581
|
+
x && console.warn("gltf-progressive: Register mesh without geometry");
|
|
601
582
|
return;
|
|
602
583
|
}
|
|
603
|
-
a.userData || (a.userData = {}),
|
|
604
|
-
let l =
|
|
605
|
-
l ? l.push(s.geometry) : l = [s.geometry],
|
|
584
|
+
a.userData || (a.userData = {}), x && console.log("> Progressive: register mesh " + s.name, { index: r, uuid: s.uuid }, i, s), D.assignLODInformation(t, a, e, n, r), D.lodInfos.set(e, i);
|
|
585
|
+
let l = D.lowresCache.get(e);
|
|
586
|
+
l ? l.push(s.geometry) : l = [s.geometry], D.lowresCache.set(e, l), n > 0 && !ce(s) && gt(s, a);
|
|
606
587
|
for (const d of j)
|
|
607
588
|
(c = d.onRegisteredNewMesh) == null || c.call(d, s, i);
|
|
608
589
|
}), /** A map of key = asset uuid and value = LOD information */
|
|
609
|
-
u(
|
|
610
|
-
u(
|
|
611
|
-
u(
|
|
590
|
+
u(P, "lodInfos", /* @__PURE__ */ new Map()), /** cache of already loaded mesh lods */
|
|
591
|
+
u(P, "previouslyLoaded", /* @__PURE__ */ new Map()), /** this contains the geometry/textures that were originally loaded */
|
|
592
|
+
u(P, "lowresCache", /* @__PURE__ */ new Map()), u(P, "queue", new ft(100, { debug: x != !1 }));
|
|
612
593
|
class yt {
|
|
613
594
|
constructor(t, e, s, n) {
|
|
614
595
|
u(this, "url");
|
|
@@ -663,7 +644,7 @@ class ye {
|
|
|
663
644
|
}
|
|
664
645
|
add(t, e, s) {
|
|
665
646
|
if (this._resolved) {
|
|
666
|
-
|
|
647
|
+
x && console.warn("PromiseGroup: Trying to add a promise to a resolved group, ignoring.");
|
|
667
648
|
return;
|
|
668
649
|
}
|
|
669
650
|
if (!(this._currentFrame > this.frame_capture_end)) {
|
|
@@ -671,7 +652,7 @@ class ye {
|
|
|
671
652
|
if (this._seen.has(e)) {
|
|
672
653
|
let n = this._seen.get(e);
|
|
673
654
|
if (n >= this._maxPromisesPerObject) {
|
|
674
|
-
|
|
655
|
+
x && console.warn("PromiseGroup: Already awaiting object ignoring new promise for it.");
|
|
675
656
|
return;
|
|
676
657
|
}
|
|
677
658
|
this._seen.set(e, n + 1);
|
|
@@ -696,14 +677,14 @@ u(ye, "addPromise", (t, e, s, n) => {
|
|
|
696
677
|
r.add(t, e, s);
|
|
697
678
|
});
|
|
698
679
|
});
|
|
699
|
-
const F = de("debugprogressive"),
|
|
700
|
-
var
|
|
701
|
-
const
|
|
680
|
+
const F = de("debugprogressive"), xt = de("noprogressive"), be = Symbol("Needle:LODSManager"), Se = Symbol("Needle:LODState"), Q = Symbol("Needle:CurrentLOD"), $ = { mesh_lod: -1, texture_lod: -1 };
|
|
681
|
+
var k, K, _e, J, ie, we, Y;
|
|
682
|
+
const O = class {
|
|
702
683
|
// readonly plugins: NEEDLE_progressive_plugin[] = [];
|
|
703
684
|
constructor(t, e) {
|
|
704
685
|
u(this, "renderer");
|
|
705
686
|
u(this, "context");
|
|
706
|
-
u(this, "projectionScreenMatrix", new
|
|
687
|
+
u(this, "projectionScreenMatrix", new Ge());
|
|
707
688
|
/**
|
|
708
689
|
* The target triangle density is the desired max amount of triangles on screen when the mesh is filling the screen.
|
|
709
690
|
* @default 200_000
|
|
@@ -720,7 +701,7 @@ const b = class {
|
|
|
720
701
|
* @default "auto"
|
|
721
702
|
*/
|
|
722
703
|
u(this, "updateInterval", "auto");
|
|
723
|
-
H(this,
|
|
704
|
+
H(this, k, 1);
|
|
724
705
|
/**
|
|
725
706
|
* If set to true, the LODsManager will not update the LODs.
|
|
726
707
|
* @default false
|
|
@@ -736,17 +717,17 @@ const b = class {
|
|
|
736
717
|
u(this, "_promiseGroupIds", 0);
|
|
737
718
|
u(this, "_lodchangedlisteners", []);
|
|
738
719
|
H(this, K, void 0);
|
|
739
|
-
H(this,
|
|
720
|
+
H(this, _e, new je());
|
|
740
721
|
H(this, J, 0);
|
|
741
722
|
H(this, ie, 0);
|
|
742
|
-
H(this,
|
|
723
|
+
H(this, we, 0);
|
|
743
724
|
H(this, Y, 0);
|
|
744
725
|
u(this, "_fpsBuffer", [60, 60, 60, 60, 60]);
|
|
745
726
|
// private testIfLODLevelsAreAvailable() {
|
|
746
|
-
u(this, "_sphere", new
|
|
747
|
-
u(this, "_tempBox", new
|
|
748
|
-
u(this, "_tempBox2", new
|
|
749
|
-
u(this, "tempMatrix", new
|
|
727
|
+
u(this, "_sphere", new Ze());
|
|
728
|
+
u(this, "_tempBox", new Ee());
|
|
729
|
+
u(this, "_tempBox2", new Ee());
|
|
730
|
+
u(this, "tempMatrix", new Ge());
|
|
750
731
|
u(this, "_tempWorldPosition", new W());
|
|
751
732
|
u(this, "_tempBoxSize", new W());
|
|
752
733
|
u(this, "_tempBox2Size", new W());
|
|
@@ -771,7 +752,7 @@ const b = class {
|
|
|
771
752
|
static get(t, e) {
|
|
772
753
|
if (t[be])
|
|
773
754
|
return console.debug("[gltf-progressive] LODsManager already exists for this renderer"), t[be];
|
|
774
|
-
const s = new
|
|
755
|
+
const s = new O(t, {
|
|
775
756
|
engine: "unknown",
|
|
776
757
|
...e
|
|
777
758
|
});
|
|
@@ -785,12 +766,12 @@ const b = class {
|
|
|
785
766
|
* Call to await LODs loading during the next render cycle.
|
|
786
767
|
*/
|
|
787
768
|
awaitLoading(t) {
|
|
788
|
-
const e = this._promiseGroupIds++, s = new ye(
|
|
769
|
+
const e = this._promiseGroupIds++, s = new ye(y(this, J), { ...t });
|
|
789
770
|
this._newPromiseGroups.push(s);
|
|
790
771
|
const n = performance.now();
|
|
791
772
|
return s.ready.finally(() => {
|
|
792
773
|
const r = this._newPromiseGroups.indexOf(s);
|
|
793
|
-
r >= 0 && (this._newPromiseGroups.splice(r, 1),
|
|
774
|
+
r >= 0 && (this._newPromiseGroups.splice(r, 1), ct() && performance.measure("LODsManager:awaitLoading", {
|
|
794
775
|
start: n,
|
|
795
776
|
detail: { id: e, name: t == null ? void 0 : t.name, awaited: s.awaitedCount, resolved: s.resolvedCount }
|
|
796
777
|
}));
|
|
@@ -799,7 +780,7 @@ const b = class {
|
|
|
799
780
|
_postprocessPromiseGroups() {
|
|
800
781
|
if (this._newPromiseGroups.length !== 0)
|
|
801
782
|
for (let t = this._newPromiseGroups.length - 1; t >= 0; t--)
|
|
802
|
-
this._newPromiseGroups[t].update(
|
|
783
|
+
this._newPromiseGroups[t].update(y(this, J));
|
|
803
784
|
}
|
|
804
785
|
addEventListener(t, e) {
|
|
805
786
|
t === "changed" && this._lodchangedlisteners.push(e);
|
|
@@ -814,21 +795,21 @@ const b = class {
|
|
|
814
795
|
* Enable the LODsManager. This will replace the render method of the renderer with a method that updates the LODs.
|
|
815
796
|
*/
|
|
816
797
|
enable() {
|
|
817
|
-
if (
|
|
798
|
+
if (y(this, K))
|
|
818
799
|
return;
|
|
819
800
|
console.debug("[gltf-progressive] Enabling LODsManager for renderer");
|
|
820
801
|
let t = 0;
|
|
821
|
-
|
|
802
|
+
q(this, K, this.renderer.render);
|
|
822
803
|
const e = this;
|
|
823
804
|
Ue(this.renderer), this.renderer.render = function(s, n) {
|
|
824
805
|
const r = e.renderer.getRenderTarget();
|
|
825
|
-
(r == null || "isXRRenderTarget" in r && r.isXRRenderTarget) && (t = 0,
|
|
806
|
+
(r == null || "isXRRenderTarget" in r && r.isXRRenderTarget) && (t = 0, q(e, J, y(e, J) + 1), q(e, ie, y(e, _e).getDelta()), q(e, we, y(e, we) + y(e, ie)), e._fpsBuffer.shift(), e._fpsBuffer.push(1 / y(e, ie)), q(e, Y, e._fpsBuffer.reduce((a, l) => a + l) / e._fpsBuffer.length), F && y(e, J) % 200 === 0 && console.log("FPS", Math.round(y(e, Y)), "Interval:", y(e, k)));
|
|
826
807
|
const i = t++;
|
|
827
|
-
|
|
808
|
+
y(e, K).call(this, s, n), e.onAfterRender(s, n, i);
|
|
828
809
|
};
|
|
829
810
|
}
|
|
830
811
|
disable() {
|
|
831
|
-
|
|
812
|
+
y(this, K) && (console.debug("[gltf-progressive] Disabling LODsManager for renderer"), this.renderer.render = y(this, K), q(this, K, void 0));
|
|
832
813
|
}
|
|
833
814
|
update(t, e) {
|
|
834
815
|
this.internalUpdate(t, e);
|
|
@@ -843,7 +824,7 @@ const b = class {
|
|
|
843
824
|
(a.name === "EffectMaterial" || a.name === "CopyShader") && (i = !1);
|
|
844
825
|
}
|
|
845
826
|
if ((e.parent && e.parent.type === "CubeCamera" || s >= 1 && e.type === "OrthographicCamera") && (i = !1), i) {
|
|
846
|
-
if (
|
|
827
|
+
if (xt || (this.updateInterval === "auto" ? y(this, Y) < 40 && y(this, k) < 10 ? (q(this, k, y(this, k) + 1), F && console.warn("↓ Reducing LOD updates", y(this, k), y(this, Y).toFixed(0))) : y(this, Y) >= 60 && y(this, k) > 1 && (q(this, k, y(this, k) - 1), F && console.warn("↑ Increasing LOD updates", y(this, k), y(this, Y).toFixed(0))) : q(this, k, this.updateInterval), y(this, k) > 0 && y(this, J) % y(this, k) != 0))
|
|
847
828
|
return;
|
|
848
829
|
this.internalUpdate(t, e), this._postprocessPromiseGroups();
|
|
849
830
|
}
|
|
@@ -872,21 +853,21 @@ const b = class {
|
|
|
872
853
|
}
|
|
873
854
|
if (F === "color" && d.material && !d.object.progressive_debug_color) {
|
|
874
855
|
d.object.progressive_debug_color = !0;
|
|
875
|
-
const f = Math.random() * 16777215, w = new
|
|
856
|
+
const f = Math.random() * 16777215, w = new Je({ color: f });
|
|
876
857
|
d.object.material = w;
|
|
877
858
|
}
|
|
878
|
-
const
|
|
879
|
-
(
|
|
859
|
+
const p = d.object;
|
|
860
|
+
(p instanceof se || p.isMesh) && this.updateLODs(t, e, p, r);
|
|
880
861
|
}
|
|
881
862
|
const i = s.transparent;
|
|
882
863
|
for (const d of i) {
|
|
883
|
-
const
|
|
884
|
-
(
|
|
864
|
+
const p = d.object;
|
|
865
|
+
(p instanceof se || p.isMesh) && this.updateLODs(t, e, p, r);
|
|
885
866
|
}
|
|
886
867
|
const a = s.transmissive;
|
|
887
868
|
for (const d of a) {
|
|
888
|
-
const
|
|
889
|
-
(
|
|
869
|
+
const p = d.object;
|
|
870
|
+
(p instanceof se || p.isMesh) && this.updateLODs(t, e, p, r);
|
|
890
871
|
}
|
|
891
872
|
}
|
|
892
873
|
/** Update the LOD levels for the renderer. */
|
|
@@ -894,15 +875,15 @@ const b = class {
|
|
|
894
875
|
var a, l;
|
|
895
876
|
s.userData || (s.userData = {});
|
|
896
877
|
let r = s[Se];
|
|
897
|
-
if (r || (r = new
|
|
878
|
+
if (r || (r = new Lt(), s[Se] = r), r.frames++ < 2)
|
|
898
879
|
return;
|
|
899
880
|
for (const c of j)
|
|
900
881
|
(a = c.onBeforeUpdateLOD) == null || a.call(c, this.renderer, t, e, s);
|
|
901
|
-
const i =
|
|
902
|
-
i >= 0 ? (
|
|
882
|
+
const i = O.overrideGlobalLodLevel !== void 0 ? O.overrideGlobalLodLevel : te;
|
|
883
|
+
i >= 0 ? ($.mesh_lod = i, $.texture_lod = i) : (this.calculateLodLevel(e, s, r, n, $), $.mesh_lod = Math.round($.mesh_lod), $.texture_lod = Math.round($.texture_lod)), $.mesh_lod >= 0 && this.loadProgressiveMeshes(s, $.mesh_lod), s.material && $.texture_lod >= 0 && this.loadProgressiveTextures(s.material, $.texture_lod), x && s.material && !s.isGizmo && qe(s.material);
|
|
903
884
|
for (const c of j)
|
|
904
|
-
(l = c.onAfterUpdatedLOD) == null || l.call(c, this.renderer, t, e, s,
|
|
905
|
-
r.lastLodLevel_Mesh =
|
|
885
|
+
(l = c.onAfterUpdatedLOD) == null || l.call(c, this.renderer, t, e, s, $);
|
|
886
|
+
r.lastLodLevel_Mesh = $.mesh_lod, r.lastLodLevel_Texture = $.texture_lod;
|
|
906
887
|
}
|
|
907
888
|
/** Load progressive textures for the given material
|
|
908
889
|
* @param material the material to load the textures for
|
|
@@ -922,7 +903,7 @@ const b = class {
|
|
|
922
903
|
const n = t["DEBUG:LOD"];
|
|
923
904
|
if (n != null && (s = t[Q] != n, e = n), s) {
|
|
924
905
|
t[Q] = e;
|
|
925
|
-
const r =
|
|
906
|
+
const r = P.assignTextureLOD(t, e).then((i) => {
|
|
926
907
|
this._lodchangedlisteners.forEach((a) => a({ type: "texture", level: e, object: t }));
|
|
927
908
|
});
|
|
928
909
|
ye.addPromise("texture", t, r, this._newPromiseGroups);
|
|
@@ -941,7 +922,7 @@ const b = class {
|
|
|
941
922
|
const n = t["DEBUG:LOD"];
|
|
942
923
|
if (n != null && (s = t[Q] != n, e = n), s) {
|
|
943
924
|
t[Q] = e;
|
|
944
|
-
const r = t.geometry, i =
|
|
925
|
+
const r = t.geometry, i = P.assignMeshLOD(t, e).then((a) => (a && t[Q] == e && r != t.geometry && this._lodchangedlisteners.forEach((l) => l({ type: "mesh", level: e, object: t })), a));
|
|
945
926
|
return ye.addPromise("mesh", t, i, this._newPromiseGroups), i;
|
|
946
927
|
}
|
|
947
928
|
return Promise.resolve(null);
|
|
@@ -951,7 +932,7 @@ const b = class {
|
|
|
951
932
|
return this._tempPtInside.set(r, i, s.z).applyMatrix4(e).z < 0;
|
|
952
933
|
}
|
|
953
934
|
calculateLodLevel(t, e, s, n, r) {
|
|
954
|
-
var
|
|
935
|
+
var b, R, Z;
|
|
955
936
|
if (!e) {
|
|
956
937
|
r.mesh_lod = -1, r.texture_lod = -1;
|
|
957
938
|
return;
|
|
@@ -963,102 +944,102 @@ const b = class {
|
|
|
963
944
|
let a = 10 + 1, l = !1;
|
|
964
945
|
if (F && e["DEBUG:LOD"] != null)
|
|
965
946
|
return e["DEBUG:LOD"];
|
|
966
|
-
const c = (
|
|
967
|
-
if (!
|
|
947
|
+
const c = (b = P.getMeshLODExtension(e.geometry)) == null ? void 0 : b.lods, d = P.getPrimitiveIndex(e.geometry), p = c && c.length > 0, f = P.getMaterialMinMaxLODsCount(e.material), w = (f == null ? void 0 : f.min_count) != 1 / 0 && f.min_count > 0 && f.max_count > 0;
|
|
948
|
+
if (!p && !w) {
|
|
968
949
|
r.mesh_lod = 0, r.texture_lod = 0;
|
|
969
950
|
return;
|
|
970
951
|
}
|
|
971
|
-
|
|
972
|
-
const
|
|
973
|
-
let
|
|
952
|
+
p || (l = !0, a = 0);
|
|
953
|
+
const M = this.renderer.domElement.clientHeight || this.renderer.domElement.height;
|
|
954
|
+
let A = e.geometry.boundingBox;
|
|
974
955
|
if (e.type === "SkinnedMesh") {
|
|
975
|
-
const
|
|
976
|
-
if (!
|
|
977
|
-
|
|
956
|
+
const h = e;
|
|
957
|
+
if (!h.boundingBox)
|
|
958
|
+
h.computeBoundingBox();
|
|
978
959
|
else if (this.skinnedMeshAutoUpdateBoundsInterval > 0) {
|
|
979
|
-
if (!
|
|
980
|
-
const
|
|
981
|
-
|
|
960
|
+
if (!h[O.$skinnedMeshBoundsOffset]) {
|
|
961
|
+
const C = O.skinnedMeshBoundsFrameOffsetCounter++;
|
|
962
|
+
h[O.$skinnedMeshBoundsOffset] = C;
|
|
982
963
|
}
|
|
983
|
-
const
|
|
984
|
-
if ((s.frames +
|
|
985
|
-
const
|
|
986
|
-
|
|
964
|
+
const L = h[O.$skinnedMeshBoundsOffset];
|
|
965
|
+
if ((s.frames + L) % this.skinnedMeshAutoUpdateBoundsInterval === 0) {
|
|
966
|
+
const C = ce(h), N = h.geometry;
|
|
967
|
+
C && (h.geometry = C), h.computeBoundingBox(), h.geometry = N;
|
|
987
968
|
}
|
|
988
969
|
}
|
|
989
|
-
|
|
970
|
+
A = h.boundingBox;
|
|
990
971
|
}
|
|
991
|
-
if (
|
|
992
|
-
const
|
|
972
|
+
if (A) {
|
|
973
|
+
const h = t;
|
|
993
974
|
if (e.geometry.attributes.color && e.geometry.attributes.color.count < 100 && e.geometry.boundingSphere) {
|
|
994
975
|
this._sphere.copy(e.geometry.boundingSphere), this._sphere.applyMatrix4(e.matrixWorld);
|
|
995
|
-
const
|
|
996
|
-
if (this._sphere.containsPoint(
|
|
976
|
+
const g = t.getWorldPosition(this._tempWorldPosition);
|
|
977
|
+
if (this._sphere.containsPoint(g)) {
|
|
997
978
|
r.mesh_lod = 0, r.texture_lod = 0;
|
|
998
979
|
return;
|
|
999
980
|
}
|
|
1000
981
|
}
|
|
1001
|
-
if (this._tempBox.copy(
|
|
982
|
+
if (this._tempBox.copy(A), this._tempBox.applyMatrix4(e.matrixWorld), h.isPerspectiveCamera && O.isInside(this._tempBox, this.projectionScreenMatrix)) {
|
|
1002
983
|
r.mesh_lod = 0, r.texture_lod = 0;
|
|
1003
984
|
return;
|
|
1004
985
|
}
|
|
1005
|
-
if (this._tempBox.applyMatrix4(this.projectionScreenMatrix), this.renderer.xr.enabled &&
|
|
1006
|
-
const
|
|
1007
|
-
let
|
|
1008
|
-
const fe = 2, ve = 1.5, he = (
|
|
1009
|
-
|
|
1010
|
-
const
|
|
1011
|
-
s.lastCentrality = (ve -
|
|
986
|
+
if (this._tempBox.applyMatrix4(this.projectionScreenMatrix), this.renderer.xr.enabled && h.isPerspectiveCamera && h.fov > 70) {
|
|
987
|
+
const g = this._tempBox.min, _ = this._tempBox.max;
|
|
988
|
+
let G = g.x, E = g.y, z = _.x, ne = _.y;
|
|
989
|
+
const fe = 2, ve = 1.5, he = (g.x + _.x) * 0.5, ge = (g.y + _.y) * 0.5;
|
|
990
|
+
G = (G - he) * fe + he, E = (E - ge) * fe + ge, z = (z - he) * fe + he, ne = (ne - ge) * fe + ge;
|
|
991
|
+
const Xe = G < 0 && z > 0 ? 0 : Math.min(Math.abs(g.x), Math.abs(_.x)), Ke = E < 0 && ne > 0 ? 0 : Math.min(Math.abs(g.y), Math.abs(_.y)), Me = Math.max(Xe, Ke);
|
|
992
|
+
s.lastCentrality = (ve - Me) * (ve - Me) * (ve - Me);
|
|
1012
993
|
} else
|
|
1013
994
|
s.lastCentrality = 1;
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1016
|
-
const
|
|
1017
|
-
|
|
1018
|
-
const S =
|
|
1019
|
-
if (Math.max(
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1022
|
-
const _ =
|
|
1023
|
-
_.copy(this._tempBox.min),
|
|
995
|
+
const L = this._tempBox.getSize(this._tempBoxSize);
|
|
996
|
+
L.multiplyScalar(0.5), screen.availHeight > 0 && M > 0 && L.multiplyScalar(M / screen.availHeight), t.isPerspectiveCamera ? L.x *= t.aspect : t.isOrthographicCamera;
|
|
997
|
+
const C = t.matrixWorldInverse, N = this._tempBox2;
|
|
998
|
+
N.copy(A), N.applyMatrix4(e.matrixWorld), N.applyMatrix4(C);
|
|
999
|
+
const S = N.getSize(this._tempBox2Size), ee = Math.max(S.x, S.y);
|
|
1000
|
+
if (Math.max(L.x, L.y) != 0 && ee != 0 && (L.z = S.z / Math.max(S.x, S.y) * Math.max(L.x, L.y)), s.lastScreenCoverage = Math.max(L.x, L.y, L.z), s.lastScreenspaceVolume.copy(L), s.lastScreenCoverage *= s.lastCentrality, F && O.debugDrawLine) {
|
|
1001
|
+
const g = this.tempMatrix.copy(this.projectionScreenMatrix);
|
|
1002
|
+
g.invert();
|
|
1003
|
+
const _ = O.corner0, G = O.corner1, E = O.corner2, z = O.corner3;
|
|
1004
|
+
_.copy(this._tempBox.min), G.copy(this._tempBox.max), G.x = _.x, E.copy(this._tempBox.max), E.y = _.y, z.copy(this._tempBox.max);
|
|
1024
1005
|
const ne = (_.z + z.z) * 0.5;
|
|
1025
|
-
_.z =
|
|
1006
|
+
_.z = G.z = E.z = z.z = ne, _.applyMatrix4(g), G.applyMatrix4(g), E.applyMatrix4(g), z.applyMatrix4(g), O.debugDrawLine(_, G, 255), O.debugDrawLine(_, E, 255), O.debugDrawLine(G, z, 255), O.debugDrawLine(E, z, 255);
|
|
1026
1007
|
}
|
|
1027
|
-
let
|
|
1008
|
+
let v = 999;
|
|
1028
1009
|
if (c && s.lastScreenCoverage > 0)
|
|
1029
|
-
for (let
|
|
1030
|
-
const _ = c[
|
|
1031
|
-
if (
|
|
1032
|
-
|
|
1010
|
+
for (let g = 0; g < c.length; g++) {
|
|
1011
|
+
const _ = c[g];
|
|
1012
|
+
if ((((R = _.densities) == null ? void 0 : R[d]) || _.density || 1e-5) / s.lastScreenCoverage < n) {
|
|
1013
|
+
v = g;
|
|
1033
1014
|
break;
|
|
1034
1015
|
}
|
|
1035
1016
|
}
|
|
1036
|
-
|
|
1017
|
+
v < a && (a = v, l = !0);
|
|
1037
1018
|
}
|
|
1038
1019
|
if (l ? r.mesh_lod = a : r.mesh_lod = s.lastLodLevel_Mesh, F && r.mesh_lod != s.lastLodLevel_Mesh) {
|
|
1039
|
-
const
|
|
1040
|
-
|
|
1020
|
+
const L = c == null ? void 0 : c[r.mesh_lod];
|
|
1021
|
+
L && console.log(`Mesh LOD changed: ${s.lastLodLevel_Mesh} → ${r.mesh_lod} (${L.density.toFixed(0)}) - ${e.name}`);
|
|
1041
1022
|
}
|
|
1042
1023
|
if (w) {
|
|
1043
|
-
const
|
|
1024
|
+
const h = "saveData" in globalThis.navigator && globalThis.navigator.saveData === !0;
|
|
1044
1025
|
if (s.lastLodLevel_Texture < 0) {
|
|
1045
1026
|
if (r.texture_lod = f.max_count - 1, F) {
|
|
1046
|
-
const
|
|
1047
|
-
F && console.log(`First Texture LOD ${r.texture_lod} (${
|
|
1027
|
+
const L = f.lods[f.max_count - 1];
|
|
1028
|
+
F && console.log(`First Texture LOD ${r.texture_lod} (${L.max_height}px) - ${e.name}`);
|
|
1048
1029
|
}
|
|
1049
1030
|
} else {
|
|
1050
|
-
const
|
|
1051
|
-
let
|
|
1052
|
-
((Z = this.context) == null ? void 0 : Z.engine) === "model-viewer" && (
|
|
1053
|
-
const S =
|
|
1031
|
+
const L = s.lastScreenspaceVolume.x + s.lastScreenspaceVolume.y + s.lastScreenspaceVolume.z;
|
|
1032
|
+
let C = s.lastScreenCoverage * 4;
|
|
1033
|
+
((Z = this.context) == null ? void 0 : Z.engine) === "model-viewer" && (C *= 1.5);
|
|
1034
|
+
const S = M / window.devicePixelRatio * C;
|
|
1054
1035
|
let ee = !1;
|
|
1055
|
-
for (let
|
|
1056
|
-
const
|
|
1057
|
-
if (!(
|
|
1058
|
-
if (ee = !0, r.texture_lod =
|
|
1059
|
-
const m =
|
|
1036
|
+
for (let B = f.lods.length - 1; B >= 0; B--) {
|
|
1037
|
+
const v = f.lods[B];
|
|
1038
|
+
if (!(h && v.max_height >= 2048) && !(dt() && v.max_height > 4096) && (v.max_height > S || !ee && B === 0)) {
|
|
1039
|
+
if (ee = !0, r.texture_lod = B, r.texture_lod < s.lastLodLevel_Texture) {
|
|
1040
|
+
const m = v.max_height;
|
|
1060
1041
|
F && console.log(`Texture LOD changed: ${s.lastLodLevel_Texture} → ${r.texture_lod} = ${m}px
|
|
1061
|
-
Screensize: ${S.toFixed(0)}px, Coverage: ${(100 * s.lastScreenCoverage).toFixed(2)}%, Volume ${
|
|
1042
|
+
Screensize: ${S.toFixed(0)}px, Coverage: ${(100 * s.lastScreenCoverage).toFixed(2)}%, Volume ${L.toFixed(1)}
|
|
1062
1043
|
${e.name}`);
|
|
1063
1044
|
}
|
|
1064
1045
|
break;
|
|
@@ -1069,15 +1050,15 @@ ${e.name}`);
|
|
|
1069
1050
|
r.texture_lod = 0;
|
|
1070
1051
|
}
|
|
1071
1052
|
};
|
|
1072
|
-
let
|
|
1073
|
-
|
|
1053
|
+
let T = O;
|
|
1054
|
+
k = new WeakMap(), K = new WeakMap(), _e = new WeakMap(), J = new WeakMap(), ie = new WeakMap(), we = new WeakMap(), Y = new WeakMap(), /**
|
|
1074
1055
|
* Assign a function to draw debug lines for the LODs. This function will be called with the start and end position of the line and the color of the line when the `debugprogressive` query parameter is set.
|
|
1075
1056
|
*/
|
|
1076
|
-
u(
|
|
1057
|
+
u(T, "debugDrawLine"), /**
|
|
1077
1058
|
* Force override the LOD level for all objects in the scene
|
|
1078
1059
|
*/
|
|
1079
|
-
u(
|
|
1080
|
-
class
|
|
1060
|
+
u(T, "overrideGlobalLodLevel"), u(T, "corner0", new W()), u(T, "corner1", new W()), u(T, "corner2", new W()), u(T, "corner3", new W()), u(T, "_tempPtInside", new W()), u(T, "skinnedMeshBoundsFrameOffsetCounter", 0), u(T, "$skinnedMeshBoundsOffset", Symbol("gltf-progressive-skinnedMeshBoundsOffset"));
|
|
1061
|
+
class Lt {
|
|
1081
1062
|
constructor() {
|
|
1082
1063
|
u(this, "frames", 0);
|
|
1083
1064
|
u(this, "lastLodLevel_Mesh", -1);
|
|
@@ -1087,41 +1068,41 @@ class xt {
|
|
|
1087
1068
|
u(this, "lastCentrality", 0);
|
|
1088
1069
|
}
|
|
1089
1070
|
}
|
|
1090
|
-
const
|
|
1071
|
+
const $e = Symbol("NEEDLE_mesh_lod"), pe = Symbol("NEEDLE_texture_lod");
|
|
1091
1072
|
let ue = null;
|
|
1092
|
-
function
|
|
1093
|
-
const o =
|
|
1073
|
+
function Ve() {
|
|
1074
|
+
const o = _t();
|
|
1094
1075
|
o && (o.mapURLs(function(t) {
|
|
1095
1076
|
return ke(), t;
|
|
1096
1077
|
}), ke(), ue == null || ue.disconnect(), ue = new MutationObserver((t) => {
|
|
1097
1078
|
t.forEach((e) => {
|
|
1098
1079
|
e.addedNodes.forEach((s) => {
|
|
1099
|
-
s instanceof HTMLElement && s.tagName.toLowerCase() === "model-viewer" &&
|
|
1080
|
+
s instanceof HTMLElement && s.tagName.toLowerCase() === "model-viewer" && We(s);
|
|
1100
1081
|
});
|
|
1101
1082
|
});
|
|
1102
1083
|
}), ue.observe(document, { childList: !0, subtree: !0 }));
|
|
1103
1084
|
}
|
|
1104
|
-
function
|
|
1085
|
+
function _t() {
|
|
1105
1086
|
if (typeof customElements > "u")
|
|
1106
1087
|
return null;
|
|
1107
1088
|
const o = customElements.get("model-viewer");
|
|
1108
1089
|
return o || (customElements.whenDefined("model-viewer").then(() => {
|
|
1109
|
-
console.debug("[gltf-progressive] model-viewer defined"),
|
|
1090
|
+
console.debug("[gltf-progressive] model-viewer defined"), Ve();
|
|
1110
1091
|
}), null);
|
|
1111
1092
|
}
|
|
1112
1093
|
function ke() {
|
|
1113
1094
|
if (typeof document > "u")
|
|
1114
1095
|
return;
|
|
1115
1096
|
document.querySelectorAll("model-viewer").forEach((t) => {
|
|
1116
|
-
|
|
1097
|
+
We(t);
|
|
1117
1098
|
});
|
|
1118
1099
|
}
|
|
1119
|
-
const
|
|
1120
|
-
let
|
|
1121
|
-
function
|
|
1122
|
-
if (!o ||
|
|
1100
|
+
const Ie = /* @__PURE__ */ new WeakSet();
|
|
1101
|
+
let wt = 0;
|
|
1102
|
+
function We(o) {
|
|
1103
|
+
if (!o || Ie.has(o))
|
|
1123
1104
|
return null;
|
|
1124
|
-
|
|
1105
|
+
Ie.add(o), console.debug("[gltf-progressive] found new model-viewer..." + ++wt + `
|
|
1125
1106
|
`, o.getAttribute("src"));
|
|
1126
1107
|
let t = null, e = null, s = null;
|
|
1127
1108
|
for (let n = o; n != null; n = Object.getPrototypeOf(n)) {
|
|
@@ -1141,8 +1122,8 @@ function Xe(o) {
|
|
|
1141
1122
|
}
|
|
1142
1123
|
};
|
|
1143
1124
|
console.debug("[gltf-progressive] setup model-viewer");
|
|
1144
|
-
const r =
|
|
1145
|
-
return
|
|
1125
|
+
const r = T.get(t, { engine: "model-viewer" });
|
|
1126
|
+
return T.addPlugin(new vt()), r.enable(), r.addEventListener("changed", () => {
|
|
1146
1127
|
s == null || s.call(o);
|
|
1147
1128
|
}), o.addEventListener("model-visibility", (i) => {
|
|
1148
1129
|
i.detail.visible && (s == null || s.call(o));
|
|
@@ -1180,25 +1161,25 @@ class vt {
|
|
|
1180
1161
|
const s = this.tryGetCurrentGLTF(t), n = this.tryGetCurrentModelViewer(t), r = this.getUrl(n);
|
|
1181
1162
|
if (r && s && e.material) {
|
|
1182
1163
|
let i = function(l) {
|
|
1183
|
-
var d,
|
|
1164
|
+
var d, p, f;
|
|
1184
1165
|
if (l[pe] == !0)
|
|
1185
1166
|
return;
|
|
1186
1167
|
l[pe] = !0, l.userData && (l.userData.LOD = -1);
|
|
1187
1168
|
const c = Object.keys(l);
|
|
1188
1169
|
for (let w = 0; w < c.length; w++) {
|
|
1189
|
-
const
|
|
1190
|
-
if ((
|
|
1191
|
-
const
|
|
1192
|
-
if (
|
|
1170
|
+
const M = c[w], A = l[M];
|
|
1171
|
+
if ((A == null ? void 0 : A.isTexture) === !0) {
|
|
1172
|
+
const b = (p = (d = A.userData) == null ? void 0 : d.associations) == null ? void 0 : p.textures;
|
|
1173
|
+
if (b == null)
|
|
1193
1174
|
continue;
|
|
1194
|
-
const R = s.parser.json.textures[
|
|
1175
|
+
const R = s.parser.json.textures[b];
|
|
1195
1176
|
if (!R) {
|
|
1196
|
-
console.warn("Texture data not found for texture index " +
|
|
1177
|
+
console.warn("Texture data not found for texture index " + b);
|
|
1197
1178
|
continue;
|
|
1198
1179
|
}
|
|
1199
1180
|
if ((f = R == null ? void 0 : R.extensions) != null && f[X]) {
|
|
1200
1181
|
const Z = R.extensions[X];
|
|
1201
|
-
Z && r &&
|
|
1182
|
+
Z && r && P.registerTexture(r, A, Z.lods.length, b, Z);
|
|
1202
1183
|
}
|
|
1203
1184
|
}
|
|
1204
1185
|
}
|
|
@@ -1213,34 +1194,34 @@ class vt {
|
|
|
1213
1194
|
}
|
|
1214
1195
|
tryParseMeshLOD(t, e) {
|
|
1215
1196
|
var i, a;
|
|
1216
|
-
if (e[
|
|
1197
|
+
if (e[$e] == !0)
|
|
1217
1198
|
return;
|
|
1218
|
-
e[
|
|
1199
|
+
e[$e] = !0;
|
|
1219
1200
|
const s = this.tryGetCurrentModelViewer(t), n = this.getUrl(s);
|
|
1220
1201
|
if (!n)
|
|
1221
1202
|
return;
|
|
1222
1203
|
const r = (a = (i = e.userData) == null ? void 0 : i.gltfExtensions) == null ? void 0 : a[X];
|
|
1223
1204
|
if (r && n) {
|
|
1224
1205
|
const l = e.uuid;
|
|
1225
|
-
|
|
1206
|
+
P.registerMesh(n, l, e, 0, r.lods.length, r);
|
|
1226
1207
|
}
|
|
1227
1208
|
}
|
|
1228
1209
|
}
|
|
1229
|
-
function
|
|
1230
|
-
Ue(t),
|
|
1210
|
+
function Mt(o, t, e, s) {
|
|
1211
|
+
Ue(t), Ne(e), ze(e, {
|
|
1231
1212
|
progressive: !0,
|
|
1232
1213
|
...s == null ? void 0 : s.hints
|
|
1233
|
-
}), e.register((r) => new
|
|
1234
|
-
const n =
|
|
1214
|
+
}), e.register((r) => new P(r, o));
|
|
1215
|
+
const n = T.get(t);
|
|
1235
1216
|
return (s == null ? void 0 : s.enableLODsManager) !== !1 && n.enable(), n;
|
|
1236
1217
|
}
|
|
1237
|
-
|
|
1218
|
+
Ve();
|
|
1238
1219
|
if (!ht) {
|
|
1239
1220
|
const o = {
|
|
1240
1221
|
gltfProgressive: {
|
|
1241
|
-
useNeedleProgressive:
|
|
1242
|
-
LODsManager:
|
|
1243
|
-
configureLoader:
|
|
1222
|
+
useNeedleProgressive: Mt,
|
|
1223
|
+
LODsManager: T,
|
|
1224
|
+
configureLoader: ze,
|
|
1244
1225
|
getRaycastMesh: ce,
|
|
1245
1226
|
useRaycastMeshes: pt
|
|
1246
1227
|
}
|
|
@@ -1253,17 +1234,17 @@ if (!ht) {
|
|
|
1253
1234
|
}
|
|
1254
1235
|
export {
|
|
1255
1236
|
X as EXTENSION_NAME,
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1237
|
+
T as LODsManager,
|
|
1238
|
+
P as NEEDLE_progressive,
|
|
1239
|
+
rt as VERSION,
|
|
1240
|
+
Ne as addDracoAndKTX2Loaders,
|
|
1241
|
+
ze as configureLoader,
|
|
1261
1242
|
Ue as createLoaders,
|
|
1262
1243
|
ce as getRaycastMesh,
|
|
1263
|
-
|
|
1244
|
+
Ve as patchModelViewer,
|
|
1264
1245
|
gt as registerRaycastMesh,
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1246
|
+
ot as setDracoDecoderLocation,
|
|
1247
|
+
at as setKTX2TranscoderLocation,
|
|
1248
|
+
Mt as useNeedleProgressive,
|
|
1268
1249
|
pt as useRaycastMeshes
|
|
1269
1250
|
};
|