@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.
Files changed (160) hide show
  1. package/Build/Workers/{chunk-EF2QYXGA.js → chunk-2EFYUSUY.js} +14 -14
  2. package/Build/Workers/{chunk-KFSTQKNM.js → chunk-5LSOO2KD.js} +7 -7
  3. package/Build/Workers/{chunk-VQYETPWC.js → chunk-6HK6IXK2.js} +4 -4
  4. package/Build/Workers/{chunk-AYKR4VBR.js → chunk-6YR6JBMY.js} +2 -2
  5. package/Build/Workers/{chunk-DOBXCNC3.js → chunk-76FDC45O.js} +13 -13
  6. package/Build/Workers/{chunk-54I6Y66F.js → chunk-7D2HZKH7.js} +6 -6
  7. package/Build/Workers/{chunk-4MGMYHOO.js → chunk-7KVKHY7O.js} +6 -6
  8. package/Build/Workers/{chunk-IRBKFCEJ.js → chunk-A3O6EDBK.js} +2 -2
  9. package/Build/Workers/{chunk-V7VQKN6N.js → chunk-A6X24AZI.js} +5 -5
  10. package/Build/Workers/{chunk-ZP7JMQV4.js → chunk-AHWAZRBV.js} +6 -2
  11. package/Build/Workers/{chunk-YLY7NKAB.js → chunk-B4CQSLZJ.js} +4 -4
  12. package/Build/Workers/{chunk-J6BWOHUF.js → chunk-C7JQVRLM.js} +3 -3
  13. package/Build/Workers/{chunk-KSSWJIZW.js → chunk-CDJDJ5LK.js} +2 -2
  14. package/Build/Workers/{chunk-G7PXZRVF.js → chunk-CEEZE3YZ.js} +7 -7
  15. package/Build/Workers/{chunk-INUEEEQA.js → chunk-CLCTQVVL.js} +8 -8
  16. package/Build/Workers/{chunk-O3EA5HS7.js → chunk-DBD5WWG2.js} +10 -10
  17. package/Build/Workers/{chunk-E7VQ76KE.js → chunk-DIGUUD6G.js} +6 -6
  18. package/Build/Workers/{chunk-424RNO3D.js → chunk-E7NZJOK7.js} +196 -22
  19. package/Build/Workers/{chunk-ACXQXN46.js → chunk-EHTS2YPT.js} +16 -16
  20. package/Build/Workers/{chunk-VWV2IJRB.js → chunk-ENNFMWDW.js} +11 -11
  21. package/Build/Workers/{chunk-FRQZECAO.js → chunk-FCP2QY4G.js} +5 -5
  22. package/Build/Workers/{chunk-ZZ46LWL6.js → chunk-FDK4K5IA.js} +1 -1
  23. package/Build/Workers/{chunk-C6KNZ7T4.js → chunk-FGQFQHN5.js} +17 -17
  24. package/Build/Workers/{chunk-MYP774IS.js → chunk-GSWMAFTE.js} +8 -8
  25. package/Build/Workers/{chunk-Y5BF6AFU.js → chunk-GXWQZBAI.js} +2 -2
  26. package/Build/Workers/{chunk-DDWSZVMY.js → chunk-HHV3MCGV.js} +5 -5
  27. package/Build/Workers/{chunk-52JDLOEM.js → chunk-HS6AD4P2.js} +14 -14
  28. package/Build/Workers/{chunk-Q3PY526V.js → chunk-IGAZBTFZ.js} +6 -6
  29. package/Build/Workers/{chunk-EBSIOBXY.js → chunk-ILME5BXA.js} +8 -8
  30. package/Build/Workers/{chunk-C6J67V5A.js → chunk-JKXV6PG5.js} +1 -1
  31. package/Build/Workers/{chunk-SMQZZOW6.js → chunk-JW6OZT4R.js} +10 -10
  32. package/Build/Workers/{chunk-F6QDY6HU.js → chunk-KGXSYGBG.js} +13 -13
  33. package/Build/Workers/{chunk-UOOIQ3KX.js → chunk-LD64RPYV.js} +12 -12
  34. package/Build/Workers/{chunk-CFQP6LYM.js → chunk-LGNDTZVX.js} +4 -4
  35. package/Build/Workers/{chunk-U3ZA64U7.js → chunk-LNSQVXFH.js} +2 -2
  36. package/Build/Workers/{chunk-TKKIREQ6.js → chunk-N7CCOFLX.js} +1 -1
  37. package/Build/Workers/{chunk-UA25D5MX.js → chunk-NIWITKQK.js} +10 -10
  38. package/Build/Workers/{chunk-KKOSKAZB.js → chunk-OBEU25PI.js} +17 -17
  39. package/Build/Workers/{chunk-M3B5JKSM.js → chunk-QVLAFFJY.js} +1 -1
  40. package/Build/Workers/{chunk-6YEE6JDR.js → chunk-R4FPNAZ2.js} +6 -6
  41. package/Build/Workers/{chunk-7J2HKPRH.js → chunk-RG4F5R57.js} +9 -9
  42. package/Build/Workers/{chunk-CXOYE2WM.js → chunk-SF6K72D7.js} +5 -5
  43. package/Build/Workers/{chunk-CZEYZU4N.js → chunk-SGRGNDOD.js} +10 -10
  44. package/Build/Workers/{chunk-DBOEKL43.js → chunk-SM2CDCYF.js} +7 -7
  45. package/Build/Workers/{chunk-Y57HREW5.js → chunk-SS5ABQGY.js} +4 -4
  46. package/Build/Workers/{chunk-QRWGUWI6.js → chunk-T5QBPLE3.js} +11 -11
  47. package/Build/Workers/{chunk-ZK3CF7ZD.js → chunk-TVZD72WJ.js} +12 -12
  48. package/Build/Workers/{chunk-IYOUHCZB.js → chunk-UEY73NRN.js} +1 -1
  49. package/Build/Workers/{chunk-7WM2PX4V.js → chunk-UVO6COT2.js} +5 -5
  50. package/Build/Workers/{chunk-P3CK7MCY.js → chunk-VAL7DYNR.js} +4 -4
  51. package/Build/Workers/{chunk-EPYXRCDB.js → chunk-WBSY7HDY.js} +12 -12
  52. package/Build/Workers/{chunk-4S7IE3LB.js → chunk-XDWCTQCZ.js} +2 -2
  53. package/Build/Workers/{chunk-QN67VG36.js → chunk-XLXSDIP5.js} +6 -6
  54. package/Build/Workers/{chunk-S4MCOY6I.js → chunk-XQ3SKCMM.js} +5 -5
  55. package/Build/Workers/{chunk-XZMBNNDX.js → chunk-YKU2Q3A2.js} +9 -9
  56. package/Build/Workers/{chunk-3VFEWOBI.js → chunk-ZMBHFYOX.js} +7 -7
  57. package/Build/Workers/{chunk-MPZHGZU6.js → chunk-ZSGUV73H.js} +4 -4
  58. package/Build/Workers/combineGeometry.js +24 -24
  59. package/Build/Workers/createBoxGeometry.js +18 -18
  60. package/Build/Workers/createBoxOutlineGeometry.js +16 -16
  61. package/Build/Workers/createCircleGeometry.js +26 -26
  62. package/Build/Workers/createCircleOutlineGeometry.js +19 -19
  63. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
  64. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
  65. package/Build/Workers/createCorridorGeometry.js +29 -29
  66. package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
  67. package/Build/Workers/createCylinderGeometry.js +20 -20
  68. package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
  69. package/Build/Workers/createEllipseGeometry.js +26 -26
  70. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  71. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  72. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  73. package/Build/Workers/createFrustumGeometry.js +18 -18
  74. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  75. package/Build/Workers/createGeometry.js +24 -24
  76. package/Build/Workers/createGroundPolylineGeometry.js +22 -22
  77. package/Build/Workers/createPlaneGeometry.js +16 -16
  78. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  79. package/Build/Workers/createPolygonGeometry.js +32 -32
  80. package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
  81. package/Build/Workers/createPolylineGeometry.js +25 -25
  82. package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
  83. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
  84. package/Build/Workers/createRectangleGeometry.js +27 -27
  85. package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
  86. package/Build/Workers/createSimplePolylineGeometry.js +23 -23
  87. package/Build/Workers/createSphereGeometry.js +19 -19
  88. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  89. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  90. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  91. package/Build/Workers/createVectorTileGeometries.js +24 -24
  92. package/Build/Workers/createVectorTilePoints.js +13 -13
  93. package/Build/Workers/createVectorTilePolygons.js +22 -22
  94. package/Build/Workers/createVectorTilePolylines.js +14 -14
  95. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
  96. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
  97. package/Build/Workers/createVerticesFromHeightmap.js +22 -22
  98. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  99. package/Build/Workers/createWallGeometry.js +24 -24
  100. package/Build/Workers/createWallOutlineGeometry.js +23 -23
  101. package/Build/Workers/decodeDraco.js +10 -10
  102. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +987 -2320
  103. package/Build/Workers/decodeI3S.js +10 -10
  104. package/Build/Workers/gaussianSplatSorter.js +4 -4
  105. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  106. package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
  107. package/Build/Workers/transcodeKTX2.js +6 -6
  108. package/Build/Workers/transferTypedArrayTest.js +1 -1
  109. package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
  110. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  111. package/Source/Core/BoundingRectangle.js +6 -8
  112. package/Source/Core/Color.js +1 -0
  113. package/Source/Core/InterpolationAlgorithm.js +57 -50
  114. package/Source/Core/Ion.js +1 -1
  115. package/Source/Core/TerrainMesh.js +3 -3
  116. package/Source/Core/TerrainPicker.js +1 -0
  117. package/Source/Core/writeTextToCanvas.js +1 -0
  118. package/Source/DataSources/CzmlDataSource.js +12 -0
  119. package/Source/DataSources/KmlDataSource.js +528 -555
  120. package/Source/DataSources/PathGraphics.js +8 -1
  121. package/Source/DataSources/PathMode.js +27 -0
  122. package/Source/DataSources/PathVisualizer.js +298 -1
  123. package/Source/Renderer/Texture.js +1 -1
  124. package/Source/Renderer/VertexArray.js +1 -0
  125. package/Source/Scene/ArcGisMapService.js +1 -1
  126. package/Source/Scene/BillboardTexture.js +5 -3
  127. package/Source/Scene/Cesium3DTileOptimizations.js +4 -6
  128. package/Source/Scene/ClippingPlaneCollection.js +2 -2
  129. package/Source/Scene/ClippingPolygon.js +2 -0
  130. package/Source/Scene/ClippingPolygonCollection.js +2 -2
  131. package/Source/Scene/DerivedCommand.js +4 -0
  132. package/Source/Scene/Expression.js +6 -8
  133. package/Source/Scene/GlobeSurfaceShaderSet.js +501 -409
  134. package/Source/Scene/GlobeSurfaceTile.js +540 -401
  135. package/Source/Scene/GlobeSurfaceTileProvider.js +1259 -1146
  136. package/Source/Scene/GltfBufferViewLoader.js +3 -3
  137. package/Source/Scene/GltfLoader.js +1 -0
  138. package/Source/Scene/GltfLoaderUtil.js +20 -4
  139. package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +10 -0
  140. package/Source/Scene/GltfPipeline/removeUnusedElements.js +21 -11
  141. package/Source/Scene/ImageryLayer.js +2 -2
  142. package/Source/Scene/ImageryLayerCollection.js +2 -2
  143. package/Source/Scene/Material.js +1 -0
  144. package/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js +4 -0
  145. package/Source/Scene/Model/Model.js +3 -0
  146. package/Source/Scene/Model/ModelUtility.js +1 -0
  147. package/Source/Scene/Picking.js +5 -0
  148. package/Source/Scene/PntsParser.js +1 -0
  149. package/Source/Scene/QuadtreePrimitive.js +3 -2
  150. package/Source/Scene/ResourceCacheKey.js +5 -5
  151. package/Source/Scene/Scene.js +1 -0
  152. package/Source/Scene/findMeshoptExtension.js +23 -0
  153. package/Source/Scene/renderBufferPointCollection.js +13 -8
  154. package/Source/Scene/renderBufferPolygonCollection.js +9 -13
  155. package/Source/Scene/renderBufferPolylineCollection.js +120 -192
  156. package/Source/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2
  157. package/Source/Workers/incrementallyBuildTerrainPicker.js +2 -0
  158. package/index.d.ts +59 -254
  159. package/index.js +155 -153
  160. 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 hasExtension from "./hasExtension.js";
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
- if (hasExtension(bufferView, "EXT_meshopt_compression")) {
58
- const meshopt = bufferView.extensions.EXT_meshopt_compression;
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;
@@ -534,6 +534,7 @@ class GltfLoader extends ResourceLoader {
534
534
 
535
535
  /**
536
536
  * Loads the gltf object
537
+ * @ignore
537
538
  */
538
539
  async function loadGltfJson(loader) {
539
540
  loader._state = GltfLoaderState.LOADING;
@@ -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
- Math.cos(rotation) * scale.x, -Math.sin(rotation) * scale.y, offset.x,
168
- Math.sin(rotation) * scale.x, Math.cos(rotation) * scale.y, offset.y,
169
- 0.0, 0.0, 1.0
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
- if (
152
- defined(bufferView.extensions) &&
153
- defined(bufferView.extensions.EXT_meshopt_compression)
154
- ) {
155
- bufferView.extensions.EXT_meshopt_compression.buffer--;
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
- if (
587
- defined(bufferView.extensions) &&
588
- defined(bufferView.extensions.EXT_meshopt_compression)
589
- ) {
590
- usedBufferIds[bufferView.extensions.EXT_meshopt_compression.buffer] =
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
- * @private
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
- * @private
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
- * @private
564
+ * @ignore
565
565
  */
566
566
  ImageryLayerCollection.prototype.cancelReprojections = function () {
567
567
  const layers = this._layers;
@@ -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,
@@ -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
- // Store the computed position in the cache for future reuse
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
- if (hasExtension(bufferView, "EXT_meshopt_compression")) {
26
- const meshopt = bufferView.extensions.EXT_meshopt_compression;
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
- if (hasExtension(bufferView, "EXT_meshopt_compression")) {
251
- const meshopt = bufferView.extensions.EXT_meshopt_compression;
250
+ const meshopt = findMeshoptExtension(bufferView);
251
+ if (defined(meshopt)) {
252
252
  bufferId = meshopt.buffer;
253
253
  }
254
254
 
@@ -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
- attributeArrays.positionHigh[i * 3] = encodedCartesian.high.x;
129
- attributeArrays.positionHigh[i * 3 + 1] = encodedCartesian.high.y;
130
- attributeArrays.positionHigh[i * 3 + 2] = encodedCartesian.high.z;
131
- attributeArrays.positionLow[i * 3] = encodedCartesian.low.x;
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
- material.outlineColor,
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] = material.outlineColor.alpha;
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 encodedCartesian = new EncodedCartesian3();
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 TODO(tsd-jsdoc): See https://github.com/CesiumGS/cesium/pull/13302.
157
+ // @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
156
158
  Cartesian3.fromArray(cartesianArray, j * 3, cartesian);
157
- EncodedCartesian3.fromCartesian(cartesian, encodedCartesian);
158
-
159
- attributeArrays.positionHigh[vOffset * 3] = encodedCartesian.high.x;
160
- attributeArrays.positionHigh[vOffset * 3 + 1] =
161
- encodedCartesian.high.y;
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);