@cesium/engine 26.0.0 → 26.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Build/Workers/{chunk-EF2QYXGA.js → chunk-2EFYUSUY.js} +14 -14
- package/Build/Workers/{chunk-KFSTQKNM.js → chunk-5LSOO2KD.js} +7 -7
- package/Build/Workers/{chunk-VQYETPWC.js → chunk-6HK6IXK2.js} +4 -4
- package/Build/Workers/{chunk-AYKR4VBR.js → chunk-6YR6JBMY.js} +2 -2
- package/Build/Workers/{chunk-DOBXCNC3.js → chunk-76FDC45O.js} +13 -13
- package/Build/Workers/{chunk-54I6Y66F.js → chunk-7D2HZKH7.js} +6 -6
- package/Build/Workers/{chunk-4MGMYHOO.js → chunk-7KVKHY7O.js} +6 -6
- package/Build/Workers/{chunk-IRBKFCEJ.js → chunk-A3O6EDBK.js} +2 -2
- package/Build/Workers/{chunk-V7VQKN6N.js → chunk-A6X24AZI.js} +5 -5
- package/Build/Workers/{chunk-ZP7JMQV4.js → chunk-AHWAZRBV.js} +6 -2
- package/Build/Workers/{chunk-YLY7NKAB.js → chunk-B4CQSLZJ.js} +4 -4
- package/Build/Workers/{chunk-J6BWOHUF.js → chunk-C7JQVRLM.js} +3 -3
- package/Build/Workers/{chunk-KSSWJIZW.js → chunk-CDJDJ5LK.js} +2 -2
- package/Build/Workers/{chunk-G7PXZRVF.js → chunk-CEEZE3YZ.js} +7 -7
- package/Build/Workers/{chunk-INUEEEQA.js → chunk-CLCTQVVL.js} +8 -8
- package/Build/Workers/{chunk-O3EA5HS7.js → chunk-DBD5WWG2.js} +10 -10
- package/Build/Workers/{chunk-E7VQ76KE.js → chunk-DIGUUD6G.js} +6 -6
- package/Build/Workers/{chunk-424RNO3D.js → chunk-E7NZJOK7.js} +196 -22
- package/Build/Workers/{chunk-ACXQXN46.js → chunk-EHTS2YPT.js} +16 -16
- package/Build/Workers/{chunk-VWV2IJRB.js → chunk-ENNFMWDW.js} +11 -11
- package/Build/Workers/{chunk-FRQZECAO.js → chunk-FCP2QY4G.js} +5 -5
- package/Build/Workers/{chunk-ZZ46LWL6.js → chunk-FDK4K5IA.js} +1 -1
- package/Build/Workers/{chunk-C6KNZ7T4.js → chunk-FGQFQHN5.js} +17 -17
- package/Build/Workers/{chunk-MYP774IS.js → chunk-GSWMAFTE.js} +8 -8
- package/Build/Workers/{chunk-Y5BF6AFU.js → chunk-GXWQZBAI.js} +2 -2
- package/Build/Workers/{chunk-DDWSZVMY.js → chunk-HHV3MCGV.js} +5 -5
- package/Build/Workers/{chunk-52JDLOEM.js → chunk-HS6AD4P2.js} +14 -14
- package/Build/Workers/{chunk-Q3PY526V.js → chunk-IGAZBTFZ.js} +6 -6
- package/Build/Workers/{chunk-EBSIOBXY.js → chunk-ILME5BXA.js} +8 -8
- package/Build/Workers/{chunk-C6J67V5A.js → chunk-JKXV6PG5.js} +1 -1
- package/Build/Workers/{chunk-SMQZZOW6.js → chunk-JW6OZT4R.js} +10 -10
- package/Build/Workers/{chunk-F6QDY6HU.js → chunk-KGXSYGBG.js} +13 -13
- package/Build/Workers/{chunk-UOOIQ3KX.js → chunk-LD64RPYV.js} +12 -12
- package/Build/Workers/{chunk-CFQP6LYM.js → chunk-LGNDTZVX.js} +4 -4
- package/Build/Workers/{chunk-U3ZA64U7.js → chunk-LNSQVXFH.js} +2 -2
- package/Build/Workers/{chunk-TKKIREQ6.js → chunk-N7CCOFLX.js} +1 -1
- package/Build/Workers/{chunk-UA25D5MX.js → chunk-NIWITKQK.js} +10 -10
- package/Build/Workers/{chunk-KKOSKAZB.js → chunk-OBEU25PI.js} +17 -17
- package/Build/Workers/{chunk-M3B5JKSM.js → chunk-QVLAFFJY.js} +1 -1
- package/Build/Workers/{chunk-6YEE6JDR.js → chunk-R4FPNAZ2.js} +6 -6
- package/Build/Workers/{chunk-7J2HKPRH.js → chunk-RG4F5R57.js} +9 -9
- package/Build/Workers/{chunk-CXOYE2WM.js → chunk-SF6K72D7.js} +5 -5
- package/Build/Workers/{chunk-CZEYZU4N.js → chunk-SGRGNDOD.js} +10 -10
- package/Build/Workers/{chunk-DBOEKL43.js → chunk-SM2CDCYF.js} +7 -7
- package/Build/Workers/{chunk-Y57HREW5.js → chunk-SS5ABQGY.js} +4 -4
- package/Build/Workers/{chunk-QRWGUWI6.js → chunk-T5QBPLE3.js} +11 -11
- package/Build/Workers/{chunk-ZK3CF7ZD.js → chunk-TVZD72WJ.js} +12 -12
- package/Build/Workers/{chunk-IYOUHCZB.js → chunk-UEY73NRN.js} +1 -1
- package/Build/Workers/{chunk-7WM2PX4V.js → chunk-UVO6COT2.js} +5 -5
- package/Build/Workers/{chunk-P3CK7MCY.js → chunk-VAL7DYNR.js} +4 -4
- package/Build/Workers/{chunk-EPYXRCDB.js → chunk-WBSY7HDY.js} +12 -12
- package/Build/Workers/{chunk-4S7IE3LB.js → chunk-XDWCTQCZ.js} +2 -2
- package/Build/Workers/{chunk-QN67VG36.js → chunk-XLXSDIP5.js} +6 -6
- package/Build/Workers/{chunk-S4MCOY6I.js → chunk-XQ3SKCMM.js} +5 -5
- package/Build/Workers/{chunk-XZMBNNDX.js → chunk-YKU2Q3A2.js} +9 -9
- package/Build/Workers/{chunk-3VFEWOBI.js → chunk-ZMBHFYOX.js} +7 -7
- package/Build/Workers/{chunk-MPZHGZU6.js → chunk-ZSGUV73H.js} +4 -4
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- 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 +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +22 -22
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createPolylineGeometry.js +25 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
- package/Build/Workers/createSimplePolylineGeometry.js +23 -23
- 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 +14 -14
- 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 +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +24 -24
- package/Build/Workers/createWallOutlineGeometry.js +23 -23
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +987 -2320
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/BoundingRectangle.js +6 -8
- package/Source/Core/Color.js +1 -0
- package/Source/Core/InterpolationAlgorithm.js +57 -50
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/TerrainMesh.js +3 -3
- package/Source/Core/TerrainPicker.js +1 -0
- package/Source/Core/writeTextToCanvas.js +1 -0
- package/Source/DataSources/CzmlDataSource.js +12 -0
- package/Source/DataSources/KmlDataSource.js +528 -555
- package/Source/DataSources/PathGraphics.js +8 -1
- package/Source/DataSources/PathMode.js +27 -0
- package/Source/DataSources/PathVisualizer.js +298 -1
- package/Source/Renderer/Texture.js +1 -1
- package/Source/Renderer/VertexArray.js +1 -0
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/BillboardTexture.js +5 -3
- package/Source/Scene/Cesium3DTileOptimizations.js +4 -6
- package/Source/Scene/ClippingPlaneCollection.js +2 -2
- package/Source/Scene/ClippingPolygon.js +2 -0
- package/Source/Scene/ClippingPolygonCollection.js +2 -2
- package/Source/Scene/DerivedCommand.js +4 -0
- package/Source/Scene/Expression.js +6 -8
- package/Source/Scene/GlobeSurfaceShaderSet.js +501 -409
- package/Source/Scene/GlobeSurfaceTile.js +540 -401
- package/Source/Scene/GlobeSurfaceTileProvider.js +1259 -1146
- package/Source/Scene/GltfBufferViewLoader.js +3 -3
- package/Source/Scene/GltfLoader.js +1 -0
- package/Source/Scene/GltfLoaderUtil.js +20 -4
- package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +10 -0
- package/Source/Scene/GltfPipeline/removeUnusedElements.js +21 -11
- package/Source/Scene/ImageryLayer.js +2 -2
- package/Source/Scene/ImageryLayerCollection.js +2 -2
- package/Source/Scene/Material.js +1 -0
- package/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js +4 -0
- package/Source/Scene/Model/Model.js +3 -0
- package/Source/Scene/Model/ModelUtility.js +1 -0
- package/Source/Scene/Picking.js +5 -0
- package/Source/Scene/PntsParser.js +1 -0
- package/Source/Scene/QuadtreePrimitive.js +3 -2
- package/Source/Scene/ResourceCacheKey.js +5 -5
- package/Source/Scene/Scene.js +1 -0
- package/Source/Scene/findMeshoptExtension.js +23 -0
- package/Source/Scene/renderBufferPointCollection.js +13 -8
- package/Source/Scene/renderBufferPolygonCollection.js +9 -13
- package/Source/Scene/renderBufferPolylineCollection.js +120 -192
- package/Source/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2
- package/Source/Workers/incrementallyBuildTerrainPicker.js +2 -0
- package/index.d.ts +59 -254
- package/index.js +155 -153
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Check from "../Core/Check.js";
|
|
2
2
|
import Frozen from "../Core/Frozen.js";
|
|
3
3
|
import defined from "../Core/defined.js";
|
|
4
|
-
import
|
|
4
|
+
import findMeshoptExtension from "./findMeshoptExtension.js";
|
|
5
5
|
import { MeshoptDecoder } from "meshoptimizer";
|
|
6
6
|
import ResourceLoader from "./ResourceLoader.js";
|
|
7
7
|
import ResourceLoaderState from "./ResourceLoaderState.js";
|
|
@@ -54,8 +54,8 @@ class GltfBufferViewLoader extends ResourceLoader {
|
|
|
54
54
|
let meshoptMode;
|
|
55
55
|
let meshoptFilter;
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
const meshopt = findMeshoptExtension(bufferView);
|
|
58
|
+
if (defined(meshopt)) {
|
|
59
59
|
bufferId = meshopt.buffer;
|
|
60
60
|
byteOffset = meshopt.byteOffset ?? 0;
|
|
61
61
|
byteLength = meshopt.byteLength;
|
|
@@ -111,6 +111,22 @@ GltfLoaderUtil.createSampler = function (options) {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
if (!TextureWrap.validate(wrapS)) {
|
|
115
|
+
wrapS = TextureWrap.REPEAT;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (!TextureWrap.validate(wrapT)) {
|
|
119
|
+
wrapT = TextureWrap.REPEAT;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (!TextureMinificationFilter.validate(minFilter)) {
|
|
123
|
+
minFilter = TextureMinificationFilter.LINEAR;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (!TextureMagnificationFilter.validate(magFilter)) {
|
|
127
|
+
magFilter = TextureMagnificationFilter.LINEAR;
|
|
128
|
+
}
|
|
129
|
+
|
|
114
130
|
return new Sampler({
|
|
115
131
|
wrapS: wrapS,
|
|
116
132
|
wrapT: wrapT,
|
|
@@ -164,10 +180,10 @@ GltfLoaderUtil.createModelTextureReader = function (options) {
|
|
|
164
180
|
|
|
165
181
|
// prettier-ignore
|
|
166
182
|
transform = new Matrix3(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
183
|
+
Math.cos(rotation) * scale.x, -Math.sin(rotation) * scale.y, offset.x,
|
|
184
|
+
Math.sin(rotation) * scale.x, Math.cos(rotation) * scale.y, offset.y,
|
|
185
|
+
0.0, 0.0, 1.0
|
|
186
|
+
);
|
|
171
187
|
}
|
|
172
188
|
|
|
173
189
|
const modelTextureReader = new ModelComponents.TextureReader();
|
|
@@ -73,6 +73,16 @@ function forEachTextureInMaterial(material, handler) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
// Transmission extension
|
|
77
|
+
const transmission = extensions.KHR_materials_transmission;
|
|
78
|
+
if (defined(transmission) && defined(transmission.transmissionTexture)) {
|
|
79
|
+
const textureInfo = transmission.transmissionTexture;
|
|
80
|
+
const value = handler(textureInfo.index, textureInfo);
|
|
81
|
+
if (defined(value)) {
|
|
82
|
+
return value;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
76
86
|
// Materials common extension (may be present in models converted from glTF 1.0)
|
|
77
87
|
const materialsCommon = extensions.KHR_materials_common;
|
|
78
88
|
if (defined(materialsCommon) && defined(materialsCommon.values)) {
|
|
@@ -148,11 +148,16 @@ Remove.buffer = function (gltf, bufferId) {
|
|
|
148
148
|
bufferView.buffer--;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
const extensions = bufferView.extensions;
|
|
152
|
+
if (defined(extensions)) {
|
|
153
|
+
const ext = extensions.EXT_meshopt_compression;
|
|
154
|
+
if (defined(ext) && ext.buffer > bufferId) {
|
|
155
|
+
ext.buffer--;
|
|
156
|
+
}
|
|
157
|
+
const khr = extensions.KHR_meshopt_compression;
|
|
158
|
+
if (defined(khr) && khr.buffer > bufferId) {
|
|
159
|
+
khr.buffer--;
|
|
160
|
+
}
|
|
156
161
|
}
|
|
157
162
|
});
|
|
158
163
|
};
|
|
@@ -583,12 +588,17 @@ getListOfElementsIdsInUse.buffer = function (gltf) {
|
|
|
583
588
|
if (defined(bufferView.buffer)) {
|
|
584
589
|
usedBufferIds[bufferView.buffer] = true;
|
|
585
590
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
true;
|
|
591
|
+
|
|
592
|
+
const extensions = bufferView.extensions;
|
|
593
|
+
if (defined(extensions)) {
|
|
594
|
+
const ext = extensions.EXT_meshopt_compression;
|
|
595
|
+
if (defined(ext)) {
|
|
596
|
+
usedBufferIds[ext.buffer] = true;
|
|
597
|
+
}
|
|
598
|
+
const khr = extensions.KHR_meshopt_compression;
|
|
599
|
+
if (defined(khr)) {
|
|
600
|
+
usedBufferIds[khr.buffer] = true;
|
|
601
|
+
}
|
|
592
602
|
}
|
|
593
603
|
});
|
|
594
604
|
|
|
@@ -676,11 +676,11 @@ ImageryLayer.prototype.getImageryRectangle = function () {
|
|
|
676
676
|
* Create skeletons for the imagery tiles that partially or completely overlap a given terrain
|
|
677
677
|
* tile.
|
|
678
678
|
*
|
|
679
|
-
* @
|
|
679
|
+
* @ignore
|
|
680
680
|
*
|
|
681
681
|
* @param {QuadtreeTile} tile The terrain tile.
|
|
682
682
|
* @param {TerrainProvider|undefined} terrainProvider The terrain provider associated with the terrain tile.
|
|
683
|
-
* @param {number} insertionPoint The position to insert new skeletons before in the tile's imagery list.
|
|
683
|
+
* @param {number} [insertionPoint] The position to insert new skeletons before in the tile's imagery list.
|
|
684
684
|
* @returns {boolean} true if this layer overlaps any portion of the terrain tile; otherwise, false.
|
|
685
685
|
*/
|
|
686
686
|
ImageryLayer.prototype._createTileImagerySkeletons = function (
|
|
@@ -545,7 +545,7 @@ ImageryLayerCollection.prototype.pickImageryLayerFeatures = function (
|
|
|
545
545
|
/**
|
|
546
546
|
* Updates frame state to execute any queued texture re-projections.
|
|
547
547
|
*
|
|
548
|
-
* @
|
|
548
|
+
* @ignore
|
|
549
549
|
*
|
|
550
550
|
* @param {FrameState} frameState The frameState.
|
|
551
551
|
*/
|
|
@@ -561,7 +561,7 @@ ImageryLayerCollection.prototype.queueReprojectionCommands = function (
|
|
|
561
561
|
/**
|
|
562
562
|
* Cancels re-projection commands queued for the next frame.
|
|
563
563
|
*
|
|
564
|
-
* @
|
|
564
|
+
* @ignore
|
|
565
565
|
*/
|
|
566
566
|
ImageryLayerCollection.prototype.cancelReprojections = function () {
|
|
567
567
|
const layers = this._layers;
|
package/Source/Scene/Material.js
CHANGED
|
@@ -1099,6 +1099,7 @@ function createCubeMapUpdateFunction(uniformId) {
|
|
|
1099
1099
|
* @param {Material} material The material to load the cubemap images for.
|
|
1100
1100
|
* @param {string} uniformId The ID of the uniform that corresponds to the cubemap images.
|
|
1101
1101
|
* @returns A promise that resolves when the images are loaded, or a resolved promise if image loading is not necessary.
|
|
1102
|
+
* @ignore
|
|
1102
1103
|
*/
|
|
1103
1104
|
function loadCubeMapImagesForUniform(material, uniformId) {
|
|
1104
1105
|
const uniforms = material.uniforms;
|
|
@@ -30,6 +30,7 @@ function GltfGpmLoader() {}
|
|
|
30
30
|
*
|
|
31
31
|
* @param {number[]} array The input array
|
|
32
32
|
* @returns {Matrix3} The Matrix3
|
|
33
|
+
* @ignore
|
|
33
34
|
*/
|
|
34
35
|
function createCovarianceMatrixFromUpperTriangle(array) {
|
|
35
36
|
const covarianceMatrix = new Matrix3(
|
|
@@ -51,6 +52,7 @@ function createCovarianceMatrixFromUpperTriangle(array) {
|
|
|
51
52
|
*
|
|
52
53
|
* @param {object} anchorPointDirectJson The input JSON
|
|
53
54
|
* @returns {AnchorPointDirect} The direct anchor point
|
|
55
|
+
* @ignore
|
|
54
56
|
*/
|
|
55
57
|
function createAnchorPointDirect(anchorPointDirectJson) {
|
|
56
58
|
const position = Cartesian3.fromArray(
|
|
@@ -75,6 +77,7 @@ function createAnchorPointDirect(anchorPointDirectJson) {
|
|
|
75
77
|
*
|
|
76
78
|
* @param {object} anchorPointIndirectJson The input JSON
|
|
77
79
|
* @returns {AnchorPointIndirect} The indirect anchor point
|
|
80
|
+
* @ignore
|
|
78
81
|
*/
|
|
79
82
|
function createAnchorPointIndirect(anchorPointIndirectJson) {
|
|
80
83
|
const position = Cartesian3.fromArray(
|
|
@@ -103,6 +106,7 @@ function createAnchorPointIndirect(anchorPointIndirectJson) {
|
|
|
103
106
|
*
|
|
104
107
|
* @param {object} correlationGroupJson The input JSON
|
|
105
108
|
* @returns {CorrelationGroup} The correlation group
|
|
109
|
+
* @ignore
|
|
106
110
|
*/
|
|
107
111
|
function createCorrelationGroup(correlationGroupJson) {
|
|
108
112
|
const groupFlags = correlationGroupJson.groupFlags;
|
|
@@ -108,6 +108,9 @@ import ModelImagery from "./ModelImagery.js";
|
|
|
108
108
|
* {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_mesh_quantization|KHR_mesh_quantization}
|
|
109
109
|
* </li>
|
|
110
110
|
* <li>
|
|
111
|
+
* {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_meshopt_compression|KHR_meshopt_compression}
|
|
112
|
+
* </li>
|
|
113
|
+
* <li>
|
|
111
114
|
* {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_basisu|KHR_texture_basisu}
|
|
112
115
|
* </li>
|
|
113
116
|
* <li>
|
|
@@ -371,6 +371,7 @@ ModelUtility.supportedExtensions = {
|
|
|
371
371
|
KHR_materials_unlit: true,
|
|
372
372
|
KHR_mesh_quantization: true,
|
|
373
373
|
KHR_mesh_primitive_restart: true,
|
|
374
|
+
KHR_meshopt_compression: true,
|
|
374
375
|
KHR_techniques_webgl: true,
|
|
375
376
|
KHR_texture_basisu: true,
|
|
376
377
|
KHR_texture_transform: true,
|
package/Source/Scene/Picking.js
CHANGED
|
@@ -247,6 +247,7 @@ const scratchColorZero = new Color(0.0, 0.0, 0.0, 0.0);
|
|
|
247
247
|
* height will default to the value of <code>width</code>
|
|
248
248
|
* @param {BoundingRectangle} result The result rectangle
|
|
249
249
|
* @returns {BoundingRectangle} The result rectangle
|
|
250
|
+
* @ignore
|
|
250
251
|
*/
|
|
251
252
|
function computePickingDrawingBufferRectangle(
|
|
252
253
|
drawingBufferHeight,
|
|
@@ -270,6 +271,7 @@ function computePickingDrawingBufferRectangle(
|
|
|
270
271
|
* @param {BoundingRectangle} drawingBufferRectangle The output drawing buffer recangle.
|
|
271
272
|
* @param {number} [width=3] Width of the pick rectangle.
|
|
272
273
|
* @param {number} [height=3] Height of the pick rectangle.
|
|
274
|
+
* @ignore
|
|
273
275
|
*/
|
|
274
276
|
function pickBegin(
|
|
275
277
|
scene,
|
|
@@ -332,6 +334,7 @@ function pickBegin(
|
|
|
332
334
|
* Teardown needed after picking.
|
|
333
335
|
*
|
|
334
336
|
* @param {Scene} scene
|
|
337
|
+
* @ignore
|
|
335
338
|
*/
|
|
336
339
|
function pickEnd(scene) {
|
|
337
340
|
const { context } = scene;
|
|
@@ -808,6 +811,7 @@ Picking.prototype.pickPosition = function (scene, windowPosition, result) {
|
|
|
808
811
|
* @param {object[]} pickedAttributes
|
|
809
812
|
* @param {object[]} pickedFeatures
|
|
810
813
|
* @returns {boolean} whether picking should end
|
|
814
|
+
* @ignore
|
|
811
815
|
*/
|
|
812
816
|
function addDrillPickedResults(
|
|
813
817
|
pickedResults,
|
|
@@ -875,6 +879,7 @@ function addDrillPickedResults(
|
|
|
875
879
|
* @param {function(number): object[]} pickCallback Pick callback to execute each iteration
|
|
876
880
|
* @param {number} [limit=Number.MAX_VALUE] If supplied, stop drilling after collecting this many picks
|
|
877
881
|
* @returns {object[]} List of picked results
|
|
882
|
+
* @ignore
|
|
878
883
|
*/
|
|
879
884
|
function drillPick(pickCallback, limit) {
|
|
880
885
|
// PERFORMANCE_IDEA: This function calls each primitive's update for each pass. Instead
|
|
@@ -214,6 +214,7 @@ PntsParser.parse = function (arrayBuffer, byteOffset) {
|
|
|
214
214
|
* a one-time warning will be printed.
|
|
215
215
|
*
|
|
216
216
|
* @param {object} parsedContent The parsed content
|
|
217
|
+
* @ignore
|
|
217
218
|
*/
|
|
218
219
|
function removeInvalidBinaryBodyReferences(parsedContent) {
|
|
219
220
|
const batchTableJson = parsedContent.batchTableJson;
|
|
@@ -1527,11 +1527,12 @@ function updateHeights(primitive, frameState) {
|
|
|
1527
1527
|
);
|
|
1528
1528
|
|
|
1529
1529
|
if (defined(position)) {
|
|
1530
|
-
//
|
|
1530
|
+
// `pick` wrote into the module-level `scratchPosition`, so `position`
|
|
1531
|
+
// aliases it — clone before caching or the next pick mutates every entry.
|
|
1531
1532
|
tile.setPositionCacheEntry(
|
|
1532
1533
|
data.positionCartographic,
|
|
1533
1534
|
primitive.maximumScreenSpaceError,
|
|
1534
|
-
position,
|
|
1535
|
+
Cartesian3.clone(position),
|
|
1535
1536
|
);
|
|
1536
1537
|
}
|
|
1537
1538
|
}
|
|
@@ -3,8 +3,8 @@ import Frozen from "../Core/Frozen.js";
|
|
|
3
3
|
import defined from "../Core/defined.js";
|
|
4
4
|
import DeveloperError from "../Core/DeveloperError.js";
|
|
5
5
|
import getAbsoluteUri from "../Core/getAbsoluteUri.js";
|
|
6
|
+
import findMeshoptExtension from "./findMeshoptExtension.js";
|
|
6
7
|
import GltfLoaderUtil from "./GltfLoaderUtil.js";
|
|
7
|
-
import hasExtension from "./hasExtension.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Compute cache keys for resources in {@link ResourceCache}.
|
|
@@ -22,8 +22,8 @@ function getExternalResourceCacheKey(resource) {
|
|
|
22
22
|
function getBufferViewCacheKey(bufferView) {
|
|
23
23
|
let { byteOffset, byteLength } = bufferView;
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const meshopt = findMeshoptExtension(bufferView);
|
|
26
|
+
if (defined(meshopt)) {
|
|
27
27
|
byteOffset = meshopt.byteOffset ?? 0;
|
|
28
28
|
byteLength = meshopt.byteLength;
|
|
29
29
|
}
|
|
@@ -247,8 +247,8 @@ ResourceCacheKey.getBufferViewCacheKey = function (options) {
|
|
|
247
247
|
const bufferView = gltf.bufferViews[bufferViewId];
|
|
248
248
|
let bufferId = bufferView.buffer;
|
|
249
249
|
const buffer = gltf.buffers[bufferId];
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
const meshopt = findMeshoptExtension(bufferView);
|
|
251
|
+
if (defined(meshopt)) {
|
|
252
252
|
bufferId = meshopt.buffer;
|
|
253
253
|
}
|
|
254
254
|
|
package/Source/Scene/Scene.js
CHANGED
|
@@ -2466,6 +2466,7 @@ function createWorkingFrustum(camera) {
|
|
|
2466
2466
|
*
|
|
2467
2467
|
* @param {Scene} scene The scene.
|
|
2468
2468
|
* @returns {Function} A function to execute translucent commands.
|
|
2469
|
+
* @ignore
|
|
2469
2470
|
*/
|
|
2470
2471
|
function obtainTranslucentCommandExecutionFunction(scene) {
|
|
2471
2472
|
if (scene._environmentState.useOIT) {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import defined from "../Core/defined.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns the meshopt compression extension object, KHR_meshopt_compression or
|
|
5
|
+
* EXT_meshopt_compression, on a glTF bufferView or buffer. If both are present,
|
|
6
|
+
* KHR is preferred.
|
|
7
|
+
* @param {object} gltfObject A glTF bufferView or buffer.
|
|
8
|
+
* @returns {object|undefined} The meshopt extension object, or undefined.
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
function findMeshoptExtension(gltfObject) {
|
|
12
|
+
const extensions = gltfObject?.extensions;
|
|
13
|
+
if (!defined(extensions)) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
extensions["KHR_meshopt_compression"] ??
|
|
19
|
+
extensions["EXT_meshopt_compression"]
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default findMeshoptExtension;
|
|
@@ -109,6 +109,8 @@ function renderBufferPointCollection(collection, frameState, renderContext) {
|
|
|
109
109
|
if (collection._dirtyCount > 0) {
|
|
110
110
|
const { attributeArrays } = renderContext;
|
|
111
111
|
|
|
112
|
+
const positionHighArray = attributeArrays.positionHigh;
|
|
113
|
+
const positionLowArray = attributeArrays.positionLow;
|
|
112
114
|
const pickColorArray = attributeArrays.pickColor;
|
|
113
115
|
const showSizeColorAlphaArray = attributeArrays.showSizeColorAlpha;
|
|
114
116
|
const outlineWidthColorAlphaArray = attributeArrays.outlineWidthColorAlpha;
|
|
@@ -125,12 +127,10 @@ function renderBufferPointCollection(collection, frameState, renderContext) {
|
|
|
125
127
|
if (useFloat64) {
|
|
126
128
|
point.getPosition(cartesian);
|
|
127
129
|
EncodedCartesian3.fromCartesian(cartesian, encodedCartesian);
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
attributeArrays.positionLow[i * 3 + 1] = encodedCartesian.low.y;
|
|
133
|
-
attributeArrays.positionLow[i * 3 + 2] = encodedCartesian.low.z;
|
|
130
|
+
// @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
|
|
131
|
+
Cartesian3.pack(encodedCartesian.high, positionHighArray, i * 3);
|
|
132
|
+
// @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
|
|
133
|
+
Cartesian3.pack(encodedCartesian.low, positionLowArray, i * 3);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
point.getMaterial(material);
|
|
@@ -150,9 +150,14 @@ function renderBufferPointCollection(collection, frameState, renderContext) {
|
|
|
150
150
|
|
|
151
151
|
outlineWidthColorAlphaArray[i * 3] = material.outlineWidth;
|
|
152
152
|
outlineWidthColorAlphaArray[i * 3 + 1] = AttributeCompression.encodeRGB8(
|
|
153
|
-
|
|
153
|
+
// When outlineWidth=0, overwrite outlineColor to prevent subpixel bleeding.
|
|
154
|
+
material.outlineWidth > 0 ? material.outlineColor : material.color,
|
|
154
155
|
);
|
|
155
|
-
outlineWidthColorAlphaArray[i * 3 + 2] =
|
|
156
|
+
outlineWidthColorAlphaArray[i * 3 + 2] =
|
|
157
|
+
// When outlineWidth=0, overwrite outlineAlpha to prevent subpixel bleeding.
|
|
158
|
+
material.outlineWidth > 0
|
|
159
|
+
? material.outlineColor.alpha
|
|
160
|
+
: material.color.alpha;
|
|
156
161
|
|
|
157
162
|
point._dirty = false;
|
|
158
163
|
}
|
|
@@ -73,7 +73,7 @@ const polygon = new BufferPolygon();
|
|
|
73
73
|
const material = new BufferPolygonMaterial();
|
|
74
74
|
const pickColor = new Color();
|
|
75
75
|
const cartesian = new Cartesian3();
|
|
76
|
-
const
|
|
76
|
+
const encodedC = new EncodedCartesian3();
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* @param {BufferPolygonCollection} collection
|
|
@@ -118,6 +118,8 @@ function renderBufferPolygonCollection(collection, frameState, renderContext) {
|
|
|
118
118
|
const { attributeArrays } = renderContext;
|
|
119
119
|
const { _dirtyOffset, _dirtyCount } = collection;
|
|
120
120
|
|
|
121
|
+
const positionHighArray = attributeArrays.positionHigh;
|
|
122
|
+
const positionLowArray = attributeArrays.positionLow;
|
|
121
123
|
const indexArray = renderContext.indexArray;
|
|
122
124
|
const pickColorArray = attributeArrays.pickColor;
|
|
123
125
|
const showColorAlphaArray = attributeArrays.showColorAlpha;
|
|
@@ -152,19 +154,13 @@ function renderBufferPolygonCollection(collection, frameState, renderContext) {
|
|
|
152
154
|
// Update vertex arrays.
|
|
153
155
|
for (let j = 0, jl = polygon.vertexCount; j < jl; j++) {
|
|
154
156
|
if (useFloat64) {
|
|
155
|
-
// @ts-expect-error
|
|
157
|
+
// @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
|
|
156
158
|
Cartesian3.fromArray(cartesianArray, j * 3, cartesian);
|
|
157
|
-
EncodedCartesian3.fromCartesian(cartesian,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
attributeArrays.positionHigh[vOffset * 3 + 2] =
|
|
163
|
-
encodedCartesian.high.z;
|
|
164
|
-
|
|
165
|
-
attributeArrays.positionLow[vOffset * 3] = encodedCartesian.low.x;
|
|
166
|
-
attributeArrays.positionLow[vOffset * 3 + 1] = encodedCartesian.low.y;
|
|
167
|
-
attributeArrays.positionLow[vOffset * 3 + 2] = encodedCartesian.low.z;
|
|
159
|
+
EncodedCartesian3.fromCartesian(cartesian, encodedC);
|
|
160
|
+
// @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
|
|
161
|
+
Cartesian3.pack(encodedC.high, positionHighArray, vOffset * 3);
|
|
162
|
+
// @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
|
|
163
|
+
Cartesian3.pack(encodedC.low, positionLowArray, vOffset * 3);
|
|
168
164
|
}
|
|
169
165
|
|
|
170
166
|
pickColorArray[vOffset * 4] = Color.floatToByte(pickColor.red);
|