@cesium/engine 9.1.0 → 10.0.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 (255) hide show
  1. package/Build/ThirdParty/Workers/pako_deflate.min.js +108 -210
  2. package/Build/ThirdParty/Workers/pako_inflate.min.js +466 -568
  3. package/Build/ThirdParty/Workers/z-worker-pako.js +54 -104
  4. package/Build/Workers/{chunk-TMMOULW3.js → chunk-2J3JKXCP.js} +5 -5
  5. package/Build/Workers/{chunk-ZDP32RQI.js → chunk-3WUV74WM.js} +95 -155
  6. package/Build/Workers/{chunk-FOZQIHZK.js → chunk-4BAE4PWO.js} +6 -6
  7. package/Build/Workers/{chunk-CYAJYEKW.js → chunk-4MSUJ4I7.js} +8 -8
  8. package/Build/Workers/{chunk-KPY4F4BW.js → chunk-4YSNMHZ4.js} +6 -6
  9. package/Build/Workers/{chunk-66E3H2KU.js → chunk-5S7OLEPK.js} +12 -12
  10. package/Build/Workers/{chunk-4AJGCQFX.js → chunk-7XGC6YB2.js} +14 -14
  11. package/Build/Workers/{chunk-BDUJXBVF.js → chunk-AA4GZKOT.js} +3 -5
  12. package/Build/Workers/{chunk-7LPEGKOF.js → chunk-AD5HBJ2F.js} +11 -8
  13. package/Build/Workers/{chunk-XHLDDE65.js → chunk-AVI4IUWC.js} +11 -11
  14. package/Build/Workers/{chunk-MWYZ64MH.js → chunk-BCL4PHHT.js} +10 -10
  15. package/Build/Workers/{chunk-PWF3YJJ5.js → chunk-BDFNKFOE.js} +13 -13
  16. package/Build/Workers/{chunk-7VZNXIKG.js → chunk-BJF5LOWE.js} +7 -7
  17. package/Build/Workers/{chunk-3S2MFY4B.js → chunk-C2CGMAIU.js} +13 -13
  18. package/Build/Workers/{chunk-UAJEGIWA.js → chunk-COYFZ5VA.js} +6 -6
  19. package/Build/Workers/{chunk-ZWPIM77Q.js → chunk-DGS5QNIO.js} +13 -13
  20. package/Build/Workers/{chunk-V7JB576Q.js → chunk-DKVHRNFY.js} +5 -5
  21. package/Build/Workers/{chunk-NI2R52QD.js → chunk-DOXCPOG4.js} +11 -9
  22. package/Build/Workers/{chunk-XWML5Y7N.js → chunk-FXIHSF7O.js} +9 -9
  23. package/Build/Workers/{chunk-LW7WGHEU.js → chunk-G3YR53LY.js} +13 -13
  24. package/Build/Workers/{chunk-34DGOKCO.js → chunk-GR3CDLCP.js} +7 -7
  25. package/Build/Workers/{chunk-AOIKO5Y7.js → chunk-GRAT5GE7.js} +5 -5
  26. package/Build/Workers/{chunk-AOFMPKUB.js → chunk-I2RC4XVN.js} +4 -4
  27. package/Build/Workers/{chunk-PK7TEP3J.js → chunk-JYAHOGGL.js} +15 -15
  28. package/Build/Workers/{chunk-4KIUON73.js → chunk-KUN2ZA5X.js} +4 -4
  29. package/Build/Workers/{chunk-POLFRINT.js → chunk-L6RTJ3RE.js} +14 -14
  30. package/Build/Workers/{chunk-LVJCR7DH.js → chunk-LCLJJ2MZ.js} +18 -18
  31. package/Build/Workers/{chunk-3RZK5NNV.js → chunk-LEABCTLP.js} +4 -4
  32. package/Build/Workers/{chunk-QKF7XXEQ.js → chunk-MDHQR3ZS.js} +10 -8
  33. package/Build/Workers/{chunk-4PHPQRSH.js → chunk-MSKXMXJI.js} +5 -6
  34. package/Build/Workers/{chunk-GIFJ77E4.js → chunk-NTXTUNEF.js} +4 -4
  35. package/Build/Workers/{chunk-I5TDPPC4.js → chunk-O3JCMSS3.js} +17 -17
  36. package/Build/Workers/{chunk-PEABJLCK.js → chunk-OOK53QUQ.js} +1 -1
  37. package/Build/Workers/{chunk-PS6AEMBR.js → chunk-OORVMGDU.js} +7 -7
  38. package/Build/Workers/{chunk-JI2445T5.js → chunk-PCP4YQST.js} +11 -11
  39. package/Build/Workers/{chunk-C5CE4OG6.js → chunk-PYHLO636.js} +42 -13
  40. package/Build/Workers/{chunk-S4XDCPKD.js → chunk-Q55ECN3Y.js} +1 -1
  41. package/Build/Workers/{chunk-WWP3I7R5.js → chunk-QD4KM3GO.js} +5 -5
  42. package/Build/Workers/{chunk-YLZTCEBJ.js → chunk-QMLTCCYG.js} +1 -1
  43. package/Build/Workers/{chunk-IBXGK4WV.js → chunk-QX5XS4LC.js} +2 -2
  44. package/Build/Workers/{chunk-RL73GOEF.js → chunk-R6B7UCQB.js} +2 -2
  45. package/Build/Workers/{chunk-RR7EOKGZ.js → chunk-RJYML24O.js} +48 -85
  46. package/Build/Workers/{chunk-U4IMCOF5.js → chunk-S3PI2KFM.js} +2 -2
  47. package/Build/Workers/{chunk-6HCAQOVK.js → chunk-STBBMQGG.js} +6 -6
  48. package/Build/Workers/{chunk-CE6GTZ4I.js → chunk-SYCPRK3D.js} +10 -10
  49. package/Build/Workers/{chunk-WFICTTOE.js → chunk-T77JILCU.js} +2 -2
  50. package/Build/Workers/{chunk-ZC4AGBZK.js → chunk-TO2PVHKI.js} +2 -2
  51. package/Build/Workers/{chunk-UCPPWV64.js → chunk-VE7BFUIX.js} +1 -1
  52. package/Build/Workers/{chunk-2CSEEWHN.js → chunk-VFBNELXB.js} +7 -7
  53. package/Build/Workers/{chunk-A6NCZSL3.js → chunk-VO3ACQB2.js} +19 -19
  54. package/Build/Workers/{chunk-WEGCQ5DY.js → chunk-X23FRWHJ.js} +6 -6
  55. package/Build/Workers/{chunk-G7CJQKKD.js → chunk-XD445VDH.js} +7 -7
  56. package/Build/Workers/combineGeometry.js +22 -22
  57. package/Build/Workers/createBoxGeometry.js +16 -16
  58. package/Build/Workers/createBoxOutlineGeometry.js +14 -14
  59. package/Build/Workers/createCircleGeometry.js +29 -25
  60. package/Build/Workers/createCircleOutlineGeometry.js +17 -17
  61. package/Build/Workers/createCoplanarPolygonGeometry.js +32 -32
  62. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
  63. package/Build/Workers/createCorridorGeometry.js +29 -29
  64. package/Build/Workers/createCorridorOutlineGeometry.js +27 -27
  65. package/Build/Workers/createCylinderGeometry.js +18 -18
  66. package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
  67. package/Build/Workers/createEllipseGeometry.js +24 -24
  68. package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
  69. package/Build/Workers/createEllipsoidGeometry.js +17 -17
  70. package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
  71. package/Build/Workers/createFrustumGeometry.js +16 -16
  72. package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
  73. package/Build/Workers/createGeometry.js +22 -22
  74. package/Build/Workers/createGroundPolylineGeometry.js +24 -24
  75. package/Build/Workers/createPlaneGeometry.js +14 -14
  76. package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
  77. package/Build/Workers/createPolygonGeometry.js +32 -32
  78. package/Build/Workers/createPolygonOutlineGeometry.js +29 -29
  79. package/Build/Workers/createPolylineGeometry.js +24 -24
  80. package/Build/Workers/createPolylineVolumeGeometry.js +30 -30
  81. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +26 -26
  82. package/Build/Workers/createRectangleGeometry.js +27 -27
  83. package/Build/Workers/createRectangleOutlineGeometry.js +19 -19
  84. package/Build/Workers/createSimplePolylineGeometry.js +22 -22
  85. package/Build/Workers/createSphereGeometry.js +17 -17
  86. package/Build/Workers/createSphereOutlineGeometry.js +16 -16
  87. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  88. package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
  89. package/Build/Workers/createVectorTileGeometries.js +22 -22
  90. package/Build/Workers/createVectorTilePoints.js +12 -12
  91. package/Build/Workers/createVectorTilePolygons.js +20 -20
  92. package/Build/Workers/createVectorTilePolylines.js +13 -13
  93. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
  94. package/Build/Workers/createVerticesFromHeightmap.js +21 -21
  95. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
  96. package/Build/Workers/createWallGeometry.js +23 -23
  97. package/Build/Workers/createWallOutlineGeometry.js +22 -22
  98. package/Build/Workers/decodeDraco.js +11 -11
  99. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +12 -19
  100. package/Build/Workers/decodeI3S.js +10 -10
  101. package/Build/Workers/transcodeKTX2.js +43 -79
  102. package/Build/Workers/transferTypedArrayTest.js +1 -1
  103. package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
  104. package/Source/Core/ApproximateTerrainHeights.js +4 -4
  105. package/Source/Core/ArcGISTiledElevationTerrainProvider.js +12 -8
  106. package/Source/Core/BoundingRectangle.js +2 -0
  107. package/Source/Core/BoundingSphere.js +4 -2
  108. package/Source/Core/Cartesian3.js +13 -10
  109. package/Source/Core/Cartographic.js +11 -8
  110. package/Source/Core/CesiumTerrainProvider.js +3 -2
  111. package/Source/Core/CircleGeometry.js +6 -2
  112. package/Source/Core/CircleOutlineGeometry.js +1 -1
  113. package/Source/Core/CoplanarPolygonGeometry.js +3 -3
  114. package/Source/Core/CorridorGeometry.js +4 -4
  115. package/Source/Core/CorridorOutlineGeometry.js +2 -2
  116. package/Source/Core/Credit.js +3 -2
  117. package/Source/Core/CustomHeightmapTerrainProvider.js +17 -3
  118. package/Source/Core/EllipseGeometry.js +4 -4
  119. package/Source/Core/EllipseOutlineGeometry.js +2 -2
  120. package/Source/Core/Ellipsoid.js +34 -0
  121. package/Source/Core/EllipsoidGeodesic.js +2 -2
  122. package/Source/Core/EllipsoidRhumbLine.js +4 -4
  123. package/Source/Core/EllipsoidTangentPlane.js +3 -3
  124. package/Source/Core/EllipsoidTerrainProvider.js +3 -3
  125. package/Source/Core/GeographicProjection.js +4 -3
  126. package/Source/Core/GeographicTilingScheme.js +3 -3
  127. package/Source/Core/GeometryPipeline.js +2 -2
  128. package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +1 -1
  129. package/Source/Core/GoogleMaps.js +1 -1
  130. package/Source/Core/GroundPolylineGeometry.js +1 -1
  131. package/Source/Core/HeightmapTessellator.js +2 -2
  132. package/Source/Core/Ion.js +1 -1
  133. package/Source/Core/Math.js +0 -5
  134. package/Source/Core/Occluder.js +3 -3
  135. package/Source/Core/OrientedBoundingBox.js +2 -2
  136. package/Source/Core/PolygonGeometry.js +4 -4
  137. package/Source/Core/PolygonGeometryLibrary.js +1 -1
  138. package/Source/Core/PolygonOutlineGeometry.js +3 -3
  139. package/Source/Core/PolygonPipeline.js +2 -2
  140. package/Source/Core/PolylineGeometry.js +2 -2
  141. package/Source/Core/PolylinePipeline.js +6 -6
  142. package/Source/Core/PolylineVolumeGeometry.js +2 -2
  143. package/Source/Core/PolylineVolumeOutlineGeometry.js +2 -2
  144. package/Source/Core/Rectangle.js +6 -6
  145. package/Source/Core/RectangleGeometry.js +6 -6
  146. package/Source/Core/RectangleGeometryLibrary.js +3 -0
  147. package/Source/Core/RectangleOutlineGeometry.js +2 -2
  148. package/Source/Core/Simon1994PlanetaryPositions.js +3 -2
  149. package/Source/Core/SimplePolylineGeometry.js +2 -2
  150. package/Source/Core/Stereographic.js +2 -2
  151. package/Source/Core/TaskProcessor.js +19 -3
  152. package/Source/Core/Transforms.js +17 -17
  153. package/Source/Core/VRTheWorldTerrainProvider.js +2 -2
  154. package/Source/Core/WallGeometry.js +3 -3
  155. package/Source/Core/WallOutlineGeometry.js +3 -3
  156. package/Source/Core/WebMercatorTilingScheme.js +3 -3
  157. package/Source/Core/createWorldTerrainAsync.js +2 -0
  158. package/Source/Core/sampleTerrain.js +3 -3
  159. package/Source/DataSources/BoxGeometryUpdater.js +2 -2
  160. package/Source/DataSources/CylinderGeometryUpdater.js +2 -2
  161. package/Source/DataSources/CzmlDataSource.js +8 -8
  162. package/Source/DataSources/EllipsoidGeometryUpdater.js +3 -3
  163. package/Source/DataSources/EntityCluster.js +1 -1
  164. package/Source/DataSources/EntityView.js +2 -2
  165. package/Source/DataSources/KmlDataSource.js +4 -4
  166. package/Source/DataSources/ModelVisualizer.js +1 -2
  167. package/Source/DataSources/PolygonGeometryUpdater.js +1 -1
  168. package/Source/DataSources/PolylineGeometryUpdater.js +3 -2
  169. package/Source/DataSources/RectangleGeometryUpdater.js +1 -1
  170. package/Source/DataSources/ScaledPositionProperty.js +2 -2
  171. package/Source/DataSources/TerrainOffsetProperty.js +3 -7
  172. package/Source/DataSources/VelocityOrientationProperty.js +2 -2
  173. package/Source/DataSources/exportKml.js +2 -2
  174. package/Source/Renderer/UniformState.js +1 -1
  175. package/Source/Scene/ArcGisMapServerImageryProvider.js +2 -2
  176. package/Source/Scene/ArcGisMapService.js +1 -1
  177. package/Source/Scene/Billboard.js +8 -6
  178. package/Source/Scene/BingMapsImageryProvider.js +1 -1
  179. package/Source/Scene/Camera.js +16 -10
  180. package/Source/Scene/Cesium3DTileset.js +1 -1
  181. package/Source/Scene/ClippingPolygon.js +2 -2
  182. package/Source/Scene/ClippingPolygonCollection.js +1 -1
  183. package/Source/Scene/CreditDisplay.js +94 -104
  184. package/Source/Scene/Globe.js +16 -13
  185. package/Source/Scene/GltfLoader.js +458 -435
  186. package/Source/Scene/GltfLoaderUtil.js +5 -16
  187. package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +23 -7
  188. package/Source/Scene/GltfStructuralMetadataLoader.js +11 -9
  189. package/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +1 -1
  190. package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +1 -1
  191. package/Source/Scene/GridImageryProvider.js +2 -2
  192. package/Source/Scene/ImageryLayerCollection.js +2 -2
  193. package/Source/Scene/Label.js +1 -1
  194. package/Source/Scene/MapboxImageryProvider.js +1 -1
  195. package/Source/Scene/MapboxStyleImageryProvider.js +1 -1
  196. package/Source/Scene/MetadataSemantic.js +4 -4
  197. package/Source/Scene/Model/AlphaPipelineStage.js +1 -1
  198. package/Source/Scene/Model/GeometryPipelineStage.js +15 -43
  199. package/Source/Scene/Model/ImageBasedLightingPipelineStage.js +7 -0
  200. package/Source/Scene/Model/InstancingPipelineStage.js +3 -3
  201. package/Source/Scene/Model/LightingPipelineStage.js +2 -4
  202. package/Source/Scene/Model/MaterialPipelineStage.js +395 -29
  203. package/Source/Scene/Model/Model.js +15 -7
  204. package/Source/Scene/Model/ModelSceneGraph.js +1 -1
  205. package/Source/Scene/Model/ModelUtility.js +3 -0
  206. package/Source/Scene/Model/SceneMode2DPipelineStage.js +3 -3
  207. package/Source/Scene/Model/VerticalExaggerationPipelineStage.js +4 -6
  208. package/Source/Scene/Model/pickModel.js +2 -2
  209. package/Source/Scene/ModelComponents.js +178 -1
  210. package/Source/Scene/PickDepth.js +23 -15
  211. package/Source/Scene/Picking.js +4 -13
  212. package/Source/Scene/PointPrimitive.js +5 -2
  213. package/Source/Scene/ResourceCache.js +41 -50
  214. package/Source/Scene/ResourceCacheKey.js +41 -53
  215. package/Source/Scene/Scene.js +39 -31
  216. package/Source/Scene/SceneTransforms.js +78 -20
  217. package/Source/Scene/SceneTransitioner.js +2 -2
  218. package/Source/Scene/ScreenSpaceCameraController.js +29 -19
  219. package/Source/Scene/SkyBox.js +26 -0
  220. package/Source/Scene/Sun.js +1 -1
  221. package/Source/Shaders/Builtin/CzmBuiltins.js +4 -10
  222. package/Source/Shaders/Builtin/Functions/ellipsoidTextureCoordinates.glsl +10 -0
  223. package/Source/Shaders/Builtin/Functions/{ellipsoidWgs84TextureCoordinates.js → ellipsoidTextureCoordinates.js} +3 -3
  224. package/Source/Shaders/Builtin/Functions/maximumComponent.glsl +21 -0
  225. package/Source/Shaders/Builtin/Functions/maximumComponent.js +23 -0
  226. package/Source/Shaders/Builtin/Functions/pbrLighting.glsl +108 -44
  227. package/Source/Shaders/Builtin/Functions/pbrLighting.js +108 -44
  228. package/Source/Shaders/Builtin/Structs/materialInput.glsl +1 -1
  229. package/Source/Shaders/Builtin/Structs/materialInput.js +1 -1
  230. package/Source/Shaders/Builtin/Structs/modelMaterial.glsl +16 -0
  231. package/Source/Shaders/Builtin/Structs/modelMaterial.js +16 -0
  232. package/Source/Shaders/EllipsoidFS.glsl +1 -1
  233. package/Source/Shaders/EllipsoidFS.js +1 -1
  234. package/Source/Shaders/GlobeFS.glsl +3 -3
  235. package/Source/Shaders/GlobeFS.js +3 -3
  236. package/Source/Shaders/Model/ImageBasedLightingStageFS.glsl +211 -133
  237. package/Source/Shaders/Model/ImageBasedLightingStageFS.js +212 -133
  238. package/Source/Shaders/Model/LightingStageFS.glsl +113 -48
  239. package/Source/Shaders/Model/LightingStageFS.js +113 -48
  240. package/Source/Shaders/Model/MaterialStageFS.glsl +407 -136
  241. package/Source/Shaders/Model/MaterialStageFS.js +407 -136
  242. package/Source/Widget/CesiumWidget.css +0 -5
  243. package/Source/Widget/CesiumWidget.js +29 -28
  244. package/index.d.ts +184 -116
  245. package/index.js +92 -95
  246. package/package.json +2 -2
  247. package/Source/Shaders/Builtin/Functions/defaultPbrMaterial.glsl +0 -16
  248. package/Source/Shaders/Builtin/Functions/defaultPbrMaterial.js +0 -18
  249. package/Source/Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates.glsl +0 -10
  250. package/Source/Shaders/Builtin/Functions/pbrMetallicRoughnessMaterial.glsl +0 -37
  251. package/Source/Shaders/Builtin/Functions/pbrMetallicRoughnessMaterial.js +0 -39
  252. package/Source/Shaders/Builtin/Functions/pbrSpecularGlossinessMaterial.glsl +0 -30
  253. package/Source/Shaders/Builtin/Functions/pbrSpecularGlossinessMaterial.js +0 -32
  254. package/Source/Shaders/Builtin/Structs/pbrParameters.glsl +0 -16
  255. package/Source/Shaders/Builtin/Structs/pbrParameters.js +0 -18
@@ -35,7 +35,7 @@ const scratchBoundingSphere = new BoundingSphere();
35
35
  * @param {FrameState} frameState The frame state.
36
36
  * @param {number} [verticalExaggeration=1.0] A scalar used to exaggerate the height of a position relative to the ellipsoid. If the value is 1.0 there will be no effect.
37
37
  * @param {number} [relativeHeight=0.0] The ellipsoid height relative to which a position is exaggerated. If the value is 0.0 the position will be exaggerated relative to the ellipsoid surface.
38
- * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to which the exaggerated position is relative.
38
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid to which the exaggerated position is relative.
39
39
  * @param {Cartesian3|undefined} [result] The intersection or <code>undefined</code> if none was found.
40
40
  * @returns {Cartesian3|undefined} The intersection or <code>undefined</code> if none was found.
41
41
  *
@@ -280,7 +280,7 @@ export default function pickModel(
280
280
  return;
281
281
  }
282
282
 
283
- ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);
283
+ ellipsoid = defaultValue(ellipsoid, Ellipsoid.default);
284
284
  verticalExaggeration = defaultValue(verticalExaggeration, 1.0);
285
285
  relativeHeight = defaultValue(relativeHeight, 0.0);
286
286
 
@@ -1187,6 +1187,15 @@ function TextureReader() {
1187
1187
  */
1188
1188
  this.transform = Matrix3.clone(Matrix3.IDENTITY);
1189
1189
 
1190
+ /**
1191
+ * Scale to apply to texture values.
1192
+ *
1193
+ * @type {number}
1194
+ * @default 1.0
1195
+ * @private
1196
+ */
1197
+ this.scale = 1.0;
1198
+
1190
1199
  /**
1191
1200
  * The texture channels to read from. When undefined all channels are read.
1192
1201
  *
@@ -1337,10 +1346,151 @@ SpecularGlossiness.DEFAULT_SPECULAR_FACTOR = Cartesian3.ONE;
1337
1346
  */
1338
1347
  SpecularGlossiness.DEFAULT_GLOSSINESS_FACTOR = 1.0;
1339
1348
 
1349
+ function Specular() {
1350
+ /**
1351
+ * The specular factor.
1352
+ *
1353
+ * @type {number}
1354
+ * @default 1.0
1355
+ * @private
1356
+ */
1357
+ this.specularFactor = Specular.DEFAULT_SPECULAR_FACTOR;
1358
+
1359
+ /**
1360
+ * The specular texture reader.
1361
+ *
1362
+ * @type {ModelComponents.TextureReader}
1363
+ * @private
1364
+ */
1365
+ this.specularTexture = undefined;
1366
+
1367
+ /**
1368
+ * The specular color factor.
1369
+ *
1370
+ * @type {Cartesian3}
1371
+ * @default new Cartesian3(1.0, 1.0, 1.0)
1372
+ * @private
1373
+ */
1374
+ this.specularColorFactor = Cartesian3.clone(
1375
+ Specular.DEFAULT_SPECULAR_COLOR_FACTOR
1376
+ );
1377
+
1378
+ /**
1379
+ * The specular color texture reader.
1380
+ *
1381
+ * @type {ModelComponents.TextureReader}
1382
+ * @private
1383
+ */
1384
+ this.specularColorTexture = undefined;
1385
+ }
1386
+
1387
+ /**
1388
+ * @private
1389
+ */
1390
+ Specular.DEFAULT_SPECULAR_FACTOR = 1.0;
1391
+
1392
+ /**
1393
+ * @private
1394
+ */
1395
+ Specular.DEFAULT_SPECULAR_COLOR_FACTOR = Cartesian3.ONE;
1396
+
1397
+ function Anisotropy() {
1398
+ /**
1399
+ * The anisotropy strength.
1400
+ *
1401
+ * @type {number}
1402
+ * @default 0.0
1403
+ * @private
1404
+ */
1405
+ this.anisotropyStrength = Anisotropy.DEFAULT_ANISOTROPY_STRENGTH;
1406
+
1407
+ /**
1408
+ * The rotation of the anisotropy in tangent, bitangent space,
1409
+ * measured in radians counter-clockwise from the tangent.
1410
+ *
1411
+ * @type {number}
1412
+ * @default 0.0
1413
+ * @private
1414
+ */
1415
+ this.anisotropyRotation = Anisotropy.DEFAULT_ANISOTROPY_ROTATION;
1416
+
1417
+ /**
1418
+ * The anisotropy texture reader.
1419
+ *
1420
+ * @type {ModelComponents.TextureReader}
1421
+ * @private
1422
+ */
1423
+ this.anisotropyTexture = undefined;
1424
+ }
1425
+
1426
+ /**
1427
+ * @private
1428
+ */
1429
+ Anisotropy.DEFAULT_ANISOTROPY_STRENGTH = 0.0;
1430
+
1431
+ /**
1432
+ * @private
1433
+ */
1434
+ Anisotropy.DEFAULT_ANISOTROPY_ROTATION = 0.0;
1435
+
1436
+ function Clearcoat() {
1437
+ /**
1438
+ * The clearcoat layer intensity.
1439
+ *
1440
+ * @type {number}
1441
+ * @default 0.0
1442
+ * @private
1443
+ */
1444
+ this.clearcoatFactor = Clearcoat.DEFAULT_CLEARCOAT_FACTOR;
1445
+
1446
+ /**
1447
+ * The clearcoat layer intensity texture reader.
1448
+ *
1449
+ * @type {ModelComponents.TextureReader}
1450
+ * @private
1451
+ */
1452
+ this.clearcoatTexture = undefined;
1453
+
1454
+ /**
1455
+ * The clearcoat layer roughness.
1456
+ *
1457
+ * @type {number}
1458
+ * @default 0.0
1459
+ * @private
1460
+ */
1461
+ this.clearcoatRoughnessFactor = Clearcoat.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR;
1462
+
1463
+ /**
1464
+ * The clearcoat layer roughness texture.
1465
+ *
1466
+ * @type {ModelComponents.TextureReader}
1467
+ * @private
1468
+ */
1469
+ this.clearcoatRoughnessTexture = undefined;
1470
+
1471
+ /**
1472
+ * The clearcoat normal map texture.
1473
+ *
1474
+ * @type {ModelComponents.TextureReader}
1475
+ * @private
1476
+ */
1477
+ this.clearcoatNormalTexture = undefined;
1478
+ }
1479
+
1480
+ /**
1481
+ * @private
1482
+ */
1483
+ Clearcoat.DEFAULT_CLEARCOAT_FACTOR = 0.0;
1484
+
1485
+ /**
1486
+ * @private
1487
+ */
1488
+ Clearcoat.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR = 0.0;
1489
+
1340
1490
  /**
1341
1491
  * The material appearance of a primitive.
1342
1492
  *
1343
- * @alias ModelComponent.Material
1493
+ * @alias ModelComponents.Material
1344
1494
  * @constructor
1345
1495
  *
1346
1496
  * @private
@@ -1362,6 +1512,30 @@ function Material() {
1362
1512
  */
1363
1513
  this.specularGlossiness = undefined;
1364
1514
 
1515
+ /**
1516
+ * Material properties for the PBR specular shading model.
1517
+ *
1518
+ * @type {ModelComponents.Specular}
1519
+ * @private
1520
+ */
1521
+ this.specular = undefined;
1522
+
1523
+ /**
1524
+ * Material properties for the PBR anisotropy shading model.
1525
+ *
1526
+ * @type {ModelComponents.Anisotropy}
1527
+ * @private
1528
+ */
1529
+ this.anisotropy = undefined;
1530
+
1531
+ /**
1532
+ * Material properties for the PBR clearcoat shading model.
1533
+ *
1534
+ * @type {ModelComponents.Clearcoat}
1535
+ * @private
1536
+ */
1537
+ this.clearcoat = undefined;
1538
+
1365
1539
  /**
1366
1540
  * The emissive texture reader.
1367
1541
  *
@@ -1461,6 +1635,9 @@ ModelComponents.Components = Components;
1461
1635
  ModelComponents.TextureReader = TextureReader;
1462
1636
  ModelComponents.MetallicRoughness = MetallicRoughness;
1463
1637
  ModelComponents.SpecularGlossiness = SpecularGlossiness;
1638
+ ModelComponents.Specular = Specular;
1639
+ ModelComponents.Anisotropy = Anisotropy;
1640
+ ModelComponents.Clearcoat = Clearcoat;
1464
1641
  ModelComponents.Material = Material;
1465
1642
 
1466
1643
  export default ModelComponents;
@@ -30,22 +30,30 @@ function updateFramebuffers(pickDepth, context, depthTexture) {
30
30
 
31
31
  function updateCopyCommands(pickDepth, context, depthTexture) {
32
32
  if (!defined(pickDepth._copyDepthCommand)) {
33
- const fs =
34
- "uniform highp sampler2D u_texture;\n" +
35
- "in vec2 v_textureCoordinates;\n" +
36
- "void main()\n" +
37
- "{\n" +
38
- " out_FragColor = czm_packDepth(texture(u_texture, v_textureCoordinates).r);\n" +
39
- "}\n";
40
- pickDepth._copyDepthCommand = context.createViewportQuadCommand(fs, {
41
- renderState: RenderState.fromCache(),
42
- uniformMap: {
43
- u_texture: function () {
44
- return pickDepth._textureToCopy;
33
+ pickDepth._copyDepthCommand = context.createViewportQuadCommand(
34
+ `uniform highp sampler2D colorTexture;
35
+
36
+ in vec2 v_textureCoordinates;
37
+
38
+ void main()
39
+ {
40
+ vec4 globeDepthPacked = texture(czm_globeDepthTexture, v_textureCoordinates);
41
+ float globeDepth = czm_unpackDepth(globeDepthPacked);
42
+ float depth = texture(colorTexture, v_textureCoordinates).r;
43
+ out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0,
44
+ czm_packDepth(depth), globeDepthPacked);
45
+ }
46
+ `,
47
+ {
48
+ renderState: RenderState.fromCache(),
49
+ uniformMap: {
50
+ colorTexture: function () {
51
+ return pickDepth._textureToCopy;
52
+ },
45
53
  },
46
- },
47
- owner: pickDepth,
48
- });
54
+ owner: pickDepth,
55
+ }
56
+ );
49
57
  }
50
58
 
51
59
  pickDepth._textureToCopy = depthTexture;
@@ -525,7 +525,7 @@ Picking.prototype.pickPositionWorldCoordinates = function (
525
525
  uniformState.updateFrustum(frustum);
526
526
  }
527
527
 
528
- result = SceneTransforms.drawingBufferToWgs84Coordinates(
528
+ result = SceneTransforms.drawingBufferToWorldCoordinates(
529
529
  scene,
530
530
  drawingBufferPosition,
531
531
  depth,
@@ -1112,10 +1112,7 @@ const scratchSurfaceRay = new Ray();
1112
1112
  const scratchCartographic = new Cartographic();
1113
1113
 
1114
1114
  function getRayForSampleHeight(scene, cartographic) {
1115
- const globe = scene.globe;
1116
- const ellipsoid = defined(globe)
1117
- ? globe.ellipsoid
1118
- : scene.mapProjection.ellipsoid;
1115
+ const ellipsoid = scene.ellipsoid;
1119
1116
  const height = ApproximateTerrainHeights._defaultMaxTerrainHeight;
1120
1117
  const surfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic(
1121
1118
  cartographic,
@@ -1136,10 +1133,7 @@ function getRayForSampleHeight(scene, cartographic) {
1136
1133
  }
1137
1134
 
1138
1135
  function getRayForClampToHeight(scene, cartesian) {
1139
- const globe = scene.globe;
1140
- const ellipsoid = defined(globe)
1141
- ? globe.ellipsoid
1142
- : scene.mapProjection.ellipsoid;
1136
+ const ellipsoid = scene.ellipsoid;
1143
1137
  const cartographic = Cartographic.fromCartesian(
1144
1138
  cartesian,
1145
1139
  ellipsoid,
@@ -1149,10 +1143,7 @@ function getRayForClampToHeight(scene, cartesian) {
1149
1143
  }
1150
1144
 
1151
1145
  function getHeightFromCartesian(scene, cartesian) {
1152
- const globe = scene.globe;
1153
- const ellipsoid = defined(globe)
1154
- ? globe.ellipsoid
1155
- : scene.mapProjection.ellipsoid;
1146
+ const ellipsoid = scene.ellipsoid;
1156
1147
  const cartographic = Cartographic.fromCartesian(
1157
1148
  cartesian,
1158
1149
  ellipsoid,
@@ -520,7 +520,10 @@ PointPrimitive._computeActualPosition = function (
520
520
  }
521
521
 
522
522
  Matrix4.multiplyByPoint(modelMatrix, position, tempCartesian3);
523
- return SceneTransforms.computeActualWgs84Position(frameState, tempCartesian3);
523
+ return SceneTransforms.computeActualEllipsoidPosition(
524
+ frameState,
525
+ tempCartesian3
526
+ );
524
527
  };
525
528
 
526
529
  const scratchCartesian4 = new Cartesian4();
@@ -544,7 +547,7 @@ PointPrimitive._computeScreenSpacePosition = function (
544
547
  ),
545
548
  scratchCartesian4
546
549
  );
547
- const positionWC = SceneTransforms.wgs84ToWindowCoordinates(
550
+ const positionWC = SceneTransforms.worldToWindowCoordinates(
548
551
  scene,
549
552
  positionWorld,
550
553
  result
@@ -146,8 +146,7 @@ ResourceCache.unload = function (resourceLoader) {
146
146
  */
147
147
  ResourceCache.getSchemaLoader = function (options) {
148
148
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
149
- const schema = options.schema;
150
- const resource = options.resource;
149
+ const { schema, resource } = options;
151
150
 
152
151
  //>>includeStart('debug', pragmas.debug);
153
152
  if (defined(schema) === defined(resource)) {
@@ -189,9 +188,7 @@ ResourceCache.getSchemaLoader = function (options) {
189
188
  */
190
189
  ResourceCache.getEmbeddedBufferLoader = function (options) {
191
190
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
192
- const parentResource = options.parentResource;
193
- const bufferId = options.bufferId;
194
- const typedArray = options.typedArray;
191
+ const { parentResource, bufferId, typedArray } = options;
195
192
 
196
193
  //>>includeStart('debug', pragmas.debug);
197
194
  Check.typeOf.object("options.parentResource", parentResource);
@@ -231,7 +228,7 @@ ResourceCache.getEmbeddedBufferLoader = function (options) {
231
228
  */
232
229
  ResourceCache.getExternalBufferLoader = function (options) {
233
230
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
234
- const resource = options.resource;
231
+ const { resource } = options;
235
232
 
236
233
  //>>includeStart('debug', pragmas.debug);
237
234
  Check.typeOf.object("options.resource", resource);
@@ -268,10 +265,7 @@ ResourceCache.getExternalBufferLoader = function (options) {
268
265
  */
269
266
  ResourceCache.getGltfJsonLoader = function (options) {
270
267
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
271
- const gltfResource = options.gltfResource;
272
- const baseResource = options.baseResource;
273
- const typedArray = options.typedArray;
274
- const gltfJson = options.gltfJson;
268
+ const { gltfResource, baseResource, typedArray, gltfJson } = options;
275
269
 
276
270
  //>>includeStart('debug', pragmas.debug);
277
271
  Check.typeOf.object("options.gltfResource", gltfResource);
@@ -313,10 +307,7 @@ ResourceCache.getGltfJsonLoader = function (options) {
313
307
  */
314
308
  ResourceCache.getBufferViewLoader = function (options) {
315
309
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
316
- const gltf = options.gltf;
317
- const bufferViewId = options.bufferViewId;
318
- const gltfResource = options.gltfResource;
319
- const baseResource = options.baseResource;
310
+ const { gltf, bufferViewId, gltfResource, baseResource } = options;
320
311
 
321
312
  //>>includeStart('debug', pragmas.debug);
322
313
  Check.typeOf.object("options.gltf", gltf);
@@ -363,10 +354,7 @@ ResourceCache.getBufferViewLoader = function (options) {
363
354
  */
364
355
  ResourceCache.getDracoLoader = function (options) {
365
356
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
366
- const gltf = options.gltf;
367
- const draco = options.draco;
368
- const gltfResource = options.gltfResource;
369
- const baseResource = options.baseResource;
357
+ const { gltf, draco, gltfResource, baseResource } = options;
370
358
 
371
359
  //>>includeStart('debug', pragmas.debug);
372
360
  Check.typeOf.object("options.gltf", gltf);
@@ -424,18 +412,20 @@ ResourceCache.getDracoLoader = function (options) {
424
412
  */
425
413
  ResourceCache.getVertexBufferLoader = function (options) {
426
414
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
427
- const gltf = options.gltf;
428
- const gltfResource = options.gltfResource;
429
- const baseResource = options.baseResource;
430
- const frameState = options.frameState;
431
- const bufferViewId = options.bufferViewId;
432
- const draco = options.draco;
433
- const attributeSemantic = options.attributeSemantic;
434
- const accessorId = options.accessorId;
435
- const asynchronous = defaultValue(options.asynchronous, true);
436
- const dequantize = defaultValue(options.dequantize, false);
437
- const loadBuffer = defaultValue(options.loadBuffer, false);
438
- const loadTypedArray = defaultValue(options.loadTypedArray, false);
415
+ const {
416
+ gltf,
417
+ gltfResource,
418
+ baseResource,
419
+ frameState,
420
+ bufferViewId,
421
+ draco,
422
+ attributeSemantic,
423
+ accessorId,
424
+ asynchronous = true,
425
+ dequantize = false,
426
+ loadBuffer = false,
427
+ loadTypedArray = false,
428
+ } = options;
439
429
 
440
430
  //>>includeStart('debug', pragmas.debug);
441
431
  Check.typeOf.object("options.gltf", gltf);
@@ -541,15 +531,17 @@ function hasDracoCompression(draco, semantic) {
541
531
  */
542
532
  ResourceCache.getIndexBufferLoader = function (options) {
543
533
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
544
- const gltf = options.gltf;
545
- const accessorId = options.accessorId;
546
- const gltfResource = options.gltfResource;
547
- const baseResource = options.baseResource;
548
- const frameState = options.frameState;
549
- const draco = options.draco;
550
- const asynchronous = defaultValue(options.asynchronous, true);
551
- const loadBuffer = defaultValue(options.loadBuffer, false);
552
- const loadTypedArray = defaultValue(options.loadTypedArray, false);
534
+ const {
535
+ gltf,
536
+ accessorId,
537
+ gltfResource,
538
+ baseResource,
539
+ frameState,
540
+ draco,
541
+ asynchronous = true,
542
+ loadBuffer = false,
543
+ loadTypedArray = false,
544
+ } = options;
553
545
 
554
546
  //>>includeStart('debug', pragmas.debug);
555
547
  Check.typeOf.object("options.gltf", gltf);
@@ -610,10 +602,7 @@ ResourceCache.getIndexBufferLoader = function (options) {
610
602
  */
611
603
  ResourceCache.getImageLoader = function (options) {
612
604
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
613
- const gltf = options.gltf;
614
- const imageId = options.imageId;
615
- const gltfResource = options.gltfResource;
616
- const baseResource = options.baseResource;
605
+ const { gltf, imageId, gltfResource, baseResource } = options;
617
606
 
618
607
  //>>includeStart('debug', pragmas.debug);
619
608
  Check.typeOf.object("options.gltf", gltf);
@@ -663,13 +652,15 @@ ResourceCache.getImageLoader = function (options) {
663
652
  */
664
653
  ResourceCache.getTextureLoader = function (options) {
665
654
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
666
- const gltf = options.gltf;
667
- const textureInfo = options.textureInfo;
668
- const gltfResource = options.gltfResource;
669
- const baseResource = options.baseResource;
670
- const supportedImageFormats = options.supportedImageFormats;
671
- const frameState = options.frameState;
672
- const asynchronous = defaultValue(options.asynchronous, true);
655
+ const {
656
+ gltf,
657
+ textureInfo,
658
+ gltfResource,
659
+ baseResource,
660
+ supportedImageFormats,
661
+ frameState,
662
+ asynchronous = true,
663
+ } = options;
673
664
 
674
665
  //>>includeStart('debug', pragmas.debug);
675
666
  Check.typeOf.object("options.gltf", gltf);
@@ -20,8 +20,7 @@ function getExternalResourceCacheKey(resource) {
20
20
  }
21
21
 
22
22
  function getBufferViewCacheKey(bufferView) {
23
- let byteOffset = bufferView.byteOffset;
24
- let byteLength = bufferView.byteLength;
23
+ let { byteOffset, byteLength } = bufferView;
25
24
 
26
25
  if (hasExtension(bufferView, "EXT_meshopt_compression")) {
27
26
  const meshopt = bufferView.extensions.EXT_meshopt_compression;
@@ -34,16 +33,10 @@ function getBufferViewCacheKey(bufferView) {
34
33
 
35
34
  function getAccessorCacheKey(accessor, bufferView) {
36
35
  const byteOffset = bufferView.byteOffset + accessor.byteOffset;
37
- const componentType = accessor.componentType;
38
- const type = accessor.type;
39
- const count = accessor.count;
36
+ const { componentType, type, count } = accessor;
40
37
  return `${byteOffset}-${componentType}-${type}-${count}`;
41
38
  }
42
39
 
43
- function getExternalBufferCacheKey(resource) {
44
- return getExternalResourceCacheKey(resource);
45
- }
46
-
47
40
  function getEmbeddedBufferCacheKey(parentResource, bufferId) {
48
41
  const parentCacheKey = getExternalResourceCacheKey(parentResource);
49
42
  return `${parentCacheKey}-buffer-id-${bufferId}`;
@@ -54,7 +47,7 @@ function getBufferCacheKey(buffer, bufferId, gltfResource, baseResource) {
54
47
  const resource = baseResource.getDerivedResource({
55
48
  url: buffer.uri,
56
49
  });
57
- return getExternalBufferCacheKey(resource);
50
+ return getExternalResourceCacheKey(resource);
58
51
  }
59
52
 
60
53
  return getEmbeddedBufferCacheKey(gltfResource, bufferId);
@@ -128,8 +121,7 @@ function getSamplerCacheKey(gltf, textureInfo) {
128
121
  * @private
129
122
  */
130
123
  ResourceCacheKey.getSchemaCacheKey = function (options) {
131
- const schema = options.schema;
132
- const resource = options.resource;
124
+ const { schema, resource } = options;
133
125
 
134
126
  //>>includeStart('debug', pragmas.debug);
135
127
  if (defined(schema) === defined(resource)) {
@@ -157,13 +149,13 @@ ResourceCacheKey.getSchemaCacheKey = function (options) {
157
149
  */
158
150
  ResourceCacheKey.getExternalBufferCacheKey = function (options) {
159
151
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
160
- const resource = options.resource;
152
+ const { resource } = options;
161
153
 
162
154
  //>>includeStart('debug', pragmas.debug);
163
155
  Check.typeOf.object("options.resource", resource);
164
156
  //>>includeEnd('debug');
165
157
 
166
- return `external-buffer:${getExternalBufferCacheKey(resource)}`;
158
+ return `external-buffer:${getExternalResourceCacheKey(resource)}`;
167
159
  };
168
160
 
169
161
  /**
@@ -178,8 +170,7 @@ ResourceCacheKey.getExternalBufferCacheKey = function (options) {
178
170
  */
179
171
  ResourceCacheKey.getEmbeddedBufferCacheKey = function (options) {
180
172
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
181
- const parentResource = options.parentResource;
182
- const bufferId = options.bufferId;
173
+ const { parentResource, bufferId } = options;
183
174
 
184
175
  //>>includeStart('debug', pragmas.debug);
185
176
  Check.typeOf.object("options.parentResource", parentResource);
@@ -203,7 +194,7 @@ ResourceCacheKey.getEmbeddedBufferCacheKey = function (options) {
203
194
  */
204
195
  ResourceCacheKey.getGltfCacheKey = function (options) {
205
196
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
206
- const gltfResource = options.gltfResource;
197
+ const { gltfResource } = options;
207
198
 
208
199
  //>>includeStart('debug', pragmas.debug);
209
200
  Check.typeOf.object("options.gltfResource", gltfResource);
@@ -226,10 +217,7 @@ ResourceCacheKey.getGltfCacheKey = function (options) {
226
217
  */
227
218
  ResourceCacheKey.getBufferViewCacheKey = function (options) {
228
219
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
229
- const gltf = options.gltf;
230
- const bufferViewId = options.bufferViewId;
231
- const gltfResource = options.gltfResource;
232
- const baseResource = options.baseResource;
220
+ const { gltf, bufferViewId, gltfResource, baseResource } = options;
233
221
 
234
222
  //>>includeStart('debug', pragmas.debug);
235
223
  Check.typeOf.object("options.gltf", gltf);
@@ -272,10 +260,7 @@ ResourceCacheKey.getBufferViewCacheKey = function (options) {
272
260
  */
273
261
  ResourceCacheKey.getDracoCacheKey = function (options) {
274
262
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
275
- const gltf = options.gltf;
276
- const draco = options.draco;
277
- const gltfResource = options.gltfResource;
278
- const baseResource = options.baseResource;
263
+ const { gltf, draco, gltfResource, baseResource } = options;
279
264
 
280
265
  //>>includeStart('debug', pragmas.debug);
281
266
  Check.typeOf.object("options.gltf", gltf);
@@ -309,16 +294,18 @@ ResourceCacheKey.getDracoCacheKey = function (options) {
309
294
  */
310
295
  ResourceCacheKey.getVertexBufferCacheKey = function (options) {
311
296
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
312
- const gltf = options.gltf;
313
- const gltfResource = options.gltfResource;
314
- const baseResource = options.baseResource;
315
- const frameState = options.frameState;
316
- const bufferViewId = options.bufferViewId;
317
- const draco = options.draco;
318
- const attributeSemantic = options.attributeSemantic;
319
- const dequantize = defaultValue(options.dequantize, false);
320
- const loadBuffer = defaultValue(options.loadBuffer, false);
321
- const loadTypedArray = defaultValue(options.loadTypedArray, false);
297
+ const {
298
+ gltf,
299
+ gltfResource,
300
+ baseResource,
301
+ frameState,
302
+ bufferViewId,
303
+ draco,
304
+ attributeSemantic,
305
+ dequantize = false,
306
+ loadBuffer = false,
307
+ loadTypedArray = false,
308
+ } = options;
322
309
 
323
310
  //>>includeStart('debug', pragmas.debug);
324
311
  Check.typeOf.object("options.gltf", gltf);
@@ -420,14 +407,16 @@ function hasDracoCompression(draco, semantic) {
420
407
  */
421
408
  ResourceCacheKey.getIndexBufferCacheKey = function (options) {
422
409
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
423
- const gltf = options.gltf;
424
- const accessorId = options.accessorId;
425
- const gltfResource = options.gltfResource;
426
- const baseResource = options.baseResource;
427
- const frameState = options.frameState;
428
- const draco = options.draco;
429
- const loadBuffer = defaultValue(options.loadBuffer, false);
430
- const loadTypedArray = defaultValue(options.loadTypedArray, false);
410
+ const {
411
+ gltf,
412
+ accessorId,
413
+ gltfResource,
414
+ baseResource,
415
+ frameState,
416
+ draco,
417
+ loadBuffer = false,
418
+ loadTypedArray = false,
419
+ } = options;
431
420
 
432
421
  //>>includeStart('debug', pragmas.debug);
433
422
  Check.typeOf.object("options.gltf", gltf);
@@ -495,10 +484,7 @@ ResourceCacheKey.getIndexBufferCacheKey = function (options) {
495
484
  */
496
485
  ResourceCacheKey.getImageCacheKey = function (options) {
497
486
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
498
- const gltf = options.gltf;
499
- const imageId = options.imageId;
500
- const gltfResource = options.gltfResource;
501
- const baseResource = options.baseResource;
487
+ const { gltf, imageId, gltfResource, baseResource } = options;
502
488
 
503
489
  //>>includeStart('debug', pragmas.debug);
504
490
  Check.typeOf.object("options.gltf", gltf);
@@ -533,12 +519,14 @@ ResourceCacheKey.getImageCacheKey = function (options) {
533
519
  */
534
520
  ResourceCacheKey.getTextureCacheKey = function (options) {
535
521
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
536
- const gltf = options.gltf;
537
- const textureInfo = options.textureInfo;
538
- const gltfResource = options.gltfResource;
539
- const baseResource = options.baseResource;
540
- const supportedImageFormats = options.supportedImageFormats;
541
- const frameState = options.frameState;
522
+ const {
523
+ gltf,
524
+ textureInfo,
525
+ gltfResource,
526
+ baseResource,
527
+ supportedImageFormats,
528
+ frameState,
529
+ } = options;
542
530
 
543
531
  //>>includeStart('debug', pragmas.debug);
544
532
  Check.typeOf.object("options.gltf", gltf);