@arcgis/core 4.34.0-next.64 → 4.34.0-next.66

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 (260) hide show
  1. package/Graphic.js +1 -1
  2. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/05016b0713ef760fc57d.js +1 -0
  5. package/assets/esri/core/workers/chunks/{861a6d6fe7958df36aa1.js → 06ff5f34ad9bdf9705de.js} +49 -40
  6. package/assets/esri/core/workers/chunks/{eadac757f74470b89a36.js → 0952aeddddc16705b7a3.js} +1 -1
  7. package/assets/esri/core/workers/chunks/09dd8613bc03e7a3a4cb.js +1 -0
  8. package/assets/esri/core/workers/chunks/0c4f07eb3f3dd5cd2c6c.js +1 -0
  9. package/assets/esri/core/workers/chunks/117eb1422e9795d37ea3.js +1 -0
  10. package/assets/esri/core/workers/chunks/{79933271a76a1756584f.js → 12d30c2367652e2c688b.js} +1 -1
  11. package/assets/esri/core/workers/chunks/16fe21ca9b24eaee3069.js +1 -0
  12. package/assets/esri/core/workers/chunks/18c7b1e1fbf7eb6c3c33.js +1 -0
  13. package/assets/esri/core/workers/chunks/{e72aee3f857aa473822c.js → 1c7b5ca80e80c314f78d.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{426232091caf8608e5f1.js → 26b791291689434dde09.js} +1 -1
  15. package/assets/esri/core/workers/chunks/2a938096a42613425c7b.js +1 -0
  16. package/assets/esri/core/workers/chunks/31e7358fe802abb3f8db.js +1 -0
  17. package/assets/esri/core/workers/chunks/3212a476184be25d17f8.js +1 -0
  18. package/assets/esri/core/workers/chunks/3bc50ee639a4d16c4f80.js +1 -0
  19. package/assets/esri/core/workers/chunks/4102ed32b8dbdc32cb3b.js +1 -0
  20. package/assets/esri/core/workers/chunks/{6ab435423acb0ed0b1c7.js → 44031bef6d500167ef0b.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{a29fb90226bd08157bd1.js → 481aea82501d04667ba2.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{7c3a1958990de095d3a1.js → 48316d91c06928f69f61.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{897f9775f06ddbf6486f.js → 4be2bab8ff3bd14ffdfb.js} +1 -1
  24. package/assets/esri/core/workers/chunks/4f0f6653b8e92c633d14.js +1 -0
  25. package/assets/esri/core/workers/chunks/4fda6e90822bc0198b28.js +2 -0
  26. package/assets/esri/core/workers/chunks/548818df658b607a364e.js +1 -0
  27. package/assets/esri/core/workers/chunks/5c053d197935c65792ce.js +1 -0
  28. package/assets/esri/core/workers/chunks/60920d4856a011ace7e2.js +1 -0
  29. package/assets/esri/core/workers/chunks/66cb5b294d7f251c2cc8.js +1 -0
  30. package/assets/esri/core/workers/chunks/66ffefd46fe6175c2af4.js +1 -0
  31. package/assets/esri/core/workers/chunks/6a5b5b80917a5375b9f6.js +1 -0
  32. package/assets/esri/core/workers/chunks/{d1e8220dcae1d01d3c35.js → 707311e24b2f458d9209.js} +1 -1
  33. package/assets/esri/core/workers/chunks/7a17e78c76076ed4476f.js +1 -0
  34. package/assets/esri/core/workers/chunks/7e95896ac41c7e2ca26a.js +1 -0
  35. package/assets/esri/core/workers/chunks/{5d12862042b6bf9f9d54.js → 82cb5defb0593e3017ff.js} +1 -1
  36. package/assets/esri/core/workers/chunks/88b8f33ce1cbf8a0f855.js +33 -0
  37. package/assets/esri/core/workers/chunks/8f60804c7ba445f25df8.js +1 -0
  38. package/assets/esri/core/workers/chunks/9a6d359ead62a8eadd3c.js +1 -0
  39. package/assets/esri/core/workers/chunks/{657b01a6df8dc46c5209.js → 9e3f8c06b4e090a35710.js} +1 -1
  40. package/assets/esri/core/workers/chunks/9eb1bfcb9b05f2a36748.js +1 -0
  41. package/assets/esri/core/workers/chunks/{0a36df6fdab95785d1ce.js → a2963ffc9a8c90822d2d.js} +1 -1
  42. package/assets/esri/core/workers/chunks/ad7aa7d09bfceb12609e.js +1 -0
  43. package/assets/esri/core/workers/chunks/{9f93513037a6e87433c4.js → adfb018f510e19a520fb.js} +1 -1
  44. package/assets/esri/core/workers/chunks/af1030e4c4437d4eb600.js +1 -0
  45. package/assets/esri/core/workers/chunks/{a1bd4eecca1e3272bffb.js → aff553c3d6544e20f188.js} +1 -1
  46. package/assets/esri/core/workers/chunks/b482132638f3b351724c.js +1 -0
  47. package/assets/esri/core/workers/chunks/{e1b25b1ce3bd4f0f2cda.js → bc5fa33afec5354601a1.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{0b53bc76d38e85902748.js → c20aead85cdea91c4b74.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{904c116c6b093e0e970c.js → d1b361b8adf1c719a10a.js} +1 -1
  50. package/assets/esri/core/workers/chunks/dcad3dcbd4ea2f5a6a04.js +1 -0
  51. package/assets/esri/core/workers/chunks/e0fe6bb51ecc9b2faf69.js +1 -0
  52. package/assets/esri/core/workers/chunks/e4e224983c3ee24fc51d.js +1 -0
  53. package/assets/esri/core/workers/chunks/ee391a41144855fc625d.js +1 -0
  54. package/assets/esri/core/workers/chunks/f054557e23978e174686.js +1 -0
  55. package/assets/esri/core/workers/chunks/f5101f5f93f776a6456f.js +1 -0
  56. package/assets/esri/themes/base/widgets/_Attribution.scss +0 -1
  57. package/assets/esri/themes/dark/main.css +1 -1
  58. package/assets/esri/themes/light/main.css +1 -1
  59. package/assets/esri/themes/light/view.css +1 -1
  60. package/chunks/ComponentShader.glsl.js +1 -1
  61. package/chunks/DefaultMaterial.glsl.js +2 -2
  62. package/chunks/Fog.glsl.js +2 -2
  63. package/chunks/{BloomBlur.glsl.js → GlowBlur.glsl.js} +5 -5
  64. package/chunks/GlowComposition.glsl.js +41 -0
  65. package/chunks/Path.glsl.js +1 -1
  66. package/chunks/RealisticTree.glsl.js +18 -15
  67. package/config.js +1 -1
  68. package/core/AsyncUpdate.js +1 -1
  69. package/core/mapCollectionUtils.js +1 -1
  70. package/editing/sharedTemplates/executor/builders/pointAtPolygonCentroid.js +1 -1
  71. package/geometry/Polygon.js +1 -1
  72. package/geometry/support/centroid.js +1 -1
  73. package/geometry/support/geometryUtils.js +1 -1
  74. package/graphic/AggregateGraphicOrigin.js +1 -1
  75. package/graphic/BuildingGraphicOrigin.js +1 -1
  76. package/graphic/CSVGraphicOrigin.js +1 -1
  77. package/graphic/CatalogGraphicOrigin.js +1 -1
  78. package/graphic/FeatureGraphicOrigin.js +1 -1
  79. package/graphic/GeoJSONGraphicOrigin.js +1 -1
  80. package/graphic/GeoRSSGraphicOrigin.js +1 -1
  81. package/graphic/ImageryGraphicOrigin.js +1 -1
  82. package/graphic/ImageryTileGraphicOrigin.js +1 -1
  83. package/graphic/KMLGraphicOrigin.js +1 -1
  84. package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
  85. package/graphic/LinkChartGraphicOrigin.js +1 -1
  86. package/graphic/MapImageGraphicOrigin.js +1 -1
  87. package/graphic/MapNotesGraphicOrigin.js +1 -1
  88. package/graphic/OGCFeatureGraphicOrigin.js +1 -1
  89. package/graphic/OrientedImageryGraphicOrigin.js +1 -1
  90. package/graphic/ParquetGraphicOrigin.js +1 -1
  91. package/graphic/PointCloudGraphicOrigin.js +1 -1
  92. package/graphic/SceneGraphicOrigin.js +1 -1
  93. package/graphic/StreamGraphicOrigin.js +1 -1
  94. package/graphic/SubtypeGroupGraphicOrigin.js +1 -1
  95. package/graphic/TileGraphicOrigin.js +1 -1
  96. package/graphic/TrackGraphicOrigin.js +1 -1
  97. package/graphic/VectorTileGraphicOrigin.js +1 -1
  98. package/graphic/VoxelGraphicOrigin.js +1 -1
  99. package/graphic/WCSGraphicOrigin.js +1 -1
  100. package/graphic/WFSGraphicOrigin.js +1 -1
  101. package/graphic/getIdFieldsProvider.js +5 -0
  102. package/graphic/getSliceableContainer.js +5 -0
  103. package/graphic/graphicOrigins.d.ts +0 -2
  104. package/graphic/graphicOrigins.js +1 -1
  105. package/interfaces.d.ts +141 -60
  106. package/kernel.js +1 -1
  107. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  108. package/layers/IntegratedMeshLayer.js +1 -1
  109. package/layers/LinkChartLayer.js +1 -1
  110. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  111. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  112. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  113. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  114. package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
  115. package/package.json +1 -1
  116. package/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
  117. package/support/revision.js +1 -1
  118. package/symbols/support/previewCIMSymbol.js +1 -1
  119. package/symbols/support/previewSymbol2D.js +1 -1
  120. package/symbols/support/renderUtils.js +1 -1
  121. package/symbols/support/svgUtils.js +1 -1
  122. package/symbols/support/symbolUtils.js +1 -1
  123. package/symbols/support/utils.js +1 -1
  124. package/views/2d/analysis/ElevationProfile/ElevationProfileInputVisualization2D.js +5 -0
  125. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +5 -0
  126. package/views/2d/analysis/ElevationProfile/ElevationProfileVisualization2D.js +5 -0
  127. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  128. package/views/2d/layers/support/visualVariableSimpleUtils.js +1 -1
  129. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization3D.js +5 -0
  130. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +5 -0
  131. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +5 -0
  132. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  133. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  134. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  135. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  136. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  137. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  138. package/views/3d/environment/Fog.js +1 -1
  139. package/views/3d/environment/FogTechniqueConfiguration.js +1 -1
  140. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  141. package/views/3d/layers/I3SMeshView3D.js +1 -1
  142. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  143. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  144. package/views/3d/layers/SceneLayerView3D.js +1 -1
  145. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  146. package/views/3d/layers/i3s/Intersector.js +1 -1
  147. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  148. package/views/3d/layers/support/SublayerPopupHighlightHelper3D.js +1 -1
  149. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  150. package/views/3d/support/hitTest.js +1 -1
  151. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  152. package/views/3d/support/viewpointUtils.js +1 -1
  153. package/views/3d/terrain/Intersector.js +1 -1
  154. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  155. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  156. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentBVH.js +1 -1
  157. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  158. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  159. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  160. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  161. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
  162. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +5 -5
  163. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +4 -4
  164. package/views/3d/webgl-engine/effects/{bloom/BloomBlur.glsl.js → glow/GlowBlur.glsl.js} +1 -1
  165. package/views/3d/webgl-engine/effects/glow/GlowBlurTechnique.js +5 -0
  166. package/views/3d/webgl-engine/effects/{bloom/BloomBlurTechniqueConfiguration.js → glow/GlowBlurTechniqueConfiguration.js} +1 -1
  167. package/views/3d/webgl-engine/effects/{bloom/BloomComposition.glsl.js → glow/GlowComposition.glsl.js} +1 -1
  168. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +5 -0
  169. package/views/3d/webgl-engine/effects/{bloom/BloomCompositionTechniqueConfiguration.js → glow/GlowCompositionTechniqueConfiguration.js} +1 -1
  170. package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +5 -0
  171. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +5 -0
  172. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  173. package/views/3d/webgl-engine/effects/weather/SnowCover.glsl.js +8 -2
  174. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  175. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  176. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  177. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  178. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  179. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  180. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  181. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  182. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  183. package/views/3d/webgl-engine/shaders/GaussianSplatDepthCompositionTechnique.js +1 -1
  184. package/views/3d/webgl-engine/shaders/GaussianSplatTechnique.js +1 -1
  185. package/views/View2D.js +1 -1
  186. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +5 -0
  187. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +5 -0
  188. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  189. package/views/analysis/ElevationProfile/constants.js +1 -1
  190. package/views/analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js +5 -0
  191. package/views/draw/support/createUtils.js +1 -1
  192. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  193. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  194. package/widgets/Legend/styles/card/CardView.js +1 -1
  195. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  196. package/widgets/Legend/styles/card/LegendElement.js +1 -1
  197. package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
  198. package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
  199. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  200. package/widgets/Legend/styles/classic/LegendElement.js +1 -1
  201. package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
  202. package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
  203. package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
  204. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  205. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  206. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  207. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
  208. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  209. package/widgets/UtilityNetworkTrace/support/GraphicHandler.js +1 -1
  210. package/assets/esri/core/workers/chunks/0264905da9fa56166538.js +0 -1
  211. package/assets/esri/core/workers/chunks/070b29cba896f46537f9.js +0 -1
  212. package/assets/esri/core/workers/chunks/0cdf6b51f2a63f348530.js +0 -1
  213. package/assets/esri/core/workers/chunks/1143313f2f6f34deaad7.js +0 -1
  214. package/assets/esri/core/workers/chunks/14c6461ffd36319e1d74.js +0 -1
  215. package/assets/esri/core/workers/chunks/2394ac65d64e50399d76.js +0 -1
  216. package/assets/esri/core/workers/chunks/47febd4de836a33b51b1.js +0 -1
  217. package/assets/esri/core/workers/chunks/487afbf352d12c745430.js +0 -1
  218. package/assets/esri/core/workers/chunks/56b4dcd04c844eaacd60.js +0 -1
  219. package/assets/esri/core/workers/chunks/5d65987f2c1b5c56a799.js +0 -1
  220. package/assets/esri/core/workers/chunks/5de07f7a09eb9f3ab666.js +0 -1
  221. package/assets/esri/core/workers/chunks/659f7e99b2d524ef53fb.js +0 -2
  222. package/assets/esri/core/workers/chunks/77e27f318b5863dd0f5c.js +0 -1
  223. package/assets/esri/core/workers/chunks/7b7f5028a488bb9c10f4.js +0 -1
  224. package/assets/esri/core/workers/chunks/808cfed7022e3846d5b2.js +0 -1
  225. package/assets/esri/core/workers/chunks/8bd5a0ff7dcf1067bf53.js +0 -1
  226. package/assets/esri/core/workers/chunks/99b20eef2893047fac10.js +0 -1
  227. package/assets/esri/core/workers/chunks/9f4e23bae621ff3ecea3.js +0 -1
  228. package/assets/esri/core/workers/chunks/a596d6ccb6103e594031.js +0 -1
  229. package/assets/esri/core/workers/chunks/a5e6359fadbd699b1c8e.js +0 -1
  230. package/assets/esri/core/workers/chunks/a7f3cdd9a249ef4572ce.js +0 -1
  231. package/assets/esri/core/workers/chunks/a80d769b0ed025f0df64.js +0 -1
  232. package/assets/esri/core/workers/chunks/af83dddddbfe25194527.js +0 -1
  233. package/assets/esri/core/workers/chunks/b057e6d593c1607cae61.js +0 -1
  234. package/assets/esri/core/workers/chunks/b1f1a26e7a2ef5b783ee.js +0 -1
  235. package/assets/esri/core/workers/chunks/b605dfdfed8ff8eda4f3.js +0 -1
  236. package/assets/esri/core/workers/chunks/c337c1a2dbc452780dd7.js +0 -1
  237. package/assets/esri/core/workers/chunks/c601bbdafdee5074b04f.js +0 -1
  238. package/assets/esri/core/workers/chunks/c8694a27e2cf28b010e8.js +0 -1
  239. package/assets/esri/core/workers/chunks/e6457ac25c0829ee039c.js +0 -1
  240. package/assets/esri/core/workers/chunks/eacc7fccdc3fb670ac8f.js +0 -33
  241. package/assets/esri/core/workers/chunks/f4167fc895d4009df1c7.js +0 -1
  242. package/assets/esri/core/workers/chunks/f76774781865cb1411b0.js +0 -1
  243. package/assets/esri/core/workers/chunks/fd04df45cdcc6ff52554.js +0 -1
  244. package/chunks/BloomComposition.glsl.js +0 -41
  245. package/graphic/IntegratedMesh3DTilesGraphicOrigin.d.ts +0 -4
  246. package/graphic/IntegratedMesh3DTilesGraphicOrigin.js +0 -5
  247. package/graphic/IntegratedMeshGraphicOrigin.d.ts +0 -4
  248. package/graphic/IntegratedMeshGraphicOrigin.js +0 -5
  249. package/graphic/isIntegratedMesh3DTilesGraphicOrigin.js +0 -5
  250. package/graphic/isIntegratedMeshGraphicOrigin.js +0 -5
  251. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +0 -5
  252. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +0 -5
  253. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization.js +0 -5
  254. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization.js +0 -5
  255. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.js +0 -5
  256. package/views/3d/webgl-engine/effects/bloom/BloomBlurTechnique.js +0 -5
  257. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechnique.js +0 -5
  258. package/views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js +0 -5
  259. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +0 -5
  260. /package/assets/esri/core/workers/chunks/{659f7e99b2d524ef53fb.js.LICENSE.txt → 4fda6e90822bc0198b28.js.LICENSE.txt} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import i from"../../../../core/Accessor.js";import{destroyHandle as r}from"../../../../core/handleUtils.js";import{when as t,watch as s,initial as p,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{ImageHighlightHelper3D as l}from"./ImageHighlightHelper3D.js";import{MapServiceLayerViewHelper as g}from"../../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as c}from"../../../support/drapedUtils.js";let d=class extends i{constructor(e){super(e)}initialize(){this._highlightHelper=new l({layer:this.layerView.layer,view:this.view,updatingHandles:this.updatingHandles}),this._mapServiceLayerViewHelper=new g({createFetchPopupFeaturesQueryGeometry:(e,i)=>c(e,i,this.view),layerView:this.layerView,updatingHandles:this.updatingHandles,highlightGraphics:this._highlightHelper.graphics,highlightGraphicUpdated:e=>this._highlightHelper.graphicsView?.graphicChanged(e)}),this.addHandles([r(this._mapServiceLayerViewHelper),t(()=>this.view?.stationary,()=>this._mapServiceLayerViewHelper.updateHighlightedFeatures(this.view.resolution),p),s(()=>this.layerView.suspended,e=>this._highlightHelper.suspended=e,o)])}fetchPopupFeaturesAtLocation(e,i){return this._highlightHelper.preload(),this._mapServiceLayerViewHelper.fetchPopupFeaturesAtLocation(e,i)}highlight(e,i){return this._highlightHelper.highlight(e,i)}};e([h()],d.prototype,"view",void 0),e([h()],d.prototype,"layerView",void 0),e([h()],d.prototype,"updatingHandles",void 0),d=e([a("esri.views.3d.layers.support.SublayerPopupHighlightHelper3D")],d);export{d as SublayerPopupHighlightHelper3D};
5
+ import{__decorate as e}from"tslib";import i from"../../../../core/Accessor.js";import{destroyHandle as r}from"../../../../core/handleUtils.js";import{ignoreAbortErrors as t}from"../../../../core/promiseUtils.js";import{when as s,watch as p,initial as o,syncAndInitial as h}from"../../../../core/reactiveUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{ImageHighlightHelper3D as c}from"./ImageHighlightHelper3D.js";import{MapServiceLayerViewHelper as g}from"../../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as d}from"../../../support/drapedUtils.js";let m=class extends i{constructor(e){super(e)}initialize(){this._highlightHelper=new c({layer:this.layerView.layer,view:this.view,updatingHandles:this.updatingHandles}),this._mapServiceLayerViewHelper=new g({createFetchPopupFeaturesQueryGeometry:(e,i)=>d(e,i,this.view),layerView:this.layerView,updatingHandles:this.updatingHandles,highlightGraphics:this._highlightHelper.graphics,highlightGraphicUpdated:e=>this._highlightHelper.graphicsView?.graphicChanged(e)}),this.addHandles([r(this._mapServiceLayerViewHelper),s(()=>this._mapServiceLayerViewHelper.highlightFeaturesActive&&this.view?.stationary,()=>t(this._mapServiceLayerViewHelper.updateHighlightedFeatures(this.view.resolution)),o),p(()=>this.layerView.suspended,e=>this._highlightHelper.suspended=e,h)])}fetchPopupFeaturesAtLocation(e,i){return this._highlightHelper.preload(),this._mapServiceLayerViewHelper.fetchPopupFeaturesAtLocation(e,i)}highlight(e,i){return this._highlightHelper.highlight(e,i)}};e([a()],m.prototype,"view",void 0),e([a()],m.prototype,"layerView",void 0),e([a()],m.prototype,"updatingHandles",void 0),m=e([l("esri.views.3d.layers.support.SublayerPopupHighlightHelper3D")],m);export{m as SublayerPopupHighlightHelper3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Graphic.js";import{Tiles3DTarget as i}from"../i3s/Intersector.js";import{IntersectorResult as t}from"../../webgl-engine/lib/IntersectorResult.js";import{MeshIntersectionOptions as r}from"../../webgl-engine/lib/RayIntersections.js";class s{constructor(e){this.type=8,this.slicePlaneEnabled=!1,this.isGround=!0,this.layerView=e,this.layerViewUid=e.uid,this._graphicOrigin=e.layer.graphicOrigin}intersect(e,s,n,l,o,a){if(e.options.filteredLayerViewUids.includes(this.layerView.uid))return;const c=e.results,u=2===e.options.store,h=this.layerView.view.stage.renderView.componentObjectCollection,d=new r(a,e.options.normalRequired);this.layerView.objects.forEach(r=>{r.visible&&r.intersectionGeometry&&h.intersect(r,n,l,e.tolerance,null,d,(r,o,a,h)=>{if(o>=0){if(null!=s&&!s(n,l,o))return;const r=e=>{const t=new i(this.layerView.layer.uid,()=>this._createTiles3DGraphic(this.layerView.layer,{}));e.set(this.type,t,o,a)};if(this.isGround&&(null==c.ground.distance||o<c.ground.distance)&&r(c.ground),e.options.isFiltered)return;if((null==c.min.distance||o<c.min.distance)&&r(c.min),(null==c.max.distance||o>c.max.distance)&&r(c.max),u){const i=new t(e.ray);r(i),e.results.all.push(i)}}})})}_createTiles3DGraphic(i,t){return new e({layer:i,sourceLayer:i,origin:this._graphicOrigin,attributes:t})}}export{s as Tiles3DIntersectionHandler};
5
+ import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Tiles3DTarget as i}from"../i3s/Intersector.js";import{IntersectorResult as t}from"../../webgl-engine/lib/IntersectorResult.js";import{MeshIntersectionOptions as n,computeInvDir as s,intersectAabbInvDir as r}from"../../webgl-engine/lib/RayIntersections.js";class o{constructor(e){this.type=8,this.slicePlaneEnabled=!1,this.isGround=!0,this.layerView=e,this.layerViewUid=e.uid}intersect(o,l,a,c,d,u){if(o.options.filteredLayerViewUids.includes(this.layerView.uid))return;const m=o.results,p=2===o.options.store,w=this.layerView.view.stage.renderView.componentObjectCollection,f=new n(u,o.options.normalRequired),h=e();s(a,c,h),this.layerView.forEachVisibleComponentObject(e=>{e.intersectionGeometry&&r(e.aabbInWorldCoordinates,a,h,0)&&w.intersect(e,a,c,o.tolerance,null,f,(e,n,s,r)=>{if(n>=0){if(null!=l&&!l(a,c,n))return;const e=e=>{const t=new i(this.layerView.layer.uid);e.set(this.type,t,n,s)};if(this.isGround&&(null==m.ground.distance||n<m.ground.distance)&&e(m.ground),o.options.isFiltered)return;if((null==m.min.distance||n<m.min.distance)&&e(m.min),(null==m.max.distance||n>m.max.distance)&&e(m.max),p){const i=new t(o.ray);e(i),o.results.all.push(i)}}})})}}export{o as Tiles3DIntersectionHandler};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../Graphic.js";import{isIterable as n}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as i,createScreenPointArray as t}from"../../../core/screenUtils.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../geometry/Point.js";import l from"../../../geometry/SpatialReference.js";import{projectVectorToVector as o}from"../../../geometry/projection/projectVectorToVector.js";import{fallbackObjectIDAttribute as c}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as a}from"../../../layers/support/layerUtils.js";import{debugFlags as u}from"./debugFlags.js";import{getElevationAtPoint as d}from"./ElevationProvider.js";import{Intersector as p}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResult as f}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as m,toOwner as g}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as y}from"../webgl-engine/lib/verticalOffsetUtils.js";async function h(e,n,i,r){const s=i?x(e,i):r,l=t(n.x,n.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;const o=new p(e.state.viewingMode);o.options.selectionMode=!0,o.options.store=2,e.sceneIntersectionHelper.intersectIntersectorScreen(l,o,s);const c=await b(e,o.results.all,s.graphics),d=o.results.ground,m=g(d,e),y=null!=m&&"type"in m&&a(m.type)?m:null,h={screenPoint:n,results:c,ground:{mapPoint:j(e,d),distance:f(d)?d.distanceInRenderSpace:0,layer:y}};return u.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=o),h}function w(e,n,t,r){const s=t?x(e,t):r,l=!(!s.graphics?.include&&!s.graphics?.exclude),o=!(!s.mediaElements?.include&&!s.mediaElements?.exclude),c=i(n);s.enableDraped=s.include&&!s.include.has(y)||s.exclude?.has(y);const a=e.sceneIntersectionHelper,u=new p(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=l||o?2:0,u.options.excludeLabels=t?.excludeLabels??!1,a.intersectIntersectorScreen(c,u,s),l||o){for(const n of u.results.all){const i=m(n,e);if(null==i)return j(e,n);if(l&&("graphic"!==i.type||E(s.graphics,i.graphic)))return j(e,n);if(o&&("media"!==i.type||S(s.mediaElements,i.element)))return j(e,n)}return null}return j(e,u.results.min)}async function b(e,n,i){const t=new Array;let r,s=null;const l={defer(e){r=e()}};for(let o=0;o<n.length;o++){const c=n[o],u=g(c,e);if(null!=u&&(u===e.map.ground||"type"in u&&a(u.type)))break;const d=m(c,e,l)??await r;if(r=null,null==d)continue;if("graphic"===d.type){if(null==s&&o!==n.length-1&&(s=new Set),null!=s){const e=U(d.graphic);if(s.has(e))continue;s.add(e)}if(!E(i,d.graphic))continue}const p=j(e,c),f=c.distanceInRenderSpace;if("media"===d.type){const e=d.element.toSource(p);t.push({...d,mapPoint:p,distance:f,sourcePoint:e})}else t.push({...d,mapPoint:p,distance:f})}return t}function j(e,n,i){return n.getIntersectionPoint(F)?(i=V(e,F,i),2===n.intersector&&e.basemapTerrain&&(i.z=d(e.basemapTerrain,i)??0),i):null}function U(e){const n=e.sourceLayer,i=e.layer,t=n&&"objectIdField"in n?n:i&&"objectIdField"in i?i:n;if(t){const n=t.objectIdField??c,i=e.attributes?.[n];if(i)return`o-${t.id}-${i}`}return`u-${e.uid}`}function E(e,n){return S(e,U(n))}function S(e,n){return null==e||(null==e.include||e.include.has(n))&&(null==e.exclude||!e.exclude.has(n))}function V(e,n,i){let t=e.spatialReference||l.WGS84;return o(n,e.renderSpatialReference,F,t)?n=F:(t=l.WGS84,o(n,e.renderSpatialReference,F,t)&&(n=F)),i?(i.x=n[0],i.y=n[1],i.z=n[2],i.spatialReference=t):i=new s(n,t),i}function x(e,n){const i=I(e,n.include,0),t=I(e,n.exclude,1);return{include:i.layerViewUids,exclude:t.layerViewUids,graphics:{include:i.graphicUids,exclude:t.graphicUids},mediaElements:{include:i.mediaElements,exclude:t.mediaElements}}}function I(i,t,r,s=new R){if(!t)return s;if(t instanceof e)L(s,U(t)),0===r&&(null!=i.graphicsView&&t.layer===i?P(s,i.graphicsView.uid):t.layer&&T(s,i,t.layer.uid));else if("layer"in t&&"element"in t)M(s,t.element),0===r&&T(s,i,t.layer.uid);else if(n(t))for(const e of t)e===i.graphics&&null!=i.graphicsView?P(s,i.graphicsView.uid):e===i.map.ground?P(s,y):I(i,e,r,s);else"layer"in t&&v(s,i,t),"uid"in t&&T(s,i,t.uid);return s}class R{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function T(e,n,i){const t=n.allLayerViews.find(e=>e.layer.uid===i);t&&P(e,t.uid)}function P(e,n){e.layerViewUids??=new Map,e.layerViewUids.set(n,!0)}function v(e,n,i){const t=n.allLayerViews.find(e=>e.layer.uid===i.layer.uid);if(!t)return;e.layerViewUids??=new Map;const r=e.layerViewUids.get(t.uid);!0!==r&&(r?r.add(i.id):e.layerViewUids.set(t.uid,new Set([i.id])))}function L(e,n){e.graphicUids??=new Set,e.graphicUids.add(n)}function M(e,n){e.mediaElements??=new Set,e.mediaElements.add(n)}const F=r();export{V as computeMapPointFromVec3d,x as externalToInternalIntersectOptions,U as getGraphicFilterUid,h as hitTest,j as intersectResultToMapPoint,w as toMap};
5
+ import e from"../../../Graphic.js";import{isIterable as n}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as i,createScreenPointArray as t}from"../../../core/screenUtils.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../geometry/Point.js";import l from"../../../geometry/SpatialReference.js";import{projectVectorToVector as o}from"../../../geometry/projection/projectVectorToVector.js";import{fallbackObjectIDAttribute as c}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as a}from"../../../layers/support/layerUtils.js";import{debugFlags as u}from"./debugFlags.js";import{getElevationAtPoint as d}from"./ElevationProvider.js";import{Intersector as p}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResult as m}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as f,toOwner as g}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as y}from"../webgl-engine/lib/verticalOffsetUtils.js";async function h(e,n,i,r){const s=i?x(e,i):r,l=t(n.x,n.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;const o=new p(e.state.viewingMode);o.options.selectionMode=!0,o.options.store=2,e.sceneIntersectionHelper.intersectIntersectorScreen(l,o,s);const c=await b(e,o.results.all,s.graphics),d=o.results.ground,f=g(d,e),y=null!=f&&"type"in f&&a(f.type)?f:null,h={screenPoint:n,results:c,ground:{mapPoint:U(e,d),distance:m(d)?d.distanceInRenderSpace:0,layer:y}};return u.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=o),h}function w(e,n,t,r){const s=t?x(e,t):r,l=!(!s.graphics?.include&&!s.graphics?.exclude),o=!(!s.mediaElements?.include&&!s.mediaElements?.exclude),c=i(n);s.enableDraped=s.include&&!s.include.has(y)||s.exclude?.has(y);const a=e.sceneIntersectionHelper,u=new p(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=l||o?2:0,u.options.excludeLabels=t?.excludeLabels??!1,a.intersectIntersectorScreen(c,u,s),l||o){for(const n of u.results.all){const i=f(n,e);if(null==i)return U(e,n);if(l&&("graphic"!==i.type||E(s.graphics,i.graphic)))return U(e,n);if(o&&("media"!==i.type||S(s.mediaElements,i.element)))return U(e,n)}return null}return U(e,u.results.min)}async function b(e,n,i){const t=new Array;let r,s=null;const l={defer(e){r=e()}};for(let o=0;o<n.length;o++){const c=n[o],u=g(c,e);if(null!=u&&(u===e.map.ground||"type"in u&&a(u.type)))break;const d=f(c,e,l)??await r;if(r=null,null==d)continue;if("graphic"===d.type){if(null==s&&o!==n.length-1&&(s=new Set),null!=s){const e=j(d.graphic);if(s.has(e))continue;s.add(e)}if(!E(i,d.graphic))continue}const p=U(e,c),m=c.distanceInRenderSpace;if("media"===d.type){const e=d.element.toSource(p);t.push({...d,mapPoint:p,distance:m,sourcePoint:e})}else t.push({...d,mapPoint:p,distance:m})}return t}function U(e,n,i){return n.getIntersectionPoint(C)?(i=V(e,C,i),2===n.intersector&&e.basemapTerrain&&(i.z=d(e.basemapTerrain,i)??0),i):null}function j(e){const n=e.getObjectId()??e.attributes?.[c];return e.origin&&null!=n?`o-${e.origin.id}-${n}`:`u-${e.uid}`}function E(e,n){return S(e,j(n))}function S(e,n){return null==e||(null==e.include||e.include.has(n))&&(null==e.exclude||!e.exclude.has(n))}function V(e,n,i){let t=e.spatialReference||l.WGS84;return o(n,e.renderSpatialReference,C,t)?n=C:(t=l.WGS84,o(n,e.renderSpatialReference,C,t)&&(n=C)),i?(i.x=n[0],i.y=n[1],i.z=n[2],i.spatialReference=t):i=new s(n,t),i}function x(e,n){const i=I(e,n.include,0),t=I(e,n.exclude,1);return{include:i.layerViewUids,exclude:t.layerViewUids,graphics:{include:i.graphicUids,exclude:t.graphicUids},mediaElements:{include:i.mediaElements,exclude:t.mediaElements}}}function I(i,t,r,s=new R){if(!t)return s;if(t instanceof e)M(s,j(t)),0===r&&(null!=i.graphicsView&&t.layer===i?P(s,i.graphicsView.uid):t.layer&&T(s,i,t.layer.uid));else if("layer"in t&&"element"in t)L(s,t.element),0===r&&T(s,i,t.layer.uid);else if(n(t))for(const e of t)e===i.graphics&&null!=i.graphicsView?P(s,i.graphicsView.uid):e===i.map.ground?P(s,y):I(i,e,r,s);else"layer"in t&&v(s,i,t),"uid"in t&&T(s,i,t.uid);return s}class R{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function T(e,n,i){const t=n.allLayerViews.find(e=>e.layer.uid===i);t&&P(e,t.uid)}function P(e,n){e.layerViewUids??=new Map,e.layerViewUids.set(n,!0)}function v(e,n,i){const t=n.allLayerViews.find(e=>e.layer.uid===i.layer.uid);if(!t)return;e.layerViewUids??=new Map;const r=e.layerViewUids.get(t.uid);!0!==r&&(r?r.add(i.id):e.layerViewUids.set(t.uid,new Set([i.id])))}function M(e,n){e.graphicUids??=new Set,e.graphicUids.add(n)}function L(e,n){e.mediaElements??=new Set,e.mediaElements.add(n)}const C=r();export{V as computeMapPointFromVec3d,x as externalToInternalIntersectOptions,h as hitTest,U as intersectResultToMapPoint,w as toMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{destroyMaybe as e}from"../../../../core/maybe.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{on as o}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{j as n,q as a,c as d}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import p from"../../../../geometry/Point.js";import{distanceToScale as c}from"../cameraUtils.js";import{PointOfInterest as h}from"./PointOfInterest.js";import{PropertiesPool as u}from"../../../support/PropertiesPool.js";import{Yield as m}from"../../../support/Yield.js";let _=class extends h{constructor(t){super(t),this._dirty=!1,this._propertiesPool=new u({location:()=>new p,renderLocation:()=>l()},this),this._estimatedSurfaceAltitude=0,this._pendingElevationQueryController=null,this.renderLocation=l(),this._tmpPoint=new p}initialize(){if(this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.runTask(),this.map){const t=()=>this._setDirty();this.addHandles(o(()=>this.map?.ground?.layers,"change",t,{onListenerAdd:t,onListenerRemove:t}))}this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=e(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool.get("location");return t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t}get scale(){const t=this._camera,e=n(t.eye,this.renderLocation),r={renderCoordsHelper:this.renderCoordsHelper,state:{camera:t}};return c(r,e)}get updating(){return this._dirty||null!=this._pendingElevationQueryController}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0,this.notifyChange("updating"))}_cancelPendingRequest(){const t=this._pendingElevationQueryController;t&&(this._pendingElevationQueryController=null,t.abort(),this.notifyChange("updating"))}get readyToRun(){return!this._pendingElevationQueryController&&this._dirty}runTask(){if(this._cancelPendingRequest(),this._dirty=!1,this.notifyChange("updating"),!this.map?.ground)return this._updateSurfaceAltitude(0),m;const t=this.state.spatialReference;this._tmpPoint.spatialReference=t,this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);const e=(this._tmpPoint.z??0)>g&&1===this.renderCoordsHelper.viewingMode&&(t.isWGS84||t.isWebMercator);let o=new AbortController;return this.map.ground.queryElevation(this._tmpPoint,{signal:o.signal,cache:this.cache,minDemResolution:e?f:0}).then(t=>this._updateSurfaceAltitude(t.geometry.z??0)).catch(t=>{r(t)||this._updateSurfaceAltitude(0)}).catch(()=>{}).then(()=>{this._pendingElevationQueryController===o&&(this._pendingElevationQueryController=null,this.notifyChange("updating")),o=null}),this._pendingElevationQueryController=o,m}_updateSurfaceAltitude(t){this._estimatedSurfaceAltitude!==t&&(this._estimatedSurfaceAltitude=t,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(y,this._estimatedSurfaceAltitude,this._camera.eye),a(this._get("renderLocation"),y)||(this._set("renderLocation",d(this._propertiesPool.get("renderLocation"),y)),this.notifyChange("renderLocation"))}};t([i({constructOnly:!0})],_.prototype,"scheduler",void 0),t([i({constructOnly:!0})],_.prototype,"cache",void 0),t([i({constructOnly:!0})],_.prototype,"task",void 0),t([i()],_.prototype,"location",null),t([i({constructOnly:!0})],_.prototype,"map",void 0),t([i()],_.prototype,"renderLocation",void 0),t([i()],_.prototype,"scale",null),t([i()],_.prototype,"updating",null),_=t([s("esri.views.3d.support.pointsOfInterest.CameraOnSurface")],_);const y=l(),g=1e5,f=1e6;export{_ as CameraOnSurface};
5
+ import{__decorate as t}from"tslib";import{destroyMaybe as e}from"../../../../core/maybe.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{on as o}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{j as n,q as a,c as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../../../../geometry/Point.js";import{distanceToScale as p}from"../cameraUtils.js";import{PointOfInterest as h}from"./PointOfInterest.js";import{PropertiesPool as u}from"../../../support/PropertiesPool.js";import{Yield as m}from"../../../support/Yield.js";let _=class extends h{constructor(t){super(t),this._dirty=!1,this._propertiesPool=new u({location:()=>new d,renderLocation:()=>c()},this),this._estimatedSurfaceAltitude=0,this._elevationQueryController=null,this.renderLocation=c(),this._tmpPoint=new d}initialize(){if(this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.runTask(),this.map){const t=()=>this._setDirty();this.addHandles(o(()=>this.map?.ground?.layers,"change",t,{onListenerAdd:t,onListenerRemove:t}))}this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=e(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool.get("location");return t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t}get scale(){const t=this._camera,e=n(t.eye,this.renderLocation),r={renderCoordsHelper:this.renderCoordsHelper,state:{camera:t}};return p(r,e)}get updating(){return this._dirty||null!=this._elevationQueryController}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0,this.notifyChange("updating"))}_cancelPendingRequest(){const t=this._elevationQueryController;t&&(this._elevationQueryController=null,t.abort(),this.notifyChange("updating"))}get readyToRun(){return!this._elevationQueryController&&this._dirty}runTask(){if(this._cancelPendingRequest(),this._dirty=!1,this.notifyChange("updating"),!this.map?.ground)return this._updateSurfaceAltitude(0),m;const t=this.state.spatialReference;this._tmpPoint.spatialReference=t,this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);const e=(this._tmpPoint.z??0)>f&&1===this.renderCoordsHelper.viewingMode&&(t.isWGS84||t.isWebMercator);let o=new AbortController;return this.map.ground.queryElevation(this._tmpPoint,{signal:o.signal,cache:this.cache,minDemResolution:e?g:0}).then(t=>this._updateSurfaceAltitude(t.geometry.z??0)).catch(t=>{r(t)||this._updateSurfaceAltitude(0)}).catch(()=>{}).then(()=>{this._elevationQueryController===o&&(this._elevationQueryController=null,this.notifyChange("updating")),o=null}),this._elevationQueryController=o,m}_updateSurfaceAltitude(t){this._estimatedSurfaceAltitude!==t&&(this._estimatedSurfaceAltitude=t,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(y,this._estimatedSurfaceAltitude,this._camera.eye),a(this._get("renderLocation"),y)||(this._set("renderLocation",l(this._propertiesPool.get("renderLocation"),y)),this.notifyChange("renderLocation"))}};t([i({constructOnly:!0})],_.prototype,"scheduler",void 0),t([i({constructOnly:!0})],_.prototype,"cache",void 0),t([i({constructOnly:!0})],_.prototype,"task",void 0),t([i()],_.prototype,"location",null),t([i({constructOnly:!0})],_.prototype,"map",void 0),t([i()],_.prototype,"renderLocation",void 0),t([i()],_.prototype,"scale",null),t([i()],_.prototype,"updating",null),_=t([s("esri.views.3d.support.pointsOfInterest.CameraOnSurface")],_);const y=c(),f=1e5,g=1e6;export{_ as CameraOnSurface};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../Camera.js";import e from"../../../Graphic.js";import n from"../../../Viewpoint.js";import{result as a}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{cyclicalDegrees as r}from"../../../core/Cyclical.js";import o from"../../../core/Error.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{fromMat4 as s,transpose as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as u,f,j as p,c as g,d as y,i as h,o as d}from"../../../chunks/vec32.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import x from"../../../geometry/Extent.js";import j from"../../../geometry/Geometry.js";import v from"../../../geometry/Multipoint.js";import b from"../../../geometry/Point.js";import{projectWithZConversion as R,tryProjectWithZConversion as z}from"../../../geometry/projectionUtils.js";import G from"../../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as B}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVectorAsync as M}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as S}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as Z}from"../../../geometry/projection/projectVectorToVector.js";import{create as F,center as T,toRect as P,isPoint as A,empty as E,expandWithVec3 as V,expandWithAABB as U,width as k,height as O,depth as I}from"../../../geometry/support/aaBoundingBox.js";import{create as N,isPoint as C}from"../../../geometry/support/aaBoundingRect.js";import{intersectsPoint as W}from"../../../geometry/support/frustum.js";import{getResolutionInMetersForScale as Y}from"../../../geometry/support/scaleUtils.js";import{fromRenderCamera as q,toRenderCamera as D}from"../webgl.js";import{cameraOnContentAlongViewDirection as X}from"../camera/intersectionUtils.js";import{getViewSR as _,fromExtentAsync as H,scaleToDistance as J,fromCenterDistanceAsync as K,fromExtentSync as L,distanceToScale as Q,fromCenterDistanceSync as $,fromCenterScale as tt,zoomToScale as et}from"./cameraUtils.js";import{getElevationAtPoint as nt}from"./ElevationProvider.js";import{directionToHeadingTilt as at}from"./viewingModeUtils.js";const rt=.66;function ot(t){return 360-r.normalize(t)}function it(t){return r.normalize(360-t)}function st(t,e,n){const a=e.camera;if(null!=a)return lt(a,_(t));const{targetGeometry:r}=e;if(null==r)return null;const{camera:o,mode:i}=ut(t,e.rotation,n);if("point"===r.type)return ft(t,e,r,o,i);const s=r.extent;return null==s?null:L(t,s,o.heading,o.tilt,i)}async function ct(t,e,n,a){const r=e.camera;if(null!=r)return mt(r,_(t),a);const{targetGeometry:o}=e;if(null==o)throw new Error("Viewpoint has no targetGeometry!");const{camera:i,mode:s}=ut(t,e.rotation,n);if("point"===o.type)return pt(t,e,o,i,s,a);const c=o.extent;if(null==c)throw new Error("Target geometry has no extent!");return H(t,c,i.heading,i.tilt,s,a)}function lt(t,e){const n=t.position;let a;try{a=z(n,e)}catch(o){return null}if(!a)return null;const r=t.clone();return r.position=a.clone(),r}async function mt(t,e,n){const a=t.position,r=await R(a,e,{signal:n});i(n);const o=t.clone();return o.position=r.clone(),o}function ut(t,e,n){const a=q(t,t.state.camera);let r=1;return null!=e&&(a.heading=ot(e),r=0),null!=n&&(a.tilt=n),{camera:a,mode:r}}function ft(t,e,n,a,r){const o=t.spatialReference;let i;try{i=z(n.clone(),o)}catch(c){return null}if(!i)return null;const s=null!=e.scale?J(t,e.scale):t.state.camera.distance;return $(t,i,s,a,r)}async function pt(t,e,n,a,r,o){const s=t.spatialReference,c=await R(n.clone(),s,{signal:o});i(o);const l=null!=e.scale?J(t,e.scale):t.state.camera.distance;return K(t,c,l,a,r,o)}function gt(t,e,a=null){return null==a&&(a=new n),xt(t,null,e.clone(),a)}async function yt(e,a,r){const i=Pt(e,a);if(!i)throw new o("viewpointutils-create:no-target","Missing target for creating viewpoint");const s=new t({fov:e.camera.fov}),c=new n({camera:s});if(i.target instanceof n){return At(await Rt(e,i.target,i,r,c))}if(i.target instanceof t)return At(await zt(e,i.target,r,c));const l=null!=i.scale||null!=i.zoom;if(i.target instanceof x){const t=i.target.xmin===i.target.xmax||i.target.ymin===i.target.ymax;return At(l||t?await Bt(e,i,i.target.center,s,r,c):await Zt(e,i,i.target,s,r,c))}const m=new Vt,u=l?dt(e,i):void 0;if(await bt(e,i.target,u,m,r),isFinite(m.boundingBox[0])){let t;if(T(m.boundingBox,Ut),Dt.x=Ut[0],Dt.y=Ut[1],Dt.z=Ut[2],Dt.spatialReference=e.spatialReference,isFinite(Dt.z)&&m.hasZ?t=A(m.boundingBox):(Dt.z=void 0,t=C(P(m.boundingBox,Nt))),l||t)return At(await Bt(e,i,Dt,s,r,c));const n=Et(e,m.screenSpaceObjects);return At(await Tt(e,i,Dt,m.boundingBox,n,s,r,c))}return i.position?At(await Mt(e,i,s,c,r)):At(await St(e,i,s,r,c))}function ht(t,e){return null==e.scale&&null!=e.zoom?et(t,e.zoom):e.scale}function dt(t,e){const n=ht(t,e);return n?Y(n):void 0}function wt(t,e){let n=!1;return null!=e.heading?(t.heading=e.heading,n=!0):null!=e.rotation&&(t.heading=ot(e.rotation),n=!0),null!=e.tilt&&(t.tilt=e.tilt,n=!0),null!=e.fov&&(t.fov=e.fov),n}function xt(t,e,n,a){const r=t.spatialReference||G.WGS84;if(e??=D(t,n),null==e)return a;const o=new b({spatialReference:r});return S(e.center,t.renderSpatialReference,o)?(a.targetGeometry=o,a.scale=Q(t,e.distance),a.rotation=it(n.heading),a.camera=n,a):a}async function jt(t,e,n,a){const r=()=>new o("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!e)throw r();"mesh"===e.type&&(e=e.extent);const i=t.basemapTerrain.spatialReference;if(!e.hasZ&&t.basemapTerrain){let n;switch(e.type){case"point":n=e;break;case"multipoint":case"polyline":n=e.extent?.center;break;case"extent":n=e.center;break;case"polygon":n=e.centroid}null!=n&&i&&t.elevationProvider?(n=await R(n,i,{signal:a}),Ut[2]=nt(t.elevationProvider,n)??0):Ut[2]=0}const s=Xt[e.type],c=new Array;if(s(e,e.hasZ?t=>{c.push([t[0],t[1],t[2]])}:t=>{c.push([t[0],t[1]])},Ut),0===c.length)throw r();const l=e.spatialReference,m=t.spatialReference,u=await R(new v({spatialReference:l,hasZ:e.hasZ,hasM:!1,points:c}),m,{signal:a});if(e.hasZ&&(n.hasZ=!0),e.hasZ)for(const[o,f,p]of u.points)Ut[0]=o,Ut[1]=f,Ut[2]=p,V(n.boundingBox,Ut);else for(const[o,f]of u.points)Ut[0]=o,Ut[1]=f,V(n.boundingBox,Ut)}async function vt(t,e,n,r,o){const i=await a(t.whenViewForGraphic(e));if(!1===i.ok||null==i.value||!("whenGraphicBounds"in i.value))return void await jt(t,e.geometry,r,o);const s=i.value,c=await a(s.whenGraphicBounds(e,{minDemResolution:n}));if(!1===c.ok||!c.value)return void await jt(t,e.geometry,r,o);const{screenSpaceObjects:l,boundingBox:m}=c.value;U(r.boundingBox,m),l&&l.forEach(t=>{r.screenSpaceObjects.push(t)}),isFinite(m[2])&&(r.hasZ=!0)}async function bt(t,n,a,r,o){if(Array.isArray(n)&&2===n.length){const e=n[0],a=n[1];if("number"==typeof e&&"number"==typeof a)return Dt.x=e,Dt.y=a,Dt.z=void 0,Dt.spatialReference=t.spatialReference?.isGeographic?t.spatialReference:G.WGS84,void await jt(t,Dt,r,o)}n&&"map"in n&&"function"==typeof n.map?await Promise.allSettled(n.map(e=>bt(t,e,a,r,o))):n instanceof j?await jt(t,n,r,o):n instanceof e&&await vt(t,n,a,r,o)}async function Rt(t,e,n,a,r){if(e.camera)return zt(t,e.camera,a,r);r.scale=e.scale,r.rotation=e.rotation,r.targetGeometry=null!=e.targetGeometry?e.targetGeometry.clone():null,r.camera=null,null!=n.heading?r.rotation=it(n.heading):null!=n.rotation&&(r.rotation=n.rotation);const o=ht(t,n);return null!=o&&(r.scale=o),r.camera=await ct(t,r,n.tilt,a),r}async function zt(t,e,n,a){const r=t.spatialReference,o=await R(e.position,r,{signal:n}),i=e.clone();return i.position=o,xt(t,null,i,a)}async function Gt(t,e,n,a,r,o,i){const s=t.renderSpatialReference;return await M(e,Yt,s,0,{signal:i}),await M(n,Wt,s,0,{signal:i}),o.targetGeometry=new b(e),r.position=new b(n),y(Ct,Yt,Wt),at(t,Wt,Ct,a.up,r),o.scale=Q(t,p(Wt,Yt)),o.rotation=it(r.heading),o.camera=r,o}async function Bt(t,e,n,a,r,o){o.targetGeometry=n.clone();const i=X(t);if(e.position)return Gt(t,o.targetGeometry,e.position,i,a,o,r);if(e.zoomFactor){const n=i.distance/e.zoomFactor,a=u(Ut,i.viewForward,-n);i.eye=f(Ut,i.center,a),o.scale=Q(t,n)}q(t,i,a);const s=wt(a,e)?0:1;if(!e.zoomFactor){const n=ht(t,e);if(null==n){await M(o.targetGeometry,Ut,t.renderSpatialReference,0,{signal:r});const e=W(i.frustum,Ut)?p(i.eye,Ut):i.distance;o.camera=await K(t,o.targetGeometry,e,a,s),o.scale=Q(t,e)}else o.scale=n,o.camera=await tt(t,o.targetGeometry,o.scale,a,s,r)}return o}async function Mt(t,e,n,a,r){const o=X(t);g(Ct,o.viewForward),at(t,o.eye,Ct,o.up,qt);const i=t.spatialReference,{position:s}=e;if(s){const t=await R(s,i,{signal:r});n.position=t}else n.position=new b;return n.heading=null!=e.heading?e.heading:qt.heading,n.tilt=null!=e.tilt?e.tilt:qt.tilt,xt(t,null,n,a)}async function St(t,e,n,a,r){if(null!=e.heading||null!=e.rotation||null!=e.scale||null!=e.tilt||null!=e.zoom||null!=e.zoomFactor){const o=X(t),{spatialReference:i,renderSpatialReference:s}=t,c=new b({spatialReference:i});return S(o.center,s,c)?Bt(t,e,c,n,a,r):r}return r.scale=t.scale,r.camera=t.camera.clone(),wt(r.camera,e),r}async function Zt(t,e,n,a,r,o){o.targetGeometry=n.clone();const i=X(t);q(t,i,a);const s=wt(a,e)?0:1;return o.camera=await H(t,n,a.heading,a.tilt,s,r),o}function Ft(t,e,n,a,r){let o=0;null!=n.z?o=n.z:t.basemapTerrain&&t.elevationProvider&&(o=nt(t.elevationProvider,n)),h(Ut,n.x,n.y,o),B(t.spatialReference,Ut,kt,t.renderSpatialReference),s(Ot,kt),c(Ot,Ot),E(It);const i=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(let s=0;s<i.length;s++){const e=i[s];let n=a[e[2]];isFinite(n)||(n=o),h(Ut,a[e[0]],a[e[1]],n),Z(Ut,t.spatialReference,Ut,t.renderSpatialReference),V(It,d(Ut,Ut,Ot))}const l=k(It),m=O(It),u=I(It),f=1/Math.tan(e.fovX/2),p=1/Math.tan(e.fovY/2),g=.5*Math.sqrt(l*l+u*u)*Math.max(p,f)+.5*m,y=.5*m*p+.5*Math.max(l,u);return Math.max(g,y)/r}async function Tt(t,e,n,a,r,o,i,s){s.targetGeometry=n.clone();const c=X(t),l=Ft(t,c,n,a,r);q(t,c,o);const m=wt(o,e)?0:1;return s.camera=await K(t,s.targetGeometry,l,o,m,i),s.scale=Q(t,l),s}function Pt(t,e){if(!e||!t.spatialReference)return null;const n={target:void 0};return"declaredClass"in e||Array.isArray(e)?n.target=e:(Object.assign(n,e),!n.target&&"center"in e&&e.center&&(n.target=e.center)),n}function At(t){return null!=t?.camera&&(t.rotation=it(t.camera.heading)),t}function Et(t,e){const n=rt;if(!e.length)return n;let a=Number.NEGATIVE_INFINITY;for(let r=0;r<e.length;r++){const t=e[r].screenSpaceBoundingRect;a=Math.max(a,Math.abs(t[0]),Math.abs(t[1]),Math.abs(t[2]),Math.abs(t[3]))}return n-a/Math.min(t.width,t.height)*2}class Vt{constructor(){this.hasZ=!1,this.boundingBox=E(),this.screenSpaceObjects=new Array}}const Ut=w(),kt=m(),Ot=l(),It=F(),Nt=N(),Ct=w(),Wt=w(),Yt=w(),qt={heading:0,tilt:0},Dt=new b,Xt={point(t,e,n){n[0]=t.x,n[1]=t.y,null!=t.z&&(n[2]=t.z),e(n)},polygon(t,e,n){const a=t.hasZ;for(let r=0;r<t.rings.length;r++){const o=t.rings[r];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],a&&(n[2]=o[t][2]),e(n)}},polyline(t,e,n){const a=t.hasZ;for(let r=0;r<t.paths.length;r++){const o=t.paths[r];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],a&&(n[2]=o[t][2]),e(n)}},multipoint(t,e,n){const a=t.points,r=t.hasZ;for(let o=0;o<a.length;o++)n[0]=a[o][0],n[1]=a[o][1],r&&(n[2]=a[o][2]),e(n)},extent(t,e,n){null!=t.zmin&&null!=t.zmax?(e(h(n,t.xmin,t.ymin,t.zmin)),e(h(n,t.xmax,t.ymin,t.zmin)),e(h(n,t.xmin,t.ymax,t.zmin)),e(h(n,t.xmax,t.ymax,t.zmin)),e(h(n,t.xmin,t.ymin,t.zmax)),e(h(n,t.xmax,t.ymin,t.zmax)),e(h(n,t.xmin,t.ymax,t.zmax)),e(h(n,t.xmax,t.ymax,t.zmax))):(e(h(n,t.xmin,t.ymin,n[2])),e(h(n,t.xmax,t.ymin,n[2])),e(h(n,t.xmin,t.ymax,n[2])),e(h(n,t.xmax,t.ymax,n[2])))}};export{yt as create,gt as fromCamera,ct as toCameraAsync,st as toCameraSync};
5
+ import t from"../../../Camera.js";import e from"../../../Graphic.js";import n from"../../../Viewpoint.js";import{result as r}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{cyclicalDegrees as a}from"../../../core/Cyclical.js";import o from"../../../core/Error.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{fromMat4 as s,transpose as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as u,f,j as p,c as g,d as y,i as h,o as d}from"../../../chunks/vec32.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import x from"../../../geometry/Extent.js";import j from"../../../geometry/Geometry.js";import v from"../../../geometry/Multipoint.js";import b from"../../../geometry/Point.js";import{projectWithZConversion as R,tryProjectWithZConversion as z}from"../../../geometry/projectionUtils.js";import G from"../../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as B}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVectorAsync as M}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as S}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as Z}from"../../../geometry/projection/projectVectorToVector.js";import{create as F,center as T,toRect as P,isPoint as A,empty as E,expandWithVec3 as V,expandWithAABB as k,width as O,height as U,depth as N}from"../../../geometry/support/aaBoundingBox.js";import{create as I,isPoint as C}from"../../../geometry/support/aaBoundingRect.js";import{polygonCentroidPoint as W}from"../../../geometry/support/centroid.js";import{intersectsPoint as Y}from"../../../geometry/support/frustum.js";import{getResolutionInMetersForScale as q}from"../../../geometry/support/scaleUtils.js";import{fromRenderCamera as D,toRenderCamera as J}from"../webgl.js";import{cameraOnContentAlongViewDirection as X}from"../camera/intersectionUtils.js";import{getViewSR as _,fromExtentAsync as H,scaleToDistance as K,fromCenterDistanceAsync as L,fromExtentSync as Q,distanceToScale as $,fromCenterDistanceSync as tt,fromCenterScale as et,zoomToScale as nt}from"./cameraUtils.js";import{getElevationAtPoint as rt}from"./ElevationProvider.js";import{directionToHeadingTilt as at}from"./viewingModeUtils.js";const ot=.66;function it(t){return 360-a.normalize(t)}function st(t){return a.normalize(360-t)}function ct(t,e,n){const r=e.camera;if(null!=r)return mt(r,_(t));const{targetGeometry:a}=e;if(null==a)return null;const{camera:o,mode:i}=ft(t,e.rotation,n);if("point"===a.type)return pt(t,e,a,o,i);const s=a.extent;return null==s?null:Q(t,s,o.heading,o.tilt,i)}async function lt(t,e,n,r){const a=e.camera;if(null!=a)return ut(a,_(t),r);const{targetGeometry:o}=e;if(null==o)throw new Error("Viewpoint has no targetGeometry!");const{camera:i,mode:s}=ft(t,e.rotation,n);if("point"===o.type)return gt(t,e,o,i,s,r);const c=o.extent;if(null==c)throw new Error("Target geometry has no extent!");return H(t,c,i.heading,i.tilt,s,r)}function mt(t,e){const n=t.position;let r;try{r=z(n,e)}catch(o){return null}if(!r)return null;const a=t.clone();return a.position=r.clone(),a}async function ut(t,e,n){const r=t.position,a=await R(r,e,{signal:n});i(n);const o=t.clone();return o.position=a.clone(),o}function ft(t,e,n){const r=D(t,t.state.camera);let a=1;return null!=e&&(r.heading=it(e),a=0),null!=n&&(r.tilt=n),{camera:r,mode:a}}function pt(t,e,n,r,a){const o=t.spatialReference;let i;try{i=z(n.clone(),o)}catch(c){return null}if(!i)return null;const s=null!=e.scale?K(t,e.scale):t.state.camera.distance;return tt(t,i,s,r,a)}async function gt(t,e,n,r,a,o){const s=t.spatialReference,c=await R(n.clone(),s,{signal:o});i(o);const l=null!=e.scale?K(t,e.scale):t.state.camera.distance;return L(t,c,l,r,a,o)}function yt(t,e,r=null){return null==r&&(r=new n),jt(t,null,e.clone(),r)}async function ht(e,r,a){const i=At(e,r);if(!i)throw new o("viewpointutils-create:no-target","Missing target for creating viewpoint");const s=new t({fov:e.camera.fov}),c=new n({camera:s});if(i.target instanceof n){return Et(await zt(e,i.target,i,a,c))}if(i.target instanceof t)return Et(await Gt(e,i.target,a,c));const l=null!=i.scale||null!=i.zoom;if(i.target instanceof x){const t=i.target.xmin===i.target.xmax||i.target.ymin===i.target.ymax;return Et(l||t?await Mt(e,i,i.target.center,s,a,c):await Ft(e,i,i.target,s,a,c))}const m=new kt,u=l?wt(e,i):void 0;if(await Rt(e,i.target,u,m,a),isFinite(m.boundingBox[0])){let t;if(T(m.boundingBox,Ot),Jt.x=Ot[0],Jt.y=Ot[1],Jt.z=Ot[2],Jt.spatialReference=e.spatialReference,isFinite(Jt.z)&&m.hasZ?t=A(m.boundingBox):(Jt.z=void 0,t=C(P(m.boundingBox,Ct))),l||t)return Et(await Mt(e,i,Jt,s,a,c));const n=Vt(e,m.screenSpaceObjects);return Et(await Pt(e,i,Jt,m.boundingBox,n,s,a,c))}return i.position?Et(await St(e,i,s,c,a)):Et(await Zt(e,i,s,a,c))}function dt(t,e){return null==e.scale&&null!=e.zoom?nt(t,e.zoom):e.scale}function wt(t,e){const n=dt(t,e);return n?q(n):void 0}function xt(t,e){let n=!1;return null!=e.heading?(t.heading=e.heading,n=!0):null!=e.rotation&&(t.heading=it(e.rotation),n=!0),null!=e.tilt&&(t.tilt=e.tilt,n=!0),null!=e.fov&&(t.fov=e.fov),n}function jt(t,e,n,r){const a=t.spatialReference||G.WGS84;if(e??=J(t,n),null==e)return r;const o=new b({spatialReference:a});return S(e.center,t.renderSpatialReference,o)?(r.targetGeometry=o,r.scale=$(t,e.distance),r.rotation=st(n.heading),r.camera=n,r):r}async function vt(t,e,n,r){const a=()=>new o("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!e)throw a();"mesh"===e.type&&(e=e.extent);const i=t.basemapTerrain.spatialReference;if(!e.hasZ&&t.basemapTerrain){let n;switch(e.type){case"point":n=e;break;case"multipoint":case"polyline":n=e.extent?.center;break;case"extent":n=e.center;break;case"polygon":{const t=W(e);n=t?b.fromJSON(t):null;break}}null!=n&&i&&t.elevationProvider?(n=await R(n,i,{signal:r}),Ot[2]=rt(t.elevationProvider,n)??0):Ot[2]=0}const s=Xt[e.type],c=new Array;if(s(e,e.hasZ?t=>{c.push([t[0],t[1],t[2]])}:t=>{c.push([t[0],t[1]])},Ot),0===c.length)throw a();const l=e.spatialReference,m=t.spatialReference,u=await R(new v({spatialReference:l,hasZ:e.hasZ,hasM:!1,points:c}),m,{signal:r});if(e.hasZ&&(n.hasZ=!0),e.hasZ)for(const[o,f,p]of u.points)Ot[0]=o,Ot[1]=f,Ot[2]=p,V(n.boundingBox,Ot);else for(const[o,f]of u.points)Ot[0]=o,Ot[1]=f,V(n.boundingBox,Ot)}async function bt(t,e,n,a,o){const i=await r(t.whenViewForGraphic(e));if(!1===i.ok||null==i.value||!("whenGraphicBounds"in i.value))return void await vt(t,e.geometry,a,o);const s=i.value,c=await r(s.whenGraphicBounds(e,{minDemResolution:n}));if(!1===c.ok||!c.value)return void await vt(t,e.geometry,a,o);const{screenSpaceObjects:l,boundingBox:m}=c.value;k(a.boundingBox,m),l&&l.forEach(t=>{a.screenSpaceObjects.push(t)}),isFinite(m[2])&&(a.hasZ=!0)}async function Rt(t,n,r,a,o){if(Array.isArray(n)&&2===n.length){const e=n[0],r=n[1];if("number"==typeof e&&"number"==typeof r)return Jt.x=e,Jt.y=r,Jt.z=void 0,Jt.spatialReference=t.spatialReference?.isGeographic?t.spatialReference:G.WGS84,void await vt(t,Jt,a,o)}n&&"map"in n&&"function"==typeof n.map?await Promise.allSettled(n.map(e=>Rt(t,e,r,a,o))):n instanceof j?await vt(t,n,a,o):n instanceof e&&await bt(t,n,r,a,o)}async function zt(t,e,n,r,a){if(e.camera)return Gt(t,e.camera,r,a);a.scale=e.scale,a.rotation=e.rotation,a.targetGeometry=null!=e.targetGeometry?e.targetGeometry.clone():null,a.camera=null,null!=n.heading?a.rotation=st(n.heading):null!=n.rotation&&(a.rotation=n.rotation);const o=dt(t,n);return null!=o&&(a.scale=o),a.camera=await lt(t,a,n.tilt,r),a}async function Gt(t,e,n,r){const a=t.spatialReference,o=await R(e.position,a,{signal:n}),i=e.clone();return i.position=o,jt(t,null,i,r)}async function Bt(t,e,n,r,a,o,i){const s=t.renderSpatialReference;return await M(e,qt,s,0,{signal:i}),await M(n,Yt,s,0,{signal:i}),o.targetGeometry=new b(e),a.position=new b(n),y(Wt,qt,Yt),at(t,Yt,Wt,r.up,a),o.scale=$(t,p(Yt,qt)),o.rotation=st(a.heading),o.camera=a,o}async function Mt(t,e,n,r,a,o){o.targetGeometry=n.clone();const i=X(t);if(e.position)return Bt(t,o.targetGeometry,e.position,i,r,o,a);if(e.zoomFactor){const n=i.distance/e.zoomFactor,r=u(Ot,i.viewForward,-n);i.eye=f(Ot,i.center,r),o.scale=$(t,n)}D(t,i,r);const s=xt(r,e)?0:1;if(!e.zoomFactor){const n=dt(t,e);if(null==n){await M(o.targetGeometry,Ot,t.renderSpatialReference,0,{signal:a});const e=Y(i.frustum,Ot)?p(i.eye,Ot):i.distance;o.camera=await L(t,o.targetGeometry,e,r,s),o.scale=$(t,e)}else o.scale=n,o.camera=await et(t,o.targetGeometry,o.scale,r,s,a)}return o}async function St(t,e,n,r,a){const o=X(t);g(Wt,o.viewForward),at(t,o.eye,Wt,o.up,Dt);const i=t.spatialReference,{position:s}=e;if(s){const t=await R(s,i,{signal:a});n.position=t}else n.position=new b;return n.heading=null!=e.heading?e.heading:Dt.heading,n.tilt=null!=e.tilt?e.tilt:Dt.tilt,jt(t,null,n,r)}async function Zt(t,e,n,r,a){if(null!=e.heading||null!=e.rotation||null!=e.scale||null!=e.tilt||null!=e.zoom||null!=e.zoomFactor){const o=X(t),{spatialReference:i,renderSpatialReference:s}=t,c=new b({spatialReference:i});return S(o.center,s,c)?Mt(t,e,c,n,r,a):a}return a.scale=t.scale,a.camera=t.camera.clone(),xt(a.camera,e),a}async function Ft(t,e,n,r,a,o){o.targetGeometry=n.clone();const i=X(t);D(t,i,r);const s=xt(r,e)?0:1;return o.camera=await H(t,n,r.heading,r.tilt,s,a),o}function Tt(t,e,n,r,a){let o=0;null!=n.z?o=n.z:t.basemapTerrain&&t.elevationProvider&&(o=rt(t.elevationProvider,n)),h(Ot,n.x,n.y,o),B(t.spatialReference,Ot,Ut,t.renderSpatialReference),s(Nt,Ut),c(Nt,Nt),E(It);const i=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(let s=0;s<i.length;s++){const e=i[s];let n=r[e[2]];isFinite(n)||(n=o),h(Ot,r[e[0]],r[e[1]],n),Z(Ot,t.spatialReference,Ot,t.renderSpatialReference),V(It,d(Ot,Ot,Nt))}const l=O(It),m=U(It),u=N(It),f=1/Math.tan(e.fovX/2),p=1/Math.tan(e.fovY/2),g=.5*Math.sqrt(l*l+u*u)*Math.max(p,f)+.5*m,y=.5*m*p+.5*Math.max(l,u);return Math.max(g,y)/a}async function Pt(t,e,n,r,a,o,i,s){s.targetGeometry=n.clone();const c=X(t),l=Tt(t,c,n,r,a);D(t,c,o);const m=xt(o,e)?0:1;return s.camera=await L(t,s.targetGeometry,l,o,m,i),s.scale=$(t,l),s}function At(t,e){if(!e||!t.spatialReference)return null;const n={target:void 0};return"declaredClass"in e||Array.isArray(e)?n.target=e:(Object.assign(n,e),!n.target&&"center"in e&&e.center&&(n.target=e.center)),n}function Et(t){return null!=t?.camera&&(t.rotation=st(t.camera.heading)),t}function Vt(t,e){const n=ot;if(!e.length)return n;let r=Number.NEGATIVE_INFINITY;for(let a=0;a<e.length;a++){const t=e[a].screenSpaceBoundingRect;r=Math.max(r,Math.abs(t[0]),Math.abs(t[1]),Math.abs(t[2]),Math.abs(t[3]))}return n-r/Math.min(t.width,t.height)*2}class kt{constructor(){this.hasZ=!1,this.boundingBox=E(),this.screenSpaceObjects=new Array}}const Ot=w(),Ut=m(),Nt=l(),It=F(),Ct=I(),Wt=w(),Yt=w(),qt=w(),Dt={heading:0,tilt:0},Jt=new b,Xt={point(t,e,n){n[0]=t.x,n[1]=t.y,null!=t.z&&(n[2]=t.z),e(n)},polygon(t,e,n){const r=t.hasZ;for(let a=0;a<t.rings.length;a++){const o=t.rings[a];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],r&&(n[2]=o[t][2]),e(n)}},polyline(t,e,n){const r=t.hasZ;for(let a=0;a<t.paths.length;a++){const o=t.paths[a];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],r&&(n[2]=o[t][2]),e(n)}},multipoint(t,e,n){const r=t.points,a=t.hasZ;for(let o=0;o<r.length;o++)n[0]=r[o][0],n[1]=r[o][1],a&&(n[2]=r[o][2]),e(n)},extent(t,e,n){null!=t.zmin&&null!=t.zmax?(e(h(n,t.xmin,t.ymin,t.zmin)),e(h(n,t.xmax,t.ymin,t.zmin)),e(h(n,t.xmin,t.ymax,t.zmin)),e(h(n,t.xmax,t.ymax,t.zmin)),e(h(n,t.xmin,t.ymin,t.zmax)),e(h(n,t.xmax,t.ymin,t.zmax)),e(h(n,t.xmin,t.ymax,t.zmax)),e(h(n,t.xmax,t.ymax,t.zmax))):(e(h(n,t.xmin,t.ymin,n[2])),e(h(n,t.xmax,t.ymin,n[2])),e(h(n,t.xmin,t.ymax,n[2])),e(h(n,t.xmax,t.ymax,n[2])))}};export{ht as create,yt as fromCamera,lt as toCameraAsync,ct as toCameraSync};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{isValidIntersectorResult as t}from"../webgl-engine/lib/IntersectorResult.js";import{Graphic3DTarget as e}from"../webgl-engine/lib/IntersectorTarget.js";function r(e){return t(e)&&2===e.intersector&&!!e.target}class n extends e{constructor(t,e,r){super(t,e),this.triangleNr=r}}function o(e){return t(e)&&3===e.intersector&&!!e.target}export{n as OverlayTarget,o as isOverlayIntersectorResult,r as isTerrainIntersectorResult};
5
+ import{isValidIntersectorResult as e}from"../webgl-engine/lib/IntersectorResult.js";import{Graphic3DTarget as t}from"../webgl-engine/lib/IntersectorTarget.js";function r(t){return e(t)&&2===t.intersector&&!!t.target}function n(t,r){if(!e(r)||!r.target||!("layerViewUid"in r.target))return!1;const n=r.target.layerViewUid,i=t.allLayerViews.find(e=>e.uid===n);switch(i?.layer.type){case"integrated-mesh":case"integrated-mesh-3dtiles":return!0}return!1}class i extends t{constructor(e,t,r){super(e,t),this.triangleNr=r}}function s(t){return e(t)&&3===t.intersector&&!!t.target}export{i as OverlayTarget,n as isIntegratedMeshIntersectorResult,s as isOverlayIntersectorResult,r as isTerrainIntersectorResult};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{destroyMaybe as t}from"../../../../../core/maybe.js";class e{constructor(t,e,s,i,o,r){this.transform=t,this.toMapSpace=e,this.obb=s,this.componentData=i,this.renderable=o,this.intersectionGeometry=r,this.visible=!1,this.offsetObb=null}destroy(){this.intersectionGeometry=t(this.intersectionGeometry),this.renderable=t(this.renderable),this.componentData=t(this.componentData)}}export{e as ComponentObject};
5
+ import{destroyMaybe as t}from"../../../../../core/maybe.js";import{i as o,o as e,f as r}from"../../../../../chunks/vec32.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as i}from"../../../../../geometry/support/aaBoundingBox.js";class a{constructor(t,o,e,r,s,i){this.transform=t,this.toMapSpace=o,this.obb=e,this.componentData=r,this.renderable=s,this.intersectionGeometry=i,this.visible=!1,this.offsetObb=null,this._aabbInWorldCoordinates=null}destroy(){this.intersectionGeometry=t(this.intersectionGeometry),this.renderable=t(this.renderable),this.componentData=t(this.componentData)}get aabbInWorldCoordinates(){let t=this._aabbInWorldCoordinates;return t||(t=this._computeAabbInWorldCoordinates(),this._aabbInWorldCoordinates=t),t}_computeAabbInWorldCoordinates(){const t=i(),a=this.intersectionGeometry.positions;if(Math.floor(a.length/3)>0){const{rotationScale:i,position:n}=this.transform;let h=1/0,m=1/0,c=1/0,l=-1/0,b=-1/0,d=-1/0;const p=s();for(let t=0;t<a.length;t+=3)o(p,a[t+0],a[t+1],a[t+2]),e(p,p,i),r(p,p,n),h=Math.min(h,p[0]),m=Math.min(m,p[1]),c=Math.min(c,p[2]),l=Math.max(l,p[0]),b=Math.max(b,p[1]),d=Math.max(d,p[2]);t[0]=h,t[1]=m,t[2]=c,t[3]=l,t[4]=b,t[5]=d}return t}}export{a as ComponentObject};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Logger.js";import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import i from"../../../../../core/PooledArray.js";import{isTypedArray as o}from"../../../../../core/typedArrayUtil.js";import{s as n}from"../../../../../chunks/vec32.js";import{clone as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as s}from"../../../../../geometry/support/aaBoundingBox.js";import{compactIndices as a}from"../../../../../geometry/support/Indices.js";import{c}from"../../../../../chunks/vec3.js";import{c as l}from"../../../../../chunks/vec33.js";import{encodeSymbolColor as m}from"../../../layers/support/symbolColorUtils.js";import{computeOffsetObb as h}from"../../../support/orientedBoundingBox.js";import{glLayout as f}from"../../../support/buffer/glUtil.js";import{ComponentData as p}from"./ComponentData.js";import{ComponentObject as g}from"./ComponentObject.js";import{IntersectionGeometry as d}from"./IntersectionGeometry.js";import{Renderable as u}from"./Renderable.js";import{RenderGeometry as b}from"./RenderGeometry.js";import{RenderSubmitSystem as v}from"./RenderSubmitSystem.js";import{createVertexBufferLayout as y}from"./SourceGeometry.js";import{UniformComponentParameters as _}from"./UniformComponentParameters.js";import{ComponentParametersVarying as M,ComponentParametersUniform as C,ComponentMaterial as j}from"./Material/ComponentMaterial.js";import{indexGlLayout as w}from"./Material/ComponentTechnique.js";import{getComponentFieldCount as O,encodeElevationOffset as x,encodeEmissiveStrength as D}from"./Material/shader/ComponentData.glsl.js";import{olidEnabled as R}from"../../effects/geometry/olidUtils.js";import{getVisibility as S,updatePickabilityWithCount as A}from"../../lib/ComponentUtils.js";import{assert as P}from"../../lib/Util.js";import{VertexArrayObject as B}from"../../lib/VertexArrayObject.js";import{getVerticalOffsetI3S as E}from"../../lib/verticalOffsetUtils.js";import{BufferManager as H}from"../../lib/TextureBackedBuffer/BufferManager.js";import{BufferObject as U}from"../../../../webgl/BufferObject.js";import{PrimitiveType as V}from"../../../../webgl/enums.js";import{VertexBuffer as I}from"../../../../webgl/VertexBuffer.js";const N=()=>e.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class k{constructor(e,t){this._renderManager=e,this._viewingMode=t,this._elevationRangeCacheVerticalOffset=NaN,this._elevationRangeCacheMin=NaN,this._elevationRangeCacheMax=NaN,this._activeHighlightOptions=new Map,this._visible=new i,this._hidden=new i,this._renderSubmit=new v(this),this._renderManager.register(this._renderSubmit),this._componentBufferManager=new H(e.rctx,O())}destroy(){P(0===this._hidden.length&&0===this._visible.length,"ObjectCollection should be empty upon disposal"),this._componentBufferManager.destroy(),this._componentBufferManager=null,this._visible.forAll(e=>e.destroy()),this._visible.prune(),this._hidden.forAll(e=>e.destroy()),this._hidden.prune(),this._renderSubmit.destroy()}createObject(e){const t=e.geometry,i=new p(this._componentBufferManager,a(t.componentOffsets)),o=this._createRenderable(e,i),n=new d(this._viewingMode,t.positionData,i),r=new g(e.transform,e.toMapSpace,e.obb.clone(),i,o,n);return(r.visible?this._visible:this._hidden).push(r),r}destroyObject(e){const t=e;(t.visible?this._visible:this._hidden).removeUnordered(t),t.destroy(),this._notifyDirty()}setObjectVisibility(e,t){const i=e;t!==i.visible&&(t?(this._hidden.removeUnordered(i),this._visible.push(i)):(this._visible.removeUnordered(i),this._hidden.push(i)),i.visible=t,this._notifyDirty())}preSubmit(e){const t=e.camera.eye;this.visibleObjects.forAll(e=>e.renderable.meta.cameraDepthSquared=n(t,e.obb.center))}getMaterial(e){return e.renderable.material}updateMaterial(e,t){const i=e.renderable.material;t(i),i.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,t){const i=e;i.componentData.visibility.reset(t),i.componentData.markVisibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,t){return e.componentData.visibility.forEachComponent(t)}getComponentCount(e){const t=e,i=t.componentData.visibility.componentCount;return{visible:i,invisible:t.componentData.count-i}}setComponentData(e,t){const i=e,{renderable:o,componentData:n}=i,r=o.material,s=n.materialDataBuffer,a=n.materialDataIndices,c=new _,l=s.textureBuffer,f=new Uint8Array(4),p=new Uint32Array(f.buffer);let g=0,d=0,u=0,b=0,v=0,y=n.verticalOffsets,j=1/0,w=-1/0,O=!1,P=!1,B=!1,E=0;for(let h=0;h<n.count;h++){t(h,c),g+=+(c.externalColor[3]<1),d+=+(3===c.externalColorMixMode&&1===c.externalColor[3]),b+=+(c.emissiveStrength>0),v+=+(1===c.emissiveSource),P||=1!==c.emissiveStrength,u+=+c.castShadows,m(c.externalColor,c.externalColorMixMode,f),f[2]=254&f[2]|+c.castShadows,l.setData(a[h],0,f[0],f[1],f[2],f[3]),O||=h>0&&E!==p[0],E=p[0],B||=0!==c.elevationOffset,B&&null==y&&(y=new Array(h).fill(0)),null!=y&&(y[h]=c.elevationOffset),j=Math.min(j,c.elevationOffset),w=Math.max(w,c.elevationOffset),x(c.elevationOffset,f),l.setData(a[h],1,f[0],f[1],f[2],f[3]),D(c.emissiveStrength,f),l.setData(a[h],2,f[0],f[1],f[2],0===c.emissiveSource?0:255);const e=c.olidColor;null!=e&&l.setData(a[h],3,e[0],e[1],e[2],e[3]),c.pickable!==S(n.pickability,h)&&A(n,h,c.pickable)}n.verticalOffsets=B?y:null,i.offsetObb=B?h(i.obb,j,w,this._viewingMode,i.offsetObb??i.obb.clone()):null,O||B||R()||(P||v>0)&&b>0?(r.componentParameters=new M,r.componentParameters.castShadows=G(u,n.count),r.componentParameters.transparent=G(g,n.count),r.componentParameters.opaqueOverride=G(d,n.count),r.componentParameters.emissiveOverride=G(b,n.count),r.componentParameters.emissiveSourceOverride=G(v,n.count),r.componentParameters.texture=l,l.updateTexture()):(r.componentParameters=new C,r.componentParameters.castShadows=c.castShadows?0:2,r.componentParameters.externalColor=c.externalColor,r.componentParameters.externalColorMixMode=c.externalColorMixMode,r.componentParameters.emissiveStrength=c.emissiveStrength,r.componentParameters.emissiveSource=c.emissiveSource),this._elevationRangeCacheVerticalOffset=NaN,this._notifyDirty()}getComponentAabb(e,t,i,o=!1){e.intersectionGeometry.getComponentAabb(t,i);const n=e,r=n.componentData.verticalOffsets;if(o||null==r)return i;const s=r[t];if(2===this._viewingMode||0===s)return i[2]+=s,i[5]+=s,i;const a=E(s);return a.localOrigin=n.transform.position,a.applyToAabb(i)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,i){return e.intersectionGeometry.getComponentPositions(t,i)}expandRangeWithComponentObjectElevationRange(e,t,i,o){Number.isNaN(this._elevationRangeCacheVerticalOffset)||this._elevationRangeCacheVerticalOffset!==t||o.expandElevationRangeValues(this._elevationRangeCacheMin,this._elevationRangeCacheMax);const n=e,r=n.componentData,s=r.count,a=r.verticalOffsets,c=n.intersectionGeometry,l=2===this._viewingMode,m=c.getComponentAabbs(),h=L;let f=1/0,p=-1/0;for(let g=0;g<s;g++){const e=6*g,r=a?.[g]??0;let s=1/0,c=-1/0;if(l)s=m[e+2]+r+t,c=m[e+5]+r+t;else{if(h[0]=m[e],h[1]=m[e+1],h[2]=m[e+2],h[3]=m[e+3],h[4]=m[e+4],h[5]=m[e+5],0!==r){const e=E(r);e.localOrigin=n.transform.position,e.applyToAabb(h)}const s=Math.max(Math.abs(h[3]),Math.abs(h[0])),a=Math.max(Math.abs(h[4]),Math.abs(h[1])),c=t+h[5]+i;o.expandElevationRangeValues(t+h[2],Math.sqrt(s*s+a*a+c*c)-i)}o.expandElevationRangeValues(s,c),f=Math.min(f,s),p=Math.max(p,c)}this._elevationRangeCacheVerticalOffset=t,this._elevationRangeCacheMin=f,this._elevationRangeCacheMax=p}intersect(e,t,i,o,n,r,s){const a=e,{transform:c,componentData:l,intersectionGeometry:m}=a;return null!=n&&(n.localOrigin=c.position),m.intersect(t,i,o,n,l.verticalOffsets,c,r,s)}addEdges(e,t,i,o,n){const r=e,{indices:s,positions:a}=r.intersectionGeometry,c=r.componentData.offsets;return t.addComponentObject(r,a,s,c,i,o,n)}async extractEdgeInformation(e,t,i){const o=e,n=o.componentData.visibility;if(n.allInvisible()){const{extractComponentsEdgeLocationsLayout:e}=await import("../../lib/edgeRendering/edgeProcessing.js");return{buffer:e.createBuffer(0),origin:[0,0,0]}}const{indices:s,positions:a}=o.intersectionGeometry,m=o.componentData.offsets,{EdgeInputBufferLayout:h}=await import("../../lib/edgeRendering/bufferLayouts.js"),f=h.createBuffer(a.length/3);l(f.position.typedBuffer,a,f.position.typedBufferStride,3),c(f.position,f.position,o.transform.rotationScale),this._setComponentIndices(f.componentIndex,s,m);const p=f.count,g=this._computeVisibilityIndices(s,n,m,p);return{origin:r(o.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:g,indicesLength:g.length,skipDeduplicate:!0,data:f,writerSettings:{reducedPrecision:!1,variants:0}},i)}}_setComponentIndices(e,t,i){let o=0;for(let n=0;n<i.length-1;n++){const r=i[n],s=i[n+1];for(let i=r;i<s;i++){const n=t?t[i]:i;e.set(n,o)}o++}}_computeVisibilityIndices(e,t,i,n){if(e&&t.allVisible())return e;let r=0;t.forEachComponentRange((e,t)=>(r+=i[t]-i[e],!0));const s=o(e)?2===e?.BYTES_PER_ELEMENT||n<=65536?new Uint16Array(r):new Uint32Array(r):new Array(r);let a=0;return t.forEachComponentRange((t,o)=>{const n=i[t],r=i[o];for(let i=n;i<r;i++)s[a++]=e?e[i]:i;return!0}),s}addComponentHighlight(e,i,o){const n=e.componentData,r=t(n.componentHighlights,o,()=>new Uint32Array(n.count+1));{const e=this._activeHighlightOptions.get(o)??0;this._activeHighlightOptions.set(o,e+1)}0===r[i]++&&(n.markHighlightsDirty(),this._notifyDirty()),r[n.count]++}removeComponentHighlight(e,t,i){const{componentData:o}=e,n=o.componentHighlights.get(i);if(void 0===n)return void N().warn("Removing non-existing highlight.");const r=n[t];if(0===r)return void N().warn("Removing non-existing highlight.");this._removeActiveHighlight(i);const s=n[o.count];if(r>1)return n[t]=r-1,void(n[o.count]=s-1);n[t]=0,1===s?o.componentHighlights.delete(i):n[o.count]=s-1,o.markHighlightsDirty(),this._notifyDirty()}_removeActiveHighlight(e,t=1){const i=this._activeHighlightOptions.get(e);if(void 0===i)N().warn("Removing non-existing highlight.");else{const o=i-t;o<0&&N().warn("Removing non-existing highlight."),o<=0?this._activeHighlightOptions.delete(e):this._activeHighlightOptions.set(e,o)}}clearHighlights(e){const{componentData:t}=e,{componentHighlights:i}=t;if(i.size>0){for(const e of i)this._removeActiveHighlight(e[0],e[1][t.count]);i.clear(),t.markHighlightsDirty(),this._notifyDirty()}}hasHighlight(e){return this._activeHighlightOptions.has(e)}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._visible}_createRenderable(e,t){const i=this._renderManager.rctx,o=e.geometry,n=o.vertices.layoutParameters,r=f(y(n)),s=new I(i,r,o.vertices.data),a=o.indices?U.createIndex(i,35044,o.indices):null,c=new Uint16Array(o.vertices.count);for(let f=0;f<t.count;f++){const e=t.offsets[f],i=t.offsets[f+1],n=t.materialDataIndices[f];if(null!=o.indices)for(let t=e;t<i;t++){c[o.indices[t]]=n}else for(let t=e;t<i;t++)c[t]=n}const l=new I(i,w,c.buffer),m=new j(e.transform,e.toMapSpace),h=new B(i,new Map([["geometry",s],["componentIndices",l]]),a),p=new b(h,V.TRIANGLES,n,null!=a),g={cameraDepthSquared:.5,gpuMemoryEstimate:s.usedMemory+l.usedMemory+(null!=a?a.usedMemory:0)};return new u(m,p,g)}_notifyDirty(){this._renderManager.notifyDirty()}}function G(e,t){return e===t?0:0===e?2:1}const L=s();export{k as ComponentObjectCollection};
5
+ import e from"../../../../../core/Logger.js";import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import i from"../../../../../core/PooledArray.js";import{isTypedArray as o}from"../../../../../core/typedArrayUtil.js";import{s as n}from"../../../../../chunks/vec32.js";import{clone as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as s}from"../../../../../geometry/support/aaBoundingBox.js";import{compactIndices as a}from"../../../../../geometry/support/Indices.js";import{c}from"../../../../../chunks/vec3.js";import{c as l}from"../../../../../chunks/vec33.js";import{encodeSymbolColor as m}from"../../../layers/support/symbolColorUtils.js";import{computeOffsetObb as h}from"../../../support/orientedBoundingBox.js";import{glLayout as f}from"../../../support/buffer/glUtil.js";import{ComponentData as p}from"./ComponentData.js";import{ComponentObject as g}from"./ComponentObject.js";import{IntersectionGeometry as d}from"./IntersectionGeometry.js";import{Renderable as u}from"./Renderable.js";import{RenderGeometry as b}from"./RenderGeometry.js";import{RenderSubmitSystem as v}from"./RenderSubmitSystem.js";import{createVertexBufferLayout as y}from"./SourceGeometry.js";import{UniformComponentParameters as _}from"./UniformComponentParameters.js";import{ComponentParametersVarying as M,ComponentParametersUniform as C,ComponentMaterial as j}from"./Material/ComponentMaterial.js";import{indexGlLayout as w}from"./Material/ComponentTechnique.js";import{getComponentFieldCount as O,encodeElevationOffset as x,encodeEmissiveStrength as D}from"./Material/shader/ComponentData.glsl.js";import{olidEnabled as R}from"../../effects/geometry/olidUtils.js";import{getVisibility as S,updatePickabilityWithCount as A}from"../../lib/ComponentUtils.js";import{assert as P}from"../../lib/Util.js";import{VertexArrayObject as B}from"../../lib/VertexArrayObject.js";import{getVerticalOffsetI3S as E}from"../../lib/verticalOffsetUtils.js";import{BufferManager as H}from"../../lib/TextureBackedBuffer/BufferManager.js";import{BufferObject as U}from"../../../../webgl/BufferObject.js";import{PrimitiveType as V}from"../../../../webgl/enums.js";import{VertexBuffer as I}from"../../../../webgl/VertexBuffer.js";const N=()=>e.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class k{constructor(e,t){this._renderManager=e,this._viewingMode=t,this._elevationRangeCacheVerticalOffset=NaN,this._elevationRangeCacheMin=NaN,this._elevationRangeCacheMax=NaN,this._activeHighlightOptions=new Map,this._visible=new i,this._hidden=new i,this._renderSubmit=new v(this),this._renderManager.register(this._renderSubmit),this._componentBufferManager=new H(e.rctx,O())}destroy(){P(0===this._hidden.length&&0===this._visible.length,"ObjectCollection should be empty upon disposal"),this._componentBufferManager.destroy(),this._componentBufferManager=null,this._visible.forAll(e=>e.destroy()),this._visible.prune(),this._hidden.forAll(e=>e.destroy()),this._hidden.prune(),this._renderSubmit.destroy()}createObject(e){const{geometry:t}=e,i=new p(this._componentBufferManager,a(t.componentOffsets)),o=this._createRenderable(e,i),n=new d(this._viewingMode,t.positionData,i),r=new g(e.transform,e.toMapSpace,e.obb.clone(),i,o,n);return(r.visible?this._visible:this._hidden).push(r),r}destroyObject(e){const t=e;(t.visible?this._visible:this._hidden).removeUnordered(t),t.destroy(),this._notifyDirty()}setObjectVisibility(e,t){const i=e;t!==i.visible&&(t?(this._hidden.removeUnordered(i),this._visible.push(i)):(this._visible.removeUnordered(i),this._hidden.push(i)),i.visible=t,this._notifyDirty())}preSubmit(e){const t=e.camera.eye;this.visibleObjects.forAll(e=>e.renderable.meta.cameraDepthSquared=n(t,e.obb.center))}getMaterial(e){return e.renderable.material}updateMaterial(e,t){const i=e.renderable.material;t(i),i.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,t){const i=e;i.componentData.visibility.reset(t),i.componentData.markVisibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,t){return e.componentData.visibility.forEachComponent(t)}getComponentCount(e){const t=e,i=t.componentData.visibility.componentCount;return{visible:i,invisible:t.componentData.count-i}}setComponentData(e,t){const i=e,{renderable:o,componentData:n}=i,r=o.material,s=n.materialDataBuffer,a=n.materialDataIndices,c=new _,l=s.textureBuffer,f=new Uint8Array(4),p=new Uint32Array(f.buffer);let g=0,d=0,u=0,b=0,v=0,y=n.verticalOffsets,j=1/0,w=-1/0,O=!1,P=!1,B=!1,E=0;for(let h=0;h<n.count;h++){t(h,c),g+=+(c.externalColor[3]<1),d+=+(3===c.externalColorMixMode&&1===c.externalColor[3]),b+=+(c.emissiveStrength>0),v+=+(1===c.emissiveSource),P||=1!==c.emissiveStrength,u+=+c.castShadows,m(c.externalColor,c.externalColorMixMode,f),f[2]=254&f[2]|+c.castShadows,l.setData(a[h],0,f[0],f[1],f[2],f[3]),O||=h>0&&E!==p[0],E=p[0],B||=0!==c.elevationOffset,B&&null==y&&(y=new Array(h).fill(0)),null!=y&&(y[h]=c.elevationOffset),j=Math.min(j,c.elevationOffset),w=Math.max(w,c.elevationOffset),x(c.elevationOffset,f),l.setData(a[h],1,f[0],f[1],f[2],f[3]),D(c.emissiveStrength,f),l.setData(a[h],2,f[0],f[1],f[2],0===c.emissiveSource?0:255);const e=c.olidColor;null!=e&&l.setData(a[h],3,e[0],e[1],e[2],e[3]),c.pickable!==S(n.pickability,h)&&A(n,h,c.pickable)}n.verticalOffsets=B?y:null,i.offsetObb=B?h(i.obb,j,w,this._viewingMode,i.offsetObb??i.obb.clone()):null,O||B||R()||(P||v>0)&&b>0?(r.componentParameters=new M,r.componentParameters.castShadows=G(u,n.count),r.componentParameters.transparent=G(g,n.count),r.componentParameters.opaqueOverride=G(d,n.count),r.componentParameters.emissiveOverride=G(b,n.count),r.componentParameters.emissiveSourceOverride=G(v,n.count),r.componentParameters.texture=l,l.updateTexture()):(r.componentParameters=new C,r.componentParameters.castShadows=c.castShadows?0:2,r.componentParameters.externalColor=c.externalColor,r.componentParameters.externalColorMixMode=c.externalColorMixMode,r.componentParameters.emissiveStrength=c.emissiveStrength,r.componentParameters.emissiveSource=c.emissiveSource),this._elevationRangeCacheVerticalOffset=NaN,this._notifyDirty()}getComponentAabb(e,t,i,o=!1){e.intersectionGeometry.getComponentAabb(t,i);const n=e,r=n.componentData.verticalOffsets;if(o||null==r)return i;const s=r[t];if(2===this._viewingMode||0===s)return i[2]+=s,i[5]+=s,i;const a=E(s);return a.localOrigin=n.transform.position,a.applyToAabb(i)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,i){return e.intersectionGeometry.getComponentPositions(t,i)}expandRangeWithComponentObjectElevationRange(e,t,i,o){Number.isNaN(this._elevationRangeCacheVerticalOffset)||this._elevationRangeCacheVerticalOffset!==t||o.expandElevationRangeValues(this._elevationRangeCacheMin,this._elevationRangeCacheMax);const n=e,r=n.componentData,s=r.count,a=r.verticalOffsets,c=n.intersectionGeometry,l=2===this._viewingMode,m=c.getComponentAabbs(),h=L;let f=1/0,p=-1/0;for(let g=0;g<s;g++){const e=6*g,r=a?.[g]??0;let s=1/0,c=-1/0;if(l)s=m[e+2]+r+t,c=m[e+5]+r+t;else{if(h[0]=m[e],h[1]=m[e+1],h[2]=m[e+2],h[3]=m[e+3],h[4]=m[e+4],h[5]=m[e+5],0!==r){const e=E(r);e.localOrigin=n.transform.position,e.applyToAabb(h)}const s=Math.max(Math.abs(h[3]),Math.abs(h[0])),a=Math.max(Math.abs(h[4]),Math.abs(h[1])),c=t+h[5]+i;o.expandElevationRangeValues(t+h[2],Math.sqrt(s*s+a*a+c*c)-i)}o.expandElevationRangeValues(s,c),f=Math.min(f,s),p=Math.max(p,c)}this._elevationRangeCacheVerticalOffset=t,this._elevationRangeCacheMin=f,this._elevationRangeCacheMax=p}intersect(e,t,i,o,n,r,s){const a=e,{transform:c,componentData:l,intersectionGeometry:m}=a;return null!=n&&(n.localOrigin=c.position),m.intersect(t,i,o,n,l.verticalOffsets,c,r,s)}addEdges(e,t,i,o,n){const r=e,{indices:s,positions:a}=r.intersectionGeometry,c=r.componentData.offsets;return t.addComponentObject(r,a,s,c,i,o,n)}async extractEdgeInformation(e,t,i){const o=e,n=o.componentData.visibility;if(n.allInvisible()){const{extractComponentsEdgeLocationsLayout:e}=await import("../../lib/edgeRendering/edgeProcessing.js");return{buffer:e.createBuffer(0),origin:[0,0,0]}}const{indices:s,positions:a}=o.intersectionGeometry,m=o.componentData.offsets,{EdgeInputBufferLayout:h}=await import("../../lib/edgeRendering/bufferLayouts.js"),f=h.createBuffer(a.length/3);l(f.position.typedBuffer,a,f.position.typedBufferStride,3),c(f.position,f.position,o.transform.rotationScale),this._setComponentIndices(f.componentIndex,s,m);const p=f.count,g=this._computeVisibilityIndices(s,n,m,p);return{origin:r(o.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:g,indicesLength:g.length,skipDeduplicate:!0,data:f,writerSettings:{reducedPrecision:!1,variants:0}},i)}}_setComponentIndices(e,t,i){let o=0;for(let n=0;n<i.length-1;n++){const r=i[n],s=i[n+1];for(let i=r;i<s;i++){const n=t?t[i]:i;e.set(n,o)}o++}}_computeVisibilityIndices(e,t,i,n){if(e&&t.allVisible())return e;let r=0;t.forEachComponentRange((e,t)=>(r+=i[t]-i[e],!0));const s=o(e)?2===e?.BYTES_PER_ELEMENT||n<=65536?new Uint16Array(r):new Uint32Array(r):new Array(r);let a=0;return t.forEachComponentRange((t,o)=>{const n=i[t],r=i[o];for(let i=n;i<r;i++)s[a++]=e?e[i]:i;return!0}),s}addComponentHighlight(e,i,o){const n=e.componentData,r=t(n.componentHighlights,o,()=>new Uint32Array(n.count+1));{const e=this._activeHighlightOptions.get(o)??0;this._activeHighlightOptions.set(o,e+1)}0===r[i]++&&(n.markHighlightsDirty(),this._notifyDirty()),r[n.count]++}removeComponentHighlight(e,t,i){const{componentData:o}=e,n=o.componentHighlights.get(i);if(void 0===n)return void N().warn("Removing non-existing highlight.");const r=n[t];if(0===r)return void N().warn("Removing non-existing highlight.");this._removeActiveHighlight(i);const s=n[o.count];if(r>1)return n[t]=r-1,void(n[o.count]=s-1);n[t]=0,1===s?o.componentHighlights.delete(i):n[o.count]=s-1,o.markHighlightsDirty(),this._notifyDirty()}_removeActiveHighlight(e,t=1){const i=this._activeHighlightOptions.get(e);if(void 0===i)N().warn("Removing non-existing highlight.");else{const o=i-t;o<0&&N().warn("Removing non-existing highlight."),o<=0?this._activeHighlightOptions.delete(e):this._activeHighlightOptions.set(e,o)}}clearHighlights(e){const{componentData:t}=e,{componentHighlights:i}=t;if(i.size>0){for(const e of i)this._removeActiveHighlight(e[0],e[1][t.count]);i.clear(),t.markHighlightsDirty(),this._notifyDirty()}}hasHighlight(e){return this._activeHighlightOptions.has(e)}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._visible}_createRenderable(e,t){const i=this._renderManager.rctx,o=e.geometry,n=o.vertices.layoutParameters,r=f(y(n)),s=new I(i,r,o.vertices.data),a=o.indices?U.createIndex(i,35044,o.indices):null,c=new Uint16Array(o.vertices.count);for(let f=0;f<t.count;f++){const e=t.offsets[f],i=t.offsets[f+1],n=t.materialDataIndices[f];if(null!=o.indices)for(let t=e;t<i;t++){c[o.indices[t]]=n}else for(let t=e;t<i;t++)c[t]=n}const l=new I(i,w,c.buffer),m=new j(e.transform,e.toMapSpace),h=new B(i,new Map([["geometry",s],["componentIndices",l]]),a),p=new b(h,V.TRIANGLES,n,null!=a),g={cameraDepthSquared:.5,gpuMemoryEstimate:s.usedMemory+l.usedMemory+(null!=a?a.usedMemory:0)};return new u(m,p,g)}_notifyDirty(){this._renderManager.notifyDirty()}}function G(e,t){return e===t?0:0===e?2:1}const L=s();export{k as ComponentObjectCollection};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{c as t,a as e}from"../../../../../chunks/vec32.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as o}from"../../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as s}from"../../../../../geometry/support/DoubleArray.js";import{ComponentObjectElevationAgnosticComponentGeometryBVH as i,intersectTriangleRangeForComponent as r}from"./ComponentObjectElevationAgnosticComponentGeometryBVH.js";import{ElevationAgnosticBVH as a}from"./ElevationAgnosticBVH.js";import{getVisibility as c}from"../../lib/ComponentUtils.js";import{MeshIntersectionOptions as l,computeInvDir as m,intersectAabbInvDir as h}from"../../lib/RayIntersections.js";class p{constructor(t,e,o,s,i,r,c,l){this.vertexData=t,this.vertexStride=e,this.indexData=o,this._components=s,this._componentAabbs3D=i,this.geometryMinZ=r,this.planetCenterZ=c,this.localMode=l,this.maxBspNodeDepth=6,this.minElementCountForBVH=10,this.minBspNodeElementCount=3,this._ray0=u,this._ray1=y,this._invDir=n(),this._componentVerticalOffsets=null,this._verticalOffset=null,this._tolerance=0,this._intersectionOptions=g,this._callback=D,this.rayDirectionC=n(),this._componentIndexMap=null,this._bvh=new a(s.count,this),this.componentIntersectionData=new Array(s.count)}get numComponents(){return this._components.count}get minZGlobal(){return this.geometryMinZ-this.planetCenterZ}getAabbs2D(){return this.localMode?this.getAabbs2DLocal():this.getAabbs2DGlobal()}getAabbs2DGlobal(){const{numComponents:t,planetCenterZ:e,minZGlobal:n}=this,o=s(4*t),i=this._componentAabbs3D;for(let s=0;s<t;++s){const t=6*s,r=i[t+0],a=i[t+1],c=i[t+2],l=i[t+3],m=i[t+4],h=n/(c-e),p=n/(i[t+5]-e),b=Math.min(r*h,r*p),_=Math.min(a*h,a*p),f=Math.max(l*h,l*p),u=Math.max(m*h,m*p),y=4*s;o[y+0]=b,o[y+1]=_,o[y+2]=f,o[y+3]=u}return o}getAabbs2DLocal(){const{numComponents:t}=this,e=s(4*t),n=this._componentAabbs3D;for(let o=0;o<t;++o){const t=6*o,s=n[t+0],i=n[t+1],r=n[t+3],a=n[t+4],c=4*o;e[c+0]=s,e[c+1]=i,e[c+2]=r,e[c+3]=a}return e}intersectRay(t,e,n,o,s,i,r){const{isVerticalRay:a}=r;this._ray0=t,this._ray1=e,this._componentVerticalOffsets=n,this._verticalOffset=o,this._tolerance=i,this._intersectionOptions=r,this._componentIndexMap=this._bvh.elementIndexMap,m(t,e,this._invDir),this._callback=s,this._bvh.intersectRay(t,e,a),this._callback=D}intersectRange(t,e){const n=this._componentIndexMap,{pickability:o,visibility:s}=this._components;for(let i=t;i<e;++i){const t=n?n[i]:i;c(o,t)&&s.isVisible(t)&&this._intersectComponent(t)}}getComponentTriangleCount(t){const e=this._components.offsets,n=e[t]/3;return e[t+1]/3-n}getComponentAabb3D(t,e){const n=this._componentAabbs3D,o=6*t;return e[0]=n[o],e[1]=n[o+1],e[2]=n[o+2],e[3]=n[o+3],e[4]=n[o+4],e[5]=n[o+5],e}_intersectComponent(n){const o=this.getComponentAabb3D(n,b);let s=!1;const{localMode:a,_componentVerticalOffsets:c,_verticalOffset:l,_ray0:m,_ray1:p,_invDir:u,planetCenterZ:y,_tolerance:D,rayDirectionC:g,componentIntersectionData:v}=this,{isVerticalRay:x}=this._intersectionOptions,A=this._components.offsets,d=t(_,m),M=t(f,p),O=c?.[n]??0,j=O+(l?.offset??0);if(0!==j&&(a?(d[2]=m[2]-j,M[2]=p[2]-j,s=!0):null!=l&&(l.componentOffset=O)),null==l||s||0===j||l.applyToAabb(o),!h(o,d,u,D))return;e(g,M,d);const V=A[n]/3,Z=A[n+1]/3,R=Z-V,B=(t,e,o)=>{this._callback(t,e,n,o)},{vertexData:I,vertexStride:k,indexData:G,_intersectionOptions:w}=this,{normalRequired:E}=w;if(R>C){let t=v[n];null==t&&(t=new i(n,I,k,G,V,Z,this.geometryMinZ,y,a),v[n]=t),t.intersectRay(d,M,x,s?0:j,B,E)}else{r(d,g,V,Z,G,I,k,s?0:j,y,E,B)}}}const b=o(),_=n(),f=n(),u=n(),y=n(),D=()=>{},g=new l,C=40;export{p as ComponentObjectElevationAgnosticComponentBVH};
5
+ import{c as t,a as e}from"../../../../../chunks/vec32.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as o}from"../../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as s}from"../../../../../geometry/support/DoubleArray.js";import{ComponentObjectElevationAgnosticComponentGeometryBVH as i,intersectTriangleRangeForComponent as r}from"./ComponentObjectElevationAgnosticComponentGeometryBVH.js";import{ElevationAgnosticBVH as a}from"./ElevationAgnosticBVH.js";import{getVisibility as c}from"../../lib/ComponentUtils.js";import{MeshIntersectionOptions as l,computeInvDir as m,intersectAabbInvDir as h}from"../../lib/RayIntersections.js";import{elevationAlignVertexGlobal as p}from"../../lib/triangleIntersectionUtils.js";class b{constructor(t,e,o,s,i,r,c,l){this.vertexData=t,this.vertexStride=e,this.indexData=o,this._components=s,this._componentAabbs3D=i,this.geometryMinZ=r,this.planetCenterZ=c,this.localMode=l,this.maxBspNodeDepth=6,this.minElementCountForBVH=10,this.minBspNodeElementCount=3,this._ray0=y,this._ray1=D,this._invDir=n(),this._componentVerticalOffsets=null,this._verticalOffset=null,this._tolerance=0,this._intersectionOptions=C,this._callback=g,this.rayDirectionC=n(),this._componentIndexMap=null,this._bvh=new a(s.count,this),this.componentIntersectionData=new Array(s.count)}get numComponents(){return this._components.count}get minZGlobal(){return this.geometryMinZ-this.planetCenterZ}getAabbs2D(){return this.localMode?this.getAabbs2DLocal():this.getAabbs2DGlobal()}getAabbs2DGlobal(){const{numComponents:t,planetCenterZ:e,minZGlobal:n}=this,o=s(4*t),i=this._componentAabbs3D;for(let s=0;s<t;++s){const t=6*s,r=i[t+0],a=i[t+1],c=i[t+2],l=i[t+3],m=i[t+4],h=n/(c-e),p=n/(i[t+5]-e),b=Math.min(r*h,r*p),_=Math.min(a*h,a*p),f=Math.max(l*h,l*p),u=Math.max(m*h,m*p),y=4*s;o[y+0]=b,o[y+1]=_,o[y+2]=f,o[y+3]=u}return o}getAabbs2DLocal(){const{numComponents:t}=this,e=s(4*t),n=this._componentAabbs3D;for(let o=0;o<t;++o){const t=6*o,s=n[t+0],i=n[t+1],r=n[t+3],a=n[t+4],c=4*o;e[c+0]=s,e[c+1]=i,e[c+2]=r,e[c+3]=a}return e}intersectRay(t,e,n,o,s,i,r){const{isVerticalRay:a}=r;this._ray0=t,this._ray1=e,this._componentVerticalOffsets=n,this._verticalOffset=o,this._tolerance=i,this._intersectionOptions=r,this._componentIndexMap=this._bvh.elementIndexMap,m(t,e,this._invDir),this._callback=s,this._bvh.intersectRay(t,e,a),this._callback=g}intersectRange(t,e){const n=this._componentIndexMap,{pickability:o,visibility:s}=this._components;for(let i=t;i<e;++i){const t=n?n[i]:i;c(o,t)&&s.isVisible(t)&&this._intersectComponent(t)}}getComponentTriangleCount(t){const e=this._components.offsets,n=e[t]/3;return e[t+1]/3-n}getComponentAabb3D(t,e){const n=this._componentAabbs3D,o=6*t;return e[0]=n[o],e[1]=n[o+1],e[2]=n[o+2],e[3]=n[o+3],e[4]=n[o+4],e[5]=n[o+5],e}_intersectComponent(n){const o=this.getComponentAabb3D(n,_);let s=!1;const{localMode:a,_componentVerticalOffsets:c,_verticalOffset:l,_ray0:m,_ray1:b,_invDir:y,planetCenterZ:D,_tolerance:g,rayDirectionC:C,componentIntersectionData:x}=this,{isVerticalRay:A}=this._intersectionOptions,d=this._components.offsets,M=t(f,m),O=t(u,b),j=c?.[n]??0,V=j+(l?.offset??0);if(0!==V&&(a?(M[2]=m[2]-V,O[2]=b[2]-V,s=!0):(null!=l&&(l.componentOffset=j),A&&(p(M,-V,D,m),p(O,-V,D,b),s=!0))),null==l||s||0===V||l.applyToAabb(o),!h(o,M,y,g))return;e(C,O,M);const Z=d[n]/3,I=d[n+1]/3,R=I-Z,B=(t,e,o)=>{this._callback(t,e,n,o)},{vertexData:k,vertexStride:G,indexData:w,_intersectionOptions:E}=this,{normalRequired:H}=E;if(R>v){let t=x[n];null==t&&(t=new i(n,k,G,w,Z,I,this.geometryMinZ,D,a),x[n]=t),t.intersectRay(M,O,A,s?0:V,B,H)}else{r(M,C,Z,I,w,k,G,s?0:V,D,H,B)}}}const _=o(),f=n(),u=n(),y=n(),D=n(),g=()=>{},C=new l,v=40;export{b as ComponentObjectElevationAgnosticComponentBVH};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{invert as t,transpose as s}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{q as o,I as i}from"../../../../../../chunks/vec32.js";import{freeze as a,ZEROS as l}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as n}from"../../../../../../chunks/vec42.js";import{freeze as h,fromValues as u}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ComponentTechnique as c}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as p}from"./ComponentTechniqueConfiguration.js";import{parameter as d,parameterBlock as m,MaterialBase as v,MaterialParameterBlock as g}from"../../../core/material/MaterialBase.js";import{isColorEmission as x}from"../../../core/shaderLibrary/ShaderOutput.js";import{TwoVectorPosition as f}from"../../../core/util/TwoVectorPosition.js";import{advancedMRRFactors as M}from"../../../materials/pbrUtils.js";import{defaultHighlightName as b}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as y}from"../../../../../../webscene/support/AlphaCutoff.js";class T extends v{constructor(e,o){super(),this.toMapSpace=o,this.baseColor=h(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=M,this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.normalTexture=null,this.occlusionTexture=null,this.emissionTexture=null,this.emissiveBaseColor=a(0,0,0),this.emissiveStrength=0,this.commonMaterialParameters=new S,this.componentParameters=new O,this.objectOpacity=1,this.textureAlphaCutoff=y,this.alphaDiscardMode=1,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=1,this.hasOccludees=!1;const i=new f(e.position),l=r(e.rotationScale);t(l,l),s(l,l),this.transformNormalGlobalFromModel=l,this.transformWorldFromModelTL=i.low,this.transformWorldFromModelTH=i.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get _hasEmissiveBase(){return null!=this.emissionTexture||!o(this.emissiveBaseColor,l)}get _hasEmissiveStrength(){return 2!==this.componentParameters.emissiveOverride}get hasEmissions(){return this._hasEmissiveStrength&&(this._hasEmissiveBase||2!==this.componentParameters.emissiveSourceOverride)}get texture(){return this.baseColorTexture?.glTexture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.glTexture}get textureEmissive(){return this.emissionTexture?.glTexture}get textureOcclusion(){return this.occlusionTexture?.glTexture}get textureNormal(){return this.normalTexture?.glTexture}acquireTechnique(e,t,s,r){const o=new p(e.context.spherical);o.renderOccluded=9===s.slot,o.hasVertexColors=r.hasVertexColors,o.hasNormals=r.hasNormals,o.textureCoordinateType=r.textureCoordinateType,o.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,o.hasOcclusionTexture=null!=this.occlusionTexture,o.hasNormalTexture=null!=this.normalTexture,o.oitPass=0===t.identifier&&null!=s.oitPass?s.oitPass:0,o.terrainDepthTest=0===t.identifier&&s.terrainDepthTest,o.cullAboveTerrain=0===t.identifier&&s.cullAboveTerrain,o.ellipsoidMode=this.ellipsoidMode,o.componentData=this.componentParameters.type,o.cullFace=this.commonMaterialParameters.cullFace,o.doubleSidedMode=this.commonMaterialParameters.doubleSided?1:0,o.hasColorTexture=null!=this.baseColorTexture;const i=this._computeWhichMaterialPass();o.blendingEnabled=1===i||2===i,o.alphaDiscardMode=this.alphaDiscardMode,o.integratedMeshMode=this.isIntegratedMesh?D(s)?P(s)?3:2:1:0,o.hasPolygonOffset=this.polygonOffsetEnabled,o.pbrMode=3===o.integratedMeshMode?4:this.usePBR?this.hasParametersFromSource?r.shadeNormals&&this.isIntegratedMesh?0:2:1:0;const a=1===this.componentParameters.emissiveSourceOverride,l=2===this.componentParameters.emissiveSourceOverride,n=null!=this.emissionTexture;if(o.emissionSource=this.hasEmissions?this._hasEmissiveBase&&1===o.pbrMode?l?n?4:2:a?n?5:7:6:a?7:6:0,o.shadeNormals=r.shadeNormals,o.normalType=o.hasNormals?1:2,o.hasSlicePlane=null!=s.slicePlane&&this.commonMaterialParameters.hasSlicePlane,o.receiveAmbientOcclusion=o.hasOccludees=o.receiveShadows=o.screenSpaceReflections=o.cloudReflections=o.hasHighlightMixTexture=!1,1===t.identifier)o.output=4,o.vertexDiscardMode=0;else if(3===t.identifier)o.output=7,o.vertexDiscardMode=0;else if(2===t.identifier)o.output=9,o.vertexDiscardMode=0,o.hasHighlightMixTexture=null!=s.highlightMixTexture;else{switch(o.vertexDiscardMode=2===i?t.transparent?2:1:0,o.hasBloom=x(t.output),o.output=t.output,t.output){case 0:case 1:o.receiveAmbientOcclusion=r.applySSAO&&null!=s.ssao?.getTexture(),o.hasOccludees=s.hasOccludees,o.receiveShadows=s.shadowMap.ready,o.screenSpaceReflections=null!=s.ssr.lastFrameColor,o.cloudReflections=null!=s.clouds.data?.cubeMap?.colorTexture;break;case 10:o.olidColor=!0}o.snowCover=s.snowCover>0}const h=e.get(c,o);return this._setClean(),h}submit(e,t,s){if(this.objectOpacity<=0)return;const{componentData:r,renderable:o}=s,{geometry:i}=o,a=o.meta.cameraDepthSquared;r.updateHighlights(t.highlights);const{geometryRanges:l,highlightRangesMap:n,shadowmapRanges:h}=r;switch(this._computeWhichMaterialPass()){case 0:e.opaque.submitDraw(this,i,l,a);break;case 1:e.transparent.submitDraw(this,i,l,a);break;case 2:e.opaque.submitDraw(this,i,l,a),e.transparent.submitDraw(this,i,l,a);break;case 3:e.integratedMesh.submitDraw(this,i,l,a),j(t)&&e.occludedGround.submitDraw(this,i,l,a),C(t)&&e.highlightIntegratedMesh.submitDraw(this,i,l,a);break;case 4:e.transparentIntegratedMesh.submitDraw(this,i,l,a)}if(2!==this.componentParameters.castShadows){if(null!=n)for(const t of n)t[0]===b&&e.highlightShadowMap.submitDraw(this,i,t[1],a,t[0]);null!=h&&e.defaultShadowMap.submitDraw(this,i,h,a),e.shadowMap.submitDraw(this,i,l,a)}if(null!=n)for(const u of n)e.highlight.submitDraw(this,i,u[1],a,u[0]);t.viewshedEnabled&&e.viewshedShadowMap.submitDraw(this,i,l,a)}_computeWhichMaterialPass(){if(this.isIntegratedMesh&&this.objectOpacity>=1)return 3;if(this.isIntegratedMesh&&this.objectOpacity<1)return 4;if(this.objectOpacity<1)return 1;if(0===this.componentParameters.opaqueOverride)return 0;if(this.baseColor[3]<1||0===this.alphaDiscardMode||3===this.alphaDiscardMode)return 1;switch(this.componentParameters.transparent){case 2:return 0;case 0:return 1;case 1:return 2}}}e([d({vectorOps:n})],T.prototype,"baseColor",void 0),e([d()],T.prototype,"usePBR",void 0),e([d()],T.prototype,"hasParametersFromSource",void 0),e([d({vectorOps:i})],T.prototype,"mrrFactors",void 0),e([d({dispose:!0})],T.prototype,"baseColorTexture",void 0),e([d({dispose:!0})],T.prototype,"metallicRoughnessTexture",void 0),e([d({dispose:!0})],T.prototype,"normalTexture",void 0),e([d({dispose:!0})],T.prototype,"occlusionTexture",void 0),e([d({dispose:!0})],T.prototype,"emissionTexture",void 0),e([d({vectorOps:i})],T.prototype,"emissiveBaseColor",void 0),e([d()],T.prototype,"emissiveStrength",void 0),e([m()],T.prototype,"commonMaterialParameters",void 0),e([m()],T.prototype,"componentParameters",void 0),e([d()],T.prototype,"objectOpacity",void 0),e([d()],T.prototype,"textureAlphaCutoff",void 0),e([d()],T.prototype,"alphaDiscardMode",void 0),e([d()],T.prototype,"isIntegratedMesh",void 0),e([d()],T.prototype,"polygonOffsetEnabled",void 0),e([d()],T.prototype,"ellipsoidMode",void 0),e([d()],T.prototype,"hasOccludees",void 0);class S extends g{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=2,this.hasSlicePlane=!0}}e([d()],S.prototype,"doubleSided",void 0),e([d()],S.prototype,"cullFace",void 0),e([d()],S.prototype,"hasSlicePlane",void 0);class O extends g{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=1,this.emissiveStrength=0,this.emissiveSource=0,this.castShadows=0}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}get visible(){return this.externalColor[3]>0?0:2}get type(){return 0}}e([d({vectorOps:n})],O.prototype,"externalColor",void 0),e([d()],O.prototype,"externalColorMixMode",void 0),e([d()],O.prototype,"emissiveStrength",void 0),e([d()],O.prototype,"emissiveSource",void 0),e([d()],O.prototype,"castShadows",void 0);class w extends g{constructor(){super(...arguments),this.texture=null,this.transparent=2,this.opaqueOverride=2,this.emissiveOverride=2,this.emissiveSourceOverride=2,this.castShadows=2}get type(){return 1}}function C(e){return null!=e.overlay?.getTexture(2)}function P(e){return null!=e.overlay?.getTexture(3)}function D(e){return null!=e.overlay?.getTexture(1)}function j(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}e([d()],w.prototype,"texture",void 0),e([d()],w.prototype,"transparent",void 0),e([d()],w.prototype,"opaqueOverride",void 0),e([d()],w.prototype,"emissiveOverride",void 0),e([d()],w.prototype,"emissiveSourceOverride",void 0),e([d()],w.prototype,"castShadows",void 0);export{S as CommonMaterialParameters,T as ComponentMaterial,O as ComponentParametersUniform,w as ComponentParametersVarying};
5
+ import{__decorate as e}from"tslib";import{invert as t,transpose as s}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{q as o,I as i}from"../../../../../../chunks/vec32.js";import{freeze as a,ZEROS as l}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as n}from"../../../../../../chunks/vec42.js";import{freeze as h,fromValues as u}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ComponentTechnique as c}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as p}from"./ComponentTechniqueConfiguration.js";import{parameter as d,parameterBlock as m,MaterialBase as v,MaterialParameterBlock as g}from"../../../core/material/MaterialBase.js";import{isColorEmission as x}from"../../../core/shaderLibrary/ShaderOutput.js";import{TwoVectorPosition as f}from"../../../core/util/TwoVectorPosition.js";import{advancedMRRFactors as M}from"../../../materials/pbrUtils.js";import{defaultHighlightName as b}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as y}from"../../../../../../webscene/support/AlphaCutoff.js";class T extends v{constructor(e,o){super(),this.toMapSpace=o,this.baseColor=h(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=M,this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.normalTexture=null,this.occlusionTexture=null,this.emissionTexture=null,this.emissiveBaseColor=a(0,0,0),this.emissiveStrength=0,this.commonMaterialParameters=new S,this.componentParameters=new w,this.objectOpacity=1,this.textureAlphaCutoff=y,this.alphaDiscardMode=1,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=1,this.hasOccludees=!1;const i=new f(e.position),l=r(e.rotationScale);t(l,l),s(l,l),this.transformNormalGlobalFromModel=l,this.transformWorldFromModelTL=i.low,this.transformWorldFromModelTH=i.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get _hasEmissiveBase(){return null!=this.emissionTexture||!o(this.emissiveBaseColor,l)}get _hasEmissiveStrength(){return 2!==this.componentParameters.emissiveOverride}get hasEmissions(){return this._hasEmissiveStrength&&(this._hasEmissiveBase||2!==this.componentParameters.emissiveSourceOverride)}get texture(){return this.baseColorTexture?.glTexture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.glTexture}get textureEmissive(){return this.emissionTexture?.glTexture}get textureOcclusion(){return this.occlusionTexture?.glTexture}get textureNormal(){return this.normalTexture?.glTexture}acquireTechnique(e,t,s,r){const o=new p(e.context.spherical);o.renderOccluded=9===s.slot,o.hasVertexColors=r.hasVertexColors,o.hasNormals=r.hasNormals,o.textureCoordinateType=r.textureCoordinateType,o.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,o.hasOcclusionTexture=null!=this.occlusionTexture,o.hasNormalTexture=null!=this.normalTexture,o.oitPass=0===t.identifier&&null!=s.oitPass?s.oitPass:0,o.terrainDepthTest=0===t.identifier&&s.terrainDepthTest,o.cullAboveTerrain=0===t.identifier&&s.cullAboveTerrain,o.ellipsoidMode=this.ellipsoidMode,o.componentData=this.componentParameters.type,o.cullFace=this.commonMaterialParameters.cullFace,o.doubleSidedMode=this.commonMaterialParameters.doubleSided?1:0,o.hasColorTexture=null!=this.baseColorTexture;const i=this._computeWhichMaterialPass();o.blendingEnabled=1===i||2===i,o.alphaDiscardMode=this.alphaDiscardMode,o.integratedMeshMode=this.isIntegratedMesh?D(s)?P(s)?3:2:1:0,o.hasPolygonOffset=this.polygonOffsetEnabled,o.pbrMode=3===o.integratedMeshMode?4:this.usePBR?this.hasParametersFromSource?r.shadeNormals&&this.isIntegratedMesh?0:2:1:0;const a=1===this.componentParameters.emissiveSourceOverride,l=2===this.componentParameters.emissiveSourceOverride,n=null!=this.emissionTexture;if(o.emissionSource=this.hasEmissions?this._hasEmissiveBase&&1===o.pbrMode?l?n?4:2:a?n?5:7:6:a?7:6:0,o.shadeNormals=r.shadeNormals,o.normalType=o.hasNormals?1:2,o.hasSlicePlane=null!=s.slicePlane&&this.commonMaterialParameters.hasSlicePlane,o.receiveAmbientOcclusion=o.hasOccludees=o.receiveShadows=o.screenSpaceReflections=o.cloudReflections=o.hasHighlightMixTexture=!1,1===t.identifier)o.output=4,o.vertexDiscardMode=0;else if(3===t.identifier)o.output=7,o.vertexDiscardMode=0;else if(2===t.identifier)o.output=9,o.vertexDiscardMode=0,o.hasHighlightMixTexture=null!=s.highlightMixTexture;else{switch(o.vertexDiscardMode=2===i?t.transparent?2:1:0,o.hasGlow=x(t.output),o.output=t.output,t.output){case 0:case 1:o.receiveAmbientOcclusion=r.applySSAO&&null!=s.ssao?.getTexture(),o.hasOccludees=s.hasOccludees,o.receiveShadows=s.shadowMap.ready,o.screenSpaceReflections=null!=s.ssr.lastFrameColor,o.cloudReflections=null!=s.clouds.data?.cubeMap?.colorTexture;break;case 10:o.olidColor=!0}o.snowCover=s.snowCover>0}const h=e.get(c,o);return this._setClean(),h}submit(e,t,s){if(this.objectOpacity<=0)return;const{componentData:r,renderable:o}=s,{geometry:i}=o,a=o.meta.cameraDepthSquared;r.updateHighlights(t.highlights);const{geometryRanges:l,highlightRangesMap:n,shadowmapRanges:h}=r;switch(this._computeWhichMaterialPass()){case 0:e.opaque.submitDraw(this,i,l,a);break;case 1:e.transparent.submitDraw(this,i,l,a);break;case 2:e.opaque.submitDraw(this,i,l,a),e.transparent.submitDraw(this,i,l,a);break;case 3:e.integratedMesh.submitDraw(this,i,l,a),j(t)&&e.occludedGround.submitDraw(this,i,l,a),C(t)&&e.highlightIntegratedMesh.submitDraw(this,i,l,a);break;case 4:e.transparentIntegratedMesh.submitDraw(this,i,l,a)}if(2!==this.componentParameters.castShadows){if(null!=n)for(const t of n)t[0]===b&&e.highlightShadowMap.submitDraw(this,i,t[1],a,t[0]);null!=h&&e.defaultShadowMap.submitDraw(this,i,h,a),e.shadowMap.submitDraw(this,i,l,a)}if(null!=n)for(const u of n)e.highlight.submitDraw(this,i,u[1],a,u[0]);t.viewshedEnabled&&e.viewshedShadowMap.submitDraw(this,i,l,a)}_computeWhichMaterialPass(){if(this.isIntegratedMesh&&this.objectOpacity>=1)return 3;if(this.isIntegratedMesh&&this.objectOpacity<1)return 4;if(this.objectOpacity<1)return 1;if(0===this.componentParameters.opaqueOverride)return 0;if(this.baseColor[3]<1||0===this.alphaDiscardMode||3===this.alphaDiscardMode)return 1;switch(this.componentParameters.transparent){case 2:return 0;case 0:return 1;case 1:return 2}}}e([d({vectorOps:n})],T.prototype,"baseColor",void 0),e([d()],T.prototype,"usePBR",void 0),e([d()],T.prototype,"hasParametersFromSource",void 0),e([d({vectorOps:i})],T.prototype,"mrrFactors",void 0),e([d({dispose:!0})],T.prototype,"baseColorTexture",void 0),e([d({dispose:!0})],T.prototype,"metallicRoughnessTexture",void 0),e([d({dispose:!0})],T.prototype,"normalTexture",void 0),e([d({dispose:!0})],T.prototype,"occlusionTexture",void 0),e([d({dispose:!0})],T.prototype,"emissionTexture",void 0),e([d({vectorOps:i})],T.prototype,"emissiveBaseColor",void 0),e([d()],T.prototype,"emissiveStrength",void 0),e([m()],T.prototype,"commonMaterialParameters",void 0),e([m()],T.prototype,"componentParameters",void 0),e([d()],T.prototype,"objectOpacity",void 0),e([d()],T.prototype,"textureAlphaCutoff",void 0),e([d()],T.prototype,"alphaDiscardMode",void 0),e([d()],T.prototype,"isIntegratedMesh",void 0),e([d()],T.prototype,"polygonOffsetEnabled",void 0),e([d()],T.prototype,"ellipsoidMode",void 0),e([d()],T.prototype,"hasOccludees",void 0);class S extends g{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=2,this.hasSlicePlane=!0}}e([d()],S.prototype,"doubleSided",void 0),e([d()],S.prototype,"cullFace",void 0),e([d()],S.prototype,"hasSlicePlane",void 0);class w extends g{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=1,this.emissiveStrength=0,this.emissiveSource=0,this.castShadows=0}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}get visible(){return this.externalColor[3]>0?0:2}get type(){return 0}}e([d({vectorOps:n})],w.prototype,"externalColor",void 0),e([d()],w.prototype,"externalColorMixMode",void 0),e([d()],w.prototype,"emissiveStrength",void 0),e([d()],w.prototype,"emissiveSource",void 0),e([d()],w.prototype,"castShadows",void 0);class O extends g{constructor(){super(...arguments),this.texture=null,this.transparent=2,this.opaqueOverride=2,this.emissiveOverride=2,this.emissiveSourceOverride=2,this.castShadows=2}get type(){return 1}}function C(e){return null!=e.overlay?.getTexture(2)}function P(e){return null!=e.overlay?.getTexture(3)}function D(e){return null!=e.overlay?.getTexture(1)}function j(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}e([d()],O.prototype,"texture",void 0),e([d()],O.prototype,"transparent",void 0),e([d()],O.prototype,"opaqueOverride",void 0),e([d()],O.prototype,"emissiveOverride",void 0),e([d()],O.prototype,"emissiveSourceOverride",void 0),e([d()],O.prototype,"castShadows",void 0);export{S as CommonMaterialParameters,T as ComponentMaterial,w as ComponentParametersUniform,O as ComponentParametersVarying};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import{isColorEmissionHighlightOrOID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as e,ShaderTechniqueConfiguration as i}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class s extends i{constructor(o){super(),this.spherical=o,this.output=0,this.textureCoordinateType=0,this.componentData=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.oitPass=0,this.ellipsoidMode=1,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasNormals=!1,this.shadeNormals=!0,this.hasSlicePlane=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.olidColor=!1,this.hasBloom=!1,this.renderOccluded=!1,this.discardInvisibleFragments=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}}o([e({count:11})],s.prototype,"output",void 0),o([e({count:3})],s.prototype,"textureCoordinateType",void 0),o([e({count:2})],s.prototype,"componentData",void 0),o([e({count:3})],s.prototype,"cullFace",void 0),o([e({count:3})],s.prototype,"vertexDiscardMode",void 0),o([e({count:3})],s.prototype,"doubleSidedMode",void 0),o([e({count:4})],s.prototype,"alphaDiscardMode",void 0),o([e({count:4})],s.prototype,"integratedMeshMode",void 0),o([e({count:3})],s.prototype,"oitPass",void 0),o([e({count:4})],s.prototype,"ellipsoidMode",void 0),o([e({count:7})],s.prototype,"pbrMode",void 0),o([e({count:3})],s.prototype,"normalType",void 0),o([e({count:8})],s.prototype,"emissionSource",void 0),o([e()],s.prototype,"hasVertexColors",void 0),o([e()],s.prototype,"hasNormals",void 0),o([e()],s.prototype,"shadeNormals",void 0),o([e()],s.prototype,"hasSlicePlane",void 0),o([e()],s.prototype,"hasColorTexture",void 0),o([e()],s.prototype,"hasHighlightMixTexture",void 0),o([e()],s.prototype,"receiveAmbientOcclusion",void 0),o([e()],s.prototype,"receiveShadows",void 0),o([e()],s.prototype,"blendingEnabled",void 0),o([e()],s.prototype,"screenSpaceReflections",void 0),o([e()],s.prototype,"hasPolygonOffset",void 0),o([e()],s.prototype,"hasMetallicRoughnessTexture",void 0),o([e()],s.prototype,"hasOcclusionTexture",void 0),o([e()],s.prototype,"hasNormalTexture",void 0),o([e()],s.prototype,"hasOccludees",void 0),o([e()],s.prototype,"terrainDepthTest",void 0),o([e()],s.prototype,"cullAboveTerrain",void 0),o([e()],s.prototype,"hasNormalTextureTransform",void 0),o([e()],s.prototype,"cloudReflections",void 0),o([e()],s.prototype,"snowCover",void 0),o([e()],s.prototype,"olidColor",void 0),o([e()],s.prototype,"hasBloom",void 0),o([e()],s.prototype,"renderOccluded",void 0);export{s as ComponentTechniqueConfiguration};
5
+ import{__decorate as o}from"tslib";import{isColorEmissionHighlightOrOID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as e,ShaderTechniqueConfiguration as i}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class s extends i{constructor(o){super(),this.spherical=o,this.output=0,this.textureCoordinateType=0,this.componentData=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.oitPass=0,this.ellipsoidMode=1,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasNormals=!1,this.shadeNormals=!0,this.hasSlicePlane=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.olidColor=!1,this.hasGlow=!1,this.renderOccluded=!1,this.discardInvisibleFragments=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}}o([e({count:11})],s.prototype,"output",void 0),o([e({count:3})],s.prototype,"textureCoordinateType",void 0),o([e({count:2})],s.prototype,"componentData",void 0),o([e({count:3})],s.prototype,"cullFace",void 0),o([e({count:3})],s.prototype,"vertexDiscardMode",void 0),o([e({count:3})],s.prototype,"doubleSidedMode",void 0),o([e({count:4})],s.prototype,"alphaDiscardMode",void 0),o([e({count:4})],s.prototype,"integratedMeshMode",void 0),o([e({count:3})],s.prototype,"oitPass",void 0),o([e({count:4})],s.prototype,"ellipsoidMode",void 0),o([e({count:7})],s.prototype,"pbrMode",void 0),o([e({count:3})],s.prototype,"normalType",void 0),o([e({count:8})],s.prototype,"emissionSource",void 0),o([e()],s.prototype,"hasVertexColors",void 0),o([e()],s.prototype,"hasNormals",void 0),o([e()],s.prototype,"shadeNormals",void 0),o([e()],s.prototype,"hasSlicePlane",void 0),o([e()],s.prototype,"hasColorTexture",void 0),o([e()],s.prototype,"hasHighlightMixTexture",void 0),o([e()],s.prototype,"receiveAmbientOcclusion",void 0),o([e()],s.prototype,"receiveShadows",void 0),o([e()],s.prototype,"blendingEnabled",void 0),o([e()],s.prototype,"screenSpaceReflections",void 0),o([e()],s.prototype,"hasPolygonOffset",void 0),o([e()],s.prototype,"hasMetallicRoughnessTexture",void 0),o([e()],s.prototype,"hasOcclusionTexture",void 0),o([e()],s.prototype,"hasNormalTexture",void 0),o([e()],s.prototype,"hasOccludees",void 0),o([e()],s.prototype,"terrainDepthTest",void 0),o([e()],s.prototype,"cullAboveTerrain",void 0),o([e()],s.prototype,"hasNormalTextureTransform",void 0),o([e()],s.prototype,"cloudReflections",void 0),o([e()],s.prototype,"snowCover",void 0),o([e()],s.prototype,"olidColor",void 0),o([e()],s.prototype,"hasGlow",void 0),o([e()],s.prototype,"renderOccluded",void 0);export{s as ComponentTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{ManagedColorAttachment as t}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as r}from"../../webgl/ManagedDepthTexture.js";import a from"../../webgl/ManagedFBO.js";import{isDepthFormat as c,DepthTextureFormats as h,ColorFormats as i}from"./FBOCacheFormats.js";import{FBOPool as n}from"./FBOPool.js";import{DepthStencilAttachment as o,ColorAttachment0 as s}from"../../../webgl/enums.js";import{FramebufferObject as l}from"../../../webgl/FramebufferObject.js";import{Texture as u}from"../../../webgl/Texture.js";class m{constructor(e){this.rctx=e,this._interactive=!1,this._acquired=new Set,this._cache=new n(e.newCache,"FBOCache"),this._depthCache=new n(e.newCache,"DepthAttachmentCache"),this._colorCache=new n(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.()}frameEnd(){const{debugCallback:e}=this;e&&this._acquired.forEach(t=>e(t.name,t.fbo))}get usedMemory(){return Array.from(this._acquired.values()).reduce((e,t)=>e+t.cachedMemory,this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e,this._interactive=e}get interactive(){return this._interactive}acquire(t,r,h,i=5){const n=_(i,t,r);let u=this._cache.pop(n);const{rctx:m}=this;if(u){u.retain(),u.setName(h);const t=u.getAttachment(o);t&&(t.name=f(h));const r=u.getAttachment(s);r&&(r.name=d(h,0));const{fbo:a}=u;if(!a)throw new e("renderer","attempt to use a none existing framebuffer");m.temporaryBindFramebufferObject(a,()=>{m.setDrawBuffers([s]),m.unbindTexture(a.colorTexture)})}else{const e=new l(m),p=(e,a,c)=>{a??=5;const h=this._acquireColor(a,t,r,c??d(u.name,e-s));return this.rctx.unbindTexture(h.attachment),u.attachColor(h,e),h.release(),u},_=e=>{e??=12;const a=this.acquireDepth(e,t,r,f(u.name));return u.attachDepth(a),a.release(),u},C=()=>{if(!u)return;this.debugCallback?.(u.name,u.fbo),this._acquired.delete(u);const e=c(i);e&&null!=u.getAttachment(o)||!e&&null!=u.getAttachment(s)?(e?(u.fbo?.invalidateAttachments([o]),u.detachAllColors()):(u.fbo?.invalidateAttachments([s]),u.detachAllButColor0()),this._cache.put(u)):u.dispose()};u=new a(n,h,e,p,_,C),c(i)?u.acquireDepth(i):u.acquireColor(s,i,h)}return this._trackHandle(u)}acquireDepth(e,t,a,c){const i=_(e,t,a);let n=this._depthCache.pop(i);if(n)n.retain(),n.attachment.setShadowFiltering(!1);else{const c=new u(this.rctx,{...h[e],width:t,height:a});n=new r(i,c,()=>this._depthCache.put(n))}return n.name=c,n}_acquireColor(e,r,a,c){const h=_(e,r,a);let n=this._colorCache.pop(h);if(n)n.retain();else{const c=new u(this.rctx,{...i[e],width:r,height:a});n=new t(h,c,()=>this._colorCache.put(n))}return n.name=c,n}_trackHandle(e){return this._acquired.add(e),e}}function d(e,t=0){return`${e}.color${t}`}function f(e){return`${e}.depth`}const p=new a("default","default",null,()=>p,()=>p,()=>{});function _(e,t,r){return`${t}x${r}:${e}`}p.release=()=>!1;export{m as FBOCache,p as defaultWebGLFBO};
5
+ import e from"../../../../core/Error.js";import{ManagedColorAttachment as t}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as a}from"../../webgl/ManagedDepthTexture.js";import r from"../../webgl/ManagedFBO.js";import{isDepthFormat as c,formatString as h,DepthTextureFormats as s,ColorFormats as i}from"./FBOCacheFormats.js";import{FBOPool as n}from"./FBOPool.js";import{DepthStencilAttachment as o,ColorAttachment0 as l}from"../../../webgl/enums.js";import{FramebufferObject as u}from"../../../webgl/FramebufferObject.js";import{Texture as m}from"../../../webgl/Texture.js";class d{constructor(e){this.rctx=e,this._interactive=!1,this._usage=new Map,this._acquired=new Set,this._cache=new n(e.newCache,"FBOCache"),this._depthCache=new n(e.newCache,"DepthAttachmentCache"),this._colorCache=new n(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.(),this._usage.clear()}frameEnd(){const{debugCallback:e}=this;e&&this._acquired.forEach(t=>e(t.name,t.fbo,this._usage))}get usedMemory(){return Array.from(this._acquired.values()).reduce((e,t)=>e+t.cachedMemory,this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e,this._interactive=e}get interactive(){return this._interactive}acquire(t,a,s,i=5){const n=C(i,t,a);let m=this._cache.pop(n);const{rctx:d}=this;if(m){m.retain(),m.setName(s);const t=m.getAttachment(o);t&&(t.name=f(s));const a=m.getAttachment(l);a&&(a.name=_(s,0));const{fbo:r}=m;if(!r)throw new e("renderer","attempt to use a none existing framebuffer");d.temporaryBindFramebufferObject(r,()=>{d.setDrawBuffers([l]),d.unbindTexture(r.colorTexture)})}else{const e=new u(d),h=(e,r,c)=>{r??=5;const h=this._acquireColor(r,t,a,c??_(m.name,e-l));return this.rctx.unbindTexture(h.attachment),m.attachColor(h,e),h.release(),m},p=e=>{e??=12;const r=this.acquireDepth(e,t,a,f(m.name));return m.attachDepth(r),r.release(),m},C=()=>{if(!m)return;this.debugCallback?.(m.name,m.fbo),this._acquired.delete(m);const e=c(i);e&&null!=m.getAttachment(o)||!e&&null!=m.getAttachment(l)?(e?(m.fbo?.invalidateAttachments([o]),m.detachAllColors()):(m.fbo?.invalidateAttachments([l]),m.detachAllButColor0()),this._cache.put(m)):m.dispose()};m=new r(n,s,e,h,p,C),c(i)?m.acquireDepth(i):m.acquireColor(l,i,s)}return this._trackUsage(m,"fbo "+h(i),t,a),this._trackHandle(m)}acquireDepth(e,t,r,c){const i=C(e,t,r);let n=this._depthCache.pop(i);if(n)n.retain(),n.attachment.setShadowFiltering(!1);else{const c=new m(this.rctx,{...s[e],width:t,height:r});n=new a(i,c,()=>this._depthCache.put(n))}return n.name=c,this._trackUsage(n,"depth "+h(e),t,r),n}_acquireColor(e,a,r,c){const s=C(e,a,r);let n=this._colorCache.pop(s);if(n)n.retain();else{const c=new m(this.rctx,{...i[e],width:a,height:r});n=new t(s,c,()=>this._colorCache.put(n))}return n.name=c,this._trackUsage(n,"color "+h(e),a,r),n}_trackHandle(e){return this._acquired.add(e),e}_trackUsage(e,t,a,r){this.debugCallback&&(this._usage.has(e)?this._usage.get(e)[2].push(e.name):this._usage.set(e,[t,`${a}x${r}`,[e.name]]))}}function _(e,t=0){return`${e}.color${t}`}function f(e){return`${e}.depth`}const p=new r("default","default",null,()=>p,()=>p,()=>{});function C(e,t,a){return`${t}x${a}:${e}`}p.release=()=>!1;export{d as FBOCache,p as defaultWebGLFBO};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{SizedPixelFormat as e,PixelType as a,SizedDepthStencilFormat as t,SizedDepthFormat as n}from"../../../webgl/enums.js";import{TextureDescriptor as o}from"../../../webgl/TextureDescriptor.js";import{isSizedDepthFormat as r}from"../../../webgl/textureUtils.js";function p(e){return e>=11}const m=new o;m.pixelFormat=6403,m.internalFormat=e.R8,m.wrapMode=33071;const i=new o;i.pixelFormat=36244,i.internalFormat=e.R8UI,i.wrapMode=33071,i.samplingMode=9728;const l=new o;l.pixelFormat=33319,l.internalFormat=e.RG8,l.wrapMode=33071;const F=new o;F.pixelFormat=33320,F.internalFormat=e.RG8UI,F.wrapMode=33071,F.samplingMode=9728;const T=new o;T.internalFormat=e.RGBA4,T.dataType=a.UNSIGNED_SHORT_4_4_4_4,T.wrapMode=33071;const s=new o;s.wrapMode=33071;const _=new o;_.wrapMode=33071,_.samplingMode=9987,_.hasMipmap=!0,_.maxAnisotropy=8;const w=new o;w.pixelFormat=6403,w.dataType=a.HALF_FLOAT,w.internalFormat=e.R16F,w.samplingMode=9728;const N=new o;N.dataType=a.HALF_FLOAT,N.internalFormat=e.RGBA16F,N.wrapMode=33071;const d=new o;d.pixelFormat=6403,d.dataType=a.FLOAT,d.internalFormat=e.R32F,d.samplingMode=9728;const M=new o;M.pixelFormat=33319,M.dataType=a.FLOAT,M.internalFormat=e.RG32F,M.samplingMode=9728;const E={0:m,1:i,2:l,3:F,4:T,5:s,6:_,7:w,8:N,9:d,10:M,11:null},c={[n.DEPTH_COMPONENT16]:a.UNSIGNED_SHORT,[n.DEPTH_COMPONENT24]:a.UNSIGNED_INT,[n.DEPTH_COMPONENT32F]:a.FLOAT,[t.DEPTH24_STENCIL8]:a.UNSIGNED_INT_24_8,[t.DEPTH32F_STENCIL8]:a.FLOAT_32_UNSIGNED_INT_24_8_REV},O={12:I(t.DEPTH24_STENCIL8),11:I(n.DEPTH_COMPONENT16)};function I(e){const a=new o;return a.pixelFormat=r(e)?6402:34041,a.dataType=c[e],a.samplingMode=9728,a.wrapMode=33071,a.internalFormat=e,a.hasMipmap=!1,a.isImmutable=!0,a}export{E as ColorFormats,O as DepthTextureFormats,p as isDepthFormat};
5
+ import{SizedPixelFormat as e,PixelType as r,SizedDepthStencilFormat as n,SizedDepthFormat as t}from"../../../webgl/enums.js";import{TextureDescriptor as a}from"../../../webgl/TextureDescriptor.js";import{isSizedDepthFormat as o}from"../../../webgl/textureUtils.js";function s(e){switch(e){case 0:return"R8UNORM";case 1:return"R8UINT";case 2:return"RG8UNORM";case 3:return"RG8UINT";case 4:return"RGBA4UNORM";case 5:return"RGBA8UNORM";case 6:return"RGBA8UNORM_MIPMAP";case 7:return"R16FLOAT";case 8:return"RGBA16FLOAT";case 9:return"R32FLOAT";case 10:return"RG32FLOAT";case 11:return"COUNT"}}function T(e){switch(e){case 11:return"DEPTH16";case 12:return"DEPTH24_STENCIL8"}}function i(e){return p(e)?T(e):s(e)}function p(e){return e>=11}const m=new a;m.pixelFormat=6403,m.internalFormat=e.R8,m.wrapMode=33071;const F=new a;F.pixelFormat=36244,F.internalFormat=e.R8UI,F.wrapMode=33071,F.samplingMode=9728;const c=new a;c.pixelFormat=33319,c.internalFormat=e.RG8,c.wrapMode=33071;const N=new a;N.pixelFormat=33320,N.internalFormat=e.RG8UI,N.wrapMode=33071,N.samplingMode=9728;const l=new a;l.internalFormat=e.RGBA4,l.dataType=r.UNSIGNED_SHORT_4_4_4_4,l.wrapMode=33071;const M=new a;M.wrapMode=33071;const R=new a;R.wrapMode=33071,R.samplingMode=9987,R.hasMipmap=!0,R.maxAnisotropy=8;const u=new a;u.pixelFormat=6403,u.dataType=r.HALF_FLOAT,u.internalFormat=e.R16F,u.samplingMode=9728;const _=new a;_.dataType=r.HALF_FLOAT,_.internalFormat=e.RGBA16F,_.wrapMode=33071;const w=new a;w.pixelFormat=6403,w.dataType=r.FLOAT,w.internalFormat=e.R32F,w.samplingMode=9728;const O=new a;O.pixelFormat=33319,O.dataType=r.FLOAT,O.internalFormat=e.RG32F,O.samplingMode=9728;const E={0:m,1:F,2:c,3:N,4:l,5:M,6:R,7:u,8:_,9:w,10:O,11:null},d={[t.DEPTH_COMPONENT16]:r.UNSIGNED_SHORT,[t.DEPTH_COMPONENT24]:r.UNSIGNED_INT,[t.DEPTH_COMPONENT32F]:r.FLOAT,[n.DEPTH24_STENCIL8]:r.UNSIGNED_INT_24_8,[n.DEPTH32F_STENCIL8]:r.FLOAT_32_UNSIGNED_INT_24_8_REV},A={12:I(n.DEPTH24_STENCIL8),11:I(t.DEPTH_COMPONENT16)};function I(e){const r=new a;return r.pixelFormat=o(e)?6402:34041,r.dataType=d[e],r.samplingMode=9728,r.wrapMode=33071,r.internalFormat=e,r.hasMipmap=!1,r.isImmutable=!0,r}export{E as ColorFormats,A as DepthTextureFormats,i as formatString,p as isDepthFormat};
@@ -2,7 +2,9 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../../../../core/compilerUtils.js";import{glsl as r}from"../../shaderModules/glsl.js";function o(o,a){switch(a.normalType){case 1:o.attributes.add("normalCompressed","vec2"),o.vertex.code.add(r`vec3 decompressNormal(vec2 normal) {
5
+ import{neverReached as e}from"../../../../../../core/compilerUtils.js";import{glsl as r}from"../../shaderModules/glsl.js";function o(o,a){switch(o.fragment.code.add(r`vec3 screenDerivativeNormal(vec3 positionView) {
6
+ return normalize(cross(dFdx(positionView), dFdy(positionView)));
7
+ }`),a.normalType){case 1:o.attributes.add("normalCompressed","vec2"),o.vertex.code.add(r`vec3 decompressNormal(vec2 normal) {
6
8
  float z = 1.0 - abs(normal.x) - abs(normal.y);
7
9
  return vec3(normal + sign(normal) * min(z, 0.0), z);
8
10
  }
@@ -10,6 +12,4 @@ vec3 normalModel() {
10
12
  return decompressNormal(normalCompressed);
11
13
  }`);break;case 0:o.attributes.add("normal","vec3"),o.vertex.code.add(r`vec3 normalModel() {
12
14
  return normal;
13
- }`);break;case 2:o.fragment.code.add(r`vec3 screenDerivativeNormal(vec3 positionView) {
14
- return normalize(cross(dFdx(positionView), dFdy(positionView)));
15
- }`);break;default:e(a.normalType);case 3:}}export{o as NormalAttribute};
15
+ }`);break;default:e(a.normalType);case 2:case 3:}}export{o as NormalAttribute};
@@ -2,11 +2,11 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{isColorOrColorEmission as e}from"../ShaderOutput.js";import{VertexTextureCoordinates as s}from"../attributes/VertexTextureCoordinates.glsl.js";import{Gamma as i}from"../shading/Gamma.glsl.js";import{Float3DrawUniform as o}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as r}from"../../shaderModules/Float3PassUniform.js";import{FloatDrawUniform as m}from"../../shaderModules/FloatDrawUniform.js";import{FloatPassUniform as t}from"../../shaderModules/FloatPassUniform.js";import{If as n,glsl as a}from"../../shaderModules/glsl.js";import{Texture2DDrawUniform as v}from"../../shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as l}from"../../shaderModules/Texture2DPassUniform.js";import{GLEmissiveTexturePassParameters as u}from"../../../lib/GLTextureMaterial.js";const d=1;class c extends u{}function f(u,d){if(!e(d.output))return;u.fragment.include(i);const{emissionSource:c,hasEmissiveTextureTransform:f,bindType:x}=d,g=3===c||4===c||5===c;g&&(u.include(s,d),u.fragment.uniforms.add(1===x?new l("texEmission",e=>e.textureEmissive):new v("texEmission",e=>e.textureEmissive)));const p=2===c||g;p&&u.fragment.uniforms.add(1===x?new r("emissiveBaseColor",e=>e.emissiveBaseColor):new o("emissiveBaseColor",e=>e.emissiveBaseColor));const h=0!==c;h&&!(7===c||6===c||4===c||5===c)&&u.fragment.uniforms.add(1===x?new t("emissiveStrength",e=>e.emissiveStrength):new m("emissiveStrength",e=>e.emissiveStrength));const T=7===c,b=5===c,j=1===c||6===c||T;u.fragment.code.add(a`
5
+ import{isColorOrColorEmission as e}from"../ShaderOutput.js";import{VertexTextureCoordinates as s}from"../attributes/VertexTextureCoordinates.glsl.js";import{Gamma as i}from"../shading/Gamma.glsl.js";import{Float3DrawUniform as o}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as r}from"../../shaderModules/Float3PassUniform.js";import{FloatDrawUniform as m}from"../../shaderModules/FloatDrawUniform.js";import{FloatPassUniform as t}from"../../shaderModules/FloatPassUniform.js";import{If as n,glsl as a}from"../../shaderModules/glsl.js";import{Texture2DDrawUniform as v}from"../../shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as l}from"../../shaderModules/Texture2DPassUniform.js";import{GLEmissiveTexturePassParameters as u}from"../../../lib/GLTextureMaterial.js";const d=1,f=5;class c extends u{}function x(u,d){if(!e(d.output))return;u.fragment.include(i);const{emissionSource:c,hasEmissiveTextureTransform:x,bindType:g}=d,p=3===c||4===c||5===c;p&&(u.include(s,d),u.fragment.uniforms.add(1===g?new l("texEmission",e=>e.textureEmissive):new v("texEmission",e=>e.textureEmissive)));const h=2===c||p;h&&u.fragment.uniforms.add(1===g?new r("emissiveBaseColor",e=>e.emissiveBaseColor):new o("emissiveBaseColor",e=>e.emissiveBaseColor));const T=0!==c;T&&!(7===c||6===c||4===c||5===c)&&u.fragment.uniforms.add(1===g?new t("emissiveStrength",e=>e.emissiveStrength):new m("emissiveStrength",e=>e.emissiveStrength));const b=7===c,j=5===c,w=1===c||6===c||b;u.fragment.code.add(a`
6
6
  vec4 getEmissions(vec3 symbolColor) {
7
- vec4 emissions = ${p?b?"emissiveSource == 0 ? vec4(emissiveBaseColor, 1.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(emissiveBaseColor, 1.0)":j?T?"emissiveSource == 0 ? vec4(0.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(linearizeGamma(symbolColor), 1.0)":"vec4(0.0)"};
8
- ${n(g,`${n(b,`if(emissiveSource == 0) {\n vec4 emissiveFromTex = textureLookup(texEmission, ${f?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);\n }`,`vec4 emissiveFromTex = textureLookup(texEmission, ${f?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);`)}\n emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}
9
- ${n(h,"emissions.rgb *= emissiveStrength;")}
7
+ vec4 emissions = ${h?j?"emissiveSource == 0 ? vec4(emissiveBaseColor, 1.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(emissiveBaseColor, 1.0)":w?b?"emissiveSource == 0 ? vec4(0.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(linearizeGamma(symbolColor), 1.0)":"vec4(0.0)"};
8
+ ${n(p,`${n(j,`if(emissiveSource == 0) {\n vec4 emissiveFromTex = textureLookup(texEmission, ${x?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);\n }`,`vec4 emissiveFromTex = textureLookup(texEmission, ${x?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);`)}\n emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}
9
+ ${n(T,`emissions.rgb *= emissiveStrength * ${a.float(f)};`)}
10
10
  return emissions;
11
11
  }
12
- `)}export{f as Emissions,c as EmissionsParameters,d as emissiveStrengthDefault};
12
+ `)}export{x as Emissions,c as EmissionsParameters,f as emissiveStrengthBoost,d as emissiveStrengthDefault};
@@ -2,7 +2,7 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as t}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderCategory as n}from"../../../webgl.js";import i from"../../../webgl/RenderNode.js";import{glsl as c,If as s}from"../../core/shaderModules/glsl.js";import{Pos2Locations as a}from"../../lib/DefaultVertexBufferLayouts.js";import{checkWebGLError as l}from"../../../../webgl/checkWebGLError.js";import{ColorAttachment0 as u,DataType as p,SizedPixelFormat as h}from"../../../../webgl/enums.js";import{alphaCutoff as f}from"../../../../../webscene/support/AlphaCutoff.js";let d=class extends i{constructor(e){super(e),this.destroyedCB=null,this.produces=n.FINAL,this.consumes={required:[n.FINAL]},this.clearColor=o,this._focusedFBOType=0,this._program=new Map}destroy(){this._program.forEach(e=>e.dispose()),this._program.clear(),this.destroyedCB()}render(e){const r=e.find(({name:e})=>e===n.FINAL);if(!this._focusedFBO)return r;const t=this.renderingContext;t.bindFramebuffer(r.fbo),t.setClearColor(0,0,0,0),t.clear(16384);const o=this._focusedFBO.getTexture(),i=[v(o)],c=this._ensureProgram(t,!1,i);return t.useProgram(c),t.bindTexture(o,0),c.setUniform1i("colorTex0",0),c.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&c.setUniform2fv("nearFar",this.camera.nearFar),t.screen.draw(),r}getDownscaledFBO(e,r,t,o,n){0===r&&(o=e.width,n=e.height);const i=e.colorAttachments.length,s=[],a=new Array(i);for(let c=0;c<i;++c){const r=e.getColorTexture(u+c);if(r){const e=v(r);s.push(e);const{descriptor:t}=r;"float"!==e||t.hasMipmap||t.isImmutable||(r.generateMipmap(),a[c]=!0)}}const p=this.renderingContext,{depthStencilTexture:f}=e,d=this._ensureProgram(p,null!=f,s),m=this.fboCache.acquire(o,n,"fbo visualizer");p.useProgram(d),p.bindFramebuffer(m.fbo);const g=[];for(let l=0;l<i;++l){const r=u+l,t=`colorTex${c.int(l)}`;p.bindTexture(e.getColorTexture(r),l),d.setUniform1i(t,l),l>0&&m.acquireColor(r,5),g.push(r)}const x=f?.descriptor.linearFilterDepth??!1;if(f){const e=i;f.setShadowFiltering(!1),p.bindTexture(f,e),d.setUniform1i("depthTex",e);const r=u+e;r>u&&m.acquireColor(r,5,"depth to color"),g.push(r)}p.gl.drawBuffers(g),l(p.gl);const T=p.getViewport();p.setViewport(0,0,o,n),p.setClearColor(0,0,0,0),p.clear(16384),p.setBlendingEnabled(!0),p.setBlendFunction(1,771);const F="linear-depth"===t||t.includes("shadow"),b="overlay highlight"===t||"highlights"===t||"highlight mix"===t,R="highlight coverage"===t,B=e.colorTexture?.descriptor,C=B?.internalFormat,y=F?3:b?5:R?6:C===h.R16F||C===h.R32F||C===h.R8?1:C===h.RG8?2:C===h.RGBA16F?4:C===h.RG8UI?7:0;d.setUniform1i("inputType",y),d.setUniform2fv("nearFar",this.camera.nearFar),p.screen.draw(),l(p.gl),p.bindFramebuffer(null),p.setViewport(T.x,T.y,T.width,T.height),0===r&&(this._focusedFBO=m,this._focusedFBOType=y);for(let c=0;c<i;++c)if(a[c]){const r=e.getColorTexture(u+c);r?.clearMipmap()}return f&&f.setShadowFiltering(x),m}clearFocusedFBO(){this._focusedFBO=null}getPreviewContent(e,r,t,o){if(!t)return null;const n=this.renderingContext,i=this.fboCache.acquire(e,r,"fbo visualizer");n.bindFramebuffer(i?.fbo),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(16384),n.setBlendingEnabled(!0),n.setBlendFunction(1,771);const c=t.getColorTexture(o);n.setViewport(0,0,e,r);const s=this._ensureProgram(n,!1,[v(c)]);n.useProgram(s),n.bindTexture(c,0),s.setUniform1i("colorTex0",0),s.setUniform1i("inputType",0),n.screen.draw();const a=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,6408,p.UNSIGNED_BYTE,new Uint8Array(a.data.buffer)),l(n.gl),n.bindFramebuffer(null),i?.release(),a}_ensureProgram(e,r,t){const o=g({hasDepthAttachment:r,colorAttachmentTypes:t}),n=this._program.get(o);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",l=e=>{let r="";for(let t=0;t<e.length;++t){const o=e[t];r+=`layout(location = ${c.int(t)}) out vec4 fragColor${c.int(t)};\n uniform ${m(o)} colorTex${c.int(t)};`}return r},u=e=>{let r="";for(let t=1;t<e.length;++t){const o=e[t],n=`texture(colorTex${c.int(t)}, uv)`,i="float"===o?n:`vec4( vec2(${n}), 0.0, 1.0)`;r+=`fragColor${c.int(t)} = ${i};`}return r},p=t.length,h=`#version 300 es\n precision highp float;\n precision highp usampler2D;\n\n in vec2 uv;\n ${l(t)}\n ${s(r,`layout(location = ${c.int(p)}) out vec4 fragDepth;\n uniform sampler2D depthTex;`)}\n\n uniform int inputType;\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaTofloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaTofloat(depth));\n }\n\n ${"float"===t[0]?"float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }":"float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);\n }"}\n\n void main() {\n ${s(t.length>0,c`
5
+ import{__decorate as e}from"tslib";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as t}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderCategory as n}from"../../../webgl.js";import i from"../../../webgl/RenderNode.js";import{glsl as s,If as c}from"../../core/shaderModules/glsl.js";import{Pos2Locations as a}from"../../lib/DefaultVertexBufferLayouts.js";import{checkWebGLError as l}from"../../../../webgl/checkWebGLError.js";import{ColorAttachment0 as u,DataType as p,SizedPixelFormat as h}from"../../../../webgl/enums.js";import{alphaCutoff as f}from"../../../../../webscene/support/AlphaCutoff.js";let d=class extends i{constructor(e){super(e),this.destroyedCB=null,this.produces=n.FINAL,this.consumes={required:[n.FINAL]},this.clearColor=o,this._focusedFBOType=0,this._program=new Map}destroy(){this._program.forEach(e=>e.dispose()),this._program.clear(),this.destroyedCB()}render(e){const r=e.find(({name:e})=>e===n.FINAL);if(!this._focusedFBO)return r;const t=this.renderingContext;t.bindFramebuffer(r.fbo),t.setClearColor(0,0,0,0),t.clear(16384);const o=this._focusedFBO.getTexture(),i=[v(o)],s=this._ensureProgram(t,!1,i);return t.useProgram(s),t.bindTexture(o,0),s.setUniform1i("colorTex0",0),s.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&s.setUniform2fv("nearFar",this.camera.nearFar),t.screen.draw(),r}getDownscaledFBO(e,r,t,o,n){0===r&&(o=e.width,n=e.height);const i=e.colorAttachments.length,c=[],a=new Array(i);for(let s=0;s<i;++s){const r=e.getColorTexture(u+s);if(r){const e=v(r);c.push(e);const{descriptor:t}=r;"float"!==e||t.hasMipmap||t.isImmutable||(r.generateMipmap(),a[s]=!0)}}const p=this.renderingContext,{depthStencilTexture:f}=e,d=this._ensureProgram(p,null!=f,c),m=this.fboCache.acquire(o,n,"fbo visualizer");p.useProgram(d),p.bindFramebuffer(m.fbo);const g=[];for(let l=0;l<i;++l){const r=u+l,t=`colorTex${s.int(l)}`;p.bindTexture(e.getColorTexture(r),l),d.setUniform1i(t,l),l>0&&m.acquireColor(r,5),g.push(r)}const x=f?.descriptor.linearFilterDepth??!1;if(f){const e=i;f.setShadowFiltering(!1),p.bindTexture(f,e),d.setUniform1i("depthTex",e);const r=u+e;r>u&&m.acquireColor(r,5,"fbo visualizer"),g.push(r)}p.gl.drawBuffers(g),l(p.gl);const T=p.getViewport();p.setViewport(0,0,o,n),p.setClearColor(0,0,0,0),p.clear(16384),p.setBlendingEnabled(!0),p.setBlendFunction(1,771);const F="linear depth"===t||t.includes("shadow"),b="overlay highlight"===t||"highlights"===t||"highlight mix"===t,R="highlight coverage"===t,B=e.colorTexture?.descriptor,C=B?.internalFormat,y=F?3:b?5:R?6:C===h.R16F||C===h.R32F||C===h.R8?1:C===h.RG8?2:C===h.RGBA16F?4:C===h.RG8UI?7:0;d.setUniform1i("inputType",y),d.setUniform2fv("nearFar",this.camera.nearFar),p.screen.draw(),l(p.gl),p.bindFramebuffer(null),p.setViewport(T.x,T.y,T.width,T.height),0===r&&(this._focusedFBO=m,this._focusedFBOType=y);for(let s=0;s<i;++s)if(a[s]){const r=e.getColorTexture(u+s);r?.clearMipmap()}return f&&f.setShadowFiltering(x),m}clearFocusedFBO(){this._focusedFBO=null}getPreviewContent(e,r,t,o){if(!t)return null;const n=this.renderingContext,i=this.fboCache.acquire(e,r,"fbo visualizer");n.bindFramebuffer(i?.fbo),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(16384),n.setBlendingEnabled(!0),n.setBlendFunction(1,771);const s=t.getColorTexture(o);n.setViewport(0,0,e,r);const c=this._ensureProgram(n,!1,[v(s)]);n.useProgram(c),n.bindTexture(s,0),c.setUniform1i("colorTex0",0),c.setUniform1i("inputType",0),n.screen.draw();const a=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,6408,p.UNSIGNED_BYTE,new Uint8Array(a.data.buffer)),l(n.gl),n.bindFramebuffer(null),i?.release(),a}_ensureProgram(e,r,t){const o=g({hasDepthAttachment:r,colorAttachmentTypes:t}),n=this._program.get(o);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",l=e=>{let r="";for(let t=0;t<e.length;++t){const o=e[t];r+=`layout(location = ${s.int(t)}) out vec4 fragColor${s.int(t)};\n uniform ${m(o)} colorTex${s.int(t)};`}return r},u=e=>{let r="";for(let t=1;t<e.length;++t){const o=e[t],n=`texture(colorTex${s.int(t)}, uv)`,i="float"===o?n:`vec4( vec2(${n}), 0.0, 1.0)`;r+=`fragColor${s.int(t)} = ${i};`}return r},p=t.length,h=`#version 300 es\n precision highp float;\n precision highp usampler2D;\n\n in vec2 uv;\n ${l(t)}\n ${c(r,`layout(location = ${s.int(p)}) out vec4 fragDepth;\n uniform sampler2D depthTex;`)}\n\n uniform int inputType;\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaTofloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaTofloat(depth));\n }\n\n ${"float"===t[0]?"float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }":"float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);\n }"}\n\n void main() {\n ${c(t.length>0,s`
6
6
  vec4 color;
7
7
  if (inputType == 1) {
8
8
  color = vec4(vec3(texture(colorTex0, uv).r), 1.0);
@@ -31,8 +31,8 @@ import{__decorate as e}from"tslib";import{property as r}from"../../../../../core
31
31
  }
32
32
 
33
33
 
34
- if(color.a < ${c.float(f)})
34
+ if(color.a < ${s.float(f)})
35
35
  discard;
36
36
  fragColor0 = color;
37
- ${s(t.length>1,u(t))}
38
- `)}\n\n ${s(r,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n }`,d=e.programCache.acquire(i,h,a);return this._program.set(o,d),d}};function m(e){switch(e){case"float":return"sampler2D";case"uint":return"usampler2D";case"int":return"isampler2D"}}function v(e){if(!e)return"float";const{internalFormat:r}=e.descriptor;switch(r){case h.R8I:case h.R16I:case h.R32I:case h.RG8I:case h.RG16I:case h.RG32I:case h.RGB8I:case h.RGB16I:case h.RGB32I:case h.RGBA8I:case h.RGBA16I:case h.RGBA32I:return"int";case h.R8UI:case h.R16UI:case h.R32UI:case h.RG8UI:case h.RG16UI:case h.RG32UI:case h.RGB8UI:case h.RGB16UI:case h.RGB32UI:case h.RGBA8UI:case h.RGBA16UI:case h.RGBA32UI:return"uint";default:return"float"}}function g(e){const{hasDepthAttachment:r,colorAttachmentTypes:t}=e;return`${r?"Depth":""}${t.reduceRight((e,r)=>e+`|C${r}`,"")}`}e([r()],d.prototype,"destroyedCB",void 0),e([r()],d.prototype,"produces",void 0),e([r()],d.prototype,"consumes",void 0),e([r()],d.prototype,"clearColor",void 0),d=e([t("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],d);export{d as RenderNodeVisualizerNode};
37
+ ${c(t.length>1,u(t))}
38
+ `)}\n\n ${c(r,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n }`,d=e.programCache.acquire(i,h,a);return this._program.set(o,d),d}};function m(e){switch(e){case"float":return"sampler2D";case"uint":return"usampler2D";case"int":return"isampler2D"}}function v(e){if(!e)return"float";const{internalFormat:r}=e.descriptor;switch(r){case h.R8I:case h.R16I:case h.R32I:case h.RG8I:case h.RG16I:case h.RG32I:case h.RGB8I:case h.RGB16I:case h.RGB32I:case h.RGBA8I:case h.RGBA16I:case h.RGBA32I:return"int";case h.R8UI:case h.R16UI:case h.R32UI:case h.RG8UI:case h.RG16UI:case h.RG32UI:case h.RGB8UI:case h.RGB16UI:case h.RGB32UI:case h.RGBA8UI:case h.RGBA16UI:case h.RGBA32UI:return"uint";default:return"float"}}function g(e){const{hasDepthAttachment:r,colorAttachmentTypes:t}=e;return`${r?"Depth":""}${t.reduceRight((e,r)=>e+`|C${r}`,"")}`}e([r()],d.prototype,"destroyedCB",void 0),e([r()],d.prototype,"produces",void 0),e([r()],d.prototype,"consumes",void 0),e([r()],d.prototype,"clearColor",void 0),d=e([t("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],d);export{d as RenderNodeVisualizerNode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../core/mathUtils.js";import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./BloomPresets.glsl.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{B as BloomBlurPassParameters,b as build}from"../../../../../chunks/BloomBlur.glsl.js";
5
+ import"../../../../../core/mathUtils.js";import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./GlowPresets.glsl.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlowBlurPassParameters,b as build}from"../../../../../chunks/GlowBlur.glsl.js";
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as o}from"../../../../../chunks/GlowBlur.glsl.js";import{Pos2Locations as l}from"../../lib/DefaultVertexBufferLayouts.js";import{makePipelineState as s,defaultColorWrite as t}from"../../../../webgl/renderState.js";class i extends r{constructor(r,s){super(r,s,new e(o,()=>import("./GlowBlur.glsl.js")),l)}initializePipeline(){return s({colorWrite:t})}}export{i as GlowBlurTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import{parameter as e,ShaderTechniqueConfiguration as t}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends t{constructor(){super(...arguments),this.bloomStage=0}}o([e({count:2})],r.prototype,"bloomStage",void 0);export{r as BloomBlurTechniqueConfiguration};
5
+ import{__decorate as o}from"tslib";import{parameter as e,ShaderTechniqueConfiguration as t}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends t{constructor(){super(...arguments),this.glowStage=0}}o([e({count:2})],r.prototype,"glowStage",void 0);export{r as GlowBlurTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/FloatsPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/IntegerPassUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./BloomPresets.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{B as BloomCompositionPassParameters,b as build,d as defaultCompositionParameters}from"../../../../../chunks/BloomComposition.glsl.js";
5
+ import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/FloatsPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/IntegerPassUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./GlowPresets.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlowCompositionPassParameters,b as build,d as defaultCompositionParameters}from"../../../../../chunks/GlowComposition.glsl.js";
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as o}from"../../../../../chunks/GlowComposition.glsl.js";import{Pos2Locations as s}from"../../lib/DefaultVertexBufferLayouts.js";import{ColorAttachment0 as i,ColorAttachment1 as t}from"../../../../webgl/enums.js";import{makePipelineState as l,defaultColorWrite as m}from"../../../../webgl/renderState.js";class a extends r{constructor(r,i){super(r,i,new e(o,()=>import("./GlowComposition.glsl.js")),s)}initializePipeline(){return l({colorWrite:m,drawBuffers:{buffers:[i,t]}})}}export{a as GlowCompositionTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as r}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class t extends r{constructor(){super(...arguments),this.blurEnabled=!1,this.tonemappingEnabled=!0}}e([o()],t.prototype,"blurEnabled",void 0),e([o()],t.prototype,"tonemappingEnabled",void 0);export{t as BloomCompositionTechniqueConfiguration};
5
+ import{__decorate as e}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as r}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class t extends r{constructor(){super(...arguments),this.blurEnabled=!1,this.tonemappingEnabled=!0}}e([o()],t.prototype,"blurEnabled",void 0),e([o()],t.prototype,"tonemappingEnabled",void 0);export{t as GlowCompositionTechniqueConfiguration};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ const n=2.6,s={sunny:.0022,rainy:.0022,cloudy:.0022,snowy:.0042,foggy:.0042};class t{constructor(n){this.presets=n,this.presets=c(n)}}const o={sunny:new t([2.1,.8,.6,.4,.2,.1]),foggy:new t([0,0,.06,.12,.25,.57])};function c(n,s=1){const t=n[0]+n[1]+n[2]+n[3]+n[4]+n[5];return t<=s?n:[n[0]/t,n[1]/t,n[2]/t,n[3]/t,n[4]/t,n[5]/t]}export{s as blurRadiusPresets,n as defaultExposure,o as lodFactorsPresets,c as normalizePreset};