@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
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * @see czm_pass
8
8
  */
9
- const float czm_passCesium3DTileClassification = 6.0;
9
+ const float czm_passCesium3DTileClassification = 7.0;
@@ -7,5 +7,5 @@ export default "/**\n\
7
7
  *\n\
8
8
  * @see czm_pass\n\
9
9
  */\n\
10
- const float czm_passCesium3DTileClassification = 6.0;\n\
10
+ const float czm_passCesium3DTileClassification = 7.0;\n\
11
11
  ";
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * @see czm_pass
8
8
  */
9
- const float czm_passCesium3DTileClassificationIgnoreShow = 7.0;
9
+ const float czm_passCesium3DTileClassificationIgnoreShow = 8.0;
@@ -7,5 +7,5 @@ export default "/**\n\
7
7
  *\n\
8
8
  * @see czm_pass\n\
9
9
  */\n\
10
- const float czm_passCesium3DTileClassificationIgnoreShow = 7.0;\n\
10
+ const float czm_passCesium3DTileClassificationIgnoreShow = 8.0;\n\
11
11
  ";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_PLANAR_FILL_ID}
3
+ *
4
+ * @name czm_passCesium3DTilePlanarFillId
5
+ * @glslConstant
6
+ *
7
+ * @see czm_pass
8
+ */
9
+ const float czm_passCesium3DTilePlanarFillId = 5.0;
@@ -0,0 +1,11 @@
1
+ //This file is automatically rebuilt by the Cesium build process.
2
+ export default "/**\n\
3
+ * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_PLANAR_FILL_ID}\n\
4
+ *\n\
5
+ * @name czm_passCesium3DTilePlanarFillId\n\
6
+ * @glslConstant\n\
7
+ *\n\
8
+ * @see czm_pass\n\
9
+ */\n\
10
+ const float czm_passCesium3DTilePlanarFillId = 5.0;\n\
11
+ ";
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * @see czm_pass
8
8
  */
9
- const float czm_passClassification = 7.0;
9
+ const float czm_passClassification = 8.0;
@@ -7,5 +7,5 @@ export default "/**\n\
7
7
  *\n\
8
8
  * @see czm_pass\n\
9
9
  */\n\
10
- const float czm_passClassification = 7.0;\n\
10
+ const float czm_passClassification = 8.0;\n\
11
11
  ";
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * @see czm_pass
8
8
  */
9
- const float czm_passGaussianSplats = 11.0;
9
+ const float czm_passGaussianSplats = 12.0;
@@ -7,5 +7,5 @@ export default "/**\n\
7
7
  *\n\
8
8
  * @see czm_pass\n\
9
9
  */\n\
10
- const float czm_passGaussianSplats = 11.0;\n\
10
+ const float czm_passGaussianSplats = 12.0;\n\
11
11
  ";
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * @see czm_pass
8
8
  */
9
- const float czm_passOpaque = 8.0;
9
+ const float czm_passOpaque = 9.0;
@@ -7,5 +7,5 @@ export default "/**\n\
7
7
  *\n\
8
8
  * @see czm_pass\n\
9
9
  */\n\
10
- const float czm_passOpaque = 8.0;\n\
10
+ const float czm_passOpaque = 9.0;\n\
11
11
  ";
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * @see czm_pass
8
8
  */
9
- const float czm_passTranslucent = 9.0;
9
+ const float czm_passTranslucent = 10.0;
@@ -7,5 +7,5 @@ export default "/**\n\
7
7
  *\n\
8
8
  * @see czm_pass\n\
9
9
  */\n\
10
- const float czm_passTranslucent = 9.0;\n\
10
+ const float czm_passTranslucent = 10.0;\n\
11
11
  ";
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * @see czm_pass
8
8
  */
9
- const float czm_passVoxels = 10.0;
9
+ const float czm_passVoxels = 11.0;
@@ -7,5 +7,5 @@ export default "/**\n\
7
7
  *\n\
8
8
  * @see czm_pass\n\
9
9
  */\n\
10
- const float czm_passVoxels = 10.0;\n\
10
+ const float czm_passVoxels = 11.0;\n\
11
11
  ";
@@ -16,6 +16,7 @@ import czm_passCesium3DTileClassification from './Constants/passCesium3DTileClas
16
16
  import czm_passCesium3DTileClassificationIgnoreShow from './Constants/passCesium3DTileClassificationIgnoreShow.js'
17
17
  import czm_passCesium3DTileEdges from './Constants/passCesium3DTileEdges.js'
18
18
  import czm_passCesium3DTileEdgesDirect from './Constants/passCesium3DTileEdgesDirect.js'
19
+ import czm_passCesium3DTilePlanarFillId from './Constants/passCesium3DTilePlanarFillId.js'
19
20
  import czm_passClassification from './Constants/passClassification.js'
20
21
  import czm_passCompute from './Constants/passCompute.js'
21
22
  import czm_passEnvironment from './Constants/passEnvironment.js'
@@ -160,6 +161,7 @@ export default {
160
161
  czm_passCesium3DTileClassificationIgnoreShow : czm_passCesium3DTileClassificationIgnoreShow,
161
162
  czm_passCesium3DTileEdges : czm_passCesium3DTileEdges,
162
163
  czm_passCesium3DTileEdgesDirect : czm_passCesium3DTileEdgesDirect,
164
+ czm_passCesium3DTilePlanarFillId : czm_passCesium3DTilePlanarFillId,
163
165
  czm_passClassification : czm_passClassification,
164
166
  czm_passCompute : czm_passCompute,
165
167
  czm_passEnvironment : czm_passEnvironment,
@@ -88,7 +88,7 @@ uniform float u_minimumBrightness;
88
88
  #endif
89
89
 
90
90
  // Based on colorCorrect
91
- // The colorCorrect flag can only be true when tileProvider.hue/saturation/brightnessShift
91
+ // The colorCorrect flag can only be true when tileProvider.hue/saturation/brightnessShift
92
92
  // are nonzero AND when (applyFog || showGroundAtmosphere) in the tile provider
93
93
  // - The tileProvider.hue/saturation/brightnessShift are just passed through
94
94
  // from the Globe hue/saturation/brightness, like atmosphereBrightnessShift
@@ -116,8 +116,8 @@ uniform vec4 u_translucencyRectangle;
116
116
  #endif
117
117
 
118
118
  // Based on showUndergroundColor
119
- // This is set when GlobeSurfaceTileProvider.isUndergroundVisible
120
- // returns true, AND the tileProvider.undergroundColor had a value with
119
+ // This is set when GlobeSurfaceTileProvider.isUndergroundVisible
120
+ // returns true, AND the tileProvider.undergroundColor had a value with
121
121
  // nonzero alpha, and the tileProvider.undergroundColorAlphaByDistance
122
122
  // was in the right range
123
123
  #ifdef UNDERGROUND_COLOR
@@ -576,11 +576,16 @@ void main()
576
576
  }
577
577
  #endif
578
578
 
579
+ #ifdef HAS_VECTOR_LAYER
580
+ finalColor = vectorPolygonRender(v_textureCoordinates.xy, finalColor);
581
+ finalColor = vectorPolylineRender(v_textureCoordinates.xy, finalColor);
582
+ #endif
583
+
579
584
  #ifdef TRANSLUCENT
580
585
  if (inTranslucencyRectangle())
581
586
  {
582
- vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;
583
- finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);
587
+ vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;
588
+ finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);
584
589
  }
585
590
  #endif
586
591
 
@@ -89,7 +89,7 @@ uniform float u_minimumBrightness;\n\
89
89
  #endif\n\
90
90
  \n\
91
91
  // Based on colorCorrect\n\
92
- // The colorCorrect flag can only be true when tileProvider.hue/saturation/brightnessShift \n\
92
+ // The colorCorrect flag can only be true when tileProvider.hue/saturation/brightnessShift\n\
93
93
  // are nonzero AND when (applyFog || showGroundAtmosphere) in the tile provider\n\
94
94
  // - The tileProvider.hue/saturation/brightnessShift are just passed through\n\
95
95
  // from the Globe hue/saturation/brightness, like atmosphereBrightnessShift\n\
@@ -117,8 +117,8 @@ uniform vec4 u_translucencyRectangle;\n\
117
117
  #endif\n\
118
118
  \n\
119
119
  // Based on showUndergroundColor\n\
120
- // This is set when GlobeSurfaceTileProvider.isUndergroundVisible \n\
121
- // returns true, AND the tileProvider.undergroundColor had a value with \n\
120
+ // This is set when GlobeSurfaceTileProvider.isUndergroundVisible\n\
121
+ // returns true, AND the tileProvider.undergroundColor had a value with\n\
122
122
  // nonzero alpha, and the tileProvider.undergroundColorAlphaByDistance\n\
123
123
  // was in the right range\n\
124
124
  #ifdef UNDERGROUND_COLOR\n\
@@ -577,11 +577,15 @@ void main()\n\
577
577
  }\n\
578
578
  #endif\n\
579
579
  \n\
580
+ #ifdef HAS_VECTOR_LAYER\n\
581
+ finalColor = vectorPolylineRender(v_textureCoordinates.xy, finalColor);\n\
582
+ #endif\n\
583
+ \n\
580
584
  #ifdef TRANSLUCENT\n\
581
585
  if (inTranslucencyRectangle())\n\
582
586
  {\n\
583
- vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;\n\
584
- finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);\n\
587
+ vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;\n\
588
+ finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);\n\
585
589
  }\n\
586
590
  #endif\n\
587
591
  \n\
@@ -15,7 +15,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
15
15
 
16
16
  vec4 fragColor;
17
17
  fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);
18
- fragColor.a = clamp(0.0, 1.0, glow) * color.a;
18
+ fragColor.a = clamp(glow, 0.0, 1.0) * color.a;
19
19
  fragColor = czm_gammaCorrect(fragColor);
20
20
 
21
21
  material.emission = fragColor.rgb;
@@ -16,7 +16,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)\n\
16
16
  \n\
17
17
  vec4 fragColor;\n\
18
18
  fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);\n\
19
- fragColor.a = clamp(0.0, 1.0, glow) * color.a;\n\
19
+ fragColor.a = clamp(glow, 0.0, 1.0) * color.a;\n\
20
20
  fragColor = czm_gammaCorrect(fragColor);\n\
21
21
  \n\
22
22
  material.emission = fragColor.rgb;\n\
@@ -463,8 +463,14 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
463
463
  #endif
464
464
 
465
465
  vec4 baseColorWithAlpha = vec4(1.0);
466
- // Regardless of whether we use PBR, set a base color
467
- #ifdef HAS_BASE_COLOR_TEXTURE
466
+ // Regardless of whether we use PBR, set a base color.
467
+ // HAS_BACKGROUND_FILL (from BENTLEY_materials_planar_fill) overrides with
468
+ // the view's background color to create an invisible masking polygon.
469
+ // The background color is in sRGB, so convert to linear to match the
470
+ // material pipeline's expected color space.
471
+ #ifdef HAS_BACKGROUND_FILL
472
+ baseColorWithAlpha = czm_srgbToLinear(czm_backgroundColor);
473
+ #elif defined(HAS_BASE_COLOR_TEXTURE)
468
474
  baseColorWithAlpha = getBaseColorFromTexture();
469
475
  #elif defined(HAS_BASE_COLOR_FACTOR)
470
476
  baseColorWithAlpha = u_baseColorFactor;
@@ -464,8 +464,14 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
464
464
  #endif\n\
465
465
  \n\
466
466
  vec4 baseColorWithAlpha = vec4(1.0);\n\
467
- // Regardless of whether we use PBR, set a base color\n\
468
- #ifdef HAS_BASE_COLOR_TEXTURE\n\
467
+ // Regardless of whether we use PBR, set a base color.\n\
468
+ // HAS_BACKGROUND_FILL (from BENTLEY_materials_planar_fill) overrides with\n\
469
+ // the view's background color to create an invisible masking polygon.\n\
470
+ // The background color is in sRGB, so convert to linear to match the\n\
471
+ // material pipeline's expected color space.\n\
472
+ #ifdef HAS_BACKGROUND_FILL\n\
473
+ baseColorWithAlpha = czm_srgbToLinear(czm_backgroundColor);\n\
474
+ #elif defined(HAS_BASE_COLOR_TEXTURE)\n\
469
475
  baseColorWithAlpha = getBaseColorFromTexture();\n\
470
476
  #elif defined(HAS_BASE_COLOR_FACTOR)\n\
471
477
  baseColorWithAlpha = u_baseColorFactor;\n\
@@ -1,6 +1,29 @@
1
1
 
2
2
  precision highp float;
3
3
 
4
+ // ──────────────────────────────────────────────────────────────────────
5
+ // BENTLEY_materials_planar_fill constants
6
+ //
7
+ // These factors scale gl_FragDepth AFTER czm_writeLogDepth has run, so
8
+ // they are proportional offsets in log-depth space. The corresponding
9
+ // eye-space offset therefore varies with the fragment's distance from
10
+ // the camera (growing with distance). This is the intended behavior: it
11
+ // matches the proportional depth comparison tolerance used by the edge
12
+ // visibility system, so fills and edges stay consistently ordered at all
13
+ // viewing distances.
14
+ // ──────────────────────────────────────────────────────────────────────
15
+ // Depth pull factor for all planar fills: scales log depth by 0.9995,
16
+ // i.e. a 0.05% pull toward the camera in log-depth space.
17
+ const float PLANAR_DEPTH_PULL = 0.9995;
18
+ // Depth push factor for behind fills: scales log depth by 1.0002, i.e. a
19
+ // 0.02% push away from the camera in log-depth space, so behind fills sit
20
+ // behind same-object siblings.
21
+ const float BEHIND_DEPTH_PUSH = 1.0002;
22
+ // Tolerance for comparing feature IDs stored as floats (integer equality).
23
+ const float FEATURE_ID_TOLERANCE = 0.5;
24
+ // Offset added to feature IDs so 0 means "no planar fill" in the texture.
25
+ const float FEATURE_ID_OFFSET = 1.0;
26
+
4
27
  czm_modelMaterial defaultModelMaterial()
5
28
  {
6
29
  czm_modelMaterial material;
@@ -40,6 +63,10 @@ void lineStyleStage()
40
63
 
41
64
  SelectedFeature selectedFeature;
42
65
 
66
+ // Set by edge-pass fragments below; consumed by the snapId expression built
67
+ // in PickingPipelineStage (see Scene#snap).
68
+ bool isEdge = false;
69
+
43
70
  void main()
44
71
  {
45
72
  #if defined(PRIMITIVE_TYPE_POINTS) && defined(HAS_POINT_DIAMETER)
@@ -69,6 +96,26 @@ void main()
69
96
  FeatureIds featureIds;
70
97
  featureIdStage(featureIds, attributes);
71
98
 
99
+ // ──────────────────────────────────────────────────────────────────────
100
+ // BENTLEY_materials_planar_fill: Feature-ID pre-pass output.
101
+ //
102
+ // When HAS_PLANAR_FILL_ID_PASS is defined this command is being rendered
103
+ // into the planar fill ID framebuffer. Non-behind planar geometry writes
104
+ // its feature ID + 1 into the R channel (0 = no feature) and returns.
105
+ // No material / lighting / post-process stages are needed.
106
+ // ──────────────────────────────────────────────────────────────────────
107
+ #ifdef HAS_PLANAR_FILL_ID_PASS
108
+ if (u_isPlanarFillIdPass) {
109
+ float fid = float(featureIds.PLANAR_FILL_FEATURE_ID) + FEATURE_ID_OFFSET;
110
+ out_FragColor = vec4(fid, 0.0, 0.0, 1.0);
111
+ // Still need to write log depth so the depth buffer is correct.
112
+ #ifdef LOG_DEPTH
113
+ czm_writeLogDepth();
114
+ #endif
115
+ return;
116
+ }
117
+ #endif
118
+
72
119
  Metadata metadata;
73
120
  MetadataClass metadataClass;
74
121
  MetadataStatistics metadataStatistics;
@@ -145,6 +192,12 @@ void main()
145
192
  #ifdef HAS_EDGE_VISIBILITY
146
193
  edgeVisibilityStage(color, featureIds);
147
194
  edgeDetectionStage(color, featureIds);
195
+ // Edge-pass fragments rasterize the edge band itself. Flag them so the
196
+ // snap payload (see Scene#snap) can distinguish edges from surfaces;
197
+ // surface fragments leave isEdge false.
198
+ if (u_isEdgePass) {
199
+ isEdge = true;
200
+ }
148
201
  #endif
149
202
 
150
203
  #endif
@@ -152,5 +205,57 @@ void main()
152
205
  //========================================================================
153
206
 
154
207
  out_FragColor = color;
208
+
209
+ // ──────────────────────────────────────────────────────────────────────
210
+ // Explicit log-depth write.
211
+ //
212
+ // DerivedCommand.getLogDepthShaderProgram auto-wraps only when the raw
213
+ // source does NOT already mention czm_writeLogDepth. We mention it
214
+ // above in the HAS_PLANAR_FILL_ID_PASS block, so we must also handle
215
+ // the normal code path ourselves. The LOG_DEPTH define is injected by
216
+ // that same auto-wrapper, so this block is active exactly when needed.
217
+ // ──────────────────────────────────────────────────────────────────────
218
+ #ifdef LOG_DEPTH
219
+ czm_writeLogDepth();
220
+ #endif
221
+
222
+ // ──────────────────────────────────────────────────────────────────────
223
+ // BENTLEY_materials_planar_fill: Proportional depth adjustment.
224
+ //
225
+ // Per the spec, planar primitives must render in front of non-planar
226
+ // geometry. We use proportional depth scaling (similar to edge visibility)
227
+ // which scales naturally with logarithmic depth at all viewing distances.
228
+ //
229
+ // ──────────────────────────────────────────────────────────────────────
230
+ #ifdef HAS_PLANAR_FILL_DEPTH
231
+ gl_FragDepth *= PLANAR_DEPTH_PULL;
232
+ #endif
233
+
234
+ // ──────────────────────────────────────────────────────────────────────
235
+ // BENTLEY_materials_planar_fill: Behind fill depth adjustment.
236
+ //
237
+ // After the proportional depth pull has been applied, sample the planar
238
+ // fill ID texture. If the pixel already belongs to the same feature,
239
+ // apply a small proportional push so this "behind" fill sits behind its
240
+ // non-behind sibling. If the pixel has no stored feature, the base pull
241
+ // still keeps us in front of non-planar geometry.
242
+ //
243
+ // ──────────────────────────────────────────────────────────────────────
244
+ #ifdef HAS_PLANAR_FILL_BEHIND
245
+ {
246
+ vec2 screenCoord = gl_FragCoord.xy / czm_viewport.zw;
247
+ float storedEncoded = texture(czm_planarFillIdTexture, screenCoord).r;
248
+ float storedFeatureId = storedEncoded - FEATURE_ID_OFFSET;
249
+ float myFeatureId = float(featureIds.PLANAR_FILL_FEATURE_ID);
250
+
251
+ // storedFeatureId < 0 means "no planar fill at this pixel".
252
+ if (storedFeatureId >= 0.0 && abs(storedFeatureId - myFeatureId) < FEATURE_ID_TOLERANCE) {
253
+ // Proportional push: multiply by >1 to move away from camera.
254
+ // Net effect: PLANAR_DEPTH_PULL * BEHIND_DEPTH_PUSH ≈ 0.9997,
255
+ // still in front of non-planar but behind same-feature non-behind fills.
256
+ gl_FragDepth *= BEHIND_DEPTH_PUSH;
257
+ }
258
+ }
259
+ #endif
155
260
  }
156
261
 
@@ -2,6 +2,29 @@
2
2
  export default "\n\
3
3
  precision highp float;\n\
4
4
  \n\
5
+ // ──────────────────────────────────────────────────────────────────────\n\
6
+ // BENTLEY_materials_planar_fill constants\n\
7
+ //\n\
8
+ // These factors scale gl_FragDepth AFTER czm_writeLogDepth has run, so\n\
9
+ // they are proportional offsets in log-depth space. The corresponding\n\
10
+ // eye-space offset therefore varies with the fragment's distance from\n\
11
+ // the camera (growing with distance). This is the intended behavior: it\n\
12
+ // matches the proportional depth comparison tolerance used by the edge\n\
13
+ // visibility system, so fills and edges stay consistently ordered at all\n\
14
+ // viewing distances.\n\
15
+ // ──────────────────────────────────────────────────────────────────────\n\
16
+ // Depth pull factor for all planar fills: scales log depth by 0.9995,\n\
17
+ // i.e. a 0.05% pull toward the camera in log-depth space.\n\
18
+ const float PLANAR_DEPTH_PULL = 0.9995;\n\
19
+ // Depth push factor for behind fills: scales log depth by 1.0002, i.e. a\n\
20
+ // 0.02% push away from the camera in log-depth space, so behind fills sit\n\
21
+ // behind same-object siblings.\n\
22
+ const float BEHIND_DEPTH_PUSH = 1.0002;\n\
23
+ // Tolerance for comparing feature IDs stored as floats (integer equality).\n\
24
+ const float FEATURE_ID_TOLERANCE = 0.5;\n\
25
+ // Offset added to feature IDs so 0 means \"no planar fill\" in the texture.\n\
26
+ const float FEATURE_ID_OFFSET = 1.0;\n\
27
+ \n\
5
28
  czm_modelMaterial defaultModelMaterial()\n\
6
29
  {\n\
7
30
  czm_modelMaterial material;\n\
@@ -41,6 +64,10 @@ void lineStyleStage()\n\
41
64
  \n\
42
65
  SelectedFeature selectedFeature;\n\
43
66
  \n\
67
+ // Set by edge-pass fragments below; consumed by the snapId expression built\n\
68
+ // in PickingPipelineStage (see Scene#snap).\n\
69
+ bool isEdge = false;\n\
70
+ \n\
44
71
  void main()\n\
45
72
  {\n\
46
73
  #if defined(PRIMITIVE_TYPE_POINTS) && defined(HAS_POINT_DIAMETER)\n\
@@ -69,6 +96,26 @@ void main()\n\
69
96
  \n\
70
97
  FeatureIds featureIds;\n\
71
98
  featureIdStage(featureIds, attributes);\n\
99
+ \n\
100
+ // ──────────────────────────────────────────────────────────────────────\n\
101
+ // BENTLEY_materials_planar_fill: Feature-ID pre-pass output.\n\
102
+ //\n\
103
+ // When HAS_PLANAR_FILL_ID_PASS is defined this command is being rendered\n\
104
+ // into the planar fill ID framebuffer. Non-behind planar geometry writes\n\
105
+ // its feature ID + 1 into the R channel (0 = no feature) and returns.\n\
106
+ // No material / lighting / post-process stages are needed.\n\
107
+ // ──────────────────────────────────────────────────────────────────────\n\
108
+ #ifdef HAS_PLANAR_FILL_ID_PASS\n\
109
+ if (u_isPlanarFillIdPass) {\n\
110
+ float fid = float(featureIds.PLANAR_FILL_FEATURE_ID) + FEATURE_ID_OFFSET;\n\
111
+ out_FragColor = vec4(fid, 0.0, 0.0, 1.0);\n\
112
+ // Still need to write log depth so the depth buffer is correct.\n\
113
+ #ifdef LOG_DEPTH\n\
114
+ czm_writeLogDepth();\n\
115
+ #endif\n\
116
+ return;\n\
117
+ }\n\
118
+ #endif\n\
72
119
  \n\
73
120
  Metadata metadata;\n\
74
121
  MetadataClass metadataClass;\n\
@@ -146,6 +193,12 @@ void main()\n\
146
193
  #ifdef HAS_EDGE_VISIBILITY\n\
147
194
  edgeVisibilityStage(color, featureIds);\n\
148
195
  edgeDetectionStage(color, featureIds);\n\
196
+ // Edge-pass fragments rasterize the edge band itself. Flag them so the\n\
197
+ // snap payload (see Scene#snap) can distinguish edges from surfaces;\n\
198
+ // surface fragments leave isEdge false.\n\
199
+ if (u_isEdgePass) {\n\
200
+ isEdge = true;\n\
201
+ }\n\
149
202
  #endif\n\
150
203
  \n\
151
204
  #endif\n\
@@ -153,6 +206,58 @@ void main()\n\
153
206
  //========================================================================\n\
154
207
  \n\
155
208
  out_FragColor = color;\n\
209
+ \n\
210
+ // ──────────────────────────────────────────────────────────────────────\n\
211
+ // Explicit log-depth write.\n\
212
+ //\n\
213
+ // DerivedCommand.getLogDepthShaderProgram auto-wraps only when the raw\n\
214
+ // source does NOT already mention czm_writeLogDepth. We mention it\n\
215
+ // above in the HAS_PLANAR_FILL_ID_PASS block, so we must also handle\n\
216
+ // the normal code path ourselves. The LOG_DEPTH define is injected by\n\
217
+ // that same auto-wrapper, so this block is active exactly when needed.\n\
218
+ // ──────────────────────────────────────────────────────────────────────\n\
219
+ #ifdef LOG_DEPTH\n\
220
+ czm_writeLogDepth();\n\
221
+ #endif\n\
222
+ \n\
223
+ // ──────────────────────────────────────────────────────────────────────\n\
224
+ // BENTLEY_materials_planar_fill: Proportional depth adjustment.\n\
225
+ //\n\
226
+ // Per the spec, planar primitives must render in front of non-planar\n\
227
+ // geometry. We use proportional depth scaling (similar to edge visibility)\n\
228
+ // which scales naturally with logarithmic depth at all viewing distances.\n\
229
+ //\n\
230
+ // ──────────────────────────────────────────────────────────────────────\n\
231
+ #ifdef HAS_PLANAR_FILL_DEPTH\n\
232
+ gl_FragDepth *= PLANAR_DEPTH_PULL;\n\
233
+ #endif\n\
234
+ \n\
235
+ // ──────────────────────────────────────────────────────────────────────\n\
236
+ // BENTLEY_materials_planar_fill: Behind fill depth adjustment.\n\
237
+ //\n\
238
+ // After the proportional depth pull has been applied, sample the planar\n\
239
+ // fill ID texture. If the pixel already belongs to the same feature,\n\
240
+ // apply a small proportional push so this \"behind\" fill sits behind its\n\
241
+ // non-behind sibling. If the pixel has no stored feature, the base pull\n\
242
+ // still keeps us in front of non-planar geometry.\n\
243
+ //\n\
244
+ // ──────────────────────────────────────────────────────────────────────\n\
245
+ #ifdef HAS_PLANAR_FILL_BEHIND\n\
246
+ {\n\
247
+ vec2 screenCoord = gl_FragCoord.xy / czm_viewport.zw;\n\
248
+ float storedEncoded = texture(czm_planarFillIdTexture, screenCoord).r;\n\
249
+ float storedFeatureId = storedEncoded - FEATURE_ID_OFFSET;\n\
250
+ float myFeatureId = float(featureIds.PLANAR_FILL_FEATURE_ID);\n\
251
+ \n\
252
+ // storedFeatureId < 0 means \"no planar fill at this pixel\".\n\
253
+ if (storedFeatureId >= 0.0 && abs(storedFeatureId - myFeatureId) < FEATURE_ID_TOLERANCE) {\n\
254
+ // Proportional push: multiply by >1 to move away from camera.\n\
255
+ // Net effect: PLANAR_DEPTH_PULL * BEHIND_DEPTH_PUSH ≈ 0.9997,\n\
256
+ // still in front of non-planar but behind same-feature non-behind fills.\n\
257
+ gl_FragDepth *= BEHIND_DEPTH_PUSH;\n\
258
+ }\n\
259
+ }\n\
260
+ #endif\n\
156
261
  }\n\
157
262
  \n\
158
263
  ";