@cesium/engine 26.3.0 → 26.3.1-wasm.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.
Files changed (143) hide show
  1. package/Build/ThirdParty/Workers/zip-web-worker.js +504 -535
  2. package/Build/Workers/chunk-2P3WKV6V.js +290 -0
  3. package/Build/Workers/{chunk-MUW4DJV7.js → chunk-2U5272QU.js} +17 -17
  4. package/Build/Workers/{chunk-7WXBTNRV.js → chunk-4KCOC6OZ.js} +8 -10
  5. package/Build/Workers/{chunk-GS7RY2DH.js → chunk-5FULJNWY.js} +11 -13
  6. package/Build/Workers/{chunk-2PWVICP6.js → chunk-65ZF23AQ.js} +1 -1
  7. package/Build/Workers/{chunk-SEJIXZZ4.js → chunk-6D5534B7.js} +10 -12
  8. package/Build/Workers/{chunk-MDDKCLMF.js → chunk-6GFMBHBD.js} +19 -19
  9. package/Build/Workers/{chunk-PKZA44LH.js → chunk-6VRGQF3D.js} +4 -4
  10. package/Build/Workers/{chunk-JBJ6BRIM.js → chunk-6XUIECFB.js} +4 -6
  11. package/Build/Workers/{chunk-DKSANM4A.js → chunk-7KWUH6RK.js} +14 -14
  12. package/Build/Workers/{chunk-6BSNYZZG.js → chunk-7ZBJRQQT.js} +7 -7
  13. package/Build/Workers/{chunk-XRZCS3HE.js → chunk-AEHANE5A.js} +991 -5612
  14. package/Build/Workers/chunk-AUU74SIZ.js +2420 -0
  15. package/Build/Workers/{chunk-2YY724ZX.js → chunk-B6V5NMIE.js} +13 -11
  16. package/Build/Workers/{chunk-5JCZHJUU.js → chunk-BRQ52ASU.js} +15 -17
  17. package/Build/Workers/{chunk-Z2DW5NM2.js → chunk-FVLSQBPH.js} +7 -14
  18. package/Build/Workers/{chunk-L73K5UPP.js → chunk-IFKM2GZR.js} +12 -12
  19. package/Build/Workers/{chunk-F34TJJLA.js → chunk-KF6OEWVT.js} +17 -17
  20. package/Build/Workers/{chunk-JL4NWWQY.js → chunk-KOAXSU77.js} +5 -7
  21. package/Build/Workers/{chunk-CKK6CUXK.js → chunk-KRVYCMGN.js} +6 -6
  22. package/Build/Workers/{chunk-KBGAHN5R.js → chunk-LTZRLNQP.js} +1 -1
  23. package/Build/Workers/{chunk-CQ4TZXAT.js → chunk-M7WEAGWT.js} +8 -8
  24. package/Build/Workers/{chunk-A7SMPV6B.js → chunk-MJTLGN63.js} +14 -14
  25. package/Build/Workers/{chunk-DZK34ZVD.js → chunk-MUNZ77KV.js} +1 -1
  26. package/Build/Workers/{chunk-X27HKF5E.js → chunk-NC5BUJEF.js} +2 -2
  27. package/Build/Workers/chunk-NYKURYFR.js +2131 -0
  28. package/Build/Workers/{chunk-5KG7KDDW.js → chunk-NZAQG57U.js} +7 -7
  29. package/Build/Workers/{chunk-JKTWW7IO.js → chunk-O5GUOP2G.js} +5 -7
  30. package/Build/Workers/{chunk-6R6SGKYN.js → chunk-OQUOLQTN.js} +8 -10
  31. package/Build/Workers/chunk-OUG5JB2K.js +46 -0
  32. package/Build/Workers/{chunk-HDD3RFLT.js → chunk-P4SDLSGF.js} +13 -6
  33. package/Build/Workers/{chunk-M6W46OAP.js → chunk-P6PC2OIM.js} +7 -7
  34. package/Build/Workers/{chunk-XSIUYAT6.js → chunk-PPRK3XQU.js} +31 -35
  35. package/Build/Workers/{chunk-4LRFYRBX.js → chunk-QGTYLWOT.js} +2 -2
  36. package/Build/Workers/{chunk-COKOYTRS.js → chunk-QHTLIQUH.js} +5 -7
  37. package/Build/Workers/{chunk-N5YK44FS.js → chunk-ROHWZQZ5.js} +5 -5
  38. package/Build/Workers/{chunk-XBY3354M.js → chunk-SNUWISJO.js} +6 -8
  39. package/Build/Workers/{chunk-EDETO6NY.js → chunk-T67YY3KP.js} +4 -2
  40. package/Build/Workers/{chunk-4DMAXPKB.js → chunk-TF5473GK.js} +13 -13
  41. package/Build/Workers/{chunk-B7Q2WF6Q.js → chunk-THHFTMAL.js} +4 -6
  42. package/Build/Workers/{chunk-SL2HCFYW.js → chunk-UFCZ62WM.js} +15 -13
  43. package/Build/Workers/{chunk-NZQUP52G.js → chunk-UV2YC2Q5.js} +11 -11
  44. package/Build/Workers/{chunk-E7G32DWL.js → chunk-V4ICCWYA.js} +1 -1
  45. package/Build/Workers/{chunk-75BC2IHI.js → chunk-VC6XXI2Z.js} +9 -9
  46. package/Build/Workers/{chunk-JMUUAW4X.js → chunk-VXJ6P4UI.js} +10 -10
  47. package/Build/Workers/{chunk-QTAEVUED.js → chunk-W2BKP7G7.js} +15 -17
  48. package/Build/Workers/{chunk-VRECSMG3.js → chunk-WMVGNBSH.js} +2 -2
  49. package/Build/Workers/{chunk-7SESBH2I.js → chunk-XFZMQZSZ.js} +4 -4
  50. package/Build/Workers/{chunk-Q2JS5LCB.js → chunk-XJ532R6R.js} +20 -20
  51. package/Build/Workers/{chunk-SLHK3KAR.js → chunk-YJNU4SM4.js} +5 -5
  52. package/Build/Workers/{chunk-LL2SGJYH.js → chunk-YJRDTEHQ.js} +8 -8
  53. package/Build/Workers/chunk-YUICDZKO.js +2660 -0
  54. package/Build/Workers/{chunk-ATSXKJ3L.js → chunk-Z3DEVGJV.js} +7 -7
  55. package/Build/Workers/{chunk-6V2KDEHL.js → chunk-ZECGI7UZ.js} +4 -4
  56. package/Build/Workers/{chunk-LYJUL4XQ.js → chunk-ZFLPVPUJ.js} +6 -8
  57. package/Build/Workers/{chunk-BNDSDQ7D.js → chunk-ZIM5H2DB.js} +11 -11
  58. package/Build/Workers/{chunk-KEWK6VZL.js → chunk-ZSQMGGSB.js} +14 -16
  59. package/Build/Workers/{chunk-2DKJSPYF.js → chunk-ZWYRGMBK.js} +16 -18
  60. package/Build/Workers/{chunk-UZY5XRL2.js → chunk-ZY733NZA.js} +1 -1
  61. package/Build/Workers/combineGeometry.js +24 -24
  62. package/Build/Workers/createBoxGeometry.js +18 -18
  63. package/Build/Workers/createBoxOutlineGeometry.js +20 -19
  64. package/Build/Workers/createCircleGeometry.js +28 -27
  65. package/Build/Workers/createCircleOutlineGeometry.js +21 -20
  66. package/Build/Workers/createCoplanarPolygonGeometry.js +34 -34
  67. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -32
  68. package/Build/Workers/createCorridorGeometry.js +31 -31
  69. package/Build/Workers/createCorridorOutlineGeometry.js +30 -30
  70. package/Build/Workers/createCylinderGeometry.js +20 -20
  71. package/Build/Workers/createCylinderOutlineGeometry.js +22 -21
  72. package/Build/Workers/createEllipseGeometry.js +26 -26
  73. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  74. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  75. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  76. package/Build/Workers/createFrustumGeometry.js +18 -18
  77. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  78. package/Build/Workers/createGeometry.js +27 -26
  79. package/Build/Workers/createGroundPolylineGeometry.js +27 -26
  80. package/Build/Workers/createPlaneGeometry.js +18 -17
  81. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  82. package/Build/Workers/createPolygonGeometry.js +35 -35
  83. package/Build/Workers/createPolygonOutlineGeometry.js +34 -34
  84. package/Build/Workers/createPolylineGeometry.js +28 -29
  85. package/Build/Workers/createPolylineVolumeGeometry.js +34 -35
  86. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +30 -31
  87. package/Build/Workers/createRectangleGeometry.js +30 -30
  88. package/Build/Workers/createRectangleOutlineGeometry.js +23 -24
  89. package/Build/Workers/createSimplePolylineGeometry.js +26 -27
  90. package/Build/Workers/createSphereGeometry.js +19 -19
  91. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  92. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  93. package/Build/Workers/createVectorTileClampedPolylines.js +17 -16
  94. package/Build/Workers/createVectorTileGeometries.js +24 -24
  95. package/Build/Workers/createVectorTilePoints.js +13 -13
  96. package/Build/Workers/createVectorTilePolygons.js +22 -22
  97. package/Build/Workers/createVectorTilePolylines.js +17 -16
  98. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +36 -26
  99. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +24 -24
  100. package/Build/Workers/createVerticesFromHeightmap.js +24 -25
  101. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  102. package/Build/Workers/createWallGeometry.js +27 -28
  103. package/Build/Workers/createWallOutlineGeometry.js +26 -27
  104. package/Build/Workers/decodeDraco.js +16 -12
  105. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +336 -337
  106. package/Build/Workers/decodeI3S.js +17 -12
  107. package/Build/Workers/{chunk-GLHDTTTO.js → decodeMeshopt.js} +23 -29
  108. package/Build/Workers/decodeSpz.js +1960 -0
  109. package/Build/Workers/gaussianSplatSorter.js +13 -6
  110. package/Build/Workers/gaussianSplatTextureGenerator.js +13 -6
  111. package/Build/Workers/incrementallyBuildTerrainPicker.js +9 -10
  112. package/Build/Workers/transcodeKTX2.js +26 -12
  113. package/Build/Workers/transferTypedArrayTest.js +1 -1
  114. package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -24
  115. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  116. package/Source/Core/Cesium3DTilesTerrainData.js +11 -1
  117. package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +33 -23
  118. package/Source/Core/KTX2Transcoder.js +99 -5
  119. package/Source/Core/Resource.js +2 -0
  120. package/Source/Core/TaskProcessor.js +249 -129
  121. package/Source/Core/TrustedServers.js +34 -1
  122. package/Source/Core/WebAssemblyWorkerInitializer.js +125 -0
  123. package/Source/Core/fetchWebAssemblyBinary.js +52 -0
  124. package/Source/Scene/GaussianSplatPrimitive.js +153 -66
  125. package/Source/Scene/GltfBufferViewLoader.js +25 -13
  126. package/Source/Scene/GltfSpzLoader.js +5 -4
  127. package/Source/Scene/SpzDecoder.js +106 -0
  128. package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
  129. package/Source/ThirdParty/zip-module.wasm +0 -0
  130. package/Source/Workers/createTaskProcessorWorker.js +2 -0
  131. package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +13 -1
  132. package/Source/Workers/decodeDraco.js +7 -3
  133. package/Source/Workers/decodeI3S.js +7 -3
  134. package/Source/Workers/decodeMeshopt.js +21 -0
  135. package/Source/Workers/decodeSpz.js +20 -0
  136. package/Source/Workers/gaussianSplatSorter.js +7 -3
  137. package/Source/Workers/gaussianSplatTextureGenerator.js +7 -3
  138. package/Source/Workers/transcodeKTX2.js +22 -5
  139. package/index.d.ts +93 -0
  140. package/index.js +4 -1
  141. package/package.json +1 -1
  142. package/Build/Workers/chunk-B4AVL7VI.js +0 -82
  143. package/Build/Workers/chunk-HDPNFEPP.js +0 -3820
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.145.0
4
+ * Version 1.145.1-wasm.0
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -26,19 +26,26 @@
26
26
  import {
27
27
  initSync,
28
28
  radix_sort_gaussians_indexes
29
- } from "./chunk-DZK34ZVD.js";
29
+ } from "./chunk-MUNZ77KV.js";
30
+ import {
31
+ fetchWebAssemblyBinary_default
32
+ } from "./chunk-OUG5JB2K.js";
30
33
  import {
31
34
  createTaskProcessorWorker_default
32
- } from "./chunk-EDETO6NY.js";
35
+ } from "./chunk-T67YY3KP.js";
36
+ import "./chunk-NYKURYFR.js";
37
+ import "./chunk-P4SDLSGF.js";
38
+ import "./chunk-PPRK3XQU.js";
33
39
  import {
34
40
  defined_default
35
- } from "./chunk-B4AVL7VI.js";
41
+ } from "./chunk-YUICDZKO.js";
36
42
 
37
43
  // packages/engine/Source/Workers/gaussianSplatSorter.js
38
44
  async function initWorker(parameters, transferableObjects) {
39
45
  const wasmConfig = parameters.webAssemblyConfig;
40
- if (defined_default(wasmConfig) && defined_default(wasmConfig.wasmBinary)) {
41
- initSync({ module: wasmConfig.wasmBinary });
46
+ const wasmBinary = await fetchWebAssemblyBinary_default(wasmConfig) ?? wasmConfig.wasmBinary;
47
+ if (defined_default(wasmBinary)) {
48
+ initSync({ module: wasmBinary });
42
49
  return true;
43
50
  }
44
51
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.145.0
4
+ * Version 1.145.1-wasm.0
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -26,19 +26,26 @@
26
26
  import {
27
27
  generate_splat_texture,
28
28
  initSync
29
- } from "./chunk-DZK34ZVD.js";
29
+ } from "./chunk-MUNZ77KV.js";
30
+ import {
31
+ fetchWebAssemblyBinary_default
32
+ } from "./chunk-OUG5JB2K.js";
30
33
  import {
31
34
  createTaskProcessorWorker_default
32
- } from "./chunk-EDETO6NY.js";
35
+ } from "./chunk-T67YY3KP.js";
36
+ import "./chunk-NYKURYFR.js";
37
+ import "./chunk-P4SDLSGF.js";
38
+ import "./chunk-PPRK3XQU.js";
33
39
  import {
34
40
  defined_default
35
- } from "./chunk-B4AVL7VI.js";
41
+ } from "./chunk-YUICDZKO.js";
36
42
 
37
43
  // packages/engine/Source/Workers/gaussianSplatTextureGenerator.js
38
44
  async function initWorker(parameters, transferableObjects) {
39
45
  const wasmConfig = parameters.webAssemblyConfig;
40
- if (defined_default(wasmConfig) && defined_default(wasmConfig.wasmBinary)) {
41
- initSync({ module: wasmConfig.wasmBinary });
46
+ const wasmBinary = await fetchWebAssemblyBinary_default(wasmConfig) ?? wasmConfig.wasmBinary;
47
+ if (defined_default(wasmBinary)) {
48
+ initSync({ module: wasmBinary });
42
49
  return true;
43
50
  }
44
51
  return false;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.145.0
4
+ * Version 1.145.1-wasm.0
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -25,21 +25,20 @@
25
25
 
26
26
  import {
27
27
  createTaskProcessorWorker_default
28
- } from "./chunk-EDETO6NY.js";
28
+ } from "./chunk-T67YY3KP.js";
29
29
  import {
30
30
  AxisAlignedBoundingBox_default
31
- } from "./chunk-N5YK44FS.js";
32
- import "./chunk-UZY5XRL2.js";
31
+ } from "./chunk-ROHWZQZ5.js";
32
+ import "./chunk-ZY733NZA.js";
33
33
  import {
34
34
  Matrix4_default
35
- } from "./chunk-6R6SGKYN.js";
36
- import "./chunk-GLHDTTTO.js";
35
+ } from "./chunk-OQUOLQTN.js";
37
36
  import {
38
37
  Cartesian3_default
39
- } from "./chunk-Z2DW5NM2.js";
40
- import "./chunk-HDD3RFLT.js";
41
- import "./chunk-XSIUYAT6.js";
42
- import "./chunk-B4AVL7VI.js";
38
+ } from "./chunk-FVLSQBPH.js";
39
+ import "./chunk-P4SDLSGF.js";
40
+ import "./chunk-PPRK3XQU.js";
41
+ import "./chunk-YUICDZKO.js";
43
42
 
44
43
  // packages/engine/Source/Workers/incrementallyBuildTerrainPicker.js
45
44
  var scratchAABBCornerMin = new Cartesian3_default();
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.145.0
4
+ * Version 1.145.1-wasm.0
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -23,24 +23,27 @@
23
23
  * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
24
  */
25
25
 
26
+ import {
27
+ fetchWebAssemblyBinary_default
28
+ } from "./chunk-OUG5JB2K.js";
26
29
  import {
27
30
  createTaskProcessorWorker_default
28
- } from "./chunk-EDETO6NY.js";
31
+ } from "./chunk-T67YY3KP.js";
29
32
  import {
30
33
  WebGLConstants_default
31
- } from "./chunk-E7G32DWL.js";
34
+ } from "./chunk-V4ICCWYA.js";
35
+ import "./chunk-NYKURYFR.js";
36
+ import "./chunk-P4SDLSGF.js";
32
37
  import {
38
+ Check_default,
33
39
  RuntimeError_default
34
- } from "./chunk-GLHDTTTO.js";
35
- import {
36
- Check_default
37
- } from "./chunk-XSIUYAT6.js";
40
+ } from "./chunk-PPRK3XQU.js";
38
41
  import {
39
42
  __commonJS,
40
43
  __require,
41
44
  __toESM,
42
45
  defined_default
43
- } from "./chunk-B4AVL7VI.js";
46
+ } from "./chunk-YUICDZKO.js";
44
47
 
45
48
  // packages/engine/Source/ThirdParty/Workers/basis_transcoder.js
46
49
  var require_basis_transcoder = __commonJS({
@@ -3444,11 +3447,22 @@ function transcodeCompressed(data, header, supportedTargetFormats, transcoderMod
3444
3447
  }
3445
3448
  async function initWorker(parameters, transferableObjects) {
3446
3449
  const wasmConfig = parameters.webAssemblyConfig;
3447
- const basisTranscoder = import_basis_transcoder.default ?? self.BASIS;
3448
- if (defined_default(wasmConfig.wasmBinaryFile)) {
3449
- transcoderModule = await basisTranscoder(wasmConfig);
3450
+ let createBasisModule = import_basis_transcoder.default ?? self.BASIS;
3451
+ if (defined_default(wasmConfig.modulePath)) {
3452
+ const wrapperModule = await import(wasmConfig.modulePath);
3453
+ createBasisModule = wrapperModule.default;
3454
+ }
3455
+ if (typeof createBasisModule !== "function") {
3456
+ throw new RuntimeError_default(
3457
+ "The Basis wrapper must have a default export that is a module factory."
3458
+ );
3459
+ }
3460
+ const wasmBinary = await fetchWebAssemblyBinary_default(wasmConfig) ?? wasmConfig.wasmBinary;
3461
+ if (defined_default(wasmBinary)) {
3462
+ const moduleOptions = { wasmBinary };
3463
+ transcoderModule = await createBasisModule(moduleOptions);
3450
3464
  } else {
3451
- transcoderModule = await basisTranscoder();
3465
+ transcoderModule = await createBasisModule();
3452
3466
  }
3453
3467
  transcoderModule.initializeBasis();
3454
3468
  return true;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.145.0
4
+ * Version 1.145.1-wasm.0
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.145.0
4
+ * Version 1.145.1-wasm.0
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -26,52 +26,52 @@
26
26
  import {
27
27
  EllipsoidalOccluder_default,
28
28
  TerrainEncoding_default
29
- } from "./chunk-4DMAXPKB.js";
29
+ } from "./chunk-TF5473GK.js";
30
30
  import {
31
31
  createTaskProcessorWorker_default
32
- } from "./chunk-EDETO6NY.js";
32
+ } from "./chunk-T67YY3KP.js";
33
33
  import {
34
34
  OrientedBoundingBox_default
35
- } from "./chunk-A7SMPV6B.js";
35
+ } from "./chunk-MJTLGN63.js";
36
36
  import {
37
37
  AttributeCompression_default
38
- } from "./chunk-NZQUP52G.js";
39
- import "./chunk-L73K5UPP.js";
40
- import "./chunk-N5YK44FS.js";
41
- import "./chunk-75BC2IHI.js";
42
- import "./chunk-LL2SGJYH.js";
38
+ } from "./chunk-UV2YC2Q5.js";
39
+ import "./chunk-IFKM2GZR.js";
40
+ import "./chunk-ROHWZQZ5.js";
41
+ import "./chunk-VC6XXI2Z.js";
42
+ import "./chunk-YJRDTEHQ.js";
43
43
  import {
44
44
  IndexDatatype_default
45
- } from "./chunk-JKTWW7IO.js";
45
+ } from "./chunk-O5GUOP2G.js";
46
46
  import {
47
47
  BoundingSphere_default
48
- } from "./chunk-BNDSDQ7D.js";
49
- import "./chunk-UZY5XRL2.js";
48
+ } from "./chunk-ZIM5H2DB.js";
49
+ import "./chunk-ZY733NZA.js";
50
50
  import {
51
51
  Rectangle_default
52
- } from "./chunk-XRZCS3HE.js";
53
- import "./chunk-6R6SGKYN.js";
54
- import "./chunk-JBJ6BRIM.js";
55
- import "./chunk-E7G32DWL.js";
56
- import "./chunk-GLHDTTTO.js";
52
+ } from "./chunk-AEHANE5A.js";
53
+ import "./chunk-OQUOLQTN.js";
54
+ import "./chunk-6XUIECFB.js";
55
+ import "./chunk-V4ICCWYA.js";
57
56
  import {
58
57
  Cartesian2_default,
59
58
  Cartographic_default,
60
59
  Ellipsoid_default
61
- } from "./chunk-6BSNYZZG.js";
60
+ } from "./chunk-7ZBJRQQT.js";
62
61
  import {
63
62
  Cartesian3_default
64
- } from "./chunk-Z2DW5NM2.js";
63
+ } from "./chunk-FVLSQBPH.js";
64
+ import "./chunk-NYKURYFR.js";
65
65
  import {
66
66
  Math_default
67
- } from "./chunk-HDD3RFLT.js";
67
+ } from "./chunk-P4SDLSGF.js";
68
68
  import {
69
- Check_default,
70
- DeveloperError_default
71
- } from "./chunk-XSIUYAT6.js";
69
+ Check_default
70
+ } from "./chunk-PPRK3XQU.js";
72
71
  import {
72
+ DeveloperError_default,
73
73
  defined_default
74
- } from "./chunk-B4AVL7VI.js";
74
+ } from "./chunk-YUICDZKO.js";
75
75
 
76
76
  // packages/engine/Source/Core/Intersections2D.js
77
77
  var Intersections2D = {};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.145.0
4
+ * Version 1.145.1-wasm.0
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -25,32 +25,32 @@
25
25
 
26
26
  import {
27
27
  Cesium3DTilesTerrainGeometryProcessor_default
28
- } from "./chunk-HDPNFEPP.js";
29
- import "./chunk-JL4NWWQY.js";
30
- import "./chunk-4DMAXPKB.js";
28
+ } from "./chunk-AUU74SIZ.js";
29
+ import "./chunk-KOAXSU77.js";
30
+ import "./chunk-TF5473GK.js";
31
31
  import {
32
32
  createTaskProcessorWorker_default
33
- } from "./chunk-EDETO6NY.js";
34
- import "./chunk-XBY3354M.js";
35
- import "./chunk-A7SMPV6B.js";
36
- import "./chunk-NZQUP52G.js";
37
- import "./chunk-L73K5UPP.js";
38
- import "./chunk-N5YK44FS.js";
39
- import "./chunk-75BC2IHI.js";
40
- import "./chunk-LL2SGJYH.js";
41
- import "./chunk-JKTWW7IO.js";
42
- import "./chunk-BNDSDQ7D.js";
43
- import "./chunk-UZY5XRL2.js";
44
- import "./chunk-XRZCS3HE.js";
45
- import "./chunk-6R6SGKYN.js";
46
- import "./chunk-JBJ6BRIM.js";
47
- import "./chunk-E7G32DWL.js";
48
- import "./chunk-GLHDTTTO.js";
49
- import "./chunk-6BSNYZZG.js";
50
- import "./chunk-Z2DW5NM2.js";
51
- import "./chunk-HDD3RFLT.js";
52
- import "./chunk-XSIUYAT6.js";
53
- import "./chunk-B4AVL7VI.js";
33
+ } from "./chunk-T67YY3KP.js";
34
+ import "./chunk-SNUWISJO.js";
35
+ import "./chunk-MJTLGN63.js";
36
+ import "./chunk-UV2YC2Q5.js";
37
+ import "./chunk-IFKM2GZR.js";
38
+ import "./chunk-ROHWZQZ5.js";
39
+ import "./chunk-VC6XXI2Z.js";
40
+ import "./chunk-YJRDTEHQ.js";
41
+ import "./chunk-O5GUOP2G.js";
42
+ import "./chunk-ZIM5H2DB.js";
43
+ import "./chunk-ZY733NZA.js";
44
+ import "./chunk-AEHANE5A.js";
45
+ import "./chunk-OQUOLQTN.js";
46
+ import "./chunk-6XUIECFB.js";
47
+ import "./chunk-V4ICCWYA.js";
48
+ import "./chunk-7ZBJRQQT.js";
49
+ import "./chunk-FVLSQBPH.js";
50
+ import "./chunk-NYKURYFR.js";
51
+ import "./chunk-P4SDLSGF.js";
52
+ import "./chunk-PPRK3XQU.js";
53
+ import "./chunk-YUICDZKO.js";
54
54
 
55
55
  // packages/engine/Source/Workers/upsampleVerticesFromCesium3DTilesTerrain.js
56
56
  function upsampleVerticesFromCesium3DTilesTerrain(options, transferableObjects) {
@@ -324,7 +324,7 @@ Cesium3DTilesTerrainData.prototype.createMesh = function (options) {
324
324
  };
325
325
 
326
326
  /**
327
- * Creates a {@link TerrainMesh} from this terrain data synchronously.
327
+ * Creates a {@link TerrainMesh} from this terrain data without task throttling.
328
328
  *
329
329
  * @private
330
330
  *
@@ -340,6 +340,16 @@ Cesium3DTilesTerrainData.prototype.createMesh = function (options) {
340
340
  Cesium3DTilesTerrainData.prototype._createMeshSync = function (options) {
341
341
  options = options ?? Frozen.EMPTY_OBJECT;
342
342
 
343
+ const hasMeshoptCompression =
344
+ this._gltf.extensionsRequired?.includes("EXT_meshopt_compression") === true;
345
+ if (hasMeshoptCompression) {
346
+ // Meshopt decoding must remain in the worker
347
+ return this.createMesh({
348
+ ...options,
349
+ throttle: false,
350
+ });
351
+ }
352
+
343
353
  //>>includeStart('debug', pragmas.debug)
344
354
  Check.typeOf.object("options.tilingScheme", options.tilingScheme);
345
355
  Check.typeOf.number("options.x", options.x);
@@ -1,4 +1,3 @@
1
- import { MeshoptDecoder } from "meshoptimizer";
2
1
  import AttributeCompression from "./AttributeCompression.js";
3
2
  import Axis from "../Scene/Axis.js";
4
3
  import AxisAlignedBoundingBox from "./AxisAlignedBoundingBox.js";
@@ -97,6 +96,7 @@ const sortedEdgeCompare = function (a, b) {
97
96
  * @property {number} skirtHeight The height of the skirts.
98
97
  * @property {number} [exaggeration=1.0] The scale used to exaggerate the terrain.
99
98
  * @property {number} [exaggerationRelativeHeight=0.0] The height relative to which terrain is exaggerated.
99
+ * @property {object} [meshoptDecoder] The meshoptimizer decoder supplied by the worker for compressed terrain.
100
100
  */
101
101
 
102
102
  /**
@@ -163,11 +163,11 @@ Cesium3DTilesTerrainGeometryProcessor.createMesh = async function (options) {
163
163
  gltf.extensionsRequired !== undefined &&
164
164
  gltf.extensionsRequired.indexOf("EXT_meshopt_compression") !== -1;
165
165
 
166
- const decoderPromise = hasMeshOptCompression
167
- ? MeshoptDecoder.ready
168
- : Promise.resolve(undefined);
169
-
170
- await decoderPromise;
166
+ //>>includeStart('debug', pragmas.debug);
167
+ if (hasMeshOptCompression) {
168
+ Check.typeOf.object("options.meshoptDecoder", options.meshoptDecoder);
169
+ }
170
+ //>>includeEnd('debug');
171
171
 
172
172
  const tileMinLongitude = rectangle.west;
173
173
  const tileMinLatitude = rectangle.south;
@@ -206,7 +206,12 @@ Cesium3DTilesTerrainGeometryProcessor.createMesh = async function (options) {
206
206
  tilesetTransform,
207
207
  );
208
208
 
209
- const gltfInfo = decodeGltf(gltf, hasVertexNormals, scratchGltfInfo);
209
+ const gltfInfo = decodeGltf(
210
+ gltf,
211
+ hasVertexNormals,
212
+ options.meshoptDecoder,
213
+ scratchGltfInfo,
214
+ );
210
215
 
211
216
  const skirtVertexCount = TerrainProvider.getSkirtVertexCount(
212
217
  gltfInfo.edgeIndicesWest,
@@ -449,9 +454,10 @@ const scratchGeodeticSurfaceNormalUpsample = new Cartesian3();
449
454
  * Decode the position attributes from a glTF object.
450
455
  * @private
451
456
  * @param {Object.<string,*>} gltf The glTF JSON.
457
+ * @param {object} meshoptDecoder The meshoptimizer decoder for compressed attributes.
452
458
  * @returns {Float32Array} The decoded positions, as a flattened array of x, y, z values.
453
459
  */
454
- function decodePositions(gltf) {
460
+ function decodePositions(gltf, meshoptDecoder) {
455
461
  const primitive = gltf.meshes[0].primitives[0];
456
462
  const accessor = gltf.accessors[primitive.attributes["POSITION"]];
457
463
  const bufferView = gltf.bufferViews[accessor.bufferView];
@@ -486,7 +492,7 @@ function decodePositions(gltf) {
486
492
  const positionByteLength = bufferViewMeshOpt.byteStride;
487
493
  const PositionType = positionByteLength === 4 ? Uint8Array : Uint16Array;
488
494
  const positionsResult = new PositionType(positionCount * 4);
489
- MeshoptDecoder.decodeVertexBuffer(
495
+ meshoptDecoder.decodeVertexBuffer(
490
496
  new Uint8Array(positionsResult.buffer),
491
497
  positionCount,
492
498
  positionByteLength,
@@ -510,9 +516,10 @@ function decodePositions(gltf) {
510
516
  * Decode the normal attributes from a glTF object.
511
517
  * @private
512
518
  * @param {Object.<string,*>} gltf The glTF JSON.
519
+ * @param {object} meshoptDecoder The meshoptimizer decoder for compressed attributes.
513
520
  * @returns {Float32Array} The decoded normals, as a flattened array of x, y, z values.
514
521
  */
515
- function decodeNormals(gltf) {
522
+ function decodeNormals(gltf, meshoptDecoder) {
516
523
  const primitive = gltf.meshes[0].primitives[0];
517
524
  const accessor = gltf.accessors[primitive.attributes["NORMAL"]];
518
525
  const bufferView = gltf.bufferViews[accessor.bufferView];
@@ -547,7 +554,7 @@ function decodeNormals(gltf) {
547
554
  const normalByteLength = bufferViewMeshOpt.byteStride;
548
555
  const normalsResult = new Int8Array(normalCount * normalByteLength);
549
556
 
550
- MeshoptDecoder.decodeVertexBuffer(
557
+ meshoptDecoder.decodeVertexBuffer(
551
558
  new Uint8Array(normalsResult.buffer),
552
559
  normalCount,
553
560
  normalByteLength,
@@ -588,9 +595,10 @@ function decodeNormals(gltf) {
588
595
  * Decode the index attributes from a glTF object.
589
596
  * @private
590
597
  * @param {Object.<string,*>} gltf The glTF JSON.
598
+ * @param {object} meshoptDecoder The meshoptimizer decoder for compressed attributes.
591
599
  * @returns {Uint16Array|Uint32Array} An array of indices.
592
600
  */
593
- function decodeIndices(gltf) {
601
+ function decodeIndices(gltf, meshoptDecoder) {
594
602
  const primitive = gltf.meshes[0].primitives[0];
595
603
  const accessor = gltf.accessors[primitive.indices];
596
604
  const bufferView = gltf.bufferViews[accessor.bufferView];
@@ -626,7 +634,7 @@ function decodeIndices(gltf) {
626
634
  );
627
635
 
628
636
  const indices = new SizedIndexType(indexCount);
629
- MeshoptDecoder.decodeIndexBuffer(
637
+ meshoptDecoder.decodeIndexBuffer(
630
638
  new Uint8Array(indices.buffer),
631
639
  indexCount,
632
640
  bufferViewMeshOpt.byteStride,
@@ -640,9 +648,10 @@ function decodeIndices(gltf) {
640
648
  * @private
641
649
  * @param {Object.<string,*>} gltf The glTF JSON.
642
650
  * @param {string} name The name of the edge indices to decode.
651
+ * @param {object} meshoptDecoder The meshoptimizer decoder for compressed attributes.
643
652
  * @returns {Uint16Array|Uint32Array} An array of edge indices.
644
653
  */
645
- function decodeEdgeIndices(gltf, name) {
654
+ function decodeEdgeIndices(gltf, name, meshoptDecoder) {
646
655
  const primitive = gltf.meshes[0].primitives[0];
647
656
  const accessor = gltf.accessors[primitive.extensions.CESIUM_tile_edges[name]];
648
657
  const bufferView = gltf.bufferViews[accessor.bufferView];
@@ -680,7 +689,7 @@ function decodeEdgeIndices(gltf, name) {
680
689
 
681
690
  const indices = new SizedIndexType(indexCount);
682
691
  const indexByteLength = bufferViewMeshOpt.byteStride;
683
- MeshoptDecoder.decodeIndexSequence(
692
+ meshoptDecoder.decodeIndexSequence(
684
693
  new Uint8Array(indices.buffer),
685
694
  indexCount,
686
695
  indexByteLength,
@@ -694,17 +703,18 @@ function decodeEdgeIndices(gltf, name) {
694
703
  * @private
695
704
  * @param {Object.<string,*>} gltf The glTF JSON.
696
705
  * @param {boolean} hasNormals <code>true</code> if the glTF has normal attributes.
706
+ * @param {object} meshoptDecoder The meshoptimizer decoder for compressed attributes.
697
707
  * @param {GltfInfo} result The object to store the decoded arrays.
698
708
  * @returns {GltfInfo} The decoded geometry info.
699
709
  */
700
- function decodeGltf(gltf, hasNormals, result) {
701
- result.positions = decodePositions(gltf);
702
- result.normals = hasNormals ? decodeNormals(gltf) : undefined;
703
- result.indices = decodeIndices(gltf);
704
- result.edgeIndicesWest = decodeEdgeIndices(gltf, "left");
705
- result.edgeIndicesSouth = decodeEdgeIndices(gltf, "bottom");
706
- result.edgeIndicesEast = decodeEdgeIndices(gltf, "right");
707
- result.edgeIndicesNorth = decodeEdgeIndices(gltf, "top");
710
+ function decodeGltf(gltf, hasNormals, meshoptDecoder, result) {
711
+ result.positions = decodePositions(gltf, meshoptDecoder);
712
+ result.normals = hasNormals ? decodeNormals(gltf, meshoptDecoder) : undefined;
713
+ result.indices = decodeIndices(gltf, meshoptDecoder);
714
+ result.edgeIndicesWest = decodeEdgeIndices(gltf, "left", meshoptDecoder);
715
+ result.edgeIndicesSouth = decodeEdgeIndices(gltf, "bottom", meshoptDecoder);
716
+ result.edgeIndicesEast = decodeEdgeIndices(gltf, "right", meshoptDecoder);
717
+ result.edgeIndicesNorth = decodeEdgeIndices(gltf, "top", meshoptDecoder);
708
718
  return result;
709
719
  }
710
720
 
@@ -1,16 +1,101 @@
1
1
  import Check from "./Check.js";
2
2
  import CompressedTextureBuffer from "./CompressedTextureBuffer.js";
3
3
  import defined from "./defined.js";
4
+ import DeveloperError from "./DeveloperError.js";
5
+ import getAbsoluteUri from "./getAbsoluteUri.js";
4
6
  import RuntimeError from "./RuntimeError.js";
5
7
  import TaskProcessor from "./TaskProcessor.js";
6
8
 
7
9
  /**
8
- * Transcodes KTX2 textures using web workers.
10
+ * Lets applications use their own Basis Universal build to decode KTX2 textures.
11
+ * Cesium uses its bundled build by default.
9
12
  *
10
- * @private
13
+ * @alias KTX2Transcoder
14
+ * @namespace
15
+ * @experimental This feature is not final and is subject to change without
16
+ * Cesium's standard deprecation policy.
11
17
  */
12
18
  function KTX2Transcoder() {}
13
19
 
20
+ /**
21
+ * The two files that make up an application-supplied Basis Universal build.
22
+ * Both the JavaScript wrapper and Wasm binary must come from the same build.
23
+ *
24
+ * The wrapper must be an ES module whose default export is a factory function.
25
+ * Cesium calls that function in its KTX2 worker with an Emscripten configuration
26
+ * that contains the binary bytes in <code>wasmBinary</code>.
27
+ * The function returns a Basis module, or a promise for that module.
28
+ *
29
+ * The module must provide <code>initializeBasis</code>, <code>KTX2File</code>,
30
+ * and <code>transcoder_texture_format</code>. These APIs must be compatible
31
+ * with Cesium's bundled Basis version.
32
+ *
33
+ * @typedef {object} KTX2Transcoder.BasisTranscoderOptions
34
+ * @property {string} modulePath The URL of the JavaScript wrapper.
35
+ * @property {string} wasmBinaryFile The URL of the matching Wasm binary.
36
+ */
37
+
38
+ Object.defineProperties(KTX2Transcoder, {
39
+ /**
40
+ * Uses your own Basis Universal build to decode KTX2 textures.
41
+ * Leave this undefined to use Cesium's bundled build.
42
+ *
43
+ * Before the first KTX2 load, set both the JavaScript wrapper URL and the
44
+ * matching Wasm binary URL. Relative URLs resolve against the document URL.
45
+ * Cesium copies the options and rejects changes after loading starts.
46
+ *
47
+ * Cesium's existing KTX2 worker loads both files and compiles the Wasm binary.
48
+ * See {@link KTX2Transcoder.BasisTranscoderOptions} for the wrapper requirements.
49
+ *
50
+ * For a Content Security Policy without <code>'unsafe-eval'</code>, use a
51
+ * compatible Basis build that does not generate JavaScript at runtime.
52
+ * The worker's policy must allow the wrapper import, binary fetch, and Wasm compilation.
53
+ *
54
+ * @memberof KTX2Transcoder
55
+ * @type {KTX2Transcoder.BasisTranscoderOptions|undefined}
56
+ * @default undefined
57
+ * @experimental This feature is not final and is subject to change without
58
+ * Cesium's standard deprecation policy.
59
+ *
60
+ * @example
61
+ * Cesium.KTX2Transcoder.basisTranscoderOptions = {
62
+ * modulePath: "/decoders/basis_transcoder.js",
63
+ * wasmBinaryFile: "/decoders/basis_transcoder.wasm",
64
+ * };
65
+ */
66
+ basisTranscoderOptions: {
67
+ get: function () {
68
+ return KTX2Transcoder._basisTranscoderOptions;
69
+ },
70
+ set: function (value) {
71
+ if (defined(KTX2Transcoder._readyPromise)) {
72
+ throw new DeveloperError(
73
+ "KTX2Transcoder.basisTranscoderOptions must be configured before the first KTX2 load.",
74
+ );
75
+ }
76
+ if (!defined(value)) {
77
+ KTX2Transcoder._basisTranscoderOptions = undefined;
78
+ return;
79
+ }
80
+ if (
81
+ typeof value !== "object" ||
82
+ typeof value.modulePath !== "string" ||
83
+ value.modulePath.length === 0 ||
84
+ typeof value.wasmBinaryFile !== "string" ||
85
+ value.wasmBinaryFile.length === 0
86
+ ) {
87
+ throw new DeveloperError(
88
+ "KTX2Transcoder.basisTranscoderOptions requires non-empty modulePath and wasmBinaryFile strings.",
89
+ );
90
+ }
91
+ KTX2Transcoder._basisTranscoderOptions = Object.freeze({
92
+ modulePath: value.modulePath,
93
+ wasmBinaryFile: value.wasmBinaryFile,
94
+ });
95
+ },
96
+ },
97
+ });
98
+
14
99
  KTX2Transcoder._transcodeTaskProcessor = new TaskProcessor(
15
100
  "transcodeKTX2",
16
101
  Number.POSITIVE_INFINITY, // KTX2 transcoding is used in place of Resource.fetchImage, so it can't reject as "just soooo busy right now"
@@ -19,10 +104,15 @@ KTX2Transcoder._transcodeTaskProcessor = new TaskProcessor(
19
104
  KTX2Transcoder._readyPromise = undefined;
20
105
 
21
106
  function makeReadyPromise() {
107
+ const options = KTX2Transcoder._basisTranscoderOptions;
108
+ const wasmOptions = defined(options)
109
+ ? {
110
+ modulePath: getAbsoluteUri(options.modulePath),
111
+ wasmBinaryFile: getAbsoluteUri(options.wasmBinaryFile),
112
+ }
113
+ : { wasmBinaryFile: "ThirdParty/basis_transcoder.wasm" };
22
114
  const readyPromise = KTX2Transcoder._transcodeTaskProcessor
23
- .initWebAssemblyModule({
24
- wasmBinaryFile: "ThirdParty/basis_transcoder.wasm",
25
- })
115
+ .initWebAssemblyModule(wasmOptions)
26
116
  .then(function (result) {
27
117
  if (result) {
28
118
  return KTX2Transcoder._transcodeTaskProcessor;
@@ -33,6 +123,10 @@ function makeReadyPromise() {
33
123
  KTX2Transcoder._readyPromise = readyPromise;
34
124
  }
35
125
 
126
+ /**
127
+ * Transcodes a KTX2 buffer in the worker.
128
+ * @private
129
+ */
36
130
  KTX2Transcoder.transcode = function (ktx2Buffer, supportedTargetFormats) {
37
131
  //>>includeStart('debug', pragmas.debug);
38
132
  Check.defined("supportedTargetFormats", supportedTargetFormats);