@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.
- package/Build/ThirdParty/Workers/zip-web-worker.js +504 -535
- package/Build/Workers/chunk-2P3WKV6V.js +290 -0
- package/Build/Workers/{chunk-MUW4DJV7.js → chunk-2U5272QU.js} +17 -17
- package/Build/Workers/{chunk-7WXBTNRV.js → chunk-4KCOC6OZ.js} +8 -10
- package/Build/Workers/{chunk-GS7RY2DH.js → chunk-5FULJNWY.js} +11 -13
- package/Build/Workers/{chunk-2PWVICP6.js → chunk-65ZF23AQ.js} +1 -1
- package/Build/Workers/{chunk-SEJIXZZ4.js → chunk-6D5534B7.js} +10 -12
- package/Build/Workers/{chunk-MDDKCLMF.js → chunk-6GFMBHBD.js} +19 -19
- package/Build/Workers/{chunk-PKZA44LH.js → chunk-6VRGQF3D.js} +4 -4
- package/Build/Workers/{chunk-JBJ6BRIM.js → chunk-6XUIECFB.js} +4 -6
- package/Build/Workers/{chunk-DKSANM4A.js → chunk-7KWUH6RK.js} +14 -14
- package/Build/Workers/{chunk-6BSNYZZG.js → chunk-7ZBJRQQT.js} +7 -7
- package/Build/Workers/{chunk-XRZCS3HE.js → chunk-AEHANE5A.js} +991 -5612
- package/Build/Workers/chunk-AUU74SIZ.js +2420 -0
- package/Build/Workers/{chunk-2YY724ZX.js → chunk-B6V5NMIE.js} +13 -11
- package/Build/Workers/{chunk-5JCZHJUU.js → chunk-BRQ52ASU.js} +15 -17
- package/Build/Workers/{chunk-Z2DW5NM2.js → chunk-FVLSQBPH.js} +7 -14
- package/Build/Workers/{chunk-L73K5UPP.js → chunk-IFKM2GZR.js} +12 -12
- package/Build/Workers/{chunk-F34TJJLA.js → chunk-KF6OEWVT.js} +17 -17
- package/Build/Workers/{chunk-JL4NWWQY.js → chunk-KOAXSU77.js} +5 -7
- package/Build/Workers/{chunk-CKK6CUXK.js → chunk-KRVYCMGN.js} +6 -6
- package/Build/Workers/{chunk-KBGAHN5R.js → chunk-LTZRLNQP.js} +1 -1
- package/Build/Workers/{chunk-CQ4TZXAT.js → chunk-M7WEAGWT.js} +8 -8
- package/Build/Workers/{chunk-A7SMPV6B.js → chunk-MJTLGN63.js} +14 -14
- package/Build/Workers/{chunk-DZK34ZVD.js → chunk-MUNZ77KV.js} +1 -1
- package/Build/Workers/{chunk-X27HKF5E.js → chunk-NC5BUJEF.js} +2 -2
- package/Build/Workers/chunk-NYKURYFR.js +2131 -0
- package/Build/Workers/{chunk-5KG7KDDW.js → chunk-NZAQG57U.js} +7 -7
- package/Build/Workers/{chunk-JKTWW7IO.js → chunk-O5GUOP2G.js} +5 -7
- package/Build/Workers/{chunk-6R6SGKYN.js → chunk-OQUOLQTN.js} +8 -10
- package/Build/Workers/chunk-OUG5JB2K.js +46 -0
- package/Build/Workers/{chunk-HDD3RFLT.js → chunk-P4SDLSGF.js} +13 -6
- package/Build/Workers/{chunk-M6W46OAP.js → chunk-P6PC2OIM.js} +7 -7
- package/Build/Workers/{chunk-XSIUYAT6.js → chunk-PPRK3XQU.js} +31 -35
- package/Build/Workers/{chunk-4LRFYRBX.js → chunk-QGTYLWOT.js} +2 -2
- package/Build/Workers/{chunk-COKOYTRS.js → chunk-QHTLIQUH.js} +5 -7
- package/Build/Workers/{chunk-N5YK44FS.js → chunk-ROHWZQZ5.js} +5 -5
- package/Build/Workers/{chunk-XBY3354M.js → chunk-SNUWISJO.js} +6 -8
- package/Build/Workers/{chunk-EDETO6NY.js → chunk-T67YY3KP.js} +4 -2
- package/Build/Workers/{chunk-4DMAXPKB.js → chunk-TF5473GK.js} +13 -13
- package/Build/Workers/{chunk-B7Q2WF6Q.js → chunk-THHFTMAL.js} +4 -6
- package/Build/Workers/{chunk-SL2HCFYW.js → chunk-UFCZ62WM.js} +15 -13
- package/Build/Workers/{chunk-NZQUP52G.js → chunk-UV2YC2Q5.js} +11 -11
- package/Build/Workers/{chunk-E7G32DWL.js → chunk-V4ICCWYA.js} +1 -1
- package/Build/Workers/{chunk-75BC2IHI.js → chunk-VC6XXI2Z.js} +9 -9
- package/Build/Workers/{chunk-JMUUAW4X.js → chunk-VXJ6P4UI.js} +10 -10
- package/Build/Workers/{chunk-QTAEVUED.js → chunk-W2BKP7G7.js} +15 -17
- package/Build/Workers/{chunk-VRECSMG3.js → chunk-WMVGNBSH.js} +2 -2
- package/Build/Workers/{chunk-7SESBH2I.js → chunk-XFZMQZSZ.js} +4 -4
- package/Build/Workers/{chunk-Q2JS5LCB.js → chunk-XJ532R6R.js} +20 -20
- package/Build/Workers/{chunk-SLHK3KAR.js → chunk-YJNU4SM4.js} +5 -5
- package/Build/Workers/{chunk-LL2SGJYH.js → chunk-YJRDTEHQ.js} +8 -8
- package/Build/Workers/chunk-YUICDZKO.js +2660 -0
- package/Build/Workers/{chunk-ATSXKJ3L.js → chunk-Z3DEVGJV.js} +7 -7
- package/Build/Workers/{chunk-6V2KDEHL.js → chunk-ZECGI7UZ.js} +4 -4
- package/Build/Workers/{chunk-LYJUL4XQ.js → chunk-ZFLPVPUJ.js} +6 -8
- package/Build/Workers/{chunk-BNDSDQ7D.js → chunk-ZIM5H2DB.js} +11 -11
- package/Build/Workers/{chunk-KEWK6VZL.js → chunk-ZSQMGGSB.js} +14 -16
- package/Build/Workers/{chunk-2DKJSPYF.js → chunk-ZWYRGMBK.js} +16 -18
- package/Build/Workers/{chunk-UZY5XRL2.js → chunk-ZY733NZA.js} +1 -1
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +20 -19
- package/Build/Workers/createCircleGeometry.js +28 -27
- package/Build/Workers/createCircleOutlineGeometry.js +21 -20
- package/Build/Workers/createCoplanarPolygonGeometry.js +34 -34
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -32
- package/Build/Workers/createCorridorGeometry.js +31 -31
- package/Build/Workers/createCorridorOutlineGeometry.js +30 -30
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +22 -21
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
- package/Build/Workers/createGeometry.js +27 -26
- package/Build/Workers/createGroundPolylineGeometry.js +27 -26
- package/Build/Workers/createPlaneGeometry.js +18 -17
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +35 -35
- package/Build/Workers/createPolygonOutlineGeometry.js +34 -34
- package/Build/Workers/createPolylineGeometry.js +28 -29
- package/Build/Workers/createPolylineVolumeGeometry.js +34 -35
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +30 -31
- package/Build/Workers/createRectangleGeometry.js +30 -30
- package/Build/Workers/createRectangleOutlineGeometry.js +23 -24
- package/Build/Workers/createSimplePolylineGeometry.js +26 -27
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +17 -16
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +17 -16
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +36 -26
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +24 -24
- package/Build/Workers/createVerticesFromHeightmap.js +24 -25
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +27 -28
- package/Build/Workers/createWallOutlineGeometry.js +26 -27
- package/Build/Workers/decodeDraco.js +16 -12
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +336 -337
- package/Build/Workers/decodeI3S.js +17 -12
- package/Build/Workers/{chunk-GLHDTTTO.js → decodeMeshopt.js} +23 -29
- package/Build/Workers/decodeSpz.js +1960 -0
- package/Build/Workers/gaussianSplatSorter.js +13 -6
- package/Build/Workers/gaussianSplatTextureGenerator.js +13 -6
- package/Build/Workers/incrementallyBuildTerrainPicker.js +9 -10
- package/Build/Workers/transcodeKTX2.js +26 -12
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -24
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/Cesium3DTilesTerrainData.js +11 -1
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +33 -23
- package/Source/Core/KTX2Transcoder.js +99 -5
- package/Source/Core/Resource.js +2 -0
- package/Source/Core/TaskProcessor.js +249 -129
- package/Source/Core/TrustedServers.js +34 -1
- package/Source/Core/WebAssemblyWorkerInitializer.js +125 -0
- package/Source/Core/fetchWebAssemblyBinary.js +52 -0
- package/Source/Scene/GaussianSplatPrimitive.js +153 -66
- package/Source/Scene/GltfBufferViewLoader.js +25 -13
- package/Source/Scene/GltfSpzLoader.js +5 -4
- package/Source/Scene/SpzDecoder.js +106 -0
- package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Workers/createTaskProcessorWorker.js +2 -0
- package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +13 -1
- package/Source/Workers/decodeDraco.js +7 -3
- package/Source/Workers/decodeI3S.js +7 -3
- package/Source/Workers/decodeMeshopt.js +21 -0
- package/Source/Workers/decodeSpz.js +20 -0
- package/Source/Workers/gaussianSplatSorter.js +7 -3
- package/Source/Workers/gaussianSplatTextureGenerator.js +7 -3
- package/Source/Workers/transcodeKTX2.js +22 -5
- package/index.d.ts +93 -0
- package/index.js +4 -1
- package/package.json +1 -1
- package/Build/Workers/chunk-B4AVL7VI.js +0 -82
- 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-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
41
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
41
|
-
|
|
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-
|
|
28
|
+
} from "./chunk-T67YY3KP.js";
|
|
29
29
|
import {
|
|
30
30
|
AxisAlignedBoundingBox_default
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import "./chunk-
|
|
31
|
+
} from "./chunk-ROHWZQZ5.js";
|
|
32
|
+
import "./chunk-ZY733NZA.js";
|
|
33
33
|
import {
|
|
34
34
|
Matrix4_default
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-GLHDTTTO.js";
|
|
35
|
+
} from "./chunk-OQUOLQTN.js";
|
|
37
36
|
import {
|
|
38
37
|
Cartesian3_default
|
|
39
|
-
} from "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
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-
|
|
31
|
+
} from "./chunk-T67YY3KP.js";
|
|
29
32
|
import {
|
|
30
33
|
WebGLConstants_default
|
|
31
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
3448
|
-
if (defined_default(wasmConfig.
|
|
3449
|
-
|
|
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
|
|
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
|
*
|
|
@@ -26,52 +26,52 @@
|
|
|
26
26
|
import {
|
|
27
27
|
EllipsoidalOccluder_default,
|
|
28
28
|
TerrainEncoding_default
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-TF5473GK.js";
|
|
30
30
|
import {
|
|
31
31
|
createTaskProcessorWorker_default
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-T67YY3KP.js";
|
|
33
33
|
import {
|
|
34
34
|
OrientedBoundingBox_default
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-MJTLGN63.js";
|
|
36
36
|
import {
|
|
37
37
|
AttributeCompression_default
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
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-
|
|
45
|
+
} from "./chunk-O5GUOP2G.js";
|
|
46
46
|
import {
|
|
47
47
|
BoundingSphere_default
|
|
48
|
-
} from "./chunk-
|
|
49
|
-
import "./chunk-
|
|
48
|
+
} from "./chunk-ZIM5H2DB.js";
|
|
49
|
+
import "./chunk-ZY733NZA.js";
|
|
50
50
|
import {
|
|
51
51
|
Rectangle_default
|
|
52
|
-
} from "./chunk-
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-
|
|
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-
|
|
60
|
+
} from "./chunk-7ZBJRQQT.js";
|
|
62
61
|
import {
|
|
63
62
|
Cartesian3_default
|
|
64
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-FVLSQBPH.js";
|
|
64
|
+
import "./chunk-NYKURYFR.js";
|
|
65
65
|
import {
|
|
66
66
|
Math_default
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-P4SDLSGF.js";
|
|
68
68
|
import {
|
|
69
|
-
Check_default
|
|
70
|
-
|
|
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-
|
|
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-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
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-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-
|
|
48
|
-
import "./chunk-
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
51
|
-
import "./chunk-
|
|
52
|
-
import "./chunk-
|
|
53
|
-
import "./chunk-
|
|
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
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
10
|
+
* Lets applications use their own Basis Universal build to decode KTX2 textures.
|
|
11
|
+
* Cesium uses its bundled build by default.
|
|
9
12
|
*
|
|
10
|
-
* @
|
|
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);
|