@loaders.gl/tiles-3d 5.0.0-beta.2 → 5.0.0-beta.4

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.
Files changed (54) hide show
  1. package/dist/3d-tiles/3d-tiles-archive-loader.js +1 -1
  2. package/dist/3d-tiles/dist.dev.js +502 -342
  3. package/dist/3d-tiles/dist.min.js +19 -19
  4. package/dist/3d-tiles/index.cjs +307 -183
  5. package/dist/3d-tiles/index.cjs.map +3 -3
  6. package/dist/3d-tiles/lib/classes/tile-3d-batch-table.d.ts.map +1 -1
  7. package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js +12 -8
  8. package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js.map +1 -1
  9. package/dist/3d-tiles/lib/utils/version.js +1 -1
  10. package/dist/3d-tiles-archive-writer.cjs +1 -1
  11. package/dist/cesium-ion-loader-with-parser.cjs +301 -177
  12. package/dist/cesium-ion-loader-with-parser.cjs.map +3 -3
  13. package/dist/copc/copc-source-loader.js +1 -1
  14. package/dist/copc/copc-writer.js +1 -1
  15. package/dist/copc/index.cjs +358 -9
  16. package/dist/copc/index.cjs.map +3 -3
  17. package/dist/dist.min.js +2 -2
  18. package/dist/i3s/arcgis-webscene-loader.js +1 -1
  19. package/dist/i3s/dist.dev.js +3731 -694
  20. package/dist/i3s/dist.min.js +43 -35
  21. package/dist/i3s/i3s-attribute-loader.js +1 -1
  22. package/dist/i3s/i3s-building-scene-layer-loader.js +1 -1
  23. package/dist/i3s/i3s-content-loader.js +1 -1
  24. package/dist/i3s/i3s-lepcc-loader-types.js +1 -1
  25. package/dist/i3s/i3s-loader.js +1 -1
  26. package/dist/i3s/i3s-node-page-loader.js +1 -1
  27. package/dist/i3s/i3s-slpk-loader.js +1 -1
  28. package/dist/i3s/i3s-slpk-writer.js +1 -1
  29. package/dist/i3s/index.cjs +2542 -373
  30. package/dist/i3s/index.cjs.map +3 -3
  31. package/dist/i3s-content-worker-node.js +11 -11
  32. package/dist/i3s-content-worker-node.js.map +4 -4
  33. package/dist/i3s-content-worker.js +392 -56
  34. package/dist/i3s-lepcc-worker-node.js +369 -37
  35. package/dist/i3s-lepcc-worker-node.js.map +4 -4
  36. package/dist/i3s-lepcc-worker.js +340 -33
  37. package/dist/i3s-mesh-writer.cjs +2464 -295
  38. package/dist/i3s-mesh-writer.cjs.map +3 -3
  39. package/dist/i3s-slpk-writer.cjs +1 -1
  40. package/dist/index.cjs +1 -1
  41. package/dist/point-cloud-tile-source-loader-types.js +1 -1
  42. package/dist/point-cloud-tile-source-loader.cjs +1 -1
  43. package/dist/potree/dist.dev.js +84 -28
  44. package/dist/potree/dist.min.js +26 -26
  45. package/dist/potree/index.cjs +11 -6
  46. package/dist/potree/index.cjs.map +1 -1
  47. package/dist/potree/potree-bin-loader.js +1 -1
  48. package/dist/potree/potree-hierarchy-chunk-loader.js +1 -1
  49. package/dist/potree/potree-loader-types.js +1 -1
  50. package/dist/potree/potree-source-loader.js +1 -1
  51. package/dist/potree/potree-writer.js +1 -1
  52. package/dist/potree-loader.cjs +1 -1
  53. package/package.json +13 -13
  54. package/src/3d-tiles/lib/classes/tile-3d-batch-table.ts +12 -8
@@ -14,8 +14,8 @@ var __esm = (fn, res, err) => function __init() {
14
14
  }
15
15
  };
16
16
  var __export = (target, all) => {
17
- for (var name20 in all)
18
- __defProp(target, name20, { get: all[name20], enumerable: true });
17
+ for (var name22 in all)
18
+ __defProp(target, name22, { get: all[name22], enumerable: true });
19
19
  };
20
20
  var __copyProps = (to, from, except, desc) => {
21
21
  if (from && typeof from === "object" || typeof from === "function") {
@@ -129,9 +129,9 @@ function registerJSModules(modules) {
129
129
  globalThis.loaders.modules ||= {};
130
130
  Object.assign(globalThis.loaders.modules, modules);
131
131
  }
132
- function getJSModuleOrNull(name20) {
132
+ function getJSModuleOrNull(name22) {
133
133
  var _a, _b;
134
- const module2 = (_b = (_a = globalThis.loaders) == null ? void 0 : _a.modules) == null ? void 0 : _b[name20];
134
+ const module2 = (_b = (_a = globalThis.loaders) == null ? void 0 : _a.modules) == null ? void 0 : _b[name22];
135
135
  return module2 || null;
136
136
  }
137
137
  var init_js_module_utils = __esm({
@@ -376,10 +376,12 @@ var init_library_utils = __esm({
376
376
  });
377
377
 
378
378
  // ../core/src/worker-utils/index.ts
379
+ var import_tasks;
379
380
  var init_worker_utils = __esm({
380
381
  "../core/src/worker-utils/index.ts"() {
381
382
  "use strict";
382
383
  init_globals2();
384
+ import_tasks = require("@math.gl/core/tasks");
383
385
  init_library_utils();
384
386
  }
385
387
  });
@@ -3219,17 +3221,17 @@ var init_gltf_scenegraph = __esm({
3219
3221
  return extras[key];
3220
3222
  }
3221
3223
  hasExtension(extensionName) {
3222
- const isUsedExtension = this.getUsedExtensions().find((name20) => name20 === extensionName);
3223
- const isRequiredExtension = this.getRequiredExtensions().find((name20) => name20 === extensionName);
3224
+ const isUsedExtension = this.getUsedExtensions().find((name22) => name22 === extensionName);
3225
+ const isRequiredExtension = this.getRequiredExtensions().find((name22) => name22 === extensionName);
3224
3226
  return typeof isUsedExtension === "string" || typeof isRequiredExtension === "string";
3225
3227
  }
3226
3228
  getExtension(extensionName) {
3227
- const isExtension = this.getUsedExtensions().find((name20) => name20 === extensionName);
3229
+ const isExtension = this.getUsedExtensions().find((name22) => name22 === extensionName);
3228
3230
  const extensions = this.json.extensions || {};
3229
3231
  return isExtension ? extensions[extensionName] : null;
3230
3232
  }
3231
3233
  getRequiredExtension(extensionName) {
3232
- const isRequired = this.getRequiredExtensions().find((name20) => name20 === extensionName);
3234
+ const isRequired = this.getRequiredExtensions().find((name22) => name22 === extensionName);
3233
3235
  return isRequired ? this.getExtension(extensionName) : null;
3234
3236
  }
3235
3237
  getRequiredExtensions() {
@@ -3631,8 +3633,8 @@ var init_gltf_scenegraph = __esm({
3631
3633
  assert3(bufferOffset !== void 0);
3632
3634
  bufferView.byteOffset = bufferOffset + (bufferView.byteOffset || 0);
3633
3635
  bufferView.buffer = 0;
3634
- for (const name20 of ["EXT_meshopt_compression", "KHR_meshopt_compression"]) {
3635
- const extension = (_b = bufferView.extensions) == null ? void 0 : _b[name20];
3636
+ for (const name22 of ["EXT_meshopt_compression", "KHR_meshopt_compression"]) {
3637
+ const extension = (_b = bufferView.extensions) == null ? void 0 : _b[name22];
3636
3638
  if (extension) {
3637
3639
  const extensionOffset = bufferOffsets[extension.buffer];
3638
3640
  assert3(extensionOffset !== void 0);
@@ -3951,7 +3953,7 @@ function iterateObjectData(objects) {
3951
3953
  })();
3952
3954
  }
3953
3955
  function mapObjectData(objects) {
3954
- return new Map(Array.from(objects, ([name20, object]) => [name20, object.data]));
3956
+ return new Map(Array.from(objects, ([name22, object]) => [name22, object.data]));
3955
3957
  }
3956
3958
  function getCollectionName(type) {
3957
3959
  switch (type) {
@@ -4829,7 +4831,7 @@ function getPrimitiveTextureData(scenegraph, textureInfo, primitive) {
4829
4831
  if (typeof imageIndex !== "undefined") {
4830
4832
  const mimeType = (_d = (_c = json.images) == null ? void 0 : _c[imageIndex]) == null ? void 0 : _d.mimeType;
4831
4833
  const parsedImage = (_e = scenegraph.gltf.images) == null ? void 0 : _e[imageIndex];
4832
- if (parsedImage && typeof parsedImage.width !== "undefined") {
4834
+ if (parsedImage && typeof parsedImage.width !== "undefined" && !("compressed" in parsedImage && parsedImage.compressed)) {
4833
4835
  const textureData = [];
4834
4836
  for (let index = 0; index < textureCoordinates.length; index += 2) {
4835
4837
  const value = getImageValueByCoordinates(
@@ -5403,13 +5405,17 @@ __export(KHR_gaussian_splatting_exports, {
5403
5405
  getGaussianSplatPrimitives: () => getGaussianSplatPrimitives,
5404
5406
  name: () => name6
5405
5407
  });
5406
- async function decode6(gltfData, options) {
5407
- var _a, _b, _c, _d;
5408
+ async function decode6(gltfData, options, context) {
5409
+ var _a, _b, _c, _d, _e;
5410
+ const loader = (_a = context == null ? void 0 : context.loaders) == null ? void 0 : _a.find((candidate) => {
5411
+ var _a2;
5412
+ return (_a2 = candidate.extensions) == null ? void 0 : _a2.includes("spz");
5413
+ });
5408
5414
  const descriptors = getGaussianSplatPrimitives(gltfData);
5409
5415
  const iterator = new GLTFIterator(gltfData);
5410
5416
  for (const [meshIndex, mesh] of (gltfData.json.meshes || []).entries()) {
5411
5417
  for (const [primitiveIndex, primitive] of mesh.primitives.entries()) {
5412
- const extension = (_a = primitive.extensions) == null ? void 0 : _a[name6];
5418
+ const extension = (_b = primitive.extensions) == null ? void 0 : _b[name6];
5413
5419
  if (!extension) continue;
5414
5420
  validateGaussianSplatPrimitive(
5415
5421
  gltfData.json,
@@ -5419,22 +5425,29 @@ async function decode6(gltfData, options) {
5419
5425
  primitiveIndex,
5420
5426
  iterator
5421
5427
  );
5422
- const compression = (_b = extension.extensions) == null ? void 0 : _b[SPZ_COMPRESSION_EXTENSION_NAME];
5428
+ const compression = (_c = extension.extensions) == null ? void 0 : _c[SPZ_COMPRESSION_EXTENSION_NAME];
5423
5429
  if (compression) {
5424
5430
  const descriptor = descriptors.find(
5425
5431
  (item) => item.meshIndex === meshIndex && item.primitiveIndex === primitiveIndex
5426
5432
  );
5427
5433
  if (descriptor) {
5428
- const decoder = (_c = options == null ? void 0 : options.gltf) == null ? void 0 : _c.splatDecoder;
5429
- const bufferView = (_d = gltfData.json.bufferViews) == null ? void 0 : _d[compression.bufferView];
5434
+ const decoder = (_d = options == null ? void 0 : options.gltf) == null ? void 0 : _d.splatDecoder;
5435
+ const bufferView = (_e = gltfData.json.bufferViews) == null ? void 0 : _e[compression.bufferView];
5430
5436
  if (bufferView && gltfData.buffers[bufferView.buffer]) {
5431
5437
  descriptor.compressedBytes = getBufferViewBytes(gltfData, compression.bufferView);
5432
- } else if (decoder) {
5438
+ } else if (decoder || loader) {
5433
5439
  throw new Error(
5434
5440
  `KHR_gaussian_splatting: bufferView ${compression.bufferView} is not loaded for SPZ2 decoding.`
5435
5441
  );
5436
5442
  }
5437
- if (decoder && descriptor.compressedBytes) {
5443
+ if (loader && context && descriptor.compressedBytes) {
5444
+ descriptor.decoded = await parseFromContext(
5445
+ descriptor.compressedBytes.buffer,
5446
+ loader,
5447
+ { ...options, splats: { ...options.splats, sourceCoordinateSystem: "LUF" } },
5448
+ context
5449
+ );
5450
+ } else if (decoder && descriptor.compressedBytes) {
5438
5451
  descriptor.decoded = await decoder(descriptor.compressedBytes.buffer, {
5439
5452
  sourceCoordinateSystem: "LUF"
5440
5453
  });
@@ -5575,6 +5588,7 @@ var name6, SPZ_COMPRESSION_EXTENSION_NAME, REQUIRED_ATTRIBUTES;
5575
5588
  var init_KHR_gaussian_splatting = __esm({
5576
5589
  "../scene/src/gltf/lib/extensions/KHR_gaussian_splatting.ts"() {
5577
5590
  "use strict";
5591
+ init_loader_utils();
5578
5592
  init_gltf_iterator();
5579
5593
  name6 = "KHR_gaussian_splatting";
5580
5594
  SPZ_COMPRESSION_EXTENSION_NAME = "KHR_gaussian_splatting_compression_spz_2";
@@ -7132,6 +7146,33 @@ var init_resolve_gltf_file = __esm({
7132
7146
  }
7133
7147
  });
7134
7148
 
7149
+ // ../scene/src/gltf/lib/extensions/KHR_accessor_float64.ts
7150
+ var KHR_accessor_float64_exports = {};
7151
+ __export(KHR_accessor_float64_exports, {
7152
+ name: () => name10,
7153
+ preprocess: () => preprocess
7154
+ });
7155
+ function preprocess(gltf) {
7156
+ var _a, _b, _c, _d;
7157
+ const { json } = gltf;
7158
+ if (!((_a = json.extensionsUsed) == null ? void 0 : _a.includes(name10)) && !((_b = json.extensionsRequired) == null ? void 0 : _b.includes(name10))) return;
7159
+ if (!((_c = json.extensionsUsed) == null ? void 0 : _c.includes(name10)) || !((_d = json.extensionsRequired) == null ? void 0 : _d.includes(name10))) {
7160
+ throw new Error(`${name10}: must be declared in extensionsUsed and extensionsRequired.`);
7161
+ }
7162
+ for (const [index, accessor] of (json.accessors || []).entries()) {
7163
+ if (accessor.componentType === 5130 && accessor.normalized) {
7164
+ throw new Error(`${name10}: accessor ${index} must not be normalized.`);
7165
+ }
7166
+ }
7167
+ }
7168
+ var name10;
7169
+ var init_KHR_accessor_float64 = __esm({
7170
+ "../scene/src/gltf/lib/extensions/KHR_accessor_float64.ts"() {
7171
+ "use strict";
7172
+ name10 = "KHR_accessor_float64";
7173
+ }
7174
+ });
7175
+
7135
7176
  // ../scene/src/gltf/libs/meshopt-decoder.mjs
7136
7177
  var meshopt_decoder_exports = {};
7137
7178
  __export(meshopt_decoder_exports, {
@@ -7282,7 +7323,7 @@ var init_meshopt_decoder = __esm({
7282
7323
  }
7283
7324
  return result.buffer.slice(0, write);
7284
7325
  }
7285
- function decode17(instance2, fun, target, count, size, source, filter) {
7326
+ function decode18(instance2, fun, target, count, size, source, filter) {
7286
7327
  var sbrk = instance2.exports.sbrk;
7287
7328
  var count4 = count + 3 & ~3;
7288
7329
  var tp = sbrk(count4 * size);
@@ -7328,7 +7369,7 @@ var init_meshopt_decoder = __esm({
7328
7369
  return worker;
7329
7370
  }
7330
7371
  function initWorkers(count) {
7331
- var source = "self.ready = WebAssembly.instantiate(new Uint8Array([" + new Uint8Array(wasm) + "]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = " + workerProcess.name + ";" + decode17.toString() + workerProcess.toString();
7372
+ var source = "self.ready = WebAssembly.instantiate(new Uint8Array([" + new Uint8Array(wasm) + "]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = " + workerProcess.name + ";" + decode18.toString() + workerProcess.toString();
7332
7373
  var blob = new Blob([source], { type: "text/javascript" });
7333
7374
  var url = URL.createObjectURL(blob);
7334
7375
  for (var i = workers.length; i < count; ++i) {
@@ -7363,7 +7404,7 @@ var init_meshopt_decoder = __esm({
7363
7404
  }
7364
7405
  try {
7365
7406
  var target = new Uint8Array(data.count * data.size);
7366
- decode17(instance2, instance2.exports[data.mode], target, data.count, data.size, data.source, instance2.exports[data.filter]);
7407
+ decode18(instance2, instance2.exports[data.mode], target, data.count, data.size, data.source, instance2.exports[data.filter]);
7367
7408
  self.postMessage({ id: data.id, count: data.count, action: "resolve", value: target }, [target.buffer]);
7368
7409
  } catch (error) {
7369
7410
  self.postMessage({ id: data.id, count: data.count, action: "reject", value: error });
@@ -7377,16 +7418,16 @@ var init_meshopt_decoder = __esm({
7377
7418
  initWorkers(count);
7378
7419
  },
7379
7420
  decodeVertexBuffer: function(target, count, size, source, filter) {
7380
- decode17(instance, instance.exports.meshopt_decodeVertexBuffer, target, count, size, source, instance.exports[filters[filter]]);
7421
+ decode18(instance, instance.exports.meshopt_decodeVertexBuffer, target, count, size, source, instance.exports[filters[filter]]);
7381
7422
  },
7382
7423
  decodeIndexBuffer: function(target, count, size, source) {
7383
- decode17(instance, instance.exports.meshopt_decodeIndexBuffer, target, count, size, source);
7424
+ decode18(instance, instance.exports.meshopt_decodeIndexBuffer, target, count, size, source);
7384
7425
  },
7385
7426
  decodeIndexSequence: function(target, count, size, source) {
7386
- decode17(instance, instance.exports.meshopt_decodeIndexSequence, target, count, size, source);
7427
+ decode18(instance, instance.exports.meshopt_decodeIndexSequence, target, count, size, source);
7387
7428
  },
7388
7429
  decodeGltfBuffer: function(target, count, size, source, mode, filter) {
7389
- decode17(instance, instance.exports[decoders[mode]], target, count, size, source, instance.exports[filters[filter]]);
7430
+ decode18(instance, instance.exports[decoders[mode]], target, count, size, source, instance.exports[filters[filter]]);
7390
7431
  },
7391
7432
  decodeGltfBufferAsync: function(count, size, source, mode, filter) {
7392
7433
  if (workers.length > 0) {
@@ -7394,7 +7435,7 @@ var init_meshopt_decoder = __esm({
7394
7435
  }
7395
7436
  return ready.then(function() {
7396
7437
  var target = new Uint8Array(count * size);
7397
- decode17(instance, instance.exports[decoders[mode]], target, count, size, source, instance.exports[filters[filter]]);
7438
+ decode18(instance, instance.exports[decoders[mode]], target, count, size, source, instance.exports[filters[filter]]);
7398
7439
  return target;
7399
7440
  });
7400
7441
  }
@@ -7548,17 +7589,17 @@ var init_meshopt_compression = __esm({
7548
7589
  var EXT_meshopt_compression_exports = {};
7549
7590
  __export(EXT_meshopt_compression_exports, {
7550
7591
  decode: () => decode10,
7551
- name: () => name10
7592
+ name: () => name11
7552
7593
  });
7553
7594
  async function decode10(gltfData, options) {
7554
- await decodeMeshoptCompression(gltfData, options, name10);
7595
+ await decodeMeshoptCompression(gltfData, options, name11);
7555
7596
  }
7556
- var name10;
7597
+ var name11;
7557
7598
  var init_EXT_meshopt_compression = __esm({
7558
7599
  "../scene/src/gltf/lib/extensions/EXT_meshopt_compression.ts"() {
7559
7600
  "use strict";
7560
7601
  init_meshopt_compression();
7561
- name10 = "EXT_meshopt_compression";
7602
+ name11 = "EXT_meshopt_compression";
7562
7603
  }
7563
7604
  });
7564
7605
 
@@ -7566,28 +7607,29 @@ var init_EXT_meshopt_compression = __esm({
7566
7607
  var KHR_meshopt_compression_exports = {};
7567
7608
  __export(KHR_meshopt_compression_exports, {
7568
7609
  decode: () => decode11,
7569
- name: () => name11
7610
+ name: () => name12
7570
7611
  });
7571
7612
  async function decode11(gltfData, options) {
7572
- await decodeMeshoptCompression(gltfData, options, name11);
7613
+ await decodeMeshoptCompression(gltfData, options, name12);
7573
7614
  }
7574
- var name11;
7615
+ var name12;
7575
7616
  var init_KHR_meshopt_compression = __esm({
7576
7617
  "../scene/src/gltf/lib/extensions/KHR_meshopt_compression.ts"() {
7577
7618
  "use strict";
7578
7619
  init_meshopt_compression();
7579
- name11 = "KHR_meshopt_compression";
7620
+ name12 = "KHR_meshopt_compression";
7580
7621
  }
7581
7622
  });
7582
7623
 
7583
7624
  // ../scene/src/gltf/lib/extensions/EXT_texture_webp.ts
7584
7625
  var EXT_texture_webp_exports = {};
7585
7626
  __export(EXT_texture_webp_exports, {
7586
- name: () => name12,
7587
- preprocess: () => preprocess
7627
+ name: () => name13,
7628
+ preprocess: () => preprocess2
7588
7629
  });
7589
- function preprocess(gltfData, options) {
7630
+ function preprocess2(gltfData, options) {
7590
7631
  const iterator = new GLTFIterator(gltfData);
7632
+ if (!iterator.hasExtension(EXT_TEXTURE_WEBP)) return;
7591
7633
  if (!isImageFormatSupported("image/webp")) {
7592
7634
  if (iterator.isExtensionRequired(EXT_TEXTURE_WEBP)) {
7593
7635
  throw new Error(`gltf: Required extension ${EXT_TEXTURE_WEBP} not supported by browser`);
@@ -7603,24 +7645,24 @@ function preprocess(gltfData, options) {
7603
7645
  }
7604
7646
  iterator.removeExtension(EXT_TEXTURE_WEBP);
7605
7647
  }
7606
- var EXT_TEXTURE_WEBP, name12;
7648
+ var EXT_TEXTURE_WEBP, name13;
7607
7649
  var init_EXT_texture_webp = __esm({
7608
7650
  "../scene/src/gltf/lib/extensions/EXT_texture_webp.ts"() {
7609
7651
  "use strict";
7610
7652
  init_src();
7611
7653
  init_gltf_iterator();
7612
7654
  EXT_TEXTURE_WEBP = "EXT_texture_webp";
7613
- name12 = EXT_TEXTURE_WEBP;
7655
+ name13 = EXT_TEXTURE_WEBP;
7614
7656
  }
7615
7657
  });
7616
7658
 
7617
7659
  // ../scene/src/gltf/lib/extensions/EXT_texture_avif.ts
7618
7660
  var EXT_texture_avif_exports = {};
7619
7661
  __export(EXT_texture_avif_exports, {
7620
- name: () => name13,
7621
- preprocess: () => preprocess2
7662
+ name: () => name14,
7663
+ preprocess: () => preprocess3
7622
7664
  });
7623
- async function preprocess2(gltfData, options) {
7665
+ async function preprocess3(gltfData, options) {
7624
7666
  void options;
7625
7667
  const iterator = new GLTFIterator(gltfData);
7626
7668
  if (!iterator.hasExtension(EXT_TEXTURE_AVIF)) return;
@@ -7640,24 +7682,72 @@ async function preprocess2(gltfData, options) {
7640
7682
  }
7641
7683
  iterator.removeExtension(EXT_TEXTURE_AVIF);
7642
7684
  }
7643
- var EXT_TEXTURE_AVIF, name13;
7685
+ var EXT_TEXTURE_AVIF, name14;
7644
7686
  var init_EXT_texture_avif = __esm({
7645
7687
  "../scene/src/gltf/lib/extensions/EXT_texture_avif.ts"() {
7646
7688
  "use strict";
7647
7689
  init_src();
7648
7690
  init_gltf_iterator();
7649
7691
  EXT_TEXTURE_AVIF = "EXT_texture_avif";
7650
- name13 = EXT_TEXTURE_AVIF;
7692
+ name14 = EXT_TEXTURE_AVIF;
7693
+ }
7694
+ });
7695
+
7696
+ // ../scene/src/gltf/lib/extensions/MSFT_texture_dds.ts
7697
+ var MSFT_texture_dds_exports = {};
7698
+ __export(MSFT_texture_dds_exports, {
7699
+ decode: () => decode12,
7700
+ getDDSLoader: () => getDDSLoader,
7701
+ name: () => name15,
7702
+ preprocess: () => preprocess4
7703
+ });
7704
+ function getDDSLoader(context) {
7705
+ var _a;
7706
+ return (_a = context == null ? void 0 : context.loaders) == null ? void 0 : _a.find(
7707
+ (loader) => {
7708
+ var _a2, _b;
7709
+ return ((_a2 = loader.extensions) == null ? void 0 : _a2.includes("dds")) || ((_b = loader.mimeTypes) == null ? void 0 : _b.includes("image/vnd-ms.dds"));
7710
+ }
7711
+ );
7712
+ }
7713
+ function preprocess4(gltf, _options, context) {
7714
+ const iterator = new GLTFIterator(gltf);
7715
+ if (!iterator.hasExtension(name15)) return;
7716
+ if (!getDDSLoader(context)) {
7717
+ if (iterator.isExtensionRequired(name15)) {
7718
+ throw new Error("gltf: Required extension MSFT_texture_dds needs a DDS parser");
7719
+ }
7720
+ return;
7721
+ }
7722
+ for (const texture of iterator.textures) {
7723
+ const extension = iterator.getExtension(texture, name15);
7724
+ if (extension) texture.source = extension.source;
7725
+ }
7726
+ }
7727
+ async function decode12(gltf, options, context) {
7728
+ var _a;
7729
+ if (!getDDSLoader(context) || ((_a = options.gltf) == null ? void 0 : _a.loadImages) === false) return;
7730
+ const iterator = new GLTFIterator(gltf);
7731
+ if (!iterator.hasExtension(name15)) return;
7732
+ for (const texture of iterator.textures) iterator.removeExtension(texture, name15);
7733
+ iterator.removeExtension(name15);
7734
+ }
7735
+ var name15;
7736
+ var init_MSFT_texture_dds = __esm({
7737
+ "../scene/src/gltf/lib/extensions/MSFT_texture_dds.ts"() {
7738
+ "use strict";
7739
+ init_gltf_iterator();
7740
+ name15 = "MSFT_texture_dds";
7651
7741
  }
7652
7742
  });
7653
7743
 
7654
7744
  // ../scene/src/gltf/lib/extensions/KHR_texture_basisu.ts
7655
7745
  var KHR_texture_basisu_exports = {};
7656
7746
  __export(KHR_texture_basisu_exports, {
7657
- name: () => name14,
7658
- preprocess: () => preprocess3
7747
+ name: () => name16,
7748
+ preprocess: () => preprocess5
7659
7749
  });
7660
- function preprocess3(gltfData, options) {
7750
+ function preprocess5(gltfData, options) {
7661
7751
  void options;
7662
7752
  const iterator = new GLTFIterator(gltfData);
7663
7753
  for (const texture of iterator.textures) {
@@ -7669,13 +7759,13 @@ function preprocess3(gltfData, options) {
7669
7759
  }
7670
7760
  iterator.removeExtension(KHR_TEXTURE_BASISU);
7671
7761
  }
7672
- var KHR_TEXTURE_BASISU, name14;
7762
+ var KHR_TEXTURE_BASISU, name16;
7673
7763
  var init_KHR_texture_basisu = __esm({
7674
7764
  "../scene/src/gltf/lib/extensions/KHR_texture_basisu.ts"() {
7675
7765
  "use strict";
7676
7766
  init_gltf_iterator();
7677
7767
  KHR_TEXTURE_BASISU = "KHR_texture_basisu";
7678
- name14 = KHR_TEXTURE_BASISU;
7768
+ name16 = KHR_TEXTURE_BASISU;
7679
7769
  }
7680
7770
  });
7681
7771
 
@@ -8572,7 +8662,7 @@ function validateDracoDecoderModule(module2) {
8572
8662
  return typedModule;
8573
8663
  }
8574
8664
  function getLibraryCacheKey2(type, options) {
8575
- const libraryOverrides = Object.entries(options.modules || {}).filter(([name20]) => name20 !== "draco3d").map(([name20, value]) => `${name20}:${String(value)}`).sort().join("|");
8665
+ const libraryOverrides = Object.entries(options.modules || {}).filter(([name22]) => name22 !== "draco3d").map(([name22, value]) => `${name22}:${String(value)}`).sort().join("|");
8576
8666
  return [
8577
8667
  type,
8578
8668
  options.useLocalLibraries ? "local" : "remote",
@@ -9022,12 +9112,12 @@ var init_convert_mesh_to_table = __esm({
9022
9112
  });
9023
9113
 
9024
9114
  // ../core/src/schema-utils/lib/mesh/deduce-mesh-schema.ts
9025
- function deduceMeshField(name20, attribute, optionalMetadata) {
9115
+ function deduceMeshField(name22, attribute, optionalMetadata) {
9026
9116
  const type = attribute.componentType || getDataTypeFromTypedArray(attribute.value);
9027
9117
  const metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);
9028
9118
  const dataType = attribute.size === 1 ? type : { type: "fixed-size-list", listSize: attribute.size, children: [{ name: "value", type }] };
9029
9119
  return {
9030
- name: name20,
9120
+ name: name22,
9031
9121
  type: dataType,
9032
9122
  nullable: false,
9033
9123
  metadata
@@ -9912,11 +10002,11 @@ var init_draco_loader_types2 = __esm({
9912
10002
  // ../scene/src/gltf/lib/gltf-utils/gltf-attribute-utils.ts
9913
10003
  function getGLTFAccessors(attributes) {
9914
10004
  const accessors = {};
9915
- for (const name20 in attributes) {
9916
- const attribute = attributes[name20];
9917
- if (name20 !== "indices") {
10005
+ for (const name22 in attributes) {
10006
+ const attribute = attributes[name22];
10007
+ if (name22 !== "indices") {
9918
10008
  const glTFAccessor = getGLTFAccessor(attribute);
9919
- accessors[name20] = glTFAccessor;
10009
+ accessors[name22] = glTFAccessor;
9920
10010
  }
9921
10011
  }
9922
10012
  return accessors;
@@ -9977,11 +10067,11 @@ var init_gltf_attribute_utils = __esm({
9977
10067
  // ../scene/src/gltf/lib/extensions/KHR_draco_mesh_compression.ts
9978
10068
  var KHR_draco_mesh_compression_exports = {};
9979
10069
  __export(KHR_draco_mesh_compression_exports, {
9980
- decode: () => decode12,
9981
- name: () => name15,
9982
- preprocess: () => preprocess4
10070
+ decode: () => decode13,
10071
+ name: () => name17,
10072
+ preprocess: () => preprocess6
9983
10073
  });
9984
- function preprocess4(gltfData, options, context) {
10074
+ function preprocess6(gltfData, options, context) {
9985
10075
  const iterator = new GLTFIterator(gltfData);
9986
10076
  for (const mesh of iterator.meshes) {
9987
10077
  for (const primitive of iterator.getReferences(mesh).primitives) {
@@ -9990,7 +10080,7 @@ function preprocess4(gltfData, options, context) {
9990
10080
  }
9991
10081
  }
9992
10082
  }
9993
- async function decode12(gltfData, options, context) {
10083
+ async function decode13(gltfData, options, context) {
9994
10084
  var _a;
9995
10085
  if (!((_a = options == null ? void 0 : options.gltf) == null ? void 0 : _a.decompressMeshes)) {
9996
10086
  return;
@@ -10073,7 +10163,7 @@ function checkPrimitive(primitive) {
10073
10163
  throw new Error("glTF: Empty primitive detected: Draco decompression failure?");
10074
10164
  }
10075
10165
  }
10076
- var KHR_DRACO_MESH_COMPRESSION, name15;
10166
+ var KHR_DRACO_MESH_COMPRESSION, name17;
10077
10167
  var init_KHR_draco_mesh_compression = __esm({
10078
10168
  "../scene/src/gltf/lib/extensions/KHR_draco_mesh_compression.ts"() {
10079
10169
  "use strict";
@@ -10083,17 +10173,17 @@ var init_KHR_draco_mesh_compression = __esm({
10083
10173
  init_gltf_attribute_utils();
10084
10174
  init_get_typed_array();
10085
10175
  KHR_DRACO_MESH_COMPRESSION = "KHR_draco_mesh_compression";
10086
- name15 = KHR_DRACO_MESH_COMPRESSION;
10176
+ name17 = KHR_DRACO_MESH_COMPRESSION;
10087
10177
  }
10088
10178
  });
10089
10179
 
10090
10180
  // ../scene/src/gltf/lib/extensions/KHR_texture_transform.ts
10091
10181
  var KHR_texture_transform_exports = {};
10092
10182
  __export(KHR_texture_transform_exports, {
10093
- decode: () => decode13,
10094
- name: () => name16
10183
+ decode: () => decode14,
10184
+ name: () => name18
10095
10185
  });
10096
- async function decode13(gltfData, options) {
10186
+ async function decode14(gltfData, options) {
10097
10187
  var _a;
10098
10188
  const iterator = new GLTFIterator(gltfData);
10099
10189
  const hasExtension = iterator.hasExtension(KHR_TEXTURE_TRANSFORM);
@@ -10314,7 +10404,7 @@ function makeTransformationMatrix(extensionData) {
10314
10404
  const scaleMatrix = scratchScaleMatrix.set(scale[0], 0, 0, 0, scale[1], 0, 0, 0, 1);
10315
10405
  return translationMatrix.multiplyRight(rotationMatrix).multiplyRight(scaleMatrix);
10316
10406
  }
10317
- var import_core3, KHR_TEXTURE_TRANSFORM, name16, scratchVector, scratchRotationMatrix, scratchScaleMatrix;
10407
+ var import_core3, KHR_TEXTURE_TRANSFORM, name18, scratchVector, scratchRotationMatrix, scratchScaleMatrix;
10318
10408
  var init_KHR_texture_transform = __esm({
10319
10409
  "../scene/src/gltf/lib/extensions/KHR_texture_transform.ts"() {
10320
10410
  "use strict";
@@ -10324,7 +10414,7 @@ var init_KHR_texture_transform = __esm({
10324
10414
  init_gltf_iterator();
10325
10415
  init_loader_utils();
10326
10416
  KHR_TEXTURE_TRANSFORM = "KHR_texture_transform";
10327
- name16 = KHR_TEXTURE_TRANSFORM;
10417
+ name18 = KHR_TEXTURE_TRANSFORM;
10328
10418
  scratchVector = new import_core3.Vector3();
10329
10419
  scratchRotationMatrix = new import_core3.Matrix3();
10330
10420
  scratchScaleMatrix = new import_core3.Matrix3();
@@ -10334,11 +10424,11 @@ var init_KHR_texture_transform = __esm({
10334
10424
  // ../scene/src/gltf/lib/extensions/deprecated/KHR_lights_punctual.ts
10335
10425
  var KHR_lights_punctual_exports = {};
10336
10426
  __export(KHR_lights_punctual_exports, {
10337
- decode: () => decode14,
10427
+ decode: () => decode15,
10338
10428
  encode: () => encode3,
10339
- name: () => name17
10429
+ name: () => name19
10340
10430
  });
10341
- async function decode14(gltfData) {
10431
+ async function decode15(gltfData) {
10342
10432
  const iterator = new GLTFIterator(gltfData);
10343
10433
  const extension = iterator.getExtension(KHR_LIGHTS_PUNCTUAL);
10344
10434
  if (extension) {
@@ -10370,7 +10460,7 @@ async function encode3(gltfData) {
10370
10460
  delete gltfScenegraph.json.lights;
10371
10461
  }
10372
10462
  }
10373
- var KHR_LIGHTS_PUNCTUAL, name17;
10463
+ var KHR_LIGHTS_PUNCTUAL, name19;
10374
10464
  var init_KHR_lights_punctual = __esm({
10375
10465
  "../scene/src/gltf/lib/extensions/deprecated/KHR_lights_punctual.ts"() {
10376
10466
  "use strict";
@@ -10378,18 +10468,18 @@ var init_KHR_lights_punctual = __esm({
10378
10468
  init_gltf_iterator();
10379
10469
  init_gltf_scenegraph();
10380
10470
  KHR_LIGHTS_PUNCTUAL = "KHR_lights_punctual";
10381
- name17 = KHR_LIGHTS_PUNCTUAL;
10471
+ name19 = KHR_LIGHTS_PUNCTUAL;
10382
10472
  }
10383
10473
  });
10384
10474
 
10385
10475
  // ../scene/src/gltf/lib/extensions/deprecated/KHR_materials_unlit.ts
10386
10476
  var KHR_materials_unlit_exports = {};
10387
10477
  __export(KHR_materials_unlit_exports, {
10388
- decode: () => decode15,
10478
+ decode: () => decode16,
10389
10479
  encode: () => encode4,
10390
- name: () => name18
10480
+ name: () => name20
10391
10481
  });
10392
- async function decode15(gltfData) {
10482
+ async function decode16(gltfData) {
10393
10483
  const iterator = new GLTFIterator(gltfData);
10394
10484
  for (const material of iterator.materials) {
10395
10485
  const extension = iterator.getExtension(material, KHR_MATERIALS_UNLIT);
@@ -10414,25 +10504,25 @@ function encode4(gltfData) {
10414
10504
  for (const field of ["extensionsUsed", "extensionsRequired"])
10415
10505
  if (((_a = gltfData.json[field]) == null ? void 0 : _a.length) === 0) delete gltfData.json[field];
10416
10506
  }
10417
- var KHR_MATERIALS_UNLIT, name18;
10507
+ var KHR_MATERIALS_UNLIT, name20;
10418
10508
  var init_KHR_materials_unlit = __esm({
10419
10509
  "../scene/src/gltf/lib/extensions/deprecated/KHR_materials_unlit.ts"() {
10420
10510
  "use strict";
10421
10511
  init_gltf_iterator();
10422
10512
  init_gltf_scenegraph();
10423
10513
  KHR_MATERIALS_UNLIT = "KHR_materials_unlit";
10424
- name18 = KHR_MATERIALS_UNLIT;
10514
+ name20 = KHR_MATERIALS_UNLIT;
10425
10515
  }
10426
10516
  });
10427
10517
 
10428
10518
  // ../scene/src/gltf/lib/extensions/deprecated/KHR_techniques_webgl.ts
10429
10519
  var KHR_techniques_webgl_exports = {};
10430
10520
  __export(KHR_techniques_webgl_exports, {
10431
- decode: () => decode16,
10521
+ decode: () => decode17,
10432
10522
  encode: () => encode5,
10433
- name: () => name19
10523
+ name: () => name21
10434
10524
  });
10435
- async function decode16(gltfData) {
10525
+ async function decode17(gltfData) {
10436
10526
  const iterator = new GLTFIterator(gltfData);
10437
10527
  const extension = iterator.getExtension(KHR_TECHNIQUES_WEBGL);
10438
10528
  if (extension) {
@@ -10493,14 +10583,14 @@ function resolveValues(technique, iterator) {
10493
10583
  });
10494
10584
  return values;
10495
10585
  }
10496
- var KHR_TECHNIQUES_WEBGL, name19;
10586
+ var KHR_TECHNIQUES_WEBGL, name21;
10497
10587
  var init_KHR_techniques_webgl = __esm({
10498
10588
  "../scene/src/gltf/lib/extensions/deprecated/KHR_techniques_webgl.ts"() {
10499
10589
  "use strict";
10500
10590
  init_gltf_iterator();
10501
10591
  init_get_typed_array();
10502
10592
  KHR_TECHNIQUES_WEBGL = "KHR_techniques_webgl";
10503
- name19 = KHR_TECHNIQUES_WEBGL;
10593
+ name21 = KHR_TECHNIQUES_WEBGL;
10504
10594
  }
10505
10595
  });
10506
10596
 
@@ -10530,6 +10620,7 @@ var EXTENSIONS;
10530
10620
  var init_gltf_extensions = __esm({
10531
10621
  "../scene/src/gltf/lib/api/gltf-extensions.ts"() {
10532
10622
  "use strict";
10623
+ init_KHR_accessor_float64();
10533
10624
  init_EXT_mesh_features();
10534
10625
  init_EXT_structural_metadata();
10535
10626
  init_KHR_gaussian_splatting();
@@ -10541,6 +10632,7 @@ var init_gltf_extensions = __esm({
10541
10632
  init_KHR_meshopt_compression();
10542
10633
  init_EXT_texture_webp();
10543
10634
  init_EXT_texture_avif();
10635
+ init_MSFT_texture_dds();
10544
10636
  init_KHR_texture_basisu();
10545
10637
  init_KHR_draco_mesh_compression();
10546
10638
  init_KHR_texture_transform();
@@ -10550,6 +10642,7 @@ var init_gltf_extensions = __esm({
10550
10642
  init_KHR_techniques_webgl();
10551
10643
  init_EXT_feature_metadata();
10552
10644
  EXTENSIONS = [
10645
+ KHR_accessor_float64_exports,
10553
10646
  // 1.0
10554
10647
  // KHR_binary_gltf is handled separately - must be processed before other parsing starts
10555
10648
  // KHR_binary_gltf,
@@ -10568,9 +10661,11 @@ var init_gltf_extensions = __esm({
10568
10661
  EXT_mesh_polygon_exports,
10569
10662
  MPEG_audio_spatial_exports,
10570
10663
  KHR_audio_emitter_exports,
10571
- EXT_texture_avif_exports,
10572
10664
  EXT_texture_webp_exports,
10573
- // Basisu should come after webp, we want basisu to be preferred if both are provided
10665
+ EXT_texture_avif_exports,
10666
+ // Compressed textures take precedence over browser image formats when available.
10667
+ MSFT_texture_dds_exports,
10668
+ // BasisU remains preferred when both compressed alternatives are provided.
10574
10669
  KHR_texture_basisu_exports,
10575
10670
  KHR_lights_punctual_exports,
10576
10671
  KHR_materials_unlit_exports,
@@ -10582,7 +10677,7 @@ var init_gltf_extensions = __esm({
10582
10677
  });
10583
10678
 
10584
10679
  // ../scene/src/gltf/lib/extensions/KHR_binary_gltf.ts
10585
- function preprocess5(gltfData) {
10680
+ function preprocess7(gltfData) {
10586
10681
  const iterator = new GLTFIterator(gltfData);
10587
10682
  for (const image of iterator.images) {
10588
10683
  const extension = iterator.getExtension(image, KHR_BINARY_GLTF);
@@ -10724,7 +10819,7 @@ function convertGLTFV1Skins(json, resolveNodeId, reportUnsupported) {
10724
10819
  for (let skinIndex = 0; skinIndex < originalSkinCount; skinIndex++) {
10725
10820
  const skin = skins[skinIndex];
10726
10821
  const jointNames = skin.jointNames;
10727
- if (!Array.isArray(jointNames) || jointNames.length === 0 || jointNames.some((name20) => typeof name20 !== "string" || !name20) || new Set(jointNames).size !== jointNames.length) {
10822
+ if (!Array.isArray(jointNames) || jointNames.length === 0 || jointNames.some((name22) => typeof name22 !== "string" || !name22) || new Set(jointNames).size !== jointNames.length) {
10728
10823
  reportUnsupported(`skin ${skinIndex} has invalid joint names`);
10729
10824
  hasUnconvertedSkin = true;
10730
10825
  continue;
@@ -11308,7 +11403,7 @@ function hasOpaqueGLTFV1Consumers(json) {
11308
11403
  for (const [field, value] of Object.entries(object)) {
11309
11404
  if (field === "extras") continue;
11310
11405
  if (field === "extensions" && value && typeof value === "object" && Object.keys(value).some(
11311
- (name20) => !["KHR_materials_unlit", "KHR_materials_common"].includes(name20)
11406
+ (name22) => !["KHR_materials_unlit", "KHR_materials_common"].includes(name22)
11312
11407
  ))
11313
11408
  return true;
11314
11409
  pending.push(value);
@@ -11448,18 +11543,18 @@ function preserveLegacyFields(object, fields) {
11448
11543
  function isRecord(value) {
11449
11544
  return value !== null && typeof value === "object" && !Array.isArray(value);
11450
11545
  }
11451
- function convertGLTFV1AttributeName(name20) {
11452
- const indexed = /^(JOINTS?|WEIGHTS?|TEXCOORD|COLOR)(?:_(\d+))?$/.exec(name20);
11546
+ function convertGLTFV1AttributeName(name22) {
11547
+ const indexed = /^(JOINTS?|WEIGHTS?|TEXCOORD|COLOR)(?:_(\d+))?$/.exec(name22);
11453
11548
  if (indexed) {
11454
11549
  const semantic = indexed[1].startsWith("JOINT") ? "JOINTS" : indexed[1].startsWith("WEIGHT") ? "WEIGHTS" : indexed[1];
11455
11550
  const index = Number(indexed[2] || 0);
11456
11551
  if (!Number.isSafeInteger(index) || index > 999999999)
11457
- throw new Error(`glTF v1: invalid attribute set index ${name20}`);
11552
+ throw new Error(`glTF v1: invalid attribute set index ${name22}`);
11458
11553
  return `${semantic}_${index}`;
11459
11554
  }
11460
- if (["POSITION", "NORMAL", "TANGENT"].includes(name20) || name20.startsWith("_") || name20.includes(":"))
11461
- return name20;
11462
- return `_${name20}`;
11555
+ if (["POSITION", "NORMAL", "TANGENT"].includes(name22) || name22.startsWith("_") || name22.includes(":"))
11556
+ return name22;
11557
+ return `_${name22}`;
11463
11558
  }
11464
11559
  var init_clean_gltf_v1_fields = __esm({
11465
11560
  "../scene/src/gltf/lib/api/clean-gltf-v1-fields.ts"() {
@@ -11885,8 +11980,8 @@ function validateSkinInfluences(gltf, readAccessor, reportUnsupported) {
11885
11980
  checkedBindings.add(binding);
11886
11981
  for (const [primitiveIndex, primitive] of mesh.primitives.entries()) {
11887
11982
  const label = `mesh ${node.mesh} primitive ${primitiveIndex} skin ${node.skin}`;
11888
- const jointSets = Object.keys(primitive.attributes).filter((name20) => /^JOINTS_\d+$/.test(name20)).map((name20) => Number(name20.slice(7))).sort((first, second) => first - second);
11889
- const weightSets = Object.keys(primitive.attributes).filter((name20) => /^WEIGHTS_\d+$/.test(name20)).map((name20) => Number(name20.slice(8))).sort((first, second) => first - second);
11983
+ const jointSets = Object.keys(primitive.attributes).filter((name22) => /^JOINTS_\d+$/.test(name22)).map((name22) => Number(name22.slice(7))).sort((first, second) => first - second);
11984
+ const weightSets = Object.keys(primitive.attributes).filter((name22) => /^WEIGHTS_\d+$/.test(name22)).map((name22) => Number(name22.slice(8))).sort((first, second) => first - second);
11890
11985
  if (!jointSets.length && !weightSets.length) {
11891
11986
  reportUnsupported(`${label} requires JOINTS_0 and WEIGHTS_0 skin influences`);
11892
11987
  continue;
@@ -12337,7 +12432,7 @@ function collectExtensionNames(value) {
12337
12432
  if (!object || typeof object !== "object" || visited.has(object)) continue;
12338
12433
  visited.add(object);
12339
12434
  if (isRecord2(object) && isRecord2(object.extensions))
12340
- for (const name20 of Object.keys(object.extensions)) names.add(name20);
12435
+ for (const name22 of Object.keys(object.extensions)) names.add(name22);
12341
12436
  for (const [field, child] of Object.entries(object))
12342
12437
  if (field !== "extras") pending.push(child);
12343
12438
  }
@@ -12495,7 +12590,7 @@ var init_normalize_gltf_v1 = __esm({
12495
12590
  this._addAsset(json);
12496
12591
  this._orderBinaryBufferPayloads(gltf);
12497
12592
  this._convertTopLevelObjectsToArrays(json);
12498
- preprocess5(gltf);
12593
+ preprocess7(gltf);
12499
12594
  this._convertObjectIdsToArrayIndices(json);
12500
12595
  this._updateObjects(json);
12501
12596
  for (const [bufferIndex, buffer] of (json.buffers || []).entries())
@@ -13084,6 +13179,7 @@ function getReferencesImageIndices(gltf) {
13084
13179
  return Array.from(imageIndices).sort();
13085
13180
  }
13086
13181
  async function loadImage(gltf, image, index, options, context) {
13182
+ var _a, _b, _c;
13087
13183
  let arrayBuffer;
13088
13184
  if (image.uri && !image.hasOwnProperty("bufferView")) {
13089
13185
  const uri = resolveUrl(image.uri, options, context);
@@ -13100,6 +13196,33 @@ async function loadImage(gltf, image, index, options, context) {
13100
13196
  }
13101
13197
  assert3(arrayBuffer, "glTF image has no data");
13102
13198
  const gltfOptions = getGLTFImageOptions(options, image.mimeType);
13199
+ const ddsLoader = getDDSLoader(context);
13200
+ const ddsSelected = Boolean(
13201
+ ddsLoader && !((_b = (_a = options.gltf) == null ? void 0 : _a.excludeExtensions) == null ? void 0 : _b.includes("MSFT_texture_dds")) && ((_c = gltf.json.textures) == null ? void 0 : _c.some(
13202
+ (texture) => {
13203
+ var _a2, _b2;
13204
+ return texture.source === index && ((_b2 = (_a2 = texture.extensions) == null ? void 0 : _a2.MSFT_texture_dds) == null ? void 0 : _b2.source) === index;
13205
+ }
13206
+ ))
13207
+ );
13208
+ if (ddsSelected) {
13209
+ const levels = await parseFromContext(
13210
+ arrayBuffer,
13211
+ ddsLoader,
13212
+ options,
13213
+ context
13214
+ );
13215
+ assert3(levels.length > 0, "MSFT_texture_dds parser returned no texture levels");
13216
+ gltf.images = gltf.images || [];
13217
+ gltf.images[index] = {
13218
+ compressed: true,
13219
+ mipmaps: true,
13220
+ width: levels[0].width,
13221
+ height: levels[0].height,
13222
+ data: levels
13223
+ };
13224
+ return;
13225
+ }
13103
13226
  let parsedImage = await parseFromContext(
13104
13227
  arrayBuffer,
13105
13228
  [ImageLoader, BasisLoader],
@@ -13132,6 +13255,7 @@ var init_parse_gltf = __esm({
13132
13255
  init_resolve_gltf_file();
13133
13256
  init_get_typed_array();
13134
13257
  init_gltf_extensions();
13258
+ init_MSFT_texture_dds();
13135
13259
  init_normalize_gltf_v1();
13136
13260
  PACKAGE_URL_PREFIX = "gltf-package://";
13137
13261
  }
@@ -13749,8 +13873,8 @@ var init_format_spatial_reference = __esm({
13749
13873
  function getSpatialProjectionEngine() {
13750
13874
  return spatialProjectionEngine;
13751
13875
  }
13752
- function getGeoidModel(name20) {
13753
- return geoidModels.get(name20);
13876
+ function getGeoidModel(name22) {
13877
+ return geoidModels.get(name22);
13754
13878
  }
13755
13879
  var import_earth, import_projection, geoidModels, spatialProjectionEngine;
13756
13880
  var init_spatial_resource_registry = __esm({
@@ -14810,9 +14934,9 @@ var init_tile_3d_batch_table = __esm({
14810
14934
  this.binary = binary;
14811
14935
  this.featureCount = featureCount;
14812
14936
  this._extensions = ((_a = this.json) == null ? void 0 : _a.extensions) || {};
14813
- this._properties = {};
14814
- for (const propertyName in this.json) {
14815
- if (!IGNORED_PROPERTY_FIELDS[propertyName]) {
14937
+ this._properties = /* @__PURE__ */ Object.create(null);
14938
+ for (const propertyName of Object.keys(this.json)) {
14939
+ if (!Object.hasOwn(IGNORED_PROPERTY_FIELDS, propertyName)) {
14816
14940
  this._properties[propertyName] = this.json[propertyName];
14817
14941
  }
14818
14942
  }
@@ -14853,10 +14977,10 @@ var init_tile_3d_batch_table = __esm({
14853
14977
  }
14854
14978
  return void 0;
14855
14979
  }
14856
- hasProperty(batchId, name20) {
14980
+ hasProperty(batchId, name22) {
14857
14981
  this._checkBatchId(batchId);
14858
- assert(typeof name20 === "string", name20);
14859
- return defined2(this._properties[name20]) || this._hasPropertyInHierarchy(batchId, name20);
14982
+ assert(typeof name22 === "string", name22);
14983
+ return defined2(this._properties[name22]) || this._hasPropertyInHierarchy(batchId, name22);
14860
14984
  }
14861
14985
  getPropertyNames(batchId, results) {
14862
14986
  this._checkBatchId(batchId);
@@ -14869,47 +14993,47 @@ var init_tile_3d_batch_table = __esm({
14869
14993
  }
14870
14994
  return results;
14871
14995
  }
14872
- getProperty(batchId, name20) {
14996
+ getProperty(batchId, name22) {
14873
14997
  this._checkBatchId(batchId);
14874
- assert(typeof name20 === "string", name20);
14998
+ assert(typeof name22 === "string", name22);
14875
14999
  if (this._binaryProperties) {
14876
- const binaryProperty = this._binaryProperties[name20];
15000
+ const binaryProperty = this._binaryProperties[name22];
14877
15001
  if (defined2(binaryProperty)) {
14878
15002
  return this._getBinaryProperty(binaryProperty, batchId);
14879
15003
  }
14880
15004
  }
14881
- const propertyValues = this._properties[name20];
15005
+ const propertyValues = this._properties[name22];
14882
15006
  if (defined2(propertyValues)) {
14883
15007
  return clone(propertyValues[batchId], true);
14884
15008
  }
14885
15009
  if (this._hierarchy) {
14886
- const hierarchyProperty = this._getHierarchyProperty(batchId, name20);
15010
+ const hierarchyProperty = this._getHierarchyProperty(batchId, name22);
14887
15011
  if (defined2(hierarchyProperty)) {
14888
15012
  return hierarchyProperty;
14889
15013
  }
14890
15014
  }
14891
15015
  return void 0;
14892
15016
  }
14893
- setProperty(batchId, name20, value) {
15017
+ setProperty(batchId, name22, value) {
14894
15018
  const featureCount = this.featureCount;
14895
15019
  this._checkBatchId(batchId);
14896
- assert(typeof name20 === "string", name20);
15020
+ assert(typeof name22 === "string", name22);
14897
15021
  if (this._binaryProperties) {
14898
- const binaryProperty = this._binaryProperties[name20];
15022
+ const binaryProperty = this._binaryProperties[name22];
14899
15023
  if (binaryProperty) {
14900
15024
  this._setBinaryProperty(binaryProperty, batchId, value);
14901
15025
  return;
14902
15026
  }
14903
15027
  }
14904
15028
  if (this._hierarchy) {
14905
- if (this._setHierarchyProperty(this, batchId, name20, value)) {
15029
+ if (this._setHierarchyProperty(this, batchId, name22, value)) {
14906
15030
  return;
14907
15031
  }
14908
15032
  }
14909
- let propertyValues = this._properties[name20];
15033
+ let propertyValues = this._properties[name22];
14910
15034
  if (!defined2(propertyValues)) {
14911
- this._properties[name20] = new Array(featureCount);
14912
- propertyValues = this._properties[name20];
15035
+ this._properties[name22] = new Array(featureCount);
15036
+ propertyValues = this._properties[name22];
14913
15037
  }
14914
15038
  propertyValues[batchId] = clone(value, true);
14915
15039
  }
@@ -14928,21 +15052,21 @@ var init_tile_3d_batch_table = __esm({
14928
15052
  }
14929
15053
  _initializeBinaryProperties() {
14930
15054
  let binaryProperties = null;
14931
- for (const name20 in this._properties) {
14932
- const property = this._properties[name20];
14933
- const binaryProperty = this._initializeBinaryProperty(name20, property);
15055
+ for (const name22 in this._properties) {
15056
+ const property = this._properties[name22];
15057
+ const binaryProperty = this._initializeBinaryProperty(name22, property);
14934
15058
  if (binaryProperty) {
14935
- binaryProperties = binaryProperties || {};
14936
- binaryProperties[name20] = binaryProperty;
15059
+ binaryProperties ??= /* @__PURE__ */ Object.create(null);
15060
+ binaryProperties[name22] = binaryProperty;
14937
15061
  }
14938
15062
  }
14939
15063
  return binaryProperties;
14940
15064
  }
14941
- _initializeBinaryProperty(name20, property) {
15065
+ _initializeBinaryProperty(name22, property) {
14942
15066
  if ("byteOffset" in property) {
14943
15067
  const tile3DAccessor = property;
14944
- assert(this.binary, `Property ${name20} requires a batch table binary.`);
14945
- assert(tile3DAccessor.type, `Property ${name20} requires a type.`);
15068
+ assert(this.binary, `Property ${name22} requires a batch table binary.`);
15069
+ assert(tile3DAccessor.type, `Property ${name22} requires a type.`);
14946
15070
  const accessor = createTypedArrayFromAccessor(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
14947
15071
  return {
14948
15072
  typedArray: accessor.values,
@@ -14954,14 +15078,14 @@ var init_tile_3d_batch_table = __esm({
14954
15078
  return null;
14955
15079
  }
14956
15080
  // EXTENSION SUPPORT: 3DTILES_batch_table_hierarchy
14957
- _hasPropertyInHierarchy(batchId, name20) {
15081
+ _hasPropertyInHierarchy(batchId, name22) {
14958
15082
  if (!this._hierarchy) {
14959
15083
  return false;
14960
15084
  }
14961
15085
  const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
14962
15086
  const classId = hierarchy.classIds[instanceIndex];
14963
15087
  const instances = hierarchy.classes[classId].instances;
14964
- return defined2(instances[name20]) ? true : void 0;
15088
+ return Object.hasOwn(instances, name22) && defined2(instances[name22]) ? true : void 0;
14965
15089
  });
14966
15090
  return defined2(result);
14967
15091
  }
@@ -14969,21 +15093,21 @@ var init_tile_3d_batch_table = __esm({
14969
15093
  traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
14970
15094
  const classId = hierarchy.classIds[instanceIndex];
14971
15095
  const instances = hierarchy.classes[classId].instances;
14972
- for (const name20 in instances) {
14973
- if (instances.hasOwnProperty(name20)) {
14974
- if (results.indexOf(name20) === -1) {
14975
- results.push(name20);
15096
+ for (const name22 in instances) {
15097
+ if (Object.hasOwn(instances, name22)) {
15098
+ if (results.indexOf(name22) === -1) {
15099
+ results.push(name22);
14976
15100
  }
14977
15101
  }
14978
15102
  }
14979
15103
  });
14980
15104
  }
14981
- _getHierarchyProperty(batchId, name20) {
15105
+ _getHierarchyProperty(batchId, name22) {
14982
15106
  return traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
14983
15107
  const classId = hierarchy.classIds[instanceIndex];
14984
15108
  const instanceClass = hierarchy.classes[classId];
14985
15109
  const indexInClass = hierarchy.classIndexes[instanceIndex];
14986
- const propertyValues = instanceClass.instances[name20];
15110
+ const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
14987
15111
  if (defined2(propertyValues)) {
14988
15112
  if (defined2(propertyValues.typedArray)) {
14989
15113
  return this._getBinaryProperty(propertyValues, indexInClass);
@@ -14993,14 +15117,14 @@ var init_tile_3d_batch_table = __esm({
14993
15117
  return void 0;
14994
15118
  });
14995
15119
  }
14996
- _setHierarchyProperty(batchTable, batchId, name20, value) {
15120
+ _setHierarchyProperty(batchTable, batchId, name22, value) {
14997
15121
  const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
14998
15122
  const classId = hierarchy.classIds[instanceIndex];
14999
15123
  const instanceClass = hierarchy.classes[classId];
15000
15124
  const indexInClass = hierarchy.classIndexes[instanceIndex];
15001
- const propertyValues = instanceClass.instances[name20];
15125
+ const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
15002
15126
  if (defined2(propertyValues)) {
15003
- assert(instanceIndex === batchId, `Inherited property "${name20}" is read-only.`);
15127
+ assert(instanceIndex === batchId, `Inherited property "${name22}" is read-only.`);
15004
15128
  if (defined2(propertyValues.typedArray)) {
15005
15129
  this._setBinaryProperty(propertyValues, indexInClass, value);
15006
15130
  } else {
@@ -16250,7 +16374,7 @@ var VERSION5;
16250
16374
  var init_version5 = __esm({
16251
16375
  "dist/3d-tiles/lib/utils/version.js"() {
16252
16376
  "use strict";
16253
- VERSION5 = true ? "5.0.0-beta.2" : "latest";
16377
+ VERSION5 = true ? "5.0.0-beta.4" : "latest";
16254
16378
  }
16255
16379
  });
16256
16380
 
@@ -18171,9 +18295,9 @@ var init_tile_3d_batch_table2 = __esm({
18171
18295
  this.binary = binary;
18172
18296
  this.featureCount = featureCount;
18173
18297
  this._extensions = ((_a = this.json) == null ? void 0 : _a.extensions) || {};
18174
- this._properties = {};
18175
- for (const propertyName in this.json) {
18176
- if (!IGNORED_PROPERTY_FIELDS2[propertyName]) {
18298
+ this._properties = /* @__PURE__ */ Object.create(null);
18299
+ for (const propertyName of Object.keys(this.json)) {
18300
+ if (!Object.hasOwn(IGNORED_PROPERTY_FIELDS2, propertyName)) {
18177
18301
  this._properties[propertyName] = this.json[propertyName];
18178
18302
  }
18179
18303
  }
@@ -18214,10 +18338,10 @@ var init_tile_3d_batch_table2 = __esm({
18214
18338
  }
18215
18339
  return void 0;
18216
18340
  }
18217
- hasProperty(batchId, name20) {
18341
+ hasProperty(batchId, name22) {
18218
18342
  this._checkBatchId(batchId);
18219
- assert(typeof name20 === "string", name20);
18220
- return defined4(this._properties[name20]) || this._hasPropertyInHierarchy(batchId, name20);
18343
+ assert(typeof name22 === "string", name22);
18344
+ return defined4(this._properties[name22]) || this._hasPropertyInHierarchy(batchId, name22);
18221
18345
  }
18222
18346
  getPropertyNames(batchId, results) {
18223
18347
  this._checkBatchId(batchId);
@@ -18230,47 +18354,47 @@ var init_tile_3d_batch_table2 = __esm({
18230
18354
  }
18231
18355
  return results;
18232
18356
  }
18233
- getProperty(batchId, name20) {
18357
+ getProperty(batchId, name22) {
18234
18358
  this._checkBatchId(batchId);
18235
- assert(typeof name20 === "string", name20);
18359
+ assert(typeof name22 === "string", name22);
18236
18360
  if (this._binaryProperties) {
18237
- const binaryProperty = this._binaryProperties[name20];
18361
+ const binaryProperty = this._binaryProperties[name22];
18238
18362
  if (defined4(binaryProperty)) {
18239
18363
  return this._getBinaryProperty(binaryProperty, batchId);
18240
18364
  }
18241
18365
  }
18242
- const propertyValues = this._properties[name20];
18366
+ const propertyValues = this._properties[name22];
18243
18367
  if (defined4(propertyValues)) {
18244
18368
  return clone2(propertyValues[batchId], true);
18245
18369
  }
18246
18370
  if (this._hierarchy) {
18247
- const hierarchyProperty = this._getHierarchyProperty(batchId, name20);
18371
+ const hierarchyProperty = this._getHierarchyProperty(batchId, name22);
18248
18372
  if (defined4(hierarchyProperty)) {
18249
18373
  return hierarchyProperty;
18250
18374
  }
18251
18375
  }
18252
18376
  return void 0;
18253
18377
  }
18254
- setProperty(batchId, name20, value) {
18378
+ setProperty(batchId, name22, value) {
18255
18379
  const featureCount = this.featureCount;
18256
18380
  this._checkBatchId(batchId);
18257
- assert(typeof name20 === "string", name20);
18381
+ assert(typeof name22 === "string", name22);
18258
18382
  if (this._binaryProperties) {
18259
- const binaryProperty = this._binaryProperties[name20];
18383
+ const binaryProperty = this._binaryProperties[name22];
18260
18384
  if (binaryProperty) {
18261
18385
  this._setBinaryProperty(binaryProperty, batchId, value);
18262
18386
  return;
18263
18387
  }
18264
18388
  }
18265
18389
  if (this._hierarchy) {
18266
- if (this._setHierarchyProperty(this, batchId, name20, value)) {
18390
+ if (this._setHierarchyProperty(this, batchId, name22, value)) {
18267
18391
  return;
18268
18392
  }
18269
18393
  }
18270
- let propertyValues = this._properties[name20];
18394
+ let propertyValues = this._properties[name22];
18271
18395
  if (!defined4(propertyValues)) {
18272
- this._properties[name20] = new Array(featureCount);
18273
- propertyValues = this._properties[name20];
18396
+ this._properties[name22] = new Array(featureCount);
18397
+ propertyValues = this._properties[name22];
18274
18398
  }
18275
18399
  propertyValues[batchId] = clone2(value, true);
18276
18400
  }
@@ -18289,21 +18413,21 @@ var init_tile_3d_batch_table2 = __esm({
18289
18413
  }
18290
18414
  _initializeBinaryProperties() {
18291
18415
  let binaryProperties = null;
18292
- for (const name20 in this._properties) {
18293
- const property = this._properties[name20];
18294
- const binaryProperty = this._initializeBinaryProperty(name20, property);
18416
+ for (const name22 in this._properties) {
18417
+ const property = this._properties[name22];
18418
+ const binaryProperty = this._initializeBinaryProperty(name22, property);
18295
18419
  if (binaryProperty) {
18296
- binaryProperties = binaryProperties || {};
18297
- binaryProperties[name20] = binaryProperty;
18420
+ binaryProperties ??= /* @__PURE__ */ Object.create(null);
18421
+ binaryProperties[name22] = binaryProperty;
18298
18422
  }
18299
18423
  }
18300
18424
  return binaryProperties;
18301
18425
  }
18302
- _initializeBinaryProperty(name20, property) {
18426
+ _initializeBinaryProperty(name22, property) {
18303
18427
  if ("byteOffset" in property) {
18304
18428
  const tile3DAccessor = property;
18305
- assert(this.binary, `Property ${name20} requires a batch table binary.`);
18306
- assert(tile3DAccessor.type, `Property ${name20} requires a type.`);
18429
+ assert(this.binary, `Property ${name22} requires a batch table binary.`);
18430
+ assert(tile3DAccessor.type, `Property ${name22} requires a type.`);
18307
18431
  const accessor = createTypedArrayFromAccessor2(
18308
18432
  tile3DAccessor,
18309
18433
  this.binary.buffer,
@@ -18320,14 +18444,14 @@ var init_tile_3d_batch_table2 = __esm({
18320
18444
  return null;
18321
18445
  }
18322
18446
  // EXTENSION SUPPORT: 3DTILES_batch_table_hierarchy
18323
- _hasPropertyInHierarchy(batchId, name20) {
18447
+ _hasPropertyInHierarchy(batchId, name22) {
18324
18448
  if (!this._hierarchy) {
18325
18449
  return false;
18326
18450
  }
18327
18451
  const result = traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
18328
18452
  const classId = hierarchy.classIds[instanceIndex];
18329
18453
  const instances = hierarchy.classes[classId].instances;
18330
- return defined4(instances[name20]) ? true : void 0;
18454
+ return Object.hasOwn(instances, name22) && defined4(instances[name22]) ? true : void 0;
18331
18455
  });
18332
18456
  return defined4(result);
18333
18457
  }
@@ -18335,21 +18459,21 @@ var init_tile_3d_batch_table2 = __esm({
18335
18459
  traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
18336
18460
  const classId = hierarchy.classIds[instanceIndex];
18337
18461
  const instances = hierarchy.classes[classId].instances;
18338
- for (const name20 in instances) {
18339
- if (instances.hasOwnProperty(name20)) {
18340
- if (results.indexOf(name20) === -1) {
18341
- results.push(name20);
18462
+ for (const name22 in instances) {
18463
+ if (Object.hasOwn(instances, name22)) {
18464
+ if (results.indexOf(name22) === -1) {
18465
+ results.push(name22);
18342
18466
  }
18343
18467
  }
18344
18468
  }
18345
18469
  });
18346
18470
  }
18347
- _getHierarchyProperty(batchId, name20) {
18471
+ _getHierarchyProperty(batchId, name22) {
18348
18472
  return traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
18349
18473
  const classId = hierarchy.classIds[instanceIndex];
18350
18474
  const instanceClass = hierarchy.classes[classId];
18351
18475
  const indexInClass = hierarchy.classIndexes[instanceIndex];
18352
- const propertyValues = instanceClass.instances[name20];
18476
+ const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
18353
18477
  if (defined4(propertyValues)) {
18354
18478
  if (defined4(propertyValues.typedArray)) {
18355
18479
  return this._getBinaryProperty(propertyValues, indexInClass);
@@ -18359,14 +18483,14 @@ var init_tile_3d_batch_table2 = __esm({
18359
18483
  return void 0;
18360
18484
  });
18361
18485
  }
18362
- _setHierarchyProperty(batchTable, batchId, name20, value) {
18486
+ _setHierarchyProperty(batchTable, batchId, name22, value) {
18363
18487
  const result = traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
18364
18488
  const classId = hierarchy.classIds[instanceIndex];
18365
18489
  const instanceClass = hierarchy.classes[classId];
18366
18490
  const indexInClass = hierarchy.classIndexes[instanceIndex];
18367
- const propertyValues = instanceClass.instances[name20];
18491
+ const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
18368
18492
  if (defined4(propertyValues)) {
18369
- assert(instanceIndex === batchId, `Inherited property "${name20}" is read-only.`);
18493
+ assert(instanceIndex === batchId, `Inherited property "${name22}" is read-only.`);
18370
18494
  if (defined4(propertyValues.typedArray)) {
18371
18495
  this._setBinaryProperty(propertyValues, indexInClass, value);
18372
18496
  } else {