@arcgis/core 4.24.0-next.20220430 → 4.24.0-next.20220503

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 (998) hide show
  1. package/Basemap.js +1 -1
  2. package/Color.js +1 -1
  3. package/Ground.js +1 -1
  4. package/Map.js +1 -1
  5. package/PopupTemplate.js +1 -1
  6. package/WebMap.js +1 -1
  7. package/WebScene.js +1 -1
  8. package/analysis/LinearDimension.js +1 -1
  9. package/analysis/SliceAnalysis.js +1 -1
  10. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  11. package/arcade/Dictionary.js +1 -1
  12. package/arcade/Feature.js +1 -1
  13. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  14. package/arcade/featureset/support/FeatureSet.js +1 -1
  15. package/assets/esri/core/workers/RemoteClient.js +1 -1
  16. package/assets/esri/core/workers/chunks/{e06461703e6f1acfcfdc.js → 076d1b1101b59af0d389.js} +1 -1
  17. package/assets/esri/core/workers/chunks/0b72d123386dc4ec7538.js +1 -0
  18. package/assets/esri/core/workers/chunks/0d53e575f11198867619.js +1 -0
  19. package/assets/esri/core/workers/chunks/0e6e3cf07c84d9f040c0.js +1 -0
  20. package/assets/esri/core/workers/chunks/105728404ddd9e73d5c9.js +1 -0
  21. package/assets/esri/core/workers/chunks/11106873b009b98e4286.js +1 -0
  22. package/assets/esri/core/workers/chunks/11a7b156591d1feca952.js +1 -0
  23. package/assets/esri/core/workers/chunks/{94325f920a125610e1f5.js → 12feeace7215248be23f.js} +1 -1
  24. package/assets/esri/core/workers/chunks/17be5bd0d1c233d73d7a.js +1 -0
  25. package/assets/esri/core/workers/chunks/1b53bd65407ba5c479d7.js +1 -0
  26. package/assets/esri/core/workers/chunks/1d91aa745b49b2ab36cf.js +1 -0
  27. package/assets/esri/core/workers/chunks/{fd35b69872ac9393924f.js → 1db8bfb1731be3ae320c.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{3433361f09c84b31aec4.js → 2290bd6dc2e6bb136e14.js} +1 -1
  29. package/assets/esri/core/workers/chunks/24217129d492e170f0f0.js +1 -0
  30. package/assets/esri/core/workers/chunks/24e194107e0e5090125b.js +1 -0
  31. package/assets/esri/core/workers/chunks/2a1301a1d0cd4c0c17cf.js +1 -0
  32. package/assets/esri/core/workers/chunks/{178831b0d0bdabcc45e7.js → 2a676221ca1fc8e0cf34.js} +1 -1
  33. package/assets/esri/core/workers/chunks/2aede0d1dcac8592436b.js +1 -0
  34. package/assets/esri/core/workers/chunks/2b93ad626f5e75b97692.js +1 -0
  35. package/assets/esri/core/workers/chunks/2d03210fc6b5884c6bf9.js +1 -0
  36. package/assets/esri/core/workers/chunks/{b10c333abe4f4e52841c.js → 2dfd3def105005fc72c7.js} +1 -1
  37. package/assets/esri/core/workers/chunks/2f8ff35b8ab15c0e39c2.js +1 -0
  38. package/assets/esri/core/workers/chunks/36272141b3c33cb19026.js +1 -0
  39. package/assets/esri/core/workers/chunks/36c8e8de9c3f67d32572.js +1 -0
  40. package/assets/esri/core/workers/chunks/3ab8c6ae2f2713f637b0.js +1 -0
  41. package/assets/esri/core/workers/chunks/3c058381adcfdc407aa1.js +1 -0
  42. package/assets/esri/core/workers/chunks/3f39df1dfc0a685e5f9d.js +1 -0
  43. package/assets/esri/core/workers/chunks/3fd52a03b3126556aee6.js +1 -0
  44. package/assets/esri/core/workers/chunks/4082d8573f41f952c72e.js +1 -0
  45. package/assets/esri/core/workers/chunks/40b11eea270f6688ff9c.js +1 -0
  46. package/assets/esri/core/workers/chunks/4281b4b27f4767cdd3ae.js +1 -0
  47. package/assets/esri/core/workers/chunks/43fcaaeb6fd179e9199b.js +1 -0
  48. package/assets/esri/core/workers/chunks/4c65b27d80b23c0c3101.js +1 -0
  49. package/assets/esri/core/workers/chunks/{a6406a248b7b2ed65f35.js → 4ec7d59b0c814dbaa7a4.js} +1 -1
  50. package/assets/esri/core/workers/chunks/4f378ad6f4299183df85.js +1 -0
  51. package/assets/esri/core/workers/chunks/505b0aa5ee3e5a26c351.js +1 -0
  52. package/assets/esri/core/workers/chunks/509a9cdd0228a730bcea.js +1 -0
  53. package/assets/esri/core/workers/chunks/52255ad573cec0a34720.js +1 -0
  54. package/assets/esri/core/workers/chunks/52d4fdc451a58a858af1.js +1 -0
  55. package/assets/esri/core/workers/chunks/5405f478af3563580926.js +1 -0
  56. package/assets/esri/core/workers/chunks/54577c2522ca3ff08f7e.js +1 -0
  57. package/assets/esri/core/workers/chunks/54d67e450da6ce2641b4.js +1 -0
  58. package/assets/esri/core/workers/chunks/56d3cb0ae0069a8eadde.js +1 -0
  59. package/assets/esri/core/workers/chunks/5b4efe0014162f777534.js +1 -0
  60. package/assets/esri/core/workers/chunks/5baa162351551817838b.js +1 -0
  61. package/assets/esri/core/workers/chunks/5cf2064bfd9d0847d9ec.js +1 -0
  62. package/assets/esri/core/workers/chunks/620dc3c13c345d5aa9f6.js +1 -0
  63. package/assets/esri/core/workers/chunks/7c290763920f52a1f504.js +1 -0
  64. package/assets/esri/core/workers/chunks/7dc266be958e34e81007.js +972 -0
  65. package/assets/esri/core/workers/chunks/7dfd70f4fa1096e56641.js +1 -0
  66. package/assets/esri/core/workers/chunks/7f097de06972a68cd08a.js +1 -0
  67. package/assets/esri/core/workers/chunks/8033531b0cc706b40d86.js +1 -0
  68. package/assets/esri/core/workers/chunks/814234844a056d9f1ddc.js +1 -0
  69. package/assets/esri/core/workers/chunks/83700cdd60ceecc639cd.js +1 -0
  70. package/assets/esri/core/workers/chunks/857df84cea67079a91e5.js +1 -0
  71. package/assets/esri/core/workers/chunks/8793070d288878d6f49b.js +1 -0
  72. package/assets/esri/core/workers/chunks/8865c5cc28df60364e60.js +1 -0
  73. package/assets/esri/core/workers/chunks/{e9f786d4ba3143ed9644.js → 8cc85d1d46dda16ad041.js} +1 -1
  74. package/assets/esri/core/workers/chunks/958a7ef2cbf048819988.js +1 -0
  75. package/assets/esri/core/workers/chunks/967af0aa4dc4da032fdc.js +1 -0
  76. package/assets/esri/core/workers/chunks/9722880bd7f455b2bd07.js +1 -0
  77. package/assets/esri/core/workers/chunks/9d738aab0d907cd09a9d.js +1 -0
  78. package/assets/esri/core/workers/chunks/{86b31ae136f931d7884a.js → 9e6df034d7949880471f.js} +1 -1
  79. package/assets/esri/core/workers/chunks/a056a79f31cddb066f15.js +1 -0
  80. package/assets/esri/core/workers/chunks/a2c9fd78d42df7314a3e.js +1 -0
  81. package/assets/esri/core/workers/chunks/a4dcb50f6622cb1444c8.js +1 -0
  82. package/assets/esri/core/workers/chunks/a6bfbe449b8c2fa5334c.js +1 -0
  83. package/assets/esri/core/workers/chunks/a8ed1a938dc164b401d9.js +1 -0
  84. package/assets/esri/core/workers/chunks/a9a73bc4875a5aeaf1b9.js +1 -0
  85. package/assets/esri/core/workers/chunks/ac0df52b2f2a4874e4ea.js +1 -0
  86. package/assets/esri/core/workers/chunks/{431efa172901ab8e4d53.js → acfa8eb19225f7862b1d.js} +1 -1
  87. package/assets/esri/core/workers/chunks/adae54f116f311d72d97.js +1 -0
  88. package/assets/esri/core/workers/chunks/{718073d13d3de67b629b.js → aeeb364b7c1876f6e7db.js} +1 -1
  89. package/assets/esri/core/workers/chunks/afddfe620e6539991e6b.js +1 -0
  90. package/assets/esri/core/workers/chunks/b02a83845d3da4caee9d.js +1 -0
  91. package/assets/esri/core/workers/chunks/{0d21506b7d4f9afdbb09.js → b3847a6bbd45d813f03c.js} +1 -1
  92. package/assets/esri/core/workers/chunks/b4c23630d6c85f7b59c0.js +1 -0
  93. package/assets/esri/core/workers/chunks/{c318b229911b60fc3cbf.js → b50ae3dc7e43ff452568.js} +1 -1
  94. package/assets/esri/core/workers/chunks/b5ede4df4620097c6528.js +1 -0
  95. package/assets/esri/core/workers/chunks/b7d7ad127f8939cbdec2.js +1 -0
  96. package/assets/esri/core/workers/chunks/bf1d1c02d12b526b0750.js +1 -0
  97. package/assets/esri/core/workers/chunks/c0e6dbecdbd30066a82c.js +1 -0
  98. package/assets/esri/core/workers/chunks/c2a36243eb105d570bff.js +1 -0
  99. package/assets/esri/core/workers/chunks/c8a3a28809542396c6fd.js +1 -0
  100. package/assets/esri/core/workers/chunks/cf1047ad176a25dcd2d6.js +1 -0
  101. package/assets/esri/core/workers/chunks/d03de043d43691665a93.js +1 -0
  102. package/assets/esri/core/workers/chunks/d3fecbaca51ef8844026.js +1 -0
  103. package/assets/esri/core/workers/chunks/dafe120243db6648a4ab.js +1 -0
  104. package/assets/esri/core/workers/chunks/dccc33d87cb7d902f5c7.js +1 -0
  105. package/assets/esri/core/workers/chunks/dd43f5647900ee27af22.js +1 -0
  106. package/assets/esri/core/workers/chunks/{52489e2f7748dc610263.js → dfdd853dd6c023089963.js} +1 -1
  107. package/assets/esri/core/workers/chunks/e6f76f62cf58fb1e67c6.js +1 -0
  108. package/assets/esri/core/workers/chunks/ea73a1d9cad5e1a5d861.js +1 -0
  109. package/assets/esri/core/workers/chunks/{4130ea1f5a9f197168d7.js → ed4519ac9533a4d340f1.js} +1 -1
  110. package/assets/esri/core/workers/chunks/f0e462f5a16852f33225.js +1 -0
  111. package/assets/esri/core/workers/chunks/f13c29bcc71aed8f3a2e.js +1 -0
  112. package/assets/esri/core/workers/chunks/f356e505c36397fda3cf.js +1 -0
  113. package/assets/esri/core/workers/chunks/f55cbaf5a1d6ee6ac171.js +1 -0
  114. package/assets/esri/core/workers/chunks/f6e613ae6812a347a26c.js +1 -0
  115. package/assets/esri/core/workers/chunks/fb3279408bd5323ec612.js +1 -0
  116. package/assets/esri/core/workers/chunks/fdf80a371b7b2a45f1ff.js +1 -0
  117. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  118. package/chunks/ChapmanAtmosphere.glsl.js +15 -15
  119. package/chunks/CheckerBoard.glsl.js +3 -3
  120. package/chunks/Clouds.glsl.js +2 -3
  121. package/chunks/CloudsComposition.glsl.js +3 -3
  122. package/chunks/ColorMaterial.glsl.js +11 -11
  123. package/chunks/DefaultMaterial.glsl.js +26 -26
  124. package/chunks/EdgeShader.glsl.js +3 -3
  125. package/chunks/Fog.glsl.js +6 -6
  126. package/chunks/HUDMaterial.glsl.js +48 -48
  127. package/chunks/HeatmapDensity.glsl.js +7 -7
  128. package/chunks/HighlightApply.glsl.js +3 -3
  129. package/chunks/LineCallout.glsl.js +3 -3
  130. package/chunks/LineMarker.glsl.js +22 -22
  131. package/chunks/MeasurementArrow.glsl.js +4 -4
  132. package/chunks/NativeLine.glsl.js +11 -11
  133. package/chunks/Path.glsl.js +16 -16
  134. package/chunks/Pattern.glsl.js +30 -30
  135. package/chunks/RasterColorizer.glsl.js +4 -4
  136. package/chunks/RealisticTree.glsl.js +20 -20
  137. package/chunks/RibbonLine.glsl.js +39 -39
  138. package/chunks/ShadedColorMaterial.glsl.js +10 -10
  139. package/chunks/ShadowCastVisualize.glsl.js +5 -5
  140. package/chunks/ShadowHighlight.glsl.js +2 -2
  141. package/chunks/SlicePlaneMaterial.glsl.js +3 -3
  142. package/chunks/Stars.glsl.js +2 -2
  143. package/chunks/WaterSurface.glsl.js +20 -20
  144. package/chunks/languageUtils.js +1 -1
  145. package/chunks/persistableUrlUtils.js +1 -1
  146. package/chunks/vec22.js +1 -1
  147. package/chunks/vec2f64.js +1 -1
  148. package/chunks/vec3.js +1 -1
  149. package/chunks/vec33.js +1 -1
  150. package/chunks/vec43.js +1 -1
  151. package/colorUtils.js +1 -1
  152. package/config.js +1 -1
  153. package/core/Accessor.js +1 -1
  154. package/core/AsyncUpdate.js +1 -1
  155. package/core/Clonable.js +1 -1
  156. package/core/Collection.js +1 -1
  157. package/core/HandleOwner.js +1 -1
  158. package/core/Loadable.js +1 -1
  159. package/core/NestedMap.js +1 -1
  160. package/core/accessorSupport/DefaultsStore.js +1 -1
  161. package/core/accessorSupport/Properties.js +1 -1
  162. package/core/accessorSupport/decorators/enumeration.js +1 -1
  163. package/core/accessorSupport/extensions/serializableProperty/reader.js +1 -1
  164. package/core/accessorSupport/extensions/serializableProperty/writePolicyUtils.js +1 -1
  165. package/core/accessorSupport/extensions/serializableProperty/writer.js +1 -1
  166. package/core/accessorSupport/read.js +1 -1
  167. package/core/accessorSupport/tracking.js +1 -1
  168. package/core/accessorSupport/write.js +1 -1
  169. package/core/devEnvironmentUtils.js +1 -1
  170. package/core/has.js +1 -1
  171. package/core/libs/gl-matrix-2/factories/vec2f64.js +1 -1
  172. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  173. package/core/libs/rbush/PooledRBush.js +1 -1
  174. package/core/promiseUtils.js +1 -1
  175. package/core/reactiveUtils.js +1 -1
  176. package/core/scheduling.js +1 -1
  177. package/core/throttle.js +1 -1
  178. package/core/urlUtils.js +1 -1
  179. package/core/watchUtils.js +1 -1
  180. package/core/workers/RemoteClient.js +1 -1
  181. package/core/workers/WorkerOwner.js +1 -1
  182. package/core/workers/loaderConfig.js +1 -1
  183. package/core/workers/workerFactory.js +1 -1
  184. package/geometry/Mesh.js +1 -1
  185. package/geometry/geometryEngine.js +1 -1
  186. package/geometry/geometryEngineAsync.js +1 -1
  187. package/geometry/projection.js +1 -1
  188. package/geometry/support/axisAngleDegrees.js +1 -1
  189. package/geometry/support/meshUtils/centerAt.js +1 -1
  190. package/geometry/support/meshUtils/deduplicate.js +1 -1
  191. package/geometry/support/meshUtils/elevation.js +1 -1
  192. package/geometry/support/meshUtils/geographicUtils.js +1 -1
  193. package/geometry/support/meshUtils/georeference.js +1 -1
  194. package/geometry/support/meshUtils/loadExternal.js +1 -1
  195. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  196. package/geometry/support/meshUtils/offset.js +1 -1
  197. package/geometry/support/meshUtils/rotate.js +1 -1
  198. package/geometry/support/meshUtils/scale.js +1 -1
  199. package/geometry/support/normalizeUtils.js +1 -1
  200. package/geometry/support/normalizeUtilsCommon.js +1 -1
  201. package/geometry/support/offset.js +1 -1
  202. package/geometry/support/rotate.js +1 -1
  203. package/identity/IdentityManagerBase.js +1 -1
  204. package/identity/IdentityModal.js +1 -1
  205. package/interfaces.d.ts +109 -2
  206. package/intl/locale.js +1 -1
  207. package/intl/messages.js +1 -1
  208. package/kernel.js +1 -1
  209. package/layers/AnalysisLayer.js +1 -1
  210. package/layers/CSVLayer.js +1 -1
  211. package/layers/FeatureLayer.js +1 -1
  212. package/layers/GeoJSONLayer.js +1 -1
  213. package/layers/GeoRSSLayer.js +1 -1
  214. package/layers/ImageryLayer.js +1 -1
  215. package/layers/ImageryTileLayer.js +1 -1
  216. package/layers/Layer.js +1 -1
  217. package/layers/MapImageLayer.js +1 -1
  218. package/layers/MapNotesLayer.js +1 -1
  219. package/layers/OGCFeatureLayer.js +1 -1
  220. package/layers/RouteLayer.js +1 -1
  221. package/layers/SceneLayer.js +1 -1
  222. package/layers/StreamLayer.js +1 -1
  223. package/layers/SubtypeGroupLayer.js +1 -1
  224. package/layers/TileLayer.js +1 -1
  225. package/layers/VectorTileLayer.js +1 -1
  226. package/layers/VoxelLayer.js +1 -1
  227. package/layers/VoxelWasmPerScene.js +1 -1
  228. package/layers/WCSLayer.js +1 -1
  229. package/layers/WFSLayer.js +1 -1
  230. package/layers/WMSLayer.js +1 -1
  231. package/layers/WMTSLayer.js +1 -1
  232. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  233. package/layers/effects/EffectView.js +1 -1
  234. package/layers/effects/FeatureEffectView.js +1 -1
  235. package/layers/effects/jsonUtils.js +1 -1
  236. package/layers/graphics/OptimizedGeometry.js +1 -1
  237. package/layers/graphics/centroid.js +1 -1
  238. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  239. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  240. package/layers/graphics/data/QueryEngineResult.js +1 -1
  241. package/layers/graphics/data/StreamFeatureManager.js +1 -1
  242. package/layers/graphics/editingSupport.js +1 -1
  243. package/layers/graphics/objectIdUtils.js +1 -1
  244. package/layers/graphics/sources/CSVSource.js +1 -1
  245. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  246. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  247. package/layers/graphics/sources/MemorySource.js +1 -1
  248. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  249. package/layers/graphics/sources/WFSSource.js +1 -1
  250. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  251. package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
  252. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  253. package/layers/graphics/sources/geojson/geojson.js +1 -1
  254. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  255. package/layers/graphics/sources/support/QueryTask.js +1 -1
  256. package/layers/mixins/APIKeyMixin.js +1 -1
  257. package/layers/mixins/ArcGISImageService.js +1 -1
  258. package/layers/mixins/ArcGISMapService.js +1 -1
  259. package/layers/mixins/ImageryTileMixin.js +1 -1
  260. package/layers/mixins/OperationalLayer.js +1 -1
  261. package/layers/mixins/PortalLayer.js +1 -1
  262. package/layers/mixins/SceneService.js +1 -1
  263. package/layers/mixins/refresh.js +1 -1
  264. package/layers/ogc/dateUtils.js +1 -1
  265. package/layers/ogc/ogcFeatureUtils.js +1 -1
  266. package/layers/ogc/wfsUtils.js +1 -1
  267. package/layers/save/featureLayerUtils.js +1 -1
  268. package/layers/support/ExportImageParameters.js +1 -1
  269. package/layers/support/ExportImageServiceParameters.js +1 -1
  270. package/layers/support/ExportWMSImageParameters.js +1 -1
  271. package/layers/support/FeatureEffect.js +1 -1
  272. package/layers/support/FeatureType.js +1 -1
  273. package/layers/support/FetchAssociatedFeatureLayer.js +1 -1
  274. package/layers/support/LabelClass.js +1 -1
  275. package/layers/support/LayerContingentValuesCache.js +1 -1
  276. package/layers/support/RasterFunction.js +1 -1
  277. package/layers/support/RasterInfo.js +1 -1
  278. package/layers/support/RasterJobHandler.js +1 -1
  279. package/layers/support/RasterWorker.js +1 -1
  280. package/layers/support/Sublayer.js +1 -1
  281. package/layers/support/SubtypeSublayer.js +1 -1
  282. package/layers/support/TilemapCache.js +1 -1
  283. package/layers/support/TimeReference.d.ts +4 -0
  284. package/layers/support/WMTSSublayer.js +1 -1
  285. package/layers/support/arcgisLayers.js +1 -1
  286. package/layers/support/commonProperties.js +1 -1
  287. package/layers/support/editableLayers.js +1 -1
  288. package/layers/support/fieldUtils.js +1 -1
  289. package/layers/support/floorFilterUtils.js +1 -1
  290. package/layers/support/imageryRendererUtils.js +1 -1
  291. package/layers/support/layerUtils.js +1 -1
  292. package/layers/support/layersCreator.js +1 -1
  293. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  294. package/layers/support/rasterDatasets/CloudRaster.js +1 -1
  295. package/layers/support/rasterDatasets/ImageAuxRaster.js +1 -1
  296. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  297. package/layers/support/rasterDatasets/InMemoryRaster.js +1 -1
  298. package/layers/support/rasterDatasets/MRFRaster.js +1 -1
  299. package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
  300. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  301. package/layers/support/rasterDatasets/multipartParser.js +1 -1
  302. package/layers/support/rasterDatasets/pamParser.js +1 -1
  303. package/layers/support/rasterDatasets/wcsCapabilitiesParser.js +1 -1
  304. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  305. package/layers/support/rasterDatasets/xmlUtilities.js +1 -1
  306. package/layers/support/rasterFormats/Lerc.js +1 -1
  307. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  308. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  309. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  310. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  311. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  312. package/layers/support/rasterFunctions/vectorFieldUtils.js +1 -1
  313. package/layers/support/rasterTransforms/PolynomialTransform.js +1 -1
  314. package/layers/support/rasterTransforms/utils.js +1 -1
  315. package/layers/support/source/DataLayerSource.js +1 -1
  316. package/layers/support/source/QueryTableDataSource.js +1 -1
  317. package/layers/support/vectorTileLayerLoader.js +1 -1
  318. package/layers/support/wmsUtils.js +1 -1
  319. package/layers/support/wmtsUtils.js +1 -1
  320. package/libs/maquette-advanced-projector/projector.js +1 -1
  321. package/networks/Network.js +1 -1
  322. package/networks/UtilityNetwork.js +1 -1
  323. package/networks/support/utils.js +1 -1
  324. package/package.json +1 -1
  325. package/popup/content/ExpressionContent.js +1 -1
  326. package/portal/Portal.js +1 -1
  327. package/portal/PortalItem.js +1 -1
  328. package/portal/support/geometryServiceUtils.js +1 -1
  329. package/portal/support/layersLoader.js +1 -1
  330. package/portal/support/portalItemUtils.js +1 -1
  331. package/portal/support/portalLayers.js +1 -1
  332. package/renderers/DictionaryRenderer.js +1 -1
  333. package/renderers/FlowRenderer.js +1 -1
  334. package/renderers/RasterColormapRenderer.js +1 -1
  335. package/renderers/RasterStretchRenderer.js +1 -1
  336. package/renderers/VectorFieldRenderer.js +1 -1
  337. package/renderers/support/RasterSymbolizer.js +1 -1
  338. package/renderers/support/UniqueValueInfo.js +1 -1
  339. package/renderers/support/colorRampUtils.js +1 -1
  340. package/renderers/support/heatmapUtils.js +1 -1
  341. package/renderers/support/rasterRendererHelper.js +1 -1
  342. package/request.js +1 -1
  343. package/rest/identify.js +1 -1
  344. package/rest/imageService.js +1 -1
  345. package/rest/networkService.js +1 -1
  346. package/rest/networks/support/SynthesizeAssociationGeometriesParameters.js +1 -1
  347. package/rest/operations/identify.js +1 -1
  348. package/rest/print.js +1 -1
  349. package/rest/query/executeQuery.js +1 -1
  350. package/rest/query/operations/query.js +1 -1
  351. package/rest/query/operations/queryRelatedRecords.js +1 -1
  352. package/rest/query/operations/queryTopFeatures.js +1 -1
  353. package/rest/route.js +1 -1
  354. package/rest/support/DirectionLine.js +1 -1
  355. package/rest/support/DirectionPoint.js +1 -1
  356. package/rest/support/DirectionsFeatureSet.js +1 -1
  357. package/rest/support/FeatureSet.js +1 -1
  358. package/rest/support/ImageSampleParameters.js +1 -1
  359. package/rest/support/PointBarrier.js +1 -1
  360. package/rest/support/PolygonBarrier.js +1 -1
  361. package/rest/support/PolylineBarrier.js +1 -1
  362. package/rest/support/RouteInfo.js +1 -1
  363. package/rest/support/Stop.js +1 -1
  364. package/rest/support/meshFeatureSet.js +1 -1
  365. package/rest/support/printTaskUtils.js +1 -1
  366. package/smartMapping/labels/clusters.js +1 -1
  367. package/smartMapping/raster/renderers/rgb.js +1 -1
  368. package/smartMapping/raster/renderers/uniqueValue.js +1 -1
  369. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  370. package/smartMapping/raster/support/adapters/RasterLayerAdapter.js +1 -1
  371. package/smartMapping/raster/support/utils.js +1 -1
  372. package/smartMapping/renderers/color.js +1 -1
  373. package/smartMapping/renderers/size.js +1 -1
  374. package/smartMapping/renderers/support/utils.js +1 -1
  375. package/smartMapping/renderers/univariateColorSize.js +1 -1
  376. package/smartMapping/statistics/support/WorkerClient.js +1 -1
  377. package/smartMapping/support/adapters/CSVLayerAdapter.js +1 -1
  378. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  379. package/smartMapping/support/adapters/OGCFeatureLayerAdapter.js +1 -1
  380. package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
  381. package/smartMapping/support/adapters/support/utils.js +1 -1
  382. package/statistics/utils.js +1 -1
  383. package/support/LayersMixin.js +1 -1
  384. package/support/TablesMixin.js +1 -1
  385. package/support/arcadeUtils.js +1 -1
  386. package/support/basemapUtils.js +1 -1
  387. package/support/popupUtils.js +1 -1
  388. package/support/revision.js +1 -1
  389. package/support/timeUtils.js +1 -1
  390. package/symbols/FillSymbol3DLayer.js +1 -1
  391. package/symbols/LineSymbol3DLayer.js +1 -1
  392. package/symbols/LineSymbolMarker.js +1 -1
  393. package/symbols/PictureFillSymbol.js +1 -1
  394. package/symbols/PointSymbol3D.js +1 -1
  395. package/symbols/SimpleLineSymbol.js +1 -1
  396. package/symbols/SimpleMarkerSymbol.js +1 -1
  397. package/symbols/cim/CIMResourceManager.js +1 -1
  398. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  399. package/symbols/cim/CIMSymbolHelper.js +1 -1
  400. package/symbols/cim/ExpandedCIM.js +1 -1
  401. package/symbols/cim/SDFHelper.js +1 -1
  402. package/symbols/cim/cimAnalyzer.js +1 -1
  403. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  404. package/symbols/cim/effects/EffectDashes.js +1 -1
  405. package/symbols/cim/effects/EffectOffset.js +1 -1
  406. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  407. package/symbols/cim/utils.js +1 -1
  408. package/symbols/support/cimSymbolUtils.js +1 -1
  409. package/symbols/support/jsonUtils.js +1 -1
  410. package/symbols/support/previewCIMSymbol.js +1 -1
  411. package/symbols/support/previewSymbol2D.js +1 -1
  412. package/symbols/support/previewSymbol3D.js +1 -1
  413. package/symbols/support/previewWebStyleSymbol.js +1 -1
  414. package/symbols/support/svgUtils.js +1 -1
  415. package/symbols/support/symbolConversion.js +1 -1
  416. package/symbols/support/symbolUtils.js +1 -1
  417. package/tasks/GenerateRendererTask.js +1 -1
  418. package/views/2d/MapViewConstraints.js +1 -1
  419. package/views/2d/constraints/GeometryConstraint.js +1 -1
  420. package/views/2d/engine/Bitmap.js +1 -1
  421. package/views/2d/engine/Container.js +1 -1
  422. package/views/2d/engine/DisplayObject.js +1 -1
  423. package/views/2d/engine/Stage.js +1 -1
  424. package/views/2d/engine/imagery/BrushRasterBitmap.js +1 -1
  425. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  426. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  427. package/views/2d/engine/vectorTiles/TilemapRequest.js +1 -1
  428. package/views/2d/engine/vectorTiles/WorkerTileHandler.js +1 -1
  429. package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
  430. package/views/2d/engine/vectorTiles/buckets/LineBucket.js +1 -1
  431. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  432. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  433. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  434. package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
  435. package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
  436. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  437. package/views/2d/engine/webgl/GraphicTile.js +1 -1
  438. package/views/2d/engine/webgl/TextureManager.js +1 -1
  439. package/views/2d/engine/webgl/brushes/WGLBrushHeatmap.js +1 -1
  440. package/views/2d/engine/webgl/brushes/WGLBrushVTLCircle.js +1 -1
  441. package/views/2d/engine/webgl/brushes/WGLBrushVTLFill.js +1 -1
  442. package/views/2d/engine/webgl/brushes/WGLBrushVTLLine.js +1 -1
  443. package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
  444. package/views/2d/engine/webgl/collisions/MetricReader.js +1 -1
  445. package/views/2d/engine/webgl/cpuMapped/DisplayRecordReader.js +1 -1
  446. package/views/2d/engine/webgl/cpuMapped/FreeList.js +1 -1
  447. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  448. package/views/2d/engine/webgl/mesh/templates/WGLBaseLineTemplate.js +1 -1
  449. package/views/2d/engine/webgl/mesh/templates/WGLBaseMarkerTemplate.js +1 -1
  450. package/views/2d/engine/webgl/mesh/templates/WGLBaseTextTemplate.js +1 -1
  451. package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
  452. package/views/2d/engine/webgl/mesh/templates/WGLLabelTemplate.js +1 -1
  453. package/views/2d/engine/webgl/mesh/templates/WGLLineTemplate.js +1 -1
  454. package/views/2d/engine/webgl/mesh/templates/WGLMeshTemplate.js +1 -1
  455. package/views/2d/engine/webgl/painter/RenderPass.js +1 -1
  456. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  457. package/views/2d/engine/webgl/techniques/dotDensity/TechniqueDotDensity.js +1 -1
  458. package/views/2d/input/MapViewInputManager.js +1 -1
  459. package/views/2d/input/handlers/GamepadNavigation.js +1 -1
  460. package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
  461. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  462. package/views/2d/layers/BaseLayerView2D.js +1 -1
  463. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  464. package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
  465. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  466. package/views/2d/layers/GeoRSSLayerView2D.js +1 -1
  467. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  468. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  469. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  470. package/views/2d/layers/KMLLayerView2D.js +1 -1
  471. package/views/2d/layers/LayerView2D.js +1 -1
  472. package/views/2d/layers/SubtypeGroupLayerView2D.js +1 -1
  473. package/views/2d/layers/TileLayerView2D.js +1 -1
  474. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  475. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  476. package/views/2d/layers/features/FeatureStore2D.js +1 -1
  477. package/views/2d/layers/features/Pipeline.js +1 -1
  478. package/views/2d/layers/features/batchUtils.js +1 -1
  479. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  480. package/views/2d/layers/features/controllers/support/sourceAdapters.js +1 -1
  481. package/views/2d/layers/features/createSymbolSchema.js +1 -1
  482. package/views/2d/layers/features/processors/SymbolProcessor.js +1 -1
  483. package/views/2d/layers/features/schemaUtils.js +1 -1
  484. package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
  485. package/views/2d/layers/features/sources/DataTileSource.js +1 -1
  486. package/views/2d/layers/features/sources/DataTileSubscription.js +1 -1
  487. package/views/2d/layers/features/sources/SnapshotFeatureSource.js +1 -1
  488. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  489. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  490. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  491. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  492. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  493. package/views/2d/layers/features/support/ResourceManagerProxy.js +1 -1
  494. package/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js +1 -1
  495. package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
  496. package/views/2d/layers/graphics/graphicsUtils.js +1 -1
  497. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  498. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  499. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  500. package/views/2d/layers/support/ExportStrategy.js +1 -1
  501. package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
  502. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  503. package/views/2d/support/engineHelpers.js +1 -1
  504. package/views/2d/tiling/TileManager.js +1 -1
  505. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  506. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  507. package/views/3d/analysis/Dimensioning/DimensioningVisualization.js +5 -0
  508. package/views/3d/analysis/Dimensioning/LinearDimensionVisualization.js +5 -0
  509. package/views/3d/analysis/DimensioningAnalysisView3D.js +1 -1
  510. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  511. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  512. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  513. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  514. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  515. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  516. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  517. package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
  518. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  519. package/views/3d/environment/Clouds.glsl.js +1 -1
  520. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  521. package/views/3d/environment/CloudsComposition.js +1 -1
  522. package/views/3d/environment/CloudsCompositionParameters.js +5 -0
  523. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  524. package/views/3d/environment/Fog.glsl.js +1 -1
  525. package/views/3d/environment/Fog.js +1 -1
  526. package/views/3d/environment/Precipitation.js +1 -1
  527. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  528. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  529. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  530. package/views/3d/environment/Stars.glsl.js +1 -1
  531. package/views/3d/environment/Stars.js +1 -1
  532. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  533. package/views/3d/glTF/internal/Resource.js +1 -1
  534. package/views/3d/glTF/loader.js +1 -1
  535. package/views/3d/input/SceneInputManager.js +1 -1
  536. package/views/3d/input/handlers/TwoFingerTilt.js +1 -1
  537. package/views/3d/interactive/Manipulator3D.js +1 -1
  538. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  539. package/views/3d/interactive/editingTools/manipulations/MoveManipulation.js +1 -1
  540. package/views/3d/interactive/editingTools/moveGraphic/isSupportedGraphic.js +1 -1
  541. package/views/3d/interactive/editingTools/reshapeGraphic/GraphicReshapeTool.js +1 -1
  542. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  543. package/views/3d/interactive/editingTools/reshapeGraphic/isSupportedGraphic.js +1 -1
  544. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  545. package/views/3d/interactive/editingTools/transformGraphic/isSupportedGraphic.js +1 -1
  546. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  547. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  548. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  549. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  550. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  551. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  552. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  553. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  554. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  555. package/views/3d/layers/FeatureLayerView3D.js +1 -1
  556. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  557. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  558. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  559. package/views/3d/layers/GraphicsView3D.js +1 -1
  560. package/views/3d/layers/I3SMeshView3D.js +1 -1
  561. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  562. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  563. package/views/3d/layers/LayerView3D.js +1 -1
  564. package/views/3d/layers/RouteLayerView3D.js +1 -1
  565. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  566. package/views/3d/layers/SceneLayerView3D.js +1 -1
  567. package/views/3d/layers/SceneLayerWorker.js +1 -1
  568. package/views/3d/layers/StreamLayerView3D.js +1 -1
  569. package/views/3d/layers/TiledLayerView3D.js +1 -1
  570. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  571. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  572. package/views/3d/layers/WMSLayerView3D.js +1 -1
  573. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  574. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  575. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  576. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  577. package/views/3d/layers/graphics/Graphics3DFilterVisibility.js +1 -1
  578. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  579. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  580. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  581. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  582. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  583. package/views/3d/layers/graphics/Graphics3DPointSymbol.js +1 -1
  584. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  585. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  586. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  587. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  588. package/views/3d/layers/graphics/Labeler.js +1 -1
  589. package/views/3d/layers/i3s/I3SAttributeOverrides.js +1 -1
  590. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  591. package/views/3d/layers/i3s/I3SStreamDataController.js +1 -1
  592. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  593. package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
  594. package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
  595. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  596. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  597. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  598. package/views/3d/state/ConstraintsManager.js +1 -1
  599. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  600. package/views/3d/support/ResourceController.js +1 -1
  601. package/views/3d/support/SharedSymbolResources.js +1 -1
  602. package/views/3d/support/TextureCollection.js +1 -1
  603. package/views/3d/support/cameraUtils.js +1 -1
  604. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  605. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  606. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  607. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  608. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  609. package/views/3d/terrain/OverlayManager.js +1 -1
  610. package/views/3d/terrain/OverlayRenderer.js +1 -1
  611. package/views/3d/terrain/PatchGeometry.js +1 -1
  612. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  613. package/views/3d/terrain/PatchRenderData.js +1 -1
  614. package/views/3d/terrain/PlanarPatch.js +1 -1
  615. package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
  616. package/views/3d/terrain/RasterTile.js +1 -1
  617. package/views/3d/terrain/SphericalPatch.js +1 -1
  618. package/views/3d/terrain/TerrainRenderer.js +1 -1
  619. package/views/3d/terrain/TerrainSurface.js +1 -1
  620. package/views/3d/terrain/Tile.js +1 -1
  621. package/views/3d/terrain/TileCompositor.js +1 -1
  622. package/views/3d/terrain/TileRenderer.js +1 -1
  623. package/views/3d/terrain/TilingSchemeLogic.js +1 -1
  624. package/views/3d/terrain/terrainUtils.js +1 -1
  625. package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
  626. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  627. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  628. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +2 -2
  629. package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
  630. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +1 -1
  631. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +5 -5
  632. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +8 -8
  633. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +6 -6
  634. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +4 -4
  635. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
  636. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +5 -5
  637. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +13 -13
  638. package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
  639. package/views/3d/webgl-engine/core/shaderLibrary/raster/Colormap.glsl.js +1 -1
  640. package/views/3d/webgl-engine/core/shaderLibrary/raster/Common.glsl.js +2 -2
  641. package/views/3d/webgl-engine/core/shaderLibrary/raster/Projection.glsl.js +1 -1
  642. package/views/3d/webgl-engine/core/shaderLibrary/raster/RasterColorizer.glsl.js +1 -1
  643. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +1 -1
  644. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +5 -5
  645. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js +3 -3
  646. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +13 -13
  647. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +17 -17
  648. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +1 -1
  649. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +7 -7
  650. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +2 -2
  651. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +5 -5
  652. package/views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js +2 -2
  653. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +15 -15
  654. package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +2 -2
  655. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  656. package/views/3d/webgl-engine/core/shaderModules/BooleanPassUniform.js +5 -0
  657. package/views/3d/webgl-engine/core/shaderModules/Float4DrawUniform.js +5 -0
  658. package/views/3d/webgl-engine/core/shaderModules/{Matrix3Uniform.js → Float4PassUniform.js} +1 -1
  659. package/views/3d/webgl-engine/core/shaderModules/Float4Uniform.js +1 -1
  660. package/views/3d/webgl-engine/core/shaderModules/Matrix3DrawUniform.js +5 -0
  661. package/views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform.js +5 -0
  662. package/views/3d/webgl-engine/core/shaderModules/{TextureCubeUniform.js → TextureCubePassUniform.js} +1 -1
  663. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js +1 -1
  664. package/views/3d/webgl-engine/lib/AutoDisposable.js +1 -1
  665. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  666. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  667. package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
  668. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  669. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  670. package/views/3d/webgl-engine/lib/ShadowHighlight.js +1 -1
  671. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  672. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  673. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  674. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  675. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  676. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  677. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  678. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  679. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  680. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  681. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  682. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  683. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  684. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  685. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  686. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  687. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  688. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  689. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  690. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  691. package/views/3d/webgl-engine/materials/{VisualVariableMaterialParameters.js → VisualVariablePassParameters.js} +1 -1
  692. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  693. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  694. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  695. package/views/3d/webgl-engine/parts/requireUtils.js +1 -1
  696. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  697. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  698. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  699. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  700. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  701. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  702. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  703. package/views/3d/webgl-engine/shaders/HeatmapDensity.glsl.js +1 -1
  704. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  705. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  706. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  707. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  708. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  709. package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +3 -3
  710. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  711. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  712. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  713. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  714. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  715. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  716. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  717. package/views/3d/webgl-engine/shaders/ShadowCastVisualize.glsl.js +1 -1
  718. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  719. package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
  720. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  721. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +3 -3
  722. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShader.glsl.js +1 -1
  723. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +5 -5
  724. package/views/BasemapView.js +1 -1
  725. package/views/GroundView.js +1 -1
  726. package/views/LayerViewManager.js +1 -1
  727. package/views/MapView.js +1 -1
  728. package/views/SceneView.js +1 -1
  729. package/views/ToolViewManager.js +1 -1
  730. package/views/View.js +1 -1
  731. package/views/draw/DrawAction.js +1 -1
  732. package/views/draw/DrawGraphicTool.js +1 -1
  733. package/views/draw/DrawOperation.js +1 -1
  734. package/views/draw/DrawTool.js +1 -1
  735. package/views/draw/support/Box.js +1 -1
  736. package/views/draw/support/GraphicMover.js +1 -1
  737. package/views/draw/support/Reshape.js +1 -1
  738. package/views/interactive/coordinateHelper.js +1 -1
  739. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  740. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  741. package/views/interactive/snapping/SnappingManager.js +1 -1
  742. package/views/interactive/snapping/featureSources/WorkerTileTreeDebugger.js +1 -1
  743. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  744. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  745. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  746. package/views/layers/FeatureLayerView.js +1 -1
  747. package/views/layers/GroupLayerView.js +1 -1
  748. package/views/layers/ImageryLayerView.js +1 -1
  749. package/views/layers/ImageryTileLayerView.js +1 -1
  750. package/views/layers/LayerView.js +1 -1
  751. package/views/layers/MapImageLayerView.js +1 -1
  752. package/views/layers/WMSLayerView.js +1 -1
  753. package/views/support/AllocationTracer.js +1 -1
  754. package/views/support/DefaultsFromMap.js +1 -1
  755. package/views/support/geometry2dUtils.js +1 -1
  756. package/views/support/layerViewUtils.js +1 -1
  757. package/views/support/waitForResources.js +1 -1
  758. package/views/ui/UI.js +1 -1
  759. package/views/webgl/BufferObject.js +1 -1
  760. package/views/webgl/FramebufferObject.js +1 -1
  761. package/views/webgl/RenderingContext.js +1 -1
  762. package/views/webgl/Texture.js +1 -1
  763. package/views/webgl/UniformBufferLayout.js +1 -1
  764. package/views/webgl/VertexArrayObject.js +1 -1
  765. package/views/webgl/capabilities.js +1 -1
  766. package/views/webgl/rasterUtils.js +1 -1
  767. package/views/webgl/testFloatBufferBlend.js +1 -1
  768. package/webdoc/widgets/TimeSlider.js +1 -1
  769. package/webmap/Bookmark.js +1 -1
  770. package/webscene/Slide.js +1 -1
  771. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  772. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  773. package/widgets/AreaMeasurement2D.js +1 -1
  774. package/widgets/AreaMeasurement3D.js +1 -1
  775. package/widgets/Attribution.js +1 -1
  776. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  777. package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
  778. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  779. package/widgets/BasemapLayerList.js +1 -1
  780. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  781. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  782. package/widgets/Bookmarks.js +1 -1
  783. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  784. package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
  785. package/widgets/BuildingExplorer/BuildingLevel.js +1 -1
  786. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  787. package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
  788. package/widgets/BuildingExplorer/BuildingPhase.js +1 -1
  789. package/widgets/BuildingExplorer/support/buildingLayerUtils.js +1 -1
  790. package/widgets/BuildingExplorer.js +1 -1
  791. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  792. package/widgets/CoordinateConversion/support/Format.js +1 -1
  793. package/widgets/Daylight/DaylightViewModel.js +1 -1
  794. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  795. package/widgets/Daylight.js +1 -1
  796. package/widgets/DirectLineMeasurement3D.js +1 -1
  797. package/widgets/Directions/DirectionsViewModel.js +1 -1
  798. package/widgets/Directions.js +1 -1
  799. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  800. package/widgets/DistanceMeasurement2D.js +1 -1
  801. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  802. package/widgets/Editor/CreateWorkflow.js +1 -1
  803. package/widgets/Editor/EditorViewModel.js +1 -1
  804. package/widgets/Editor/UpdateWorkflow.js +1 -1
  805. package/widgets/Editor/workflowUtils.js +1 -1
  806. package/widgets/Editor.js +1 -1
  807. package/widgets/ElevationProfile/ElevationProfileLineGround.js +1 -1
  808. package/widgets/ElevationProfile/ElevationProfileLineInput.js +1 -1
  809. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  810. package/widgets/ElevationProfile/ElevationProfileTool.js +1 -1
  811. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  812. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  813. package/widgets/ElevationProfile/support/elevationQuerySourceUtils.js +1 -1
  814. package/widgets/ElevationProfile/support/profileUtils.js +1 -1
  815. package/widgets/ElevationProfile.js +1 -1
  816. package/widgets/Expand.js +1 -1
  817. package/widgets/Feature/FeatureAttachments.js +1 -1
  818. package/widgets/Feature/FeatureContent.js +1 -1
  819. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  820. package/widgets/Feature/FeatureExpression.js +1 -1
  821. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  822. package/widgets/Feature/FeatureFields.js +1 -1
  823. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  824. package/widgets/Feature/FeatureMedia.js +1 -1
  825. package/widgets/Feature/FeatureViewModel.js +1 -1
  826. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  827. package/widgets/Feature/support/featureUtils.js +1 -1
  828. package/widgets/Feature/support/relatedFeatureUtils.js +1 -1
  829. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  830. package/widgets/FeatureForm/InputField.js +1 -1
  831. package/widgets/FeatureForm/support/formTemplateUtils.js +1 -1
  832. package/widgets/FeatureForm.js +1 -1
  833. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  834. package/widgets/FeatureTable/FieldColumn.js +1 -1
  835. package/widgets/FeatureTable/Grid/Column.js +1 -1
  836. package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
  837. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  838. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  839. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  840. package/widgets/FeatureTable/Grid/support/LocalStore.js +1 -1
  841. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  842. package/widgets/FeatureTable.js +1 -1
  843. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  844. package/widgets/FeatureTemplates/ItemList.js +1 -1
  845. package/widgets/FeatureTemplates/TemplateItem.js +1 -1
  846. package/widgets/FeatureTemplates.js +1 -1
  847. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  848. package/widgets/FloorFilter.js +1 -1
  849. package/widgets/Fullscreen.js +1 -1
  850. package/widgets/Home.js +1 -1
  851. package/widgets/LayerList/LayerListViewModel.js +1 -1
  852. package/widgets/LayerList/support/layerListUtils.js +1 -1
  853. package/widgets/LayerList.js +1 -1
  854. package/widgets/Legend/LegendViewModel.js +1 -1
  855. package/widgets/Legend/styles/Card.js +1 -1
  856. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  857. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  858. package/widgets/Legend/support/clusterUtils.js +1 -1
  859. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  860. package/widgets/Locate/LocateViewModel.js +1 -1
  861. package/widgets/Popup/PopupViewModel.js +1 -1
  862. package/widgets/Popup/actionUtils.js +1 -1
  863. package/widgets/Popup.js +1 -1
  864. package/widgets/Print/PrintViewModel.js +1 -1
  865. package/widgets/Print.js +1 -1
  866. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  867. package/widgets/Search/LayerSearchSource.js +1 -1
  868. package/widgets/Search/SearchResultRenderer.js +1 -1
  869. package/widgets/Search/SearchViewModel.js +1 -1
  870. package/widgets/Search/support/geometryUtils.js +1 -1
  871. package/widgets/Search/support/layerSearchUtils.js +1 -1
  872. package/widgets/Search/support/locatorUtils.js +1 -1
  873. package/widgets/Search.js +1 -1
  874. package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
  875. package/widgets/ShadowCast/components/Label.js +1 -1
  876. package/widgets/ShadowCast/components/TimezonePicker.js +1 -1
  877. package/widgets/ShadowCast.js +1 -1
  878. package/widgets/Sketch/SketchViewModel.js +1 -1
  879. package/widgets/Sketch.js +1 -1
  880. package/widgets/Slider.js +1 -1
  881. package/widgets/Swipe/SwipeViewModel.js +1 -1
  882. package/widgets/TableList/TableListViewModel.js +1 -1
  883. package/widgets/TableList/support/tableListUtils.js +1 -1
  884. package/widgets/TableList.js +1 -1
  885. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  886. package/widgets/TimeSlider/utils.js +1 -1
  887. package/widgets/TimeSlider.js +1 -1
  888. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  889. package/widgets/Weather.js +1 -1
  890. package/widgets/Widget.js +1 -1
  891. package/widgets/smartMapping/BinaryColorSizeSlider/BinaryColorSizeSliderViewModel.js +1 -1
  892. package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
  893. package/widgets/smartMapping/ClassedColorSlider.js +1 -1
  894. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  895. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  896. package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.js +1 -1
  897. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  898. package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
  899. package/widgets/support/AnalysisViewModel.js +1 -1
  900. package/widgets/support/ColorPicker.js +1 -1
  901. package/widgets/support/DatePicker.js +1 -1
  902. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  903. package/widgets/support/Popover.js +1 -1
  904. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  905. package/widgets/support/SelectionToolbar.js +1 -1
  906. package/widgets/support/Selector2D/SelectionOperation2D.js +1 -1
  907. package/widgets/support/Selector2D.js +1 -1
  908. package/widgets/support/SnappingControls/SnappingControlsViewModel.js +1 -1
  909. package/widgets/support/SnappingControls.js +1 -1
  910. package/widgets/support/jsxWidgetSupport.js +1 -1
  911. package/widgets/support/widgetUtils.js +1 -1
  912. package/assets/esri/core/workers/chunks/049c5c30bd37693dddb7.js +0 -1
  913. package/assets/esri/core/workers/chunks/055a0ebf22a82f859474.js +0 -1
  914. package/assets/esri/core/workers/chunks/0b12ff7b2ed2838afbb8.js +0 -1
  915. package/assets/esri/core/workers/chunks/0e25548573baf855e394.js +0 -1
  916. package/assets/esri/core/workers/chunks/0edd4c3ca6e7d749d0e5.js +0 -1
  917. package/assets/esri/core/workers/chunks/0fcbf7e2db58e38ee6d1.js +0 -1
  918. package/assets/esri/core/workers/chunks/133f971e72a1a6277ac4.js +0 -1
  919. package/assets/esri/core/workers/chunks/135a90ae61f3b3cae91b.js +0 -1
  920. package/assets/esri/core/workers/chunks/13fde7fd56c39fa3f2d5.js +0 -1
  921. package/assets/esri/core/workers/chunks/1c90855c3b0e5dcff908.js +0 -1
  922. package/assets/esri/core/workers/chunks/1dbef1919c7ac10a6bcc.js +0 -1
  923. package/assets/esri/core/workers/chunks/1facbda248863cf72cbd.js +0 -1
  924. package/assets/esri/core/workers/chunks/1fb2d7abe6c8efa84695.js +0 -1
  925. package/assets/esri/core/workers/chunks/2068377c2a796d5f2245.js +0 -1
  926. package/assets/esri/core/workers/chunks/28a5878cbe5880476855.js +0 -1
  927. package/assets/esri/core/workers/chunks/2cf3934b3ecabdf207c8.js +0 -1
  928. package/assets/esri/core/workers/chunks/2d42711a629384144625.js +0 -1
  929. package/assets/esri/core/workers/chunks/3021fda52083fc67d18c.js +0 -1
  930. package/assets/esri/core/workers/chunks/30333a95dc0a44e23fb5.js +0 -1
  931. package/assets/esri/core/workers/chunks/30837d93116f0337972f.js +0 -1
  932. package/assets/esri/core/workers/chunks/320543485c8e22485075.js +0 -1
  933. package/assets/esri/core/workers/chunks/3f0f7da92a6e4493686e.js +0 -1
  934. package/assets/esri/core/workers/chunks/42057f252ba4e82a8b45.js +0 -1
  935. package/assets/esri/core/workers/chunks/45a3f6033cdf4bc74a4c.js +0 -1
  936. package/assets/esri/core/workers/chunks/492b65fe99641f5740f0.js +0 -1
  937. package/assets/esri/core/workers/chunks/4d1cd7df617273c489f4.js +0 -1
  938. package/assets/esri/core/workers/chunks/4df9dfa80dbbae9b743d.js +0 -1
  939. package/assets/esri/core/workers/chunks/515c1c055666ff4740f3.js +0 -1
  940. package/assets/esri/core/workers/chunks/541e644fc77dbe527124.js +0 -1
  941. package/assets/esri/core/workers/chunks/59e341b2db44351bf557.js +0 -1
  942. package/assets/esri/core/workers/chunks/5a10b58533b4116115ac.js +0 -1
  943. package/assets/esri/core/workers/chunks/5f940853341d7e2bc852.js +0 -1
  944. package/assets/esri/core/workers/chunks/5ff2cdecf95e0136dd52.js +0 -1
  945. package/assets/esri/core/workers/chunks/6147bfbe2bd7292d6ad0.js +0 -1
  946. package/assets/esri/core/workers/chunks/6467f996fe9f136c370b.js +0 -1
  947. package/assets/esri/core/workers/chunks/682a8f15f352de76df69.js +0 -1
  948. package/assets/esri/core/workers/chunks/6a06635089761ee3e6d4.js +0 -972
  949. package/assets/esri/core/workers/chunks/725828a41917d3d56f2d.js +0 -1
  950. package/assets/esri/core/workers/chunks/794b47764ebb0257ed41.js +0 -1
  951. package/assets/esri/core/workers/chunks/7fd03a75eb07a09cda35.js +0 -1
  952. package/assets/esri/core/workers/chunks/86ad6b020c01850d9095.js +0 -1
  953. package/assets/esri/core/workers/chunks/86f9d1ce36661781d962.js +0 -1
  954. package/assets/esri/core/workers/chunks/8dcf6c836b53b40dfbf1.js +0 -1
  955. package/assets/esri/core/workers/chunks/8e98ff9404a802352037.js +0 -1
  956. package/assets/esri/core/workers/chunks/94e51fe1c539df6257c2.js +0 -1
  957. package/assets/esri/core/workers/chunks/9519a02b9b8db88a3150.js +0 -1
  958. package/assets/esri/core/workers/chunks/9a8b50ed75219b4a42e1.js +0 -1
  959. package/assets/esri/core/workers/chunks/9f3a094aa4b47e4eb046.js +0 -1
  960. package/assets/esri/core/workers/chunks/a0ebf25c9c9a7f839b93.js +0 -1
  961. package/assets/esri/core/workers/chunks/a25f0a195f9217665530.js +0 -1
  962. package/assets/esri/core/workers/chunks/a2be1e0b632cef87f6a4.js +0 -1
  963. package/assets/esri/core/workers/chunks/a4d8cf9829da9cfc5f36.js +0 -1
  964. package/assets/esri/core/workers/chunks/a562059dbdd1bf1fab66.js +0 -1
  965. package/assets/esri/core/workers/chunks/a59ee7d2b98c85f27dd2.js +0 -1
  966. package/assets/esri/core/workers/chunks/a5dbab94697757c87c49.js +0 -1
  967. package/assets/esri/core/workers/chunks/a5e65d5a7a536759d1cc.js +0 -1
  968. package/assets/esri/core/workers/chunks/a8ac0b6a3eba35e3a5b6.js +0 -1
  969. package/assets/esri/core/workers/chunks/acbd0f4d72d1f5d8e4e8.js +0 -1
  970. package/assets/esri/core/workers/chunks/acc97a210f36bff2d1b0.js +0 -1
  971. package/assets/esri/core/workers/chunks/ad68fe924456d6d7d4f0.js +0 -1
  972. package/assets/esri/core/workers/chunks/b06c949fc7d08e376a5f.js +0 -1
  973. package/assets/esri/core/workers/chunks/b26bd8fde2fc65bb67fb.js +0 -1
  974. package/assets/esri/core/workers/chunks/b4405e9fe6c0cf7250d3.js +0 -1
  975. package/assets/esri/core/workers/chunks/bc08fe3b03767bd694c5.js +0 -1
  976. package/assets/esri/core/workers/chunks/c11501e96ffd81bf39a0.js +0 -1
  977. package/assets/esri/core/workers/chunks/c44116378cc1bc627044.js +0 -1
  978. package/assets/esri/core/workers/chunks/c9b09099488d0e719dfb.js +0 -1
  979. package/assets/esri/core/workers/chunks/cbea4f1eb814115748db.js +0 -1
  980. package/assets/esri/core/workers/chunks/ce262a2accd982988ef1.js +0 -1
  981. package/assets/esri/core/workers/chunks/d15e6662d90718411d62.js +0 -1
  982. package/assets/esri/core/workers/chunks/d16aac3461af9cee0c29.js +0 -1
  983. package/assets/esri/core/workers/chunks/d60dd3e1028f714f2258.js +0 -1
  984. package/assets/esri/core/workers/chunks/d6c150c243ca1f6108f9.js +0 -1
  985. package/assets/esri/core/workers/chunks/d85748b57a71999caf3a.js +0 -1
  986. package/assets/esri/core/workers/chunks/d8c59b1d73650c060dfb.js +0 -1
  987. package/assets/esri/core/workers/chunks/dcb6e1b33402d7fa455b.js +0 -1
  988. package/assets/esri/core/workers/chunks/df653bca2b14dffc82d1.js +0 -1
  989. package/assets/esri/core/workers/chunks/e2a12142439d3037a3a7.js +0 -1
  990. package/assets/esri/core/workers/chunks/e3e1d87b8532bf84a18d.js +0 -1
  991. package/assets/esri/core/workers/chunks/e7744b7e0c16bba93151.js +0 -1
  992. package/assets/esri/core/workers/chunks/ea50effc5c39870dc871.js +0 -1
  993. package/assets/esri/core/workers/chunks/f1665a64564593f2a438.js +0 -1
  994. package/assets/esri/core/workers/chunks/f4c12f3a5e7f89106ae0.js +0 -1
  995. package/assets/esri/core/workers/chunks/fbefdc74b3aab716187f.js +0 -1
  996. package/assets/esri/core/workers/chunks/fc4fd9db056579e09bfe.js +0 -1
  997. package/assets/esri/core/workers/chunks/fd4907fa96f55128764d.js +0 -1
  998. package/views/3d/webgl-engine/core/shaderModules/BooleanUniform.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{a as s}from"../../../../chunks/vec2f64.js";import{MultipassGeometryUniforms as e}from"../core/shaderLibrary/shading/MultipassGeometryTest.glsl.js";import{MultipassTerrainUniforms as r}from"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{SSRUniforms as i}from"../core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js";import{RenderSlot as t}from"./RenderSlot.js";import{SceneLighting as a}from"../lighting/SceneLighting.js";class o{constructor(o,h,l){this.shadowMap=o,this.ssaoHelper=h,this.slicePlane=l,this.slot=t.OPAQUE_MATERIAL,this.hasOccludees=!1,this.enableFillLights=!0,this._inverseViewport=s(),this.lighting=new a,this.ssr=new i,this.multipassTerrain=new r,this.multipassGeometry=new e,this.overlays=[]}get camera(){return this._camera}set camera(s){this._camera=this.ssr.camera=s,this._inverseViewport[0]=1/s.fullViewport[2],this._inverseViewport[1]=1/s.fullViewport[3]}get inverseViewport(){return this._inverseViewport}}export{o as BindParameters};
5
+ import{a as s}from"../../../../chunks/vec2f64.js";import{CloudsCompositionParameters as e}from"../../environment/CloudsCompositionParameters.js";import{MultipassGeometryUniforms as i}from"../core/shaderLibrary/shading/MultipassGeometryTest.glsl.js";import{MultipassTerrainUniforms as r}from"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{SSRUniforms as t}from"../core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js";import{RenderSlot as o}from"./RenderSlot.js";import{SceneLighting as a}from"../lighting/SceneLighting.js";class n{constructor(n,h,l){this.shadowMap=n,this.ssaoHelper=h,this.slicePlane=l,this.slot=o.OPAQUE_MATERIAL,this.hasOccludees=!1,this.enableFillLights=!0,this._inverseViewport=s(),this.lighting=new a,this.ssr=new t,this.multipassTerrain=new r,this.multipassGeometry=new i,this.cloudsComposition=new e,this.overlays=[]}get camera(){return this._camera}set camera(s){this._camera=this.ssr.camera=s,this._inverseViewport[0]=1/s.fullViewport[2],this._inverseViewport[1]=1/s.fullViewport[3]}get inverseViewport(){return this._inverseViewport}}export{n as BindParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{releaseMaybe as t,isSome as e,isNone as s}from"../../../../core/maybe.js";import{isPromiseLike as i}from"../../../../core/promiseUtils.js";import{NoParameters as r}from"../core/shaderModules/interfaces.js";import{ResourceState as u}from"./basicInterfaces.js";import l from"./GLMaterial.js";class h extends l{constructor(t){super(t),this._numLoading=0,this._disposed=!1,this._textureRepository=t.textureRep,this._textureId=t.textureId,this._acquire(t.textureId,(t=>this._texture=t)),this._acquire(t.normalTextureId,(t=>this._textureNormal=t)),this._acquire(t.emissiveTextureId,(t=>this._textureEmissive=t)),this._acquire(t.occlusionTextureId,(t=>this._textureOcclusion=t)),this._acquire(t.metallicRoughnessTextureId,(t=>this._textureMetallicRoughness=t))}dispose(){this._texture=t(this._texture),this._textureNormal=t(this._textureNormal),this._textureEmissive=t(this._textureEmissive),this._textureOcclusion=t(this._textureOcclusion),this._textureMetallicRoughness=t(this._textureMetallicRoughness),this._disposed=!0}ensureResources(t){return 0===this._numLoading?u.LOADED:u.LOADING}get passParameters(){return new o(e(this._texture)?this._texture.glTexture:null,e(this._textureNormal)?this._textureNormal.glTexture:null,e(this._textureEmissive)?this._textureEmissive.glTexture:null,e(this._textureOcclusion)?this._textureOcclusion.glTexture:null,e(this._textureMetallicRoughness)?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){(s(this._texture)||e!==this._texture.id)&&(this._texture=t(this._texture),this._textureId=e,this._acquire(this._textureId,(t=>this._texture=t)))}_acquire(e,r){if(s(e))return void r(null);const u=this._textureRepository.acquire(e);if(i(u))return++this._numLoading,void u.then((e=>{if(this._disposed)return t(e),void r(null);r(e)})).finally((()=>--this._numLoading));r(u)}}class o extends r{constructor(t=null,e=null,s=null,i=null,r=null){super(),this.texture=t,this.textureNormal=e,this.textureEmissive=s,this.textureOcclusion=i,this.textureMetallicRoughness=r}}export{h as GLTextureMaterial,o as GLTextureMaterialBindParameters};
5
+ import{releaseMaybe as t,isSome as e,isNone as s}from"../../../../core/maybe.js";import{isPromiseLike as i}from"../../../../core/promiseUtils.js";import{NoParameters as r}from"../core/shaderModules/interfaces.js";import{ResourceState as u}from"./basicInterfaces.js";import l from"./GLMaterial.js";class h extends l{constructor(t){super(t),this._numLoading=0,this._disposed=!1,this._textureRepository=t.textureRep,this._textureId=t.textureId,this._acquire(t.textureId,(t=>this._texture=t)),this._acquire(t.normalTextureId,(t=>this._textureNormal=t)),this._acquire(t.emissiveTextureId,(t=>this._textureEmissive=t)),this._acquire(t.occlusionTextureId,(t=>this._textureOcclusion=t)),this._acquire(t.metallicRoughnessTextureId,(t=>this._textureMetallicRoughness=t))}dispose(){this._texture=t(this._texture),this._textureNormal=t(this._textureNormal),this._textureEmissive=t(this._textureEmissive),this._textureOcclusion=t(this._textureOcclusion),this._textureMetallicRoughness=t(this._textureMetallicRoughness),this._disposed=!0}ensureResources(t){return 0===this._numLoading?u.LOADED:u.LOADING}get textureBindParameters(){return new o(e(this._texture)?this._texture.glTexture:null,e(this._textureNormal)?this._textureNormal.glTexture:null,e(this._textureEmissive)?this._textureEmissive.glTexture:null,e(this._textureOcclusion)?this._textureOcclusion.glTexture:null,e(this._textureMetallicRoughness)?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){(s(this._texture)||e!==this._texture.id)&&(this._texture=t(this._texture),this._textureId=e,this._acquire(this._textureId,(t=>this._texture=t)))}_acquire(e,r){if(s(e))return void r(null);const u=this._textureRepository.acquire(e);if(i(u))return++this._numLoading,void u.then((e=>{if(this._disposed)return t(e),void r(null);r(e)})).finally((()=>--this._numLoading));r(u)}}class o extends r{constructor(t=null,e=null,s=null,i=null,r=null){super(),this.texture=t,this.textureNormal=e,this.textureEmissive=s,this.textureOcclusion=i,this.textureMetallicRoughness=r}}export{h as GLTextureMaterial,o as GLTextureMaterialBindParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/PooledArray.js";import{isPromiseLike as t,createAbortError as r}from"../../../../core/promiseUtils.js";import{union as n}from"./depthRange.js";import{RenderSlot as s}from"./RenderSlot.js";class i{constructor(t){this.context=t,this._renderPlugins=new e,this.slots=[];for(let e=0;e<s.MAX_SLOTS;++e)this.slots[e]=[]}add(e,n,s){const i=()=>{if(null!=s&&s.aborted)throw n.uninitializeRenderContext(),r();this._renderPlugins.push(n);for(const t of e)this.slots[t].push(n);this.context.requestRender()},o=n.initializeRenderContext(this.context,s);if(t(o))return o.then(i);i()}remove(e){if(null!=this._renderPlugins.removeUnordered(e)){for(let t=0;t<this.slots.length;++t)this.slots[t]=this.slots[t].filter((t=>t!==e));e.uninitializeRenderContext(),this.context.requestRender()}}prepareRender(){this._renderPlugins.forAll((e=>{e.prepareRender&&e.prepareRender(this.context.renderContext)}))}updateAnimation(e){let t=!1;return this._renderPlugins.forAll((r=>{r.updateAnimation&&(t=r.updateAnimation(e)||t)})),t}render(){const e=this.slots[this.context.renderContext.bindParameters.slot],t=new Array;e.filter((e=>{if(!e.canRender)return!1;if(o(e)){const r=e.prepareTechnique(this.context.renderContext);return!!r&&(t.push(r),!0)}return t.push(null),!0})).forEach(((e,r)=>e.render(this.context.renderContext,t[r])))}queryDepthRange(e){const t=l;return t.near=1/0,t.far=-1/0,this._renderPlugins.forAll((r=>{if(r.queryDepthRange){const s=r.queryDepthRange(e);s&&n(t,s,t)}})),t}get needsTransparentPass(){return this._renderPlugins.some((e=>e.needsTransparentPass))}get needsHighlight(){return this._renderPlugins.some((e=>e.needsHighlight))}get needsLinearDepth(){return this._renderPlugins.some((e=>e.needsLinearDepth))}get needsLaserlineWithContrastControl(){const e=this.slots[s.LASERLINES_CONTRAST_CONTROL];return!!e&&e.length>0}get renderOccludedFlags(){return this._renderPlugins.reduce(((e,t)=>e|t.renderOccludedFlags),0)}}function o(e){return"prepareTechnique"in e}const l={near:0,far:0};export{i as RenderPluginManager};
5
+ import e from"../../../../core/PooledArray.js";import{isPromiseLike as t,createAbortError as r}from"../../../../core/promiseUtils.js";import{union as n}from"./depthRange.js";import{RenderSlot as s}from"./RenderSlot.js";class i{constructor(t){this.context=t,this._renderPlugins=new e,this.slots=[];for(let e=0;e<s.MAX_SLOTS;++e)this.slots[e]=[]}add(e,n,s){const i=()=>{if(s?.aborted)throw n.uninitializeRenderContext(),r();this._renderPlugins.push(n);for(const t of e)this.slots[t].push(n);this.context.requestRender()},o=n.initializeRenderContext(this.context,s);if(t(o))return o.then(i);i()}remove(e){if(null!=this._renderPlugins.removeUnordered(e)){for(let t=0;t<this.slots.length;++t)this.slots[t]=this.slots[t].filter((t=>t!==e));e.uninitializeRenderContext(),this.context.requestRender()}}prepareRender(){this._renderPlugins.forAll((e=>{e.prepareRender&&e.prepareRender(this.context.renderContext)}))}updateAnimation(e){let t=!1;return this._renderPlugins.forAll((r=>{r.updateAnimation&&(t=r.updateAnimation(e)||t)})),t}render(){const e=this.slots[this.context.renderContext.bindParameters.slot],t=new Array;e.filter((e=>{if(!e.canRender)return!1;if(o(e)){const r=e.prepareTechnique(this.context.renderContext);return!!r&&(t.push(r),!0)}return t.push(null),!0})).forEach(((e,r)=>e.render(this.context.renderContext,t[r])))}queryDepthRange(e){const t=d;return t.near=1/0,t.far=-1/0,this._renderPlugins.forAll((r=>{if(r.queryDepthRange){const s=r.queryDepthRange(e);s&&n(t,s,t)}})),t}get needsTransparentPass(){return this._renderPlugins.some((e=>e.needsTransparentPass))}get needsHighlight(){return this._renderPlugins.some((e=>e.needsHighlight))}get needsLinearDepth(){return this._renderPlugins.some((e=>e.needsLinearDepth))}get needsLaserlineWithContrastControl(){const e=this.slots[s.LASERLINES_CONTRAST_CONTROL];return!!e&&e.length>0}get renderOccludedFlags(){return this._renderPlugins.reduce(((e,t)=>e|t.renderOccludedFlags),0)}}function o(e){return"prepareTechnique"in e}const d={near:0,far:0};export{i as RenderPluginManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{update as t}from"../../../../core/arrayUtils.js";import s from"../../../../core/Handles.js";import{someMap as i}from"../../../../core/MapUtils.js";import{destroyMaybe as n,disposeMaybe as a,isSome as h,isNone as d,applySome as o,unwrap as l}from"../../../../core/maybe.js";import{watch as _,syncAndInitial as c,initial as p,sync as m}from"../../../../core/reactiveUtils.js";import{Milliseconds as g}from"../../../../core/time.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{v as T,a as R,m as A}from"../../../../chunks/mat4.js";import{I as E,c as P}from"../../../../chunks/mat4f64.js";import{c as b}from"../../../../chunks/boundedPlane.js";import{MAXIMUM_ANIMATION_LOAD as S,MINIMUM_IDLE_ANIMATION_MS as H}from"../../support/animationUtils.js";import w from"../../support/debugFlags.js";import{RenderPassManager as M}from"../core/renderPasses/RenderPassManager.js";import{HUDTransparentRenderStyle as I}from"../core/shaderLibrary/hud/HUDUniforms.js";import{AntiAliasingMode as x,TransparencyPassType as C,Decorations as L,RenderRequestType as O,StencilBits as D}from"./basicInterfaces.js";import{BoundingInfo as y}from"./BoundingInfo.js";import{ZERO as N,union as v}from"./depthRange.js";import{depthRangeFromScene as U}from"./depthRangeUtils.js";import{createEmptyDepthTexture as F}from"./glUtil3D.js";import{Highlight as j}from"./Highlight.js";import{RenderOccludedFlag as q}from"./Material.js";import{OffscreenRendering as G}from"./OffscreenRendering.js";import{RenderContext as V}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as B}from"./rendererUtils.js";import{RenderPass as W}from"./RenderPass.js";import{RenderPluginManager as k}from"./RenderPluginManager.js";import{RenderSlot as Q}from"./RenderSlot.js";import{ShadowAccumulator as z}from"./ShadowAccumulator.js";import{ShadowHighlight as X}from"./ShadowHighlight.js";import{ShadowMap as Y,SnapshotSlot as K}from"./ShadowMap.js";import J from"./SliceHelper.js";import{SmaaRenderPass as Z}from"./SmaaRenderPass.js";import{SSAOHelper as $}from"./SSAOHelper.js";import{EdgeView as ee}from"./edgeRendering/EdgeView.js";import{Transparency as re}from"./edgeRendering/interfaces.js";import{MergedRenderer as te}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as se}from"../shaders/CompositingTechniqueConfiguration.js";import{RendererPerformanceInfo as ie,Statistics as ne}from"../statistics/RendererPerformanceInfo.js";import{ClearBufferBit as ae,PixelFormat as he,PixelType as de}from"../../../webgl/enums.js";const oe=.9;let le=class extends r{constructor(e,r,t,i,n,a,h,d,o){super({}),this._materialRepository=e,this._shaderTechniqueRepository=t,this._rctx=i,this._compositingHelper=n,this._magnifierHelper=a,this._requestRender=h,this._stage=o,this._materialRenderers=new Map,this._needsTransparentPass=!1,this._hasHUDElements=!1,this._hasHighlights=!1,this._hasWater=!1,this._hasOverlayWater=!1,this._content=new Map,this._isRendering=!1,this._fallbackDepthStencilTexture=null,this.performanceInfo=new ie,this._antialiasing=x.SMAA,this._oitEnabled=!1,this._multipassTerrain=!0,this._transparentTerrain=!1,this._hasAnimations=!1,this._animationTimestep=g(0),this._handles=new s,this._renderHiddenTransparentEdges=()=>{},this._oitUsed=!1,this._smaaPass=new Z(this._rctx,t),this._oitEnabled=this._hasOITSupport,this._requestRender(),this._offscreenRendering=new G(this._rctx,this._compositingHelper),this._sliceHelper=new J,this._shadowMap=new Y(this._rctx,o.viewingMode,2),this._ssaoHelper=new $(t,this._rctx,(()=>this._requestRender())),this._highlight=new j(t,this._rctx),this._shadowHighlight=new X(this._rctx,o.viewingMode),this._shadowAccumulator=new z(this._rctx,t,o,(e=>{const r=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureCameraBindParameters(e.camera,e.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=r}),((e,r,t)=>{e.shadowMap.start(e.camera,r,t),this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_ALL,e.shadowMap),e.camera.setGLViewport(this._rctx),this._ensureCameraBindParameters(e.camera,e.contentCamera)}),(()=>this._requestRender())),this._renderContext=new V(this._rctx,this._offscreenRendering,this._shadowMap,this._ssaoHelper,this._sliceHelper),this._renderPlugins=new k({renderContext:this._renderContext,shaderTechniqueRepository:t,textureRep:r,materialRep:this._materialRepository,requestRender:this._requestRender,schedule:d}),this.renderPassManager=new M(this._rctx,this._shaderTechniqueRepository),this._renderPlugins.add(this.renderPassManager.slots(),this.renderPassManager),this._handles.add([_((()=>this._stage.state.camera),(()=>this._requestRender()),c),_((()=>w.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(re.TRANSPARENT):()=>{},this._requestRender()}),p)])}get _bindParameters(){return this._renderContext.bindParameters}get hasWater(){return this._hasWater||this._hasOverlayWater}get hasWaterReflection(){return this.hasWater&&this._waterReflectionEnabled}normalizeCtorArgs(){return{}}dispose(){this._handles.destroy(),this._smaaPass.dispose(),this._materialRenderers.forEach((e=>e.dispose())),this._materialRenderers.clear(),this._edgeView=n(this._edgeView),this._offscreenRendering.dispose(),this._fallbackDepthStencilTexture=a(this._fallbackDepthStencilTexture),this._shadowMap.enabled=!1,this._shadowMap.dispose(),this._ssaoHelper.enabled=!1,this._ssaoHelper.dispose(),this._highlight.dispose(),this._shadowHighlight.dispose(),this._shadowAccumulator.dispose(),y.prune(),this._content.clear()}disposeOffscreenBuffers(){this._offscreenRendering.dispose(),this._shadowMap.dispose(),this._smaaPass.disable(),this._ssaoHelper.disposeOffscreenBuffers()}get updating(){return this._antialiasing===x.SMAA&&this._smaaPass.updating||h(this._edgeView)&&this._edgeView.updating||this._shadowAccumulator.running||!this.isCameraFinal}ensureEdgeView(){return d(this._edgeView)&&(this._edgeView=new ee({rctx:this._rctx,renderSR:this._stage.renderSR,techniqueRepository:this._shaderTechniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:e=>this._stage.resourceController.schedule(e)}),this._handles.add(_((()=>o(this._edgeView,(e=>e.updating))),(()=>this._requestRender()),m)),this._requestRender()),this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return T(this._bindParameters.ssr.reprojectionMatrix,E)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){var e;return!(null==(e=this._shadowMap)||!e.enabled)}setRenderParameters(e){const{_shadowMap:r,_ssaoHelper:t,_bindParameters:s}=this;void 0!==e.screenSpaceReflectionsEnabled&&s.ssr.enabled!==e.screenSpaceReflectionsEnabled&&(s.ssr.enabled=e.screenSpaceReflectionsEnabled,this._requestRender()),void 0!==e.enableFillLights&&s.enableFillLights!==e.enableFillLights&&(s.enableFillLights=e.enableFillLights,this._requestRender()),void 0!==e.shadowMap&&r.enabled!==e.shadowMap&&(r.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&r.maxCascades!==e.shadowMapMaxCascades&&(r.maxCascades=e.shadowMapMaxCascades,this._requestRender()),void 0!==e.ssao&&t.enabled!==e.ssao&&(t.enabled=e.ssao,this._requestRender()),e.background&&this._offscreenRendering.background!==e.background&&(this._offscreenRendering.background=e.background,this._requestRender());const i=e.antialiasingEnabled?x.SMAA:x.NONE;void 0!==e.antialiasingEnabled&&this._antialiasing!==i&&(this._antialiasing=i,this._requestRender()),void 0!==e.highQualityTransparency&&this._multipassTerrain!==e.highQualityTransparency&&(this._multipassTerrain=e.highQualityTransparency,this._oitEnabled=e.highQualityTransparency&&this._hasOITSupport,this._requestRender()),void 0!==e.defaultHighlightOptions&&(this._highlight.setDefaultOptions(e.defaultHighlightOptions),this._shadowHighlight.setDefaultOptions(e.defaultHighlightOptions),this._requestRender()),void 0!==e.overlays&&this._bindParameters.overlays!==e.overlays&&(this._bindParameters.overlays=e.overlays,this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=l(e.slicePlane),this._requestRender()),void 0!==e.waterReflectionEnabled&&this._waterReflectionEnabled!==e.waterReflectionEnabled&&(this._waterReflectionEnabled=e.waterReflectionEnabled,this._requestRender()),void 0!==e.enableFillLights&&s.enableFillLights!==e.enableFillLights&&(s.enableFillLights=e.enableFillLights,this._requestRender()),void 0!==e.transparentTerrain&&this._transparentTerrain!==e.transparentTerrain&&(this._transparentTerrain=e.transparentTerrain,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlendWorking}modify(e){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:t,updates:s}=e;if(0===r.length&&0===t.length&&0===s.length)return;t.forAll((({id:e})=>this._content.delete(e))),r.forAll((e=>this._content.set(e.id,e)));const n=B(e);let a=!1;n.forEach(((e,r)=>{let t=this._materialRenderers.get(r);if(!t){if(!(e.adds.length>0))return;t=new te(this._rctx,this._materialRepository,r),this._materialRenderers.set(r,t)}t.modify(e),t.isEmpty&&(a=!0)})),a&&this._materialRenderers.forEach(((e,r)=>{e.isEmpty&&(this._materialRenderers.delete(r),e.dispose())})),this._hasHighlights=i(this._materialRenderers,(e=>e.hasHighlights)),this._bindParameters.hasOccludees=i(this._materialRenderers,(e=>e.hasOccludees)),this._hasWater=i(this._materialRenderers,(e=>e.hasWater)),this._needsTransparentPass=i(this._materialRenderers,(e=>e.requiresSlot(Q.TRANSPARENT_MATERIAL,W.MATERIAL))),this._hasHUDElements=i(this._materialRenderers,(e=>e.requiresSlot(Q.LINE_CALLOUTS_HUD_DEPTH,W.MATERIAL)||e.requiresSlot(Q.HUD_MATERIAL,W.MATERIAL)||e.requiresSlot(Q.LABEL_MATERIAL,W.MATERIAL))),this._requestRender()}updateAnimation(e){return this._hasAnimations=!1,this._materialRenderers.forEach((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations=this._renderPlugins.updateAnimation(e)||this._hasAnimations,this._hasAnimations}get animationTimestep(){return this._animationTimestep}updateLightSources(e,r,t){this._bindParameters.lighting.groundLightingFactor=r,this._bindParameters.lighting.globalFactor=t,this._bindParameters.lighting.set(e)}render(e,r,t,s){this._isRendering=!0,this.performanceInfo.prerender(this._rctx),this._bindParameters.transparencyPassType=C.NONE;const i=this._offscreenRendering;i.needLastFrameColorTexture=this.hasWaterReflection,i.advanceCurrentRenderTarget();const n=b(this._sliceHelper.plane);s===L.OFF&&(this._sliceHelper.plane=null),this._rctx.bindFramebuffer(e),r.setGLViewport(this._rctx),this._ensureCameraBindParameters(r,t),this._renderPlugins.prepareRender(),this.performanceInfo.advance(ne.Prepare);const a=this._computeDepthRange(r);this._renderShadowMap(e,r,this._bindParameters.lighting.lightingMainDirection,a),this.performanceInfo.advance(ne.Shadowmap),i.initializeFrame(r),this._ensureBindParameters(r,t),this._renderLinearDepth(),this.performanceInfo.advance(ne.Lineardepth),this._accumulateShadows(a,r,t),this._renderNormal(),this.performanceInfo.advance(ne.Normals),this._ensureBindParametersSSR(),this._ssaoHelper.computeSSAO(this._bindParameters,i.linearDepthTexture,i.normalTexture),this.performanceInfo.advance(ne.SSAO),this._renderContext.pass=W.MATERIAL,i.bindFramebuffer(),this._renderOpaqueGeometry(),this.performanceInfo.advance(ne.Opaque);const o=this._multipassTerrain&&this._transparentTerrain;this._renderTerrainLinearDepth(o),this._setMultipassEnabled(o),this._setTerrainCulling(o),this._renderEdges(re.OPAQUE),this.performanceInfo.advance(ne.OpaqueEdges),this._renderHiddenTransparentEdges();const l=this._needsTransparentPass||this._renderPlugins.needsTransparentPass;l&&(this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry()),this.performanceInfo.advance(ne.Transparent),this._renderGeometryLinearDepth(o);const _=this._renderHUDVisibility();o||this._renderInternalSlot(Q.LINE_CALLOUTS),this.performanceInfo.advance(ne.Hudvisibility),this._renderEdges(re.TRANSPARENT,o),this.performanceInfo.advance(ne.TransparentEdges),this._renderSlot(Q.VOXEL),this._renderTransparentTerrain(),this._transparentTerrain&&_&&(o?this._renderLineCallouts(I.Occluded):i.compositeTransparentTerrainOntoHUDVisibility(this._bindParameters),this._renderHUD(I.Occluded,i.framebuffer),this.performanceInfo.advance(ne.HudOccluded)),this.performanceInfo.advance(ne.TransparentTerrain),this._setTerrainCulling(!1),this._transparentTerrain&&(i.compositeTransparentTerrainOntoMain(this._bindParameters),o&&(this._renderEdges(re.OPAQUE),this.performanceInfo.advance(ne.OpaqueEdges),l&&(this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry()),this.performanceInfo.advance(ne.Transparent),this._renderEdges(re.TRANSPARENT),this.performanceInfo.advance(ne.TransparentEdges))),o&&this._renderLineCallouts(I.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),i.renderToTargets((()=>{this._renderInternalSlot(Q.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderSlot(Q.POSTPROCESSING_ENVIRONMENT_TRANSPARENT),this._renderSlot(Q.LASERLINES)}),i.currentColorTarget,i.mainDepth),this.performanceInfo.advance(ne.Atmosphere),this._renderPlugins.needsLaserlineWithContrastControl&&i.renderTmpAndCompositeToMain((()=>this._renderSlot(Q.LASERLINES_CONTRAST_CONTROL)),this._bindParameters,se.PremultipliedAlpha),this.performanceInfo.advance(ne.Laserline),this._renderOccluded(),this.performanceInfo.advance(ne.Occluded);const c=s===L.ON&&this._magnifierHelper.enabled,p=c&&d(e)?this._offscreenRendering.getFramebuffer(this._offscreenRendering.tmpColor,this._offscreenRendering.tmpDepth):e;this._rctx.bindFramebuffer(p);const m=this._offscreenRendering.colorTexture;!this._renderAntiAliasing(this._antialiasing,m)&&h(m)&&this._compositingHelper.composite(this._bindParameters,m,se.None),this.performanceInfo.advance(ne.Antialiasing),this._renderHUD(I.NotOccluded,p),this.performanceInfo.advance(ne.HudNotoccluded),this._renderHighlights(p,this._bindParameters),this.performanceInfo.advance(ne.Highlights),c&&this._magnifierHelper.render(this._rctx,this._bindParameters),p!==e&&(this._rctx.bindFramebuffer(e),this._compositingHelper.composite(this._bindParameters,this._offscreenRendering.tmpColorTexture,se.None)),this._disposeOITBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=n,this._isRendering=!1,this.onPostRender&&this.onPostRender(),this.performanceInfo.postrender()}finish(e){if(this._hasAnimations||(this._animationTimestep=g(0)),e===O.BACKGROUND){this._rctx.gl.getError();const e=this.performanceInfo.elapsedTime/S;this._animationTimestep=g(Math.max(this._animationTimestep*oe+e*(1-oe),H))}}readDepthPixels(e,r,t){const s=this._offscreenRendering.bindTarget(this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth);if(!this._needsLinearDepth){this._ensureBindParameters(e,e),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const r=ae.COLOR_BUFFER_BIT|ae.DEPTH_BUFFER_BIT|ae.STENCIL_BUFFER_BIT;this._rctx.clearSafe(r),this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_DEPTH)}s.readPixels(r[0],r[1],r[2],r[3],he.RGBA,de.UNSIGNED_BYTE,t)}readHUDVisibility(e,r,t,s,i){this._offscreenRendering.bindTarget(this._offscreenRendering.hudVisibility).readPixels(e,r,t,s,he.RGBA,de.UNSIGNED_BYTE,i)}readAccumulatedShadow(e,r){return this._shadowAccumulator.readAccumulatedShadow(e,r)}_setMultipassEnabled(e){this._bindParameters.multipassTerrain.enabled=this._bindParameters.multipassGeometry.enabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_renderSlot(e){this._bindParameters.slot=e,this._renderPlugins.render()}_renderEdges(e,r=!1){const t=this._edgeView;h(t)&&t.shouldRender()&&this._offscreenRendering.renderTmpAndCompositeToMain((()=>t.render(this._bindParameters,e)),this._bindParameters,se.Alpha,r)}_renderShadowMap(e,r,t,s){const i=this._shadowMap;i.enabled&&(i.start(r,t,s),this._shadowHighlight.updateParameters(r,t),this.needsShadowHighlight?(this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT,this._shadowMap,(e=>i.takeCascadeSnapshotTo(e,K.Highlight))),i.clear(),this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_DEFAULT,this._shadowMap,(e=>{i.takeCascadeSnapshotTo(e,K.Default),this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT)}))):this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_ALL),i.finish(e),r.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap,t=(e=>{})){for(const s of r.getCascades())s.camera.setGLViewport(this._rctx),this._ensureCameraBindParameters(s.camera,s.camera),this._renderGeometryAndTransparentTerrainPass(e),t(s)}get _needsLinearDepth(){return this._ssaoHelper.enabled||this._renderPlugins.needsLinearDepth||this._hasWater&&this._waterReflectionEnabled||this.needsShadowHighlight||this.needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?this._offscreenRendering.renderToTargets((()=>this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_DEPTH)),this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.linearDepth),this._bindParameters.linearDepthTexture=this._offscreenRendering.linearDepthTexture}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.pass;this._renderContext.pass=W.MATERIAL_DEPTH,this._offscreenRendering.renderToTargets((()=>this._renderTransparentTerrain()),this._offscreenRendering.terrainLinearDepth,this._offscreenRendering.tmpDepth,[-1e10,-1e10,-1e10,1],!0,!0),this._renderContext.pass=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.terrainLinearDepth);this._bindParameters.multipassTerrain.linearDepthTexture=this._offscreenRendering.terrainLinearDepthTexture}_renderGeometryLinearDepth(e){if(e){const e=this._renderContext.pass;this._offscreenRendering.renderToTargets((()=>this._renderGeometryPass(W.MATERIAL_DEPTH)),this._offscreenRendering.geometryLinearDepth,this._offscreenRendering.tmpDepth,[1,1,1,1],!0,!0),this._renderContext.pass=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.geometryLinearDepth);this._bindParameters.multipassGeometry.linearDepthTexture=this._offscreenRendering.geometryLinearDepthTexture}get needsNormal(){return this._ssaoHelper.enabled}_renderNormal(){this.needsNormal?this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_NORMAL)}),this._offscreenRendering.normal,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.normal)}get needsDepthRange(){return this._shadowMap.enabled||this.needsShadowCast}_computeDepthRange(e){if(!this.needsDepthRange)return N;const r=U(e,this._content,this._stage.layers);return v(r,this.renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderGeometryAndTransparentTerrainPass(e){this._renderContext.pass=e,this._renderGeometryPass(e),this._renderTransparentTerrain()}_renderGeometryPass(e){this._renderContext.pass=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderOpaqueGeometry(){this._renderSlot(Q.INTEGRATED_MESH),this._renderSlot(Q.OPAQUE_TERRAIN),this._renderInternalSlot(Q.OPAQUE_MATERIAL),this._renderSlot(Q.OPAQUE_MATERIAL),this._renderSlot(Q.POSTPROCESSING_ENVIRONMENT_OPAQUE)}_renderTransparentGeometry(){this._renderInternalSlot(Q.TRANSPARENT_MATERIAL),this._renderSlot(Q.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){this._renderSlot(Q.TRANSPARENT_TERRAIN)}_renderHUDVisibility(){let e=!1;return this._renderContext.offscreenRenderingHelper&&this._renderContext.offscreenRenderingHelper.renderHUDVisibility((()=>{this._bindParameters.hudVisibilityTexture=this._renderContext.offscreenRenderingHelper.hudVisibilityTexture,e=this._renderInternalSlot(Q.OCCLUSION_PIXELS)}),this._multipassTerrain&&this._transparentTerrain),e}_renderLineCallouts(e){this._bindParameters.renderTransparentlyOccludedHUD=e,e===I.Occluded?this._offscreenRendering.renderToTargets((()=>this._renderInternalSlot(Q.LINE_CALLOUTS)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderInternalSlot(Q.LINE_CALLOUTS)}_renderHUD(e,r){this._hasHUDElements&&(this._oitEnabled?(this._renderOrderIndependentTransparency((()=>this._renderHUDElements(e)),!0),this._rctx.bindFramebuffer(r),this._compositingHelper.composite(this._bindParameters,this._offscreenRendering.hudColorTexture,se.PremultipliedAlpha)):e===I.Occluded?this._offscreenRendering.renderToTargets((()=>this._renderHUDElements(I.Occluded)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderHUDElements(e))}_renderHUDElements(e){this._bindParameters.renderTransparentlyOccludedHUD=e,this._renderInternalSlot(Q.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(Q.HUD_MATERIAL),this._renderInternalSlot(Q.LABEL_MATERIAL)}get needsHighlight(){return this._hasHighlights||this._renderPlugins.needsHighlight}get needsShadowHighlight(){return this._shadowMap.enabled&&this._shadowHighlight.isVisible&&this.needsHighlight}_renderHighlights(e,r){if(!this.needsHighlight)return void this._offscreenRendering.disposeTarget(this._offscreenRendering.highlight);const t=this._highlight,s=this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_HIGHLIGHT),this._rctx.clearSafe(ae.DEPTH_BUFFER_BIT),this._renderHUDElements(I.Both)}),this._offscreenRendering.highlight,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0);this._bindParameters.highlightColorTexture=s.colorTexture,this.needsShadowHighlight&&this._shadowHighlight.render(r,e),t.render(this._bindParameters,s,e)}get needsShadowCast(){return this._shadowAccumulator.isAccumulating}_accumulateShadows(e,r,t){this.needsShadowCast&&this._shadowAccumulator.renderAccumulation(this._offscreenRendering.linearDepthTexture,e,r,t)}_renderOrderIndependentTransparency(e,r){const t=t=>{this._bindParameters.transparencyPassType=t,this._offscreenRendering.renderOITPass((()=>e()),t,r)},s=this._renderContext.pass;this._renderContext.pass=W.MATERIAL_ALPHA,t(C.Alpha),this._renderContext.pass=W.MATERIAL,t(C.Color),t(C.FrontFace),this._offscreenRendering.compositeTransparentOntoOpaque(this._bindParameters,r),this._bindParameters.transparencyPassType=C.NONE,this._renderContext.pass=s,this._oitUsed=!0}_disposeOITBuffers(){this._oitUsed||(this._offscreenRendering.disposeTarget(this._offscreenRendering.alphaFloatTarget),this._offscreenRendering.disposeTarget(this._offscreenRendering.colorFloatTarget),this._offscreenRendering.disposeTarget(this._offscreenRendering.frontFaceTarget)),this._oitUsed=!1}_renderOccluded(){let e=0;this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&t.renderOccluded===q.OccludeAndTransparentStencil&&(e|=t.renderOccluded,pe.push(t))}));const r=this._offscreenRendering,t=(t,s,i,n,a)=>{0!=(e&s)&&(r.renderToTargets(i,r.tmpColor,r.mainDepth,[0,0,0,0],n,a),r.compositeOccludedOntoMain(this._bindParameters,t))};0!==pe.length&&(this._renderInternalSlot(Q.OCCLUDER_MATERIAL,pe),t(.5,q.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(Q.TRANSPARENT_OCCLUDER_MATERIAL,pe)),!1,!1),pe.length=0),this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&(t.renderOccluded===q.OccludeAndTransparent||t.renderOccluded===q.Transparent||t.renderOccluded===q.Opaque)&&(e|=t.renderOccluded,ce.push(t))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const i=e=>{this._renderContext.renderOccludedMask=e,s>q.Occlude&&this._renderSlot(Q.OCCLUDED_TERRAIN),this._renderInternalSlot(Q.OPAQUE_MATERIAL,ce),this._renderInternalSlot(Q.TRANSPARENT_MATERIAL,ce),this._renderInternalSlot(Q.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,ce),this._renderContext.resetRenderOccludedMask()};this._renderContext.pass=W.MATERIAL,t(.5,q.OccludeAndTransparent,(()=>i(q.OccludeAndTransparent)),!0,D.OutlineVisualElementMask),t(.5,q.Transparent,(()=>i(q.Transparent)),!0,D.OutlineVisualElementMask),t(1,q.Opaque,(()=>i(q.Opaque)),!0,D.OutlineVisualElementMask),ce.length=0}_renderAntiAliasing(e,r){if(e===x.SMAA){if(this._smaaPass.enable((()=>this._requestRender()))&&h(r))return this._smaaPass.render(r),!0}else this._smaaPass.disable();return!1}_ensureCameraBindParameters(e,r){this._bindParameters.camera=e,this._bindParameters.contentCamera=r}_ensureBindParameters(e,r){var t;this._ensureCameraBindParameters(e,r);const s=this._renderContext.offscreenRenderingHelper;this._bindParameters.hudVisibilityTexture=s.hudVisibilityTexture,this._bindParameters.highlightDepthTexture=null!=(t=s.depthTexture)?t:this._getFallbackDepthTexture()}_ensureBindParametersSSR(){this.hasWaterReflection?(this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=E:(R(ge,this._bindParameters.camera.viewMatrix),R(me,this._bindParameters.camera.projectionMatrix),A(ue,ge,me),A(ue,this._renderContext.lastFrameCamera.viewMatrix,ue),A(ue,this._renderContext.lastFrameCamera.projectionMatrix,ue),this._reprojectionMatrix=ue),this._bindParameters.ssr.lastFrameColorTexture=this._offscreenRendering.lastFrameColorTexture):this._bindParameters.ssr.lastFrameColorTexture=null,this._bindParameters.ssr.enabled=this.hasWaterReflection}_renderInternalSlot(e,r){let t=!1;return this._bindParameters.slot=e,h(r)?r.forEach((e=>{if(!e.shouldRender(this._renderContext))return;const r=this._materialRenderers.get(e);h(r)&&(t=r.render(this._renderContext.pass,this._bindParameters)||t)})):this._materialRenderers.forEach(((e,r)=>{r.shouldRender(this._renderContext)&&e.render(this._renderContext.pass,this._bindParameters)&&(t=!0)})),t}_getFallbackDepthTexture(){return this._fallbackDepthStencilTexture||(this._fallbackDepthStencilTexture=F(this._rctx)),this._fallbackDepthStencilTexture}get gpuMemoryUsage(){var e,r,t,s,i,n,a,h,d,o;return{offscreen:null!=(e=null==(r=this._offscreenRendering)?void 0:r.gpuMemoryUsage)?e:0,highlights:(null!=(t=null==(s=this._highlight)?void 0:s.gpuMemoryUsage)?t:0)+(null!=(i=null==(n=this._shadowHighlight)?void 0:n.gpuMemoryUsage)?i:0),shadows:null!=(a=null==(h=this._shadowMap)?void 0:h.gpuMemoryUsage)?a:0,ssao:null!=(d=null==(o=this._ssaoHelper)?void 0:o.gpuMemoryUsage)?d:0}}get test(){const e=this;return{offscreen:this._offscreenRendering,shadowMap:this._shadowMap,ssao:this._ssaoHelper,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,getFramebufferTexture:r=>{switch(r){case _e.Color:return e._offscreenRendering.colorTexture;case _e.LinearDepth:return e._offscreenRendering.linearDepthTexture;case _e.Normals:return e._offscreenRendering.normalTexture;case _e.ShadowMap:return e._shadowMap.depthTexture;case _e.HudVisibility:return e._offscreenRendering.hudVisibilityTexture;case _e.Highlight:return e._offscreenRendering.highlightTexture}}}}};var _e;e([u()],le.prototype,"_shadowAccumulator",void 0),e([u()],le.prototype,"_smaaPass",void 0),e([u()],le.prototype,"_antialiasing",void 0),e([u()],le.prototype,"_edgeView",void 0),e([u()],le.prototype,"updating",null),e([u()],le.prototype,"isCameraFinal",null),le=e([f("esri.views.3d.webgl-engine.lib.Renderer")],le),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.Normals=2]="Normals",e[e.ShadowMap=3]="ShadowMap",e[e.HudVisibility=4]="HudVisibility",e[e.Highlight=5]="Highlight"}(_e||(_e={}));const ce=[],pe=[],me=P(),ge=P(),ue=P();export{_e as FramebufferId,le as Renderer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{update as t}from"../../../../core/arrayUtils.js";import s from"../../../../core/Handles.js";import{someMap as i}from"../../../../core/MapUtils.js";import{destroyMaybe as n,disposeMaybe as a,isSome as h,isNone as d,applySome as o,unwrap as _}from"../../../../core/maybe.js";import{watch as l,syncAndInitial as c,initial as p,sync as m}from"../../../../core/reactiveUtils.js";import{Milliseconds as g}from"../../../../core/time.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{v as T,a as R,m as A}from"../../../../chunks/mat4.js";import{I as E,c as P}from"../../../../chunks/mat4f64.js";import{c as b}from"../../../../chunks/boundedPlane.js";import{MAXIMUM_ANIMATION_LOAD as S,MINIMUM_IDLE_ANIMATION_MS as H}from"../../support/animationUtils.js";import w from"../../support/debugFlags.js";import{RenderPassManager as M}from"../core/renderPasses/RenderPassManager.js";import{HUDTransparentRenderStyle as I}from"../core/shaderLibrary/hud/HUDUniforms.js";import{AntiAliasingMode as x,TransparencyPassType as C,Decorations as L,RenderRequestType as O,StencilBits as D}from"./basicInterfaces.js";import{BoundingInfo as y}from"./BoundingInfo.js";import{ZERO as N,union as v}from"./depthRange.js";import{depthRangeFromScene as U}from"./depthRangeUtils.js";import{createEmptyDepthTexture as F}from"./glUtil3D.js";import{Highlight as j}from"./Highlight.js";import{RenderOccludedFlag as q}from"./Material.js";import{OffscreenRendering as G}from"./OffscreenRendering.js";import{RenderContext as V}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as B}from"./rendererUtils.js";import{RenderPass as W}from"./RenderPass.js";import{RenderPluginManager as k}from"./RenderPluginManager.js";import{RenderSlot as Q}from"./RenderSlot.js";import{ShadowAccumulator as z}from"./ShadowAccumulator.js";import{ShadowHighlight as X}from"./ShadowHighlight.js";import{ShadowMap as Y,SnapshotSlot as K}from"./ShadowMap.js";import J from"./SliceHelper.js";import{SmaaRenderPass as Z}from"./SmaaRenderPass.js";import{SSAOHelper as $}from"./SSAOHelper.js";import{EdgeView as ee}from"./edgeRendering/EdgeView.js";import{Transparency as re}from"./edgeRendering/interfaces.js";import{MergedRenderer as te}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as se}from"../shaders/CompositingTechniqueConfiguration.js";import{RendererPerformanceInfo as ie,Statistics as ne}from"../statistics/RendererPerformanceInfo.js";import{ClearBufferBit as ae,PixelFormat as he,PixelType as de}from"../../../webgl/enums.js";const oe=.9;let _e=class extends r{constructor(e,r,t,i,n,a,h,d,o){super({}),this._materialRepository=e,this._shaderTechniqueRepository=t,this._rctx=i,this._compositingHelper=n,this._magnifierHelper=a,this._requestRender=h,this._stage=o,this._materialRenderers=new Map,this._needsTransparentPass=!1,this._hasHUDElements=!1,this._hasHighlights=!1,this._hasWater=!1,this._hasOverlayWater=!1,this._content=new Map,this._isRendering=!1,this._fallbackDepthStencilTexture=null,this.performanceInfo=new ie,this._antialiasing=x.SMAA,this._oitEnabled=!1,this._multipassTerrain=!0,this._transparentTerrain=!1,this._hasAnimations=!1,this._animationTimestep=g(0),this._handles=new s,this._renderHiddenTransparentEdges=()=>{},this._oitUsed=!1,this._smaaPass=new Z(this._rctx,t),this._oitEnabled=this._hasOITSupport,this._requestRender(),this._offscreenRendering=new G(this._rctx,this._compositingHelper),this._sliceHelper=new J,this._shadowMap=new Y(this._rctx,o.viewingMode,2),this._ssaoHelper=new $(t,this._rctx,(()=>this._requestRender())),this._highlight=new j(t,this._rctx),this._shadowHighlight=new X(this._rctx,o.viewingMode),this._shadowAccumulator=new z(this._rctx,t,o,(e=>{const r=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureCameraBindParameters(e.camera,e.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=r}),((e,r,t)=>{e.shadowMap.start(e.camera,r,t),this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_ALL,e.shadowMap),e.camera.setGLViewport(this._rctx),this._ensureCameraBindParameters(e.camera,e.contentCamera)}),(()=>this._requestRender())),this._renderContext=new V(this._rctx,this._offscreenRendering,this._shadowMap,this._ssaoHelper,this._sliceHelper),this._renderPlugins=new k({renderContext:this._renderContext,shaderTechniqueRepository:t,textureRep:r,materialRep:this._materialRepository,requestRender:this._requestRender,schedule:d}),this.renderPassManager=new M(this._rctx,this._shaderTechniqueRepository),this._renderPlugins.add(this.renderPassManager.slots(),this.renderPassManager),this._handles.add([l((()=>this._stage.state.camera),(()=>this._requestRender()),c),l((()=>w.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(re.TRANSPARENT):()=>{},this._requestRender()}),p)])}get _bindParameters(){return this._renderContext.bindParameters}get hasWater(){return this._hasWater||this._hasOverlayWater}get hasWaterReflection(){return this.hasWater&&this._waterReflectionEnabled}normalizeCtorArgs(){return{}}dispose(){this._handles.destroy(),this._smaaPass.dispose(),this._materialRenderers.forEach((e=>e.dispose())),this._materialRenderers.clear(),this._edgeView=n(this._edgeView),this._offscreenRendering.dispose(),this._fallbackDepthStencilTexture=a(this._fallbackDepthStencilTexture),this._shadowMap.enabled=!1,this._shadowMap.dispose(),this._ssaoHelper.enabled=!1,this._ssaoHelper.dispose(),this._highlight.dispose(),this._shadowHighlight.dispose(),this._shadowAccumulator.dispose(),y.prune(),this._content.clear()}disposeOffscreenBuffers(){this._offscreenRendering.dispose(),this._shadowMap.dispose(),this._smaaPass.disable(),this._ssaoHelper.disposeOffscreenBuffers()}get updating(){return this._antialiasing===x.SMAA&&this._smaaPass.updating||h(this._edgeView)&&this._edgeView.updating||this._shadowAccumulator.running||!this.isCameraFinal}ensureEdgeView(){return d(this._edgeView)&&(this._edgeView=new ee({rctx:this._rctx,renderSR:this._stage.renderSR,techniqueRepository:this._shaderTechniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:e=>this._stage.resourceController.schedule(e)}),this._handles.add(l((()=>o(this._edgeView,(e=>e.updating))),(()=>this._requestRender()),m)),this._requestRender()),this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return T(this._bindParameters.ssr.reprojectionMatrix,E)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){return!!this._shadowMap?.enabled}setRenderParameters(e){const{_shadowMap:r,_ssaoHelper:t,_bindParameters:s}=this;void 0!==e.screenSpaceReflectionsEnabled&&s.ssr.enabled!==e.screenSpaceReflectionsEnabled&&(s.ssr.enabled=e.screenSpaceReflectionsEnabled,this._requestRender()),void 0!==e.enableFillLights&&s.enableFillLights!==e.enableFillLights&&(s.enableFillLights=e.enableFillLights,this._requestRender()),void 0!==e.shadowMap&&r.enabled!==e.shadowMap&&(r.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&r.maxCascades!==e.shadowMapMaxCascades&&(r.maxCascades=e.shadowMapMaxCascades,this._requestRender()),void 0!==e.ssao&&t.enabled!==e.ssao&&(t.enabled=e.ssao,this._requestRender()),e.background&&this._offscreenRendering.background!==e.background&&(this._offscreenRendering.background=e.background,this._requestRender());const i=e.antialiasingEnabled?x.SMAA:x.NONE;void 0!==e.antialiasingEnabled&&this._antialiasing!==i&&(this._antialiasing=i,this._requestRender()),void 0!==e.highQualityTransparency&&this._multipassTerrain!==e.highQualityTransparency&&(this._multipassTerrain=e.highQualityTransparency,this._oitEnabled=e.highQualityTransparency&&this._hasOITSupport,this._requestRender()),void 0!==e.defaultHighlightOptions&&(this._highlight.setDefaultOptions(e.defaultHighlightOptions),this._shadowHighlight.setDefaultOptions(e.defaultHighlightOptions),this._requestRender()),void 0!==e.overlays&&this._bindParameters.overlays!==e.overlays&&(this._bindParameters.overlays=e.overlays,this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=_(e.slicePlane),this._requestRender()),void 0!==e.waterReflectionEnabled&&this._waterReflectionEnabled!==e.waterReflectionEnabled&&(this._waterReflectionEnabled=e.waterReflectionEnabled,this._requestRender()),void 0!==e.enableFillLights&&s.enableFillLights!==e.enableFillLights&&(s.enableFillLights=e.enableFillLights,this._requestRender()),void 0!==e.transparentTerrain&&this._transparentTerrain!==e.transparentTerrain&&(this._transparentTerrain=e.transparentTerrain,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlendWorking}modify(e){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:t,updates:s}=e;if(0===r.length&&0===t.length&&0===s.length)return;t.forAll((({id:e})=>this._content.delete(e))),r.forAll((e=>this._content.set(e.id,e)));const n=B(e);let a=!1;n.forEach(((e,r)=>{let t=this._materialRenderers.get(r);if(!t){if(!(e.adds.length>0))return;t=new te(this._rctx,this._materialRepository,r),this._materialRenderers.set(r,t)}t.modify(e),t.isEmpty&&(a=!0)})),a&&this._materialRenderers.forEach(((e,r)=>{e.isEmpty&&(this._materialRenderers.delete(r),e.dispose())})),this._hasHighlights=i(this._materialRenderers,(e=>e.hasHighlights)),this._bindParameters.hasOccludees=i(this._materialRenderers,(e=>e.hasOccludees)),this._hasWater=i(this._materialRenderers,(e=>e.hasWater)),this._needsTransparentPass=i(this._materialRenderers,(e=>e.requiresSlot(Q.TRANSPARENT_MATERIAL,W.MATERIAL))),this._hasHUDElements=i(this._materialRenderers,(e=>e.requiresSlot(Q.LINE_CALLOUTS_HUD_DEPTH,W.MATERIAL)||e.requiresSlot(Q.HUD_MATERIAL,W.MATERIAL)||e.requiresSlot(Q.LABEL_MATERIAL,W.MATERIAL))),this._requestRender()}updateAnimation(e){return this._hasAnimations=!1,this._materialRenderers.forEach((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations=this._renderPlugins.updateAnimation(e)||this._hasAnimations,this._hasAnimations}get animationTimestep(){return this._animationTimestep}updateLightSources(e,r,t){this._bindParameters.lighting.groundLightingFactor=r,this._bindParameters.lighting.globalFactor=t,this._bindParameters.lighting.set(e)}render(e,r,t,s){this._isRendering=!0,this.performanceInfo.prerender(this._rctx),this._bindParameters.transparencyPassType=C.NONE;const i=this._offscreenRendering;i.needLastFrameColorTexture=this.hasWaterReflection,i.advanceCurrentRenderTarget();const n=b(this._sliceHelper.plane);s===L.OFF&&(this._sliceHelper.plane=null),this._rctx.bindFramebuffer(e),r.setGLViewport(this._rctx),this._ensureCameraBindParameters(r,t),this._renderPlugins.prepareRender(),this.performanceInfo.advance(ne.Prepare);const a=this._computeDepthRange(r);this._renderShadowMap(e,r,this._bindParameters.lighting.lightingMainDirection,a),this.performanceInfo.advance(ne.Shadowmap),i.initializeFrame(r),this._ensureBindParameters(r,t),this._renderLinearDepth(),this.performanceInfo.advance(ne.Lineardepth),this._accumulateShadows(a,r,t),this._renderNormal(),this.performanceInfo.advance(ne.Normals),this._ensureBindParametersSSR(),this._ssaoHelper.computeSSAO(this._bindParameters,i.linearDepthTexture,i.normalTexture),this.performanceInfo.advance(ne.SSAO),this._renderContext.pass=W.MATERIAL,i.bindFramebuffer(),this._renderOpaqueGeometry(),this.performanceInfo.advance(ne.Opaque);const o=this._multipassTerrain&&this._transparentTerrain;this._renderTerrainLinearDepth(o),this._setMultipassEnabled(o),this._setTerrainCulling(o),this._renderEdges(re.OPAQUE),this.performanceInfo.advance(ne.OpaqueEdges),this._renderHiddenTransparentEdges();const _=this._needsTransparentPass||this._renderPlugins.needsTransparentPass;_&&(this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry()),this.performanceInfo.advance(ne.Transparent),this._renderGeometryLinearDepth(o);const l=this._renderHUDVisibility();o||this._renderInternalSlot(Q.LINE_CALLOUTS),this.performanceInfo.advance(ne.Hudvisibility),this._renderEdges(re.TRANSPARENT,o),this.performanceInfo.advance(ne.TransparentEdges),this._renderSlot(Q.VOXEL),this._renderTransparentTerrain(),this._transparentTerrain&&l&&(o?this._renderLineCallouts(I.Occluded):i.compositeTransparentTerrainOntoHUDVisibility(this._bindParameters),this._renderHUD(I.Occluded,i.framebuffer),this.performanceInfo.advance(ne.HudOccluded)),this.performanceInfo.advance(ne.TransparentTerrain),this._setTerrainCulling(!1),this._transparentTerrain&&(i.compositeTransparentTerrainOntoMain(this._bindParameters),o&&(this._renderEdges(re.OPAQUE),this.performanceInfo.advance(ne.OpaqueEdges),_&&(this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry()),this.performanceInfo.advance(ne.Transparent),this._renderEdges(re.TRANSPARENT),this.performanceInfo.advance(ne.TransparentEdges))),o&&this._renderLineCallouts(I.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),i.renderToTargets((()=>{this._renderInternalSlot(Q.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderSlot(Q.POSTPROCESSING_ENVIRONMENT_TRANSPARENT),this._renderSlot(Q.LASERLINES)}),i.currentColorTarget,i.mainDepth),this.performanceInfo.advance(ne.Atmosphere),this._renderPlugins.needsLaserlineWithContrastControl&&i.renderTmpAndCompositeToMain((()=>this._renderSlot(Q.LASERLINES_CONTRAST_CONTROL)),this._bindParameters,se.PremultipliedAlpha),this.performanceInfo.advance(ne.Laserline),this._renderOccluded(),this.performanceInfo.advance(ne.Occluded);const c=s===L.ON&&this._magnifierHelper.enabled,p=c&&d(e)?this._offscreenRendering.getFramebuffer(this._offscreenRendering.tmpColor,this._offscreenRendering.tmpDepth):e;this._rctx.bindFramebuffer(p);const m=this._offscreenRendering.colorTexture;!this._renderAntiAliasing(this._antialiasing,m)&&h(m)&&this._compositingHelper.composite(this._bindParameters,m,se.None),this.performanceInfo.advance(ne.Antialiasing),this._renderHUD(I.NotOccluded,p),this.performanceInfo.advance(ne.HudNotoccluded),this._renderHighlights(p,this._bindParameters),this.performanceInfo.advance(ne.Highlights),c&&this._magnifierHelper.render(this._rctx,this._bindParameters),p!==e&&(this._rctx.bindFramebuffer(e),this._compositingHelper.composite(this._bindParameters,this._offscreenRendering.tmpColorTexture,se.None)),this._disposeOITBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=n,this._isRendering=!1,this.onPostRender&&this.onPostRender(),this.performanceInfo.postrender()}finish(e){if(this._hasAnimations||(this._animationTimestep=g(0)),e===O.BACKGROUND){this._rctx.gl.getError();const e=this.performanceInfo.elapsedTime/S;this._animationTimestep=g(Math.max(this._animationTimestep*oe+e*(1-oe),H))}}readDepthPixels(e,r,t){const s=this._offscreenRendering.bindTarget(this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth);if(!this._needsLinearDepth){this._ensureBindParameters(e,e),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const r=ae.COLOR_BUFFER_BIT|ae.DEPTH_BUFFER_BIT|ae.STENCIL_BUFFER_BIT;this._rctx.clearSafe(r),this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_DEPTH)}s.readPixels(r[0],r[1],r[2],r[3],he.RGBA,de.UNSIGNED_BYTE,t)}readHUDVisibility(e,r,t,s,i){this._offscreenRendering.bindTarget(this._offscreenRendering.hudVisibility).readPixels(e,r,t,s,he.RGBA,de.UNSIGNED_BYTE,i)}readAccumulatedShadow(e,r){return this._shadowAccumulator.readAccumulatedShadow(e,r)}_setMultipassEnabled(e){this._bindParameters.multipassTerrain.enabled=this._bindParameters.multipassGeometry.enabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_renderSlot(e){this._bindParameters.slot=e,this._renderPlugins.render()}_renderEdges(e,r=!1){const t=this._edgeView;h(t)&&t.shouldRender()&&this._offscreenRendering.renderTmpAndCompositeToMain((()=>t.render(this._bindParameters,e)),this._bindParameters,se.Alpha,r)}_renderShadowMap(e,r,t,s){const i=this._shadowMap;i.enabled&&(i.start(r,t,s),this._shadowHighlight.updateParameters(r,t),this.needsShadowHighlight?(this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT,this._shadowMap,(e=>i.takeCascadeSnapshotTo(e,K.Highlight))),i.clear(),this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_DEFAULT,this._shadowMap,(e=>{i.takeCascadeSnapshotTo(e,K.Default),this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT)}))):this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_ALL),i.finish(e),r.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap,t=(e=>{})){for(const s of r.getCascades())s.camera.setGLViewport(this._rctx),this._ensureCameraBindParameters(s.camera,s.camera),this._renderGeometryAndTransparentTerrainPass(e),t(s)}get _needsLinearDepth(){return this._ssaoHelper.enabled||this._renderPlugins.needsLinearDepth||this._hasWater&&this._waterReflectionEnabled||this.needsShadowHighlight||this.needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?this._offscreenRendering.renderToTargets((()=>this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_DEPTH)),this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.linearDepth),this._bindParameters.linearDepthTexture=this._offscreenRendering.linearDepthTexture}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.pass;this._renderContext.pass=W.MATERIAL_DEPTH,this._offscreenRendering.renderToTargets((()=>this._renderTransparentTerrain()),this._offscreenRendering.terrainLinearDepth,this._offscreenRendering.tmpDepth,[-1e10,-1e10,-1e10,1],!0,!0),this._renderContext.pass=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.terrainLinearDepth);this._bindParameters.multipassTerrain.linearDepthTexture=this._offscreenRendering.terrainLinearDepthTexture}_renderGeometryLinearDepth(e){if(e){const e=this._renderContext.pass;this._offscreenRendering.renderToTargets((()=>this._renderGeometryPass(W.MATERIAL_DEPTH)),this._offscreenRendering.geometryLinearDepth,this._offscreenRendering.tmpDepth,[1,1,1,1],!0,!0),this._renderContext.pass=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.geometryLinearDepth);this._bindParameters.multipassGeometry.linearDepthTexture=this._offscreenRendering.geometryLinearDepthTexture}get needsNormal(){return this._ssaoHelper.enabled}_renderNormal(){this.needsNormal?this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_NORMAL)}),this._offscreenRendering.normal,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.normal)}get needsDepthRange(){return this._shadowMap.enabled||this.needsShadowCast}_computeDepthRange(e){if(!this.needsDepthRange)return N;const r=U(e,this._content,this._stage.layers);return v(r,this.renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderGeometryAndTransparentTerrainPass(e){this._renderContext.pass=e,this._renderGeometryPass(e),this._renderTransparentTerrain()}_renderGeometryPass(e){this._renderContext.pass=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderOpaqueGeometry(){this._renderSlot(Q.INTEGRATED_MESH),this._renderSlot(Q.OPAQUE_TERRAIN),this._renderInternalSlot(Q.OPAQUE_MATERIAL),this._renderSlot(Q.OPAQUE_MATERIAL),this._renderSlot(Q.POSTPROCESSING_ENVIRONMENT_OPAQUE)}_renderTransparentGeometry(){this._renderInternalSlot(Q.TRANSPARENT_MATERIAL),this._renderSlot(Q.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){this._renderSlot(Q.TRANSPARENT_TERRAIN)}_renderHUDVisibility(){let e=!1;return this._renderContext.offscreenRenderingHelper&&this._renderContext.offscreenRenderingHelper.renderHUDVisibility((()=>{this._bindParameters.hudVisibilityTexture=this._renderContext.offscreenRenderingHelper.hudVisibilityTexture,e=this._renderInternalSlot(Q.OCCLUSION_PIXELS)}),this._multipassTerrain&&this._transparentTerrain),e}_renderLineCallouts(e){this._bindParameters.renderTransparentlyOccludedHUD=e,e===I.Occluded?this._offscreenRendering.renderToTargets((()=>this._renderInternalSlot(Q.LINE_CALLOUTS)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderInternalSlot(Q.LINE_CALLOUTS)}_renderHUD(e,r){this._hasHUDElements&&(this._oitEnabled?(this._renderOrderIndependentTransparency((()=>this._renderHUDElements(e)),!0),this._rctx.bindFramebuffer(r),this._compositingHelper.composite(this._bindParameters,this._offscreenRendering.hudColorTexture,se.PremultipliedAlpha)):e===I.Occluded?this._offscreenRendering.renderToTargets((()=>this._renderHUDElements(I.Occluded)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderHUDElements(e))}_renderHUDElements(e){this._bindParameters.renderTransparentlyOccludedHUD=e,this._renderInternalSlot(Q.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(Q.HUD_MATERIAL),this._renderInternalSlot(Q.LABEL_MATERIAL)}get needsHighlight(){return this._hasHighlights||this._renderPlugins.needsHighlight}get needsShadowHighlight(){return this._shadowMap.enabled&&this._shadowHighlight.isVisible&&this.needsHighlight}_renderHighlights(e,r){if(!this.needsHighlight)return void this._offscreenRendering.disposeTarget(this._offscreenRendering.highlight);const t=this._highlight,s=this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_HIGHLIGHT),this._rctx.clearSafe(ae.DEPTH_BUFFER_BIT),this._renderHUDElements(I.Both)}),this._offscreenRendering.highlight,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0);this._bindParameters.highlightColorTexture=s.colorTexture,this.needsShadowHighlight&&this._shadowHighlight.render(r,e),t.render(this._bindParameters,s,e)}get needsShadowCast(){return this._shadowAccumulator.isAccumulating}_accumulateShadows(e,r,t){this.needsShadowCast&&this._shadowAccumulator.renderAccumulation(this._offscreenRendering.linearDepthTexture,e,r,t)}_renderOrderIndependentTransparency(e,r){const t=t=>{this._bindParameters.transparencyPassType=t,this._offscreenRendering.renderOITPass((()=>e()),t,r)},s=this._renderContext.pass;this._renderContext.pass=W.MATERIAL_ALPHA,t(C.Alpha),this._renderContext.pass=W.MATERIAL,t(C.Color),t(C.FrontFace),this._offscreenRendering.compositeTransparentOntoOpaque(this._bindParameters,r),this._bindParameters.transparencyPassType=C.NONE,this._renderContext.pass=s,this._oitUsed=!0}_disposeOITBuffers(){this._oitUsed||(this._offscreenRendering.disposeTarget(this._offscreenRendering.alphaFloatTarget),this._offscreenRendering.disposeTarget(this._offscreenRendering.colorFloatTarget),this._offscreenRendering.disposeTarget(this._offscreenRendering.frontFaceTarget)),this._oitUsed=!1}_renderOccluded(){let e=0;this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&t.renderOccluded===q.OccludeAndTransparentStencil&&(e|=t.renderOccluded,pe.push(t))}));const r=this._offscreenRendering,t=(t,s,i,n,a)=>{0!=(e&s)&&(r.renderToTargets(i,r.tmpColor,r.mainDepth,[0,0,0,0],n,a),r.compositeOccludedOntoMain(this._bindParameters,t))};0!==pe.length&&(this._renderInternalSlot(Q.OCCLUDER_MATERIAL,pe),t(.5,q.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(Q.TRANSPARENT_OCCLUDER_MATERIAL,pe)),!1,!1),pe.length=0),this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&(t.renderOccluded===q.OccludeAndTransparent||t.renderOccluded===q.Transparent||t.renderOccluded===q.Opaque)&&(e|=t.renderOccluded,ce.push(t))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const i=e=>{this._renderContext.renderOccludedMask=e,s>q.Occlude&&this._renderSlot(Q.OCCLUDED_TERRAIN),this._renderInternalSlot(Q.OPAQUE_MATERIAL,ce),this._renderInternalSlot(Q.TRANSPARENT_MATERIAL,ce),this._renderInternalSlot(Q.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,ce),this._renderContext.resetRenderOccludedMask()};this._renderContext.pass=W.MATERIAL,t(.5,q.OccludeAndTransparent,(()=>i(q.OccludeAndTransparent)),!0,D.OutlineVisualElementMask),t(.5,q.Transparent,(()=>i(q.Transparent)),!0,D.OutlineVisualElementMask),t(1,q.Opaque,(()=>i(q.Opaque)),!0,D.OutlineVisualElementMask),ce.length=0}_renderAntiAliasing(e,r){if(e===x.SMAA){if(this._smaaPass.enable((()=>this._requestRender()))&&h(r))return this._smaaPass.render(r),!0}else this._smaaPass.disable();return!1}_ensureCameraBindParameters(e,r){this._bindParameters.camera=e,this._bindParameters.contentCamera=r}_ensureBindParameters(e,r){this._ensureCameraBindParameters(e,r);const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.hudVisibilityTexture=t.hudVisibilityTexture,this._bindParameters.highlightDepthTexture=t.depthTexture??this._getFallbackDepthTexture()}_ensureBindParametersSSR(){this.hasWaterReflection?(this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=E:(R(ge,this._bindParameters.camera.viewMatrix),R(me,this._bindParameters.camera.projectionMatrix),A(ue,ge,me),A(ue,this._renderContext.lastFrameCamera.viewMatrix,ue),A(ue,this._renderContext.lastFrameCamera.projectionMatrix,ue),this._reprojectionMatrix=ue),this._bindParameters.ssr.lastFrameColorTexture=this._offscreenRendering.lastFrameColorTexture):this._bindParameters.ssr.lastFrameColorTexture=null,this._bindParameters.ssr.enabled=this.hasWaterReflection}_renderInternalSlot(e,r){let t=!1;return this._bindParameters.slot=e,h(r)?r.forEach((e=>{if(!e.shouldRender(this._renderContext))return;const r=this._materialRenderers.get(e);h(r)&&(t=r.render(this._renderContext.pass,this._bindParameters)||t)})):this._materialRenderers.forEach(((e,r)=>{r.shouldRender(this._renderContext)&&e.render(this._renderContext.pass,this._bindParameters)&&(t=!0)})),t}_getFallbackDepthTexture(){return this._fallbackDepthStencilTexture||(this._fallbackDepthStencilTexture=F(this._rctx)),this._fallbackDepthStencilTexture}get gpuMemoryUsage(){return{offscreen:this._offscreenRendering?.gpuMemoryUsage??0,highlights:(this._highlight?.gpuMemoryUsage??0)+(this._shadowHighlight?.gpuMemoryUsage??0),shadows:this._shadowMap?.gpuMemoryUsage??0,ssao:this._ssaoHelper?.gpuMemoryUsage??0}}get test(){const e=this;return{offscreen:this._offscreenRendering,shadowMap:this._shadowMap,ssao:this._ssaoHelper,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,getFramebufferTexture:r=>{switch(r){case le.Color:return e._offscreenRendering.colorTexture;case le.LinearDepth:return e._offscreenRendering.linearDepthTexture;case le.Normals:return e._offscreenRendering.normalTexture;case le.ShadowMap:return e._shadowMap.depthTexture;case le.HudVisibility:return e._offscreenRendering.hudVisibilityTexture;case le.Highlight:return e._offscreenRendering.highlightTexture}}}}};var le;e([u()],_e.prototype,"_shadowAccumulator",void 0),e([u()],_e.prototype,"_smaaPass",void 0),e([u()],_e.prototype,"_antialiasing",void 0),e([u()],_e.prototype,"_edgeView",void 0),e([u()],_e.prototype,"updating",null),e([u()],_e.prototype,"isCameraFinal",null),_e=e([f("esri.views.3d.webgl-engine.lib.Renderer")],_e),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.Normals=2]="Normals",e[e.ShadowMap=3]="ShadowMap",e[e.HudVisibility=4]="HudVisibility",e[e.Highlight=5]="Highlight"}(le||(le={}));const ce=[],pe=[],me=P(),ge=P(),ue=P();export{le as FramebufferId,_e as Renderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{equals as i}from"../../../../core/arrayUtils.js";import s from"../../../../core/Handles.js";import{smoothstep as r}from"../../../../core/mathUtils.js";import{isNone as o,disposeMaybe as a,releaseMaybe as n}from"../../../../core/maybe.js";import{watch as h,syncAndInitial as c}from"../../../../core/reactiveUtils.js";import{property as _}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{y as u,c as m}from"../../../../chunks/vec3.js";import{c as p}from"../../../../chunks/vec3f64.js";import{ShaderTechniqueConfiguration as d}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{BindParameters as g}from"./BindParameters.js";import{Camera as f}from"./Camera.js";import{ZERO as w}from"./depthRange.js";import{createQuadVAO as v}from"./glUtil3D.js";import{ShadowCastRenderer as b,shadowCastDisabledElevationThreshold as A,shadowCastDisableElevationMax as y,shadowCastDisableElevationMin as R}from"./ShadowCastRenderer.js";import{ShadowMap as T}from"./ShadowMap.js";import{S,s as D}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as j}from"../shaders/ShadowCastAccumulateTechnique.js";import{TaskPriority as C}from"../../../support/Scheduler.js";import{TargetType as F,DepthStencilTargetType as E,TextureType as P,PixelFormat as q,PixelType as x,TextureSamplingMode as M,TextureWrapMode as U,ClearBufferBit as O}from"../../../webgl/enums.js";import{FramebufferObject as L}from"../../../webgl/FramebufferObject.js";import{vertexCount as B}from"../../../webgl/Util.js";var I;let N=I=class extends t{constructor(e,t,i,r,a,n){super({}),this._rctx=e,this._stage=i,this._prepareForShadowMapPass=r,this._renderToShadowMap=a,this._requestRender=n,this._progress=0,this._sampleCount=0,this._passParameters=new S,this._enabled=!1,this._cachedLightDirections=[],this._depthRange=w,this._previewing=!1,this._handles=new s,this._cameraForcedForScreenshot=!1,this._bindParameters=new g(new T(e,i.viewingMode),null,null),this._bindParameters.shadowMap.enabled=!0,this._bindParameters.camera=new f,this._vao=v(e);const _={colorTarget:F.TEXTURE,depthStencilTarget:E.NONE,width:0,height:0},l={target:P.TEXTURE_2D,pixelFormat:q.RGBA,dataType:x.UNSIGNED_BYTE,samplingMode:M.LINEAR,wrapMode:U.CLAMP_TO_EDGE,width:0,height:0};this._fbo=new L(e,_,l),this._accumulationRenderer=new b(t,e,this,n);const u=this._stage.resourceController.scheduler;this._handles.add(u.registerTask(C.SHADOW_ACCUMULATOR,this)),this._handles.add(h((()=>i.renderView),(e=>{this._handles.remove(I.renderViewHandleKey),o(e)||this._handles.add(e.events.on("force-camera-for-screenshot",(()=>this._cameraForcedForScreenshot=!0)),I.renderViewHandleKey)}),c))}normalizeCtorArgs(){return{}}get computedSamples(){return this._progress}get shadowCastTexture(){return this._fbo.colorTexture}get isAccumulating(){return this._isPreviewing||this._isRefining}get accumulationTechnique(){if(o(this._accumulationTechnique)){const e={rctx:this._rctx,viewingMode:this._stage.viewingMode};this._accumulationTechnique=new j(e,new d)}return this._accumulationTechnique}get _isRefining(){return this._isActive&&!this._isDoneAccumulating&&!this._previewing}get _isPreviewing(){return this._isActive&&this._previewing}get _isActive(){return this._enabled&&this._sampleCount>0}get canAccumulate(){return null!==this._passParameters.linearDepthTexture&&this._depthRange!==w&&this._opacityFromElevation>A}get _isDoneAccumulating(){return this._progress>=this._sampleCount}get _lightDirections(){return this._cachedLightDirections}set _lightDirections(e){const t=this._cachedLightDirections;if(i(t,e,u))return;const s=e.length;t.length=s,this._sampleCount=Math.min(D,s);for(let i=0;i<s;++i){const s=e[i],r=t[i]||p();m(r,s),t[i]=r}this._invalidate()}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get running(){return this._isRefining&&this.canAccumulate&&this._progress>0}runTask(e){for(this._prepareForShadowMapPass(this._bindParameters);!e.done&&!this._isDoneAccumulating;)this._accumulateShadow(),e.madeProgress();this._requestRender()}renderAccumulation(e,t,i,s){if(this._passParameters.linearDepthTexture=e,this._depthRange=t,this._updateCamera(i),this._bindParameters.contentCamera=s,this.notifyChange("canAccumulate"),!this.isAccumulating||!this.canAccumulate)return;(this._previewing||0===this._progress||this._cameraForcedForScreenshot)&&this._clear();const r=this._cameraForcedForScreenshot?this._sampleCount:Math.min(I.previewSamples,this._sampleCount-this._progress);for(let o=0;o<r;++o)this._accumulateShadow();this._cameraForcedForScreenshot=!1}render(e){this._accumulationRenderer.render(e)}dispose(){this._stop(),this._handles.destroy(),this._accumulationRenderer=a(this._accumulationRenderer),this._bindParameters.shadowMap.dispose(),this._fbo=a(this._fbo),this._vao=a(this._vao),this._accumulationTechnique=n(this._accumulationTechnique),this._cachedLightDirections.length=0,this._sampleCount=0}setOptions(e){void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.previewing&&(this.previewing=e.previewing),void 0!==e.lightDirections&&(this.lightDirections=e.lightDirections),this._accumulationRenderer.setOptions(e)}set previewing(e){this._previewing!==e&&(this._previewing=e,this._requestRenderIfEnabled())}set lightDirections(e){this._lightDirections=e}readAccumulatedShadow(e,t){if(!this._isActive||this._progress<1||e<0||e>this._fbo.width||t<0||t>this._fbo.height)return 0;const i=k;return this._fbo.readPixels(e,t,1,1,q.RGBA,x.UNSIGNED_BYTE,i),i[0]/this._progress}_start(){this._progress=0,this._enabled=!0}_stop(){this._enabled=!1}_invalidate(){this._progress=0,this._requestRenderIfEnabled()}_clear(){this._rctx.bindFramebuffer(this._fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clearSafe(O.COLOR_BUFFER_BIT),this._progress=0}_accumulateShadow(){const e=this._lightDirections[this._progress];this._renderToShadowMap(this._bindParameters,e,this._depthRange),this._passParameters.origin=this._bindParameters.camera.center,this._rctx.bindFramebuffer(this._fbo);const t=this.accumulationTechnique;this._rctx.bindTechnique(t,this._passParameters,this._bindParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(t.primitiveType,0,B(this._vao,"geometry")),this._progress++}_updateCamera(e){e.equals(this._bindParameters.camera)||(this._bindParameters.camera.copyFrom(e),this._fbo.resize(e.fullWidth,e.fullHeight),this._opacityFromElevation=1-r(R,y,e.relativeElevation))}set enabled(e){e!==this._enabled&&(e?this._start():this._stop())}_requestRenderIfEnabled(){this._enabled&&this._requestRender()}get test(){return{lightDirections:this._lightDirections,isDone:()=>this._isDoneAccumulating,isActive:()=>this._isActive}}};N.previewSamples=6,N.renderViewHandleKey="renderView",e([_()],N.prototype,"_progress",void 0),e([_()],N.prototype,"_sampleCount",void 0),e([_()],N.prototype,"_enabled",void 0),e([_()],N.prototype,"_depthRange",void 0),e([_()],N.prototype,"_previewing",void 0),e([_()],N.prototype,"_accumulationRenderer",void 0),e([_()],N.prototype,"_isRefining",null),e([_()],N.prototype,"_isActive",null),e([_()],N.prototype,"canAccumulate",null),e([_()],N.prototype,"_isDoneAccumulating",null),e([_()],N.prototype,"_opacityFromElevation",null),e([_()],N.prototype,"running",null),N=I=e([l("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],N);const k=new Uint8Array(4);export{N as ShadowAccumulator};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{equals as i}from"../../../../core/arrayUtils.js";import s from"../../../../core/Handles.js";import{smoothstep as r}from"../../../../core/mathUtils.js";import{isNone as o,disposeMaybe as a,releaseMaybe as n}from"../../../../core/maybe.js";import{watch as h,syncAndInitial as c}from"../../../../core/reactiveUtils.js";import{property as _}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{z as u,c as m}from"../../../../chunks/vec3.js";import{c as p}from"../../../../chunks/vec3f64.js";import{ShaderTechniqueConfiguration as d}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{BindParameters as g}from"./BindParameters.js";import{Camera as f}from"./Camera.js";import{ZERO as w}from"./depthRange.js";import{createQuadVAO as v}from"./glUtil3D.js";import{ShadowCastRenderer as b,shadowCastDisabledElevationThreshold as A,shadowCastDisableElevationMax as y,shadowCastDisableElevationMin as R}from"./ShadowCastRenderer.js";import{ShadowMap as T}from"./ShadowMap.js";import{S,s as D}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as j}from"../shaders/ShadowCastAccumulateTechnique.js";import{TaskPriority as C}from"../../../support/Scheduler.js";import{TargetType as F,DepthStencilTargetType as E,TextureType as P,PixelFormat as q,PixelType as x,TextureSamplingMode as M,TextureWrapMode as U,ClearBufferBit as O}from"../../../webgl/enums.js";import{FramebufferObject as L}from"../../../webgl/FramebufferObject.js";import{vertexCount as B}from"../../../webgl/Util.js";var I;let N=I=class extends t{constructor(e,t,i,r,a,n){super({}),this._rctx=e,this._stage=i,this._prepareForShadowMapPass=r,this._renderToShadowMap=a,this._requestRender=n,this._progress=0,this._sampleCount=0,this._passParameters=new S,this._enabled=!1,this._cachedLightDirections=[],this._depthRange=w,this._previewing=!1,this._handles=new s,this._cameraForcedForScreenshot=!1,this._bindParameters=new g(new T(e,i.viewingMode),null,null),this._bindParameters.shadowMap.enabled=!0,this._bindParameters.camera=new f,this._vao=v(e);const _={colorTarget:F.TEXTURE,depthStencilTarget:E.NONE,width:0,height:0},l={target:P.TEXTURE_2D,pixelFormat:q.RGBA,dataType:x.UNSIGNED_BYTE,samplingMode:M.LINEAR,wrapMode:U.CLAMP_TO_EDGE,width:0,height:0};this._fbo=new L(e,_,l),this._accumulationRenderer=new b(t,e,this,n);const u=this._stage.resourceController.scheduler;this._handles.add(u.registerTask(C.SHADOW_ACCUMULATOR,this)),this._handles.add(h((()=>i.renderView),(e=>{this._handles.remove(I.renderViewHandleKey),o(e)||this._handles.add(e.events.on("force-camera-for-screenshot",(()=>this._cameraForcedForScreenshot=!0)),I.renderViewHandleKey)}),c))}normalizeCtorArgs(){return{}}get computedSamples(){return this._progress}get shadowCastTexture(){return this._fbo.colorTexture}get isAccumulating(){return this._isPreviewing||this._isRefining}get accumulationTechnique(){if(o(this._accumulationTechnique)){const e={rctx:this._rctx,viewingMode:this._stage.viewingMode};this._accumulationTechnique=new j(e,new d)}return this._accumulationTechnique}get _isRefining(){return this._isActive&&!this._isDoneAccumulating&&!this._previewing}get _isPreviewing(){return this._isActive&&this._previewing}get _isActive(){return this._enabled&&this._sampleCount>0}get canAccumulate(){return null!==this._passParameters.linearDepthTexture&&this._depthRange!==w&&this._opacityFromElevation>A}get _isDoneAccumulating(){return this._progress>=this._sampleCount}get _lightDirections(){return this._cachedLightDirections}set _lightDirections(e){const t=this._cachedLightDirections;if(i(t,e,u))return;const s=e.length;t.length=s,this._sampleCount=Math.min(D,s);for(let i=0;i<s;++i){const s=e[i],r=t[i]||p();m(r,s),t[i]=r}this._invalidate()}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get running(){return this._isRefining&&this.canAccumulate&&this._progress>0}runTask(e){for(this._prepareForShadowMapPass(this._bindParameters);!e.done&&!this._isDoneAccumulating;)this._accumulateShadow(),e.madeProgress();this._requestRender()}renderAccumulation(e,t,i,s){if(this._passParameters.linearDepthTexture=e,this._depthRange=t,this._updateCamera(i),this._bindParameters.contentCamera=s,this.notifyChange("canAccumulate"),!this.isAccumulating||!this.canAccumulate)return;(this._previewing||0===this._progress||this._cameraForcedForScreenshot)&&this._clear();const r=this._cameraForcedForScreenshot?this._sampleCount:Math.min(I.previewSamples,this._sampleCount-this._progress);for(let o=0;o<r;++o)this._accumulateShadow();this._cameraForcedForScreenshot=!1}render(e){this._accumulationRenderer.render(e)}dispose(){this._stop(),this._handles.destroy(),this._accumulationRenderer=a(this._accumulationRenderer),this._bindParameters.shadowMap.dispose(),this._fbo=a(this._fbo),this._vao=a(this._vao),this._accumulationTechnique=n(this._accumulationTechnique),this._cachedLightDirections.length=0,this._sampleCount=0}setOptions(e){void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.previewing&&(this.previewing=e.previewing),void 0!==e.lightDirections&&(this.lightDirections=e.lightDirections),this._accumulationRenderer.setOptions(e)}set previewing(e){this._previewing!==e&&(this._previewing=e,this._requestRenderIfEnabled())}set lightDirections(e){this._lightDirections=e}readAccumulatedShadow(e,t){if(!this._isActive||this._progress<1||e<0||e>this._fbo.width||t<0||t>this._fbo.height)return 0;const i=k;return this._fbo.readPixels(e,t,1,1,q.RGBA,x.UNSIGNED_BYTE,i),i[0]/this._progress}_start(){this._progress=0,this._enabled=!0}_stop(){this._enabled=!1}_invalidate(){this._progress=0,this._requestRenderIfEnabled()}_clear(){this._rctx.bindFramebuffer(this._fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clearSafe(O.COLOR_BUFFER_BIT),this._progress=0}_accumulateShadow(){const e=this._lightDirections[this._progress];this._renderToShadowMap(this._bindParameters,e,this._depthRange),this._passParameters.origin=this._bindParameters.camera.center,this._rctx.bindFramebuffer(this._fbo);const t=this.accumulationTechnique;this._rctx.bindTechnique(t,this._passParameters,this._bindParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(t.primitiveType,0,B(this._vao,"geometry")),this._progress++}_updateCamera(e){e.equals(this._bindParameters.camera)||(this._bindParameters.camera.copyFrom(e),this._fbo.resize(e.fullWidth,e.fullHeight),this._opacityFromElevation=1-r(R,y,e.relativeElevation))}set enabled(e){e!==this._enabled&&(e?this._start():this._stop())}_requestRenderIfEnabled(){this._enabled&&this._requestRender()}get test(){return{lightDirections:this._lightDirections,isDone:()=>this._isDoneAccumulating,isActive:()=>this._isActive}}};N.previewSamples=6,N.renderViewHandleKey="renderView",e([_()],N.prototype,"_progress",void 0),e([_()],N.prototype,"_sampleCount",void 0),e([_()],N.prototype,"_enabled",void 0),e([_()],N.prototype,"_depthRange",void 0),e([_()],N.prototype,"_previewing",void 0),e([_()],N.prototype,"_accumulationRenderer",void 0),e([_()],N.prototype,"_isRefining",null),e([_()],N.prototype,"_isActive",null),e([_()],N.prototype,"canAccumulate",null),e([_()],N.prototype,"_isDoneAccumulating",null),e([_()],N.prototype,"_opacityFromElevation",null),e([_()],N.prototype,"running",null),N=I=e([l("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],N);const k=new Uint8Array(4);export{N as ShadowAccumulator};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{smoothstep as t,clamp as s}from"../../../../core/mathUtils.js";import{isNone as e,disposeMaybe as i,releaseMaybe as a}from"../../../../core/maybe.js";import{n as r,s as h,e as o}from"../../../../chunks/vec3.js";import{c as n}from"../../../../chunks/vec3f64.js";import{ViewingMode as c}from"../../../ViewingMode.js";import{ReadShadowMapBindParameters as m}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{createQuadVAO as p}from"./glUtil3D.js";import{ShadowHighlightPassParameters as _,ShadowHighlightTechnique as d}from"../shaders/ShadowHighlightTechnique.js";import{vertexCount as l}from"../../../webgl/Util.js";const u=.001953125,g=4e4,w=5e4;class v{constructor(t,s){this._rctx=t,this._viewingMode=s,this._maxOpacity=1,this._passParameters=new _,this._drawParameters=new m,this._vao=p(this._rctx)}get technique(){return e(this._technique)&&(this._technique=new d({rctx:this._rctx,viewingMode:this._viewingMode})),this._technique}render(t,s){if(!t.shadowMap.enabled||!t.linearDepthTexture||!this.isVisible)return;const e=this.technique;this._drawParameters.origin=t.camera.center,this._rctx.bindFramebuffer(s),this._rctx.bindTechnique(e,this._passParameters,t).bindDraw(this._drawParameters,t),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(e.primitiveType,0,l(this._vao,"geometry"))}get gpuMemoryUsage(){var t,s;return null!=(t=null==(s=this._vao)?void 0:s.size)?t:0}setDefaultOptions(t){this._passParameters={...this._passParameters,...t},this._updateMaxOpacity()}updateParameters(e,i){this._passParameters.opacityElevation=1-t(g,w,e.relativeElevation);const a=this._viewingMode===c.Global?r(y,e.center):h(y,0,0,1),n=o(a,i);this._passParameters.dayNightTerminator=t(0,1,s(30*n,0,1))}dispose(){this._vao=i(this._vao),this._technique=a(this._technique)}get isVisible(){const{opacityElevation:t,dayNightTerminator:s}=this._passParameters;return this._maxOpacity*t*s>=u}_updateMaxOpacity(){const t=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity);this._maxOpacity=t*this._passParameters.shadowColor[3]}}const y=n();export{v as ShadowHighlight};
5
+ import{smoothstep as t,clamp as s}from"../../../../core/mathUtils.js";import{isNone as e,disposeMaybe as i,releaseMaybe as a}from"../../../../core/maybe.js";import{n as r,s as h,e as o}from"../../../../chunks/vec3.js";import{c}from"../../../../chunks/vec3f64.js";import{ViewingMode as n}from"../../../ViewingMode.js";import{ReadShadowMapBindParameters as m}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{createQuadVAO as p}from"./glUtil3D.js";import{ShadowHighlightPassParameters as _,ShadowHighlightTechnique as d}from"../shaders/ShadowHighlightTechnique.js";import{vertexCount as u}from"../../../webgl/Util.js";const l=.001953125,g=4e4,w=5e4;class v{constructor(t,s){this._rctx=t,this._viewingMode=s,this._maxOpacity=1,this._passParameters=new _,this._drawParameters=new m,this._vao=p(this._rctx)}get technique(){return e(this._technique)&&(this._technique=new d({rctx:this._rctx,viewingMode:this._viewingMode})),this._technique}render(t,s){if(!t.shadowMap.enabled||!t.linearDepthTexture||!this.isVisible)return;const e=this.technique;this._drawParameters.origin=t.camera.center,this._rctx.bindFramebuffer(s),this._rctx.bindTechnique(e,this._passParameters,t).bindDraw(this._drawParameters,t),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(e.primitiveType,0,u(this._vao,"geometry"))}get gpuMemoryUsage(){return this._vao?.size??0}setDefaultOptions(t){this._passParameters={...this._passParameters,...t},this._updateMaxOpacity()}updateParameters(e,i){this._passParameters.opacityElevation=1-t(g,w,e.relativeElevation);const a=this._viewingMode===n.Global?r(y,e.center):h(y,0,0,1),c=o(a,i);this._passParameters.dayNightTerminator=t(0,1,s(30*c,0,1))}dispose(){this._vao=i(this._vao),this._technique=a(this._technique)}get isVisible(){const{opacityElevation:t,dayNightTerminator:s}=this._passParameters;return this._maxOpacity*t*s>=l}_updateMaxOpacity(){const t=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity);this._maxOpacity=t*this._passParameters.shadowColor[3]}}const y=c();export{v as ShadowHighlight};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t,acosClamped as e,lerp as s}from"../../../../core/mathUtils.js";import{isSome as a,disposeMaybe as i}from"../../../../core/maybe.js";import{c as r}from"../../../../chunks/mat3f64.js";import{j as h,m as c,q as o,a as n,n as u}from"../../../../chunks/mat4.js";import{c as m}from"../../../../chunks/mat4f64.js";import{b as d,f as p,g as l,l as _,s as f,h as x,i as g,n as T,j as S,c as b}from"../../../../chunks/vec2.js";import{a as w}from"../../../../chunks/vec2f64.js";import{k as M,c as C,o as D,m as E,s as j}from"../../../../chunks/vec3.js";import{c as v}from"../../../../chunks/vec3f64.js";import{s as z,t as R}from"../../../../chunks/vec4.js";import{c as U}from"../../../../chunks/vec4f64.js";import{ViewingMode as F}from"../../../ViewingMode.js";import{Camera as y}from"./Camera.js";import{assert as N,logWithBase as O,verify as A,rayRay2D as k}from"./Util.js";import{TextureType as L,ClearBufferBit as P,PixelFormat as B,PixelType as G,TextureWrapMode as I,TextureSamplingMode as X,TargetType as H,DepthStencilTargetType as q}from"../../../webgl/enums.js";import{FramebufferObject as Y}from"../../../webgl/FramebufferObject.js";import{Texture as V}from"../../../webgl/Texture.js";import{getGpuMemoryUsage as W}from"../../../webgl/Util.js";var J;!function(t){t[t.Highlight=0]="Highlight",t[t.Default=1]="Default"}(J||(J={}));class K{constructor(){this.camera=new y,this.lightMat=m()}}class Q{constructor(t,e,s=0){this.rctx=t,this.viewingMode=e,this._enabled=!1,this._snapshots=new Array,this._textureSize=0,this.maxTextureSize=0,this.numCascades=1,this.maxNumCascades=4,this.splitSchemeLambda=0,this.warp=!0,this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=U(),this._cascades=[new K,new K,new K,new K],this.maxTextureSize=this.rctx.parameters.maxTextureSize,this.snapshotCount=s}get depthTexture(){return this._depthTexture}get textureSize(){return this._textureSize}get cascadeDistances(){return z(this._usedCascadeDistances,this._cascadeDistances[0],this.numCascades>1?this._cascadeDistances[1]:1/0,this.numCascades>2?this._cascadeDistances[2]:1/0,this.numCascades>3?this._cascadeDistances[3]:1/0)}dispose(){this._discardDepthTexture(),this._discardAllSnapshots()}set maxCascades(e){this.maxNumCascades=t(Math.floor(e),1,4)}get maxCascades(){return this.maxNumCascades}set enabled(t){this._enabled=t,t||(this._discardDepthTexture(),this._discardAllSnapshots())}get enabled(){return this._enabled}get ready(){return this._enabled&&a(this._depthTexture)}get snapshotCount(){return this._snapshots.length}set snapshotCount(t){const e=this._snapshots.length;if(t>e){const s=t-e;this._snapshots.length=t;for(let t=0;t<s;++t)this._snapshots[e+t]=null}else if(t<this.snapshotCount){const s=e-t;for(let e=0;e<s;++e)this._discardSnapshot(t+e);this._snapshots.length=t}}getSnapshot(t){return this.enabled?this._snapshots[t]:null}getCascades(){for(let t=0;t<this.numCascades;++t)dt[t]=this._cascades[t];return dt.length=this.numCascades,dt}start(t,e,s){N(this.enabled),this._textureSize=this._computeTextureSize(t.fullWidth,t.fullHeight),this._ensureDepthTexture();const{near:a,far:i}=this._clampNearFar(s);this._computeCascadeDistances(i,a),this._setupMatrices(t,e);const r=t.viewMatrix,h=t.projectionMatrix;for(let c=0;c<this.numCascades;++c)this._constructCascade(c,h,r,e);this.lastOrigin=null,this.clear()}finish(t){N(this.enabled),this.rctx.bindFramebuffer(t)}getShadowMapMatrices(t){if(!this.lastOrigin||!M(t,this.lastOrigin)){this.lastOrigin=this.lastOrigin||v(),C(this.lastOrigin,t);for(let e=0;e<this.numCascades;++e){h(pt,this._cascades[e].lightMat,t);for(let t=0;t<16;++t)lt[16*e+t]=pt[t]}}return lt}takeCascadeSnapshotTo(t,e){N(this.enabled);const s=this._ensureSnapshot(e);this._bindFbo();const a=this.rctx,i=a.bindTexture(s,V.TEXTURE_UNIT_FOR_UPDATES);a.gl.copyTexSubImage2D(L.TEXTURE_2D,0,t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[2],t.camera.viewport[3]),a.bindTexture(i,V.TEXTURE_UNIT_FOR_UPDATES)}clear(){const t=this.rctx;this._bindFbo(),t.setClearColor(1,1,1,1),t.clearSafe(P.COLOR_BUFFER_BIT|P.DEPTH_BUFFER_BIT)}_computeTextureSize(t,e){const s=.5*Math.log(t*t+e*e)*Math.LOG2E,a=.35,i=2**Math.round(s+a);return Math.min(this.maxTextureSize,2*i)}_ensureDepthTexture(){if(a(this._depthTexture)&&this._depthTexture.descriptor.width===this._textureSize)return;this._discardDepthTexture();const t={target:L.TEXTURE_2D,pixelFormat:B.RGBA,dataType:G.UNSIGNED_BYTE,wrapMode:I.CLAMP_TO_EDGE,samplingMode:X.NEAREST,flipped:!0,width:this._textureSize,height:this._textureSize};this._depthTexture=new V(this.rctx,t),this._fbo=new Y(this.rctx,{colorTarget:H.TEXTURE,depthStencilTarget:q.DEPTH_RENDER_BUFFER,width:this._textureSize,height:this._textureSize},this._depthTexture)}_ensureSnapshot(t){let e=this._snapshots[t];if(a(e)&&e.descriptor.width===this._textureSize)return e;this._discardSnapshot(t);const s={target:L.TEXTURE_2D,pixelFormat:B.RGBA,dataType:G.UNSIGNED_BYTE,wrapMode:I.CLAMP_TO_EDGE,samplingMode:X.NEAREST,flipped:!0,width:this._textureSize,height:this._textureSize};return e=new V(this.rctx,s),this._snapshots[t]=e,e}_discardDepthTexture(){this._fbo=i(this._fbo),this._depthTexture=i(this._depthTexture)}_discardSnapshot(t){this._snapshots[t]=i(this._snapshots[t])}_discardAllSnapshots(){for(let t=0;t<this.snapshotCount;++t)this._discardSnapshot(t)}_bindFbo(){const t=this.rctx;t.unbindTexture(this._depthTexture),t.bindFramebuffer(this._fbo)}_constructCascade(t,e,s,a){const i=this._cascades[t],r=-this._cascadeDistances[t],o=-this._cascadeDistances[t+1],n=(e[10]*r+e[14])/Math.abs(e[11]*r+e[15]),u=(e[10]*o+e[14])/Math.abs(e[11]*o+e[15]);N(n<u);for(let h=0;h<8;++h){z(et,h%4==0||h%4==3?-1:1,h%4==0||h%4==1?-1:1,h<4?n:u,1),R(st[h],et,tt);for(let t=0;t<3;++t)st[h][t]/=st[h][3]}D(mt,st[0]),h(Z,ut,mt),i.camera.viewMatrix=Z;for(let h=0;h<8;++h)E(st[h],st[h],i.camera.viewMatrix);C(at,st[0]),C(it,st[0]);for(let h=1;h<8;++h)for(let t=0;t<3;++t)at[t]=Math.min(at[t],st[h][t]),it[t]=Math.max(it[t],st[h][t]);at[2]-=200,it[2]+=200,i.camera.near=-it[2],i.camera.far=-at[2],this.warp?this._constructTrapezoidalProjection(s,a,i):this._constructOrthogonalProjection(i),c(i.lightMat,i.camera.projectionMatrix,i.camera.viewMatrix);const m=this._textureSize/2;i.camera.viewport[0]=t%2==0?0:m,i.camera.viewport[1]=0===Math.floor(t/2)?0:m,i.camera.viewport[2]=m,i.camera.viewport[3]=m}_constructOrthogonalProjection(t){o(t.camera.projectionMatrix,at[0],it[0],at[1],it[1],t.camera.near,t.camera.far)}_constructTrapezoidalProjection(t,s,a){const i=1/st[0][3],r=1/st[4][3];N(i<r);let h=i+Math.sqrt(i*r);const c=Math.sin(e(t[2]*s[0]+t[6]*s[1]+t[10]*s[2]));h/=c,Dt(st,h,c,rt,ht,ct,ot,nt),Ut(rt,ht,ot,nt,a.camera.projectionMatrix),a.camera.projectionMatrix[10]=2/(at[2]-it[2]),a.camera.projectionMatrix[14]=-(at[2]+it[2])/(at[2]-it[2])}_setupMatrices(t,e){c($,t.projectionMatrix,t.viewMatrix),n(tt,$);const s=this.viewingMode===F.Global?t.eye:j(mt,0,0,1);u(ut,[0,0,0],[-e[0],-e[1],-e[2]],s)}_clampNearFar(t){let{near:e,far:s}=t;return e<2&&(e=2),s<2&&(s=2),e>=s&&(e=2,s=4),{near:e,far:s}}_computeCascadeDistances(t,e){this.numCascades=Math.min(1+Math.floor(O(t/e,4)),this.maxNumCascades);const a=(t-e)/this.numCascades,i=(t/e)**(1/this.numCascades);let r=e,h=e;for(let c=0;c<this.numCascades+1;++c)this._cascadeDistances[c]=s(r,h,this.splitSchemeLambda),r*=i,h+=a}get gpuMemoryUsage(){var t,e;return this._snapshots.reduce(((t,e)=>t+W(e)),null!=(t=null==(e=this._fbo)?void 0:e.gpuMemoryUsage)?t:0)}get test(){const t=this;return{maxNumCascades:this.maxNumCascades,cascades:this._cascades,textureSize:this._textureSize,set splitSchemeLambda(e){t.splitSchemeLambda=e},get splitSchemeLambda(){return t.splitSchemeLambda},set warp(e){t.warp=e},get warp(){return t.warp}}}}const Z=m(),$=m(),tt=m(),et=U(),st=[];for(let Ft=0;Ft<8;++Ft)st.push(U());const at=v(),it=v(),rt=w(),ht=w(),ct=w(),ot=w(),nt=w(),ut=m(),mt=v(),dt=[],pt=m(),lt=new Float32Array(64),_t=w(),ft=w(),xt=[w(),w(),w(),w()],gt=w(),Tt=w(),St=w(),bt=w(),wt=w(),Mt=w(),Ct=w();function Dt(t,e,s,a,i,r,h,c){d(_t,0,0);for(let d=0;d<4;++d)p(_t,_t,t[d]);l(_t,_t,.25),d(ft,0,0);for(let d=4;d<8;++d)p(ft,ft,t[d]);l(ft,ft,.25),_(xt[0],t[4],t[5],.5),_(xt[1],t[5],t[6],.5),_(xt[2],t[6],t[7],.5),_(xt[3],t[7],t[4],.5);let o=0,n=f(xt[0],_t);for(let d=1;d<4;++d){const t=f(xt[d],_t);t<n&&(n=t,o=d)}x(gt,xt[o],t[o+4]);const u=gt[0];let m,w;gt[0]=-gt[1],gt[1]=u,x(Tt,ft,_t),g(Tt,gt)<0&&T(gt,gt),_(gt,gt,Tt,s),S(gt,gt),m=w=g(x(St,t[0],_t),gt);for(let d=1;d<8;++d){const e=g(x(St,t[d],_t),gt);e<m?m=e:e>w&&(w=e)}b(a,_t),l(St,gt,m-e),p(a,a,St);let M=-1,C=1,D=0,E=0;for(let d=0;d<8;++d){x(bt,t[d],a),S(bt,bt);const e=gt[0]*bt[1]-gt[1]*bt[0];e>0?e>M&&(M=e,D=d):e<C&&(C=e,E=d)}A(M>0,"leftArea"),A(C<0,"rightArea"),l(wt,gt,m),p(wt,wt,_t),l(Mt,gt,w),p(Mt,Mt,_t),Ct[0]=-gt[1],Ct[1]=gt[0];const j=k(a,t[E],Mt,p(St,Mt,Ct),1,i),v=k(a,t[D],Mt,St,1,r),z=k(a,t[D],wt,p(St,wt,Ct),1,h),R=k(a,t[E],wt,St,1,c);A(j,"rayRay"),A(v,"rayRay"),A(z,"rayRay"),A(R,"rayRay")}function Et(t,e){return 3*e+t}const jt=w();function vt(t,e){return d(jt,t[e],t[e+3]),jt}const zt=w(),Rt=r();function Ut(t,e,s,a,i){x(zt,s,a),l(zt,zt,.5),Rt[0]=zt[0],Rt[1]=zt[1],Rt[2]=0,Rt[3]=zt[1],Rt[4]=-zt[0],Rt[5]=0,Rt[6]=zt[0]*zt[0]+zt[1]*zt[1],Rt[7]=zt[0]*zt[1]-zt[1]*zt[0],Rt[8]=1,Rt[Et(0,2)]=-g(vt(Rt,0),t),Rt[Et(1,2)]=-g(vt(Rt,1),t);let r=g(vt(Rt,0),s)+Rt[Et(0,2)],h=g(vt(Rt,1),s)+Rt[Et(1,2)],c=g(vt(Rt,0),a)+Rt[Et(0,2)],o=g(vt(Rt,1),a)+Rt[Et(1,2)];r=-(r+c)/(h+o),Rt[Et(0,0)]+=Rt[Et(1,0)]*r,Rt[Et(0,1)]+=Rt[Et(1,1)]*r,Rt[Et(0,2)]+=Rt[Et(1,2)]*r,r=1/(g(vt(Rt,0),s)+Rt[Et(0,2)]),h=1/(g(vt(Rt,1),s)+Rt[Et(1,2)]),Rt[Et(0,0)]*=r,Rt[Et(0,1)]*=r,Rt[Et(0,2)]*=r,Rt[Et(1,0)]*=h,Rt[Et(1,1)]*=h,Rt[Et(1,2)]*=h,Rt[Et(2,0)]=Rt[Et(1,0)],Rt[Et(2,1)]=Rt[Et(1,1)],Rt[Et(2,2)]=Rt[Et(1,2)],Rt[Et(1,2)]+=1,r=g(vt(Rt,1),e)+Rt[Et(1,2)],h=g(vt(Rt,2),e)+Rt[Et(2,2)],c=g(vt(Rt,1),s)+Rt[Et(1,2)],o=g(vt(Rt,2),s)+Rt[Et(2,2)],r=-.5*(r/h+c/o),Rt[Et(1,0)]+=Rt[Et(2,0)]*r,Rt[Et(1,1)]+=Rt[Et(2,1)]*r,Rt[Et(1,2)]+=Rt[Et(2,2)]*r,r=g(vt(Rt,1),e)+Rt[Et(1,2)],h=g(vt(Rt,2),e)+Rt[Et(2,2)],c=-h/r,Rt[Et(1,0)]*=c,Rt[Et(1,1)]*=c,Rt[Et(1,2)]*=c,i[0]=Rt[0],i[1]=Rt[1],i[2]=0,i[3]=Rt[2],i[4]=Rt[3],i[5]=Rt[4],i[6]=0,i[7]=Rt[5],i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=Rt[6],i[13]=Rt[7],i[14]=0,i[15]=Rt[8]}export{Q as ShadowMap,J as SnapshotSlot};
5
+ import{clamp as t,acosClamped as e,lerp as s}from"../../../../core/mathUtils.js";import{isSome as a,disposeMaybe as i}from"../../../../core/maybe.js";import{c as r}from"../../../../chunks/mat3f64.js";import{j as h,m as c,q as o,a as n,n as u}from"../../../../chunks/mat4.js";import{c as m}from"../../../../chunks/mat4f64.js";import{b as d,f as p,g as l,l as _,s as f,h as x,i as g,n as T,j as S,c as b}from"../../../../chunks/vec2.js";import{a as w}from"../../../../chunks/vec2f64.js";import{k as M,c as C,o as D,m as E,s as j}from"../../../../chunks/vec3.js";import{c as v}from"../../../../chunks/vec3f64.js";import{s as z,t as R}from"../../../../chunks/vec4.js";import{c as U}from"../../../../chunks/vec4f64.js";import{ViewingMode as F}from"../../../ViewingMode.js";import{Camera as y}from"./Camera.js";import{assert as N,logWithBase as O,verify as A,rayRay2D as k}from"./Util.js";import{TextureType as L,ClearBufferBit as P,PixelFormat as B,PixelType as G,TextureWrapMode as I,TextureSamplingMode as X,TargetType as H,DepthStencilTargetType as q}from"../../../webgl/enums.js";import{FramebufferObject as Y}from"../../../webgl/FramebufferObject.js";import{Texture as V}from"../../../webgl/Texture.js";import{getGpuMemoryUsage as W}from"../../../webgl/Util.js";var J;!function(t){t[t.Highlight=0]="Highlight",t[t.Default=1]="Default"}(J||(J={}));class K{constructor(){this.camera=new y,this.lightMat=m()}}class Q{constructor(t,e,s=0){this.rctx=t,this.viewingMode=e,this._enabled=!1,this._snapshots=new Array,this._textureSize=0,this.maxTextureSize=0,this.numCascades=1,this.maxNumCascades=4,this.splitSchemeLambda=0,this.warp=!0,this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=U(),this._cascades=[new K,new K,new K,new K],this.maxTextureSize=this.rctx.parameters.maxTextureSize,this.snapshotCount=s}get depthTexture(){return this._depthTexture}get textureSize(){return this._textureSize}get cascadeDistances(){return z(this._usedCascadeDistances,this._cascadeDistances[0],this.numCascades>1?this._cascadeDistances[1]:1/0,this.numCascades>2?this._cascadeDistances[2]:1/0,this.numCascades>3?this._cascadeDistances[3]:1/0)}dispose(){this._discardDepthTexture(),this._discardAllSnapshots()}set maxCascades(e){this.maxNumCascades=t(Math.floor(e),1,4)}get maxCascades(){return this.maxNumCascades}set enabled(t){this._enabled=t,t||(this._discardDepthTexture(),this._discardAllSnapshots())}get enabled(){return this._enabled}get ready(){return this._enabled&&a(this._depthTexture)}get snapshotCount(){return this._snapshots.length}set snapshotCount(t){const e=this._snapshots.length;if(t>e){const s=t-e;this._snapshots.length=t;for(let t=0;t<s;++t)this._snapshots[e+t]=null}else if(t<this.snapshotCount){const s=e-t;for(let e=0;e<s;++e)this._discardSnapshot(t+e);this._snapshots.length=t}}getSnapshot(t){return this.enabled?this._snapshots[t]:null}getCascades(){for(let t=0;t<this.numCascades;++t)dt[t]=this._cascades[t];return dt.length=this.numCascades,dt}start(t,e,s){N(this.enabled),this._textureSize=this._computeTextureSize(t.fullWidth,t.fullHeight),this._ensureDepthTexture();const{near:a,far:i}=this._clampNearFar(s);this._computeCascadeDistances(i,a),this._setupMatrices(t,e);const r=t.viewMatrix,h=t.projectionMatrix;for(let c=0;c<this.numCascades;++c)this._constructCascade(c,h,r,e);this.lastOrigin=null,this.clear()}finish(t){N(this.enabled),this.rctx.bindFramebuffer(t)}getShadowMapMatrices(t){if(!this.lastOrigin||!M(t,this.lastOrigin)){this.lastOrigin=this.lastOrigin||v(),C(this.lastOrigin,t);for(let e=0;e<this.numCascades;++e){h(pt,this._cascades[e].lightMat,t);for(let t=0;t<16;++t)lt[16*e+t]=pt[t]}}return lt}takeCascadeSnapshotTo(t,e){N(this.enabled);const s=this._ensureSnapshot(e);this._bindFbo();const a=this.rctx,i=a.bindTexture(s,V.TEXTURE_UNIT_FOR_UPDATES);a.gl.copyTexSubImage2D(L.TEXTURE_2D,0,t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[2],t.camera.viewport[3]),a.bindTexture(i,V.TEXTURE_UNIT_FOR_UPDATES)}clear(){const t=this.rctx;this._bindFbo(),t.setClearColor(1,1,1,1),t.clearSafe(P.COLOR_BUFFER_BIT|P.DEPTH_BUFFER_BIT)}_computeTextureSize(t,e){const s=.5*Math.log(t*t+e*e)*Math.LOG2E,a=.35,i=2**Math.round(s+a);return Math.min(this.maxTextureSize,2*i)}_ensureDepthTexture(){if(a(this._depthTexture)&&this._depthTexture.descriptor.width===this._textureSize)return;this._discardDepthTexture();const t={target:L.TEXTURE_2D,pixelFormat:B.RGBA,dataType:G.UNSIGNED_BYTE,wrapMode:I.CLAMP_TO_EDGE,samplingMode:X.NEAREST,flipped:!0,width:this._textureSize,height:this._textureSize};this._depthTexture=new V(this.rctx,t),this._fbo=new Y(this.rctx,{colorTarget:H.TEXTURE,depthStencilTarget:q.DEPTH_RENDER_BUFFER,width:this._textureSize,height:this._textureSize},this._depthTexture)}_ensureSnapshot(t){let e=this._snapshots[t];if(a(e)&&e.descriptor.width===this._textureSize)return e;this._discardSnapshot(t);const s={target:L.TEXTURE_2D,pixelFormat:B.RGBA,dataType:G.UNSIGNED_BYTE,wrapMode:I.CLAMP_TO_EDGE,samplingMode:X.NEAREST,flipped:!0,width:this._textureSize,height:this._textureSize};return e=new V(this.rctx,s),this._snapshots[t]=e,e}_discardDepthTexture(){this._fbo=i(this._fbo),this._depthTexture=i(this._depthTexture)}_discardSnapshot(t){this._snapshots[t]=i(this._snapshots[t])}_discardAllSnapshots(){for(let t=0;t<this.snapshotCount;++t)this._discardSnapshot(t)}_bindFbo(){const t=this.rctx;t.unbindTexture(this._depthTexture),t.bindFramebuffer(this._fbo)}_constructCascade(t,e,s,a){const i=this._cascades[t],r=-this._cascadeDistances[t],o=-this._cascadeDistances[t+1],n=(e[10]*r+e[14])/Math.abs(e[11]*r+e[15]),u=(e[10]*o+e[14])/Math.abs(e[11]*o+e[15]);N(n<u);for(let h=0;h<8;++h){z(et,h%4==0||h%4==3?-1:1,h%4==0||h%4==1?-1:1,h<4?n:u,1),R(st[h],et,tt);for(let t=0;t<3;++t)st[h][t]/=st[h][3]}D(mt,st[0]),h(Z,ut,mt),i.camera.viewMatrix=Z;for(let h=0;h<8;++h)E(st[h],st[h],i.camera.viewMatrix);C(at,st[0]),C(it,st[0]);for(let h=1;h<8;++h)for(let t=0;t<3;++t)at[t]=Math.min(at[t],st[h][t]),it[t]=Math.max(it[t],st[h][t]);at[2]-=200,it[2]+=200,i.camera.near=-it[2],i.camera.far=-at[2],this.warp?this._constructTrapezoidalProjection(s,a,i):this._constructOrthogonalProjection(i),c(i.lightMat,i.camera.projectionMatrix,i.camera.viewMatrix);const m=this._textureSize/2;i.camera.viewport[0]=t%2==0?0:m,i.camera.viewport[1]=0===Math.floor(t/2)?0:m,i.camera.viewport[2]=m,i.camera.viewport[3]=m}_constructOrthogonalProjection(t){o(t.camera.projectionMatrix,at[0],it[0],at[1],it[1],t.camera.near,t.camera.far)}_constructTrapezoidalProjection(t,s,a){const i=1/st[0][3],r=1/st[4][3];N(i<r);let h=i+Math.sqrt(i*r);const c=Math.sin(e(t[2]*s[0]+t[6]*s[1]+t[10]*s[2]));h/=c,Dt(st,h,c,rt,ht,ct,ot,nt),Ut(rt,ht,ot,nt,a.camera.projectionMatrix),a.camera.projectionMatrix[10]=2/(at[2]-it[2]),a.camera.projectionMatrix[14]=-(at[2]+it[2])/(at[2]-it[2])}_setupMatrices(t,e){c($,t.projectionMatrix,t.viewMatrix),n(tt,$);const s=this.viewingMode===F.Global?t.eye:j(mt,0,0,1);u(ut,[0,0,0],[-e[0],-e[1],-e[2]],s)}_clampNearFar(t){let{near:e,far:s}=t;return e<2&&(e=2),s<2&&(s=2),e>=s&&(e=2,s=4),{near:e,far:s}}_computeCascadeDistances(t,e){this.numCascades=Math.min(1+Math.floor(O(t/e,4)),this.maxNumCascades);const a=(t-e)/this.numCascades,i=(t/e)**(1/this.numCascades);let r=e,h=e;for(let c=0;c<this.numCascades+1;++c)this._cascadeDistances[c]=s(r,h,this.splitSchemeLambda),r*=i,h+=a}get gpuMemoryUsage(){return this._snapshots.reduce(((t,e)=>t+W(e)),this._fbo?.gpuMemoryUsage??0)}get test(){const t=this;return{maxNumCascades:this.maxNumCascades,cascades:this._cascades,textureSize:this._textureSize,set splitSchemeLambda(e){t.splitSchemeLambda=e},get splitSchemeLambda(){return t.splitSchemeLambda},set warp(e){t.warp=e},get warp(){return t.warp}}}}const Z=m(),$=m(),tt=m(),et=U(),st=[];for(let Ft=0;Ft<8;++Ft)st.push(U());const at=v(),it=v(),rt=w(),ht=w(),ct=w(),ot=w(),nt=w(),ut=m(),mt=v(),dt=[],pt=m(),lt=new Float32Array(64),_t=w(),ft=w(),xt=[w(),w(),w(),w()],gt=w(),Tt=w(),St=w(),bt=w(),wt=w(),Mt=w(),Ct=w();function Dt(t,e,s,a,i,r,h,c){d(_t,0,0);for(let d=0;d<4;++d)p(_t,_t,t[d]);l(_t,_t,.25),d(ft,0,0);for(let d=4;d<8;++d)p(ft,ft,t[d]);l(ft,ft,.25),_(xt[0],t[4],t[5],.5),_(xt[1],t[5],t[6],.5),_(xt[2],t[6],t[7],.5),_(xt[3],t[7],t[4],.5);let o=0,n=f(xt[0],_t);for(let d=1;d<4;++d){const t=f(xt[d],_t);t<n&&(n=t,o=d)}x(gt,xt[o],t[o+4]);const u=gt[0];let m,w;gt[0]=-gt[1],gt[1]=u,x(Tt,ft,_t),g(Tt,gt)<0&&T(gt,gt),_(gt,gt,Tt,s),S(gt,gt),m=w=g(x(St,t[0],_t),gt);for(let d=1;d<8;++d){const e=g(x(St,t[d],_t),gt);e<m?m=e:e>w&&(w=e)}b(a,_t),l(St,gt,m-e),p(a,a,St);let M=-1,C=1,D=0,E=0;for(let d=0;d<8;++d){x(bt,t[d],a),S(bt,bt);const e=gt[0]*bt[1]-gt[1]*bt[0];e>0?e>M&&(M=e,D=d):e<C&&(C=e,E=d)}A(M>0,"leftArea"),A(C<0,"rightArea"),l(wt,gt,m),p(wt,wt,_t),l(Mt,gt,w),p(Mt,Mt,_t),Ct[0]=-gt[1],Ct[1]=gt[0];const j=k(a,t[E],Mt,p(St,Mt,Ct),1,i),v=k(a,t[D],Mt,St,1,r),z=k(a,t[D],wt,p(St,wt,Ct),1,h),R=k(a,t[E],wt,St,1,c);A(j,"rayRay"),A(v,"rayRay"),A(z,"rayRay"),A(R,"rayRay")}function Et(t,e){return 3*e+t}const jt=w();function vt(t,e){return d(jt,t[e],t[e+3]),jt}const zt=w(),Rt=r();function Ut(t,e,s,a,i){x(zt,s,a),l(zt,zt,.5),Rt[0]=zt[0],Rt[1]=zt[1],Rt[2]=0,Rt[3]=zt[1],Rt[4]=-zt[0],Rt[5]=0,Rt[6]=zt[0]*zt[0]+zt[1]*zt[1],Rt[7]=zt[0]*zt[1]-zt[1]*zt[0],Rt[8]=1,Rt[Et(0,2)]=-g(vt(Rt,0),t),Rt[Et(1,2)]=-g(vt(Rt,1),t);let r=g(vt(Rt,0),s)+Rt[Et(0,2)],h=g(vt(Rt,1),s)+Rt[Et(1,2)],c=g(vt(Rt,0),a)+Rt[Et(0,2)],o=g(vt(Rt,1),a)+Rt[Et(1,2)];r=-(r+c)/(h+o),Rt[Et(0,0)]+=Rt[Et(1,0)]*r,Rt[Et(0,1)]+=Rt[Et(1,1)]*r,Rt[Et(0,2)]+=Rt[Et(1,2)]*r,r=1/(g(vt(Rt,0),s)+Rt[Et(0,2)]),h=1/(g(vt(Rt,1),s)+Rt[Et(1,2)]),Rt[Et(0,0)]*=r,Rt[Et(0,1)]*=r,Rt[Et(0,2)]*=r,Rt[Et(1,0)]*=h,Rt[Et(1,1)]*=h,Rt[Et(1,2)]*=h,Rt[Et(2,0)]=Rt[Et(1,0)],Rt[Et(2,1)]=Rt[Et(1,1)],Rt[Et(2,2)]=Rt[Et(1,2)],Rt[Et(1,2)]+=1,r=g(vt(Rt,1),e)+Rt[Et(1,2)],h=g(vt(Rt,2),e)+Rt[Et(2,2)],c=g(vt(Rt,1),s)+Rt[Et(1,2)],o=g(vt(Rt,2),s)+Rt[Et(2,2)],r=-.5*(r/h+c/o),Rt[Et(1,0)]+=Rt[Et(2,0)]*r,Rt[Et(1,1)]+=Rt[Et(2,1)]*r,Rt[Et(1,2)]+=Rt[Et(2,2)]*r,r=g(vt(Rt,1),e)+Rt[Et(1,2)],h=g(vt(Rt,2),e)+Rt[Et(2,2)],c=-h/r,Rt[Et(1,0)]*=c,Rt[Et(1,1)]*=c,Rt[Et(1,2)]*=c,i[0]=Rt[0],i[1]=Rt[1],i[2]=0,i[3]=Rt[2],i[4]=Rt[3],i[5]=Rt[4],i[6]=0,i[7]=Rt[5],i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=Rt[6],i[13]=Rt[7],i[14]=0,i[15]=Rt[8]}export{Q as ShadowMap,J as SnapshotSlot};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as t}from"../../../../core/compilerUtils.js";import e from"../../../../core/Error.js";import r from"../../../../core/Evented.js";import{isPowerOfTwo as i,nextHighestPowerOfTwo as s}from"../../../../core/mathUtils.js";import{isNone as a,isSome as o,removeMaybe as n}from"../../../../core/maybe.js";import{throwIfAborted as m,onAbort as h,createAbortError as l}from"../../../../core/promiseUtils.js";import{isArrayBuffer as p,isUint8Array as d}from"../../../../core/typedArrayUtil.js";import{isBlobProtocol as _,isDataProtocol as c}from"../../../../core/urlUtils.js";import{requestImage as u}from"../../../../support/requestImageUtils.js";import{loadImageAsync as T}from"../../../../support/requestUtils.js";import{PowerOfTwoResizeMode as g}from"./basicInterfaces.js";import{estimateMemoryKTX2 as f,estimateMemoryBasis as w,createTextureKTX2 as E,createTextureBasis as A}from"./BasisUtil.js";import{ContentObject as x}from"./ContentObject.js";import{ContentObjectType as D}from"./ContentObjectType.js";import{createDDSTexture as I}from"./DDSUtil.js";import{createQuadVAO as M}from"./glUtil3D.js";import{assert as F}from"./Util.js";import{TextureWrapMode as O,TextureType as N,PixelFormat as y,PixelType as R,TextureSamplingMode as U,TargetType as b,DepthStencilTargetType as C,PrimitiveType as P}from"../../../webgl/enums.js";import{FramebufferObject as S}from"../../../webgl/FramebufferObject.js";import{Texture as H}from"../../../webgl/Texture.js";import{vertexCount as V}from"../../../webgl/Util.js";import j from"../../../webgl/capabilities/isWebGL2Context.js";class v extends x{constructor(t,e){super(),this.data=t,this.type=D.Texture,this._glTexture=null,this._powerOfTwoStretchInfo=null,this._loadingPromise=null,this._loadingController=null,this.events=new r,this.params=e||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:O.REPEAT,t:O.REPEAT},this.params.powerOfTwoResizeMode=this.params.powerOfTwoResizeMode||g.STRETCH,this.estimatedTexMemRequired=v._estimateTexMemRequired(this.data,this.params),this._startPreload()}_startPreload(){const t=this.data;a(t)||(t instanceof HTMLVideoElement?this._startPreloadVideoElement(t):t instanceof HTMLImageElement&&this._startPreloadImageElement(t))}_startPreloadVideoElement(t){_(t.src)||"auto"===t.preload&&t.crossOrigin||(t.preload="auto",t.crossOrigin="anonymous",t.src=t.src)}_startPreloadImageElement(t){c(t.src)||_(t.src)||t.crossOrigin||(t.crossOrigin="anonymous",t.src=t.src)}static _getDataDimensions(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}static _estimateTexMemRequired(t,e){if(a(t))return 0;if(p(t)||d(t))return e.encoding===v.KTX2_ENCODING?f(t,e.mipmap):e.encoding===v.BASIS_ENCODING?w(t,e.mipmap):t.byteLength;const{width:r,height:i}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?v._getDataDimensions(t):e;return(e.mipmap?4/3:1)*r*i*(e.components||4)||0}dispose(){this.data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(t){var e;return{target:N.TEXTURE_2D,pixelFormat:y.RGBA,dataType:R.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?U.LINEAR_MIPMAP_LINEAR:U.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:null!=(e=this.params.maxAnisotropy)?e:this.params.mipmap?t.parameters.maxMaxAnisotropy:1}}get glTexture(){return this._glTexture}load(t,e){if(o(this._glTexture))return this._glTexture;if(o(this._loadingPromise))return this._loadingPromise;const r=this.data;return a(r)?(this._glTexture=new H(t,this._createDescriptor(t),null),this._glTexture):"string"==typeof r?this._loadFromURL(t,e,r):r instanceof Image?this._loadFromImageElement(t,e,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(t,e,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(t,r,e):(p(r)||d(r))&&this.params.encoding===v.DDS_ENCODING?(this.data=void 0,this._loadFromDDSData(t,r)):(p(r)||d(r))&&this.params.encoding===v.KTX2_ENCODING?(this.data=void 0,this._loadFromKTX2(t,r)):(p(r)||d(r))&&this.params.encoding===v.BASIS_ENCODING?(this.data=void 0,this._loadFromBasis(t,r)):d(r)?this._loadFromPixelData(t,r):p(r)?this._loadFromPixelData(t,new Uint8Array(r)):null}get requiresFrameUpdates(){return this.data instanceof HTMLVideoElement}frameUpdate(t,e,r){if(!(this.data instanceof HTMLVideoElement)||a(this._glTexture))return r;if(this.data.readyState<L.HAVE_CURRENT_DATA||r===this.data.currentTime)return r;if(o(this._powerOfTwoStretchInfo)){const{framebuffer:r,vao:i,sourceTexture:s}=this._powerOfTwoStretchInfo;s.setData(this.data),this._drawStretchedTexture(t,e,r,i,s,this._glTexture)}else{const{width:t,height:e}=this.data,{width:r,height:i}=this._glTexture.descriptor;t!==r||e!==i?this._glTexture.updateData(0,0,0,Math.min(t,r),Math.min(e,i),this.data):this._glTexture.setData(this.data)}return this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.data.currentTime}_loadFromDDSData(t,e){return this._glTexture=I(t,this._createDescriptor(t),e),this._glTexture}_loadFromKTX2(t,e){return this._loadAsync((()=>E(t,this._createDescriptor(t),e).then((t=>(this._glTexture=t,t)))))}_loadFromBasis(t,e){return this._loadAsync((()=>A(t,this._createDescriptor(t),e).then((t=>(this._glTexture=t,t)))))}_loadFromPixelData(t,e){F(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(t);return r.pixelFormat=1===this.params.components?y.LUMINANCE:3===this.params.components?y.RGB:y.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new H(t,r,e),this._glTexture}_loadFromURL(t,e,r){return this._loadAsync((async i=>{const s=await u(r,{signal:i});return m(i),this._loadFromImage(t,s,e)}))}_loadFromImageElement(t,e,r){return r.complete?this._loadFromImage(t,r,e):this._loadAsync((async i=>{const s=await T(r,r.src,!1,i);return m(i),this._loadFromImage(t,s,e)}))}_loadFromVideoElement(t,e,r){return r.readyState>=L.HAVE_CURRENT_DATA?this._loadFromImage(t,r,e):this._loadFromVideoElementAsync(t,e,r)}_loadFromVideoElementAsync(t,r,i){return this._loadAsync((s=>new Promise(((a,o)=>{const m=()=>{i.removeEventListener("loadeddata",p),i.removeEventListener("error",d),n(_)},p=()=>{i.readyState>=L.HAVE_CURRENT_DATA&&(m(),a(this._loadFromImage(t,i,r)))},d=t=>{m(),o(t||new e("Failed to load video"))};i.addEventListener("loadeddata",p),i.addEventListener("error",d);const _=h(s,(()=>d(l())))}))))}_loadFromImage(t,e,r){const s=v._getDataDimensions(e);this.params.width=s.width,this.params.height=s.height;const a=this._createDescriptor(t);return a.pixelFormat=3===this.params.components?y.RGB:y.RGBA,!this._requiresPowerOfTwo(t,a)||i(s.width)&&i(s.height)?(a.width=s.width,a.height=s.height,this._glTexture=new H(t,a,e),this._glTexture):(this._glTexture=this._makePowerOfTwoTexture(t,e,s,a,r),this._glTexture)}_loadAsync(t){const e=new AbortController;this._loadingController=e;const r=t(e.signal);this._loadingPromise=r;const i=()=>{this._loadingController===e&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}_requiresPowerOfTwo(t,e){const r=O.CLAMP_TO_EDGE,i="number"==typeof e.wrapMode?e.wrapMode===r:e.wrapMode.s===r&&e.wrapMode.t===r;return!j(t.gl)&&(e.hasMipmap||!i)}_makePowerOfTwoTexture(e,r,i,a,o){const{width:n,height:m}=i,h=s(n),l=s(m);let p;switch(a.width=h,a.height=l,this.params.powerOfTwoResizeMode){case g.PAD:a.textureCoordinateScaleFactor=[n/h,m/l],p=new H(e,a),p.updateData(0,0,0,n,m,r);break;case g.STRETCH:case null:case void 0:p=this._stretchToPowerOfTwo(e,r,a,o());break;default:t(this.params.powerOfTwoResizeMode)}return a.hasMipmap&&p.generateMipmap(),p}_stretchToPowerOfTwo(t,e,r,i){const s=new H(t,r),a=new S(t,{colorTarget:b.TEXTURE,depthStencilTarget:C.NONE},s),o=new H(t,{target:N.TEXTURE_2D,pixelFormat:r.pixelFormat,dataType:R.UNSIGNED_BYTE,wrapMode:O.CLAMP_TO_EDGE,samplingMode:U.LINEAR,flipped:!!r.flipped,maxAnisotropy:8,preMultiplyAlpha:r.preMultiplyAlpha},e),n=M(t),m=t.getBoundFramebufferObject();return this._drawStretchedTexture(t,i,a,n,o,s),this.requiresFrameUpdates?this._powerOfTwoStretchInfo={vao:n,sourceTexture:o,framebuffer:a}:(n.dispose(!0),o.dispose(),a.detachColorTexture(),a.dispose()),t.bindFramebuffer(m),s}_drawStretchedTexture(t,e,r,i,s,a){t.bindFramebuffer(r);const o=t.getViewport();t.setViewport(0,0,a.descriptor.width,a.descriptor.height);const n=t.bindTechnique(e);n.setUniform4f("uColor",1,1,1,1),n.bindTexture("tex",s),t.bindVAO(i),t.drawArrays(P.TRIANGLE_STRIP,0,V(i,"geometry")),t.bindFramebuffer(null),t.setViewport(o.x,o.y,o.width,o.height)}unload(){if(o(this._powerOfTwoStretchInfo)){const{framebuffer:t,vao:e,sourceTexture:r}=this._powerOfTwoStretchInfo;e.dispose(!0),r.dispose(),t.dispose(),this._glTexture=null,this._powerOfTwoStretchInfo=null}if(o(this._glTexture)&&(this._glTexture.dispose(),this._glTexture=null),o(this._loadingController)){const t=this._loadingController;this._loadingController=null,this._loadingPromise=null,t.abort()}this.events.emit("unloaded")}}var L;v.DDS_ENCODING="image/vnd-ms.dds",v.KTX2_ENCODING="image/ktx2",v.BASIS_ENCODING="image/x.basis",function(t){t[t.HAVE_NOTHING=0]="HAVE_NOTHING",t[t.HAVE_METADATA=1]="HAVE_METADATA",t[t.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",t[t.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",t[t.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"}(L||(L={}));export{v as Texture};
5
+ import{neverReached as t}from"../../../../core/compilerUtils.js";import e from"../../../../core/Error.js";import r from"../../../../core/Evented.js";import{isPowerOfTwo as i,nextHighestPowerOfTwo as s}from"../../../../core/mathUtils.js";import{isNone as a,isSome as o,removeMaybe as n}from"../../../../core/maybe.js";import{throwIfAborted as m,onAbort as h,createAbortError as l}from"../../../../core/promiseUtils.js";import{isArrayBuffer as p,isUint8Array as d}from"../../../../core/typedArrayUtil.js";import{isBlobProtocol as _,isDataProtocol as c}from"../../../../core/urlUtils.js";import{requestImage as u}from"../../../../support/requestImageUtils.js";import{loadImageAsync as T}from"../../../../support/requestUtils.js";import{PowerOfTwoResizeMode as g}from"./basicInterfaces.js";import{estimateMemoryKTX2 as f,estimateMemoryBasis as w,createTextureKTX2 as E,createTextureBasis as A}from"./BasisUtil.js";import{ContentObject as x}from"./ContentObject.js";import{ContentObjectType as D}from"./ContentObjectType.js";import{createDDSTexture as I}from"./DDSUtil.js";import{createQuadVAO as M}from"./glUtil3D.js";import{assert as F}from"./Util.js";import{TextureWrapMode as O,TextureType as N,PixelFormat as y,PixelType as R,TextureSamplingMode as U,TargetType as b,DepthStencilTargetType as C,PrimitiveType as P}from"../../../webgl/enums.js";import{FramebufferObject as S}from"../../../webgl/FramebufferObject.js";import{Texture as H}from"../../../webgl/Texture.js";import{vertexCount as V}from"../../../webgl/Util.js";import j from"../../../webgl/capabilities/isWebGL2Context.js";class L extends x{constructor(t,e){super(),this.data=t,this.type=D.Texture,this._glTexture=null,this._powerOfTwoStretchInfo=null,this._loadingPromise=null,this._loadingController=null,this.events=new r,this.params=e||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:O.REPEAT,t:O.REPEAT},this.params.powerOfTwoResizeMode=this.params.powerOfTwoResizeMode||g.STRETCH,this.estimatedTexMemRequired=L._estimateTexMemRequired(this.data,this.params),this._startPreload()}_startPreload(){const t=this.data;a(t)||(t instanceof HTMLVideoElement?this._startPreloadVideoElement(t):t instanceof HTMLImageElement&&this._startPreloadImageElement(t))}_startPreloadVideoElement(t){_(t.src)||"auto"===t.preload&&t.crossOrigin||(t.preload="auto",t.crossOrigin="anonymous",t.src=t.src)}_startPreloadImageElement(t){c(t.src)||_(t.src)||t.crossOrigin||(t.crossOrigin="anonymous",t.src=t.src)}static _getDataDimensions(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}static _estimateTexMemRequired(t,e){if(a(t))return 0;if(p(t)||d(t))return e.encoding===L.KTX2_ENCODING?f(t,e.mipmap):e.encoding===L.BASIS_ENCODING?w(t,e.mipmap):t.byteLength;const{width:r,height:i}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?L._getDataDimensions(t):e;return(e.mipmap?4/3:1)*r*i*(e.components||4)||0}dispose(){this.data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(t){return{target:N.TEXTURE_2D,pixelFormat:y.RGBA,dataType:R.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?U.LINEAR_MIPMAP_LINEAR:U.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:this.params.maxAnisotropy??(this.params.mipmap?t.parameters.maxMaxAnisotropy:1)}}get glTexture(){return this._glTexture}load(t,e){if(o(this._glTexture))return this._glTexture;if(o(this._loadingPromise))return this._loadingPromise;const r=this.data;return a(r)?(this._glTexture=new H(t,this._createDescriptor(t),null),this._glTexture):"string"==typeof r?this._loadFromURL(t,e,r):r instanceof Image?this._loadFromImageElement(t,e,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(t,e,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(t,r,e):(p(r)||d(r))&&this.params.encoding===L.DDS_ENCODING?(this.data=void 0,this._loadFromDDSData(t,r)):(p(r)||d(r))&&this.params.encoding===L.KTX2_ENCODING?(this.data=void 0,this._loadFromKTX2(t,r)):(p(r)||d(r))&&this.params.encoding===L.BASIS_ENCODING?(this.data=void 0,this._loadFromBasis(t,r)):d(r)?this._loadFromPixelData(t,r):p(r)?this._loadFromPixelData(t,new Uint8Array(r)):null}get requiresFrameUpdates(){return this.data instanceof HTMLVideoElement}frameUpdate(t,e,r){if(!(this.data instanceof HTMLVideoElement)||a(this._glTexture))return r;if(this.data.readyState<v.HAVE_CURRENT_DATA||r===this.data.currentTime)return r;if(o(this._powerOfTwoStretchInfo)){const{framebuffer:r,vao:i,sourceTexture:s}=this._powerOfTwoStretchInfo;s.setData(this.data),this._drawStretchedTexture(t,e,r,i,s,this._glTexture)}else{const{width:t,height:e}=this.data,{width:r,height:i}=this._glTexture.descriptor;t!==r||e!==i?this._glTexture.updateData(0,0,0,Math.min(t,r),Math.min(e,i),this.data):this._glTexture.setData(this.data)}return this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.data.currentTime}_loadFromDDSData(t,e){return this._glTexture=I(t,this._createDescriptor(t),e),this._glTexture}_loadFromKTX2(t,e){return this._loadAsync((()=>E(t,this._createDescriptor(t),e).then((t=>(this._glTexture=t,t)))))}_loadFromBasis(t,e){return this._loadAsync((()=>A(t,this._createDescriptor(t),e).then((t=>(this._glTexture=t,t)))))}_loadFromPixelData(t,e){F(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(t);return r.pixelFormat=1===this.params.components?y.LUMINANCE:3===this.params.components?y.RGB:y.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new H(t,r,e),this._glTexture}_loadFromURL(t,e,r){return this._loadAsync((async i=>{const s=await u(r,{signal:i});return m(i),this._loadFromImage(t,s,e)}))}_loadFromImageElement(t,e,r){return r.complete?this._loadFromImage(t,r,e):this._loadAsync((async i=>{const s=await T(r,r.src,!1,i);return m(i),this._loadFromImage(t,s,e)}))}_loadFromVideoElement(t,e,r){return r.readyState>=v.HAVE_CURRENT_DATA?this._loadFromImage(t,r,e):this._loadFromVideoElementAsync(t,e,r)}_loadFromVideoElementAsync(t,r,i){return this._loadAsync((s=>new Promise(((a,o)=>{const m=()=>{i.removeEventListener("loadeddata",p),i.removeEventListener("error",d),n(_)},p=()=>{i.readyState>=v.HAVE_CURRENT_DATA&&(m(),a(this._loadFromImage(t,i,r)))},d=t=>{m(),o(t||new e("Failed to load video"))};i.addEventListener("loadeddata",p),i.addEventListener("error",d);const _=h(s,(()=>d(l())))}))))}_loadFromImage(t,e,r){const s=L._getDataDimensions(e);this.params.width=s.width,this.params.height=s.height;const a=this._createDescriptor(t);return a.pixelFormat=3===this.params.components?y.RGB:y.RGBA,!this._requiresPowerOfTwo(t,a)||i(s.width)&&i(s.height)?(a.width=s.width,a.height=s.height,this._glTexture=new H(t,a,e),this._glTexture):(this._glTexture=this._makePowerOfTwoTexture(t,e,s,a,r),this._glTexture)}_loadAsync(t){const e=new AbortController;this._loadingController=e;const r=t(e.signal);this._loadingPromise=r;const i=()=>{this._loadingController===e&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}_requiresPowerOfTwo(t,e){const r=O.CLAMP_TO_EDGE,i="number"==typeof e.wrapMode?e.wrapMode===r:e.wrapMode.s===r&&e.wrapMode.t===r;return!j(t.gl)&&(e.hasMipmap||!i)}_makePowerOfTwoTexture(e,r,i,a,o){const{width:n,height:m}=i,h=s(n),l=s(m);let p;switch(a.width=h,a.height=l,this.params.powerOfTwoResizeMode){case g.PAD:a.textureCoordinateScaleFactor=[n/h,m/l],p=new H(e,a),p.updateData(0,0,0,n,m,r);break;case g.STRETCH:case null:case void 0:p=this._stretchToPowerOfTwo(e,r,a,o());break;default:t(this.params.powerOfTwoResizeMode)}return a.hasMipmap&&p.generateMipmap(),p}_stretchToPowerOfTwo(t,e,r,i){const s=new H(t,r),a=new S(t,{colorTarget:b.TEXTURE,depthStencilTarget:C.NONE},s),o=new H(t,{target:N.TEXTURE_2D,pixelFormat:r.pixelFormat,dataType:R.UNSIGNED_BYTE,wrapMode:O.CLAMP_TO_EDGE,samplingMode:U.LINEAR,flipped:!!r.flipped,maxAnisotropy:8,preMultiplyAlpha:r.preMultiplyAlpha},e),n=M(t),m=t.getBoundFramebufferObject();return this._drawStretchedTexture(t,i,a,n,o,s),this.requiresFrameUpdates?this._powerOfTwoStretchInfo={vao:n,sourceTexture:o,framebuffer:a}:(n.dispose(!0),o.dispose(),a.detachColorTexture(),a.dispose()),t.bindFramebuffer(m),s}_drawStretchedTexture(t,e,r,i,s,a){t.bindFramebuffer(r);const o=t.getViewport();t.setViewport(0,0,a.descriptor.width,a.descriptor.height);const n=t.bindTechnique(e);n.setUniform4f("uColor",1,1,1,1),n.bindTexture("tex",s),t.bindVAO(i),t.drawArrays(P.TRIANGLE_STRIP,0,V(i,"geometry")),t.bindFramebuffer(null),t.setViewport(o.x,o.y,o.width,o.height)}unload(){if(o(this._powerOfTwoStretchInfo)){const{framebuffer:t,vao:e,sourceTexture:r}=this._powerOfTwoStretchInfo;e.dispose(!0),r.dispose(),t.dispose(),this._glTexture=null,this._powerOfTwoStretchInfo=null}if(o(this._glTexture)&&(this._glTexture.dispose(),this._glTexture=null),o(this._loadingController)){const t=this._loadingController;this._loadingController=null,this._loadingPromise=null,t.abort()}this.events.emit("unloaded")}}var v;L.DDS_ENCODING="image/vnd-ms.dds",L.KTX2_ENCODING="image/ktx2",L.BASIS_ENCODING="image/x.basis",function(t){t[t.HAVE_NOTHING=0]="HAVE_NOTHING",t[t.HAVE_METADATA=1]="HAVE_METADATA",t[t.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",t[t.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",t[t.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"}(v||(v={}));export{L as Texture};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Evented.js";import t from"../../../../core/Handles.js";import{isSome as s,isNone as r,destroyMaybe as i}from"../../../../core/maybe.js";import o from"../../../../core/PooledArray.js";import{UpdatePolicy as a}from"./basicInterfaces.js";import{ContentObject as c}from"./ContentObject.js";import{ContentObjectType as h}from"./ContentObjectType.js";import{DirtyEventNames as n}from"./DirtyEvents.js";import l from"./Octree.js";class d extends c{constructor(s,r=""){var i,c,n;super(),this.apiLayerUid=r,this.type=h.Layer,this.events=new e,this.isSliceable=!1,this._objects=new o,this._stageHandles=new t,this.apiLayerUid=r,this.isVisible=null==(i=null==s?void 0:s.isVisible)||i,this.isPickable=null==(c=null==s?void 0:s.isPickable)||c,this.updatePolicy=null!=(n=null==s?void 0:s.updatePolicy)?n:a.ASYNC}get objects(){return this._objects}destroy(){this.detachStage(),this._stage=null}attachStage(e){this.detachStage(),this._stage=e;for(const t of n)this._stageHandles.add(this.events.on(t,(s=>e.handleEvent(t,s))))}detachStage(){this._stageHandles.removeAll(),this.invalidateSpatialQueryAccelerator()}add(e){this._objects.push(e),e.parentLayer=this,this.events.emit("layerObjectAdded",{layer:this,object:e}),s(this._octree)&&this._octree.add([e])}remove(e){this._objects.removeUnordered(e)&&(e.parentLayer=null,this.events.emit("layerObjectRemoved",{layer:this,object:e}),s(this._octree)&&this._octree.remove([e]))}addMany(e){this._objects.pushArray(e);for(const t of e)t.parentLayer=this;this.events.emit("layerObjectsAdded",{layer:this,objects:e}),s(this._octree)&&this._octree.add(e)}removeMany(e){const t=new Array;if(this._objects.removeUnorderedMany(e,e.length,t),0!==t.length){for(const e of t)e.parentLayer=null;this.events.emit("layerObjectsRemoved",{layer:this,objects:t}),s(this._octree)&&this._octree.remove(t)}}sync(){s(this._stage)&&this.updatePolicy!==a.SYNC&&this._stage.syncLayer(this.id)}notifyObjectBBChanged(e,t){s(this._octree)&&this._octree.update(e,t)}getSpatialQueryAccelerator(){return r(this._octree)&&this._objects.length>50&&this._createOctree(),this._octree}shaderTransformationChanged(){this.invalidateSpatialQueryAccelerator(),this.events.emit("shaderTransformationChanged",this)}invalidateSpatialQueryAccelerator(){this._octree=i(this._octree)}_createOctree(){this._octree=new l((e=>e.boundingVolumeWorldSpace.bounds)),this._octree.add(this._objects.data,this._objects.length)}}function y(e){return s(e)&&e.type===h.Layer}export{d as WebGLLayer,y as isWebGLLayer};
5
+ import e from"../../../../core/Evented.js";import t from"../../../../core/Handles.js";import{isSome as s,isNone as r,destroyMaybe as i}from"../../../../core/maybe.js";import a from"../../../../core/PooledArray.js";import{UpdatePolicy as o}from"./basicInterfaces.js";import{ContentObject as c}from"./ContentObject.js";import{ContentObjectType as h}from"./ContentObjectType.js";import{DirtyEventNames as n}from"./DirtyEvents.js";import d from"./Octree.js";class l extends c{constructor(s,r=""){super(),this.apiLayerUid=r,this.type=h.Layer,this.events=new e,this.isSliceable=!1,this._objects=new a,this._stageHandles=new t,this.apiLayerUid=r,this.isVisible=s?.isVisible??!0,this.isPickable=s?.isPickable??!0,this.updatePolicy=s?.updatePolicy??o.ASYNC}get objects(){return this._objects}destroy(){this.detachStage(),this._stage=null}attachStage(e){this.detachStage(),this._stage=e;for(const t of n)this._stageHandles.add(this.events.on(t,(s=>e.handleEvent(t,s))))}detachStage(){this._stageHandles.removeAll(),this.invalidateSpatialQueryAccelerator()}add(e){this._objects.push(e),e.parentLayer=this,this.events.emit("layerObjectAdded",{layer:this,object:e}),s(this._octree)&&this._octree.add([e])}remove(e){this._objects.removeUnordered(e)&&(e.parentLayer=null,this.events.emit("layerObjectRemoved",{layer:this,object:e}),s(this._octree)&&this._octree.remove([e]))}addMany(e){this._objects.pushArray(e);for(const t of e)t.parentLayer=this;this.events.emit("layerObjectsAdded",{layer:this,objects:e}),s(this._octree)&&this._octree.add(e)}removeMany(e){const t=new Array;if(this._objects.removeUnorderedMany(e,e.length,t),0!==t.length){for(const e of t)e.parentLayer=null;this.events.emit("layerObjectsRemoved",{layer:this,objects:t}),s(this._octree)&&this._octree.remove(t)}}sync(){s(this._stage)&&this.updatePolicy!==o.SYNC&&this._stage.syncLayer(this.id)}notifyObjectBBChanged(e,t){s(this._octree)&&this._octree.update(e,t)}getSpatialQueryAccelerator(){return r(this._octree)&&this._objects.length>50&&this._createOctree(),this._octree}shaderTransformationChanged(){this.invalidateSpatialQueryAccelerator(),this.events.emit("shaderTransformationChanged",this)}invalidateSpatialQueryAccelerator(){this._octree=i(this._octree)}_createOctree(){this._octree=new d((e=>e.boundingVolumeWorldSpace.bounds)),this._octree.add(this._objects.data,this._objects.length)}}function y(e){return s(e)&&e.type===h.Layer}export{l as WebGLLayer,y as isWebGLLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as r}from"../../../../../core/arrayUtils.js";import s from"../../../../../core/Logger.js";import{clamp as o}from"../../../../../core/mathUtils.js";import{disposeMaybe as n,destroyMaybe as i,isNone as a,isSome as c}from"../../../../../core/maybe.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as g,t as u,e as m}from"../../../../../chunks/mat3.js";import{c as h}from"../../../../../chunks/mat3f64.js";import{I as p,c as f}from"../../../../../chunks/mat4f64.js";import{s as b,c as y,v as j,e as O}from"../../../../../chunks/vec3.js";import{c as v}from"../../../../../chunks/vec3f64.js";import{WatchUpdatingTracking as w}from"../../../../../core/support/WatchUpdatingTracking.js";import{g as E,d as R}from"../../../../../chunks/sphere.js";import{c as x}from"../../../../../chunks/vec33.js";import{TwoVectorPosition as T}from"../../core/util/TwoVectorPosition.js";import{GridLocalOriginFactory as _}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as M}from"../localOriginHelper.js";import{LocalOriginManager as C}from"../LocalOriginManager.js";import{Object3D as P}from"../Object3D.js";import{VertexAttribute as S}from"../VertexAttribute.js";import{VertexLayout as D,EdgeShaderAttributeLocations as A,glVertexLayout as k,EdgeInputBufferLayout as I}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as B,SilhouetteEdgeBufferWriter as L}from"./edgeBufferWriters.js";import{EdgeType as U}from"./edgePreprocessing.js";import{EdgeRenderer as V,LINE_WIDTH_FRACTION_FACTOR as N,EXTENSION_LENGTH_OFFSET as H}from"./EdgeRenderer.js";import{EdgePassParameters as z}from"./EdgeShaderParameters.js";import W from"./EdgeWorkerHandle.js";import{Transparency as q}from"./interfaces.js";import{generateStrokesTexture as K}from"./strokes.js";import{determineRendererType as G,determineEdgeTransparency as F,determineObjectTransparency as Q,fillComponenBufferIndices as J,computeEdgeCount as X}from"./util.js";import{BufferManager as Y}from"../TextureBackedBuffer/BufferManager.js";import{BufferObject as Z}from"../../../../webgl/BufferObject.js";import{Usage as $}from"../../../../webgl/enums.js";import{VertexArrayObject as ee}from"../../../../webgl/VertexArrayObject.js";const te=s.getLogger("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView");let re=class extends t{constructor(e){super(e),this.updatingHandles=new w,this.perObjectData=new Map,this.perObjectDataEvictionCache=new Set,this.renderers=new Map,this.numberOfRenderedEdges={[q.TRANSPARENT]:0,[q.OPAQUE]:0},this.gpuMemoryUsage=0,this.workerAbort=new AbortController,this.tmpModelPosition=v(),this.localOrigins=new C(new _(e.renderSR))}initialize(){this.worker=new W(this.schedule),this.componentColorManager=new Y(this.rctx,2);const e=D.createBuffer(4);for(let t=0;t<4;t++)e.sideness.set(t,0,0===t||3===t?0:1),e.sideness.set(t,1,0===t||1===t?0:1);this.verticesBufferObject=Z.createVertex(this.rctx,$.STATIC_DRAW,e.buffer)}destroy(){this.destroyed||(this.perObjectData.forEach((e=>this._discardObjectEntry(e))),this.perObjectData.clear(),this.strokesTexture=n(this.strokesTexture),this.componentColorManager=i(this.componentColorManager),this.workerAbort.abort(),this.worker.destroy(),this.verticesBufferObject=n(this.verticesBufferObject),this.renderers.clear(),this.updatingHandles.destroy())}get updating(){return this.updatingHandles.updating}get usedMemory(){return this.gpuMemoryUsage}get numberOfRenderedPrimitives(){return this.numberOfRenderedEdges[q.TRANSPARENT]+this.numberOfRenderedEdges[q.OPAQUE]}shouldRender(){return this.renderers.size>0}async addComponentObject(e,t,r,s,o,n,i,a){if(this.hasObject(e))return this.getObjectMemoryUsage(e);let c;const d=new ne(new Promise((e=>c=e)),r.center,r.radius);this.perObjectData.set(e,d);const l=await this.updatingHandles.addPromise(this._addComponentGeometry(t,d,s,o,n,i,a));return this.setNeedsRender(),c(),l}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void te.warn("Attempt to add an object to a destroyed instance");const o=this.perObjectData.get(e);let n;(null==o?void 0:o.renderables.length)>0&&this.perObjectDataEvictionCache.add(o);const i=e.boundingVolumeWorldSpace.bounds,a=new ne(new Promise((e=>n=e)),E(i),R(i));this.perObjectData.set(e,a);const c=new Array;if(r.mergeGeometries&&e.geometries.length>1&&oe(e))c.push(this._addObjectMergedGeometries(e,a,t,r,s));else for(let d=0;d<e.geometries.length;d++){const o=e.geometryRecords[d];if(!o.material.supportsEdges)continue;const n=e.geometries[d];c.push(this._addGeometry(e,a,n,o,t[0],r,s))}await this.updatingHandles.addPromise(Promise.all(c)),this.perObjectDataEvictionCache.delete(a),this._discardObjectEntry(o),this.setNeedsRender(),n()}_discardObjectEntry(e){e&&(e.renderables.length&&(e.renderables.forEach((e=>this._removeRenderable(e))),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this.perObjectData.has(e)}async updateAllComponentOpacities(e,t){const r=t instanceof Array?e=>t[e]:()=>t;(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>{const t=e.components.meta.length;for(let s=0;s<t;s++){const t=r(s),o=e.components.meta[s],n=o.index;o.material.opacity=t,e.components.buffer.textureBuffer.setDataElement(n,1,3,255*t)}this._updateTransparency(e)})),this.setNeedsRender()}async getObjectMemoryUsage(e){return(await this._getObjectEntry(e)).renderables.reduce(((e,t)=>e+t.statistics.gpuMemoryUsage),0)}async updateAllComponentMaterials(e,t,r,s){const o=e instanceof P,n=!!r.hasSlicePlane,i=G(t),a=V.getKey(i,n,o);(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>{if(a!==e.rendererKey){const t=this.renderers.get(e.rendererKey),r=this._acquireRenderer(i,n,o);t.removeRenderable(e),t.refCount.decrement(),e.rendererKey=a,r.addRenderable(e)}for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];s&&this._updateComponentBuffer(e.components),this._updateTransparency(e)})),this.setNeedsRender()}async updateObjectVisibility(e,t){(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>e.visible=t)),this.setNeedsRender()}removeObject(e){const t=this.perObjectData.get(e);t&&(this.perObjectData.delete(e),this._discardObjectEntry(t))}async _getObjectEntry(e){const t=this.perObjectData.get(e);if(!t)throw"no object";return await t.loaded,t}removeAll(){this.perObjectData.forEach(((e,t)=>this.removeObject(t)))}render(e,t){if(this.numberOfRenderedEdges[t]=0,a(this.componentColorManager))return;this.localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=v(),o=new T;let n=0,i=0;if(this.renderers.forEach((r=>{0===r.refCount.value?(this.renderers.delete(r.key),r.dispose()):r.forEachRenderable((t=>{t.visible&&(n+=t.statistics.averageEdgeLength,i++,t.regular&&r.updateTechnique(e,!1),t.silhouette&&r.updateTechnique(e,!0))}),t)})),this.componentColorManager.garbageCollect(),this.componentColorManager.updateTextures(),0===i)return;const c=40*n/i,d=e.camera.perScreenPixelRatio,l=new z(c,d,t);b(s,r[3],r[7],r[11]),o.set(s),y(l.transformWorldFromViewTH,o.high),y(l.transformWorldFromViewTL,o.low),g(l.transformViewFromCameraRelativeRS,e.camera.viewMatrix),u(ie,l.transformViewFromCameraRelativeRS),m(l.transformNormalViewFromGlobal,ie),l.transformProjFromView=e.camera.projectionMatrix,this._updateObjectCameraDistances(e),this.renderers.forEach((t=>{this._renderRegularEdges(t,e,l),this._renderSilhouetteEdges(t,e,l)}))}_updateTransparency(e){const t=F(e.components.meta),r=Q(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this.renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){if(e.getCombinedStaticTransformation(t,r),c(t.origin))this.localOrigins.register(t.origin);else{const e=b(this.tmpModelPosition,r[12],r[13],r[14]);t.origin=this.localOrigins.acquire(e)}return M(t.origin.vec3,r),t.origin}_updateComponentBuffer(e){const{meta:t,buffer:r}=e;for(let s=0;s<t.length;s++){const e=t[s].material,n=t[s].index,i=o(Math.round(e.size*N),0,255),a=o(e.extensionLength,-H,255-H)+H,c="solid"===e.type?U.SOLID:U.SKETCH,d=255*e.opacity,l=e.color,g=255*l[0],u=255*l[1],m=255*l[2],h=255*l[3];r.textureBuffer.setData(n,0,g,u,m,h),r.textureBuffer.setData(n,1,i,a,c,d)}}_createComponentBuffers(e){if(a(this.componentColorManager))return null;const t=new Array,r=this.componentColorManager.getBuffer(e.length);for(let o=0;o<e.length;o++){const s=e[o],n=r.acquireIndex();t.push({index:n,material:s})}const s={meta:t,buffer:r};return this._updateComponentBuffer(s),s}_extractEdges(e,t,r,s,o,n=o.length){return this.worker.process({data:t,indices:o,indicesLength:n,writerSettings:e,skipDeduplicate:r},this.workerAbort.signal,s)}_createEdgeResources(e){const t={};if(a(this.verticesBufferObject))return t;if(e.regular.lodInfo.lengths.length>0){const r=new ee(this.rctx,A,{vertices:k,instances:B.glLayout},{vertices:this.verticesBufferObject,instances:Z.createVertex(this.rctx,$.STATIC_DRAW,e.regular.instancesData.buffer)});t.regular={vao:r,lod:e.regular.lodInfo}}if(e.silhouette.lodInfo.lengths.length>0){const r=new ee(this.rctx,A,{vertices:k,instances:L.glLayout},{vertices:this.verticesBufferObject,instances:Z.createVertex(this.rctx,$.STATIC_DRAW,e.silhouette.instancesData.buffer)});t.silhouette={vao:r,lod:e.silhouette.lodInfo}}return t}async _addGeometry(e,t,r,s,o,n,i){const a=r.vertexAttributes.get(S.POSITION),c=r.indices.get(S.POSITION),d=f(),l={position:a,indices:c,modelTransform:d,origin:this._computeModelTransformWithLocalOrigin(e,s,d)};return this._addPositionData(t,l,r.edgeIndicesLength,o,n,i)}async _addPositionData(e,t,r,s,o,n=!1){if(null==e.loaded)return;const i=this._createComponentBuffers([s]);if(a(i)||r<=0)return;const c=this._acquireRenderer(s.type,!!o.hasSlicePlane,!0),{modelTransform:d,origin:l}=t,g=t.indices,u=t.position,m=u.data.length/u.size,h=I.createBuffer(m);for(let a=0;a<m;a++)h.position.set(a,0,u.data[a*u.size+0]),h.position.set(a,1,u.data[a*u.size+1]),h.position.set(a,2,u.data[a*u.size+2]);J(i.meta,[0,h.componentIndex.count],h.componentIndex);const p=await this.updatingHandles.addPromise(this._extractEdges(c.writerSettings,h,!1,n,g,r));if(null==e.loaded)return;const{regular:f,silhouette:b}=this._createEdgeResources(p),y=(f?f.vao.size:0)+(b?b.vao.size:0),j={regular:f,silhouette:b,transform:{modelMatrix:d,origin:l},statistics:{gpuMemoryUsage:y,externalMemoryUsage:!1,averageEdgeLength:p.averageEdgeLength},components:i,visible:!0,edgeTransparency:F(i.meta),objectTransparency:Q(i.meta),distanceToCamera:0,rendererKey:c.key};e.renderables.push(j),c.addRenderable(j),this.gpuMemoryUsage+=y}async _addComponentGeometry(e,t,r,s,o,n,i){if(null==t.loaded)return 0;const c=this._createComponentBuffers(n);if(a(c))return 0;const d=G(n),l=this._acquireRenderer(d,i.hasSlicePlane||!1,!1),g=I.createBuffer(r.count);x(g.position,r),J(c.meta,o,g.componentIndex,s);const u=!0,m=l.writerSettings,h=await this.updatingHandles.addPromise(this._extractEdges(m,g,u,!1,s));if(null==t.loaded)return 0;const{regular:p,silhouette:f}=this._createEdgeResources(h),b=(p?p.vao.size:0)+(f?f.vao.size:0),y={regular:p,silhouette:f,transform:e,statistics:{gpuMemoryUsage:b,externalMemoryUsage:!0,averageEdgeLength:h.averageEdgeLength},components:c,visible:!0,edgeTransparency:F(c.meta),objectTransparency:Q(c.meta),distanceToCamera:0,rendererKey:l.key};return t.renderables.push(y),l.addRenderable(y),b}async _addObjectMergedGeometries(e,t,r,s,o){const n=new Map;let i=0,a=null,c=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f],r=e.geometryRecords[f];if(!r.material.supportsEdges)continue;!a&&r.origin&&(a=r);const s=t.vertexAttributes.get(S.POSITION);c+=s.data.length/s.size,i+=t.edgeIndicesLength}const d=c>=65536?Uint32Array:Uint16Array,l=i?new d(i):null,g=[];let u=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f];if(!e.geometryRecords[f].material.supportsEdges)continue;const r=t.vertexAttributes.get(S.POSITION),s=t.indices.get(S.POSITION);let o=n.get(r.data);if(null==o){o=g.length/3;for(let e=0;e<r.data.length;e+=r.size)g.push(r.data[e+0]),g.push(r.data[e+1]),g.push(r.data[e+2]);n.set(r.data,o)}if(s)for(let e=0;e<t.edgeIndicesLength;e++)l[u++]=o+s[e]}const m=a||e.geometryRecords[0],h=f(),p=this._computeModelTransformWithLocalOrigin(e,m,h);for(let f=0;f<e.geometryRecords.length;f++)e.geometryRecords[f].origin=p;const b={position:{data:g,size:3},indices:l,modelTransform:h,origin:p};await this.updatingHandles.addPromise(this._addPositionData(t,b,l.length,r[0],s,o))}_acquireRenderer(e,t,r){const s=V.getKey(e,t,r);let o=this.renderers.get(s);return a(this.strokesTexture)&&(this.strokesTexture=K(this.rctx)),o||(o=new V(this.rctx,this.techniqueRepository,{type:e,hasSlicePlane:t,strokesTexture:this.strokesTexture,legacy:r}),this.renderers.set(s,o)),o.refCount.increment(),o}_removeRenderable(e){se(e);const t=this.renderers.get(e.rendererKey);if(t){t.removeRenderable(e),t.refCount.decrement(),"origin"in e.transform&&this.localOrigins.release(e.transform.origin),this.gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=v(),o=e=>{const{center:o,radius:n}=e;j(s,o,t);const i=O(s,r),a=i<-n?1/0:i<n?0:i-n;e.renderables.forEach((e=>e.distanceToCamera=a))};this.perObjectData.forEach(o),this.perObjectDataEvictionCache.forEach(o)}_renderRegularEdges(e,t,r){const s=e.bindRegularEdges(r,t),o=r.transparency;e.forEachRenderable((n=>{if(!n.visible||!n.regular)return;const i=X(n.regular.lod.lengths,n.distanceToCamera,r),a="origin"in n.transform?this.localOrigins.getViewMatrix(n.transform.origin):p;e.renderRegularEdges(s,n,t,i,a),this.numberOfRenderedEdges[o]+=i}),o)}_renderSilhouetteEdges(e,t,r){const s=e.bindSilhouetteEdges(r,t),o=r.transparency;e.forEachRenderable((n=>{if(!n.visible||!n.silhouette)return;const i=X(n.silhouette.lod.lengths,n.distanceToCamera,r),a="origin"in n.transform?this.localOrigins.getViewMatrix(n.transform.origin):p;e.renderSilhouetteEdges(s,n,t,i,a),this.numberOfRenderedEdges[o]+=i}),o)}};function se(e){e.regular&&(e.regular.vao.vertexBuffers.instances.dispose(),e.regular.vao.dispose(!1),e.regular.vao=null),e.silhouette&&(e.silhouette.vao.vertexBuffers.instances.dispose(),e.silhouette.vao.dispose(!1),e.silhouette.vao=null)}function oe(e){let t=null,s=null;for(let n=0;n<e.geometries.length;n++){var o;const i=e.geometryRecords[n];if(i.material.supportsEdges){if(t){if(!r(t,i.transformation))return!1}else t=i.transformation;if(!s&&c(i.origin))s=i;else if(c(null==(o=s)?void 0:o.origin)&&c(i.origin)&&s.origin.id!==i.origin.id)return!1}}return!0}e([d({constructOnly:!0})],re.prototype,"rctx",void 0),e([d({constructOnly:!0})],re.prototype,"renderSR",void 0),e([d({constructOnly:!0})],re.prototype,"techniqueRepository",void 0),e([d({constructOnly:!0})],re.prototype,"setNeedsRender",void 0),e([d({constructOnly:!0})],re.prototype,"schedule",void 0),e([d({readOnly:!0})],re.prototype,"updatingHandles",void 0),e([d({readOnly:!0})],re.prototype,"updating",null),re=e([l("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],re);class ne{constructor(e,t,r){this.center=t,this.radius=r,this.renderables=new Array,this.loaded=e,this.loaded.then((()=>{null!=this.loaded&&(this.loaded=!0)}))}}const ie=h();export{re as EdgeView};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as r}from"../../../../../core/arrayUtils.js";import s from"../../../../../core/Logger.js";import{clamp as o}from"../../../../../core/mathUtils.js";import{disposeMaybe as n,destroyMaybe as i,isNone as a,isSome as c}from"../../../../../core/maybe.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as g,t as m,e as u}from"../../../../../chunks/mat3.js";import{c as h}from"../../../../../chunks/mat3f64.js";import{I as p,c as f}from"../../../../../chunks/mat4f64.js";import{s as b,c as y,v as j,e as O}from"../../../../../chunks/vec3.js";import{c as v}from"../../../../../chunks/vec3f64.js";import{WatchUpdatingTracking as w}from"../../../../../core/support/WatchUpdatingTracking.js";import{g as E,d as R}from"../../../../../chunks/sphere.js";import{c as x}from"../../../../../chunks/vec33.js";import{TwoVectorPosition as T}from"../../core/util/TwoVectorPosition.js";import{GridLocalOriginFactory as _}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as M}from"../localOriginHelper.js";import{LocalOriginManager as C}from"../LocalOriginManager.js";import{Object3D as P}from"../Object3D.js";import{VertexAttribute as S}from"../VertexAttribute.js";import{VertexLayout as D,EdgeShaderAttributeLocations as A,glVertexLayout as k,EdgeInputBufferLayout as I}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as B,SilhouetteEdgeBufferWriter as L}from"./edgeBufferWriters.js";import{EdgeType as U}from"./edgePreprocessing.js";import{EdgeRenderer as V,LINE_WIDTH_FRACTION_FACTOR as N,EXTENSION_LENGTH_OFFSET as H}from"./EdgeRenderer.js";import{EdgePassParameters as z}from"./EdgeShaderParameters.js";import W from"./EdgeWorkerHandle.js";import{Transparency as q}from"./interfaces.js";import{generateStrokesTexture as K}from"./strokes.js";import{determineRendererType as G,determineEdgeTransparency as F,determineObjectTransparency as Q,fillComponenBufferIndices as J,computeEdgeCount as X}from"./util.js";import{BufferManager as Y}from"../TextureBackedBuffer/BufferManager.js";import{BufferObject as Z}from"../../../../webgl/BufferObject.js";import{Usage as $}from"../../../../webgl/enums.js";import{VertexArrayObject as ee}from"../../../../webgl/VertexArrayObject.js";const te=s.getLogger("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView");let re=class extends t{constructor(e){super(e),this.updatingHandles=new w,this.perObjectData=new Map,this.perObjectDataEvictionCache=new Set,this.renderers=new Map,this.numberOfRenderedEdges={[q.TRANSPARENT]:0,[q.OPAQUE]:0},this.gpuMemoryUsage=0,this.workerAbort=new AbortController,this.tmpModelPosition=v(),this.localOrigins=new C(new _(e.renderSR))}initialize(){this.worker=new W(this.schedule),this.componentColorManager=new Y(this.rctx,2);const e=D.createBuffer(4);for(let t=0;t<4;t++)e.sideness.set(t,0,0===t||3===t?0:1),e.sideness.set(t,1,0===t||1===t?0:1);this.verticesBufferObject=Z.createVertex(this.rctx,$.STATIC_DRAW,e.buffer)}destroy(){this.destroyed||(this.perObjectData.forEach((e=>this._discardObjectEntry(e))),this.perObjectData.clear(),this.strokesTexture=n(this.strokesTexture),this.componentColorManager=i(this.componentColorManager),this.workerAbort.abort(),this.worker.destroy(),this.verticesBufferObject=n(this.verticesBufferObject),this.renderers.clear(),this.updatingHandles.destroy())}get updating(){return this.updatingHandles.updating}get usedMemory(){return this.gpuMemoryUsage}get numberOfRenderedPrimitives(){return this.numberOfRenderedEdges[q.TRANSPARENT]+this.numberOfRenderedEdges[q.OPAQUE]}shouldRender(){return this.renderers.size>0}async addComponentObject(e,t,r,s,o,n,i,a){if(this.hasObject(e))return this.getObjectMemoryUsage(e);let c;const d=new ne(new Promise((e=>c=e)),r.center,r.radius);this.perObjectData.set(e,d);const l=await this.updatingHandles.addPromise(this._addComponentGeometry(t,d,s,o,n,i,a));return this.setNeedsRender(),c(),l}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void te.warn("Attempt to add an object to a destroyed instance");const o=this.perObjectData.get(e);let n;o?.renderables.length>0&&this.perObjectDataEvictionCache.add(o);const i=e.boundingVolumeWorldSpace.bounds,a=new ne(new Promise((e=>n=e)),E(i),R(i));this.perObjectData.set(e,a);const c=new Array;if(r.mergeGeometries&&e.geometries.length>1&&oe(e))c.push(this._addObjectMergedGeometries(e,a,t,r,s));else for(let d=0;d<e.geometries.length;d++){const o=e.geometryRecords[d];if(!o.material.supportsEdges)continue;const n=e.geometries[d];c.push(this._addGeometry(e,a,n,o,t[0],r,s))}await this.updatingHandles.addPromise(Promise.all(c)),this.perObjectDataEvictionCache.delete(a),this._discardObjectEntry(o),this.setNeedsRender(),n()}_discardObjectEntry(e){e&&(e.renderables.length&&(e.renderables.forEach((e=>this._removeRenderable(e))),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this.perObjectData.has(e)}async updateAllComponentOpacities(e,t){const r=t instanceof Array?e=>t[e]:()=>t;(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>{const t=e.components.meta.length;for(let s=0;s<t;s++){const t=r(s),o=e.components.meta[s],n=o.index;o.material.opacity=t,e.components.buffer.textureBuffer.setDataElement(n,1,3,255*t)}this._updateTransparency(e)})),this.setNeedsRender()}async getObjectMemoryUsage(e){return(await this._getObjectEntry(e)).renderables.reduce(((e,t)=>e+t.statistics.gpuMemoryUsage),0)}async updateAllComponentMaterials(e,t,r,s){const o=e instanceof P,n=!!r.hasSlicePlane,i=G(t),a=V.getKey(i,n,o);(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>{if(a!==e.rendererKey){const t=this.renderers.get(e.rendererKey),r=this._acquireRenderer(i,n,o);t.removeRenderable(e),t.refCount.decrement(),e.rendererKey=a,r.addRenderable(e)}for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];s&&this._updateComponentBuffer(e.components),this._updateTransparency(e)})),this.setNeedsRender()}async updateObjectVisibility(e,t){(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>e.visible=t)),this.setNeedsRender()}removeObject(e){const t=this.perObjectData.get(e);t&&(this.perObjectData.delete(e),this._discardObjectEntry(t))}async _getObjectEntry(e){const t=this.perObjectData.get(e);if(!t)throw"no object";return await t.loaded,t}removeAll(){this.perObjectData.forEach(((e,t)=>this.removeObject(t)))}render(e,t){if(this.numberOfRenderedEdges[t]=0,a(this.componentColorManager))return;this.localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=v(),o=new T;let n=0,i=0;if(this.renderers.forEach((r=>{0===r.refCount.value?(this.renderers.delete(r.key),r.dispose()):r.forEachRenderable((t=>{t.visible&&(n+=t.statistics.averageEdgeLength,i++,t.regular&&r.updateTechnique(e,!1),t.silhouette&&r.updateTechnique(e,!0))}),t)})),this.componentColorManager.garbageCollect(),this.componentColorManager.updateTextures(),0===i)return;const c=40*n/i,d=e.camera.perScreenPixelRatio,l=new z(c,d,t);b(s,r[3],r[7],r[11]),o.set(s),y(l.transformWorldFromViewTH,o.high),y(l.transformWorldFromViewTL,o.low),g(l.transformViewFromCameraRelativeRS,e.camera.viewMatrix),m(ie,l.transformViewFromCameraRelativeRS),u(l.transformNormalViewFromGlobal,ie),l.transformProjFromView=e.camera.projectionMatrix,this._updateObjectCameraDistances(e),this.renderers.forEach((t=>{this._renderRegularEdges(t,e,l),this._renderSilhouetteEdges(t,e,l)}))}_updateTransparency(e){const t=F(e.components.meta),r=Q(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this.renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){if(e.getCombinedStaticTransformation(t,r),c(t.origin))this.localOrigins.register(t.origin);else{const e=b(this.tmpModelPosition,r[12],r[13],r[14]);t.origin=this.localOrigins.acquire(e)}return M(t.origin.vec3,r),t.origin}_updateComponentBuffer(e){const{meta:t,buffer:r}=e;for(let s=0;s<t.length;s++){const e=t[s].material,n=t[s].index,i=o(Math.round(e.size*N),0,255),a=o(e.extensionLength,-H,255-H)+H,c="solid"===e.type?U.SOLID:U.SKETCH,d=255*e.opacity,l=e.color,g=255*l[0],m=255*l[1],u=255*l[2],h=255*l[3];r.textureBuffer.setData(n,0,g,m,u,h),r.textureBuffer.setData(n,1,i,a,c,d)}}_createComponentBuffers(e){if(a(this.componentColorManager))return null;const t=new Array,r=this.componentColorManager.getBuffer(e.length);for(let o=0;o<e.length;o++){const s=e[o],n=r.acquireIndex();t.push({index:n,material:s})}const s={meta:t,buffer:r};return this._updateComponentBuffer(s),s}_extractEdges(e,t,r,s,o,n=o.length){return this.worker.process({data:t,indices:o,indicesLength:n,writerSettings:e,skipDeduplicate:r},this.workerAbort.signal,s)}_createEdgeResources(e){const t={};if(a(this.verticesBufferObject))return t;if(e.regular.lodInfo.lengths.length>0){const r=new ee(this.rctx,A,{vertices:k,instances:B.glLayout},{vertices:this.verticesBufferObject,instances:Z.createVertex(this.rctx,$.STATIC_DRAW,e.regular.instancesData.buffer)});t.regular={vao:r,lod:e.regular.lodInfo}}if(e.silhouette.lodInfo.lengths.length>0){const r=new ee(this.rctx,A,{vertices:k,instances:L.glLayout},{vertices:this.verticesBufferObject,instances:Z.createVertex(this.rctx,$.STATIC_DRAW,e.silhouette.instancesData.buffer)});t.silhouette={vao:r,lod:e.silhouette.lodInfo}}return t}async _addGeometry(e,t,r,s,o,n,i){const a=r.vertexAttributes.get(S.POSITION),c=r.indices.get(S.POSITION),d=f(),l={position:a,indices:c,modelTransform:d,origin:this._computeModelTransformWithLocalOrigin(e,s,d)};return this._addPositionData(t,l,r.edgeIndicesLength,o,n,i)}async _addPositionData(e,t,r,s,o,n=!1){if(null==e.loaded)return;const i=this._createComponentBuffers([s]);if(a(i)||r<=0)return;const c=this._acquireRenderer(s.type,!!o.hasSlicePlane,!0),{modelTransform:d,origin:l}=t,g=t.indices,m=t.position,u=m.data.length/m.size,h=I.createBuffer(u);for(let a=0;a<u;a++)h.position.set(a,0,m.data[a*m.size+0]),h.position.set(a,1,m.data[a*m.size+1]),h.position.set(a,2,m.data[a*m.size+2]);J(i.meta,[0,h.componentIndex.count],h.componentIndex);const p=await this.updatingHandles.addPromise(this._extractEdges(c.writerSettings,h,!1,n,g,r));if(null==e.loaded)return;const{regular:f,silhouette:b}=this._createEdgeResources(p),y=(f?f.vao.size:0)+(b?b.vao.size:0),j={regular:f,silhouette:b,transform:{modelMatrix:d,origin:l},statistics:{gpuMemoryUsage:y,externalMemoryUsage:!1,averageEdgeLength:p.averageEdgeLength},components:i,visible:!0,edgeTransparency:F(i.meta),objectTransparency:Q(i.meta),distanceToCamera:0,rendererKey:c.key};e.renderables.push(j),c.addRenderable(j),this.gpuMemoryUsage+=y}async _addComponentGeometry(e,t,r,s,o,n,i){if(null==t.loaded)return 0;const c=this._createComponentBuffers(n);if(a(c))return 0;const d=G(n),l=this._acquireRenderer(d,i.hasSlicePlane||!1,!1),g=I.createBuffer(r.count);x(g.position,r),J(c.meta,o,g.componentIndex,s);const m=!0,u=l.writerSettings,h=await this.updatingHandles.addPromise(this._extractEdges(u,g,m,!1,s));if(null==t.loaded)return 0;const{regular:p,silhouette:f}=this._createEdgeResources(h),b=(p?p.vao.size:0)+(f?f.vao.size:0),y={regular:p,silhouette:f,transform:e,statistics:{gpuMemoryUsage:b,externalMemoryUsage:!0,averageEdgeLength:h.averageEdgeLength},components:c,visible:!0,edgeTransparency:F(c.meta),objectTransparency:Q(c.meta),distanceToCamera:0,rendererKey:l.key};return t.renderables.push(y),l.addRenderable(y),b}async _addObjectMergedGeometries(e,t,r,s,o){const n=new Map;let i=0,a=null,c=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f],r=e.geometryRecords[f];if(!r.material.supportsEdges)continue;!a&&r.origin&&(a=r);const s=t.vertexAttributes.get(S.POSITION);c+=s.data.length/s.size,i+=t.edgeIndicesLength}const d=c>=65536?Uint32Array:Uint16Array,l=i?new d(i):null,g=[];let m=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f];if(!e.geometryRecords[f].material.supportsEdges)continue;const r=t.vertexAttributes.get(S.POSITION),s=t.indices.get(S.POSITION);let o=n.get(r.data);if(null==o){o=g.length/3;for(let e=0;e<r.data.length;e+=r.size)g.push(r.data[e+0]),g.push(r.data[e+1]),g.push(r.data[e+2]);n.set(r.data,o)}if(s)for(let e=0;e<t.edgeIndicesLength;e++)l[m++]=o+s[e]}const u=a||e.geometryRecords[0],h=f(),p=this._computeModelTransformWithLocalOrigin(e,u,h);for(let f=0;f<e.geometryRecords.length;f++)e.geometryRecords[f].origin=p;const b={position:{data:g,size:3},indices:l,modelTransform:h,origin:p};await this.updatingHandles.addPromise(this._addPositionData(t,b,l.length,r[0],s,o))}_acquireRenderer(e,t,r){const s=V.getKey(e,t,r);let o=this.renderers.get(s);return a(this.strokesTexture)&&(this.strokesTexture=K(this.rctx)),o||(o=new V(this.rctx,this.techniqueRepository,{type:e,hasSlicePlane:t,strokesTexture:this.strokesTexture,legacy:r}),this.renderers.set(s,o)),o.refCount.increment(),o}_removeRenderable(e){se(e);const t=this.renderers.get(e.rendererKey);if(t){t.removeRenderable(e),t.refCount.decrement(),"origin"in e.transform&&this.localOrigins.release(e.transform.origin),this.gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=v(),o=e=>{const{center:o,radius:n}=e;j(s,o,t);const i=O(s,r),a=i<-n?1/0:i<n?0:i-n;e.renderables.forEach((e=>e.distanceToCamera=a))};this.perObjectData.forEach(o),this.perObjectDataEvictionCache.forEach(o)}_renderRegularEdges(e,t,r){const s=e.bindRegularEdges(r,t),o=r.transparency;e.forEachRenderable((n=>{if(!n.visible||!n.regular)return;const i=X(n.regular.lod.lengths,n.distanceToCamera,r),a="origin"in n.transform?this.localOrigins.getViewMatrix(n.transform.origin):p;e.renderRegularEdges(s,n,t,i,a),this.numberOfRenderedEdges[o]+=i}),o)}_renderSilhouetteEdges(e,t,r){const s=e.bindSilhouetteEdges(r,t),o=r.transparency;e.forEachRenderable((n=>{if(!n.visible||!n.silhouette)return;const i=X(n.silhouette.lod.lengths,n.distanceToCamera,r),a="origin"in n.transform?this.localOrigins.getViewMatrix(n.transform.origin):p;e.renderSilhouetteEdges(s,n,t,i,a),this.numberOfRenderedEdges[o]+=i}),o)}};function se(e){e.regular&&(e.regular.vao.vertexBuffers.instances.dispose(),e.regular.vao.dispose(!1),e.regular.vao=null),e.silhouette&&(e.silhouette.vao.vertexBuffers.instances.dispose(),e.silhouette.vao.dispose(!1),e.silhouette.vao=null)}function oe(e){let t=null,s=null;for(let o=0;o<e.geometries.length;o++){const n=e.geometryRecords[o];if(n.material.supportsEdges){if(t){if(!r(t,n.transformation))return!1}else t=n.transformation;if(!s&&c(n.origin))s=n;else if(c(s?.origin)&&c(n.origin)&&s.origin.id!==n.origin.id)return!1}}return!0}e([d({constructOnly:!0})],re.prototype,"rctx",void 0),e([d({constructOnly:!0})],re.prototype,"renderSR",void 0),e([d({constructOnly:!0})],re.prototype,"techniqueRepository",void 0),e([d({constructOnly:!0})],re.prototype,"setNeedsRender",void 0),e([d({constructOnly:!0})],re.prototype,"schedule",void 0),e([d({readOnly:!0})],re.prototype,"updatingHandles",void 0),e([d({readOnly:!0})],re.prototype,"updating",null),re=e([l("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],re);class ne{constructor(e,t,r){this.center=t,this.radius=r,this.renderables=new Array,this.loaded=e,this.loaded.then((()=>{null!=this.loaded&&(this.loaded=!0)}))}}const ie=h();export{re as EdgeView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as r,isSome as e}from"../../../../core/maybe.js";import{isPclIntersectorResult as t,isI3sIntersectorResult as i}from"../../layers/i3s/Intersector.js";import{isTerrainIntersectorResult as a,isOverlayIntersectorResult as n}from"../../terrain/Intersector.js";import{isObjectIntersectorResult as c,isHudIntersectorResult as o}from"./intersectorUtils.js";import{isLodIntersectorResult as l}from"./lodRendering/Intersector.js";function s(r,e){return c(r)||o(r)?g(r.target.object.metadata,e):a(r)?null==(l=e.map)?void 0:l.ground:t(r)||i(r)||n(r)?g(r.target,e):null;var l}function p(r,e){return c(r)||o(r)?u(r.target.object.metadata,e):t(r)?r.target.createGraphic():n(r)||l(r)?u(r.target,e):i(r)?d(r.target,e):null}function u(t,i){if(r(t)||r(t.graphicUid))return null;const a=g(t,i);if(r(a))return null;if(a===i.graphics)return e(i.graphicsView)?i.graphicsView.getGraphicFromGraphicUid(t.graphicUid):null;const n=i.allLayerViews.find((r=>r.layer===a));return n&&!n.suspended&&"getGraphicFromGraphicUid"in n&&e(t.graphicUid)?n.getGraphicFromGraphicUid(t.graphicUid):null}function d(e,t){const i=g(e,t);if(r(i))return null;const a=t.allLayerViews.find((r=>r.layer===i));return a&&!a.suspended&&"getGraphicFromIntersectorTarget"in a?a.getGraphicFromIntersectorTarget(e):null}function g(t,i){return r(t.layerUid)?null:e(i.graphicsView)&&t.layerUid===i.graphicsView.processor.layer.id?i.graphics:i.map.findLayerByUid(t.layerUid)}export{p as toGraphic,s as toOwner};
5
+ import{isNone as r,isSome as e}from"../../../../core/maybe.js";import{isPclIntersectorResult as t,isI3sIntersectorResult as i}from"../../layers/i3s/Intersector.js";import{isTerrainIntersectorResult as a,isOverlayIntersectorResult as n}from"../../terrain/Intersector.js";import{isObjectIntersectorResult as c,isHudIntersectorResult as o}from"./intersectorUtils.js";import{isLodIntersectorResult as s}from"./lodRendering/Intersector.js";function l(r,e){return c(r)||o(r)?d(r.target.object.metadata,e):a(r)?e.map?.ground:t(r)||i(r)||n(r)?d(r.target,e):null}function p(r,e){return c(r)||o(r)?u(r.target.object.metadata,e):t(r)?r.target.createGraphic():n(r)||s(r)?u(r.target,e):i(r)?g(r.target,e):null}function u(t,i){if(r(t)||r(t.graphicUid))return null;const a=d(t,i);if(r(a))return null;if(a===i.graphics)return e(i.graphicsView)?i.graphicsView.getGraphicFromGraphicUid(t.graphicUid):null;const n=i.allLayerViews.find((r=>r.layer===a));return n&&!n.suspended&&"getGraphicFromGraphicUid"in n&&e(t.graphicUid)?n.getGraphicFromGraphicUid(t.graphicUid):null}function g(e,t){const i=d(e,t);if(r(i))return null;const a=t.allLayerViews.find((r=>r.layer===i));return a&&!a.suspended&&"getGraphicFromIntersectorTarget"in a?a.getGraphicFromIntersectorTarget(e):null}function d(t,i){return r(t.layerUid)?null:e(i.graphicsView)&&t.layerUid===i.graphicsView.processor.layer.id?i.graphics:i.map.findLayerByUid(t.layerUid)}export{p as toGraphic,l as toOwner};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{acosClamped as t,reciprocalClamped as e}from"../../../../core/mathUtils.js";import{s as i}from"../../../../chunks/mat2.js";import{c as s}from"../../../../chunks/mat2f64.js";import{j as r,d as o}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{b as n,i as a,p as l,h as u,g as p,f,j as c,o as x}from"../../../../chunks/vec2.js";import{a as d,b as v,f as m}from"../../../../chunks/vec2f64.js";import{e as g,c as V,a as b,n as A,g as C,b as D,f as I,o as R,s as N,l as P,m as S}from"../../../../chunks/vec3.js";import{c as U}from"../../../../chunks/vec3f64.js";import{create as _,fromPositionAndNormal as y,intersectRay as T}from"../../../../geometry/support/plane.js";import{wrap as L}from"../../../../geometry/support/ray.js";import F from"./GeometryUtil.js";import{VertexAttribute as O}from"./VertexAttribute.js";import{intersectTriangles as M}from"../materials/internal/MaterialUtil.js";function k(){return{up:U(),right:U()}}function E(t,e,i){S(t.up,e.up,i),S(t.right,e.right,i)}function B(t,e,i){t[0]=i[0]*e.right[0]+i[1]*e.up[0],t[1]=i[0]*e.right[1]+i[1]*e.up[1],t[2]=i[0]*e.right[2]+i[1]*e.up[2]}function w(t,e,i){n(t,g(i,e.right),g(i,e.up))}class G{constructor(){this.pos=U(),this.posES=U(),this.posGS=U(),this.vRight=U(),this.vLeft=U(),this.frame=k(),this.rotationFrame=k(),this.rotationRight=d(),this.rotationAngle=0,this.miterStretch=s()}setFrameFromUpVector(t){V(this.frame.up,t),b(at,this.vLeft,this.vRight),A(at,at),C(nt,this.frame.up,g(at,this.frame.up)),D(pt,at,nt),A(pt,pt),I(this.frame.right,pt,this.frame.up)}computeRotationAxisAndAngleFromUpVector(){V(this.rotationFrame.up,this.frame.up),V(this.rotationFrame.right,this.frame.right),n(this.rotationRight,1,0),C(nt,this.frame.up,g(this.frame.up,this.vLeft)),D(nt,this.vLeft,nt),R(nt,nt),A(nt,nt),C(at,this.frame.up,g(this.frame.up,this.vRight)),D(at,this.vRight,at),A(at,at),I(lt,this.rotationFrame.up,this.vLeft);const s=Math.sign(g(lt,this.vRight));if(this.rotationAngle=s*(Math.PI-t(g(nt,at))),Math.abs(this.rotationAngle)>0){const t=e(Math.cos(.5*this.rotationAngle));i(this.miterStretch,t-1+1,0,0,1)}const r=Math.PI-this.rotationAngle;this.maxStretchDistance=Math.abs(Math.min(this.vLeftLength,this.vRightLength)/Math.cos(.5*r))}}class j{constructor(){this.vertices=[],this.vertexIndices=[],this.vertexNormals=[],this.poles=[],this.poleIndices=[],this.uvs=null,this.uvIndices=null}addVertex(t,e){return this.vertices.push(v(t)),this.vertexNormals.push(v(e)),this.vertices.length-1}addUV(t){return this.uvs||(this.uvs=[],this.uvIndices=[]),this.uvs.push(t),this.uvs.length-1}addPole(t,e=null){return this.poles.push({position:v(t),normal:e?v(e):null}),this.poles.length-1}addSegment(t,e=null,i=null){this.vertexIndices.push(t.v0),this.vertexIndices.push(t.v1),e&&(this.uvIndices.push(e.v0),this.uvIndices.push(e.v1)),i&&(this.poleIndices.push(i.v0),this.poleIndices.push(i.v1))}get numSegments(){return this.vertexIndices.length/2}hasUV(){return null!=this.uvs}translate(t,e){for(const i of this.vertices)i[0]+=t,i[1]+=e;for(const i of this.poles)i.position[0]+=t,i.position[1]+=e}static circle(t=20){const e=.5,i=new j,s={v0:0,v1:0};i.addPole(m(0,0));for(let h=0;h<t;++h){const s=2*h*Math.PI/t,r=Math.cos(s),o=Math.sin(s),n=m(r*e,o*e),a=m(r,o);i.addVertex(n,a),i.addUV(h/t)}i.addUV(1);for(let h=0;h<t-1;++h){const t={v0:h,v1:h+1},e=t;i.addSegment(t,e,s)}const r={v0:t-1,v1:0},o={v0:t-1,v1:t};return i.addSegment(r,o,s),i}static rect(){const t=1,e=1,i=new j,s=m(.5*-t,.5*-e),r=m(.5*t,.5*-e),o=m(.5*t,.5*e),h=m(.5*-t,.5*e),n=m(0,-1),a=m(1,0),l=m(0,1),u=m(-1,0);i.addUV(0),i.addUV(1),i.addPole(m(0,.5*e),l),i.addPole(m(0,.5*e)),i.addPole(m(0,.5*-e)),i.addPole(m(0,.5*-e),n);const p={v0:0,v1:1};return i.addVertex(s,n),i.addVertex(r,n),i.addSegment({v0:0,v1:1},p,{v0:3,v1:3}),i.addVertex(r,a),i.addVertex(o,a),i.addSegment({v0:2,v1:3},p,{v0:2,v1:1}),i.addVertex(o,l),i.addVertex(h,l),i.addSegment({v0:4,v1:5},p,{v0:0,v1:0}),i.addVertex(h,u),i.addVertex(s,u),i.addSegment({v0:6,v1:7},p,{v0:1,v1:2}),i}}class z{constructor(t){this.vertices=[],this.offset=U(),this.xform=h(),this.vertices=t;const e=Math.floor((t.length-1)/2);V(this.offset,this.vertices[e].pos);for(const i of this.vertices)D(i.pos,i.pos,this.offset);r(this.xform,this.xform,this.offset),this.updatePathVertexInformation()}updatePathVertexInformation(){const t=this.vertices.length;let e=this.vertices[0];e.index=0,N(e.vLeft,0,0,0),e.vLeftLength=0,D(e.vRight,this.vertices[1].pos,e.pos),e.vRightLength=P(e.vRight),A(e.vRight,e.vRight);let i=e;for(let s=1;s<t;++s)e=this.vertices[s],e.index=s,V(e.vLeft,i.vRight),e.vLeftLength=i.vRightLength,s<t-1?(D(e.vRight,this.vertices[s+1].pos,e.pos),e.vRightLength=P(e.vRight),A(e.vRight,e.vRight)):(V(e.vRight,e.vLeft),e.vRightLength=e.vLeftLength),i=e}}function J(t,e){let i=null;const s=t.vertices.length,r=.99619469809,o=U(),h=U(),n=U(),a=U(),l=U(),u=U(),p=_();let f=t.vertices[0];V(h,e),N(o,0,1,0),F.makeOrthoBasisDirUpFallback(f.vRight,h,o,o,n,h,r),V(f.frame.up,h),V(f.frame.right,n),i=f;for(let c=1;c<s;++c){f=t.vertices[c],b(l,f.vLeft,f.vRight);let e=P(l);e>0?(e=1/Math.sqrt(e),l[0]=l[0]*e,l[1]=l[1]*e,l[2]=l[2]*e):(l[0]=f.vRight[0],l[1]=f.vRight[1],l[2]=f.vRight[2]),b(u,i.pos,i.frame.up),y(f.pos,l,p);T(p,L(u,f.vLeft),a)?(D(a,a,f.pos),A(h,a),I(n,l,h),A(n,n)):F.makeOrthoBasisDirUpFallback(l,i.frame.up,i.frame.right,o,n,h,r),V(f.frame.up,h),V(f.frame.right,n),i=f}}class H{}class X{numProfilesPerJoin(){return 1}extrude(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],!1)}}class q{constructor(t=.8*Math.PI,e=1){this.cutoffAngle=t,this.numBendSubdivisions=e}numProfilesPerJoin(){return this.numBendSubdivisions+1}extrude(t,e,i){const s=ft;if(Math.abs(t.rotationAngle)>=this.cutoffAngle)for(let r=0;r<this.numBendSubdivisions+1;++r){o(ct,.5*-t.rotationAngle+r*t.rotationAngle/this.numBendSubdivisions,t.rotationFrame.up),E(s,t.frame,ct);for(let r=0;r<e.vertices.length;++r){a(e.vertices[r],t.rotationRight)*t.rotationAngle>=0?i(t.index,s,e.vertices[r],e.vertexNormals[r],!1):(l(rt,e.vertices[r],t.miterStretch),i(t.index,t.frame,rt,e.vertexNormals[r],!0))}}else for(let r=0;r<this.numBendSubdivisions+1;++r)for(let s=0;s<e.vertices.length;++s){const r=a(e.vertices[s],t.rotationRight)*t.rotationAngle>=0;l(rt,e.vertices[s],t.miterStretch),i(t.index,t.frame,rt,e.vertexNormals[s],!r)}}}const K={generateUV:!1};class Q{rebuildConnectingProfileGeometry(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],0,0)}}class W extends Q{constructor(){super()}getNumVertices(){return 0}getNumIndices(){return 0}rebuildCapGeometry(){}buildTopology(){}}class Y extends Q{constructor(t,e=0,i=!1){super(),this.profile=t,this.profilePlaneOffset=e,this.flip=i}getNumVertices(){return this.profile.vertices.length}getNumIndices(){return 3*this.profile.numSegments}rebuildConnectingProfileGeometry(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],this.profilePlaneOffset,0)}rebuildCapGeometry(t,e){const i=ot;n(i,0,0);const s=this.flip?1:-1;for(let r=0;r<this.profile.vertices.length;++r)e(t.index,t.frame,this.profile.vertices[r],i,this.profilePlaneOffset,s)}buildTopology(t,e){const i=this.vertexBufferStart+this.profile.vertexIndices[0];for(let s=1;s<this.profile.numSegments;++s){const t=this.profile.vertexIndices[2*s+0],r=this.profile.vertexIndices[2*s+1],o=this.vertexBufferStart+t,h=this.vertexBufferStart+r;this.flip?e(h,o,i):e(i,o,h)}}}class Z extends Q{constructor(t){super(),this.flip=!1,this.sign=0,this.breakNormals=!1,this.numSegments=3,this.profile=t.profile,this.flip=t.flip,this.sign=this.flip?1:-1,this.breakNormals=t.breakNormals,this.numSegments=t.subdivisions}getNumVertices(){let t=0;return t=this.profile.vertices.length*(this.numSegments-1),this.breakNormals&&(t+=this.profile.vertices.length),t+=this.profile.poles.length,t}getNumIndices(){let t=0;t+=2*this.profile.numSegments*(this.numSegments-1);for(let e=0;e<this.profile.numSegments;++e){const i=this.profile.vertexIndices[2*e+0],s=this.profile.vertexIndices[2*e+1];this.profile.poleIndices[i]===this.profile.poleIndices[s]?t+=1:t+=2}return 3*t}rebuildCapGeometry(t,e){const i=t.frame,s=.5*this.sign,r=rt,o=ot;n(o,0,0);for(let h=0;h<this.profile.poles.length;++h){const r=this.profile.poles[h];r.normal?e(t.index,i,r.position,r.normal,s,0):e(t.index,i,r.position,o,s,this.sign)}if(this.breakNormals)for(let h=0;h<this.profile.vertices.length;++h)e(t.index,i,this.profile.vertices[h],this.profile.vertexNormals[h],0,0);for(let h=0;h<this.numSegments-1;++h){const n=(1-(h+1)/this.numSegments)*Math.PI*.5,a=Math.sin(n),l=Math.cos(n);for(let h=0;h<this.profile.vertices.length;++h){const n=this.profile.poles[this.profile.poleIndices[h]];u(r,this.profile.vertices[h],n.position),p(r,r,a),n.normal?(f(r,r,n.position),e(t.index,i,r,n.normal,s*l,0)):(c(o,r),p(o,o,a),f(r,r,n.position),e(t.index,i,r,o,s*l,this.sign*l))}}}buildTopology(t,e){const i=this.breakNormals?this.vertexBufferStart+this.profile.poles.length:this.firstProfileVertexIndex,s=this.breakNormals?this.vertexBufferStart+this.profile.poles.length+this.profile.vertices.length:this.vertexBufferStart+this.profile.poles.length;for(let r=0;r<this.profile.numSegments;++r){const t=this.profile.vertexIndices[2*r+0],o=this.profile.vertexIndices[2*r+1],h=this.vertexBufferStart+this.profile.poleIndices[t],n=this.vertexBufferStart+this.profile.poleIndices[o];let a=i+t,l=i+o;for(let i=0;i<this.numSegments-1;++i){const r=s+i*this.profile.vertices.length+t,h=s+i*this.profile.vertices.length+o;this.flip?(e(r,l,a),e(l,r,h)):(e(a,l,r),e(h,r,l)),a=r,l=h}this.flip?(e(h,l,a),h!==n&&e(h,n,l)):(e(a,l,h),h!==n&&e(l,n,h))}}}class ${constructor(t,e,i,s,r,o=K){this.options=o,this._extrusionVertexCount=0,this._triangleCount=0,this.numExtrusionProfiles=0,this.numVerticesTotal=0,this.numNormalsTotal=0,this.numUVTotal=0,this.profile=e,this.path=t,this.extruder=i,this.startCap=s,this.endCap=r;const h=this.path.vertices.length-2;this.numExtrusionProfiles=i.numProfilesPerJoin()*h+2,this.numVerticesTotal=e.vertices.length*this.numExtrusionProfiles,this.numNormalsTotal=this.numVerticesTotal,this.startCap.vertexBufferStart=this.numVerticesTotal;const n=this.startCap.getNumVertices();this.numVerticesTotal+=n,this.numNormalsTotal+=n,this.endCap.vertexBufferStart=this.numVerticesTotal;const a=this.endCap.getNumVertices();this.numVerticesTotal+=a,this.numNormalsTotal+=a,this.pathVertexData=new Float32Array(1*this.numVerticesTotal),this.profileRightAxisData=new Float32Array(4*this.numVerticesTotal),this.profileUpAxisData=new Float32Array(4*this.numVerticesTotal),this.profileVertexAndNormalData=new Float32Array(4*this.numVerticesTotal),this.profile.hasUV()&&this.options.generateUV&&(this.numUVTotal=this.profile.uvs.length,this.uvData=new Float32Array(2*this.numUVTotal)),this.originData=new Float32Array(3*this.path.vertices.length),this._rebuildGeometry(),this.buildTopology()}emitVertex(t,e,i,s,r){if(this.profileRightAxisData[4*this._extrusionVertexCount+0]=e.right[0],this.profileRightAxisData[4*this._extrusionVertexCount+1]=e.right[1],this.profileRightAxisData[4*this._extrusionVertexCount+2]=e.right[2],this.profileUpAxisData[4*this._extrusionVertexCount+0]=e.up[0],this.profileUpAxisData[4*this._extrusionVertexCount+1]=e.up[1],this.profileUpAxisData[4*this._extrusionVertexCount+2]=e.up[2],this.profileVertexAndNormalData[4*this._extrusionVertexCount+0]=i[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+1]=i[1],this.profileVertexAndNormalData[4*this._extrusionVertexCount+2]=s[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,r){const e=this.path.vertices[t];this.profileRightAxisData[4*this._extrusionVertexCount+3]=e.rotationRight[0]*e.maxStretchDistance,this.profileUpAxisData[4*this._extrusionVertexCount+3]=e.rotationRight[1]*e.maxStretchDistance}else this.profileRightAxisData[4*this._extrusionVertexCount+3]=0,this.profileUpAxisData[4*this._extrusionVertexCount+3]=0;++this._extrusionVertexCount}emitCapVertex(t,e,i,s,r,o){this.profileRightAxisData[4*this._extrusionVertexCount+0]=e.right[0],this.profileRightAxisData[4*this._extrusionVertexCount+1]=e.right[1],this.profileRightAxisData[4*this._extrusionVertexCount+2]=e.right[2],this.profileUpAxisData[4*this._extrusionVertexCount+0]=e.up[0],this.profileUpAxisData[4*this._extrusionVertexCount+1]=e.up[1],this.profileUpAxisData[4*this._extrusionVertexCount+2]=e.up[2],this.profileVertexAndNormalData[4*this._extrusionVertexCount+0]=i[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+1]=i[1],this.profileVertexAndNormalData[4*this._extrusionVertexCount+2]=s[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,this.profileRightAxisData[4*this._extrusionVertexCount+3]=r,this.profileUpAxisData[4*this._extrusionVertexCount+3]=o,++this._extrusionVertexCount}emitTriangle(t,e,i){this.vertexIndices[3*this._triangleCount+0]=t,this.vertexIndices[3*this._triangleCount+1]=e,this.vertexIndices[3*this._triangleCount+2]=i,this.pathVertexIndices[3*this._triangleCount+0]=this.pathVertexData[t],this.pathVertexIndices[3*this._triangleCount+1]=this.pathVertexData[e],this.pathVertexIndices[3*this._triangleCount+2]=this.pathVertexData[i],this.normalIndices[3*this._triangleCount+0]=t,this.normalIndices[3*this._triangleCount+1]=e,this.normalIndices[3*this._triangleCount+2]=i,++this._triangleCount}_rebuildGeometry(){const t=(t,e,i,s,r)=>this.emitVertex(t,e,i,s,r),e=(t,e,i,s,r,o)=>this.emitCapVertex(t,e,i,s,r,o);this._extrusionVertexCount=0;for(const i of this.path.vertices)this.originData[3*i.index+0]=i.pos[0],this.originData[3*i.index+1]=i.pos[1],this.originData[3*i.index+2]=i.pos[2];this.startCap.rebuildConnectingProfileGeometry(this.path.vertices[0],this.profile,e);for(let i=1;i<this.path.vertices.length-1;++i)this.extruder.extrude(this.path.vertices[i],this.profile,t);if(this.endCap.rebuildConnectingProfileGeometry(this.path.vertices[this.path.vertices.length-1],this.profile,e),this.startCap.rebuildCapGeometry(this.path.vertices[0],e),this.endCap.rebuildCapGeometry(this.path.vertices[this.path.vertices.length-1],e),this.profile.hasUV()&&this.options.generateUV)for(let i=0;i<this.profile.uvs.length;++i)this.uvData[2*i+0]=this.profile.uvs[i],this.uvData[2*i+1]=0}buildTopology(){const t=(t,e,i)=>this.emitTriangle(t,e,i);this._triangleCount=0;const e=this.profile.vertices.length,i=this.profile.numSegments,s=this.numExtrusionProfiles-1;let r=3*(2*(i*s));this.startCap.indexBufferStart=r,this.startCap.firstProfileVertexIndex=0,r+=this.startCap.getNumIndices(),this.endCap.indexBufferStart=r,this.endCap.firstProfileVertexIndex=e*(this.numExtrusionProfiles-1),r+=this.endCap.getNumIndices(),this.vertexIndices=new Uint32Array(r),this.normalIndices=new Uint32Array(r),this.pathVertexIndices=new Uint32Array(r),this.profile.hasUV()&&this.options.generateUV&&(this.uvIndices=new Uint32Array(r));for(let o=0;o<i;++o){const i=this.profile.vertexIndices[2*o],r=this.profile.vertexIndices[2*o+1];for(let o=0;o<s;++o){const s=o*e+i,h=(o+1)*e+r,n=o*e+r;t(s,(o+1)*e+i,h),t(s,h,n)}}this.startCap.buildTopology(this.path.vertices[0],t),this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],t)}onPathChanged(){this._rebuildGeometry()}}class tt{constructor(t){this.builder=t}get xform(){return this.builder.path.xform}onPathChanged(){this.builder.onPathChanged()}}class et extends tt{constructor(t){super(t),this.vertexAttributePosition=null,this.vertexAttributeNormal=null,this.vertexAttributeColor=null,this.vertexAttributePosition=new Float32Array(3*this.builder.numVerticesTotal),this.vertexAttributeNormal=new Float32Array(3*this.builder.numNormalsTotal),this.vertexAttributeColor=new Uint8Array(4),this.vertexAttributeColor[0]=255,this.vertexAttributeColor[1]=255,this.vertexAttributeColor[2]=255,this.vertexAttributeColor[3]=255}bakeVertexColors(t){this.vertexAttributeColor[0]=255*t[0],this.vertexAttributeColor[1]=255*t[1],this.vertexAttributeColor[2]=255*t[2],this.vertexAttributeColor[3]=255*(t.length>3?t[3]:1)}bake(t){this.size=t;for(let e=0;e<this.builder.numVerticesTotal;++e){let i=this.builder.pathVertexData[e];const s=0===i||i===this.builder.path.vertices.length-1;i*=3;const r=st;N(r,this.builder.originData[i++],this.builder.originData[i++],this.builder.originData[i]);const o=4*e,h=nt,l=rt,u=at,d=lt,v=ut;let m=0,g=0;if(N(d,this.builder.profileRightAxisData[o],this.builder.profileRightAxisData[o+1],this.builder.profileRightAxisData[o+2]),N(v,this.builder.profileUpAxisData[o],this.builder.profileUpAxisData[o+1],this.builder.profileUpAxisData[o+2]),n(l,this.builder.profileVertexAndNormalData[o]*t[0],this.builder.profileVertexAndNormalData[o+1]*t[1]),s)I(u,v,d),m=this.builder.profileRightAxisData[o+3]*t[0],g=this.builder.profileUpAxisData[o+3];else{const t=ot,e=ht;n(t,this.builder.profileRightAxisData[o+3],this.builder.profileUpAxisData[o+3]);const i=x(t);c(t,t);const s=a(l,t);if(Math.abs(s)>i){n(e,-t[1],t[0]);const r=a(l,e);p(t,t,i*Math.sign(s)),p(e,e,r),f(l,t,e)}N(u,0,0,0)}N(h,d[0]*l[0]+v[0]*l[1],d[1]*l[0]+v[1]*l[1],d[2]*l[0]+v[2]*l[1]),this.vertexAttributePosition[3*e+0]=r[0]+h[0]+u[0]*m,this.vertexAttributePosition[3*e+1]=r[1]+h[1]+u[1]*m,this.vertexAttributePosition[3*e+2]=r[2]+h[2]+u[2]*m;const V=rt;n(V,this.builder.profileVertexAndNormalData[o+2],this.builder.profileVertexAndNormalData[o+3]),this.vertexAttributeNormal[3*e+0]=d[0]*V[0]+v[0]*V[1]+u[0]*g,this.vertexAttributeNormal[3*e+1]=d[1]*V[0]+v[1]*V[1]+u[1]*g,this.vertexAttributeNormal[3*e+2]=d[2]*V[0]+v[2]*V[1]+u[2]*g}}createGeometryData(){const t=[[O.POSITION,this.builder.vertexIndices],[O.NORMAL,this.builder.normalIndices]],e=[[O.POSITION,{size:3,data:this.vertexAttributePosition,exclusive:!0}],[O.NORMAL,{size:3,data:this.vertexAttributeNormal,exclusive:!0}]];if(this.vertexAttributeColor){const i=this.builder.vertexIndices.length;t.push([O.COLOR,new Uint32Array(i)]),e.push([O.COLOR,{size:4,data:this.vertexAttributeColor}])}return{vertexAttributes:e,indices:t}}onPathChanged(){super.onPathChanged(),this.bake(this.size)}intersect(t,e,i){const s=this.builder.vertexIndices,r={size:3,data:this.vertexAttributePosition},o=s.length/3;M(t,e,0,o,s,r,void 0,void 0,i)}}class it extends tt{constructor(t,e,i,s){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=i,this.opacityAttributeValue=s,this.vvData=null,this.baked=new et(t),this.vvData=new Float32Array(4*this.builder.path.vertices.length);for(let r=0;r<this.builder.path.vertices.length;++r){this.vvData[4*r+0]=e,this.vvData[4*r+1]=i,this.vvData[4*r+2]=s;const t=0===r||r===this.builder.path.vertices.length-1;this.vvData[4*r+3]=t?1:0}}createGeometryData(){return{vertexAttributes:[[O.POSITION,{size:3,data:this.builder.originData,exclusive:!0}],[O.PROFILERIGHT,{size:4,data:this.builder.profileRightAxisData,exclusive:!0}],[O.PROFILEUP,{size:4,data:this.builder.profileUpAxisData,exclusive:!0}],[O.PROFILEVERTEXANDNORMAL,{size:4,data:this.builder.profileVertexAndNormalData,exclusive:!0}],[O.FEATUREVALUE,{size:4,data:this.vvData,exclusive:!0}]],indices:[[O.POSITION,this.builder.pathVertexIndices],[O.PROFILERIGHT,this.builder.vertexIndices],[O.PROFILEUP,this.builder.vertexIndices],[O.PROFILEVERTEXANDNORMAL,this.builder.vertexIndices],[O.FEATUREVALUE,this.builder.pathVertexIndices]]}}}const st=U(),rt=d(),ot=d(),ht=d(),nt=U(),at=U(),lt=U(),ut=U(),pt=U(),ft=k(),ct=h();export{$ as Builder,Q as CapBuilder,H as Extruder,it as FastUpdatePathGeometry,q as MiterExtruder,W as NoCapBuilder,z as Path,tt as PathGeometryData,G as PathVertex,j as Profile,Z as RoundCapBuilder,X as SimpleExtruder,et as StaticPathGeometry,Y as TriangulationCapBuilder,J as computeMinimumRotationTangentFrame,k as makeFrame,B as profileSpaceToVertexSpace,w as vertexSpaceToProfileSpace};
5
+ import{acosClamped as t,reciprocalClamped as e}from"../../../../core/mathUtils.js";import{s as i}from"../../../../chunks/mat2.js";import{c as s}from"../../../../chunks/mat2f64.js";import{j as r,d as o}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{b as n,i as a,p as l,h as u,g as p,f,j as c,o as x}from"../../../../chunks/vec2.js";import{a as d,d as v,f as m}from"../../../../chunks/vec2f64.js";import{e as g,c as V,a as A,n as b,g as C,b as D,f as I,o as R,s as N,l as P,m as S}from"../../../../chunks/vec3.js";import{c as U}from"../../../../chunks/vec3f64.js";import{create as _,fromPositionAndNormal as y,intersectRay as T}from"../../../../geometry/support/plane.js";import{wrap as L}from"../../../../geometry/support/ray.js";import F from"./GeometryUtil.js";import{VertexAttribute as O}from"./VertexAttribute.js";import{intersectTriangles as M}from"../materials/internal/MaterialUtil.js";function k(){return{up:U(),right:U()}}function E(t,e,i){S(t.up,e.up,i),S(t.right,e.right,i)}function B(t,e,i){t[0]=i[0]*e.right[0]+i[1]*e.up[0],t[1]=i[0]*e.right[1]+i[1]*e.up[1],t[2]=i[0]*e.right[2]+i[1]*e.up[2]}function w(t,e,i){n(t,g(i,e.right),g(i,e.up))}class G{constructor(){this.pos=U(),this.posES=U(),this.posGS=U(),this.vRight=U(),this.vLeft=U(),this.frame=k(),this.rotationFrame=k(),this.rotationRight=d(),this.rotationAngle=0,this.miterStretch=s()}setFrameFromUpVector(t){V(this.frame.up,t),A(at,this.vLeft,this.vRight),b(at,at),C(nt,this.frame.up,g(at,this.frame.up)),D(pt,at,nt),b(pt,pt),I(this.frame.right,pt,this.frame.up)}computeRotationAxisAndAngleFromUpVector(){V(this.rotationFrame.up,this.frame.up),V(this.rotationFrame.right,this.frame.right),n(this.rotationRight,1,0),C(nt,this.frame.up,g(this.frame.up,this.vLeft)),D(nt,this.vLeft,nt),R(nt,nt),b(nt,nt),C(at,this.frame.up,g(this.frame.up,this.vRight)),D(at,this.vRight,at),b(at,at),I(lt,this.rotationFrame.up,this.vLeft);const s=Math.sign(g(lt,this.vRight));if(this.rotationAngle=s*(Math.PI-t(g(nt,at))),Math.abs(this.rotationAngle)>0){const t=e(Math.cos(.5*this.rotationAngle));i(this.miterStretch,t-1+1,0,0,1)}const r=Math.PI-this.rotationAngle;this.maxStretchDistance=Math.abs(Math.min(this.vLeftLength,this.vRightLength)/Math.cos(.5*r))}}class j{constructor(){this.vertices=[],this.vertexIndices=[],this.vertexNormals=[],this.poles=[],this.poleIndices=[],this.uvs=null,this.uvIndices=null}addVertex(t,e){return this.vertices.push(v(t)),this.vertexNormals.push(v(e)),this.vertices.length-1}addUV(t){return this.uvs||(this.uvs=[],this.uvIndices=[]),this.uvs.push(t),this.uvs.length-1}addPole(t,e=null){return this.poles.push({position:v(t),normal:e?v(e):null}),this.poles.length-1}addSegment(t,e=null,i=null){this.vertexIndices.push(t.v0),this.vertexIndices.push(t.v1),e&&(this.uvIndices.push(e.v0),this.uvIndices.push(e.v1)),i&&(this.poleIndices.push(i.v0),this.poleIndices.push(i.v1))}get numSegments(){return this.vertexIndices.length/2}hasUV(){return null!=this.uvs}translate(t,e){for(const i of this.vertices)i[0]+=t,i[1]+=e;for(const i of this.poles)i.position[0]+=t,i.position[1]+=e}static circle(t=20){const e=.5,i=new j,s={v0:0,v1:0};i.addPole(m(0,0));for(let h=0;h<t;++h){const s=2*h*Math.PI/t,r=Math.cos(s),o=Math.sin(s),n=m(r*e,o*e),a=m(r,o);i.addVertex(n,a),i.addUV(h/t)}i.addUV(1);for(let h=0;h<t-1;++h){const t={v0:h,v1:h+1},e=t;i.addSegment(t,e,s)}const r={v0:t-1,v1:0},o={v0:t-1,v1:t};return i.addSegment(r,o,s),i}static rect(){const t=1,e=1,i=new j,s=m(.5*-t,.5*-e),r=m(.5*t,.5*-e),o=m(.5*t,.5*e),h=m(.5*-t,.5*e),n=m(0,-1),a=m(1,0),l=m(0,1),u=m(-1,0);i.addUV(0),i.addUV(1),i.addPole(m(0,.5*e),l),i.addPole(m(0,.5*e)),i.addPole(m(0,.5*-e)),i.addPole(m(0,.5*-e),n);const p={v0:0,v1:1};return i.addVertex(s,n),i.addVertex(r,n),i.addSegment({v0:0,v1:1},p,{v0:3,v1:3}),i.addVertex(r,a),i.addVertex(o,a),i.addSegment({v0:2,v1:3},p,{v0:2,v1:1}),i.addVertex(o,l),i.addVertex(h,l),i.addSegment({v0:4,v1:5},p,{v0:0,v1:0}),i.addVertex(h,u),i.addVertex(s,u),i.addSegment({v0:6,v1:7},p,{v0:1,v1:2}),i}}class z{constructor(t){this.vertices=[],this.offset=U(),this.xform=h(),this.vertices=t;const e=Math.floor((t.length-1)/2);V(this.offset,this.vertices[e].pos);for(const i of this.vertices)D(i.pos,i.pos,this.offset);r(this.xform,this.xform,this.offset),this.updatePathVertexInformation()}updatePathVertexInformation(){const t=this.vertices.length;let e=this.vertices[0];e.index=0,N(e.vLeft,0,0,0),e.vLeftLength=0,D(e.vRight,this.vertices[1].pos,e.pos),e.vRightLength=P(e.vRight),b(e.vRight,e.vRight);let i=e;for(let s=1;s<t;++s)e=this.vertices[s],e.index=s,V(e.vLeft,i.vRight),e.vLeftLength=i.vRightLength,s<t-1?(D(e.vRight,this.vertices[s+1].pos,e.pos),e.vRightLength=P(e.vRight),b(e.vRight,e.vRight)):(V(e.vRight,e.vLeft),e.vRightLength=e.vLeftLength),i=e}}function J(t,e){let i=null;const s=t.vertices.length,r=.99619469809,o=U(),h=U(),n=U(),a=U(),l=U(),u=U(),p=_();let f=t.vertices[0];V(h,e),N(o,0,1,0),F.makeOrthoBasisDirUpFallback(f.vRight,h,o,o,n,h,r),V(f.frame.up,h),V(f.frame.right,n),i=f;for(let c=1;c<s;++c){f=t.vertices[c],A(l,f.vLeft,f.vRight);let e=P(l);e>0?(e=1/Math.sqrt(e),l[0]=l[0]*e,l[1]=l[1]*e,l[2]=l[2]*e):(l[0]=f.vRight[0],l[1]=f.vRight[1],l[2]=f.vRight[2]),A(u,i.pos,i.frame.up),y(f.pos,l,p);T(p,L(u,f.vLeft),a)?(D(a,a,f.pos),b(h,a),I(n,l,h),b(n,n)):F.makeOrthoBasisDirUpFallback(l,i.frame.up,i.frame.right,o,n,h,r),V(f.frame.up,h),V(f.frame.right,n),i=f}}class H{}class X{numProfilesPerJoin(){return 1}extrude(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],!1)}}class q{constructor(t=.8*Math.PI,e=1){this.cutoffAngle=t,this.numBendSubdivisions=e}numProfilesPerJoin(){return this.numBendSubdivisions+1}extrude(t,e,i){const s=ft;if(Math.abs(t.rotationAngle)>=this.cutoffAngle)for(let r=0;r<this.numBendSubdivisions+1;++r){o(ct,.5*-t.rotationAngle+r*t.rotationAngle/this.numBendSubdivisions,t.rotationFrame.up),E(s,t.frame,ct);for(let r=0;r<e.vertices.length;++r){a(e.vertices[r],t.rotationRight)*t.rotationAngle>=0?i(t.index,s,e.vertices[r],e.vertexNormals[r],!1):(l(rt,e.vertices[r],t.miterStretch),i(t.index,t.frame,rt,e.vertexNormals[r],!0))}}else for(let r=0;r<this.numBendSubdivisions+1;++r)for(let s=0;s<e.vertices.length;++s){const r=a(e.vertices[s],t.rotationRight)*t.rotationAngle>=0;l(rt,e.vertices[s],t.miterStretch),i(t.index,t.frame,rt,e.vertexNormals[s],!r)}}}const K={generateUV:!1};class Q{rebuildConnectingProfileGeometry(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],0,0)}}class W extends Q{constructor(){super()}getNumVertices(){return 0}getNumIndices(){return 0}rebuildCapGeometry(){}buildTopology(){}}class Y extends Q{constructor(t,e=0,i=!1){super(),this.profile=t,this.profilePlaneOffset=e,this.flip=i}getNumVertices(){return this.profile.vertices.length}getNumIndices(){return 3*this.profile.numSegments}rebuildConnectingProfileGeometry(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],this.profilePlaneOffset,0)}rebuildCapGeometry(t,e){const i=ot;n(i,0,0);const s=this.flip?1:-1;for(let r=0;r<this.profile.vertices.length;++r)e(t.index,t.frame,this.profile.vertices[r],i,this.profilePlaneOffset,s)}buildTopology(t,e){const i=this.vertexBufferStart+this.profile.vertexIndices[0];for(let s=1;s<this.profile.numSegments;++s){const t=this.profile.vertexIndices[2*s+0],r=this.profile.vertexIndices[2*s+1],o=this.vertexBufferStart+t,h=this.vertexBufferStart+r;this.flip?e(h,o,i):e(i,o,h)}}}class Z extends Q{constructor(t){super(),this.flip=!1,this.sign=0,this.breakNormals=!1,this.numSegments=3,this.profile=t.profile,this.flip=t.flip,this.sign=this.flip?1:-1,this.breakNormals=t.breakNormals,this.numSegments=t.subdivisions}getNumVertices(){let t=0;return t=this.profile.vertices.length*(this.numSegments-1),this.breakNormals&&(t+=this.profile.vertices.length),t+=this.profile.poles.length,t}getNumIndices(){let t=0;t+=2*this.profile.numSegments*(this.numSegments-1);for(let e=0;e<this.profile.numSegments;++e){const i=this.profile.vertexIndices[2*e+0],s=this.profile.vertexIndices[2*e+1];this.profile.poleIndices[i]===this.profile.poleIndices[s]?t+=1:t+=2}return 3*t}rebuildCapGeometry(t,e){const i=t.frame,s=.5*this.sign,r=rt,o=ot;n(o,0,0);for(let h=0;h<this.profile.poles.length;++h){const r=this.profile.poles[h];r.normal?e(t.index,i,r.position,r.normal,s,0):e(t.index,i,r.position,o,s,this.sign)}if(this.breakNormals)for(let h=0;h<this.profile.vertices.length;++h)e(t.index,i,this.profile.vertices[h],this.profile.vertexNormals[h],0,0);for(let h=0;h<this.numSegments-1;++h){const n=(1-(h+1)/this.numSegments)*Math.PI*.5,a=Math.sin(n),l=Math.cos(n);for(let h=0;h<this.profile.vertices.length;++h){const n=this.profile.poles[this.profile.poleIndices[h]];u(r,this.profile.vertices[h],n.position),p(r,r,a),n.normal?(f(r,r,n.position),e(t.index,i,r,n.normal,s*l,0)):(c(o,r),p(o,o,a),f(r,r,n.position),e(t.index,i,r,o,s*l,this.sign*l))}}}buildTopology(t,e){const i=this.breakNormals?this.vertexBufferStart+this.profile.poles.length:this.firstProfileVertexIndex,s=this.breakNormals?this.vertexBufferStart+this.profile.poles.length+this.profile.vertices.length:this.vertexBufferStart+this.profile.poles.length;for(let r=0;r<this.profile.numSegments;++r){const t=this.profile.vertexIndices[2*r+0],o=this.profile.vertexIndices[2*r+1],h=this.vertexBufferStart+this.profile.poleIndices[t],n=this.vertexBufferStart+this.profile.poleIndices[o];let a=i+t,l=i+o;for(let i=0;i<this.numSegments-1;++i){const r=s+i*this.profile.vertices.length+t,h=s+i*this.profile.vertices.length+o;this.flip?(e(r,l,a),e(l,r,h)):(e(a,l,r),e(h,r,l)),a=r,l=h}this.flip?(e(h,l,a),h!==n&&e(h,n,l)):(e(a,l,h),h!==n&&e(l,n,h))}}}class ${constructor(t,e,i,s,r,o=K){this.options=o,this._extrusionVertexCount=0,this._triangleCount=0,this.numExtrusionProfiles=0,this.numVerticesTotal=0,this.numNormalsTotal=0,this.numUVTotal=0,this.profile=e,this.path=t,this.extruder=i,this.startCap=s,this.endCap=r;const h=this.path.vertices.length-2;this.numExtrusionProfiles=i.numProfilesPerJoin()*h+2,this.numVerticesTotal=e.vertices.length*this.numExtrusionProfiles,this.numNormalsTotal=this.numVerticesTotal,this.startCap.vertexBufferStart=this.numVerticesTotal;const n=this.startCap.getNumVertices();this.numVerticesTotal+=n,this.numNormalsTotal+=n,this.endCap.vertexBufferStart=this.numVerticesTotal;const a=this.endCap.getNumVertices();this.numVerticesTotal+=a,this.numNormalsTotal+=a,this.pathVertexData=new Float32Array(1*this.numVerticesTotal),this.profileRightAxisData=new Float32Array(4*this.numVerticesTotal),this.profileUpAxisData=new Float32Array(4*this.numVerticesTotal),this.profileVertexAndNormalData=new Float32Array(4*this.numVerticesTotal),this.profile.hasUV()&&this.options.generateUV&&(this.numUVTotal=this.profile.uvs.length,this.uvData=new Float32Array(2*this.numUVTotal)),this.originData=new Float32Array(3*this.path.vertices.length),this._rebuildGeometry(),this.buildTopology()}emitVertex(t,e,i,s,r){if(this.profileRightAxisData[4*this._extrusionVertexCount+0]=e.right[0],this.profileRightAxisData[4*this._extrusionVertexCount+1]=e.right[1],this.profileRightAxisData[4*this._extrusionVertexCount+2]=e.right[2],this.profileUpAxisData[4*this._extrusionVertexCount+0]=e.up[0],this.profileUpAxisData[4*this._extrusionVertexCount+1]=e.up[1],this.profileUpAxisData[4*this._extrusionVertexCount+2]=e.up[2],this.profileVertexAndNormalData[4*this._extrusionVertexCount+0]=i[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+1]=i[1],this.profileVertexAndNormalData[4*this._extrusionVertexCount+2]=s[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,r){const e=this.path.vertices[t];this.profileRightAxisData[4*this._extrusionVertexCount+3]=e.rotationRight[0]*e.maxStretchDistance,this.profileUpAxisData[4*this._extrusionVertexCount+3]=e.rotationRight[1]*e.maxStretchDistance}else this.profileRightAxisData[4*this._extrusionVertexCount+3]=0,this.profileUpAxisData[4*this._extrusionVertexCount+3]=0;++this._extrusionVertexCount}emitCapVertex(t,e,i,s,r,o){this.profileRightAxisData[4*this._extrusionVertexCount+0]=e.right[0],this.profileRightAxisData[4*this._extrusionVertexCount+1]=e.right[1],this.profileRightAxisData[4*this._extrusionVertexCount+2]=e.right[2],this.profileUpAxisData[4*this._extrusionVertexCount+0]=e.up[0],this.profileUpAxisData[4*this._extrusionVertexCount+1]=e.up[1],this.profileUpAxisData[4*this._extrusionVertexCount+2]=e.up[2],this.profileVertexAndNormalData[4*this._extrusionVertexCount+0]=i[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+1]=i[1],this.profileVertexAndNormalData[4*this._extrusionVertexCount+2]=s[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,this.profileRightAxisData[4*this._extrusionVertexCount+3]=r,this.profileUpAxisData[4*this._extrusionVertexCount+3]=o,++this._extrusionVertexCount}emitTriangle(t,e,i){this.vertexIndices[3*this._triangleCount+0]=t,this.vertexIndices[3*this._triangleCount+1]=e,this.vertexIndices[3*this._triangleCount+2]=i,this.pathVertexIndices[3*this._triangleCount+0]=this.pathVertexData[t],this.pathVertexIndices[3*this._triangleCount+1]=this.pathVertexData[e],this.pathVertexIndices[3*this._triangleCount+2]=this.pathVertexData[i],this.normalIndices[3*this._triangleCount+0]=t,this.normalIndices[3*this._triangleCount+1]=e,this.normalIndices[3*this._triangleCount+2]=i,++this._triangleCount}_rebuildGeometry(){const t=(t,e,i,s,r)=>this.emitVertex(t,e,i,s,r),e=(t,e,i,s,r,o)=>this.emitCapVertex(t,e,i,s,r,o);this._extrusionVertexCount=0;for(const i of this.path.vertices)this.originData[3*i.index+0]=i.pos[0],this.originData[3*i.index+1]=i.pos[1],this.originData[3*i.index+2]=i.pos[2];this.startCap.rebuildConnectingProfileGeometry(this.path.vertices[0],this.profile,e);for(let i=1;i<this.path.vertices.length-1;++i)this.extruder.extrude(this.path.vertices[i],this.profile,t);if(this.endCap.rebuildConnectingProfileGeometry(this.path.vertices[this.path.vertices.length-1],this.profile,e),this.startCap.rebuildCapGeometry(this.path.vertices[0],e),this.endCap.rebuildCapGeometry(this.path.vertices[this.path.vertices.length-1],e),this.profile.hasUV()&&this.options.generateUV)for(let i=0;i<this.profile.uvs.length;++i)this.uvData[2*i+0]=this.profile.uvs[i],this.uvData[2*i+1]=0}buildTopology(){const t=(t,e,i)=>this.emitTriangle(t,e,i);this._triangleCount=0;const e=this.profile.vertices.length,i=this.profile.numSegments,s=this.numExtrusionProfiles-1;let r=3*(2*(i*s));this.startCap.indexBufferStart=r,this.startCap.firstProfileVertexIndex=0,r+=this.startCap.getNumIndices(),this.endCap.indexBufferStart=r,this.endCap.firstProfileVertexIndex=e*(this.numExtrusionProfiles-1),r+=this.endCap.getNumIndices(),this.vertexIndices=new Uint32Array(r),this.normalIndices=new Uint32Array(r),this.pathVertexIndices=new Uint32Array(r),this.profile.hasUV()&&this.options.generateUV&&(this.uvIndices=new Uint32Array(r));for(let o=0;o<i;++o){const i=this.profile.vertexIndices[2*o],r=this.profile.vertexIndices[2*o+1];for(let o=0;o<s;++o){const s=o*e+i,h=(o+1)*e+r,n=o*e+r;t(s,(o+1)*e+i,h),t(s,h,n)}}this.startCap.buildTopology(this.path.vertices[0],t),this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],t)}onPathChanged(){this._rebuildGeometry()}}class tt{constructor(t){this.builder=t}get xform(){return this.builder.path.xform}onPathChanged(){this.builder.onPathChanged()}}class et extends tt{constructor(t){super(t),this.vertexAttributePosition=null,this.vertexAttributeNormal=null,this.vertexAttributeColor=null,this.vertexAttributePosition=new Float32Array(3*this.builder.numVerticesTotal),this.vertexAttributeNormal=new Float32Array(3*this.builder.numNormalsTotal),this.vertexAttributeColor=new Uint8Array(4),this.vertexAttributeColor[0]=255,this.vertexAttributeColor[1]=255,this.vertexAttributeColor[2]=255,this.vertexAttributeColor[3]=255}bakeVertexColors(t){this.vertexAttributeColor[0]=255*t[0],this.vertexAttributeColor[1]=255*t[1],this.vertexAttributeColor[2]=255*t[2],this.vertexAttributeColor[3]=255*(t.length>3?t[3]:1)}bake(t){this.size=t;for(let e=0;e<this.builder.numVerticesTotal;++e){let i=this.builder.pathVertexData[e];const s=0===i||i===this.builder.path.vertices.length-1;i*=3;const r=st;N(r,this.builder.originData[i++],this.builder.originData[i++],this.builder.originData[i]);const o=4*e,h=nt,l=rt,u=at,d=lt,v=ut;let m=0,g=0;if(N(d,this.builder.profileRightAxisData[o],this.builder.profileRightAxisData[o+1],this.builder.profileRightAxisData[o+2]),N(v,this.builder.profileUpAxisData[o],this.builder.profileUpAxisData[o+1],this.builder.profileUpAxisData[o+2]),n(l,this.builder.profileVertexAndNormalData[o]*t[0],this.builder.profileVertexAndNormalData[o+1]*t[1]),s)I(u,v,d),m=this.builder.profileRightAxisData[o+3]*t[0],g=this.builder.profileUpAxisData[o+3];else{const t=ot,e=ht;n(t,this.builder.profileRightAxisData[o+3],this.builder.profileUpAxisData[o+3]);const i=x(t);c(t,t);const s=a(l,t);if(Math.abs(s)>i){n(e,-t[1],t[0]);const r=a(l,e);p(t,t,i*Math.sign(s)),p(e,e,r),f(l,t,e)}N(u,0,0,0)}N(h,d[0]*l[0]+v[0]*l[1],d[1]*l[0]+v[1]*l[1],d[2]*l[0]+v[2]*l[1]),this.vertexAttributePosition[3*e+0]=r[0]+h[0]+u[0]*m,this.vertexAttributePosition[3*e+1]=r[1]+h[1]+u[1]*m,this.vertexAttributePosition[3*e+2]=r[2]+h[2]+u[2]*m;const V=rt;n(V,this.builder.profileVertexAndNormalData[o+2],this.builder.profileVertexAndNormalData[o+3]),this.vertexAttributeNormal[3*e+0]=d[0]*V[0]+v[0]*V[1]+u[0]*g,this.vertexAttributeNormal[3*e+1]=d[1]*V[0]+v[1]*V[1]+u[1]*g,this.vertexAttributeNormal[3*e+2]=d[2]*V[0]+v[2]*V[1]+u[2]*g}}createGeometryData(){const t=[[O.POSITION,this.builder.vertexIndices],[O.NORMAL,this.builder.normalIndices]],e=[[O.POSITION,{size:3,data:this.vertexAttributePosition,exclusive:!0}],[O.NORMAL,{size:3,data:this.vertexAttributeNormal,exclusive:!0}]];if(this.vertexAttributeColor){const i=this.builder.vertexIndices.length;t.push([O.COLOR,new Uint32Array(i)]),e.push([O.COLOR,{size:4,data:this.vertexAttributeColor}])}return{vertexAttributes:e,indices:t}}onPathChanged(){super.onPathChanged(),this.bake(this.size)}intersect(t,e,i){const s=this.builder.vertexIndices,r={size:3,data:this.vertexAttributePosition},o=s.length/3;M(t,e,0,o,s,r,void 0,void 0,i)}}class it extends tt{constructor(t,e,i,s){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=i,this.opacityAttributeValue=s,this.vvData=null,this.baked=new et(t),this.vvData=new Float32Array(4*this.builder.path.vertices.length);for(let r=0;r<this.builder.path.vertices.length;++r){this.vvData[4*r+0]=e,this.vvData[4*r+1]=i,this.vvData[4*r+2]=s;const t=0===r||r===this.builder.path.vertices.length-1;this.vvData[4*r+3]=t?1:0}}createGeometryData(){return{vertexAttributes:[[O.POSITION,{size:3,data:this.builder.originData,exclusive:!0}],[O.PROFILERIGHT,{size:4,data:this.builder.profileRightAxisData,exclusive:!0}],[O.PROFILEUP,{size:4,data:this.builder.profileUpAxisData,exclusive:!0}],[O.PROFILEVERTEXANDNORMAL,{size:4,data:this.builder.profileVertexAndNormalData,exclusive:!0}],[O.FEATUREVALUE,{size:4,data:this.vvData,exclusive:!0}]],indices:[[O.POSITION,this.builder.pathVertexIndices],[O.PROFILERIGHT,this.builder.vertexIndices],[O.PROFILEUP,this.builder.vertexIndices],[O.PROFILEVERTEXANDNORMAL,this.builder.vertexIndices],[O.FEATUREVALUE,this.builder.pathVertexIndices]]}}}const st=U(),rt=d(),ot=d(),ht=d(),nt=U(),at=U(),lt=U(),ut=U(),pt=U(),ft=k(),ct=h();export{$ as Builder,Q as CapBuilder,H as Extruder,it as FastUpdatePathGeometry,q as MiterExtruder,W as NoCapBuilder,z as Path,tt as PathGeometryData,G as PathVertex,j as Profile,Z as RoundCapBuilder,X as SimpleExtruder,et as StaticPathGeometry,Y as TriangulationCapBuilder,J as computeMinimumRotationTangentFrame,k as makeFrame,B as profileSpaceToVertexSpace,w as vertexSpaceToProfileSpace};