@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
@@ -0,0 +1,172 @@
1
+ import defined from "../Core/defined.js";
2
+ import destroyObject from "../Core/destroyObject.js";
3
+ import PixelFormat from "../Core/PixelFormat.js";
4
+ import Color from "../Core/Color.js";
5
+ import PixelDatatype from "../Renderer/PixelDatatype.js";
6
+ import FramebufferManager from "../Renderer/FramebufferManager.js";
7
+ import ClearCommand from "../Renderer/ClearCommand.js";
8
+
9
+ /**
10
+ * Creates and manages a framebuffer for the planar fill feature-ID pre-pass.
11
+ *
12
+ * During this pass, non-behind planar fill geometry writes its per-fragment
13
+ * feature ID into a screen-sized texture. Later, primitives with
14
+ * <code>behind: true</code> (BENTLEY_materials_planar_fill) sample this
15
+ * texture to check whether the pixel they are about to overwrite belongs to
16
+ * the same logical object (same feature ID). Only then do they apply an
17
+ * additional depth offset, pushing the fill behind its own object's edges
18
+ * and non-behind fills — but NOT behind other objects.
19
+ *
20
+ * Layout:
21
+ * Color attachment 0 – R32F (single RED channel): encoded feature ID.
22
+ * Depth-stencil attachment – shared with the main scene for correct depth testing.
23
+ *
24
+ * @alias PlanarFillIdFramebuffer
25
+ * @constructor
26
+ * @private
27
+ */
28
+ function PlanarFillIdFramebuffer() {
29
+ this._framebufferManager = new FramebufferManager({
30
+ colorAttachmentsLength: 1,
31
+ createColorAttachments: true,
32
+ depthStencil: true,
33
+ supportsDepthTexture: true,
34
+ color: true,
35
+ });
36
+
37
+ this._framebuffer = undefined;
38
+ this._idTexture = undefined;
39
+ this._depthStencilTexture = undefined;
40
+
41
+ this._clearCommand = new ClearCommand({
42
+ color: new Color(0.0, 0.0, 0.0, 0.0),
43
+ depth: 1.0,
44
+ stencil: 0,
45
+ owner: this,
46
+ });
47
+ }
48
+
49
+ Object.defineProperties(PlanarFillIdFramebuffer.prototype, {
50
+ /**
51
+ * Gets the underlying framebuffer.
52
+ * @memberof PlanarFillIdFramebuffer.prototype
53
+ * @type {Framebuffer}
54
+ * @readonly
55
+ */
56
+ framebuffer: {
57
+ get: function () {
58
+ return this._framebuffer;
59
+ },
60
+ },
61
+
62
+ /**
63
+ * Gets the feature-ID texture (color attachment 0).
64
+ * @memberof PlanarFillIdFramebuffer.prototype
65
+ * @type {Texture}
66
+ * @readonly
67
+ */
68
+ idTexture: {
69
+ get: function () {
70
+ return this._idTexture;
71
+ },
72
+ },
73
+
74
+ /**
75
+ * Gets the depth-stencil texture.
76
+ * @memberof PlanarFillIdFramebuffer.prototype
77
+ * @type {Texture}
78
+ * @readonly
79
+ */
80
+ depthStencilTexture: {
81
+ get: function () {
82
+ return this._depthStencilTexture;
83
+ },
84
+ },
85
+ });
86
+
87
+ /**
88
+ * Updates (creates / resizes) the framebuffer to match the viewport.
89
+ *
90
+ * @param {Context} context
91
+ * @param {BoundingRectangle} viewport
92
+ * @param {boolean} hdr
93
+ * @returns {boolean} <code>true</code> if the framebuffer was recreated.
94
+ */
95
+ PlanarFillIdFramebuffer.prototype.update = function (context, viewport, hdr) {
96
+ const width = viewport.width;
97
+ const height = viewport.height;
98
+
99
+ // Feature IDs are integers, so a 32-bit float channel provides plenty of range
100
+ // for feature IDs. A single RED channel (R32F) is used since only one value is
101
+ // stored per pixel. Rendering to R32F requires EXT_color_buffer_float, which is
102
+ // available in WebGL2 on all browsers CesiumJS supports; the UNSIGNED_BYTE fallback
103
+ // below only exists for stubbed WebGL contexts possibly used in tests.
104
+ const pixelDatatype = context.colorBufferFloat
105
+ ? PixelDatatype.FLOAT
106
+ : PixelDatatype.UNSIGNED_BYTE;
107
+
108
+ const changed = this._framebufferManager.update(
109
+ context,
110
+ width,
111
+ height,
112
+ 1, // no MSAA
113
+ pixelDatatype,
114
+ PixelFormat.RED,
115
+ );
116
+
117
+ if (this._framebufferManager.framebuffer) {
118
+ this._framebuffer = this._framebufferManager.framebuffer;
119
+ this._idTexture = this._framebufferManager.getColorTexture(0);
120
+ this._depthStencilTexture =
121
+ this._framebufferManager.getDepthStencilTexture();
122
+ }
123
+
124
+ return changed;
125
+ };
126
+
127
+ /**
128
+ * Returns a ClearCommand that targets this framebuffer.
129
+ *
130
+ * @param {Color} [clearColor] Override the clear color (default: transparent black).
131
+ * @returns {ClearCommand}
132
+ */
133
+ PlanarFillIdFramebuffer.prototype.getClearCommand = function (clearColor) {
134
+ this._clearCommand.framebuffer = this._framebuffer;
135
+ if (defined(clearColor)) {
136
+ Color.clone(clearColor, this._clearCommand.color);
137
+ }
138
+ return this._clearCommand;
139
+ };
140
+
141
+ /**
142
+ * Releases GPU resources without destroying this object; a later call to
143
+ * {@link PlanarFillIdFramebuffer#update} recreates them.
144
+ */
145
+ PlanarFillIdFramebuffer.prototype.releaseResources = function () {
146
+ if (!defined(this._framebuffer)) {
147
+ return;
148
+ }
149
+ this._framebufferManager.destroy();
150
+ this._framebuffer = undefined;
151
+ this._idTexture = undefined;
152
+ this._depthStencilTexture = undefined;
153
+ };
154
+
155
+ /**
156
+ * @returns {boolean}
157
+ */
158
+ PlanarFillIdFramebuffer.prototype.isDestroyed = function () {
159
+ return false;
160
+ };
161
+
162
+ /**
163
+ * Destroys WebGL resources.
164
+ */
165
+ PlanarFillIdFramebuffer.prototype.destroy = function () {
166
+ this._framebufferManager =
167
+ this._framebufferManager && this._framebufferManager.destroy();
168
+ this._clearCommand = undefined;
169
+ return destroyObject(this);
170
+ };
171
+
172
+ export default PlanarFillIdFramebuffer;
@@ -105,7 +105,6 @@ PntsParser.parse = function (arrayBuffer, byteOffset) {
105
105
  );
106
106
  // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed
107
107
  batchTableBinary = new Uint8Array(batchTableBinary);
108
- byteOffset += batchTableBinaryByteLength;
109
108
  }
110
109
  }
111
110
 
@@ -846,7 +846,7 @@ function createVertexArrays(collection, context, projection) {
846
846
 
847
847
  //stores all of the individual indices arrays.
848
848
  const totalIndices = [[]];
849
- let indices = totalIndices[0];
849
+ let indices;
850
850
 
851
851
  const batchTable = collection._batchTable;
852
852
  const useHighlightColor = collection._useHighlightColor;
@@ -640,8 +640,10 @@ function createStageOutputTextureFunction(stage, name) {
640
640
  function updateUniformTextures(stage, context) {
641
641
  const texturesToRelease = stage._texturesToRelease;
642
642
  for (let i = 0; i < texturesToRelease.length; ++i) {
643
- let texture = texturesToRelease[i];
644
- texture = texture && texture.destroy();
643
+ const texture = texturesToRelease[i];
644
+ if (defined(texture)) {
645
+ texture.destroy();
646
+ }
645
647
  }
646
648
  texturesToRelease.length = 0;
647
649
 
@@ -419,7 +419,7 @@ ResourceCache.getSpzLoader = function (options) {
419
419
 
420
420
  const cacheKey = ResourceCacheKey.getSpzCacheKey({
421
421
  gltf: gltf,
422
- primitive: primitive,
422
+ spz: spz,
423
423
  gltfResource: gltfResource,
424
424
  baseResource: baseResource,
425
425
  });
@@ -453,13 +453,14 @@ ResourceCache.getSpzLoader = function (options) {
453
453
  * @param {number} [options.bufferViewId] The bufferView ID corresponding to the vertex buffer.
454
454
  * @param {object} [options.primitive] The primitive containing the Draco extension.
455
455
  * @param {object} [options.draco] The Draco extension object.
456
+ * @param {object} [options.spz] The SPZ extension object.
456
457
  * @param {string} [options.attributeSemantic] The attribute semantic, e.g. POSITION or NORMAL.
457
458
  * @param {number} [options.accessorId] The accessor ID.
458
459
  * @param {boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.
459
460
  * @param {boolean} [options.dequantize=false] Determines whether or not the vertex buffer will be dequantized on the CPU.
460
461
  * @param {boolean} [options.loadBuffer=false] Load vertex buffer as a GPU vertex buffer.
461
462
  * @param {boolean} [options.loadTypedArray=false] Load vertex buffer as a typed array.
462
- * @exception {DeveloperError} One of options.bufferViewId and options.draco must be defined.
463
+ * @exception {DeveloperError} Exactly one vertex buffer source must be effective: options.bufferViewId, options.spz, or options.draco for options.attributeSemantic.
463
464
  * @exception {DeveloperError} When options.draco is defined options.attributeSemantic must also be defined.
464
465
  * @exception {DeveloperError} When options.draco is defined options.accessorId must also be defined.
465
466
  *
@@ -503,9 +504,11 @@ ResourceCache.getVertexBufferLoader = function (options) {
503
504
  const hasAccessorId = defined(accessorId);
504
505
  const hasSpz = defined(spz);
505
506
 
506
- if (hasBufferViewId === (hasDraco !== hasSpz)) {
507
+ const sourceCount =
508
+ Number(hasBufferViewId) + Number(hasDraco) + Number(hasSpz);
509
+ if (sourceCount !== 1) {
507
510
  throw new DeveloperError(
508
- "One of options.bufferViewId, options.draco, or options.spz must be defined.",
511
+ "Exactly one vertex buffer source must be effective: options.bufferViewId, options.spz, or options.draco for options.attributeSemantic.",
509
512
  );
510
513
  }
511
514
 
@@ -71,8 +71,8 @@ function getDracoCacheKey(gltf, draco, gltfResource, baseResource) {
71
71
  return `${bufferCacheKey}-range-${bufferViewCacheKey}`;
72
72
  }
73
73
 
74
- function getSpzCacheKey(gltf, primitive, gltfResource, baseResource) {
75
- const bufferViewId = 0;
74
+ function getSpzCacheKey(gltf, spz, gltfResource, baseResource) {
75
+ const bufferViewId = spz.bufferView;
76
76
  const bufferView = gltf.bufferViews[bufferViewId];
77
77
  const bufferId = bufferView.buffer;
78
78
  const buffer = gltf.buffers[bufferId];
@@ -292,16 +292,16 @@ ResourceCacheKey.getDracoCacheKey = function (options) {
292
292
 
293
293
  ResourceCacheKey.getSpzCacheKey = function (options) {
294
294
  options = options ?? Frozen.EMPTY_OBJECT;
295
- const { gltf, primitive, gltfResource, baseResource } = options;
295
+ const { gltf, spz, gltfResource, baseResource } = options;
296
296
 
297
297
  //>>includeStart('debug', pragmas.debug);
298
298
  Check.typeOf.object("options.gltf", gltf);
299
- Check.typeOf.object("options.primitive", primitive);
299
+ Check.typeOf.object("options.spz", spz);
300
300
  Check.typeOf.object("options.gltfResource", gltfResource);
301
301
  Check.typeOf.object("options.baseResource", baseResource);
302
302
  //>>includeEnd('debug');
303
303
 
304
- return `spz:${getSpzCacheKey(gltf, primitive, gltfResource, baseResource)}`;
304
+ return `spz:${getSpzCacheKey(gltf, spz, gltfResource, baseResource)}`;
305
305
  };
306
306
  /**
307
307
  * Gets the vertex buffer cache key.
@@ -313,11 +313,12 @@ ResourceCacheKey.getSpzCacheKey = function (options) {
313
313
  * @param {FrameState} options.frameState The frame state.
314
314
  * @param {number} [options.bufferViewId] The bufferView ID corresponding to the vertex buffer.
315
315
  * @param {object} [options.draco] The Draco extension object.
316
+ * @param {object} [options.spz] The SPZ extension object.
316
317
  * @param {string} [options.attributeSemantic] The attribute semantic, e.g. POSITION or NORMAL.
317
318
  * @param {boolean} [options.dequantize=false] Determines whether or not the vertex buffer will be dequantized on the CPU.
318
319
  * @param {boolean} [options.loadBuffer=false] Load vertex buffer as a GPU vertex buffer.
319
320
  * @param {boolean} [options.loadTypedArray=false] Load vertex buffer as a typed array.
320
- * @exception {DeveloperError} One of options.bufferViewId and options.draco must be defined.
321
+ * @exception {DeveloperError} Exactly one vertex buffer source must be effective: options.bufferViewId, options.spz, or options.draco for options.attributeSemantic.
321
322
  * @exception {DeveloperError} When options.draco is defined options.attributeSemantic must also be defined.
322
323
  *
323
324
  * @returns {string} The vertex buffer cache key.
@@ -350,9 +351,11 @@ ResourceCacheKey.getVertexBufferCacheKey = function (options) {
350
351
  const hasAttributeSemantic = defined(attributeSemantic);
351
352
  const hasSpz = defined(spz);
352
353
 
353
- if (hasBufferViewId === (hasDraco !== hasSpz)) {
354
+ const sourceCount =
355
+ Number(hasBufferViewId) + Number(hasDraco) + Number(hasSpz);
356
+ if (sourceCount !== 1) {
354
357
  throw new DeveloperError(
355
- "One of options.bufferViewId and options.draco must be defined.",
358
+ "Exactly one vertex buffer source must be effective: options.bufferViewId, options.spz, or options.draco for options.attributeSemantic.",
356
359
  );
357
360
  }
358
361
 
@@ -388,6 +391,11 @@ ResourceCacheKey.getVertexBufferCacheKey = function (options) {
388
391
  cacheKeySuffix += "-typed-array";
389
392
  }
390
393
 
394
+ if (defined(spz)) {
395
+ const spzCacheKey = getSpzCacheKey(gltf, spz, gltfResource, baseResource);
396
+ return `vertex-buffer:${spzCacheKey}-spz-${attributeSemantic}${cacheKeySuffix}`;
397
+ }
398
+
391
399
  if (defined(draco)) {
392
400
  const dracoCacheKey = getDracoCacheKey(
393
401
  gltf,
@@ -398,11 +406,6 @@ ResourceCacheKey.getVertexBufferCacheKey = function (options) {
398
406
  return `vertex-buffer:${dracoCacheKey}-draco-${attributeSemantic}${cacheKeySuffix}`;
399
407
  }
400
408
 
401
- if (spz) {
402
- const spzCacheKey = getSpzCacheKey(gltf, spz, gltfResource, baseResource);
403
- return `vertex-buffer:${spzCacheKey}-spz-${attributeSemantic}${cacheKeySuffix}`;
404
- }
405
-
406
409
  const bufferView = gltf.bufferViews[bufferViewId];
407
410
  const bufferId = bufferView.buffer;
408
411
  const buffer = gltf.buffers[bufferId];
@@ -45,6 +45,7 @@ import BrdfLutGenerator from "./BrdfLutGenerator.js";
45
45
  import Camera from "./Camera.js";
46
46
  import Cesium3DTilePass from "./Cesium3DTilePass.js";
47
47
  import Cesium3DTilePassState from "./Cesium3DTilePassState.js";
48
+ import ControllerHost from "./Controllers/ControllerHost.js";
48
49
  import CreditDisplay from "./CreditDisplay.js";
49
50
  import DebugCameraPrimitive from "./DebugCameraPrimitive.js";
50
51
  import DepthPlane from "./DepthPlane.js";
@@ -69,6 +70,7 @@ import SceneTransitioner from "./SceneTransitioner.js";
69
70
  import ScreenSpaceCameraController from "./ScreenSpaceCameraController.js";
70
71
  import ShadowMap from "./ShadowMap.js";
71
72
  import SharedContext from "../Renderer/SharedContext.js";
73
+ import Snapping from "./Snapping.js";
72
74
  import SpecularEnvironmentCubeMap from "./SpecularEnvironmentCubeMap.js";
73
75
  import StencilConstants from "./StencilConstants.js";
74
76
  import SunLight from "./SunLight.js";
@@ -241,6 +243,8 @@ function Scene(options) {
241
243
  this._preRender = new Event();
242
244
  this._postRender = new Event();
243
245
 
246
+ this._controllerHost = new ControllerHost();
247
+
244
248
  this._minimumDisableDepthTestDistance = 0.0;
245
249
  this._debugInspector = new DebugInspector();
246
250
 
@@ -770,6 +774,15 @@ function Scene(options) {
770
774
  */
771
775
  this._enableEdgeVisibility = false;
772
776
 
777
+ /**
778
+ * Whether or not to enable the planar fill feature-ID pre-pass.
779
+ * Updated each frame from FrameState.planarFillRequested.
780
+ * @type {boolean}
781
+ * @default false
782
+ * @private
783
+ */
784
+ this._enablePlanarFillId = false;
785
+
773
786
  // Give frameState, camera, and screen space camera controller initial state before rendering
774
787
  updateFrameNumber(this, 0.0, JulianDate.now());
775
788
  this.updateFrameState();
@@ -1079,6 +1092,25 @@ Object.defineProperties(Scene.prototype, {
1079
1092
  },
1080
1093
  },
1081
1094
 
1095
+ /**
1096
+ * Collects an array of <code>Controller</code> objects that can be registered with the scene to handle input events, camera animations, and other interactions.
1097
+ * @see {@link Controller}
1098
+ * @type {ControllerHost}
1099
+ * @memberof Scene.prototype
1100
+ * @readonly
1101
+ * @example
1102
+ * scene.screenSpaceCameraController.enableInputs = false;
1103
+ * scene.screenSpaceCameraController.enableCollisionDetection = false;
1104
+ *
1105
+ * const tiltOrbitController = new Cesium.ScreenSpaceTiltOrbitCameraController();
1106
+ * scene.controllerHost.registerController(tiltOrbitController, scene.canvas.parentNode);
1107
+ */
1108
+ controllerHost: {
1109
+ get: function () {
1110
+ return this._controllerHost;
1111
+ },
1112
+ },
1113
+
1082
1114
  /**
1083
1115
  * Gets the controller for camera input handling.
1084
1116
  * @memberof Scene.prototype
@@ -1227,6 +1259,17 @@ Object.defineProperties(Scene.prototype, {
1227
1259
  },
1228
1260
  },
1229
1261
 
1262
+ /**
1263
+ * @memberof Scene.prototype
1264
+ * @type {VectorProvider}
1265
+ * @ignore
1266
+ */
1267
+ vectorProvider: {
1268
+ get: function () {
1269
+ return this.globe?.vectorProvider;
1270
+ },
1271
+ },
1272
+
1230
1273
  /**
1231
1274
  * Gets the event that will be raised before the scene is updated or rendered. Subscribers to the event
1232
1275
  * receive the Scene instance as the first parameter and the current time as the second parameter.
@@ -1770,6 +1813,16 @@ function updateDerivedCommands(scene, command, shadowsDirty) {
1770
1813
  derivedCommands.picking,
1771
1814
  );
1772
1815
  }
1816
+ // Snap derived commands are only created on demand, during a snapping pass,
1817
+ // so applications that never call Scene.snap pay no shader-derivation cost.
1818
+ if (defined(command.snapId) && frameState.passes.snap) {
1819
+ derivedCommands.snapping = DerivedCommand.createSnapDerivedCommand(
1820
+ scene,
1821
+ command,
1822
+ context,
1823
+ derivedCommands.snapping,
1824
+ );
1825
+ }
1773
1826
  if (frameState.pickingMetadata && command.pickMetadataAllowed) {
1774
1827
  command.pickedMetadataInfo = frameState.pickedMetadataInfo;
1775
1828
  if (defined(command.pickedMetadataInfo)) {
@@ -1867,12 +1920,17 @@ Scene.prototype.updateDerivedCommands = function (command) {
1867
1920
  const needsUpdateForMetadataPicking =
1868
1921
  frameState.pickingMetadata &&
1869
1922
  pickedMetadataInfoChanged(command, frameState);
1923
+ const needsUpdateForSnap =
1924
+ frameState.passes.snap &&
1925
+ defined(command.snapId) &&
1926
+ !defined(derivedCommands.snapping);
1870
1927
  command.dirty =
1871
1928
  command.dirty ||
1872
1929
  needsLogDepthDerivedCommands ||
1873
1930
  needsHdrCommands ||
1874
1931
  needsDerivedCommands ||
1875
- needsUpdateForMetadataPicking;
1932
+ needsUpdateForMetadataPicking ||
1933
+ needsUpdateForSnap;
1876
1934
 
1877
1935
  if (!command.dirty) {
1878
1936
  return;
@@ -1960,6 +2018,7 @@ Scene.prototype.clearPasses = function (passes) {
1960
2018
  passes.render = false;
1961
2019
  passes.pick = false;
1962
2020
  passes.pickVoxel = false;
2021
+ passes.snap = false;
1963
2022
  passes.depth = false;
1964
2023
  passes.postProcess = false;
1965
2024
  passes.offscreen = false;
@@ -2245,6 +2304,21 @@ function executeCommand(command, scene, passState, debugFramebuffer) {
2245
2304
 
2246
2305
  if (passes.pick || passes.depth) {
2247
2306
  if (passes.pick && !passes.depth) {
2307
+ if (frameState.passes.snap) {
2308
+ // Snapping pass: only commands with a snap variant write the float
2309
+ // snap payload. Commands without one (no snapId, e.g. globe/terrain)
2310
+ // execute depth-only so they still occlude snappable geometry behind
2311
+ // them without polluting the RGBA32F snap framebuffer with RGBA8
2312
+ // pick colors.
2313
+ if (defined(command.derivedCommands.snapping)) {
2314
+ command = command.derivedCommands.snapping.snapCommand;
2315
+ command.execute(context, passState);
2316
+ } else if (defined(command.derivedCommands.depth)) {
2317
+ command = command.derivedCommands.depth.depthOnlyCommand;
2318
+ command.execute(context, passState);
2319
+ }
2320
+ return;
2321
+ }
2248
2322
  if (
2249
2323
  frameState.pickingMetadata &&
2250
2324
  defined(command.derivedCommands.pickingMetadata)
@@ -2619,6 +2693,54 @@ function performCesium3DTileEdgesPass(scene, passState, frustumCommands) {
2619
2693
  passState.framebuffer = originalFramebuffer;
2620
2694
  }
2621
2695
 
2696
+ /**
2697
+ * Execute the planar fill feature-ID pre-pass.
2698
+ *
2699
+ * Non-behind planar fill geometry writes its per-fragment feature ID into the
2700
+ * planar fill ID framebuffer. This allows behind fills in the main 3D tile
2701
+ * pass to check whether the existing pixel belongs to the same logical object.
2702
+ *
2703
+ * @param {Scene} scene
2704
+ * @param {PassState} passState
2705
+ * @param {FrustumCommands} frustumCommands
2706
+ * @private
2707
+ */
2708
+ function performPlanarFillIdPass(scene, passState, frustumCommands) {
2709
+ const { context } = scene;
2710
+ const { uniformState } = context;
2711
+
2712
+ uniformState.updatePass(Pass.CESIUM_3D_TILE_PLANAR_FILL_ID);
2713
+
2714
+ // Default to a blank texture so shaders always have something to sample.
2715
+ uniformState.planarFillIdTexture = context.defaultTexture;
2716
+
2717
+ const view = scene._view;
2718
+ const fb = view && view.planarFillIdFramebuffer;
2719
+
2720
+ const commands = frustumCommands.commands[Pass.CESIUM_3D_TILE_PLANAR_FILL_ID];
2721
+ const commandCount =
2722
+ frustumCommands.indices[Pass.CESIUM_3D_TILE_PLANAR_FILL_ID];
2723
+
2724
+ if (commandCount === 0) {
2725
+ return;
2726
+ }
2727
+
2728
+ if (scene._enablePlanarFillId && defined(fb) && defined(fb.framebuffer)) {
2729
+ const originalFramebuffer = passState.framebuffer;
2730
+ passState.framebuffer = fb.framebuffer;
2731
+
2732
+ // Clear to (0,0,0,0) — feature ID 0 means "no planar fill here".
2733
+ const clearCommand = fb.getClearCommand(new Color(0.0, 0.0, 0.0, 0.0));
2734
+ clearCommand.execute(context, passState);
2735
+
2736
+ for (let j = 0; j < commandCount; ++j) {
2737
+ executeCommand(commands[j], scene, passState);
2738
+ }
2739
+
2740
+ passState.framebuffer = originalFramebuffer;
2741
+ }
2742
+ }
2743
+
2622
2744
  /**
2623
2745
  * Execute edge commands that should render directly to the main framebuffer
2624
2746
  * (EDGES_ONLY mode). These edges bypass the MRT edge framebuffer and render
@@ -2656,6 +2778,10 @@ function executeCommands(scene, passState) {
2656
2778
 
2657
2779
  uniformState.updateCamera(camera);
2658
2780
 
2781
+ // Ensure planar fill ID texture is always available (even during edge pass)
2782
+ // so that shaders referencing czm_planarFillIdTexture never see undefined.
2783
+ uniformState.planarFillIdTexture = context.defaultTexture;
2784
+
2659
2785
  const frustum = createWorkingFrustum(camera);
2660
2786
  frustum.near = camera.frustum.near;
2661
2787
  frustum.far = camera.frustum.far;
@@ -2826,6 +2952,23 @@ function executeCommands(scene, passState) {
2826
2952
  scene.context.defaultTexture;
2827
2953
  }
2828
2954
 
2955
+ // Planar fill feature-ID pre-pass: write feature IDs from non-behind
2956
+ // planar fill geometry so that behind fills can test same-object.
2957
+ performPlanarFillIdPass(scene, passState, frustumCommands);
2958
+
2959
+ if (
2960
+ scene._enablePlanarFillId &&
2961
+ defined(scene._view) &&
2962
+ defined(scene._view.planarFillIdFramebuffer)
2963
+ ) {
2964
+ const pfIdTexture = scene._view.planarFillIdFramebuffer.idTexture;
2965
+ uniformState.planarFillIdTexture = defined(pfIdTexture)
2966
+ ? pfIdTexture
2967
+ : context.defaultTexture;
2968
+ } else {
2969
+ uniformState.planarFillIdTexture = context.defaultTexture;
2970
+ }
2971
+
2829
2972
  if (!useInvertClassification || picking || renderTranslucentDepthForPick) {
2830
2973
  // Common/fastest path. Draw 3D Tiles and classification normally.
2831
2974
 
@@ -2889,7 +3032,7 @@ function executeCommands(scene, passState) {
2889
3032
  passState.framebuffer = scene._invertClassification._fbo.framebuffer;
2890
3033
 
2891
3034
  // Draw normally
2892
- commandCount = performPass(frustumCommands, Pass.CESIUM_3D_TILE);
3035
+ performPass(frustumCommands, Pass.CESIUM_3D_TILE);
2893
3036
 
2894
3037
  if (useGlobeDepthFramebuffer) {
2895
3038
  scene._invertClassification.prepareTextures(context);
@@ -3636,10 +3779,11 @@ Scene.prototype.updateEnvironment = function () {
3636
3779
  );
3637
3780
 
3638
3781
  const envMaps = this.specularEnvironmentMaps;
3639
- let specularEnvironmentCubeMap = this._specularEnvironmentCubeMap;
3782
+ const specularEnvironmentCubeMap = this._specularEnvironmentCubeMap;
3640
3783
  if (defined(envMaps) && specularEnvironmentCubeMap?.url !== envMaps) {
3641
- specularEnvironmentCubeMap =
3642
- specularEnvironmentCubeMap && specularEnvironmentCubeMap.destroy();
3784
+ if (defined(specularEnvironmentCubeMap)) {
3785
+ specularEnvironmentCubeMap.destroy();
3786
+ }
3643
3787
  this._specularEnvironmentCubeMap = new SpecularEnvironmentCubeMap(envMaps);
3644
3788
  } else if (!defined(envMaps) && defined(specularEnvironmentCubeMap)) {
3645
3789
  specularEnvironmentCubeMap.destroy();
@@ -3729,6 +3873,7 @@ function updateAndRenderPrimitives(scene) {
3729
3873
 
3730
3874
  // Reset per-frame edge visibility request flag before primitives update
3731
3875
  frameState.edgeVisibilityRequested = false;
3876
+ frameState.planarFillRequested = false;
3732
3877
 
3733
3878
  scene._groundPrimitives.update(frameState);
3734
3879
  scene._primitives.update(frameState);
@@ -3741,6 +3886,10 @@ function updateAndRenderPrimitives(scene) {
3741
3886
  scene._enableEdgeVisibility = true;
3742
3887
  }
3743
3888
 
3889
+ // True only while at least one planar fill primitive is rendering;
3890
+ // the request flag is renewed each frame by ModelSceneGraph.
3891
+ scene._enablePlanarFillId = frameState.planarFillRequested;
3892
+
3744
3893
  updateDebugFrustumPlanes(scene);
3745
3894
  updateShadowMaps(scene);
3746
3895
 
@@ -3759,6 +3908,7 @@ function updateAndClearFramebuffers(scene, passState, clearColor) {
3759
3908
  const picking = passes.pick || passes.pickVoxel;
3760
3909
  if (defined(view.globeDepth)) {
3761
3910
  view.globeDepth.picking = picking;
3911
+ view.globeDepth.snapping = passes.snap;
3762
3912
  }
3763
3913
  const useWebVR = environmentState.useWebVR;
3764
3914
 
@@ -3864,6 +4014,15 @@ function updateAndClearFramebuffers(scene, passState, clearColor) {
3864
4014
  view.edgeFramebuffer.update(context, view.viewport, scene._hdr);
3865
4015
  }
3866
4016
 
4017
+ // Update planar fill ID framebuffer
4018
+ const usePlanarFillIdFramebuffer = !picking && scene._enablePlanarFillId;
4019
+ if (usePlanarFillIdFramebuffer) {
4020
+ view.planarFillIdFramebuffer.update(context, view.viewport, scene._hdr);
4021
+ } else if (!picking) {
4022
+ // Release GPU resources while unused; recreated on demand by update().
4023
+ view.planarFillIdFramebuffer.releaseResources();
4024
+ }
4025
+
3867
4026
  if (useInvertClassification) {
3868
4027
  let depthFramebuffer;
3869
4028
  if (frameState.invertClassificationColor.alpha === 1.0) {
@@ -4420,6 +4579,8 @@ Scene.prototype.render = function (time) {
4420
4579
  time = JulianDate.now();
4421
4580
  }
4422
4581
 
4582
+ this._controllerHost.update(this, time);
4583
+
4423
4584
  const cameraChanged = this._view.checkForCameraUpdates(this);
4424
4585
  if (cameraChanged) {
4425
4586
  this._globeHeightDirty = true;
@@ -4557,6 +4718,42 @@ Scene.prototype.pick = function (windowPosition, width, height) {
4557
4718
  return this._picking.pick(this, windowPosition, width, height, 1)[0];
4558
4719
  };
4559
4720
 
4721
+ /**
4722
+ * The result of a snap operation. See {@link Scene#snap}.
4723
+ *
4724
+ * @typedef {object} SceneSnapResult
4725
+ * @property {object} object The snapped primitive or feature.
4726
+ * @property {Cartesian3} position The world-space position of the snap point, un-projected from the snap framebuffer's eye-space depth.
4727
+ * @property {Cartesian2} screenPosition The window coordinates of the snap point.
4728
+ * @property {boolean} isEdge <code>true</code> if the snap point lies on an edge; <code>false</code> if it lies on a surface.
4729
+ *
4730
+ * @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
4731
+ */
4732
+
4733
+ /**
4734
+ * Returns the best snap target in a screen-space region around <code>windowPosition</code>.
4735
+ * Edges are preferred over surfaces; among hits of the same kind the one
4736
+ * nearest the cursor wins. Returns <code>undefined</code> if the region contains
4737
+ * no snappable geometry.
4738
+ * <p>
4739
+ * Only primitives rendered through the Model pipeline (e.g. 3D Tiles and glTF
4740
+ * models) are snappable. Snapping requires float color attachments
4741
+ * (WebGL2 with <code>EXT_color_buffer_float</code>); if unsupported, this
4742
+ * function returns <code>undefined</code>.
4743
+ * </p>
4744
+ *
4745
+ * @param {Cartesian2} windowPosition Window coordinates at the center of the search region.
4746
+ * @param {object} [options] Object with the following properties:
4747
+ * @param {number} [options.width=25] Width of the search region in pixels.
4748
+ * @param {number} [options.height=options.width] Height of the search region in pixels.
4749
+ * @returns {SceneSnapResult | undefined} The best snap target in the region, or <code>undefined</code> if there is none.
4750
+ *
4751
+ * @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
4752
+ */
4753
+ Scene.prototype.snap = function (windowPosition, options) {
4754
+ return Snapping.snap(this, windowPosition, options);
4755
+ };
4756
+
4560
4757
  /**
4561
4758
  * Performs the same operation as Scene.pick but asynchonosly without blocking the main render thread.
4562
4759
  * Requires WebGL2 else using fallback.