@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
@@ -103,6 +103,9 @@ function ModelDrawCommand(options) {
103
103
  this._needsSkipLevelOfDetailCommands = needsSkipLevelOfDetailCommands;
104
104
  this._needsSilhouetteCommands = needsSilhouetteCommands;
105
105
  this._needsEdgeCommands = needsEdgeCommands;
106
+ // Non-behind planar fill primitives write their feature IDs in a pre-pass
107
+ // so that behind fills can test same-object coplanarity.
108
+ this._needsPlanarFillIdCommand = renderResources.planarFillIdPass;
106
109
 
107
110
  // Derived commands
108
111
  this._originalCommand = undefined;
@@ -112,6 +115,10 @@ function ModelDrawCommand(options) {
112
115
  this._silhouetteModelCommand = undefined;
113
116
  this._silhouetteColorCommand = undefined;
114
117
  this._edgeCommand = undefined;
118
+ // Snap-pass variant of the edge command, pinned at 1 px width.
119
+ // See deriveEdgeCommand.
120
+ this._edgeSnapCommand = undefined;
121
+ this._planarFillIdCommand = undefined;
115
122
 
116
123
  // All derived commands (including 2D commands)
117
124
  this._derivedCommands = [];
@@ -226,8 +233,27 @@ function initialize(drawCommand) {
226
233
 
227
234
  if (drawCommand._needsEdgeCommands) {
228
235
  const renderResources = drawCommand._primitiveRenderResources;
236
+ const edgeGeometry = renderResources.edgeGeometry;
237
+ const colorLineWidth = defined(edgeGeometry.lineWidth)
238
+ ? edgeGeometry.lineWidth
239
+ : 1.0;
240
+ // Snap-pass edge width is held at 1 px independent of the color width.
241
+ // A wider snap band results in snap wiggle: as the cursor moves
242
+ // perpendicular to an edge inside the band, the "edge pixel nearest
243
+ // the cursor" shifts, so Snapping.snap returns a slightly different
244
+ // point each frame.
245
+ const snapLineWidth = 1.0;
246
+
229
247
  drawCommand._edgeCommand = new ModelDerivedCommand({
230
- command: deriveEdgeCommand(command, renderResources, model),
248
+ command: deriveEdgeCommand(command, renderResources, colorLineWidth),
249
+ updateShadows: false,
250
+ updateBackFaceCulling: false,
251
+ updateCullFace: false,
252
+ updateDebugShowBoundingVolume: false,
253
+ });
254
+
255
+ drawCommand._edgeSnapCommand = new ModelDerivedCommand({
256
+ command: deriveEdgeCommand(command, renderResources, snapLineWidth),
231
257
  updateShadows: false,
232
258
  updateBackFaceCulling: false,
233
259
  updateCullFace: false,
@@ -235,6 +261,19 @@ function initialize(drawCommand) {
235
261
  });
236
262
 
237
263
  derivedCommands.push(drawCommand._edgeCommand);
264
+ derivedCommands.push(drawCommand._edgeSnapCommand);
265
+ }
266
+
267
+ if (drawCommand._needsPlanarFillIdCommand) {
268
+ drawCommand._planarFillIdCommand = new ModelDerivedCommand({
269
+ command: derivePlanarFillIdCommand(command),
270
+ updateShadows: false,
271
+ updateBackFaceCulling: false,
272
+ updateCullFace: false,
273
+ updateDebugShowBoundingVolume: false,
274
+ });
275
+
276
+ derivedCommands.push(drawCommand._planarFillIdCommand);
238
277
  }
239
278
  }
240
279
 
@@ -584,14 +623,6 @@ ModelDrawCommand.prototype.pushCommands = function (frameState, result) {
584
623
 
585
624
  pushCommand(result, this._originalCommand, use2D);
586
625
 
587
- // Push edge commands after the original command
588
- if (
589
- this._needsEdgeCommands &&
590
- this._model.edgeDisplayMode !== EdgeDisplayMode.SURFACES_ONLY
591
- ) {
592
- pushCommand(result, this._edgeCommand, use2D);
593
- }
594
-
595
626
  return result;
596
627
  };
597
628
 
@@ -636,15 +667,51 @@ ModelDrawCommand.prototype.pushEdgeCommands = function (frameState, result) {
636
667
  return result;
637
668
  }
638
669
 
639
- // SURFACES_ONLY mode suppresses all edge rendering
640
- if (this._model.edgeDisplayMode === EdgeDisplayMode.SURFACES_ONLY) {
670
+ const mode = this._model.edgeDisplayMode;
671
+ const passes = frameState.passes;
672
+ const use2D = shouldUse2DCommands(this, frameState);
673
+
674
+ if (passes.snap) {
675
+ // Snapping pass: route the 1 px snap variant directly into the bound
676
+ // snap framebuffer, regardless of display mode -- snapping works even
677
+ // when edges are visually suppressed (SURFACES_ONLY).
678
+ const edgeCommand = this._edgeSnapCommand;
679
+ edgeCommand.command.pass = Pass.CESIUM_3D_TILE_EDGES_DIRECT;
680
+ if (defined(edgeCommand.derivedCommand2D)) {
681
+ edgeCommand.derivedCommand2D.command.pass =
682
+ Pass.CESIUM_3D_TILE_EDGES_DIRECT;
683
+ }
684
+ pushCommand(result, edgeCommand, use2D);
685
+ return result;
686
+ }
687
+
688
+ if (passes.pick) {
689
+ // Plain pick pass: edges contribute nothing to the RGBA8 pick
690
+ // framebuffer except in EDGES_ONLY mode, where they are the only
691
+ // pickable geometry (pushCommands skips the surface command).
692
+ if (mode !== EdgeDisplayMode.EDGES_ONLY) {
693
+ return result;
694
+ }
695
+ const edgeCommand = this._edgeCommand;
696
+ edgeCommand.command.pass = Pass.CESIUM_3D_TILE_EDGES_DIRECT;
697
+ if (defined(edgeCommand.derivedCommand2D)) {
698
+ edgeCommand.derivedCommand2D.command.pass =
699
+ Pass.CESIUM_3D_TILE_EDGES_DIRECT;
700
+ }
701
+ pushCommand(result, edgeCommand, use2D);
641
702
  return result;
642
703
  }
643
704
 
644
- // Use direct pass (renders to main framebuffer) when EDGES_ONLY mode is enabled,
645
- // otherwise use MRT pass (renders to edge framebuffer for compositing)
705
+ // Color pass. SURFACES_ONLY mode suppresses all edge rendering.
706
+ if (mode === EdgeDisplayMode.SURFACES_ONLY) {
707
+ return result;
708
+ }
709
+
710
+ // Use direct pass (renders to currently bound framebuffer) when EDGES_ONLY
711
+ // mode is enabled, otherwise use MRT pass (renders to edge framebuffer for
712
+ // compositing).
646
713
  const edgePass =
647
- this._model.edgeDisplayMode === EdgeDisplayMode.EDGES_ONLY
714
+ mode === EdgeDisplayMode.EDGES_ONLY
648
715
  ? Pass.CESIUM_3D_TILE_EDGES_DIRECT
649
716
  : Pass.CESIUM_3D_TILE_EDGES;
650
717
 
@@ -653,12 +720,34 @@ ModelDrawCommand.prototype.pushEdgeCommands = function (frameState, result) {
653
720
  this._edgeCommand.derivedCommand2D.command.pass = edgePass;
654
721
  }
655
722
 
656
- const use2D = shouldUse2DCommands(this, frameState);
657
723
  pushCommand(result, this._edgeCommand, use2D);
658
724
 
659
725
  return result;
660
726
  };
661
727
 
728
+ /**
729
+ * Push the planar fill feature-ID pre-pass command (if any).
730
+ *
731
+ * @param {FrameState} frameState The frame state.
732
+ * @param {DrawCommand[]} result The draw commands to push to.
733
+ * @returns {DrawCommand[]} The modified command list.
734
+ *
735
+ * @private
736
+ */
737
+ ModelDrawCommand.prototype.pushPlanarFillIdCommands = function (
738
+ frameState,
739
+ result,
740
+ ) {
741
+ if (!defined(this._planarFillIdCommand)) {
742
+ return result;
743
+ }
744
+
745
+ const use2D = shouldUse2DCommands(this, frameState);
746
+ pushCommand(result, this._planarFillIdCommand, use2D);
747
+
748
+ return result;
749
+ };
750
+
662
751
  function pushCommand(commandList, derivedCommand, use2D) {
663
752
  commandList.push(derivedCommand.command);
664
753
  if (use2D) {
@@ -718,6 +807,8 @@ function derive2DCommands(drawCommand) {
718
807
  derive2DCommand(drawCommand, drawCommand._silhouetteModelCommand);
719
808
  derive2DCommand(drawCommand, drawCommand._silhouetteColorCommand);
720
809
  derive2DCommand(drawCommand, drawCommand._edgeCommand);
810
+ derive2DCommand(drawCommand, drawCommand._edgeSnapCommand);
811
+ derive2DCommand(drawCommand, drawCommand._planarFillIdCommand);
721
812
  }
722
813
 
723
814
  function deriveTranslucentCommand(command) {
@@ -826,7 +917,13 @@ function deriveSilhouetteColorCommand(command, model) {
826
917
  return silhouetteColorCommand;
827
918
  }
828
919
 
829
- function deriveEdgeCommand(command, renderResources) {
920
+ // Builds an edge draw command at the given screen-space line width.
921
+ //
922
+ // Two variants are derived per primitive (one for the color pass and one
923
+ // for the snapping pass). Therefore, the visual line width and the snap-pass line
924
+ // width can be set independently. The snap variant is pinned at 1 px to
925
+ // avoid snap wiggle (see initialize). In practice both default to 1 px.
926
+ function deriveEdgeCommand(command, renderResources, lineWidth) {
830
927
  const edgeGeometry = renderResources.edgeGeometry;
831
928
  const edgeCommand = DrawCommand.shallowClone(command);
832
929
 
@@ -848,6 +945,12 @@ function deriveEdgeCommand(command, renderResources) {
848
945
  uniformMap.u_isEdgePass = function () {
849
946
  return true; // This is the edge pass
850
947
  };
948
+
949
+ // Set line width uniform for quad-based edge rendering
950
+ uniformMap.u_lineWidth = function () {
951
+ return lineWidth;
952
+ };
953
+
851
954
  edgeCommand.uniformMap = uniformMap;
852
955
  edgeCommand.castShadows = false;
853
956
  edgeCommand.receiveShadows = false;
@@ -855,6 +958,47 @@ function deriveEdgeCommand(command, renderResources) {
855
958
  return edgeCommand;
856
959
  }
857
960
 
961
+ /**
962
+ * Derive a command for the planar fill feature-ID pre-pass.
963
+ *
964
+ * This command uses the same geometry as the original but writes only a
965
+ * feature-ID value to the color attachment (no lighting, no material).
966
+ * The fragment shader outputs <code>vec4(featureId, 0, 0, 1)</code>
967
+ * via the <code>PLANAR_FILL_ID_PASS</code> define.
968
+ *
969
+ * No polygon offset is applied: the pre-pass uses the natural depth of the
970
+ * non-behind planar fill geometry (same program as the main command minus
971
+ * the POLYGON_OFFSET path that would shift it).
972
+ *
973
+ * Like the other derived commands (translucent, silhouette, edge, etc.),
974
+ * this is called once per draw command from <code>initialize</code> when the
975
+ * ModelDrawCommand is constructed — not per frame.
976
+ *
977
+ * @param {DrawCommand} command The original draw command.
978
+ * @returns {DrawCommand} The derived command for the feature-ID pass.
979
+ * @private
980
+ */
981
+ function derivePlanarFillIdCommand(command) {
982
+ const derived = DrawCommand.shallowClone(command);
983
+ derived.pass = Pass.CESIUM_3D_TILE_PLANAR_FILL_ID;
984
+ derived.castShadows = false;
985
+ derived.receiveShadows = false;
986
+
987
+ // Use the same render state but disable blending.
988
+ const rs = clone(command.renderState, true);
989
+ rs.blending.enabled = false;
990
+ derived.renderState = RenderState.fromCache(rs);
991
+
992
+ // Override uniformMap to set u_isPlanarFillIdPass to true for the pre-pass
993
+ const uniformMap = clone(command.uniformMap);
994
+ uniformMap.u_isPlanarFillIdPass = function () {
995
+ return true;
996
+ };
997
+ derived.uniformMap = uniformMap;
998
+
999
+ return derived;
1000
+ }
1001
+
858
1002
  function updateSkipLodStencilCommand(drawCommand, tile, use2D) {
859
1003
  const stencilDerivedComand = drawCommand._skipLodStencilCommand;
860
1004
  const stencilCommand = stencilDerivedComand.command;
@@ -169,6 +169,9 @@ function buildDrawCommandForModel(
169
169
  const pickId = hasClassification
170
170
  ? undefined
171
171
  : primitiveRenderResources.pickId;
172
+ const snapId = hasClassification
173
+ ? undefined
174
+ : primitiveRenderResources.snapId;
172
175
 
173
176
  const command = new DrawCommand({
174
177
  boundingVolume: boundingSphere,
@@ -182,6 +185,7 @@ function buildDrawCommandForModel(
182
185
  count: primitiveRenderResources.count,
183
186
  owner: model,
184
187
  pickId: pickId,
188
+ snapId: snapId,
185
189
  pickMetadataAllowed: true,
186
190
  instanceCount: primitiveRenderResources.instanceCount,
187
191
  primitiveType: primitiveRenderResources.primitiveType,
@@ -986,6 +986,7 @@ function updatePrimitiveShowBoundingVolume(runtimePrimitive, options) {
986
986
 
987
987
  const scratchSilhouetteCommands = [];
988
988
  const scratchEdgeCommands = [];
989
+ const scratchPlanarFillIdCommands = [];
989
990
  const scratchPushDrawCommandOptions = {
990
991
  frameState: undefined,
991
992
  hasSilhouette: undefined,
@@ -1011,6 +1012,10 @@ ModelSceneGraph.prototype.pushDrawCommands = function (frameState) {
1011
1012
  const edgeCommands = scratchEdgeCommands;
1012
1013
  edgeCommands.length = 0;
1013
1014
 
1015
+ // Gather planar fill feature-ID pre-pass commands
1016
+ const planarFillIdCommands = scratchPlanarFillIdCommands;
1017
+ planarFillIdCommands.length = 0;
1018
+
1014
1019
  // Since this function is called each frame, the options object is
1015
1020
  // preallocated in a scratch variable
1016
1021
  const pushDrawCommandOptions = scratchPushDrawCommandOptions;
@@ -1026,6 +1031,7 @@ ModelSceneGraph.prototype.pushDrawCommands = function (frameState) {
1026
1031
 
1027
1032
  addAllToArray(frameState.commandList, silhouetteCommands);
1028
1033
  addAllToArray(frameState.commandList, edgeCommands);
1034
+ addAllToArray(frameState.commandList, planarFillIdCommands);
1029
1035
  };
1030
1036
 
1031
1037
  // Callback is defined here to avoid allocating a closure in the render loop
@@ -1036,9 +1042,16 @@ function pushPrimitiveDrawCommands(runtimePrimitive, options) {
1036
1042
  const passes = frameState.passes;
1037
1043
  const silhouetteCommands = scratchSilhouetteCommands;
1038
1044
  const edgeCommands = scratchEdgeCommands;
1045
+ const planarFillIdCommands = scratchPlanarFillIdCommands;
1039
1046
  const primitiveDrawCommand = runtimePrimitive.drawCommand;
1040
1047
  primitiveDrawCommand.pushCommands(frameState, frameState.commandList);
1041
1048
 
1049
+ // Renew the per-frame planar fill request while this primitive renders.
1050
+ const material = runtimePrimitive.primitive.material;
1051
+ if (defined(material) && defined(material.planarFill)) {
1052
+ frameState.planarFillRequested = true;
1053
+ }
1054
+
1042
1055
  // If a model has silhouettes, the commands that draw the silhouettes for
1043
1056
  // each primitive can only be invoked after the entire model has drawn.
1044
1057
  // Otherwise, the silhouette may draw on top of the model. This requires
@@ -1051,6 +1064,14 @@ function pushPrimitiveDrawCommands(runtimePrimitive, options) {
1051
1064
  if (defined(primitiveDrawCommand.pushEdgeCommands)) {
1052
1065
  primitiveDrawCommand.pushEdgeCommands(frameState, edgeCommands);
1053
1066
  }
1067
+
1068
+ // Add planar fill feature-ID pre-pass commands
1069
+ if (defined(primitiveDrawCommand.pushPlanarFillIdCommands)) {
1070
+ primitiveDrawCommand.pushPlanarFillIdCommands(
1071
+ frameState,
1072
+ planarFillIdCommands,
1073
+ );
1074
+ }
1054
1075
  }
1055
1076
 
1056
1077
  /**
@@ -17,6 +17,32 @@ const PickingPipelineStage = {
17
17
  name: "PickingPipelineStage", // Helps with debugging
18
18
  };
19
19
 
20
+ /**
21
+ * Builds the GLSL expression for the float snap payload written during a
22
+ * snapping pass (see {@link Scene#snap}), from the expression that evaluates
23
+ * to the primitive's RGBA8-normalized pick color.
24
+ *
25
+ * Channel layout (RGBA32F snap framebuffer):
26
+ * <ul>
27
+ * <li>R: pick ID, repacked from the RGBA8 pick color to a uint32 via
28
+ * <code>rgba8UnormToUint32</code> (injected by DerivedCommand.createSnapDerivedCommand).
29
+ * Implicitly cast to float32, which represents far more pick IDs than occur in practice.</li>
30
+ * <li>G: isEdge flag (0.0/1.0). <code>isEdge</code> is a ModelFS.glsl global, set by
31
+ * edge-pass fragments under <code>u_isEdgePass</code>.</li>
32
+ * <li>B: linear eye-space depth (<code>-v_positionEC.z</code>, meters). Eye space is
33
+ * global across multifrustum and independent of log-depth encoding.</li>
34
+ * <li>A: unused</li>
35
+ * </ul>
36
+ *
37
+ * @param {string} pickId The GLSL expression for the RGBA8 pick color.
38
+ * @returns {string} The GLSL expression for the snap payload.
39
+ *
40
+ * @private
41
+ */
42
+ function snapIdFromPickId(pickId) {
43
+ return `vec4(rgba8UnormToUint32(${pickId}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`;
44
+ }
45
+
20
46
  /**
21
47
  * Process a primitive. This modifies the following parts of the render resources:
22
48
  * <ul>
@@ -65,6 +91,7 @@ PickingPipelineStage.process = function (
65
91
  };
66
92
 
67
93
  renderResources.pickId = "czm_pickColor";
94
+ renderResources.snapId = snapIdFromPickId(renderResources.pickId);
68
95
  }
69
96
  };
70
97
 
@@ -157,6 +184,7 @@ function processPickTexture(renderResources, primitive, instances) {
157
184
  // The feature ID is ignored if it is greater than the number of features.
158
185
  renderResources.pickId =
159
186
  "((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))";
187
+ renderResources.snapId = snapIdFromPickId(renderResources.pickId);
160
188
  }
161
189
 
162
190
  function processInstancedPickIds(renderResources, context) {
@@ -213,6 +241,7 @@ function processInstancedPickIds(renderResources, context) {
213
241
  shaderBuilder.addAttribute("vec4", "a_pickColor");
214
242
  shaderBuilder.addVarying("vec4", "v_pickColor");
215
243
  renderResources.pickId = "v_pickColor";
244
+ renderResources.snapId = snapIdFromPickId(renderResources.pickId);
216
245
  }
217
246
 
218
247
  export default PickingPipelineStage;
@@ -133,6 +133,19 @@ function PrimitiveRenderResources(nodeRenderResources, runtimePrimitive) {
133
133
  */
134
134
  this.hasSkipLevelOfDetail = nodeRenderResources.hasSkipLevelOfDetail;
135
135
 
136
+ /**
137
+ * Whether this primitive writes its feature IDs to the planar fill ID
138
+ * texture in a pre-pass (BENTLEY_materials_planar_fill). Set by the
139
+ * material pipeline stage for non-behind planar fill primitives so that
140
+ * behind fills can test same-object coplanarity. This value indicates
141
+ * what draw commands are needed.
142
+ *
143
+ * @type {boolean}
144
+ *
145
+ * @private
146
+ */
147
+ this.planarFillIdPass = false;
148
+
136
149
  /**
137
150
  * An object used to build a shader incrementally. This is cloned from the
138
151
  * node render resources because each primitive can compute a different shader.
@@ -292,6 +305,17 @@ function PrimitiveRenderResources(nodeRenderResources, runtimePrimitive) {
292
305
  * @private
293
306
  */
294
307
  this.pickId = undefined;
308
+
309
+ /**
310
+ * The shader expression for the float snap payload written during a snapping
311
+ * pass (see Scene#snap). If picking is enabled, this value is set by
312
+ * PickingPipelineStage.
313
+ *
314
+ * @type {string|undefined}
315
+ *
316
+ * @private
317
+ */
318
+ this.snapId = undefined;
295
319
  }
296
320
 
297
321
  export default PrimitiveRenderResources;
@@ -1578,6 +1578,67 @@ export class LineStyle {
1578
1578
  pattern = undefined;
1579
1579
  }
1580
1580
 
1581
+ /**
1582
+ * Planar fill properties from the BENTLEY_materials_planar_fill extension.
1583
+ * Controls the rendering behavior of planar polygon fills for CAD-style visualization.
1584
+ *
1585
+ * @alias ModelComponents.PlanarFill
1586
+ * @constructor
1587
+ *
1588
+ * @private
1589
+ */
1590
+ export class PlanarFill {
1591
+ static DEFAULT_WIREFRAME_FILL = 0;
1592
+
1593
+ /**
1594
+ * @param {object} [planarFillInfo={}] The contents of the BENTLEY_materials_planar_fill extension in the parsed glTF JSON.
1595
+ * @param {number} [planarFillInfo.wireframeFill=0] Whether and when the interior fill is displayed in wireframe view mode.
1596
+ * @param {boolean} [planarFillInfo.backgroundFill=false] Whether the fill should be drawn using the view's background color.
1597
+ * @param {boolean} [planarFillInfo.behind=false] Whether the fill should be drawn behind other coplanar geometry of the same logical object.
1598
+ */
1599
+ constructor(planarFillInfo = {}) {
1600
+ const {
1601
+ wireframeFill = PlanarFill.DEFAULT_WIREFRAME_FILL,
1602
+ backgroundFill = false,
1603
+ behind = false,
1604
+ } = planarFillInfo;
1605
+
1606
+ /**
1607
+ * Specifies whether and when the interior fill is displayed in wireframe view mode.
1608
+ * 0 = NONE (never drawn), 1 = ALWAYS (always drawn), 2 = TOGGLE (drawn when fill display is enabled).
1609
+ *
1610
+ * NOTE: This property is currently a NO-OP. CesiumJS does not yet have a proper
1611
+ * wireframe rendering mode (debugWireframe is not a true wireframe mode). The
1612
+ * value is loaded and stored for completeness, but it has no effect on rendering.
1613
+ * This will be implemented when CesiumJS adds a proper wireframe view mode.
1614
+ * See https://github.com/CesiumGS/cesium/issues/13620.
1615
+ *
1616
+ * @type {number}
1617
+ * @default 0
1618
+ */
1619
+ this.wireframeFill = wireframeFill;
1620
+
1621
+ /**
1622
+ * If true, the fill should be drawn using the view's background color,
1623
+ * creating an invisible masking polygon.
1624
+ *
1625
+ * @type {boolean}
1626
+ * @default false
1627
+ */
1628
+ this.backgroundFill = backgroundFill;
1629
+
1630
+ /**
1631
+ * If true, the fill should be drawn behind other coplanar geometry
1632
+ * belonging to the same logical object, useful for mitigating z-fighting
1633
+ * with overlaid geometry such as hatch patterns or text.
1634
+ *
1635
+ * @type {boolean}
1636
+ * @default false
1637
+ */
1638
+ this.behind = behind;
1639
+ }
1640
+ }
1641
+
1581
1642
  /**
1582
1643
  * The material appearance of a primitive.
1583
1644
  *
@@ -1709,6 +1770,15 @@ export class Material {
1709
1770
  */
1710
1771
  this.pointDiameter = undefined;
1711
1772
 
1773
+ /**
1774
+ * Planar fill properties from the BENTLEY_materials_planar_fill extension.
1775
+ * Controls the rendering behavior of planar polygon fills for CAD-style visualization.
1776
+ *
1777
+ * @type {ModelComponents.PlanarFill}
1778
+ * @private
1779
+ */
1780
+ this.planarFill = undefined;
1781
+
1712
1782
  /**
1713
1783
  * Material properties for the BENTLEY_materials_line_style extension.
1714
1784
  *
@@ -1799,6 +1869,7 @@ ModelComponents.SpecularGlossiness = SpecularGlossiness;
1799
1869
  ModelComponents.Specular = Specular;
1800
1870
  ModelComponents.Anisotropy = Anisotropy;
1801
1871
  ModelComponents.Clearcoat = Clearcoat;
1872
+ ModelComponents.PlanarFill = PlanarFill;
1802
1873
  ModelComponents.LineStyle = LineStyle;
1803
1874
  ModelComponents.Material = Material;
1804
1875
  ModelComponents.Vector = Vector;
@@ -266,22 +266,31 @@ function computePickingDrawingBufferRectangle(
266
266
  /**
267
267
  * Setup needed before picking.
268
268
  *
269
+ * Exported for use by Snapping, which performs the same offscreen pick render
270
+ * but targets the snap framebuffer and flags the pass as a snapping pass.
271
+ *
269
272
  * @param {Scene} scene
270
273
  * @param {Cartesian2} windowPosition Window coordinates to perform picking on.
271
274
  * @param {BoundingRectangle} drawingBufferRectangle The output drawing buffer recangle.
272
275
  * @param {number} [width=3] Width of the pick rectangle.
273
276
  * @param {number} [height=3] Height of the pick rectangle.
274
- * @ignore
277
+ * @param {object} [options] Object with the following properties:
278
+ * @param {PickFramebuffer|SnapFramebuffer} [options.framebuffer] The framebuffer to render into. Defaults to the view's pick framebuffer.
279
+ * @param {boolean} [options.snap=false] If <code>true</code>, mark the pass as a snapping pass (sets <code>frameState.passes.snap</code>).
280
+ *
281
+ * @private
275
282
  */
276
- function pickBegin(
283
+ export function pickBegin(
277
284
  scene,
278
285
  windowPosition,
279
286
  drawingBufferRectangle,
280
287
  width,
281
288
  height,
289
+ options,
282
290
  ) {
283
291
  const { context, frameState, defaultView } = scene;
284
292
  const { viewport, pickFramebuffer } = defaultView;
293
+ const framebuffer = options?.framebuffer ?? pickFramebuffer;
285
294
 
286
295
  scene.view = defaultView;
287
296
 
@@ -318,13 +327,14 @@ function pickBegin(
318
327
  );
319
328
  frameState.invertClassification = false;
320
329
  frameState.passes.pick = true;
330
+ frameState.passes.snap = options?.snap ?? false;
321
331
  frameState.tilesetPassState = pickTilesetPassState;
322
332
 
323
333
  context.uniformState.update(frameState);
324
334
 
325
335
  scene.updateEnvironment();
326
336
 
327
- passState = pickFramebuffer.begin(drawingBufferRectangle, viewport);
337
+ passState = framebuffer.begin(drawingBufferRectangle, viewport);
328
338
 
329
339
  scene.updateAndExecuteCommands(passState, scratchColorZero);
330
340
  scene.resolveFramebuffers(passState);
@@ -334,9 +344,10 @@ function pickBegin(
334
344
  * Teardown needed after picking.
335
345
  *
336
346
  * @param {Scene} scene
337
- * @ignore
347
+ *
348
+ * @private
338
349
  */
339
- function pickEnd(scene) {
350
+ export function pickEnd(scene) {
340
351
  const { context } = scene;
341
352
  context.endFrame();
342
353
  }