@cesium/engine 26.1.0 → 26.2.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 (384) hide show
  1. package/Build/ThirdParty/Workers/zip-web-worker.js +586 -480
  2. package/Build/Workers/chunk-27FWRTJI.js +454 -0
  3. package/Build/Workers/chunk-2H5264K7.js +1284 -0
  4. package/Build/Workers/chunk-2H73KDBM.js +511 -0
  5. package/Build/Workers/chunk-2RGJPWQX.js +1284 -0
  6. package/Build/Workers/chunk-2Z4ZLVOD.js +352 -0
  7. package/Build/Workers/chunk-2ZKH2QZB.js +387 -0
  8. package/Build/Workers/chunk-36NI5E6W.js +3820 -0
  9. package/Build/Workers/chunk-37SW7SYS.js +778 -0
  10. package/Build/Workers/chunk-3GHVJ3SO.js +455 -0
  11. package/Build/Workers/chunk-3LB4UVPU.js +387 -0
  12. package/Build/Workers/chunk-3PONLKEL.js +778 -0
  13. package/Build/Workers/chunk-3PSS3T43.js +102 -0
  14. package/Build/Workers/chunk-3QR662HH.js +3820 -0
  15. package/Build/Workers/chunk-3SX2WYSO.js +973 -0
  16. package/Build/Workers/chunk-3UDN6LYX.js +476 -0
  17. package/Build/Workers/chunk-47MCBSXI.js +9237 -0
  18. package/Build/Workers/chunk-4E626OCE.js +1067 -0
  19. package/Build/Workers/chunk-4NW2MJKH.js +455 -0
  20. package/Build/Workers/chunk-52YK5BSN.js +198 -0
  21. package/Build/Workers/chunk-5RNAQZK6.js +9234 -0
  22. package/Build/Workers/chunk-5YPQBFRD.js +519 -0
  23. package/Build/Workers/chunk-6FHT43QR.js +140 -0
  24. package/Build/Workers/chunk-6FZDPMTO.js +455 -0
  25. package/Build/Workers/chunk-6R5X2GUA.js +1284 -0
  26. package/Build/Workers/chunk-7A2OGDHT.js +305 -0
  27. package/Build/Workers/chunk-7CGEQUM2.js +305 -0
  28. package/Build/Workers/chunk-7I325HV6.js +1344 -0
  29. package/Build/Workers/chunk-7MM3N2VE.js +1067 -0
  30. package/Build/Workers/chunk-7TKLTCZW.js +219 -0
  31. package/Build/Workers/chunk-7UUKBDH6.js +1054 -0
  32. package/Build/Workers/chunk-7W6DUHAB.js +693 -0
  33. package/Build/Workers/chunk-7XM5JK5F.js +162 -0
  34. package/Build/Workers/chunk-7YG3ND3P.js +454 -0
  35. package/Build/Workers/chunk-A62YI6S6.js +305 -0
  36. package/Build/Workers/chunk-A7TTWVTF.js +2719 -0
  37. package/Build/Workers/chunk-ACTVJHSP.js +519 -0
  38. package/Build/Workers/chunk-ADX3CBKD.js +9234 -0
  39. package/Build/Workers/chunk-AF7DTMJ7.js +398 -0
  40. package/Build/Workers/chunk-AJSFRY4U.js +1344 -0
  41. package/Build/Workers/chunk-ARZICEEP.js +301 -0
  42. package/Build/Workers/chunk-B3QHNA4A.js +147 -0
  43. package/Build/Workers/chunk-BKPQFCXH.js +511 -0
  44. package/Build/Workers/chunk-BSPCI2LO.js +959 -0
  45. package/Build/Workers/chunk-BUJWSX5S.js +301 -0
  46. package/Build/Workers/chunk-C7QDUNI3.js +138 -0
  47. package/Build/Workers/chunk-CIV5DJOQ.js +778 -0
  48. package/Build/Workers/chunk-CQNFIAZU.js +56 -0
  49. package/Build/Workers/chunk-CRCGE4J4.js +9237 -0
  50. package/Build/Workers/chunk-CUTRKXUQ.js +288 -0
  51. package/Build/Workers/chunk-D6AY775A.js +3201 -0
  52. package/Build/Workers/chunk-DSGLDRTI.js +278 -0
  53. package/Build/Workers/chunk-DZBQUULR.js +138 -0
  54. package/Build/Workers/chunk-DZUFEE4L.js +140 -0
  55. package/Build/Workers/chunk-E2NKV5YT.js +3820 -0
  56. package/Build/Workers/chunk-EB3Y5P3A.js +368 -0
  57. package/Build/Workers/chunk-ELE6SC2C.js +837 -0
  58. package/Build/Workers/chunk-EOWDZN5S.js +288 -0
  59. package/Build/Workers/chunk-ERKUET22.js +3201 -0
  60. package/Build/Workers/chunk-EZGQPOIG.js +162 -0
  61. package/Build/Workers/chunk-F2IMBMZY.js +241 -0
  62. package/Build/Workers/chunk-F4CSNRZO.js +219 -0
  63. package/Build/Workers/chunk-FBP4DUQJ.js +693 -0
  64. package/Build/Workers/chunk-FJWZMGOQ.js +1992 -0
  65. package/Build/Workers/chunk-FQ42MT7M.js +58 -0
  66. package/Build/Workers/chunk-FU4BGABC.js +398 -0
  67. package/Build/Workers/chunk-FX3VEAIU.js +2719 -0
  68. package/Build/Workers/chunk-GGNWQWSB.js +301 -0
  69. package/Build/Workers/chunk-GHXVQVUM.js +1344 -0
  70. package/Build/Workers/chunk-GNKXEN4C.js +682 -0
  71. package/Build/Workers/chunk-GVA7XQI2.js +368 -0
  72. package/Build/Workers/chunk-GXDHRC4J.js +1344 -0
  73. package/Build/Workers/chunk-GYSYP6PC.js +1067 -0
  74. package/Build/Workers/chunk-H2WCFXLP.js +241 -0
  75. package/Build/Workers/chunk-HDL4HOXZ.js +778 -0
  76. package/Build/Workers/chunk-HLW2ZRVK.js +368 -0
  77. package/Build/Workers/chunk-HT6FASOT.js +973 -0
  78. package/Build/Workers/chunk-I74ZH5LK.js +959 -0
  79. package/Build/Workers/chunk-IDVHUDZT.js +352 -0
  80. package/Build/Workers/chunk-IJZJMIUY.js +789 -0
  81. package/Build/Workers/chunk-IMBVP57H.js +44 -0
  82. package/Build/Workers/chunk-IOO7Z2AV.js +57 -0
  83. package/Build/Workers/chunk-IUIFLOYO.js +44 -0
  84. package/Build/Workers/chunk-J73T2VOY.js +171 -0
  85. package/Build/Workers/chunk-JALGQYDY.js +288 -0
  86. package/Build/Workers/chunk-JXYLJCTC.js +124 -0
  87. package/Build/Workers/chunk-K27QOAW6.js +97 -0
  88. package/Build/Workers/chunk-KMV25A63.js +789 -0
  89. package/Build/Workers/chunk-KP5QD7WU.js +693 -0
  90. package/Build/Workers/chunk-KZWFWJML.js +2719 -0
  91. package/Build/Workers/chunk-LCXRRALY.js +387 -0
  92. package/Build/Workers/chunk-LDRQSYBN.js +1800 -0
  93. package/Build/Workers/chunk-M4JZ6TSZ.js +959 -0
  94. package/Build/Workers/chunk-M6QKXVAU.js +1054 -0
  95. package/Build/Workers/chunk-MAAHFYPC.js +198 -0
  96. package/Build/Workers/chunk-MCJDRDJQ.js +102 -0
  97. package/Build/Workers/chunk-MEENMEAH.js +198 -0
  98. package/Build/Workers/chunk-NAWU5RF4.js +162 -0
  99. package/Build/Workers/chunk-NCL22ZUX.js +56 -0
  100. package/Build/Workers/chunk-NEFDMMLY.js +241 -0
  101. package/Build/Workers/chunk-NJVBJG63.js +124 -0
  102. package/Build/Workers/chunk-NLLCQBX3.js +73 -0
  103. package/Build/Workers/chunk-NSKZ6SBK.js +1483 -0
  104. package/Build/Workers/chunk-NXGQBQWE.js +837 -0
  105. package/Build/Workers/chunk-O3DKEX7Q.js +352 -0
  106. package/Build/Workers/chunk-O3XFXGPZ.js +476 -0
  107. package/Build/Workers/chunk-OA6MYL2C.js +837 -0
  108. package/Build/Workers/chunk-OHP4ELS7.js +198 -0
  109. package/Build/Workers/chunk-OZGPS7FB.js +138 -0
  110. package/Build/Workers/chunk-PCL3Y7H5.js +82 -0
  111. package/Build/Workers/chunk-PD4GK4EM.js +57 -0
  112. package/Build/Workers/chunk-PEDU33QG.js +2342 -0
  113. package/Build/Workers/chunk-PRWUMCXF.js +682 -0
  114. package/Build/Workers/chunk-PVTSNNVI.js +288 -0
  115. package/Build/Workers/chunk-QFSSCLLZ.js +973 -0
  116. package/Build/Workers/chunk-QHPZH22L.js +241 -0
  117. package/Build/Workers/chunk-QIZDWZK6.js +301 -0
  118. package/Build/Workers/chunk-QV6DG2YX.js +1483 -0
  119. package/Build/Workers/chunk-R4K7EHOU.js +171 -0
  120. package/Build/Workers/chunk-R7JGHDD6.js +789 -0
  121. package/Build/Workers/chunk-RASQEYD4.js +1483 -0
  122. package/Build/Workers/chunk-RW6ITX7Q.js +3820 -0
  123. package/Build/Workers/chunk-RYSQVJR6.js +398 -0
  124. package/Build/Workers/chunk-S6RJU5NM.js +1054 -0
  125. package/Build/Workers/chunk-SA2A2AN5.js +2342 -0
  126. package/Build/Workers/chunk-SDFHDNS4.js +147 -0
  127. package/Build/Workers/chunk-SJYSIOEM.js +414 -0
  128. package/Build/Workers/chunk-SMTGMFBL.js +97 -0
  129. package/Build/Workers/chunk-SXSP3JHS.js +38 -0
  130. package/Build/Workers/chunk-TN35HP5B.js +1067 -0
  131. package/Build/Workers/chunk-TNWKJNUZ.js +454 -0
  132. package/Build/Workers/chunk-TOAF47AQ.js +102 -0
  133. package/Build/Workers/chunk-TQ4QCOXT.js +2719 -0
  134. package/Build/Workers/chunk-TSDSILQB.js +124 -0
  135. package/Build/Workers/chunk-U5LV3F3Z.js +1054 -0
  136. package/Build/Workers/chunk-UAZUP4I5.js +1992 -0
  137. package/Build/Workers/chunk-UF46SZEZ.js +789 -0
  138. package/Build/Workers/chunk-UNRTMCET.js +398 -0
  139. package/Build/Workers/chunk-UTB7U3O6.js +1992 -0
  140. package/Build/Workers/chunk-V46YGZE6.js +352 -0
  141. package/Build/Workers/chunk-VDGOCROW.js +57 -0
  142. package/Build/Workers/chunk-VFWSSBPT.js +511 -0
  143. package/Build/Workers/chunk-VVYMXI3I.js +1284 -0
  144. package/Build/Workers/chunk-VXWHPYQM.js +837 -0
  145. package/Build/Workers/chunk-VXYUBRSB.js +219 -0
  146. package/Build/Workers/chunk-VZLDLEWI.js +387 -0
  147. package/Build/Workers/chunk-W5OCKMPJ.js +101 -0
  148. package/Build/Workers/chunk-WN3F4CVG.js +3201 -0
  149. package/Build/Workers/chunk-WPRUWXGV.js +693 -0
  150. package/Build/Workers/chunk-WTO2ERBP.js +414 -0
  151. package/Build/Workers/chunk-WVHMDVG4.js +959 -0
  152. package/Build/Workers/chunk-XCBZVTIV.js +280 -0
  153. package/Build/Workers/chunk-XGA23TAX.js +73 -0
  154. package/Build/Workers/chunk-XLQZNQ4Z.js +163 -0
  155. package/Build/Workers/chunk-XQH66YJC.js +147 -0
  156. package/Build/Workers/chunk-XTA7BXJG.js +682 -0
  157. package/Build/Workers/chunk-XTIDAFRS.js +476 -0
  158. package/Build/Workers/chunk-XUEDWBUD.js +682 -0
  159. package/Build/Workers/chunk-XYFLRH3H.js +124 -0
  160. package/Build/Workers/chunk-Y7JRTRTO.js +305 -0
  161. package/Build/Workers/chunk-Y7QSMDCJ.js +352 -0
  162. package/Build/Workers/chunk-YCB5TYTR.js +1483 -0
  163. package/Build/Workers/chunk-YEYOSTJX.js +219 -0
  164. package/Build/Workers/chunk-YGFVAGYF.js +630 -0
  165. package/Build/Workers/chunk-YIIACKQO.js +368 -0
  166. package/Build/Workers/chunk-YJGSP6PE.js +511 -0
  167. package/Build/Workers/chunk-Z4LR5EHE.js +454 -0
  168. package/Build/Workers/chunk-Z66EVE2A.js +44 -0
  169. package/Build/Workers/chunk-ZHIHHHTB.js +414 -0
  170. package/Build/Workers/chunk-ZNWHFSLE.js +171 -0
  171. package/Build/Workers/chunk-ZQLZG4IN.js +2342 -0
  172. package/Build/Workers/chunk-ZRTSMUZ2.js +414 -0
  173. package/Build/Workers/chunk-ZZUVT5BM.js +476 -0
  174. package/Build/Workers/combineGeometry.js +16 -16
  175. package/Build/Workers/createBoxGeometry.js +10 -10
  176. package/Build/Workers/createBoxOutlineGeometry.js +8 -8
  177. package/Build/Workers/createCircleGeometry.js +18 -18
  178. package/Build/Workers/createCircleOutlineGeometry.js +11 -11
  179. package/Build/Workers/createCoplanarPolygonGeometry.js +27 -27
  180. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +23 -23
  181. package/Build/Workers/createCorridorGeometry.js +23 -25
  182. package/Build/Workers/createCorridorOutlineGeometry.js +21 -23
  183. package/Build/Workers/createCylinderGeometry.js +12 -12
  184. package/Build/Workers/createCylinderOutlineGeometry.js +10 -10
  185. package/Build/Workers/createEllipseGeometry.js +18 -18
  186. package/Build/Workers/createEllipseOutlineGeometry.js +11 -11
  187. package/Build/Workers/createEllipsoidGeometry.js +11 -11
  188. package/Build/Workers/createEllipsoidOutlineGeometry.js +10 -10
  189. package/Build/Workers/createFrustumGeometry.js +11 -11
  190. package/Build/Workers/createFrustumOutlineGeometry.js +11 -11
  191. package/Build/Workers/createGeometry.js +16 -16
  192. package/Build/Workers/createGroundPolylineGeometry.js +16 -16
  193. package/Build/Workers/createPlaneGeometry.js +9 -9
  194. package/Build/Workers/createPlaneOutlineGeometry.js +8 -8
  195. package/Build/Workers/createPolygonGeometry.js +25 -25
  196. package/Build/Workers/createPolygonOutlineGeometry.js +22 -22
  197. package/Build/Workers/createPolylineGeometry.js +18 -18
  198. package/Build/Workers/createPolylineVolumeGeometry.js +24 -24
  199. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +20 -20
  200. package/Build/Workers/createRectangleGeometry.js +19 -19
  201. package/Build/Workers/createRectangleOutlineGeometry.js +13 -13
  202. package/Build/Workers/createSimplePolylineGeometry.js +16 -16
  203. package/Build/Workers/createSphereGeometry.js +11 -11
  204. package/Build/Workers/createSphereOutlineGeometry.js +10 -10
  205. package/Build/Workers/createVectorTileClampedPolylines.js +7 -7
  206. package/Build/Workers/createVectorTileGeometries.js +15 -15
  207. package/Build/Workers/createVectorTilePoints.js +6 -6
  208. package/Build/Workers/createVectorTilePolygons.js +14 -14
  209. package/Build/Workers/createVectorTilePolylines.js +7 -7
  210. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +17 -17
  211. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +14 -14
  212. package/Build/Workers/createVerticesFromHeightmap.js +14 -14
  213. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +12 -12
  214. package/Build/Workers/createWallGeometry.js +17 -17
  215. package/Build/Workers/createWallOutlineGeometry.js +17 -17
  216. package/Build/Workers/decodeDraco.js +2 -2
  217. package/Build/Workers/decodeI3S.js +5 -5
  218. package/Build/Workers/incrementallyBuildTerrainPicker.js +4 -4
  219. package/Build/Workers/upsampleQuantizedTerrainMesh.js +14 -14
  220. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +17 -17
  221. package/Source/Core/ArcGISTiledElevationTerrainProvider.js +1 -5
  222. package/Source/Core/BoundingSphere.js +0 -3
  223. package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +3 -4
  224. package/Source/Core/CoplanarPolygonGeometry.js +2 -2
  225. package/Source/Core/CorridorGeometry.js +2 -4
  226. package/Source/Core/CorridorOutlineGeometry.js +1 -3
  227. package/Source/Core/EarthOrientationParameters.js +2 -2
  228. package/Source/Core/EllipseGeometryLibrary.js +2 -2
  229. package/Source/Core/EllipsoidGeodesic.js +3 -3
  230. package/Source/Core/EllipsoidRhumbLine.js +1 -1
  231. package/Source/Core/GroundPolylineGeometry.js +2 -2
  232. package/Source/Core/Heap.js +1 -1
  233. package/Source/Core/HermitePolynomialApproximation.js +215 -179
  234. package/Source/Core/InterpolationAlgorithm.js +1 -0
  235. package/Source/Core/Ion.js +1 -1
  236. package/Source/Core/JulianDate.js +1 -1
  237. package/Source/Core/LagrangePolynomialApproximation.js +55 -52
  238. package/Source/Core/LinearApproximation.js +69 -66
  239. package/Source/Core/Math.js +59 -0
  240. package/Source/Core/Matrix2.js +2 -2
  241. package/Source/Core/Matrix3.js +2 -2
  242. package/Source/Core/OrthographicFrustum.js +1 -1
  243. package/Source/Core/PerspectiveFrustum.js +1 -1
  244. package/Source/Core/PolygonGeometry.js +2 -2
  245. package/Source/Core/PolygonGeometryLibrary.js +1 -1
  246. package/Source/Core/PolygonOutlineGeometry.js +1 -1
  247. package/Source/Core/PolylineGeometry.js +1 -1
  248. package/Source/Core/PolylineVolumeGeometryLibrary.js +1 -1
  249. package/Source/Core/Rectangle.js +7 -1
  250. package/Source/Core/RectangleOutlineGeometry.js +1 -1
  251. package/Source/Core/SimplePolylineGeometry.js +1 -1
  252. package/Source/Core/TerrainEncoding.js +2 -2
  253. package/Source/Core/TerrainPicker.js +179 -168
  254. package/Source/Core/TimeIntervalCollection.js +1 -3
  255. package/Source/Core/Tipsify.js +1 -1
  256. package/Source/Core/Transforms.js +5 -1
  257. package/Source/Core/VectorPipeline.js +1117 -0
  258. package/Source/Core/VectorProvider.js +429 -0
  259. package/Source/Core/WallOutlineGeometry.js +1 -1
  260. package/Source/Core/getTimestamp.js +4 -2
  261. package/Source/DataSources/CompositeEntityCollection.js +0 -1
  262. package/Source/DataSources/CzmlDataSource.js +2 -0
  263. package/Source/DataSources/DataSourceDisplay.js +1 -1
  264. package/Source/DataSources/GeoJsonDataSource.js +0 -1
  265. package/Source/DataSources/GeometryVisualizer.js +1 -1
  266. package/Source/DataSources/KmlDataSource.js +1 -2
  267. package/Source/DataSources/PolylineVisualizer.js +1 -1
  268. package/Source/DataSources/StaticOutlineGeometryBatch.js +1 -1
  269. package/Source/Renderer/AutomaticUniforms.js +23 -0
  270. package/Source/Renderer/Context.js +9 -3
  271. package/Source/Renderer/DrawCommand.js +22 -0
  272. package/Source/Renderer/Framebuffer.js +4 -0
  273. package/Source/Renderer/Pass.js +11 -10
  274. package/Source/Renderer/Texture.js +11 -0
  275. package/Source/Renderer/UniformState.js +7 -0
  276. package/Source/Renderer/VertexArray.js +0 -1
  277. package/Source/Scene/ArcGisMapServerImageryProvider.js +0 -5
  278. package/Source/Scene/ArcGisMapService.js +1 -1
  279. package/Source/Scene/Billboard.js +2 -1
  280. package/Source/Scene/BillboardCollection.js +7 -3
  281. package/Source/Scene/BufferPrimitiveCollection.js +27 -5
  282. package/Source/Scene/Camera.js +71 -5
  283. package/Source/Scene/Cesium3DTileset.js +1 -1
  284. package/Source/Scene/ClippingPlaneCollection.js +2 -2
  285. package/Source/Scene/Controllers/Controller.js +63 -0
  286. package/Source/Scene/Controllers/ControllerHost.js +78 -0
  287. package/Source/Scene/Controllers/HybridScreenSpacePanCameraController.js +106 -0
  288. package/Source/Scene/Controllers/MouseButton.js +32 -0
  289. package/Source/Scene/Controllers/ScreenSpaceElevatorCameraController.js +295 -0
  290. package/Source/Scene/Controllers/ScreenSpaceInputBindings.js +154 -0
  291. package/Source/Scene/Controllers/ScreenSpaceMapCameraController.js +310 -0
  292. package/Source/Scene/Controllers/ScreenSpaceTiltOrbitCameraController.js +642 -0
  293. package/Source/Scene/Controllers/ScreenSpaceZoomCameraController.js +431 -0
  294. package/Source/Scene/Controllers/defaultPickWorldPosition.js +84 -0
  295. package/Source/Scene/DerivedCommand.js +94 -0
  296. package/Source/Scene/EdgeFramebuffer.js +1 -5
  297. package/Source/Scene/FrameState.js +17 -0
  298. package/Source/Scene/Globe.js +20 -0
  299. package/Source/Scene/GlobeDepth.js +27 -1
  300. package/Source/Scene/GlobeSurfaceShaderSet.js +12 -2
  301. package/Source/Scene/GlobeSurfaceTile.js +48 -10
  302. package/Source/Scene/GlobeSurfaceTileProvider.js +121 -3
  303. package/Source/Scene/GltfLoader.js +32 -3
  304. package/Source/Scene/GltfSpzLoader.js +1 -1
  305. package/Source/Scene/GltfVertexBufferLoader.js +6 -3
  306. package/Source/Scene/I3SDataProvider.js +1 -1
  307. package/Source/Scene/I3SLayer.js +1 -1
  308. package/Source/Scene/I3SNode.js +2 -2
  309. package/Source/Scene/ImageryLayerCollection.js +188 -4
  310. package/Source/Scene/IonImageryProvider.js +1 -5
  311. package/Source/Scene/Label.js +4 -4
  312. package/Source/Scene/LabelCollection.js +1 -1
  313. package/Source/Scene/MVTDataProvider.js +2 -0
  314. package/Source/Scene/Model/B3dmLoader.js +1 -2
  315. package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +10 -8
  316. package/Source/Scene/Model/I3dmLoader.js +1 -1
  317. package/Source/Scene/Model/InstancingPipelineStage.js +4 -7
  318. package/Source/Scene/Model/MaterialPipelineStage.js +124 -1
  319. package/Source/Scene/Model/Model.js +8 -10
  320. package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +28 -1
  321. package/Source/Scene/Model/ModelDrawCommand.js +160 -16
  322. package/Source/Scene/Model/ModelDrawCommands.js +4 -0
  323. package/Source/Scene/Model/ModelSceneGraph.js +21 -0
  324. package/Source/Scene/Model/PickingPipelineStage.js +29 -0
  325. package/Source/Scene/Model/PrimitiveRenderResources.js +24 -0
  326. package/Source/Scene/ModelComponents.js +71 -0
  327. package/Source/Scene/Picking.js +16 -5
  328. package/Source/Scene/PlanarFillIdFramebuffer.js +172 -0
  329. package/Source/Scene/PntsParser.js +0 -1
  330. package/Source/Scene/PolylineCollection.js +1 -1
  331. package/Source/Scene/PostProcessStage.js +4 -2
  332. package/Source/Scene/ResourceCache.js +7 -4
  333. package/Source/Scene/ResourceCacheKey.js +16 -13
  334. package/Source/Scene/Scene.js +202 -5
  335. package/Source/Scene/ScreenSpaceCameraController.js +1 -2
  336. package/Source/Scene/ShadowMap.js +9 -3
  337. package/Source/Scene/ShadowMapShader.js +50 -2
  338. package/Source/Scene/SnapFramebuffer.js +121 -0
  339. package/Source/Scene/Snapping.js +184 -0
  340. package/Source/Scene/TerrainFillMesh.js +3 -2
  341. package/Source/Scene/UrlTemplate3DTilesDataProvider.js +1 -1
  342. package/Source/Scene/Vector3DTileContent.js +2 -3
  343. package/Source/Scene/VectorGltf3DTileContent.js +23 -3
  344. package/Source/Scene/View.js +10 -8
  345. package/Source/Scene/VoxelTraversal.js +1 -1
  346. package/Source/Scene/createElevationBandMaterial.js +1 -1
  347. package/Source/Scene/renderBufferPointCollection.js +1 -2
  348. package/Source/Scene/renderBufferPolygonCollection.js +1 -2
  349. package/Source/Scene/renderBufferPolylineCollection.js +1 -2
  350. package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +1 -1
  351. package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
  352. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +1 -1
  353. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
  354. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +1 -1
  355. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
  356. package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.glsl +9 -0
  357. package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.js +11 -0
  358. package/Source/Shaders/Builtin/Constants/passClassification.glsl +1 -1
  359. package/Source/Shaders/Builtin/Constants/passClassification.js +1 -1
  360. package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +1 -1
  361. package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +1 -1
  362. package/Source/Shaders/Builtin/Constants/passOpaque.glsl +1 -1
  363. package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
  364. package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +1 -1
  365. package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
  366. package/Source/Shaders/Builtin/Constants/passVoxels.glsl +1 -1
  367. package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
  368. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
  369. package/Source/Shaders/GlobeFS.glsl +10 -5
  370. package/Source/Shaders/GlobeFS.js +9 -5
  371. package/Source/Shaders/Materials/PolylineGlowMaterial.glsl +1 -1
  372. package/Source/Shaders/Materials/PolylineGlowMaterial.js +1 -1
  373. package/Source/Shaders/Model/MaterialStageFS.glsl +8 -2
  374. package/Source/Shaders/Model/MaterialStageFS.js +8 -2
  375. package/Source/Shaders/Model/ModelFS.glsl +105 -0
  376. package/Source/Shaders/Model/ModelFS.js +105 -0
  377. package/Source/Shaders/VectorCommon.glsl +178 -0
  378. package/Source/Shaders/VectorCommon.js +75 -0
  379. package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
  380. package/Source/ThirdParty/zip-module.wasm +0 -0
  381. package/Source/Widget/CesiumWidget.js +30 -0
  382. package/index.d.ts +770 -10
  383. package/index.js +177 -160
  384. package/package.json +1 -1
@@ -1959,7 +1959,7 @@ function spin3D(controller, startPosition, movement) {
1959
1959
  scratchMousePosition,
1960
1960
  );
1961
1961
  if (defined(mousePos)) {
1962
- let strafing = false;
1962
+ let strafing;
1963
1963
  const ray = camera.getPickRay(
1964
1964
  movement.startPosition,
1965
1965
  pickGlobeScratchRay,
@@ -2367,7 +2367,6 @@ function zoom3D(controller, startPosition, movement) {
2367
2367
  if (!defined(controller._globe) && defined(distance)) {
2368
2368
  const targetDistance = camera.getMagnitude();
2369
2369
  if (targetDistance < distance) {
2370
- intersection = undefined;
2371
2370
  distance = undefined;
2372
2371
  }
2373
2372
  }
@@ -1719,20 +1719,25 @@ function createCastDerivedCommand(
1719
1719
  const isPointLight = shadowMap._isPointLight;
1720
1720
  const usesDepthTexture = shadowMap._usesDepthTexture;
1721
1721
 
1722
+ const vertexShaderSource = shaderProgram.vertexShaderSource;
1723
+ const fragmentShaderSource = shaderProgram.fragmentShaderSource;
1724
+
1725
+ const hasClipping =
1726
+ isOpaque &&
1727
+ ShadowMapShader.hasClippingForShadowCast(fragmentShaderSource);
1728
+
1722
1729
  const keyword = ShadowMapShader.getShadowCastShaderKeyword(
1723
1730
  isPointLight,
1724
1731
  isTerrain,
1725
1732
  usesDepthTexture,
1726
1733
  isOpaque,
1734
+ hasClipping,
1727
1735
  );
1728
1736
  castShader = context.shaderCache.getDerivedShaderProgram(
1729
1737
  shaderProgram,
1730
1738
  keyword,
1731
1739
  );
1732
1740
  if (!defined(castShader)) {
1733
- const vertexShaderSource = shaderProgram.vertexShaderSource;
1734
- const fragmentShaderSource = shaderProgram.fragmentShaderSource;
1735
-
1736
1741
  const castVS = ShadowMapShader.createShadowCastVertexShader(
1737
1742
  vertexShaderSource,
1738
1743
  isPointLight,
@@ -1743,6 +1748,7 @@ function createCastDerivedCommand(
1743
1748
  isPointLight,
1744
1749
  usesDepthTexture,
1745
1750
  isOpaque,
1751
+ hasClipping,
1746
1752
  );
1747
1753
 
1748
1754
  castShader = context.shaderCache.createDerivedShaderProgram(
@@ -6,13 +6,48 @@ import ShaderSource from "../Renderer/ShaderSource.js";
6
6
  */
7
7
  function ShadowMapShader() {}
8
8
 
9
+ const clippingDefines = {
10
+ HAS_CLIPPING_PLANES: true,
11
+ ENABLE_CLIPPING_POLYGONS: true,
12
+ };
13
+
14
+ /**
15
+ * Returns true if the fragment shader clips fragments via a
16
+ * ClippingPlaneCollection or ClippingPolygonCollection, in which case the
17
+ * shadow cast pass must run the original main so that clipped fragments
18
+ * are discarded and do not cast shadows.
19
+ *
20
+ * @param {ShaderSource} fragmentShaderSource
21
+ * @returns {boolean}
22
+ */
23
+ ShadowMapShader.hasClippingForShadowCast = function (fragmentShaderSource) {
24
+ const defines = fragmentShaderSource.defines;
25
+ return (
26
+ defined(defines) &&
27
+ defines.some(function (define) {
28
+ return clippingDefines[define] === true;
29
+ })
30
+ );
31
+ };
32
+
33
+ /**
34
+ * @param {boolean} isPointLight
35
+ * @param {boolean} isTerrain
36
+ * @param {boolean} usesDepthTexture
37
+ * @param {boolean} isOpaque
38
+ * @param {boolean} hasClipping True if the fragment shader discards clipped
39
+ * fragments. Differentiates cached shader variants so that a shader that
40
+ * must call czm_shadow_cast_main() is never reused for one that does not.
41
+ * @returns {string}
42
+ */
9
43
  ShadowMapShader.getShadowCastShaderKeyword = function (
10
44
  isPointLight,
11
45
  isTerrain,
12
46
  usesDepthTexture,
13
47
  isOpaque,
48
+ hasClipping,
14
49
  ) {
15
- return `castShadow ${isPointLight} ${isTerrain} ${usesDepthTexture} ${isOpaque}`;
50
+ return `castShadow ${isPointLight} ${isTerrain} ${usesDepthTexture} ${isOpaque} ${hasClipping}`;
16
51
  };
17
52
 
18
53
  ShadowMapShader.createShadowCastVertexShader = function (
@@ -54,11 +89,22 @@ ShadowMapShader.createShadowCastVertexShader = function (
54
89
  });
55
90
  };
56
91
 
92
+ /**
93
+ * @param {ShaderSource} fs
94
+ * @param {boolean} isPointLight
95
+ * @param {boolean} usesDepthTexture
96
+ * @param {boolean} opaque
97
+ * @param {boolean} hasClipping True if the fragment shader discards clipped
98
+ * fragments. When true, czm_shadow_cast_main() (the renamed original main)
99
+ * is called first so that clipping discards execute during the shadow cast pass.
100
+ * @returns {ShaderSource}
101
+ */
57
102
  ShadowMapShader.createShadowCastFragmentShader = function (
58
103
  fs,
59
104
  isPointLight,
60
105
  usesDepthTexture,
61
106
  opaque,
107
+ hasClipping,
62
108
  ) {
63
109
  const defines = fs.defines.slice(0);
64
110
  const sources = fs.sources.slice(0);
@@ -85,7 +131,9 @@ ShadowMapShader.createShadowCastFragmentShader = function (
85
131
  fsSource += "uniform vec4 shadowMap_lightPositionEC; \n";
86
132
  }
87
133
 
88
- if (opaque) {
134
+ if (opaque && hasClipping) {
135
+ fsSource += "void main() \n" + "{ \n" + " czm_shadow_cast_main(); \n";
136
+ } else if (opaque) {
89
137
  fsSource += "void main() \n" + "{ \n";
90
138
  } else {
91
139
  fsSource +=
@@ -0,0 +1,121 @@
1
+ import BoundingRectangle from "../Core/BoundingRectangle.js";
2
+ import defined from "../Core/defined.js";
3
+ import destroyObject from "../Core/destroyObject.js";
4
+ import PixelFormat from "../Core/PixelFormat.js";
5
+ import FramebufferManager from "../Renderer/FramebufferManager.js";
6
+ import PassState from "../Renderer/PassState.js";
7
+ import PixelDatatype from "../Renderer/PixelDatatype.js";
8
+
9
+ /**
10
+ * @private
11
+ */
12
+ function SnapFramebuffer(context) {
13
+ const passState = new PassState(context);
14
+ passState.blendingEnabled = false;
15
+ passState.scissorTest = {
16
+ enabled: true,
17
+ rectangle: new BoundingRectangle(),
18
+ };
19
+ passState.viewport = new BoundingRectangle();
20
+
21
+ this._context = context;
22
+ this._fb = new FramebufferManager({
23
+ depthStencil: true,
24
+ pixelDatatype: PixelDatatype.FLOAT,
25
+ pixelFormat: PixelFormat.RGBA,
26
+ });
27
+ this._passState = passState;
28
+ }
29
+
30
+ function getSnapObjectsFromPixels(context, pixels, width, height) {
31
+ const max = Math.max(width, height);
32
+ const length = max * max;
33
+ const halfWidth = Math.floor(width * 0.5);
34
+ const halfHeight = Math.floor(height * 0.5);
35
+
36
+ let x = 0;
37
+ let y = 0;
38
+ let dx = 0;
39
+ let dy = -1;
40
+
41
+ const results = [];
42
+ for (let i = 0; i < length; ++i) {
43
+ if (
44
+ -halfWidth <= x &&
45
+ x <= halfWidth &&
46
+ -halfHeight <= y &&
47
+ y <= halfHeight
48
+ ) {
49
+ const index = 4 * ((halfHeight - y) * width + x + halfWidth);
50
+
51
+ const pickColor = pixels[index];
52
+ const object = context.getObjectByPickColor(pickColor);
53
+ if (defined(object)) {
54
+ results.push({
55
+ object: object,
56
+ isEdge: pixels[index + 1] > 0.0,
57
+ depth: pixels[index + 2],
58
+ x: x,
59
+ y: y,
60
+ });
61
+ }
62
+ }
63
+
64
+ if (x === y || (x < 0 && -x === y) || (x > 0 && x === 1 - y)) {
65
+ const temp = dx;
66
+ dx = -dy;
67
+ dy = temp;
68
+ }
69
+
70
+ x += dx;
71
+ y += dy;
72
+ }
73
+
74
+ return results;
75
+ }
76
+
77
+ SnapFramebuffer.prototype.begin = function (screenSpaceRectangle, viewport) {
78
+ const context = this._context;
79
+ const { width, height } = viewport;
80
+
81
+ BoundingRectangle.clone(
82
+ screenSpaceRectangle,
83
+ this._passState.scissorTest.rectangle,
84
+ );
85
+
86
+ this._fb.update(context, width, height);
87
+ this._passState.framebuffer = this._fb.framebuffer;
88
+
89
+ this._passState.viewport.width = width;
90
+ this._passState.viewport.height = height;
91
+
92
+ return this._passState;
93
+ };
94
+
95
+ SnapFramebuffer.prototype.end = function (screenSpaceRectangle) {
96
+ const width = screenSpaceRectangle.width ?? 1.0;
97
+ const height = screenSpaceRectangle.height ?? 1.0;
98
+
99
+ const context = this._context;
100
+ const pixels = context.readPixels({
101
+ x: screenSpaceRectangle.x,
102
+ y: screenSpaceRectangle.y,
103
+ width: width,
104
+ height: height,
105
+ pixelDatatype: PixelDatatype.FLOAT,
106
+ framebuffer: this._fb.framebuffer,
107
+ });
108
+
109
+ return getSnapObjectsFromPixels(context, pixels, width, height);
110
+ };
111
+
112
+ SnapFramebuffer.prototype.isDestroyed = function () {
113
+ return false;
114
+ };
115
+
116
+ SnapFramebuffer.prototype.destroy = function () {
117
+ this._fb.destroy();
118
+ return destroyObject(this);
119
+ };
120
+
121
+ export default SnapFramebuffer;
@@ -0,0 +1,184 @@
1
+ import BoundingRectangle from "../Core/BoundingRectangle.js";
2
+ import Cartesian2 from "../Core/Cartesian2.js";
3
+ import Cartesian3 from "../Core/Cartesian3.js";
4
+ import Check from "../Core/Check.js";
5
+ import defined from "../Core/defined.js";
6
+ import oneTimeWarning from "../Core/oneTimeWarning.js";
7
+ import Ray from "../Core/Ray.js";
8
+ import { pickBegin, pickEnd } from "./Picking.js";
9
+ import SnapFramebuffer from "./SnapFramebuffer.js";
10
+
11
+ /**
12
+ * Implementation of {@link Scene#snap}: snap-to-geometry picking.
13
+ *
14
+ * A snapping pass is an offscreen pick render (it reuses the pick render
15
+ * machinery via <code>pickBegin</code>/<code>pickEnd</code>) that targets a
16
+ * dedicated RGBA32F framebuffer instead of the RGBA8 pick framebuffer. Each
17
+ * pixel carries a fuller payload than a pick color:
18
+ * <ul>
19
+ * <li>R: pick ID (uint32)</li>
20
+ * <li>G: isEdge flag (0.0/1.0)</li>
21
+ * <li>B: linear eye-space depth (meters)</li>
22
+ * <li>A: unused</li>
23
+ * </ul>
24
+ * The payload expression is built in PickingPipelineStage (DrawCommand.snapId)
25
+ * and compiled into a snap-derived shader by
26
+ * DerivedCommand.createSnapDerivedCommand. Only commands with a
27
+ * <code>snapId</code> (i.e. Model-pipeline primitives) render during a
28
+ * snapping pass.
29
+ *
30
+ * @namespace Snapping
31
+ *
32
+ * @private
33
+ */
34
+ const Snapping = {};
35
+
36
+ const scratchRectangle = new BoundingRectangle(0.0, 0.0, 3.0, 3.0);
37
+ const scratchSnapCoord = new Cartesian2();
38
+ const scratchSnapRay = new Ray();
39
+ const scratchSnapOffset = new Cartesian3();
40
+
41
+ // Radius around the crosshair, in pixels, used to sample the nearest surface
42
+ // (the occluder the cursor is on).
43
+ const SNAP_OCCLUDER_RADIUS_PIXELS = 3.0;
44
+
45
+ // An edge more than this fraction deeper than that surface is treated as
46
+ // occluded by it (the edge is only visible because it pokes through a gap in a
47
+ // nearer silhouette), so snap doesn't punch through to geometry behind the
48
+ // object the cursor is on.
49
+ const SNAP_OCCLUSION_TOLERANCE = 0.1;
50
+
51
+ function cursorDist(hit) {
52
+ return Math.sqrt(hit.x * hit.x + hit.y * hit.y);
53
+ }
54
+
55
+ function selectBestHit(hits) {
56
+ // Depth of the nearest surface under the crosshair; edges well behind it are
57
+ // occluded by the object the cursor is on and must not win.
58
+ let occluderDepth = Number.POSITIVE_INFINITY;
59
+ for (const hit of hits) {
60
+ if (!hit.isEdge && cursorDist(hit) <= SNAP_OCCLUDER_RADIUS_PIXELS) {
61
+ occluderDepth = Math.min(occluderDepth, hit.depth);
62
+ }
63
+ }
64
+ const maxEdgeDepth = occluderDepth * (1.0 + SNAP_OCCLUSION_TOLERANCE);
65
+
66
+ // Edges outrank surfaces, but only edges in front of (or at) the occluder;
67
+ // otherwise fall back to the closest surface. Within the chosen group the
68
+ // hit closest to the crosshair wins.
69
+ const visible = hits.filter(
70
+ (hit) => !hit.isEdge || hit.depth <= maxEdgeDepth,
71
+ );
72
+ const wantEdge = visible.some((hit) => hit.isEdge);
73
+ const group = visible.filter((hit) => hit.isEdge === wantEdge);
74
+ return group.reduce((best, hit) =>
75
+ cursorDist(hit) < cursorDist(best) ? hit : best,
76
+ );
77
+ }
78
+
79
+ // Unproject a snap hit's eye-space depth (channel B of the snap framebuffer,
80
+ // written by the snap shader at the edge fragment itself) into a world
81
+ // position.
82
+ function snapHitToWorld(scene, windowPosition, hit) {
83
+ const coords = scratchSnapCoord;
84
+ coords.x = windowPosition.x + hit.x;
85
+ coords.y = windowPosition.y + hit.y;
86
+
87
+ const ray = scene.camera.getPickRay(coords, scratchSnapRay);
88
+ if (!defined(ray)) {
89
+ return undefined;
90
+ }
91
+
92
+ // hit.depth is perpendicular distance from the camera plane along the view
93
+ // direction; convert to distance along the (non-axis-aligned) pick ray.
94
+ const cos = Cartesian3.dot(ray.direction, scene.camera.directionWC);
95
+ if (cos <= 0.0) {
96
+ return undefined;
97
+ }
98
+ const t = hit.depth / cos;
99
+
100
+ const offset = Cartesian3.multiplyByScalar(
101
+ ray.direction,
102
+ t,
103
+ scratchSnapOffset,
104
+ );
105
+ return Cartesian3.add(ray.origin, offset, new Cartesian3());
106
+ }
107
+
108
+ /**
109
+ * Returns the best snap target in a screen-space region around
110
+ * <code>windowPosition</code>. See {@link Scene#snap} for the public API.
111
+ *
112
+ * @param {Scene} scene
113
+ * @param {Cartesian2} windowPosition Window coordinates at the center of the search region.
114
+ * @param {object} [options] Object with the following properties:
115
+ * @param {number} [options.width=25] Width of the search region in pixels.
116
+ * @param {number} [options.height=options.width] Height of the search region in pixels.
117
+ * @returns {SceneSnapResult | undefined}
118
+ *
119
+ * @private
120
+ */
121
+ Snapping.snap = function (scene, windowPosition, options) {
122
+ //>>includeStart('debug', pragmas.debug);
123
+ Check.defined("windowPosition", windowPosition);
124
+ //>>includeEnd('debug');
125
+
126
+ const width = options?.width ?? 25;
127
+ const height = options?.height ?? width;
128
+
129
+ const { context, defaultView } = scene;
130
+
131
+ // The snap framebuffer is RGBA32F; rendering to it requires float color
132
+ // attachment support.
133
+ if (!context.colorBufferFloat) {
134
+ oneTimeWarning(
135
+ "snap-color-buffer-float",
136
+ "Scene.snap requires the EXT_color_buffer_float extension, which is not supported on this platform.",
137
+ );
138
+ return undefined;
139
+ }
140
+
141
+ // Created lazily so applications that never snap pay no framebuffer cost.
142
+ if (!defined(defaultView.snapFramebuffer)) {
143
+ defaultView.snapFramebuffer = new SnapFramebuffer(context);
144
+ }
145
+ const snapFramebuffer = defaultView.snapFramebuffer;
146
+
147
+ const drawingBufferRectangle = scratchRectangle;
148
+ pickBegin(scene, windowPosition, drawingBufferRectangle, width, height, {
149
+ framebuffer: snapFramebuffer,
150
+ snap: true,
151
+ });
152
+ const hits = snapFramebuffer.end(drawingBufferRectangle);
153
+ pickEnd(scene);
154
+
155
+ if (hits.length === 0) {
156
+ return undefined;
157
+ }
158
+
159
+ const best = selectBestHit(hits);
160
+ if (!defined(best)) {
161
+ return undefined;
162
+ }
163
+
164
+ const position = snapHitToWorld(scene, windowPosition, best);
165
+ if (!defined(position)) {
166
+ return undefined;
167
+ }
168
+
169
+ return {
170
+ object: best.object,
171
+ isEdge: best.isEdge,
172
+ position: position,
173
+ screenPosition: new Cartesian2(
174
+ windowPosition.x + best.x,
175
+ windowPosition.y + best.y,
176
+ ),
177
+ };
178
+ };
179
+
180
+ // Exposed for testing.
181
+ Snapping._selectBestHit = selectBestHit;
182
+ Snapping._snapHitToWorld = snapHitToWorld;
183
+
184
+ export default Snapping;
@@ -823,6 +823,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) {
823
823
  GlobeSurfaceTile.initialize(
824
824
  tile,
825
825
  tileProvider.terrainProvider,
826
+ tileProvider.vectorProvider,
826
827
  tileProvider._imageryLayers,
827
828
  );
828
829
 
@@ -1243,7 +1244,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) {
1243
1244
 
1244
1245
  indices[indexOut++] = centerIndex;
1245
1246
  indices[indexOut++] = i;
1246
- indices[indexOut++] = 0;
1247
+ indices[indexOut] = 0;
1247
1248
 
1248
1249
  const westIndicesSouthToNorth = [];
1249
1250
  for (i = southwestIndex; i >= northwestIndex; --i) {
@@ -1800,7 +1801,7 @@ function addEdgeMesh(
1800
1801
  heightRange,
1801
1802
  ) {
1802
1803
  // Handle copying edges across the anti-meridian.
1803
- let sourceRectangle = edgeTile.rectangle;
1804
+ let sourceRectangle;
1804
1805
  if (tileEdge === TileEdge.EAST && terrainFillMesh.tile.x === 0) {
1805
1806
  sourceRectangle = Rectangle.clone(
1806
1807
  edgeTile.rectangle,
@@ -41,7 +41,7 @@ const scratchIntersectionRectangle = new Rectangle();
41
41
  * Base provider for URL-template vector sources that are rendered through a
42
42
  * runtime-generated 3D Tiles tileset.
43
43
  *
44
- * @private
44
+ * @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
45
45
  */
46
46
  class UrlTemplate3DTilesDataProvider {
47
47
  /**
@@ -402,8 +402,8 @@ function initialize(content, arrayBuffer, byteOffset) {
402
402
  byteOffset += sizeOfUint32;
403
403
  const polylinePositionByteLength = view.getUint32(byteOffset, true);
404
404
  byteOffset += sizeOfUint32;
405
- const pointsPositionByteLength = view.getUint32(byteOffset, true);
406
- byteOffset += sizeOfUint32;
405
+ // Ignore pointsPositionByteLength
406
+ byteOffset += sizeOfUint32; // For pointsPositionByteLength
407
407
 
408
408
  const featureTableJson = getJsonFromTypedArray(
409
409
  uint8Array,
@@ -687,7 +687,6 @@ function initialize(content, arrayBuffer, byteOffset) {
687
687
  byteOffset,
688
688
  numberOfPoints * 3,
689
689
  );
690
- byteOffset += pointsPositionByteLength;
691
690
  content._points = new Vector3DTilePoints({
692
691
  positions: pointPositions,
693
692
  batchIds: batchIds.points,
@@ -18,6 +18,7 @@ import createVectorTileBuffersFromModelComponents from "./Model/createVectorTile
18
18
  import defined from "../Core/defined.js";
19
19
  import destroyObject from "../Core/destroyObject.js";
20
20
  import DeveloperError from "../Core/DeveloperError.js";
21
+ import { isHeightReferenceClamp } from "./HeightReference.js";
21
22
 
22
23
  /** @import BufferPrimitive from "./BufferPrimitive.js"; */
23
24
  /** @import BufferPrimitiveCollection from "./BufferPrimitiveCollection.js"; */
@@ -319,6 +320,9 @@ class VectorGltf3DTileContent {
319
320
  * @param {FrameState} frameState
320
321
  */
321
322
  update(_tileset, frameState) {
323
+ const tileset = this._tileset;
324
+ const vectorProvider = tileset._scene?.vectorProvider;
325
+
322
326
  if (defined(this._model) && !this._ready) {
323
327
  const model = this._model;
324
328
  model.modelMatrix = this._tile.computedTransform;
@@ -337,13 +341,24 @@ class VectorGltf3DTileContent {
337
341
  scratchTileModelMatrix,
338
342
  );
339
343
 
344
+ // Only bake collections selected to render this frame (avoids duplicates).
345
+ const isSelected =
346
+ defined(vectorProvider) &&
347
+ this._tile._selectedFrame === frameState.frameNumber;
348
+
340
349
  for (let i = 0; i < this._collections.length; i++) {
350
+ const collection = this._collections[i];
341
351
  Matrix4.multiplyTransformation(
342
352
  scratchTileModelMatrix,
343
353
  this._collectionLocalMatrices[i],
344
- this._collections[i].modelMatrix,
354
+ collection.modelMatrix,
345
355
  );
346
- this._collections[i].update(frameState);
356
+
357
+ if (!isHeightReferenceClamp(tileset._heightReference)) {
358
+ collection.update(frameState);
359
+ } else if (isSelected) {
360
+ vectorProvider.markSelected(collection, frameState.frameNumber);
361
+ }
347
362
  }
348
363
  }
349
364
 
@@ -362,9 +377,14 @@ class VectorGltf3DTileContent {
362
377
  }
363
378
 
364
379
  destroy() {
380
+ const vectorProvider = this._tileset._scene?.vectorProvider;
381
+
365
382
  this._model?.destroy();
366
383
  this._model = undefined;
367
- this._collections.forEach((collection) => collection.destroy());
384
+ for (const collection of this._collections) {
385
+ vectorProvider?.remove(collection);
386
+ collection.destroy();
387
+ }
368
388
  this._collections.length = 0;
369
389
  return destroyObject(this);
370
390
  }
@@ -11,6 +11,7 @@ import Pass from "../Renderer/Pass.js";
11
11
  import PassState from "../Renderer/PassState.js";
12
12
  import Camera from "./Camera.js";
13
13
  import EdgeFramebuffer from "./EdgeFramebuffer.js";
14
+ import PlanarFillIdFramebuffer from "./PlanarFillIdFramebuffer.js";
14
15
  import FrustumCommands from "./FrustumCommands.js";
15
16
  import GlobeDepth from "./GlobeDepth.js";
16
17
  import GlobeTranslucencyFramebuffer from "./GlobeTranslucencyFramebuffer.js";
@@ -62,9 +63,11 @@ function View(scene, camera, viewport) {
62
63
  this.viewport = viewport;
63
64
  this.passState = passState;
64
65
  this.pickFramebuffer = new PickFramebuffer(context);
66
+ this.snapFramebuffer = undefined;
65
67
  this.pickDepthFramebuffer = new PickDepthFramebuffer();
66
68
  this.sceneFramebuffer = new SceneFramebuffer();
67
69
  this.edgeFramebuffer = new EdgeFramebuffer();
70
+ this.planarFillIdFramebuffer = new PlanarFillIdFramebuffer();
68
71
  this.globeDepth = globeDepth;
69
72
  this.globeTranslucencyFramebuffer = new GlobeTranslucencyFramebuffer();
70
73
  this.oit = oit;
@@ -211,15 +214,11 @@ function updateFrustums(view, scene, near, far) {
211
214
  curNear = Math.max(near, Math.pow(farToNearRatio, m) * near);
212
215
  curFar = Math.min(far, farToNearRatio * curNear);
213
216
  }
214
- let frustumCommands = frustumCommandsList[m];
215
- if (!defined(frustumCommands)) {
216
- frustumCommands = frustumCommandsList[m] = new FrustumCommands(
217
- curNear,
218
- curFar,
219
- );
217
+ if (!defined(frustumCommandsList[m])) {
218
+ frustumCommandsList[m] = new FrustumCommands(curNear, curFar);
220
219
  } else {
221
- frustumCommands.near = curNear;
222
- frustumCommands.far = curFar;
220
+ frustumCommandsList[m].near = curNear;
221
+ frustumCommandsList[m].far = curFar;
223
222
  }
224
223
  }
225
224
  }
@@ -443,11 +442,14 @@ View.prototype.createPotentiallyVisibleSet = function (scene) {
443
442
 
444
443
  View.prototype.destroy = function () {
445
444
  this.pickFramebuffer = this.pickFramebuffer && this.pickFramebuffer.destroy();
445
+ this.snapFramebuffer = this.snapFramebuffer && this.snapFramebuffer.destroy();
446
446
  this.pickDepthFramebuffer =
447
447
  this.pickDepthFramebuffer && this.pickDepthFramebuffer.destroy();
448
448
  this.sceneFramebuffer =
449
449
  this.sceneFramebuffer && this.sceneFramebuffer.destroy();
450
450
  this.edgeFramebuffer = this.edgeFramebuffer && this.edgeFramebuffer.destroy();
451
+ this.planarFillIdFramebuffer =
452
+ this.planarFillIdFramebuffer && this.planarFillIdFramebuffer.destroy();
451
453
  this.globeDepth = this.globeDepth && this.globeDepth.destroy();
452
454
  this.oit = this.oit && this.oit.destroy();
453
455
  this.translucentTileClassification =
@@ -602,7 +602,7 @@ function updateKeyframeNodes(that, frameState) {
602
602
  that._primitive.tileFailed.raiseEvent();
603
603
  continue;
604
604
  }
605
- let addNodeIndex = 0;
605
+ let addNodeIndex;
606
606
  if (megatexture.isFull()) {
607
607
  // If the megatexture is full, try removing a discardable node with the lowest priority.
608
608
  addNodeIndex = keyframeNodesInMegatextureCount - 1 - destroyedCount;
@@ -202,7 +202,7 @@ function createLayeredEntries(layers) {
202
202
  const layeredEntries = preprocess(layers);
203
203
 
204
204
  let entriesAccumNext = [];
205
- let entriesAccumCurr = [];
205
+ let entriesAccumCurr;
206
206
  let i;
207
207
 
208
208
  function addEntry(height, color) {
@@ -306,8 +306,7 @@ function renderBufferPointCollection(collection, frameState, renderContext) {
306
306
 
307
307
  frameState.commandList.push(command);
308
308
 
309
- collection._dirtyCount = 0;
310
- collection._dirtyOffset = 0;
309
+ collection._makeClean();
311
310
 
312
311
  return renderContext;
313
312
  }
@@ -332,8 +332,7 @@ function renderBufferPolygonCollection(collection, frameState, renderContext) {
332
332
 
333
333
  frameState.commandList.push(command);
334
334
 
335
- collection._dirtyCount = 0;
336
- collection._dirtyOffset = 0;
335
+ collection._makeClean();
337
336
 
338
337
  return renderContext;
339
338
  }
@@ -544,8 +544,7 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
544
544
 
545
545
  frameState.commandList.push(command);
546
546
 
547
- collection._dirtyCount = 0;
548
- collection._dirtyOffset = 0;
547
+ collection._makeClean();
549
548
 
550
549
  return renderContext;
551
550
  }
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * @see czm_pass
8
8
  */
9
- const float czm_passCesium3DTile = 5.0;
9
+ const float czm_passCesium3DTile = 6.0;
@@ -7,5 +7,5 @@ export default "/**\n\
7
7
  *\n\
8
8
  * @see czm_pass\n\
9
9
  */\n\
10
- const float czm_passCesium3DTile = 5.0;\n\
10
+ const float czm_passCesium3DTile = 6.0;\n\
11
11
  ";