@arcgis/core 4.33.0-next.20250521 → 4.33.0-next.20250522

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 (237) hide show
  1. package/applications/Components/analysisUtils.d.ts +2 -0
  2. package/applications/Components/analysisUtils.js +1 -1
  3. package/arcade/featureset/actions/GroupBy.js +1 -1
  4. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/0a770f283eb77c8dc97a.js +1 -0
  7. package/assets/esri/core/workers/chunks/0dcab04dd1feeb5521cf.js +1 -0
  8. package/assets/esri/core/workers/chunks/{8a2cee726b7843c7408a.js → 0fb5de3f8a4d69b2d514.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{7c819b3e6d69c526f4b2.js → 1c86aa3802d9ae0230ae.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{b53a7040a71b0f1f3854.js → 23f6e98ef22f099f846c.js} +1 -1
  11. package/assets/esri/core/workers/chunks/28b1819bf744ce957dfd.js +2 -0
  12. package/assets/esri/core/workers/chunks/28b1819bf744ce957dfd.js.LICENSE.txt +33 -0
  13. package/assets/esri/core/workers/chunks/{234117cc5cb7c6863313.js → 2d90806faa4269828948.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{e2cada6644c49b1b6e79.js → 36b0d6b4089a96475201.js} +1 -1
  15. package/assets/esri/core/workers/chunks/40f54c4f8ae63c6f3df9.js +1 -0
  16. package/assets/esri/core/workers/chunks/4193c52799aa3b6337c9.js +2 -0
  17. package/assets/esri/core/workers/chunks/{9588328d4ed6b0f04166.js.LICENSE.txt → 4193c52799aa3b6337c9.js.LICENSE.txt} +0 -34
  18. package/assets/esri/core/workers/chunks/42d9989b2aad3ac28d4d.js +1 -0
  19. package/assets/esri/core/workers/chunks/{8a6aac37b3133de74cce.js → 51c31e6d014005107d42.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{5c8d52b72a3bea4202ac.js → 634a418310e44e2436e0.js} +1 -1
  21. package/assets/esri/core/workers/chunks/6ee41e9c92ed8ba4c763.js +1 -0
  22. package/assets/esri/core/workers/chunks/{83fcc6f770ad084b8ab9.js → 86023cc5ccbc7ac43479.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{cc4a6f4000cb6680be48.js → ac2607f1e8cd2e99907c.js} +2 -2
  24. package/assets/esri/core/workers/chunks/bf3555f91492a1a3b613.js +1 -0
  25. package/assets/esri/core/workers/chunks/d2ebb72a43d995ed368a.js +1 -0
  26. package/assets/esri/core/workers/chunks/dbe10c20df7e0e563a0b.js +1 -0
  27. package/assets/esri/core/workers/chunks/df933eac03dc63064723.js +1 -0
  28. package/assets/esri/core/workers/chunks/e77371ddbaf4b2d9be8d.js +1 -0
  29. package/assets/esri/core/workers/chunks/{19a58adc75a34f84b0ef.js → ee6240636d04d7d37b7b.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{f74f8ed3f17713a208c3.js → fa63b0f7fa799cb2f81d.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{6c29a768f02dc7ce0ed6.js → fb9e9b9e567e32f37042.js} +1 -1
  32. package/assets/esri/core/workers/chunks/fc61d02286b6ff5447cc.js +1 -0
  33. package/assets/esri/themes/base/widgets/_Editor.scss +40 -2
  34. package/assets/esri/themes/base/widgets/_FeatureForm.scss +4 -0
  35. package/assets/esri/themes/base/widgets/_SelectionList.scss +21 -15
  36. package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +1 -0
  37. package/assets/esri/themes/dark/main.css +1 -1
  38. package/assets/esri/themes/light/main.css +1 -1
  39. package/assets/esri/themes/light/view.css +1 -1
  40. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  41. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  42. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  43. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  44. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  45. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  46. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  47. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  48. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  49. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  50. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  51. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  52. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  53. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  54. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  55. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  56. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  57. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  58. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  59. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  60. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  61. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  62. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  63. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  64. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  65. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  66. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  67. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  68. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  69. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  70. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  71. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  72. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  73. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  74. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  75. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  76. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  77. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  78. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  79. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  80. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  81. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm.json +1 -1
  82. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_en.json +1 -1
  83. package/assets/esri/widgets/Home/t9n/Home_pt-BR.json +1 -1
  84. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  85. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  86. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  87. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  88. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  89. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  90. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  91. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  92. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  93. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  94. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  95. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  96. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  97. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  98. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  99. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  100. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  101. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  102. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  103. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  104. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  105. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  106. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  107. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  108. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  109. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  110. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  111. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  112. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  113. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  114. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  115. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  116. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  117. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  118. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  119. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  120. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  121. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  122. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  123. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  124. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  125. package/chunks/ComponentShader.glsl.js +24 -15
  126. package/core/sanitizerUtils.js +5 -0
  127. package/editing/sharedTemplates/SharedTemplate.js +1 -1
  128. package/editing/sharedTemplates/templateDefinitions/FeatureTemplateDefinition.js +1 -1
  129. package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
  130. package/editing/sharedTemplates/templateDefinitions/PresetTemplateDefinition.js +1 -1
  131. package/editing/sharedTemplates/templateDefinitions/parts/FeatureTemplateRelationshipPart.js +1 -1
  132. package/editing/sharedTemplates/templateDefinitions/parts/GroupTemplatePart.js +1 -1
  133. package/editing/sharedTemplates/templateDefinitions/parts/PresetTemplatePart.js +1 -1
  134. package/interfaces.d.ts +193 -11
  135. package/layers/IntegratedMeshLayer.js +1 -1
  136. package/layers/WMSLayer.js +1 -1
  137. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  138. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  139. package/layers/mixins/ArcGISImageService.js +1 -1
  140. package/layers/support/VideoElement.js +1 -1
  141. package/layers/support/capabilities.js +1 -1
  142. package/layers/support/rasterFunctions/clipUtils.js +1 -1
  143. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  144. package/libs/maquette/projection.js +1 -1
  145. package/networks/UnitIdentifierManager.js +5 -0
  146. package/networks/support/UNTraceConfiguration.js +1 -1
  147. package/package.json +1 -1
  148. package/rest/featureService/FeatureService.js +1 -1
  149. package/rest/knowledgeGraph/GraphAddNamedTypesResult.d.ts +4 -0
  150. package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.d.ts +4 -0
  151. package/rest/knowledgeGraphService.d.ts +2 -0
  152. package/rest/networks/unitIdentifiers/support/UnitQueryResult.js +1 -1
  153. package/rest/query/executeQuery.js +1 -1
  154. package/rest/query/executeQueryJSON.js +1 -1
  155. package/rest/query/executeQueryPBF.js +1 -1
  156. package/rest/query.js +1 -1
  157. package/smartMapping/renderers/support/spikeUtils.js +1 -1
  158. package/support/revision.js +1 -1
  159. package/views/2d/LabelManager.js +1 -1
  160. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  161. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  162. package/views/2d/engine/vectorTiles/decluttering/core.js +1 -1
  163. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  164. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  165. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  166. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  167. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  168. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
  169. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterColorizerShader.js +1 -1
  170. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  171. package/views/2d/layers/features/FeatureContainer.js +1 -1
  172. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  173. package/views/2d/layers/support/vectorTileDebugUtils.js +1 -1
  174. package/views/3d/FocusAreasView.js +1 -1
  175. package/views/3d/layers/I3SMeshView3D.js +1 -1
  176. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  177. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  178. package/views/3d/layers/i3s/enums.js +1 -1
  179. package/views/3d/terrain/TerrainRenderer.js +1 -1
  180. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  181. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  182. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  183. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  184. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  185. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  186. package/views/3d/webgl-engine/lib/RenderSlot.js +1 -1
  187. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  188. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  189. package/views/ui/UI.js +1 -1
  190. package/views/webgl/Texture.js +1 -1
  191. package/views/webgl/rasterUtils.js +1 -1
  192. package/webscene/Slide.js +1 -1
  193. package/widgets/DirectionalPad.js +1 -1
  194. package/widgets/Editor/EditorViewModel.js +1 -1
  195. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  196. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  197. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  198. package/widgets/Editor/UpdateWorkflow.js +1 -1
  199. package/widgets/Editor/VisibleElements.js +1 -1
  200. package/widgets/Editor/components/FooterActions.js +1 -1
  201. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  202. package/widgets/Editor/css.js +1 -1
  203. package/widgets/Editor.js +1 -1
  204. package/widgets/FeatureForm/TextElementInput.js +1 -1
  205. package/widgets/FeatureForm/css.js +1 -1
  206. package/widgets/FeatureForm.js +1 -1
  207. package/widgets/FeatureTable/AttachmentsColumn.js +1 -1
  208. package/widgets/FeatureTable/FieldColumn.js +1 -1
  209. package/widgets/FeatureTable/Grid/Column.js +1 -1
  210. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  211. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  212. package/widgets/FeatureTable/support/exportUtils.js +1 -1
  213. package/widgets/FeatureTable.js +1 -1
  214. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  215. package/widgets/Sketch.js +1 -1
  216. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  217. package/widgets/support/SelectionList/VisibleElements.js +1 -1
  218. package/widgets/support/SelectionList.js +1 -1
  219. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  220. package/widgets/support/SelectionToolbar/VisibleElements.js +1 -1
  221. package/widgets/support/SelectionToolbar.js +1 -1
  222. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  223. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  224. package/widgets/support/widget.js +1 -1
  225. package/widgets/support/widgetUtils.js +1 -1
  226. package/assets/esri/core/workers/chunks/0c50ee1f3cdd30d96479.js +0 -1
  227. package/assets/esri/core/workers/chunks/133e4bde346828d4510b.js +0 -1
  228. package/assets/esri/core/workers/chunks/5228d39c05d660a135b6.js +0 -1
  229. package/assets/esri/core/workers/chunks/5f4ca51b82daf0e51010.js +0 -1
  230. package/assets/esri/core/workers/chunks/8fda0a5b247385e68dc0.js +0 -1
  231. package/assets/esri/core/workers/chunks/938f1eebc48871be64e9.js +0 -1
  232. package/assets/esri/core/workers/chunks/9588328d4ed6b0f04166.js +0 -2
  233. package/assets/esri/core/workers/chunks/9839309d0cd804fe52c2.js +0 -1
  234. package/assets/esri/core/workers/chunks/9b610fbfcd47c3dde34d.js +0 -1
  235. package/assets/esri/core/workers/chunks/be2c8c0a8b2bce7979b6.js +0 -1
  236. package/assets/esri/core/workers/chunks/f218a190015de1444018.js +0 -1
  237. package/assets/esri/core/workers/chunks/f9567108862629f25c8b.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import has from"../../../core/has.js";import{disposeMaybe as i}from"../../../core/maybe.js";import{MemCachePool as r}from"../../../core/MemCachePool.js";import s from"../../../core/ObjectPool.js";import{watch as n,sync as a}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{d as c,i as d,e as h}from"../../../chunks/vec32.js";import{ZEROS as u,create as g,fromValues as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as _,ZEROS as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as m,set as b}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as y}from"../../../geometry/support/buffer/BufferView.js";import{ViewingMode as T}from"../../ViewingMode.js";import{TextureUpdate as R}from"./interfaces.js";import{LayerClass as x}from"./LayerClass.js";import{OverlayContent as O}from"./OverlayContent.js";import{overlayRenderOccludedFlag as v}from"./OverlayRenderer.js";import{PatchRenderData as w}from"./PatchRenderData.js";import{RenderOrder as P}from"./RenderOrder.js";import{TerrainAttributesCache as D}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as S}from"./terrainUtils.js";import{TileRenderer as E}from"./TileRenderer.js";import{TileUpdate as C}from"./TileUpdate.js";import{IteratorPreorder as A,sortTiles as j,compareTiles as N}from"./tileUtils.js";import{TransparencyMode as B}from"./TransparencyMode.js";import{componentMinimalSizeForIntersectionData as I,ComponentIntersectionData as F}from"../webgl-engine/collections/Component/ComponentIntersectionData.js";import{ShaderOutput as q}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{TileBlendInput as M}from"../webgl-engine/core/shaderLibrary/terrain/TileBlendInput.js";import{SyncRenderPlugin as U,ConsumesDepth as G,ConsumesNone as L}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as k}from"../webgl-engine/lib/Attribute.js";import{RenderRequestType as z}from"../webgl-engine/lib/basicInterfaces.js";import{StoreResults as H}from"../webgl-engine/lib/IntersectorInterfaces.js";import{IntersectorResult as V}from"../webgl-engine/lib/IntersectorResult.js";import{IntersectorType as Y}from"../webgl-engine/lib/IntersectorType.js";import{RenderOccludedFlag as Q}from"../webgl-engine/lib/Material.js";import{intersectAabbInvDirBefore as W,MeshIntersectionOptions as X,intersectTriangles as K}from"../webgl-engine/lib/RayIntersections.js";import{RenderSlot as Z}from"../webgl-engine/lib/RenderSlot.js";import{getSettings as J}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as $}from"../webgl-engine/lib/VertexAttribute.js";import{terrainId as ee,getVerticalOffsetTerrain as te}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as ie}from"../webgl-engine/materials/DrawParameters.js";import{T as re}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as se}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as ne}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as ae}from"../../webgl/enums.js";const oe=7,le=10,ce=m();let de=class extends U{get _isGlobal(){return this._stage.viewingMode===T.Global}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}constructor(e,t,i,n,a,o){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=i,this._ellipsoidRadius=n,this._compressionHandle=a,this.type=Y.TERRAIN,this.isGround=!0,this._passParameters=new re,this._drawParameters=new ie,this._renderDataPool=new s(w),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new A,this._castShadows=!1,this._inViewshed=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.renderOccludedFlags=Q.Occlude,this.produces=new Map([[Z.OPAQUE_TERRAIN,()=>this._produces()&&this.transparency===B.Opaque],[Z.TRANSPARENT_TERRAIN,()=>this._produces()&&(this.transparency===B.Transparent||this.transparency===B.InvisibleWithDraped)],[Z.OCCLUDED_TERRAIN,()=>this._produces()&&this.renderOccludedFlags===v]]),this._tileSize=256,this._configuration=new ne(t.viewingMode===T.Global),this._tileTextureCache=new r(((e,t)=>o.newCache(e,t)),"TileTexture"),this.tileGeometryCache=new D(o)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(n((()=>this._overlayRenderer.rendersOccludedDraped),(e=>{this.renderOccludedFlags=e?v:Q.Occlude,this.setNeedsRender()}),a))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy()}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}consumes(){return this._overlayRenderer.hasWater?G:L}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setDirty()}set visible(e){this._set("visible",!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get visualizeNormals(){return this._configuration.visualizeNormals}set visualizeNormals(e){this._configuration.visualizeNormals!==e&&(this._configuration.visualizeNormals=e,this.setNeedsRender(),this.notifyChange("visualizeNormals"))}get cullBackFaces(){return this._configuration.backfaceCullingEnabled}set cullBackFaces(e){this._configuration.backfaceCullingEnabled!==e&&(this._configuration.backfaceCullingEnabled=e,this.notifyChange("cullBackFaces"),this.setNeedsRender())}set renderOrder(e){this._set("renderOrder",e),this._setSortingDirty()}get layerViewUid(){return ee}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setDebugScreenSizePerspective(e){this._configuration.screenSizePerspective!==e&&(this._configuration.screenSizePerspective=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,null!=this._tileRenderer&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,C.TEXTURE_FADING)}reuseTextureFromParent(e){const t=e.parent;if(!t)return!1;const i=_(1&e.lij[2]?.5:0,1&e.lij[1]?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,i)??!1}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,t===C.TEXTURE_FADING?R.FADING:R.UNFADED),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const i of e.layerInfo[x.ELEVATION])i.pendingUpdates&=~C.GEOMETRY;e.resetPendingUpdate(C.GEOMETRY);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=le-oe,i=Math.max(0,Math.floor((e.level-t)/oe)*oe);if(this._isGlobal&&0===i)return u;for(;e.parent&&e.level>i;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=z.UPDATE){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=z.UPDATE){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=z.UPDATE){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new E(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionHandle),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=i(this._tileRenderer)}intersect(e,t,i,r){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==B.Opaque)return;const s=he,n=ue;c(s,r,i),d(n,1/s[0],1/s[1],1/s[2]);const a=e.results.min,o=e.results.max,l=e.results.ground,u=e.options.store===H.MIN,g=!!e.results.ground.target,p=te(e.verticalOffset),_=e.tolerance;let f,m=u&&null!=a.distance?a.distance:1/0;const T=e.options,R=T.normalRequired||!T.backfacesTerrain,x=new X(!1,R),O=d=>{const g=d.renderData;if(!g?.vao)return;const O=g.geometry;b(ce,O.boundingBox);const v=g.localOrigin;null!=p&&(p.localOrigin=v,p.applyToAabb(ce));const w=ce;if(ge[0]=i[0]-v[0],ge[1]=i[1]-v[1],ge[2]=i[2]-v[2],!W(w,ge,n,_,m))return;const P=(e,t,i)=>{e.set(this.type,d,t,i),m=u&&null!=a.distance?a.distance:1/0},D=(n,c,d)=>{if((!R||null!=d)&&n>=0&&(T.backfacesTerrain||h(d,s)<0)&&(T.invisibleTerrain||!T.selectionMode||null==t||t(i,r,n))){if((null==l.distance||n<l.distance)&&P(l,n,d),T.isFiltered)return;T.store===H.ALL&&(null==f?(f=new V(e.ray),P(f,n,d),e.results.all.push(f)):n<f.distance&&P(f,n,d)),(null==a.distance||n<a.distance)&&P(a,n,d),T.store!==H.MIN&&(null==o.distance||n>o.distance)&&P(o,n,d)}},S=pe;c(S,r,v);const{indices:E,indexCount:C}=O,A=O.vertexAttributes,j=A.getField($.POSITION,y),N=new k(j.typedBuffer,3,A.stride/4),B=C/3;if(!p&&B>I){const e=d.renderData;null==e.intersectionData&&(e.intersectionData=new F(E,0,B,N)),e.intersectionData.intersectRay(ge,S,x,D)}else K(ge,S,0,B,E,N,p,x,D)},v=this._rootTiles;if(null!=v){(()=>{const t=this._tileIterator;t.reset(v);const r=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||r&&e.intersectsClippingArea)||null==p&&!e.intersectsRay(i,s,_,m)||g&&this._useStencilForTile(e)?t.skipSubtree():O(e)})()}}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._visiblePatchesByOrigin.values())for(const i of t)null!=i.renderData?.textureReference&&e.queriesForTile(i);e.process(),t.madeProgress()}}acquireTechniques(e){const t=!!has("enable-feature:terrain-shadows")&&e.bind.shadowMap.enabled;t!==this._castShadows&&(this._castShadows=t,this._patchesByOriginDirty=!0);const i=e.bind.viewshedEnabled;if(this._inViewshed!==i&&(this._inViewshed=i,this._patchesByOriginDirty=!0),e.bind.slot===Z.OCCLUDED_TERRAIN){if(0===(e.renderOccludedMask&v))return null}else{const t=this.transparency===B.Opaque?Z.OPAQUE_TERRAIN:Z.TRANSPARENT_TERRAIN;if(e.bind.slot!==t)return null}if(this.transparency===B.Invisible)return null;const r=this._configuration;switch(r.screenSpaceReflections=r.cloudReflections=r.receiveShadows=r.receiveAmbientOcclusion=r.renderOccluded=r.hasHighlightMixTexture=!1,r.overlayMode=this._overlayRenderer.mode,e.output){case q.Color:case q.ColorEmission:{r.screenSpaceReflections=null!=e.bind.ssr.lastFrameColor,r.cloudReflections=null!=e.bind.clouds.data,r.receiveShadows=e.bind.shadowMap.ready;const t=e.bind.slot===Z.OCCLUDED_TERRAIN;return r.renderOccluded=t,r.receiveAmbientOcclusion=!t&&null!=e.bind.ssao,this._acquireTechnique(e.output)}case q.Shadow:case q.ShadowExcludeHighlight:return this._castShadows?this._acquireTechnique(q.Shadow):null;case q.ViewshedShadow:return this._inViewshed?this._acquireTechnique(q.ViewshedShadow):null;case q.Depth:case q.Normal:return this._acquireTechnique(e.output);case q.ObjectAndLayerIdColor:return this._acquireTechnique(q.ObjectAndLayerIdColor);case q.Highlight:return r.hasHighlightMixTexture=null!=e.bind.highlightMixTexture,this._overlayRenderer.hasHighlights?this._acquireTechnique(q.Highlight):null}return null}render(e,t){switch(this._updatePatchGroups(),t.useStencil=!1,e.output){case q.Color:case q.ColorEmission:{const i=e.bind.slot===Z.OCCLUDED_TERRAIN?O.Occluded:O.Color;this._renderMaterialPass(e,t,i);break}case q.Depth:case q.Normal:this._renderAuxiliaryPass(e,t,O.Color,this._visiblePatchesByOrigin);break;case q.Highlight:{const i=e.bind.highlight?.name;i&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(O.Highlight)&&this._overlayRenderer.hasHighlight(i)&&this._renderAuxiliaryPass(e,t,O.Highlight,this._visiblePatchesByOrigin);break}case q.Shadow:case q.ShadowExcludeHighlight:case q.ViewshedShadow:this._renderAuxiliaryPass(e,t,null,this._allPatchesByOrigin);break;case q.ObjectAndLayerIdColor:this._renderAuxiliaryPass(e,t,O.ObjectAndLayerIdColor,this._visiblePatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const i=this._tileRenderer;let r;if(null!=e){const i=t.toUnitRGBA(e);r=p(i[0]||0,i[1]||0,i[2]||0)}i.setBackground(r),this._allTiles.forAll((e=>i.updateTileTexture(e,R.FADING))),this._configuration.tileBlendInput=i.backgroundIsGrid?M.GridComposite:null!=i.backgroundColor?M.ColorComposite:M.LayerOnly,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty&&this.renderOrder!==P.NONE){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const i of e)j(this.renderOrder,i,t);e.sort(((e,t)=>N(e[0],t[0],this.renderOrder))),this._visiblePatchesByOrigin=new Map(e.map((e=>[e[0].renderData.localOrigin,e]))),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),i=e.renderData;if(!i){this._numTilesCulled++;continue}const r=i.localOrigin;if(this._castShadows||this._inViewshed){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let s=this._visiblePatchesByOrigin.get(r);s||(s=[],this._visiblePatchesByOrigin.set(r,s)),s.push(e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,i,r){const s=e.rctx;this._passParameters.overlayContent=i,s.bindTechnique(t,e.bind,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;r.forEach((r=>{this._drawParameters.origin=r[0].renderData.localOrigin,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters);for(let s=0;s<r.length;s++)this._renderPatch(e,t,r[s],ae.TRIANGLES,n,i)})),e.rctx.bindVAO(null)}_renderMaterialPass(e,t,i){const{rctx:r}=e;this._passParameters.overlayContent=i,r.bindTechnique(t,e.bind,this._passParameters),this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const s=e.bind.camera,n=t.program;if(this._configuration.screenSizePerspective&&this.pointsOfInterest){const e=J(this._stage.viewingMode,this._ellipsoidRadius),t=this.pointsOfInterest.centerOnSurfaceFrequent.distance;e.update({distance:t,fovY:s.fovY})}const a=this._stencilEnabledLayerExtents.length>0,o=i===O.Occluded;o&&(n.bindTexture("tex",r.emptyTexture),n.setUniform3fv("textureOpacities",u),n.setUniform4fv("texOffsetAndScale",f));const l=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:u;this._configuration.tileBlendInput===M.ColorComposite&&n.setUniform3fv("backgroundColor",l);const c=this.wireframe?ae.LINES:ae.TRIANGLES;this._configuration.textureFadingEnabled&&n.bindTexture("texNext",r.emptyTexture);const d=this._visiblePatchesByOrigin;for(const h of d.values()){const r=h[0].renderData.localOrigin;this._drawParameters.origin=r,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const s of h){const r=s.renderData,l=r.textureReference;if(null!=l){if(!o){n.setUniform4fv("texOffsetAndScale",l.offsetAndScale),n.bindTexture("tex",l.texture.texture);const e=r.textureFadeFactor,t=e<1?r.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(n.setUniform1f("fadeFactor",e),n.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),n.setUniform3fv("nextTexOpacities",t.opacities),n.bindTexture("texNext",t.texture.texture)):n.setUniform1f("fadeFactor",1),r.textureIsFading&&this.setNeedsRender(),n.setUniform3fv("textureOpacities",l.opacities)}this._renderPatch(e,t,s,c,a,i),s.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}e.rctx.bindVAO(null)}_renderPatch(e,t,i,r,s,n){const a=i.renderData,o=a.vao,l=o?.indexBuffer;if(!o||null==l)return void(S&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const c=t.program;null==n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(c,a.overlay),s&&(t.useStencil=this._useStencilForTile(i),e.rctx.setPipelineState(t.getPipeline()));const d=a.geometry.indexCount;e.rctx.bindVAO(o),c.assertCompatibleVertexAttributeLocations(o),e.rctx.drawElements(r,d,l.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(se,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([o({readOnly:!0})],de.prototype,"_isGlobal",null),e([o()],de.prototype,"renderOccludedFlags",void 0),e([o({value:!1})],de.prototype,"renderingDisabled",null),e([o({value:!0})],de.prototype,"visible",null),e([o()],de.prototype,"renderPatchBorders",null),e([o()],de.prototype,"visualizeNormals",null),e([o()],de.prototype,"cullBackFaces",null),e([o({value:P.FRONT_TO_BACK})],de.prototype,"renderOrder",null),e([o()],de.prototype,"wireframe",null),de=e([l("esri.views.3d.terrain.TerrainRenderer")],de);const he=g(),ue=g(),ge=g(),pe=g();export{de as TerrainRenderer};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import has from"../../../core/has.js";import{disposeMaybe as i}from"../../../core/maybe.js";import{MemCachePool as r}from"../../../core/MemCachePool.js";import s from"../../../core/ObjectPool.js";import{watch as n,sync as a}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{d as c,i as d,e as h}from"../../../chunks/vec32.js";import{ZEROS as u,create as g,fromValues as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as _,ZEROS as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as m,set as b}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as y}from"../../../geometry/support/buffer/BufferView.js";import{ViewingMode as T}from"../../ViewingMode.js";import{TextureUpdate as O}from"./interfaces.js";import{LayerClass as R}from"./LayerClass.js";import{OverlayContent as x}from"./OverlayContent.js";import{overlayRenderOccludedFlag as v}from"./OverlayRenderer.js";import{PatchRenderData as w}from"./PatchRenderData.js";import{RenderOrder as P}from"./RenderOrder.js";import{TerrainAttributesCache as D}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as S}from"./terrainUtils.js";import{TileRenderer as C}from"./TileRenderer.js";import{TileUpdate as E}from"./TileUpdate.js";import{IteratorPreorder as j,sortTiles as A,compareTiles as N}from"./tileUtils.js";import{TransparencyMode as B}from"./TransparencyMode.js";import{componentMinimalSizeForIntersectionData as I,ComponentIntersectionData as U}from"../webgl-engine/collections/Component/ComponentIntersectionData.js";import{ShaderOutput as G}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{TileBlendInput as F}from"../webgl-engine/core/shaderLibrary/terrain/TileBlendInput.js";import{SyncRenderPlugin as q,ConsumesDepth as M,ConsumesNone as L}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as k}from"../webgl-engine/lib/Attribute.js";import{RenderRequestType as z}from"../webgl-engine/lib/basicInterfaces.js";import{StoreResults as H}from"../webgl-engine/lib/IntersectorInterfaces.js";import{IntersectorResult as V}from"../webgl-engine/lib/IntersectorResult.js";import{IntersectorType as Y}from"../webgl-engine/lib/IntersectorType.js";import{RenderOccludedFlag as Q}from"../webgl-engine/lib/Material.js";import{intersectAabbInvDirBefore as W,MeshIntersectionOptions as X,intersectTriangles as K}from"../webgl-engine/lib/RayIntersections.js";import{RenderSlot as Z}from"../webgl-engine/lib/RenderSlot.js";import{getSettings as J}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as $}from"../webgl-engine/lib/VertexAttribute.js";import{terrainId as ee,getVerticalOffsetTerrain as te}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as ie}from"../webgl-engine/materials/DrawParameters.js";import{T as re}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as se}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as ne}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as ae}from"../../webgl/enums.js";const oe=7,le=10,ce=m();let de=class extends q{get _isGlobal(){return this._stage.viewingMode===T.Global}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}constructor(e,t,i,n,a,o){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=i,this._ellipsoidRadius=n,this._compressionHandle=a,this.type=Y.TERRAIN,this.isGround=!0,this._passParameters=new re,this._drawParameters=new ie,this._renderDataPool=new s(w),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new j,this._castShadows=!1,this._inViewshed=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.renderOccludedFlags=Q.Occlude,this.produces=new Map([[Z.OPAQUE_TERRAIN,()=>this._produces()&&this.transparency===B.Opaque],[Z.TRANSPARENT_TERRAIN,()=>this._produces()&&(this.transparency===B.Transparent||this.transparency===B.InvisibleWithDraped)],[Z.OCCLUDED_GROUND,()=>this._produces()&&this.renderOccludedFlags===v]]),this._tileSize=256,this._configuration=new ne(t.viewingMode===T.Global),this._tileTextureCache=new r(((e,t)=>o.newCache(e,t)),"TileTexture"),this.tileGeometryCache=new D(o)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(n((()=>this._overlayRenderer.rendersOccludedDraped),(e=>{this.renderOccludedFlags=e?v:Q.Occlude,this.setNeedsRender()}),a))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy()}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}consumes(){return this._overlayRenderer.hasWater?M:L}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setDirty()}set visible(e){this._set("visible",!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get visualizeNormals(){return this._configuration.visualizeNormals}set visualizeNormals(e){this._configuration.visualizeNormals!==e&&(this._configuration.visualizeNormals=e,this.setNeedsRender(),this.notifyChange("visualizeNormals"))}get cullBackFaces(){return this._configuration.backfaceCullingEnabled}set cullBackFaces(e){this._configuration.backfaceCullingEnabled!==e&&(this._configuration.backfaceCullingEnabled=e,this.notifyChange("cullBackFaces"),this.setNeedsRender())}set renderOrder(e){this._set("renderOrder",e),this._setSortingDirty()}get layerViewUid(){return ee}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setDebugScreenSizePerspective(e){this._configuration.screenSizePerspective!==e&&(this._configuration.screenSizePerspective=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,null!=this._tileRenderer&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,E.TEXTURE_FADING)}reuseTextureFromParent(e){const t=e.parent;if(!t)return!1;const i=_(1&e.lij[2]?.5:0,1&e.lij[1]?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,i)??!1}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,t===E.TEXTURE_FADING?O.FADING:O.UNFADED),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const i of e.layerInfo[R.ELEVATION])i.pendingUpdates&=~E.GEOMETRY;e.resetPendingUpdate(E.GEOMETRY);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=le-oe,i=Math.max(0,Math.floor((e.level-t)/oe)*oe);if(this._isGlobal&&0===i)return u;for(;e.parent&&e.level>i;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=z.UPDATE){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=z.UPDATE){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=z.UPDATE){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new C(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionHandle),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=i(this._tileRenderer)}intersect(e,t,i,r){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==B.Opaque)return;const s=he,n=ue;c(s,r,i),d(n,1/s[0],1/s[1],1/s[2]);const a=e.results.min,o=e.results.max,l=e.results.ground,u=e.options.store===H.MIN,g=!!e.results.ground.target,p=te(e.verticalOffset),_=e.tolerance;let f,m=u&&null!=a.distance?a.distance:1/0;const T=e.options,O=T.normalRequired||!T.backfacesTerrain,R=new X(!1,O),x=d=>{const g=d.renderData;if(!g?.vao)return;const x=g.geometry;b(ce,x.boundingBox);const v=g.localOrigin;null!=p&&(p.localOrigin=v,p.applyToAabb(ce));const w=ce;if(ge[0]=i[0]-v[0],ge[1]=i[1]-v[1],ge[2]=i[2]-v[2],!W(w,ge,n,_,m))return;const P=(e,t,i)=>{e.set(this.type,d,t,i),m=u&&null!=a.distance?a.distance:1/0},D=(n,c,d)=>{if((!O||null!=d)&&n>=0&&(T.backfacesTerrain||h(d,s)<0)&&(T.invisibleTerrain||!T.selectionMode||null==t||t(i,r,n))){if((null==l.distance||n<l.distance)&&P(l,n,d),T.isFiltered)return;T.store===H.ALL&&(null==f?(f=new V(e.ray),P(f,n,d),e.results.all.push(f)):n<f.distance&&P(f,n,d)),(null==a.distance||n<a.distance)&&P(a,n,d),T.store!==H.MIN&&(null==o.distance||n>o.distance)&&P(o,n,d)}},S=pe;c(S,r,v);const{indices:C,indexCount:E}=x,j=x.vertexAttributes,A=j.getField($.POSITION,y),N=new k(A.typedBuffer,3,j.stride/4),B=E/3;if(!p&&B>I){const e=d.renderData;null==e.intersectionData&&(e.intersectionData=new U(C,0,B,N)),e.intersectionData.intersectRay(ge,S,R,D)}else K(ge,S,0,B,C,N,p,R,D)},v=this._rootTiles;if(null!=v){(()=>{const t=this._tileIterator;t.reset(v);const r=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||r&&e.intersectsClippingArea)||null==p&&!e.intersectsRay(i,s,_,m)||g&&this._useStencilForTile(e)?t.skipSubtree():x(e)})()}}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._visiblePatchesByOrigin.values())for(const i of t)null!=i.renderData?.textureReference&&e.queriesForTile(i);e.process(),t.madeProgress()}}acquireTechniques(e){const t=!!has("enable-feature:terrain-shadows")&&e.bind.shadowMap.enabled;t!==this._castShadows&&(this._castShadows=t,this._patchesByOriginDirty=!0);const i=e.bind.viewshedEnabled;if(this._inViewshed!==i&&(this._inViewshed=i,this._patchesByOriginDirty=!0),e.bind.slot===Z.OCCLUDED_GROUND){if(0===(e.renderOccludedMask&v))return null}else{const t=this.transparency===B.Opaque?Z.OPAQUE_TERRAIN:Z.TRANSPARENT_TERRAIN;if(e.bind.slot!==t)return null}if(this.transparency===B.Invisible)return null;const r=this._configuration;switch(r.screenSpaceReflections=r.cloudReflections=r.receiveShadows=r.receiveAmbientOcclusion=r.renderOccluded=r.hasHighlightMixTexture=!1,r.overlayMode=this._overlayRenderer.mode,e.output){case G.Color:case G.ColorEmission:{r.screenSpaceReflections=null!=e.bind.ssr.lastFrameColor,r.cloudReflections=null!=e.bind.clouds.data,r.receiveShadows=e.bind.shadowMap.ready;const t=e.bind.slot===Z.OCCLUDED_GROUND;return r.renderOccluded=t,r.receiveAmbientOcclusion=!t&&null!=e.bind.ssao,this._acquireTechnique(e.output)}case G.Shadow:case G.ShadowExcludeHighlight:return this._castShadows?this._acquireTechnique(G.Shadow):null;case G.ViewshedShadow:return this._inViewshed?this._acquireTechnique(G.ViewshedShadow):null;case G.Depth:case G.Normal:return this._acquireTechnique(e.output);case G.ObjectAndLayerIdColor:return this._acquireTechnique(G.ObjectAndLayerIdColor);case G.Highlight:return r.hasHighlightMixTexture=null!=e.bind.highlightMixTexture,this._overlayRenderer.hasHighlights?this._acquireTechnique(G.Highlight):null}return null}render(e,t){switch(this._updatePatchGroups(),t.useStencil=!1,e.output){case G.Color:case G.ColorEmission:{const i=e.bind.slot===Z.OCCLUDED_GROUND?x.Occluded:x.Color;this._renderMaterialPass(e,t,i);break}case G.Depth:case G.Normal:this._renderAuxiliaryPass(e,t,x.Color,this._visiblePatchesByOrigin);break;case G.Highlight:{const i=e.bind.highlight?.name;i&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(x.Highlight)&&this._overlayRenderer.hasHighlight(i)&&this._renderAuxiliaryPass(e,t,x.Highlight,this._visiblePatchesByOrigin);break}case G.Shadow:case G.ShadowExcludeHighlight:case G.ViewshedShadow:this._renderAuxiliaryPass(e,t,null,this._allPatchesByOrigin);break;case G.ObjectAndLayerIdColor:this._renderAuxiliaryPass(e,t,x.ObjectAndLayerIdColor,this._visiblePatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const i=this._tileRenderer;let r;if(null!=e){const i=t.toUnitRGBA(e);r=p(i[0]||0,i[1]||0,i[2]||0)}i.setBackground(r),this._allTiles.forAll((e=>i.updateTileTexture(e,O.FADING))),this._configuration.tileBlendInput=i.backgroundIsGrid?F.GridComposite:null!=i.backgroundColor?F.ColorComposite:F.LayerOnly,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty&&this.renderOrder!==P.NONE){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const i of e)A(this.renderOrder,i,t);e.sort(((e,t)=>N(e[0],t[0],this.renderOrder))),this._visiblePatchesByOrigin=new Map(e.map((e=>[e[0].renderData.localOrigin,e]))),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),i=e.renderData;if(!i){this._numTilesCulled++;continue}const r=i.localOrigin;if(this._castShadows||this._inViewshed){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let s=this._visiblePatchesByOrigin.get(r);s||(s=[],this._visiblePatchesByOrigin.set(r,s)),s.push(e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,i,r){const s=e.rctx;this._passParameters.overlayContent=i,s.bindTechnique(t,e.bind,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;r.forEach((r=>{this._drawParameters.origin=r[0].renderData.localOrigin,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters);for(let s=0;s<r.length;s++)this._renderPatch(e,t,r[s],ae.TRIANGLES,n,i)})),e.rctx.bindVAO(null)}_renderMaterialPass(e,t,i){const{rctx:r}=e;this._passParameters.overlayContent=i,r.bindTechnique(t,e.bind,this._passParameters),this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const s=e.bind.camera,n=t.program;if(this._configuration.screenSizePerspective&&this.pointsOfInterest){const e=J(this._stage.viewingMode,this._ellipsoidRadius),t=this.pointsOfInterest.centerOnSurfaceFrequent.distance;e.update({distance:t,fovY:s.fovY})}const a=this._stencilEnabledLayerExtents.length>0,o=i===x.Occluded;o&&(n.bindTexture("tex",r.emptyTexture),n.setUniform3fv("textureOpacities",u),n.setUniform4fv("texOffsetAndScale",f));const l=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:u;this._configuration.tileBlendInput===F.ColorComposite&&n.setUniform3fv("backgroundColor",l);const c=this.wireframe?ae.LINES:ae.TRIANGLES;this._configuration.textureFadingEnabled&&n.bindTexture("texNext",r.emptyTexture);const d=this._visiblePatchesByOrigin;for(const h of d.values()){const r=h[0].renderData.localOrigin;this._drawParameters.origin=r,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const s of h){const r=s.renderData,l=r.textureReference;if(null!=l){if(!o){n.setUniform4fv("texOffsetAndScale",l.offsetAndScale),n.bindTexture("tex",l.texture.texture);const e=r.textureFadeFactor,t=e<1?r.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(n.setUniform1f("fadeFactor",e),n.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),n.setUniform3fv("nextTexOpacities",t.opacities),n.bindTexture("texNext",t.texture.texture)):n.setUniform1f("fadeFactor",1),r.textureIsFading&&this.setNeedsRender(),n.setUniform3fv("textureOpacities",l.opacities)}this._renderPatch(e,t,s,c,a,i),s.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}e.rctx.bindVAO(null)}_renderPatch(e,t,i,r,s,n){const a=i.renderData,o=a.vao,l=o?.indexBuffer;if(!o||null==l)return void(S&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const c=t.program;null==n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(c,a.overlay),s&&(t.useStencil=this._useStencilForTile(i),e.rctx.setPipelineState(t.getPipeline()));const d=a.geometry.indexCount;e.rctx.bindVAO(o),c.assertCompatibleVertexAttributeLocations(o),e.rctx.drawElements(r,d,l.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(se,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([o({readOnly:!0})],de.prototype,"_isGlobal",null),e([o()],de.prototype,"renderOccludedFlags",void 0),e([o({value:!1})],de.prototype,"renderingDisabled",null),e([o({value:!0})],de.prototype,"visible",null),e([o()],de.prototype,"renderPatchBorders",null),e([o()],de.prototype,"visualizeNormals",null),e([o()],de.prototype,"cullBackFaces",null),e([o({value:P.FRONT_TO_BACK})],de.prototype,"renderOrder",null),e([o()],de.prototype,"wireframe",null),de=e([l("esri.views.3d.terrain.TerrainRenderer")],de);const he=g(),ue=g(),ge=g(),pe=g();export{de as TerrainRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{invert as t,transpose as r}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as o}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{q as s,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{EmissiveSourceMode as p}from"../../../../../../symbols/support/materialUtils.js";import{ColorMixModeEnum as c}from"../../../../layers/support/symbolColorUtils.js";import{OverlayContent as d}from"../../../../terrain/OverlayContent.js";import{ComponentTechnique as m}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as g,IntegratedMeshMode as f}from"./ComponentTechniqueConfiguration.js";import{ComponentDataType as x}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as v}from"./shader/VertexDiscardMode.js";import{parameter as M,parameterBlock as b,MaterialBase as y,MaterialParameterBlock as T}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as O}from"../../../core/renderPasses/RenderPassIdentifier.js";import{ShaderOutput as C,isColorEmission as S}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalType as w}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{EmissionSource as N}from"../../../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as P}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as j}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as D}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{TwoVectorPosition as q}from"../../../core/util/TwoVectorPosition.js";import{AlphaDiscardMode as A,CullFaceOptions as R}from"../../../lib/basicInterfaces.js";import{OITPass as I}from"../../../lib/OITPass.js";import{advancedMRRFactors as E}from"../../../materials/pbrUtils.js";import{defaultHighlightName as F}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as B}from"../../../../../../webscene/support/AlphaCutoff.js";class W extends y{constructor(e,s){super(),this.toMapSpace=s,this.baseColor=h(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=E,this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.normalTexture=null,this.occlusionTexture=null,this.emissionTexture=null,this.emissiveBaseColor=a(0,0,0),this.emissiveStrength=1,this.emissiveSource=p.Emissive,this.commonMaterialParameters=new H,this.componentParameters=new V,this.objectOpacity=1,this.textureAlphaCutoff=B,this.alphaDiscardMode=A.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=D.Earth,this.hasOccludees=!1;const i=new q(e.position),l=o(e.rotationScale);t(l,l),r(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 hasEmissions(){return null!=this.emissionTexture||!s(this.emissiveBaseColor,l)}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,r,o){const s=new g(e.context.spherical);s.hasVertexColors=o.colors,s.hasNormals=o.hasNormals,s.textureCoordinateType=o.textureCoordinates,s.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,s.hasOcclusionTexture=null!=this.occlusionTexture,s.hasNormalTexture=null!=this.normalTexture,s.oitPass=t.identifier===O.Material&&null!=r.oitPass?r.oitPass:I.NONE,s.terrainDepthTest=t.identifier===O.Material&&r.terrainDepthTest,s.cullAboveTerrain=t.identifier===O.Material&&r.cullAboveTerrain,s.ellipsoidMode=this.ellipsoidMode,s.componentData=this.componentParameters.type,s.cullFace=this.commonMaterialParameters.cullFace,s.doubleSidedMode=this.commonMaterialParameters.doubleSided?P.View:P.None,s.hasColorTexture=null!=this.baseColorTexture;const i=this._computeWhichMaterialPass();if(s.blendingEnabled=i===k.Transparent||i===k.OpaqueAndTransparent,s.alphaDiscardMode=this.alphaDiscardMode,s.integratedMeshMode=this.isIntegratedMesh?G(r)?z(r)?f.ColorOverlayWithWater:f.ColorOverlay:f.NoOverlay:f.None,s.hasPolygonOffset=this.polygonOffsetEnabled,s.pbrMode=s.integratedMeshMode===f.ColorOverlayWithWater?j.WaterOnIntegratedMesh:this.usePBR?this.hasParametersFromSource?o.shadeNormals&&this.isIntegratedMesh?j.Disabled:j.Schematic:j.Normal:j.Disabled,s.emissionSource=this.hasEmissions?null!=this.emissionTexture?N.Texture:s.pbrMode===j.Normal?N.SymbolColor:N.None:N.None,s.shadeNormals=o.shadeNormals,s.normalType=s.hasNormals?w.Compressed:w.ScreenDerivative,s.hasSlicePlane=null!=r.slicePlane&&this.commonMaterialParameters.hasSlicePlane,s.receiveAmbientOcclusion=s.hasOccludees=s.receiveShadows=s.screenSpaceReflections=s.cloudReflections=s.hasHighlightMixTexture=!1,t.identifier===O.ShadowMap)s.output=C.Shadow,s.vertexDiscardMode=v.None;else if(t.identifier===O.ViewshedShadowMap)s.output=C.ViewshedShadow,s.vertexDiscardMode=v.None;else if(t.identifier===O.Highlight)s.output=C.Highlight,s.vertexDiscardMode=v.None,s.hasHighlightMixTexture=null!=r.highlightMixTexture;else{switch(i===k.OpaqueAndTransparent?s.vertexDiscardMode=t.transparent?v.Opaque:v.Transparent:s.vertexDiscardMode=v.None,s.hasBloom=S(t.output),s.output=t.output,t.output){case C.Color:case C.ColorEmission:s.receiveAmbientOcclusion=o.applySSAO&&null!=r.ssao?.getTexture(),s.hasOccludees=r.hasOccludees,s.receiveShadows=r.shadowMap.ready,s.screenSpaceReflections=null!=r.ssr.lastFrameColor,s.cloudReflections=null!=r.clouds.data?.cubeMap?.colorTexture;break;case C.ObjectAndLayerIdColor:s.objectAndLayerIdColor=!0}s.snowCover=r.snowCover}const a=e.get(m,s);return this._setClean(),a}submit(e,t,r){if(this.objectOpacity<=0)return;const{componentData:o,renderable:s}=r,{geometry:i}=s,a=s.meta.cameraDepthSquared;o.updateHighlights(t.highlights);const{geometryRanges:l,highlightRangesMap:n,shadowmapRanges:h}=o;switch(this._computeWhichMaterialPass()){case k.Opaque:e.opaque.submitDraw(this,i,l,a);break;case k.Transparent:e.transparent.submitDraw(this,i,l,a);break;case k.OpaqueAndTransparent:e.opaque.submitDraw(this,i,l,a),e.transparent.submitDraw(this,i,l,a);break;case k.IntegratedMesh:e.integratedMesh.submitDraw(this,i,l,a),U(t)&&e.highlightIntegratedMesh.submitDraw(this,i,l,a)}if(this.componentParameters.castShadows!==L.None){if(null!=n)for(const t of n)t[0]===F&&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)return k.IntegratedMesh;if(this.objectOpacity<1)return k.Transparent;if(this.componentParameters.opaqueOverride===L.All)return k.Opaque;if(this.baseColor[3]<1||this.alphaDiscardMode===A.Blend||this.alphaDiscardMode===A.MaskBlend)return k.Transparent;switch(this.componentParameters.transparent){case L.None:return k.Opaque;case L.All:return k.Transparent;case L.Some:return k.OpaqueAndTransparent}}}var k,L;e([M({vectorOps:n})],W.prototype,"baseColor",void 0),e([M()],W.prototype,"usePBR",void 0),e([M()],W.prototype,"hasParametersFromSource",void 0),e([M({vectorOps:i})],W.prototype,"mrrFactors",void 0),e([M({dispose:!0})],W.prototype,"baseColorTexture",void 0),e([M({dispose:!0})],W.prototype,"metallicRoughnessTexture",void 0),e([M({dispose:!0})],W.prototype,"normalTexture",void 0),e([M({dispose:!0})],W.prototype,"occlusionTexture",void 0),e([M({dispose:!0})],W.prototype,"emissionTexture",void 0),e([M({vectorOps:i})],W.prototype,"emissiveBaseColor",void 0),e([M()],W.prototype,"emissiveStrength",void 0),e([M()],W.prototype,"emissiveSource",void 0),e([b()],W.prototype,"commonMaterialParameters",void 0),e([b()],W.prototype,"componentParameters",void 0),e([M()],W.prototype,"objectOpacity",void 0),e([M()],W.prototype,"textureAlphaCutoff",void 0),e([M()],W.prototype,"alphaDiscardMode",void 0),e([M()],W.prototype,"isIntegratedMesh",void 0),e([M()],W.prototype,"polygonOffsetEnabled",void 0),e([M()],W.prototype,"ellipsoidMode",void 0),e([M()],W.prototype,"hasOccludees",void 0),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(k||(k={}));class H extends T{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=R.Back,this.hasSlicePlane=!0}}e([M()],H.prototype,"doubleSided",void 0),e([M()],H.prototype,"cullFace",void 0),e([M()],H.prototype,"hasSlicePlane",void 0);class V extends T{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=c.Multiply,this.castShadows=L.All}get transparent(){return this.externalColor[3]<1?L.All:L.None}get opaqueOverride(){return this.externalColorMixMode===c.Replace&&1===this.externalColor[3]?L.All:L.None}get visible(){return this.externalColor[3]>0?L.All:L.None}get type(){return x.Uniform}}e([M({vectorOps:n})],V.prototype,"externalColor",void 0),e([M()],V.prototype,"externalColorMixMode",void 0),e([M()],V.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(L||(L={}));class _ extends T{constructor(){super(...arguments),this.texture=null,this.transparent=L.None,this.opaqueOverride=L.None,this.castShadows=L.None}get type(){return x.Varying}}function U(e){return null!=e.overlay?.getTexture(d.Highlight)}function z(e){return null!=e.overlay?.getTexture(d.WaterNormal)}function G(e){return null!=e.overlay?.getTexture(d.ColorNoRasterImage)}e([M()],_.prototype,"texture",void 0),e([M()],_.prototype,"transparent",void 0),e([M()],_.prototype,"opaqueOverride",void 0),e([M()],_.prototype,"castShadows",void 0);export{H as CommonMaterialParameters,W as ComponentMaterial,L as ComponentParameterSummary,V as ComponentParametersUniform,_ as ComponentParametersVarying};
5
+ import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{invert as t,transpose as r}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as o}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{q as s,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 u,fromValues as h}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{EmissiveSourceMode as p}from"../../../../../../symbols/support/materialUtils.js";import{ColorMixModeEnum as c}from"../../../../layers/support/symbolColorUtils.js";import{OverlayContent as d}from"../../../../terrain/OverlayContent.js";import{ComponentTechnique as m}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as g,IntegratedMeshMode as f}from"./ComponentTechniqueConfiguration.js";import{ComponentDataType as x}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as v}from"./shader/VertexDiscardMode.js";import{parameter as b,parameterBlock as M,MaterialBase as y,MaterialParameterBlock as T}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as O}from"../../../core/renderPasses/RenderPassIdentifier.js";import{ShaderOutput as C,isColorEmission as S}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalType as w}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{EmissionSource as D}from"../../../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as N}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as j}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as P}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{TwoVectorPosition as q}from"../../../core/util/TwoVectorPosition.js";import{AlphaDiscardMode as A,CullFaceOptions as R}from"../../../lib/basicInterfaces.js";import{OITPass as I}from"../../../lib/OITPass.js";import{RenderSlot as E}from"../../../lib/RenderSlot.js";import{advancedMRRFactors as F}from"../../../materials/pbrUtils.js";import{defaultHighlightName as B}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as W}from"../../../../../../webscene/support/AlphaCutoff.js";class L extends y{constructor(e,s){super(),this.toMapSpace=s,this.baseColor=u(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=F,this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.normalTexture=null,this.occlusionTexture=null,this.emissionTexture=null,this.emissiveBaseColor=a(0,0,0),this.emissiveStrength=1,this.emissiveSource=p.Emissive,this.commonMaterialParameters=new V,this.componentParameters=new U,this.objectOpacity=1,this.textureAlphaCutoff=W,this.alphaDiscardMode=A.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=P.Earth,this.hasOccludees=!1;const i=new q(e.position),l=o(e.rotationScale);t(l,l),r(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 hasEmissions(){return null!=this.emissionTexture||!s(this.emissiveBaseColor,l)}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,r,o){const s=new g(e.context.spherical);s.renderOccluded=r.slot===E.OCCLUDED_GROUND,s.hasVertexColors=o.colors,s.hasNormals=o.hasNormals,s.textureCoordinateType=o.textureCoordinates,s.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,s.hasOcclusionTexture=null!=this.occlusionTexture,s.hasNormalTexture=null!=this.normalTexture,s.oitPass=t.identifier===O.Material&&null!=r.oitPass?r.oitPass:I.NONE,s.terrainDepthTest=t.identifier===O.Material&&r.terrainDepthTest,s.cullAboveTerrain=t.identifier===O.Material&&r.cullAboveTerrain,s.ellipsoidMode=this.ellipsoidMode,s.componentData=this.componentParameters.type,s.cullFace=this.commonMaterialParameters.cullFace,s.doubleSidedMode=this.commonMaterialParameters.doubleSided?N.View:N.None,s.hasColorTexture=null!=this.baseColorTexture;const i=this._computeWhichMaterialPass();if(s.blendingEnabled=i===k.Transparent||i===k.OpaqueAndTransparent,s.alphaDiscardMode=this.alphaDiscardMode,s.integratedMeshMode=this.isIntegratedMesh?J(r)?z(r)?f.ColorOverlayWithWater:f.ColorOverlay:f.NoOverlay:f.None,s.hasPolygonOffset=this.polygonOffsetEnabled,s.pbrMode=s.integratedMeshMode===f.ColorOverlayWithWater?j.WaterOnIntegratedMesh:this.usePBR?this.hasParametersFromSource?o.shadeNormals&&this.isIntegratedMesh?j.Disabled:j.Schematic:j.Normal:j.Disabled,s.emissionSource=this.hasEmissions?null!=this.emissionTexture?D.Texture:s.pbrMode===j.Normal?D.SymbolColor:D.None:D.None,s.shadeNormals=o.shadeNormals,s.normalType=s.hasNormals?w.Compressed:w.ScreenDerivative,s.hasSlicePlane=null!=r.slicePlane&&this.commonMaterialParameters.hasSlicePlane,s.receiveAmbientOcclusion=s.hasOccludees=s.receiveShadows=s.screenSpaceReflections=s.cloudReflections=s.hasHighlightMixTexture=!1,t.identifier===O.ShadowMap)s.output=C.Shadow,s.vertexDiscardMode=v.None;else if(t.identifier===O.ViewshedShadowMap)s.output=C.ViewshedShadow,s.vertexDiscardMode=v.None;else if(t.identifier===O.Highlight)s.output=C.Highlight,s.vertexDiscardMode=v.None,s.hasHighlightMixTexture=null!=r.highlightMixTexture;else{switch(i===k.OpaqueAndTransparent?s.vertexDiscardMode=t.transparent?v.Opaque:v.Transparent:s.vertexDiscardMode=v.None,s.hasBloom=S(t.output),s.output=t.output,t.output){case C.Color:case C.ColorEmission:s.receiveAmbientOcclusion=o.applySSAO&&null!=r.ssao?.getTexture(),s.hasOccludees=r.hasOccludees,s.receiveShadows=r.shadowMap.ready,s.screenSpaceReflections=null!=r.ssr.lastFrameColor,s.cloudReflections=null!=r.clouds.data?.cubeMap?.colorTexture;break;case C.ObjectAndLayerIdColor:s.objectAndLayerIdColor=!0}s.snowCover=r.snowCover}const a=e.get(m,s);return this._setClean(),a}submit(e,t,r){if(this.objectOpacity<=0)return;const{componentData:o,renderable:s}=r,{geometry:i}=s,a=s.meta.cameraDepthSquared;o.updateHighlights(t.highlights);const{geometryRanges:l,highlightRangesMap:n,shadowmapRanges:u}=o;switch(this._computeWhichMaterialPass()){case k.Opaque:e.opaque.submitDraw(this,i,l,a);break;case k.Transparent:e.transparent.submitDraw(this,i,l,a);break;case k.OpaqueAndTransparent:e.opaque.submitDraw(this,i,l,a),e.transparent.submitDraw(this,i,l,a);break;case k.IntegratedMesh:e.integratedMesh.submitDraw(this,i,l,a),K(t)&&e.occludedGround.submitDraw(this,i,l,a),G(t)&&e.highlightIntegratedMesh.submitDraw(this,i,l,a)}if(this.componentParameters.castShadows!==H.None){if(null!=n)for(const t of n)t[0]===B&&e.highlightShadowMap.submitDraw(this,i,t[1],a,t[0]);null!=u&&e.defaultShadowMap.submitDraw(this,i,u,a),e.shadowMap.submitDraw(this,i,l,a)}if(null!=n)for(const h of n)e.highlight.submitDraw(this,i,h[1],a,h[0]);t.viewshedEnabled&&e.viewshedShadowMap.submitDraw(this,i,l,a)}_computeWhichMaterialPass(){if(this.isIntegratedMesh)return k.IntegratedMesh;if(this.objectOpacity<1)return k.Transparent;if(this.componentParameters.opaqueOverride===H.All)return k.Opaque;if(this.baseColor[3]<1||this.alphaDiscardMode===A.Blend||this.alphaDiscardMode===A.MaskBlend)return k.Transparent;switch(this.componentParameters.transparent){case H.None:return k.Opaque;case H.All:return k.Transparent;case H.Some:return k.OpaqueAndTransparent}}}var k,H;e([b({vectorOps:n})],L.prototype,"baseColor",void 0),e([b()],L.prototype,"usePBR",void 0),e([b()],L.prototype,"hasParametersFromSource",void 0),e([b({vectorOps:i})],L.prototype,"mrrFactors",void 0),e([b({dispose:!0})],L.prototype,"baseColorTexture",void 0),e([b({dispose:!0})],L.prototype,"metallicRoughnessTexture",void 0),e([b({dispose:!0})],L.prototype,"normalTexture",void 0),e([b({dispose:!0})],L.prototype,"occlusionTexture",void 0),e([b({dispose:!0})],L.prototype,"emissionTexture",void 0),e([b({vectorOps:i})],L.prototype,"emissiveBaseColor",void 0),e([b()],L.prototype,"emissiveStrength",void 0),e([b()],L.prototype,"emissiveSource",void 0),e([M()],L.prototype,"commonMaterialParameters",void 0),e([M()],L.prototype,"componentParameters",void 0),e([b()],L.prototype,"objectOpacity",void 0),e([b()],L.prototype,"textureAlphaCutoff",void 0),e([b()],L.prototype,"alphaDiscardMode",void 0),e([b()],L.prototype,"isIntegratedMesh",void 0),e([b()],L.prototype,"polygonOffsetEnabled",void 0),e([b()],L.prototype,"ellipsoidMode",void 0),e([b()],L.prototype,"hasOccludees",void 0),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(k||(k={}));class V extends T{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=R.Back,this.hasSlicePlane=!0}}e([b()],V.prototype,"doubleSided",void 0),e([b()],V.prototype,"cullFace",void 0),e([b()],V.prototype,"hasSlicePlane",void 0);class U extends T{constructor(){super(...arguments),this.externalColor=h(1,1,1,1),this.externalColorMixMode=c.Multiply,this.castShadows=H.All}get transparent(){return this.externalColor[3]<1?H.All:H.None}get opaqueOverride(){return this.externalColorMixMode===c.Replace&&1===this.externalColor[3]?H.All:H.None}get visible(){return this.externalColor[3]>0?H.All:H.None}get type(){return x.Uniform}}e([b({vectorOps:n})],U.prototype,"externalColor",void 0),e([b()],U.prototype,"externalColorMixMode",void 0),e([b()],U.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(H||(H={}));class _ extends T{constructor(){super(...arguments),this.texture=null,this.transparent=H.None,this.opaqueOverride=H.None,this.castShadows=H.None}get type(){return x.Varying}}function G(e){return null!=e.overlay?.getTexture(d.Highlight)}function z(e){return null!=e.overlay?.getTexture(d.WaterNormal)}function J(e){return null!=e.overlay?.getTexture(d.ColorNoRasterImage)}function K(e){return null!=e.overlay?.getTexture(d.Occluded)}e([b()],_.prototype,"texture",void 0),e([b()],_.prototype,"transparent",void 0),e([b()],_.prototype,"opaqueOverride",void 0),e([b()],_.prototype,"castShadows",void 0);export{V as CommonMaterialParameters,L as ComponentMaterial,H as ComponentParameterSummary,U as ComponentParametersUniform,_ 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{IntegratedMeshMode as e}from"./ComponentTechniqueConfiguration.js";import{C as r}from"../../../../../../chunks/ComponentShader.glsl.js";import{isColorOrColorEmission as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as o}from"../../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as n,depthOnlyOutputBuffersOr as s}from"../../../core/shaderTechnique/ShaderTechnique.js";import{StencilBits as i}from"../../../lib/basicInterfaces.js";import{OITPass as l}from"../../../lib/OITPass.js";import{OITPolygonOffset as a,oitDepthTest as c,blending as d,getDrawBuffers as u}from"../../../lib/OrderIndependentTransparency.js";import{replaceBitWhenDepthTestPasses as m,stencilBaseAllZerosParams as p,stencilWriteMaskOn as f}from"../../../lib/StencilUtils.js";import{VertexAttribute as h}from"../../../lib/VertexAttribute.js";import{makePipelineState as O,defaultColorWrite as b,defaultDepthWrite as j,cullingParams as g}from"../../../../../webgl/renderState.js";class M extends n{constructor(e,t){super(e,t,new o(r,(()=>import("./shader/ComponentShader.glsl.js"))),N)}initializePipeline(r){const{integratedMeshMode:o,output:n,blendingEnabled:h,cullFace:M,hasOccludees:N,hasPolygonOffset:S,oitPass:T}=r,C=o!==e.None,E=T===l.NONE,I=T===l.FrontFace;return O({blending:t(n)&&h?d(T):null,culling:g(M),depthTest:{func:c(T)},depthWrite:E||I?j:null,drawBuffers:s(n,u(T,n)),colorWrite:b,stencilWrite:C||N?f:null,stencilTest:C?m(i.IntegratedMeshMaskExcluded):N?p:null,polygonOffset:E||I?S?{factor:2,units:2}:null:a})}}const N=new Map([[h.POSITION,0],[h.NORMAL,1],[h.NORMALCOMPRESSED,1],[h.COLOR,2],[h.UV0,3],[h.UVREGION,4],[h.COMPONENTINDEX,5]]);export{M as ComponentTechnique,N as vertexAttributeLocations};
5
+ import{IntegratedMeshMode as e}from"./ComponentTechniqueConfiguration.js";import{C as r}from"../../../../../../chunks/ComponentShader.glsl.js";import{isColorOrColorEmission as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as n}from"../../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o,depthOnlyOutputBuffersOr as s}from"../../../core/shaderTechnique/ShaderTechnique.js";import{StencilBits as i}from"../../../lib/basicInterfaces.js";import{OITPass as l}from"../../../lib/OITPass.js";import{OITPolygonOffset as a,oitDepthTest as c,blending as d,getDrawBuffers as u}from"../../../lib/OrderIndependentTransparency.js";import{replaceBitWhenDepthTestPasses as m,stencilBaseAllZerosParams as p,stencilWriteMaskOn as f}from"../../../lib/StencilUtils.js";import{VertexAttribute as h}from"../../../lib/VertexAttribute.js";import{makePipelineState as O,defaultColorWrite as b,defaultDepthWrite as j,cullingParams as g,premultipliedAlpha as M}from"../../../../../webgl/renderState.js";class N extends o{constructor(e,t){super(e,t,new n(r,(()=>import("./shader/ComponentShader.glsl.js"))),S)}initializePipeline(r){const{integratedMeshMode:n,output:o,blendingEnabled:h,cullFace:N,hasOccludees:S,hasPolygonOffset:T,oitPass:C,renderOccluded:E}=r,I=n!==e.None,P=C===l.NONE,R=C===l.FrontFace;return O({blending:E?M:t(o)&&h?d(C):null,culling:g(N),depthTest:E?null:{func:c(C)},depthWrite:E||!P&&!R?null:j,drawBuffers:s(o,u(C,o)),colorWrite:b,stencilWrite:!E&&I||S?f:null,stencilTest:I?m(i.IntegratedMeshMaskExcluded):S?p:null,polygonOffset:P||R?T?{factor:2,units:2}:null:a})}}const S=new Map([[h.POSITION,0],[h.NORMAL,1],[h.NORMALCOMPRESSED,1],[h.COLOR,2],[h.UV0,3],[h.UVREGION,4],[h.COMPONENTINDEX,5]]);export{N as ComponentTechnique,S as vertexAttributeLocations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../../../../../chunks/tslib.es6.js";import{ComponentDataType as e}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as t}from"./shader/VertexDiscardMode.js";import{ShaderOutput as r,isColorEmissionHighlightOrOID as i}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalType as s}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateType as a}from"../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{EmissionSource as d}from"../../../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as h}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as p}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as l}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{parameter as n,ShaderTechniqueConfiguration as c}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as u,AlphaDiscardMode as y}from"../../../lib/basicInterfaces.js";import{OITPass as m}from"../../../lib/OITPass.js";import{BindType as v}from"../../../../../webgl/BindType.js";var T;!function(o){o[o.None=0]="None",o[o.NoOverlay=1]="NoOverlay",o[o.ColorOverlay=2]="ColorOverlay",o[o.ColorOverlayWithWater=3]="ColorOverlayWithWater",o[o.COUNT=4]="COUNT"}(T||(T={}));class C extends c{constructor(o){super(),this.spherical=o,this.output=r.Color,this.textureCoordinateType=a.None,this.componentData=e.Uniform,this.cullFace=u.Back,this.vertexDiscardMode=t.None,this.doubleSidedMode=h.WindingOrder,this.alphaDiscardMode=y.Opaque,this.integratedMeshMode=T.None,this.oitPass=m.NONE,this.ellipsoidMode=l.Earth,this.pbrMode=p.Disabled,this.normalType=s.Attribute,this.emissionSource=d.None,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.objectAndLayerIdColor=!1,this.hasBloom=!1,this.discardInvisibleFragments=!1,this.occlusionPass=!1,this.bindType=v.Draw,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.highStepCount=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.objectAndLayerIdColorInstanced=!1,this.draped=!1}get overlayEnabled(){return(this.integratedMeshMode===T.ColorOverlay||this.integratedMeshMode===T.ColorOverlayWithWater)&&i(this.output)}}o([n({count:r.COUNT})],C.prototype,"output",void 0),o([n({count:a.COUNT})],C.prototype,"textureCoordinateType",void 0),o([n({count:e.COUNT})],C.prototype,"componentData",void 0),o([n({count:u.COUNT})],C.prototype,"cullFace",void 0),o([n({count:t.COUNT})],C.prototype,"vertexDiscardMode",void 0),o([n({count:h.COUNT})],C.prototype,"doubleSidedMode",void 0),o([n({count:y.COUNT})],C.prototype,"alphaDiscardMode",void 0),o([n({count:T.COUNT})],C.prototype,"integratedMeshMode",void 0),o([n({count:m.COUNT})],C.prototype,"oitPass",void 0),o([n({count:l.COUNT})],C.prototype,"ellipsoidMode",void 0),o([n({count:p.COUNT})],C.prototype,"pbrMode",void 0),o([n({count:s.COUNT})],C.prototype,"normalType",void 0),o([n({count:d.COUNT})],C.prototype,"emissionSource",void 0),o([n()],C.prototype,"hasVertexColors",void 0),o([n()],C.prototype,"hasNormals",void 0),o([n()],C.prototype,"shadeNormals",void 0),o([n()],C.prototype,"hasSlicePlane",void 0),o([n()],C.prototype,"hasColorTexture",void 0),o([n()],C.prototype,"hasHighlightMixTexture",void 0),o([n()],C.prototype,"receiveAmbientOcclusion",void 0),o([n()],C.prototype,"receiveShadows",void 0),o([n()],C.prototype,"blendingEnabled",void 0),o([n()],C.prototype,"screenSpaceReflections",void 0),o([n()],C.prototype,"hasPolygonOffset",void 0),o([n()],C.prototype,"hasMetallicRoughnessTexture",void 0),o([n()],C.prototype,"hasOcclusionTexture",void 0),o([n()],C.prototype,"hasNormalTexture",void 0),o([n()],C.prototype,"hasOccludees",void 0),o([n()],C.prototype,"terrainDepthTest",void 0),o([n()],C.prototype,"cullAboveTerrain",void 0),o([n()],C.prototype,"hasNormalTextureTransform",void 0),o([n()],C.prototype,"cloudReflections",void 0),o([n()],C.prototype,"snowCover",void 0),o([n()],C.prototype,"objectAndLayerIdColor",void 0),o([n()],C.prototype,"hasBloom",void 0);export{C as ComponentTechniqueConfiguration,T as IntegratedMeshMode};
5
+ import{_ as o}from"../../../../../../chunks/tslib.es6.js";import{ComponentDataType as e}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as t}from"./shader/VertexDiscardMode.js";import{ShaderOutput as r,isColorEmissionHighlightOrOID as i}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalType as s}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateType as a}from"../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{EmissionSource as d}from"../../../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as h}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as p}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as l}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{parameter as n,ShaderTechniqueConfiguration as c}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as u,AlphaDiscardMode as y}from"../../../lib/basicInterfaces.js";import{OITPass as m}from"../../../lib/OITPass.js";import{BindType as v}from"../../../../../webgl/BindType.js";var T;!function(o){o[o.None=0]="None",o[o.NoOverlay=1]="NoOverlay",o[o.ColorOverlay=2]="ColorOverlay",o[o.ColorOverlayWithWater=3]="ColorOverlayWithWater",o[o.COUNT=4]="COUNT"}(T||(T={}));class C extends c{constructor(o){super(),this.spherical=o,this.output=r.Color,this.textureCoordinateType=a.None,this.componentData=e.Uniform,this.cullFace=u.Back,this.vertexDiscardMode=t.None,this.doubleSidedMode=h.WindingOrder,this.alphaDiscardMode=y.Opaque,this.integratedMeshMode=T.None,this.oitPass=m.NONE,this.ellipsoidMode=l.Earth,this.pbrMode=p.Disabled,this.normalType=s.Attribute,this.emissionSource=d.None,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.objectAndLayerIdColor=!1,this.hasBloom=!1,this.renderOccluded=!1,this.discardInvisibleFragments=!1,this.occlusionPass=!1,this.bindType=v.Draw,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.highStepCount=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.objectAndLayerIdColorInstanced=!1,this.draped=!1}get overlayEnabled(){return(this.integratedMeshMode===T.ColorOverlay||this.integratedMeshMode===T.ColorOverlayWithWater)&&i(this.output)}}o([n({count:r.COUNT})],C.prototype,"output",void 0),o([n({count:a.COUNT})],C.prototype,"textureCoordinateType",void 0),o([n({count:e.COUNT})],C.prototype,"componentData",void 0),o([n({count:u.COUNT})],C.prototype,"cullFace",void 0),o([n({count:t.COUNT})],C.prototype,"vertexDiscardMode",void 0),o([n({count:h.COUNT})],C.prototype,"doubleSidedMode",void 0),o([n({count:y.COUNT})],C.prototype,"alphaDiscardMode",void 0),o([n({count:T.COUNT})],C.prototype,"integratedMeshMode",void 0),o([n({count:m.COUNT})],C.prototype,"oitPass",void 0),o([n({count:l.COUNT})],C.prototype,"ellipsoidMode",void 0),o([n({count:p.COUNT})],C.prototype,"pbrMode",void 0),o([n({count:s.COUNT})],C.prototype,"normalType",void 0),o([n({count:d.COUNT})],C.prototype,"emissionSource",void 0),o([n()],C.prototype,"hasVertexColors",void 0),o([n()],C.prototype,"hasNormals",void 0),o([n()],C.prototype,"shadeNormals",void 0),o([n()],C.prototype,"hasSlicePlane",void 0),o([n()],C.prototype,"hasColorTexture",void 0),o([n()],C.prototype,"hasHighlightMixTexture",void 0),o([n()],C.prototype,"receiveAmbientOcclusion",void 0),o([n()],C.prototype,"receiveShadows",void 0),o([n()],C.prototype,"blendingEnabled",void 0),o([n()],C.prototype,"screenSpaceReflections",void 0),o([n()],C.prototype,"hasPolygonOffset",void 0),o([n()],C.prototype,"hasMetallicRoughnessTexture",void 0),o([n()],C.prototype,"hasOcclusionTexture",void 0),o([n()],C.prototype,"hasNormalTexture",void 0),o([n()],C.prototype,"hasOccludees",void 0),o([n()],C.prototype,"terrainDepthTest",void 0),o([n()],C.prototype,"cullAboveTerrain",void 0),o([n()],C.prototype,"hasNormalTextureTransform",void 0),o([n()],C.prototype,"cloudReflections",void 0),o([n()],C.prototype,"snowCover",void 0),o([n()],C.prototype,"objectAndLayerIdColor",void 0),o([n()],C.prototype,"hasBloom",void 0),o([n()],C.prototype,"renderOccluded",void 0);export{C as ComponentTechniqueConfiguration,T as IntegratedMeshMode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderPass as s,RenderPassSorting as e}from"./RenderPass.js";import{RenderPassIdentifier as i}from"./RenderPassIdentifier.js";import{ShaderOutput as r}from"../shaderLibrary/ShaderOutput.js";import{VertexNormalPassParameters as a,VertexNormalDrawParameters as n}from"../shaderLibrary/attributes/VertexNormal.glsl.js";class h{constructor(t){const i=t.renderContext.rctx,r=t.techniques;this.opaque=new s(i,r),this.transparent=new s(i,r,e.BackToFront),this.integratedMesh=new s(i,r),this.shadowMap=new s(i,r),this.highlight=new s(i,r),this.highlightIntegratedMesh=new s(i,r),this.highlightShadowMap=new s(i,r),this.viewshedShadowMap=new s(i,r),this.defaultShadowMap=new s(i,r)}}class o extends a{constructor(){super(...arguments),this.slicePlaneLocalOrigin=t(),this.origin=this.slicePlaneLocalOrigin}}class c extends n{}class d extends o{constructor(){super(...arguments),this.identifier=i.Material,this.output=r.Color,this.transparent=!1}}class l extends o{constructor(){super(...arguments),this.identifier=i.ShadowMap}}class p extends o{constructor(){super(...arguments),this.identifier=i.Highlight}}class u extends o{constructor(){super(...arguments),this.identifier=i.ViewshedShadowMap}}export{h as AllRenderPasses,c as DrawParameters,p as HighlightPassParameters,d as MaterialPassParameters,o as PassParameters,l as ShadowMapPassParameters,u as ViewshedShadowMapPassParameters};
5
+ import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderPass as e,RenderPassSorting as s}from"./RenderPass.js";import{RenderPassIdentifier as i}from"./RenderPassIdentifier.js";import{ShaderOutput as r}from"../shaderLibrary/ShaderOutput.js";import{VertexNormalPassParameters as n,VertexNormalDrawParameters as a}from"../shaderLibrary/attributes/VertexNormal.glsl.js";class o{constructor(t){const i=t.renderContext.rctx,r=t.techniques;this.opaque=new e(i,r),this.transparent=new e(i,r,s.BackToFront),this.integratedMesh=new e(i,r),this.occludedGround=new e(i,r),this.shadowMap=new e(i,r),this.highlight=new e(i,r),this.highlightIntegratedMesh=new e(i,r),this.highlightShadowMap=new e(i,r),this.viewshedShadowMap=new e(i,r),this.defaultShadowMap=new e(i,r)}}class h extends n{constructor(){super(...arguments),this.slicePlaneLocalOrigin=t(),this.origin=this.slicePlaneLocalOrigin}}class c extends a{}class d extends h{constructor(){super(...arguments),this.identifier=i.Material,this.output=r.Color,this.transparent=!1}}class l extends h{constructor(){super(...arguments),this.identifier=i.ShadowMap}}class p extends h{constructor(){super(...arguments),this.identifier=i.Highlight}}class u extends h{constructor(){super(...arguments),this.identifier=i.ViewshedShadowMap}}export{o as AllRenderPasses,c as DrawParameters,p as HighlightPassParameters,d as MaterialPassParameters,h as PassParameters,l as ShadowMapPassParameters,u as ViewshedShadowMapPassParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as s}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as e}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as t,transpose as r,invert as a}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as o}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{i as h,c as n}from"../../../../../chunks/vec32.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MaterialPassParameters as c,ShadowMapPassParameters as l,HighlightPassParameters as u,ViewshedShadowMapPassParameters as p,AllRenderPasses as d}from"./AllRenderPasses.js";import{RenderPassIdentifier as _}from"./RenderPassIdentifier.js";import{ShaderOutput as P}from"../shaderLibrary/ShaderOutput.js";import{TwoVectorPosition as g}from"../util/TwoVectorPosition.js";import{SyncRenderPlugin as w}from"../../effects/RenderPlugin.js";import{DepthRange as f}from"../../lib/DepthRange.js";import{RenderSlot as R}from"../../lib/RenderSlot.js";let E=class extends w{constructor(){super({}),this.produces=new Map([[R.OPAQUE_MATERIAL,s=>this._produces(s,R.OPAQUE_MATERIAL)],[R.TRANSPARENT_MATERIAL,s=>this._produces(s,R.TRANSPARENT_MATERIAL)],[R.INTEGRATED_MESH,s=>this._produces(s,R.INTEGRATED_MESH)]]),this._materialPassParameters=new c,this._shadowPassParameters=new l,this._highlightPassParameters=new u,this._viewshedPassParameters=new p,this._systems=new Set}initializeRenderContext(s){this._context=s,this._passes=new d(s)}get rctx(){return this._context.renderContext.rctx}uninitializeRenderContext(){}dispose(){this._context=null,this._systems.clear()}register(s){this._systems.add(s)}_produces(s,e){return!!this._invoke(s,e,(s=>s.count>0))}prepareRender(s){const{_systems:e,_passes:t}=this;if(0!==e.size&&null!=t){for(const s of Object.values(t))s.prepareSubmit();e.forEach((e=>e.submit(t,s.bind)));for(const s of Object.values(t))s.finishSubmit()}}acquireTechniques(s){if(0===this._systems.size)return null;const e=s.output===P.Shadow||s.output===P.ShadowHighlight||s.output===P.ShadowExcludeHighlight?this._shadowPassParameters:s.output===P.ViewshedShadow?this._viewshedPassParameters:s.output===P.Highlight?this._highlightPassParameters:this._materialPassParameters,t=s.bind;return this._updateParameters(t.camera,e,t.slot===R.TRANSPARENT_MATERIAL),this._materialPassParameters.output=s.output,this._invoke(s.output,s.bind.slot,((e,t)=>e.acquire(t,s.bind)))}render(s,e){this._invoke(s.output,s.bind.slot,((t,r)=>t.dispatch(r,s.bind,e)))}_invoke(s,e,t){if(null==this._passes)return null;switch(e){case R.OPAQUE_MATERIAL:switch(s){case P.Color:case P.ColorEmission:case P.Depth:case P.Normal:case P.ObjectAndLayerIdColor:return t(this._passes.opaque,this._materialPassParameters);case P.Highlight:return t(this._passes.highlight,this._highlightPassParameters);case P.Shadow:return t(this._passes.shadowMap,this._shadowPassParameters);case P.ShadowHighlight:return t(this._passes.highlightShadowMap,this._shadowPassParameters);case P.ShadowExcludeHighlight:return t(this._passes.defaultShadowMap,this._shadowPassParameters);case P.ViewshedShadow:return t(this._passes.viewshedShadowMap,this._viewshedPassParameters)}break;case R.TRANSPARENT_MATERIAL:switch(s){case P.Color:case P.ColorEmission:case P.Depth:case P.Normal:case P.ObjectAndLayerIdColor:return t(this._passes.transparent,this._materialPassParameters)}break;case R.INTEGRATED_MESH:switch(s){case P.Color:case P.ColorEmission:case P.Depth:case P.Normal:case P.ObjectAndLayerIdColor:return t(this._passes.integratedMesh,this._materialPassParameters);case P.Highlight:return t(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}}return null}notifyDirty(){this._context.requestRender()}queryDepthRange(s){const e=new f;return this._systems.forEach((t=>e.union(t.queryDepthRange(s)))),e}get hasEmissions(){let s=!1;return this._systems.forEach((e=>s=e.hasEmissions||s)),s}_updateParameters(s,e,i){const m=s.viewInverseTransposeMatrix;h(A,m[3],m[7],m[11]),S.set(A),n(e.transformWorldFromViewTH,S.high),n(e.transformWorldFromViewTL,S.low),n(e.slicePlaneLocalOrigin,A),t(e.transformViewFromCameraRelativeRS,s.viewMatrix),o(e.transformProjFromView,s.projectionMatrix),e.identifier===_.Material&&(this._materialPassParameters.transparent=i,r(b,e.transformViewFromCameraRelativeRS),a(e.transformNormalViewFromGlobal,b))}hasHighlight(s){for(const e of this._systems)if(e.hasHighlight(s))return!0;return!1}};E=s([e("esri.views.3d.webgl-engine.core.renderPasses.RenderPassManager")],E);const A=m(),b=i(),S=new g;export{E as RenderPassManager};
5
+ import{_ as s}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as e}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as t,transpose as r,invert as a}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as o}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{i as h,c as n}from"../../../../../chunks/vec32.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MaterialPassParameters as c,ShadowMapPassParameters as l,HighlightPassParameters as u,ViewshedShadowMapPassParameters as d,AllRenderPasses as p}from"./AllRenderPasses.js";import{RenderPassIdentifier as _}from"./RenderPassIdentifier.js";import{ShaderOutput as P}from"../shaderLibrary/ShaderOutput.js";import{TwoVectorPosition as g}from"../util/TwoVectorPosition.js";import{SyncRenderPlugin as w}from"../../effects/RenderPlugin.js";import{DepthRange as f}from"../../lib/DepthRange.js";import{RenderSlot as E}from"../../lib/RenderSlot.js";let R=class extends w{constructor(){super({}),this.produces=new Map([[E.OPAQUE_MATERIAL,s=>this._produces(s,E.OPAQUE_MATERIAL)],[E.TRANSPARENT_MATERIAL,s=>this._produces(s,E.TRANSPARENT_MATERIAL)],[E.INTEGRATED_MESH,s=>this._produces(s,E.INTEGRATED_MESH)],[E.OCCLUDED_GROUND,s=>this._produces(s,E.OCCLUDED_GROUND)]]),this._materialPassParameters=new c,this._shadowPassParameters=new l,this._highlightPassParameters=new u,this._viewshedPassParameters=new d,this._systems=new Set}initializeRenderContext(s){this._context=s,this._passes=new p(s)}get rctx(){return this._context.renderContext.rctx}uninitializeRenderContext(){}dispose(){this._context=null,this._systems.clear()}register(s){this._systems.add(s)}_produces(s,e){return!!this._invoke(s,e,(s=>s.count>0))}prepareRender(s){const{_systems:e,_passes:t}=this;if(0!==e.size&&null!=t){for(const s of Object.values(t))s.prepareSubmit();e.forEach((e=>e.submit(t,s.bind)));for(const s of Object.values(t))s.finishSubmit()}}acquireTechniques(s){if(0===this._systems.size)return null;const e=s.output===P.Shadow||s.output===P.ShadowHighlight||s.output===P.ShadowExcludeHighlight?this._shadowPassParameters:s.output===P.ViewshedShadow?this._viewshedPassParameters:s.output===P.Highlight?this._highlightPassParameters:this._materialPassParameters,t=s.bind;return this._updateParameters(t.camera,e,t.slot===E.TRANSPARENT_MATERIAL),this._materialPassParameters.output=s.output,this._invoke(s.output,s.bind.slot,((e,t)=>e.acquire(t,s.bind)))}render(s,e){this._invoke(s.output,s.bind.slot,((t,r)=>t.dispatch(r,s.bind,e)))}_invoke(s,e,t){if(null==this._passes)return null;switch(e){case E.OPAQUE_MATERIAL:switch(s){case P.Color:case P.ColorEmission:case P.Depth:case P.Normal:case P.ObjectAndLayerIdColor:return t(this._passes.opaque,this._materialPassParameters);case P.Highlight:return t(this._passes.highlight,this._highlightPassParameters);case P.Shadow:return t(this._passes.shadowMap,this._shadowPassParameters);case P.ShadowHighlight:return t(this._passes.highlightShadowMap,this._shadowPassParameters);case P.ShadowExcludeHighlight:return t(this._passes.defaultShadowMap,this._shadowPassParameters);case P.ViewshedShadow:return t(this._passes.viewshedShadowMap,this._viewshedPassParameters)}break;case E.TRANSPARENT_MATERIAL:switch(s){case P.Color:case P.ColorEmission:case P.Depth:case P.Normal:case P.ObjectAndLayerIdColor:return t(this._passes.transparent,this._materialPassParameters)}break;case E.INTEGRATED_MESH:switch(s){case P.Color:case P.ColorEmission:case P.Depth:case P.Normal:case P.ObjectAndLayerIdColor:return t(this._passes.integratedMesh,this._materialPassParameters);case P.Highlight:return t(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}break;case E.OCCLUDED_GROUND:switch(s){case P.Color:case P.ColorEmission:case P.Depth:case P.Normal:case P.ObjectAndLayerIdColor:return t(this._passes.occludedGround,this._materialPassParameters)}}return null}notifyDirty(){this._context.requestRender()}queryDepthRange(s){const e=new f;return this._systems.forEach((t=>e.union(t.queryDepthRange(s)))),e}get hasEmissions(){let s=!1;return this._systems.forEach((e=>s=e.hasEmissions||s)),s}_updateParameters(s,e,i){const m=s.viewInverseTransposeMatrix;h(A,m[3],m[7],m[11]),j.set(A),n(e.transformWorldFromViewTH,j.high),n(e.transformWorldFromViewTL,j.low),n(e.slicePlaneLocalOrigin,A),t(e.transformViewFromCameraRelativeRS,s.viewMatrix),o(e.transformProjFromView,s.projectionMatrix),e.identifier===_.Material&&(this._materialPassParameters.transparent=i,r(b,e.transformViewFromCameraRelativeRS),a(e.transformNormalViewFromGlobal,b))}hasHighlight(s){for(const e of this._systems)if(e.hasHighlight(s))return!0;return!1}};R=s([e("esri.views.3d.webgl-engine.core.renderPasses.RenderPassManager")],R);const A=m(),b=i(),j=new g;export{R as RenderPassManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import r from"../../../../../core/PooledArray.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as s}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as i}from"../../../webgl.js";import n from"../../../webgl/RenderNode.js";import{DepthFormat as c}from"../../core/FBOCacheFormats.js";import{Blit as l}from"../blit/Blit.js";import{RenderOccludedFlag as d}from"../../lib/Material.js";import{RenderSlot as a}from"../../lib/RenderSlot.js";import{BlitMode as p}from"../../shaders/CompositingTechniqueConfiguration.js";import{DepthStencilAttachment as m,FramebufferBit as h}from"../../../../webgl/enums.js";let u=class extends n{constructor(e){super(e),this.consumes={required:[i.OCCLUDED]},this.produces=i.OCCLUDED,this._blit=new l(e.view.stage.renderView.techniques,p.PremultipliedAlpha)}precompile(){const e=this.view.stage.renderer;e.plugins.plugins.forAll((r=>{e.precompileSlots(r,a.OCCLUDED_TERRAIN,a.TRANSPARENT_OCCLUDER_MATERIAL),r.material&&e.precompileOccludedSlots(r,g)}))}render(e){const r=e.find((({name:e})=>e===this.produces));return this._renderOccludedAndTransparentStencil(r),this._renderOccludedComposite(r),r}_renderOccludedAndTransparentStencil(e){const r=this.view.stage.renderer,t=f;t.clear();for(const o of r.plugins.plugins)o.renderOccludedFlags&d.OccludeAndTransparentStencil&&t.push(o);0!==t.length&&(r.renderSlots(t,a.OCCLUDER_MATERIAL),this._renderAndComposite(e,e.getAttachment(m),.5,(()=>r.renderSlots(t,a.TRANSPARENT_OCCLUDER_MATERIAL)),!1,!1),t.clear())}_renderOccludedComposite(e){const r=this.view.stage.renderer,t=f;t.clear();let o=0;for(const n of r.plugins.plugins){const e=n.renderOccludedFlags&C;o|=e,e&&t.push(n)}if(!o)return void t.clear();const s=this._getDepthStencilAttachment(e);let i=s.clearStencil;for(const n of g)o&n&&(this._renderAndComposite(e,s.depth,n===d.Opaque?1:.5,(()=>r.renderOccludedSlots(t,n)),!0,i),i=!1);s.release(),t.clear()}_renderAndComposite(e,r,t,o,i,n){const c=this.renderingContext,{width:l,height:d}=e.fbo,a=this.fboCache.acquire(l,d,"tmp color");a.attachDepth(r),c.bindFramebuffer(a.fbo),c.clearFramebuffer(s,i,n),o(),a.detachDepth(),this._blit.blend(c,a,e,this.bindParameters,t),a.release()}_getDepthStencilAttachment(e){const{width:r,height:t}=e.fbo;if(!this.view.stage.renderer.occludedRequiresIntegratedMeshStencil){const e=this.fboCache.acquireDepth(c.DEPTH24_STENCIL8,r,t,"retained stencil");return{depth:e,release:()=>e.release(),clearStencil:!0}}const o=this.fboCache.acquire(r,t,"retained stencil",c.DEPTH24_STENCIL8);return this.renderingContext.blitFramebuffer(e.fbo,o.fbo,h.STENCIL),{depth:o.getAttachment(m),release:()=>o.release(),clearStencil:!1}}};e([t()],u.prototype,"consumes",void 0),e([t()],u.prototype,"produces",void 0),u=e([o("esri.views.3d.webgl-engine.effects.geometry.RenderOccludedRenderNode")],u);const f=new r,g=[d.OccludeAndTransparent,d.Transparent,d.Opaque],C=g.reduce(((e,r)=>e|r),d.None);export{u as RenderOccludedRenderNode};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import r from"../../../../../core/PooledArray.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as s}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as i}from"../../../webgl.js";import n from"../../../webgl/RenderNode.js";import{DepthFormat as c}from"../../core/FBOCacheFormats.js";import{Blit as l}from"../blit/Blit.js";import{RenderOccludedFlag as d}from"../../lib/Material.js";import{RenderSlot as a}from"../../lib/RenderSlot.js";import{BlitMode as p}from"../../shaders/CompositingTechniqueConfiguration.js";import{DepthStencilAttachment as m,FramebufferBit as h}from"../../../../webgl/enums.js";let u=class extends n{constructor(e){super(e),this.consumes={required:[i.OCCLUDED]},this.produces=i.OCCLUDED,this._blit=new l(e.view.stage.renderView.techniques,p.PremultipliedAlpha)}precompile(){const e=this.view.stage.renderer;e.plugins.plugins.forAll((r=>{e.precompileSlots(r,a.OCCLUDED_GROUND,a.TRANSPARENT_OCCLUDER_MATERIAL),r.material&&e.precompileOccludedSlots(r,g)}))}render(e){const r=e.find((({name:e})=>e===this.produces));return this._renderOccludedAndTransparentStencil(r),this._renderOccludedComposite(r),r}_renderOccludedAndTransparentStencil(e){const r=this.view.stage.renderer,t=f;t.clear();for(const o of r.plugins.plugins)o.renderOccludedFlags&d.OccludeAndTransparentStencil&&t.push(o);0!==t.length&&(r.renderSlots(t,a.OCCLUDER_MATERIAL),this._renderAndComposite(e,e.getAttachment(m),.5,(()=>r.renderSlots(t,a.TRANSPARENT_OCCLUDER_MATERIAL)),!1,!1),t.clear())}_renderOccludedComposite(e){const r=this.view.stage.renderer,t=f;t.clear();let o=0;for(const n of r.plugins.plugins){const e=n.renderOccludedFlags&C;o|=e,e&&t.push(n)}if(!o)return void t.clear();const s=this._getDepthStencilAttachment(e);let i=s.clearStencil;for(const n of g)o&n&&(this._renderAndComposite(e,s.depth,n===d.Opaque?1:.5,(()=>r.renderOccludedSlots(t,n)),!0,i),i=!1);s.release(),t.clear()}_renderAndComposite(e,r,t,o,i,n){const c=this.renderingContext,{width:l,height:d}=e.fbo,a=this.fboCache.acquire(l,d,"tmp color");a.attachDepth(r),c.bindFramebuffer(a.fbo),c.clearFramebuffer(s,i,n),o(),a.detachDepth(),this._blit.blend(c,a,e,this.bindParameters,t),a.release()}_getDepthStencilAttachment(e){const{width:r,height:t}=e.fbo;if(!this.view.stage.renderer.occludedRequiresIntegratedMeshStencil){const e=this.fboCache.acquireDepth(c.DEPTH24_STENCIL8,r,t,"retained stencil");return{depth:e,release:()=>e.release(),clearStencil:!0}}const o=this.fboCache.acquire(r,t,"retained stencil",c.DEPTH24_STENCIL8);return this.renderingContext.blitFramebuffer(e.fbo,o.fbo,h.STENCIL),{depth:o.getAttachment(m),release:()=>o.release(),clearStencil:!1}}};e([t()],u.prototype,"consumes",void 0),e([t()],u.prototype,"produces",void 0),u=e([o("esri.views.3d.webgl-engine.effects.geometry.RenderOccludedRenderNode")],u);const f=new r,g=[d.OccludeAndTransparent,d.Transparent,d.Opaque],C=g.reduce(((e,r)=>e|r),d.None);export{u as RenderOccludedRenderNode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- var A;!function(A){A[A.INTEGRATED_MESH=0]="INTEGRATED_MESH",A[A.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",A[A.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",A[A.OPAQUE_MATERIAL_WITHOUT_NORMALS=3]="OPAQUE_MATERIAL_WITHOUT_NORMALS",A[A.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",A[A.TRANSPARENT_MATERIAL_WITHOUT_NORMALS=5]="TRANSPARENT_MATERIAL_WITHOUT_NORMALS",A[A.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",A[A.TRANSPARENT_MATERIAL_WITHOUT_DEPTH=7]="TRANSPARENT_MATERIAL_WITHOUT_DEPTH",A[A.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",A[A.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",A[A.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",A[A.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",A[A.HUD_MATERIAL=12]="HUD_MATERIAL",A[A.LABEL_MATERIAL=13]="LABEL_MATERIAL",A[A.LINE_CALLOUTS=14]="LINE_CALLOUTS",A[A.LINE_CALLOUTS_HUD_DEPTH=15]="LINE_CALLOUTS_HUD_DEPTH",A[A.OVERLAY=16]="OVERLAY",A[A.DRAPED_MATERIAL=17]="DRAPED_MATERIAL",A[A.DRAPED_WATER=18]="DRAPED_WATER",A[A.VOXEL=19]="VOXEL",A[A.MAX_SLOTS=20]="MAX_SLOTS"}(A||(A={}));export{A as RenderSlot};
5
+ var A;!function(A){A[A.INTEGRATED_MESH=0]="INTEGRATED_MESH",A[A.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",A[A.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",A[A.OPAQUE_MATERIAL_WITHOUT_NORMALS=3]="OPAQUE_MATERIAL_WITHOUT_NORMALS",A[A.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",A[A.TRANSPARENT_MATERIAL_WITHOUT_NORMALS=5]="TRANSPARENT_MATERIAL_WITHOUT_NORMALS",A[A.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",A[A.TRANSPARENT_MATERIAL_WITHOUT_DEPTH=7]="TRANSPARENT_MATERIAL_WITHOUT_DEPTH",A[A.OCCLUDED_GROUND=8]="OCCLUDED_GROUND",A[A.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",A[A.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",A[A.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",A[A.HUD_MATERIAL=12]="HUD_MATERIAL",A[A.LABEL_MATERIAL=13]="LABEL_MATERIAL",A[A.LINE_CALLOUTS=14]="LINE_CALLOUTS",A[A.LINE_CALLOUTS_HUD_DEPTH=15]="LINE_CALLOUTS_HUD_DEPTH",A[A.OVERLAY=16]="OVERLAY",A[A.DRAPED_MATERIAL=17]="DRAPED_MATERIAL",A[A.DRAPED_WATER=18]="DRAPED_WATER",A[A.VOXEL=19]="VOXEL",A[A.MAX_SLOTS=20]="MAX_SLOTS"}(A||(A={}));export{A as RenderSlot};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as s,lerp as a}from"../../../../core/mathUtils.js";import{removeMaybe as n,abortMaybe as h,destroyMaybe as o,releaseMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as l}from"../../../../core/promiseUtils.js";import{watch as _,syncAndInitial as u,initial as p,sync as c}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{Milliseconds as g}from"../../../../core/time.js";import{property as f}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as b}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as A,invert as T,multiply as E}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as R,create as P}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as S}from"../../../../chunks/vec42.js";import{ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as w,ZEROS as I}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as O}from"../../../../geometry/support/Indices.js";import{RenderCategory as D,InternalRenderCategory as N}from"../../webgl.js";import{innerAtmosphereFadeStart as H}from"../../environment/atmosphereUtils.js";import{minNearDistanceInMeters as y}from"../../state/NearFarHeuristic.js";import{debugFlags as x}from"../../support/debugFlags.js";import{FBOCache as L,defaultWebGLFBO as M}from"../core/FBOCache.js";import{DepthFormat as v,ColorFormat as U}from"../core/FBOCacheFormats.js";import{RenderPassManager as F}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as G,isColorOrColorEmission as q}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as V}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{distanceFadeEnd as j}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as B}from"../effects/RenderNodes.js";import{RenderPluginManager as Q}from"../effects/RenderPluginManager.js";import{Blit as W}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as k,renderHighlightBuffer as z}from"../effects/highlight/Highlight.js";import{OITBlend as Y}from"../effects/transparency/OITBlend.js";import{AnimationTimer as X}from"./AnimationTimer.js";import{AnimationTimeStep as K}from"./AnimationTimeStep.js";import{RenderRequestType as J}from"./basicInterfaces.js";import{BoundingInfo as Z}from"./BoundingInfo.js";import{DepthRange as $}from"./DepthRange.js";import{depthRangeFromScene as ee,DepthRangeMode as te}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as re}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as ie}from"./MainFramebuffer.js";import{RenderOccludedFlag as se}from"./Material.js";import{OITPass as ae}from"./OITPass.js";import{RenderContext as ne,defaultRenderOccludedMask as he}from"./RenderContext.js";import{RendererBase as oe}from"./RendererBase.js";import{RendererTarget as de}from"./rendererUtils.js";import{setupFeatureDefaults as le,RenderFeature as _e}from"./RenderFeature.js";import{RenderPluginInput as ue}from"./RenderPluginInput.js";import{RenderSlot as pe}from"./RenderSlot.js";import{ShadowAccumulator as ce}from"./ShadowAccumulator.js";import{ShadowMap as me,SnapshotSlot as ge}from"./ShadowMap.js";import fe from"./SliceHelper.js";import{Transparency as be}from"./edgeRendering/interfaces.js";import{MergedRenderer as Ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as Te}from"../parts/renderUtils.js";import{RendererPerformanceInfo as Ee,PerformanceCategory as Re}from"../statistics/RendererPerformanceInfo.js";import{RenderState as Pe}from"../../../support/RenderState.js";import{PixelFormat as Se,PixelType as Ce,FramebufferBit as we,ColorAttachment1 as Ie,ColorAttachment2 as Oe}from"../../../webgl/enums.js";let De=class extends oe{constructor(e,t,r,s,a,n){super({stage:e}),this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this.renderPassManager=new F,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=w(0,0,0,1),this._sliceHelper=new fe,this._blit=null,this._oitblend=null,this.sceneDepthRange=m($.infinite),this._state=m(Pe.IDLE),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new K,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._lastFrameTime=g(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new ue,this._releaseNormals=e=>{e.some((({name:e})=>"normals"===e))&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this.fboCache=new L(s),this._renderStateFeatures=m(le(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new ie(this.fboCache),this.performanceInfo=new Ee(this._rctx),this._shadowMap=new me(this.fboCache,e.viewingMode),this._shadowAccumulator=new ce(this.fboCache,r,e,(e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t}),((t,r,i)=>{const s=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,i,!0,s),this._renderShadowCascades(G.Shadow,t.shadowMap),t.shadowMap.finish(),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)}),n),this._renderContext=new ne(this._rctx,this._shadowMap,r),this._nodes=new B(this._renderContext),this._plugins=new Q({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this.addHandles([_((()=>e.view.state.camera),(()=>n()),u),_((()=>x.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(be.TRANSPARENT):()=>{},n()}),p),_((()=>e.view.environment.background?.color),(e=>{const t=e?i(e):I;S(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()}),u),_((()=>e.view.state.camera.relativeElevation),(e=>this._inGlobeView=(e??1/0)>=j),u),_((()=>this._bindParameters.clouds.fadeFactor),(()=>this._bindParameters.fadeLighting()),c),_((()=>this._bindParameters.clouds.data?.state),(()=>n()),c),_((()=>e.view.state.highlights),(e=>{this._bindParameters.highlights=e,n()}),p)])}destroy(){this._gpuTimerHandle=n(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.dispose(),this._loadEdgeViewTask=h(this._loadEdgeViewTask),this._edgeView=o(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.fboCache.destroy(),this._plugins.destroy(),this._blit=null,this._oitblend=null,Z.prune(),Ae.prune(),O()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=le(t,e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate((i=>i.set(t,e,r))),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(_e.HighQualityTransparency)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(_e.WaterReflection))}get _hasHighlights(){return this._plugins.produces(G.Highlight,pe.OPAQUE_MATERIAL,pe.TRANSPARENT_MATERIAL,pe.DRAPED_MATERIAL,pe.HUD_MATERIAL,pe.LABEL_MATERIAL)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(G.Highlight,pe.HUD_MATERIAL,pe.LABEL_MATERIAL)}get hasSSAO(){return(this.stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(_e.SSAO))&&!this._inGlobeView}get hasSMAA(){return this.stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(_e.Antialiasing)}get fullResolutionAtmosphere(){return this.stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(_e.HighResolutionAtmosphere)}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=d(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=d(this._bindParameters.depth),this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility)}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.running||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r((async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");l(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ve(this.stage.view.resourceController)});return this.addHandles(_((()=>r.updating),(()=>this._requestRender()),c)),this._requestRender(),this._edgeViewCallbacks.forEach((e=>e(r))),this._edgeViewCallbacks.length=0,r}))),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&A(this._bindParameters.ssr.reprojectionMatrix,R)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){if(null!=e.environment.weather){const t=e.environment.weather;this._bindParameters.weather=t,this._bindParameters.snowCover=!!e.weatherVisible&&null!=t&&"snowy"===t.type&&"enabled"===t.snowCover}const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&0!==(this.plugins.renderOccludedFlags&se.OccludeAndTransparentStencil)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(G.Color,pe.INTEGRATED_MESH)&&this._plugins.produces(G.Color,pe.OCCLUDED_TERRAIN)}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(G.Color,...ve),has.water=this._plugins.produces(G.Normal,pe.DRAPED_WATER),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new X(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?n(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r=de.Default,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new Te(this._pluginInput.get(D.FINAL),null)}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:l}=re,_=this.stage.view,u=_.stateManager.camera,p=_.qualitySettings.fadeDuration,c=e===Pe.IDLE?r:i,m=s((u.tilt-h)/(o-h),0,1),g=s(((u.position.z??0)-d)/(l-d),0,1),f=a(a(1,c,m),1,g),b=this._bindParameters.hudOccludedFragmentOpacity;if(p<=0||b===f||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=f,void(this._lastFrameTime=t);const A=t-this._lastFrameTime;this._lastFrameTime=t;const T=Math.max(1-r,Math.abs(r-i)),E=Math.min(T*A/p,n);E>=Math.abs(f-b)?this._bindParameters.hudOccludedFragmentOpacity=f:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(f-b)*E,this._requestRender())}_render(e,t,r=de.Default,i){this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r===de.Default,this._disposeBindBuffers();const{camera:s,contentCamera:a,mode:n,alignPixelEnabled:h}=e;this._state.value=n;const o=this._nodes.produces("magnifier-color"),d=this._nodes.produces(D.FINAL),l=this._nodes.require("emissive",N.TRANSPARENT_ENVIRONMENT,D.COMPOSITE,D.FINAL)>0&&this._plugins.hasEmissions,_=l?G.ColorEmission:G.Color;this._renderContext.time=t,this._renderContext.output=_,this._bindParameters.oitPass=ae.NONE,this._bindParameters.alignPixelEnabled=h,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null;const u=!i||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=u?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(N.VIEWSHED),this._renderOverlay(t),s.setGLViewport(this._rctx);const p=this._framebuffer,c=p.initialize(s.fullWidth,s.fullHeight,this._backgroundColor,l);this.hasReflections?(c?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=c):c?.release(),this._ensureBindParametersCamera(s,a),this._updateHUDOccludedFragmentOpacity(n,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const m=this._highQualityTransparency&&this._hasTransparentTerrain,g=this._plugins.produces(G.Color,...Le);this._precompilePrepasses(),this.performanceInfo.advance(Re.PREPARE);const f=this._computeShadowDepthRange(s);this._renderShadowMap(s,this._bindParameters.lighting.mainLight.direction,f),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(f,s,a),this._ensureBindParametersSSR(t),this._precompileShaders(m,g,_),this._renderContext.output=_,p.bind(),this._bindParameters.mainDepth=p.depth.attachment,this._renderOpaque(m),this._renderTransparent(g,m,_),this._shadowMap.disposeMainBuffer(),this._pluginInput.set(N.FOCUSAREA,this._renderFocusAreaGeometry()),p.update((e=>this._renderNodes(N.TRANSPARENT_ENVIRONMENT,e))),p.update((e=>this._renderNodes(N.VIEWSHED,e))),p.update((e=>this._renderNodes(N.LASERLINES,e))),p.update((e=>this._renderNodes(N.FOCUSAREA_COLOR,e))),this._pluginInput.release(N.FOCUSAREA),p.update((e=>this._renderNodes(N.OCCLUDED,e))),this._pluginInput.set("highlights",this._renderHighlightPrepass()),this._renderHighlightShadowMap(s,this._bindParameters.lighting.mainLight.direction,f);const b=r===de.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;p.update((e=>this._renderNodes(D.COMPOSITE,e))),this._shadowMap.disposeOffscreenBuffers();const A=!(r!==de.Default||d||o&&!i),T=this._pluginInput.get(D.COMPOSITE),E=A?M:this.fboCache.acquire(T.fbo.width,T.fbo.height,N.ANTIALIASING),R=this._nodes.produces(N.ANTIALIASING)?this._renderNodes(N.ANTIALIASING,E):this._blitFBO(T,E,!1);let P;this._pluginInput.set(N.ANTIALIASING,R),this._hasHUDHighlights?(this._renderHUD(V.NotOccluded,R,_),P=this._renderNodes(N.HIGHLIGHTS,R)):(P=this._renderNodes(N.HIGHLIGHTS,R),this._renderHUD(V.NotOccluded,P,_));const S=this._renderNodes(N.MAGNIFIER,P);return o&&!i&&r===de.Default&&!d&&this._blitFBO(S),d?(S.attachDepth(p.depth),this._blitFBO(this._renderNodes(D.FINAL,S)),S.detachDepth()):this._pluginInput.set(D.FINAL,S),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),p.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),r!==de.Default&&(this._releaseFBOs(),this._disposeOffscreenBuffers()),new Te(this._pluginInput.get(D.FINAL),b)}_precompileShaders(e,t,r){++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._nodes.precompile(N.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=G.Depth,this._plugins.precompile(pe.TRANSPARENT_TERRAIN),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(pe.TRANSPARENT_TERRAIN),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._nodes.precompile(N.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(pe.OCCLUSION_PIXELS),this._plugins.precompile(pe.LINE_CALLOUTS),this._precompileHUD(V.Occluded),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(N.VIEWSHED,N.LASERLINES,N.FOCUSAREA_COLOR,N.OCCLUDED,N.ANTIALIASING,N.HIGHLIGHTS);const i=this._bindParameters;i.highlightMixTexture=i.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(V.NotOccluded),this._hasHighlights&&(i.highlights.forEach(((e,t)=>{i.highlightLevel=t,this._precompileAllGeometry(G.Highlight)})),i.highlightLevel=null),i.highlightMixTexture=null,this._nodes.precompile(D.COMPOSITE,N.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(pe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(N.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(Re.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(v.DEPTH24_STENCIL8),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(Re.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=e===J.BACKGROUND;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear-depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(I),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],Se.RGBA,Ce.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,Se.RGBA,Ce.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=()=>t.render(this._bindParameters,e),a=this._bindParameters.geometryDepth;this.renderToTargets(s,i,a??this._framebuffer.depth,I),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===be.OPAQUE?Re.OPAQUE_EDGES:Re.TRANSPARENT_EDGES)}_renderOverlay(e){this._bindParameters.overlay=this.overlay?.render(e),this._bindParameters.overlay&&this.performanceInfo.advance(Re.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(_e.HighResolutionShadows),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(G.ShadowExcludeHighlight,this._shadowMap),s.copySnapshot(ge.ExcludeHighlight),this._renderShadowCascades(G.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(G.Shadow),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(Re.SHADOW_MAP)}_renderHighlightShadowMap(e,t,r){if(!this.shadowsEnabled||!this._needsShadowHighlight)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(_e.HighResolutionShadows),this.stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(G.ShadowHighlight,this._shadowMap),s.moveSnapshot(ge.Highlight),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(Re.SHADOW_MAP)}_precompileShadowCascades(e){for(const t of this._shadowMap.cascades)t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.camera),this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){t.bindFbo();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(G.Depth)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(N.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(we.STENCIL),this._renderGeometryWithoutNormals(G.Depth),d(this._bindParameters.depth),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(Re.DEPTH)):(e.detachDepth(),this._bindParameters.depth=d(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=d(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"depth",v.DEPTH24_STENCIL8);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(we.DEPTH|we.STENCIL),this.renderAllGeometry(G.Depth),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(Re.DEPTH)}_renderTerrainDepth(e){if(this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,!e)return void(this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth));const t=this._renderContext.output;this._renderContext.output=G.Depth;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth",v.DEPTH24_STENCIL8);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(we.DEPTH|we.STENCIL),this._renderTransparentTerrain(),d(this._bindParameters.terrainDepth),this._bindParameters.terrainDepth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderGeometryDepth(e){if(!e)return void(this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth));const t=this._renderContext.output,{width:r,height:i}=this._framebufferSize,s=this.fboCache.acquire(r,i,"geometry depth",v.DEPTH24_STENCIL8);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(we.DEPTH|we.STENCIL),this._renderOpaqueAndTransparentGeometry(G.Depth),this._renderContext.output=t,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsShadowDepthRange(){return this._shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return $.zero;const t=ee(e,this._plugins.plugins,this.stage.layers,te.SHADOW_CASTERS);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=$.infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<H)return void(this.sceneDepthRange.value=$.infinite);const t=e.clone();t.near=y,t.far=1e10;const r=ee(t,this._plugins.plugins,this.stage.layers,te.FULL_SCENE);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.far===r.far&&this.sceneDepthRange.value.near===r.near||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,N.VIEWSHED,N.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(G.Normal),this._needsDepth&&this._precompileAllGeometry(G.Depth),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(G.ShadowHighlight),this._precompileShadowCascades(G.ShadowExcludeHighlight),this._precompileShadowCascades(G.ShadowHighlight)):this._precompileShadowCascades(G.Shadow)),this._shadowAccumulator.active&&this._precompileAllGeometry(G.Shadow)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",U.RGBA8UNORM);r.acquireDepth(v.DEPTH24_STENCIL8),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(I,!0,!0),this._renderGeometryWithNormals(G.Normal);const i=this._nodes.optional("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,N.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(Re.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return;const t=this._nodes.produce(N.SSAO,this._pluginInput);return this._bindParameters.ssao=t,t&&this.performanceInfo.advance(Re.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(pe.TRANSPARENT_TERRAIN),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentTerrain()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...Me);this._renderContext.renderOccludedMask=he}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll((e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)}))}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>se.Occlude&&this._plugins.render(pe.OCCLUDED_TERRAIN),this.renderSlots(e,...Me),this._renderContext.renderOccludedMask=he}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(pe.HUD_MATERIAL)}precompileViewshedShadowMap(){this._precompileAllGeometry(G.ViewshedShadow)}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(G.ViewshedShadow),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(...He),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(...ye)}_precompileOpaqueGeometry(){this._plugins.precompile(...xe)}_renderOpaqueGeometry(){this._plugins.render(...xe)}_renderTransparentGeometry(){this._plugins.render(...Le)}get _hasTransparentTerrain(){return this._plugins.produces(G.Color,pe.TRANSPARENT_TERRAIN)}_renderTransparentTerrain(){const e=()=>this._plugins.render(pe.TRANSPARENT_TERRAIN);if(!q(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,I),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,pe.OCCLUSION_PIXELS)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",U.RGBA4UNORM),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(pe.OCCLUSION_PIXELS),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(Re.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===V.Occluded){const e=()=>this._plugins.render(pe.LINE_CALLOUTS),t=this._framebufferSize,r=this.fboCache.acquireDepth(v.DEPTH16,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(pe.LINE_CALLOUTS)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=G.Highlight,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&q(this._renderContext.output)?(this._bindParameters.oitPass=ae.ColorAlpha,this._plugins.precompile(...ve),this._bindParameters.oitPass=ae.FrontFace,this._plugins.precompile(...ve),this._bindParameters.oitPass=ae.NONE):this._plugins.precompile(...ve),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(Ne.HUD,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture()),i.release()}else if(this._renderContext.output=r,e===V.Occluded){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(v.DEPTH16,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(v.DEPTH16),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(e===V.Occluded?Re.HUD_OCCLUDED:Re.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...ve)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(G.ShadowHighlight,pe.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,{highlights:s}=r,a=e.acquire(i.width,i.height,"highlights",s.length>k?U.RG8UINT:U.R8UINT);a.acquireDepth(v.DEPTH24_STENCIL8),t.bindFramebuffer(a.fbo);const{gl:n}=t;return n.clearBufferuiv(n.COLOR,0,[0,0,0,0]),this._renderContext.output=G.Highlight,t.bindFramebuffer(a.fbo),z(t,e,i,r,(()=>this._renderHighlightGeometries())),this.performanceInfo.advance(Re.HIGHLIGHTS),a}_renderHighlightGeometries(){this._plugins.render(...Ue),this._rctx.clear(we.DEPTH),this._renderHUDElements(V.Both)}_renderShadowAccumulation(e,t,r){this._shadowAccumulator.updateDepthRange(e),this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,t,r)&&this.performanceInfo.advance(Re.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&q(this._renderContext.output)?(this._bindParameters.oitPass=ae.ColorAlpha,this._plugins.precompile(...Le),this._bindParameters.oitPass=ae.FrontFace,this._plugins.precompile(...Le),this._bindParameters.oitPass=ae.NONE):this._plugins.precompile(...Le)}_renderOIT(e,t,r=V.Both){const i=e===Ne.HUD,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=ae.ColorAlpha;const d=a?"oit hud color+alpha":"oit color+alpha",l=this.fboCache.acquire(s.width,s.height,d,U.RGBA16FLOAT),_=t===G.ColorEmission;_&&l.acquireColor(Ie,U.RGBA16FLOAT,"emissive"),l.acquireColor(_?Oe:Ie,U.R16FLOAT),a||l.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(l.fbo),this._rctx.clearFramebuffer([0,0,0,1]),_&&this._rctx.clearBuffer(1,C),n(),l.detachDepth(),h.oitPass=ae.FrontFace;const u=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return _&&u.acquireColor(Ie,U.RGBA16FLOAT,"emissive"),a?u.acquireDepth(v.DEPTH16):u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(I,!!a),n(),u.detachDepth(),h.oitPass=ae.NONE,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(we.COLOR)):this._framebuffer.bind(),this._oitblend??=new Y(this._techniques),this._oitblend.blend(this._rctx,l,u,h,_),a?.detachDepth(),u.release(),l.release(),this._renderContext.output=o,a}_renderOpaque(e){const t=this.plugins.produces(G.Color,...xe);if(t){this._plugins.render(pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN);const e=this._framebuffer;e.update((e=>this._renderNodes(N.OPAQUE_TERRAIN,e))),e.bind(),this._plugins.render(pe.OPAQUE_MATERIAL,pe.OPAQUE_MATERIAL_WITHOUT_NORMALS)}const r=this._framebuffer;r.update((e=>this._renderNodes(D.OPAQUE,e,t))),this.fboCache.debugCallback?.(D.OPAQUE,r.color.fbo),r.update((e=>this._renderNodes(N.OPAQUE_ENVIRONMENT,e))),this.fboCache.debugCallback?.(N.OPAQUE_ENVIRONMENT,r.color.fbo),this._renderTerrainDepth(e),this._renderEdges(be.OPAQUE)}_renderTransparent(e,t,r){const i=this._framebuffer;i.bind(),this._renderPlugins(pe.VOXEL,Re.VOXEL),this._renderHiddenTransparentEdges(),e&&(this._oitEnabled?this._renderOIT(Ne.Geometry,r):this._renderTransparentGeometry()),i.update((t=>this._renderNodes(D.TRANSPARENT,t,e))),this.fboCache.debugCallback?.(D.TRANSPARENT,i.color.fbo),this._renderGeometryDepth(t),this._renderHUDVisibility(),t||this._plugins.render(pe.LINE_CALLOUTS),this._renderEdges(be.TRANSPARENT);const s=this._hasTransparentTerrain?this._renderTransparentTerrain():null;s&&(this.performanceInfo.advance(Re.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(t?this._renderLineCallouts(V.Occluded):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,s.getTexture())),this._renderHUD(V.Occluded,i.color,r))),this._bindParameters.cullAboveTerrain=!1,s&&(i.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,s.getTexture()),s.release(),t&&(this._renderEdges(be.OPAQUE),e&&(this._oitEnabled?this._renderOIT(Ne.Geometry,r):this._renderTransparentGeometry(),this.performanceInfo.advance(Re.TRANSPARENT)),this._renderEdges(be.TRANSPARENT))),this._bindParameters.ssao=d(this._bindParameters.ssao),t&&this._renderLineCallouts(V.NotOccluded),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(Re.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(pe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),this.performanceInfo.advance(Re.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}_blitFBO(e,t=M,r=!0){return this._blit??=new W(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=R:(T(Ge,this._bindParameters.camera.viewMatrix),T(Fe,this._bindParameters.camera.projectionMatrix),E(qe,Ge,Fe),E(qe,this._renderContext.lastFrameCamera.viewMatrix,qe),E(qe,this._renderContext.lastFrameCamera.projectionMatrix,qe),this._reprojectionMatrix=qe);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=R,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(J.UPDATE)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}};var Ne;e([f({readOnly:!0})],De.prototype,"fullResolutionAtmosphere",null),e([f()],De.prototype,"_edgeView",void 0),e([f()],De.prototype,"updating",null),De=e([b("esri.views.3d.webgl-engine.lib.Renderer")],De),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(Ne||(Ne={}));const He=[pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN,pe.OPAQUE_MATERIAL,pe.TRANSPARENT_MATERIAL],ye=[pe.OPAQUE_MATERIAL_WITHOUT_NORMALS,pe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],xe=[pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN,pe.OPAQUE_MATERIAL,pe.OPAQUE_MATERIAL_WITHOUT_NORMALS],Le=[pe.TRANSPARENT_MATERIAL,pe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],Me=[pe.OPAQUE_MATERIAL,pe.TRANSPARENT_MATERIAL,pe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH],ve=[pe.LINE_CALLOUTS_HUD_DEPTH,pe.HUD_MATERIAL,pe.LABEL_MATERIAL],Ue=[pe.TRANSPARENT_MATERIAL,pe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,pe.OPAQUE_MATERIAL,pe.OPAQUE_MATERIAL_WITHOUT_NORMALS,pe.TRANSPARENT_TERRAIN,pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN],Fe=P(),Ge=P(),qe=P();function Ve(e){return t=>e.immediate.schedule(t)}export{De as Renderer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as s,lerp as a}from"../../../../core/mathUtils.js";import{removeMaybe as n,abortMaybe as h,destroyMaybe as o,releaseMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as l}from"../../../../core/promiseUtils.js";import{watch as _,syncAndInitial as u,initial as p,sync as c}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{Milliseconds as g}from"../../../../core/time.js";import{property as f}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as b}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as A,invert as T,multiply as E}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as R,create as P}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as S}from"../../../../chunks/vec42.js";import{ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as w,ZEROS as I}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as O}from"../../../../geometry/support/Indices.js";import{RenderCategory as D,InternalRenderCategory as N}from"../../webgl.js";import{innerAtmosphereFadeStart as H}from"../../environment/atmosphereUtils.js";import{minNearDistanceInMeters as y}from"../../state/NearFarHeuristic.js";import{debugFlags as x}from"../../support/debugFlags.js";import{FBOCache as L,defaultWebGLFBO as M}from"../core/FBOCache.js";import{DepthFormat as v,ColorFormat as U}from"../core/FBOCacheFormats.js";import{RenderPassManager as F}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as G,isColorOrColorEmission as q}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as V}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{distanceFadeEnd as j}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as B}from"../effects/RenderNodes.js";import{RenderPluginManager as Q}from"../effects/RenderPluginManager.js";import{Blit as W}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as k,renderHighlightBuffer as z}from"../effects/highlight/Highlight.js";import{OITBlend as Y}from"../effects/transparency/OITBlend.js";import{AnimationTimer as X}from"./AnimationTimer.js";import{AnimationTimeStep as K}from"./AnimationTimeStep.js";import{RenderRequestType as J}from"./basicInterfaces.js";import{BoundingInfo as Z}from"./BoundingInfo.js";import{DepthRange as $}from"./DepthRange.js";import{depthRangeFromScene as ee,DepthRangeMode as te}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as re}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as ie}from"./MainFramebuffer.js";import{RenderOccludedFlag as se}from"./Material.js";import{OITPass as ae}from"./OITPass.js";import{RenderContext as ne,defaultRenderOccludedMask as he}from"./RenderContext.js";import{RendererBase as oe}from"./RendererBase.js";import{RendererTarget as de}from"./rendererUtils.js";import{setupFeatureDefaults as le,RenderFeature as _e}from"./RenderFeature.js";import{RenderPluginInput as ue}from"./RenderPluginInput.js";import{RenderSlot as pe}from"./RenderSlot.js";import{ShadowAccumulator as ce}from"./ShadowAccumulator.js";import{ShadowMap as me,SnapshotSlot as ge}from"./ShadowMap.js";import fe from"./SliceHelper.js";import{Transparency as be}from"./edgeRendering/interfaces.js";import{MergedRenderer as Ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as Te}from"../parts/renderUtils.js";import{RendererPerformanceInfo as Ee,PerformanceCategory as Re}from"../statistics/RendererPerformanceInfo.js";import{RenderState as Pe}from"../../../support/RenderState.js";import{PixelFormat as Se,PixelType as Ce,FramebufferBit as we,ColorAttachment1 as Ie,ColorAttachment2 as Oe}from"../../../webgl/enums.js";let De=class extends oe{constructor(e,t,r,s,a,n){super({stage:e}),this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this.renderPassManager=new F,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=w(0,0,0,1),this._sliceHelper=new fe,this._blit=null,this._oitblend=null,this.sceneDepthRange=m($.infinite),this._state=m(Pe.IDLE),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new K,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._lastFrameTime=g(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new ue,this._releaseNormals=e=>{e.some((({name:e})=>"normals"===e))&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this.fboCache=new L(s),this._renderStateFeatures=m(le(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new ie(this.fboCache),this.performanceInfo=new Ee(this._rctx),this._shadowMap=new me(this.fboCache,e.viewingMode),this._shadowAccumulator=new ce(this.fboCache,r,e,(e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t}),((t,r,i)=>{const s=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,i,!0,s),this._renderShadowCascades(G.Shadow,t.shadowMap),t.shadowMap.finish(),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)}),n),this._renderContext=new ne(this._rctx,this._shadowMap,r),this._nodes=new B(this._renderContext),this._plugins=new Q({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this.addHandles([_((()=>e.view.state.camera),(()=>n()),u),_((()=>x.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(be.TRANSPARENT):()=>{},n()}),p),_((()=>e.view.environment.background?.color),(e=>{const t=e?i(e):I;S(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()}),u),_((()=>e.view.state.camera.relativeElevation),(e=>this._inGlobeView=(e??1/0)>=j),u),_((()=>this._bindParameters.clouds.fadeFactor),(()=>this._bindParameters.fadeLighting()),c),_((()=>this._bindParameters.clouds.data?.state),(()=>n()),c),_((()=>e.view.state.highlights),(e=>{this._bindParameters.highlights=e,n()}),p)])}destroy(){this._gpuTimerHandle=n(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.dispose(),this._loadEdgeViewTask=h(this._loadEdgeViewTask),this._edgeView=o(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.fboCache.destroy(),this._plugins.destroy(),this._blit=null,this._oitblend=null,Z.prune(),Ae.prune(),O()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=le(t,e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate((i=>i.set(t,e,r))),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(_e.HighQualityTransparency)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(_e.WaterReflection))}get _hasHighlights(){return this._plugins.produces(G.Highlight,pe.OPAQUE_MATERIAL,pe.TRANSPARENT_MATERIAL,pe.DRAPED_MATERIAL,pe.HUD_MATERIAL,pe.LABEL_MATERIAL)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(G.Highlight,pe.HUD_MATERIAL,pe.LABEL_MATERIAL)}get hasSSAO(){return(this.stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(_e.SSAO))&&!this._inGlobeView}get hasSMAA(){return this.stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(_e.Antialiasing)}get fullResolutionAtmosphere(){return this.stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(_e.HighResolutionAtmosphere)}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=d(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=d(this._bindParameters.depth),this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility)}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.running||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r((async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");l(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ve(this.stage.view.resourceController)});return this.addHandles(_((()=>r.updating),(()=>this._requestRender()),c)),this._requestRender(),this._edgeViewCallbacks.forEach((e=>e(r))),this._edgeViewCallbacks.length=0,r}))),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&A(this._bindParameters.ssr.reprojectionMatrix,R)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){if(null!=e.environment.weather){const t=e.environment.weather;this._bindParameters.weather=t,this._bindParameters.snowCover=!!e.weatherVisible&&null!=t&&"snowy"===t.type&&"enabled"===t.snowCover}const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&0!==(this.plugins.renderOccludedFlags&se.OccludeAndTransparentStencil)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(G.Color,pe.INTEGRATED_MESH)&&this._plugins.produces(G.Color,pe.OCCLUDED_GROUND)}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(G.Color,...ve),has.water=this._plugins.produces(G.Normal,pe.DRAPED_WATER),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new X(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?n(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r=de.Default,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new Te(this._pluginInput.get(D.FINAL),null)}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:l}=re,_=this.stage.view,u=_.stateManager.camera,p=_.qualitySettings.fadeDuration,c=e===Pe.IDLE?r:i,m=s((u.tilt-h)/(o-h),0,1),g=s(((u.position.z??0)-d)/(l-d),0,1),f=a(a(1,c,m),1,g),b=this._bindParameters.hudOccludedFragmentOpacity;if(p<=0||b===f||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=f,void(this._lastFrameTime=t);const A=t-this._lastFrameTime;this._lastFrameTime=t;const T=Math.max(1-r,Math.abs(r-i)),E=Math.min(T*A/p,n);E>=Math.abs(f-b)?this._bindParameters.hudOccludedFragmentOpacity=f:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(f-b)*E,this._requestRender())}_render(e,t,r=de.Default,i){this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r===de.Default,this._disposeBindBuffers();const{camera:s,contentCamera:a,mode:n,alignPixelEnabled:h}=e;this._state.value=n;const o=this._nodes.produces("magnifier-color"),d=this._nodes.produces(D.FINAL),l=this._nodes.require("emissive",N.TRANSPARENT_ENVIRONMENT,D.COMPOSITE,D.FINAL)>0&&this._plugins.hasEmissions,_=l?G.ColorEmission:G.Color;this._renderContext.time=t,this._renderContext.output=_,this._bindParameters.oitPass=ae.NONE,this._bindParameters.alignPixelEnabled=h,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null;const u=!i||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=u?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(N.VIEWSHED),this._renderOverlay(t),s.setGLViewport(this._rctx);const p=this._framebuffer,c=p.initialize(s.fullWidth,s.fullHeight,this._backgroundColor,l);this.hasReflections?(c?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=c):c?.release(),this._ensureBindParametersCamera(s,a),this._updateHUDOccludedFragmentOpacity(n,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const m=this._highQualityTransparency&&this._hasTransparentTerrain,g=this._plugins.produces(G.Color,...Le);this._precompilePrepasses(),this.performanceInfo.advance(Re.PREPARE);const f=this._computeShadowDepthRange(s);this._renderShadowMap(s,this._bindParameters.lighting.mainLight.direction,f),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(f,s,a),this._ensureBindParametersSSR(t),this._precompileShaders(m,g,_),this._renderContext.output=_,p.bind(),this._bindParameters.mainDepth=p.depth.attachment,this._renderOpaque(m),this._renderTransparent(g,m,_),this._shadowMap.disposeMainBuffer(),this._pluginInput.set(N.FOCUSAREA,this._renderFocusAreaGeometry()),p.update((e=>this._renderNodes(N.TRANSPARENT_ENVIRONMENT,e))),p.update((e=>this._renderNodes(N.VIEWSHED,e))),p.update((e=>this._renderNodes(N.LASERLINES,e))),p.update((e=>this._renderNodes(N.FOCUSAREA_COLOR,e))),this._pluginInput.release(N.FOCUSAREA),p.update((e=>this._renderNodes(N.OCCLUDED,e))),this._pluginInput.set("highlights",this._renderHighlightPrepass()),this._renderHighlightShadowMap(s,this._bindParameters.lighting.mainLight.direction,f);const b=r===de.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;p.update((e=>this._renderNodes(D.COMPOSITE,e))),this._shadowMap.disposeOffscreenBuffers();const A=!(r!==de.Default||d||o&&!i),T=this._pluginInput.get(D.COMPOSITE),E=A?M:this.fboCache.acquire(T.fbo.width,T.fbo.height,N.ANTIALIASING),R=this._nodes.produces(N.ANTIALIASING)?this._renderNodes(N.ANTIALIASING,E):this._blitFBO(T,E,!1);let P;this._pluginInput.set(N.ANTIALIASING,R),this._hasHUDHighlights?(this._renderHUD(V.NotOccluded,R,_),P=this._renderNodes(N.HIGHLIGHTS,R)):(P=this._renderNodes(N.HIGHLIGHTS,R),this._renderHUD(V.NotOccluded,P,_));const S=this._renderNodes(N.MAGNIFIER,P);return o&&!i&&r===de.Default&&!d&&this._blitFBO(S),d?(S.attachDepth(p.depth),this._blitFBO(this._renderNodes(D.FINAL,S)),S.detachDepth()):this._pluginInput.set(D.FINAL,S),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),p.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),r!==de.Default&&(this._releaseFBOs(),this._disposeOffscreenBuffers()),new Te(this._pluginInput.get(D.FINAL),b)}_precompileShaders(e,t,r){++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._nodes.precompile(N.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=G.Depth,this._plugins.precompile(pe.TRANSPARENT_TERRAIN),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(pe.TRANSPARENT_TERRAIN),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._nodes.precompile(N.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(pe.OCCLUSION_PIXELS),this._plugins.precompile(pe.LINE_CALLOUTS),this._precompileHUD(V.Occluded),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(N.VIEWSHED,N.LASERLINES,N.FOCUSAREA_COLOR,N.OCCLUDED,N.ANTIALIASING,N.HIGHLIGHTS);const i=this._bindParameters;i.highlightMixTexture=i.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(V.NotOccluded),this._hasHighlights&&(i.highlights.forEach(((e,t)=>{i.highlightLevel=t,this._precompileAllGeometry(G.Highlight)})),i.highlightLevel=null),i.highlightMixTexture=null,this._nodes.precompile(D.COMPOSITE,N.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(pe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(N.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(Re.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(v.DEPTH24_STENCIL8),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(Re.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=e===J.BACKGROUND;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear-depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(I),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],Se.RGBA,Ce.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,Se.RGBA,Ce.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=()=>t.render(this._bindParameters,e),a=this._bindParameters.geometryDepth;this.renderToTargets(s,i,a??this._framebuffer.depth,I),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===be.OPAQUE?Re.OPAQUE_EDGES:Re.TRANSPARENT_EDGES)}_renderOverlay(e){this._bindParameters.overlay=this.overlay?.render(e),this._bindParameters.overlay&&this.performanceInfo.advance(Re.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(_e.HighResolutionShadows),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(G.ShadowExcludeHighlight,this._shadowMap),s.copySnapshot(ge.ExcludeHighlight),this._renderShadowCascades(G.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(G.Shadow),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(Re.SHADOW_MAP)}_renderHighlightShadowMap(e,t,r){if(!this.shadowsEnabled||!this._needsShadowHighlight)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(_e.HighResolutionShadows),this.stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(G.ShadowHighlight,this._shadowMap),s.moveSnapshot(ge.Highlight),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(Re.SHADOW_MAP)}_precompileShadowCascades(e){for(const t of this._shadowMap.cascades)t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.camera),this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){t.bindFbo();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(G.Depth)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(N.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(we.STENCIL),this._renderGeometryWithoutNormals(G.Depth),d(this._bindParameters.depth),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(Re.DEPTH)):(e.detachDepth(),this._bindParameters.depth=d(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=d(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"depth",v.DEPTH24_STENCIL8);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(we.DEPTH|we.STENCIL),this.renderAllGeometry(G.Depth),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(Re.DEPTH)}_renderTerrainDepth(e){if(this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,!e)return void(this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth));const t=this._renderContext.output;this._renderContext.output=G.Depth;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth",v.DEPTH24_STENCIL8);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(we.DEPTH|we.STENCIL),this._renderTransparentTerrain(),d(this._bindParameters.terrainDepth),this._bindParameters.terrainDepth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderGeometryDepth(e){if(!e)return void(this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth));const t=this._renderContext.output,{width:r,height:i}=this._framebufferSize,s=this.fboCache.acquire(r,i,"geometry depth",v.DEPTH24_STENCIL8);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(we.DEPTH|we.STENCIL),this._renderOpaqueAndTransparentGeometry(G.Depth),this._renderContext.output=t,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsShadowDepthRange(){return this._shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return $.zero;const t=ee(e,this._plugins.plugins,this.stage.layers,te.SHADOW_CASTERS);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=$.infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<H)return void(this.sceneDepthRange.value=$.infinite);const t=e.clone();t.near=y,t.far=1e10;const r=ee(t,this._plugins.plugins,this.stage.layers,te.FULL_SCENE);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.far===r.far&&this.sceneDepthRange.value.near===r.near||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,N.VIEWSHED,N.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(G.Normal),this._needsDepth&&this._precompileAllGeometry(G.Depth),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(G.ShadowHighlight),this._precompileShadowCascades(G.ShadowExcludeHighlight),this._precompileShadowCascades(G.ShadowHighlight)):this._precompileShadowCascades(G.Shadow)),this._shadowAccumulator.active&&this._precompileAllGeometry(G.Shadow)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",U.RGBA8UNORM);r.acquireDepth(v.DEPTH24_STENCIL8),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(I,!0,!0),this._renderGeometryWithNormals(G.Normal);const i=this._nodes.optional("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,N.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(Re.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return;const t=this._nodes.produce(N.SSAO,this._pluginInput);return this._bindParameters.ssao=t,t&&this.performanceInfo.advance(Re.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(pe.TRANSPARENT_TERRAIN),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentTerrain()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...Me);this._renderContext.renderOccludedMask=he}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll((e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)}))}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>se.Occlude&&this._plugins.render(pe.OCCLUDED_GROUND),this.renderSlots(e,...Me),this._renderContext.renderOccludedMask=he}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(pe.HUD_MATERIAL)}precompileViewshedShadowMap(){this._precompileAllGeometry(G.ViewshedShadow)}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(G.ViewshedShadow),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(...He),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(...ye)}_precompileOpaqueGeometry(){this._plugins.precompile(...xe)}_renderOpaqueGeometry(){this._plugins.render(...xe)}_renderTransparentGeometry(){this._plugins.render(...Le)}get _hasTransparentTerrain(){return this._plugins.produces(G.Color,pe.TRANSPARENT_TERRAIN)}_renderTransparentTerrain(){const e=()=>this._plugins.render(pe.TRANSPARENT_TERRAIN);if(!q(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,I),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,pe.OCCLUSION_PIXELS)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",U.RGBA4UNORM),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(pe.OCCLUSION_PIXELS),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(Re.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===V.Occluded){const e=()=>this._plugins.render(pe.LINE_CALLOUTS),t=this._framebufferSize,r=this.fboCache.acquireDepth(v.DEPTH16,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(pe.LINE_CALLOUTS)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=G.Highlight,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&q(this._renderContext.output)?(this._bindParameters.oitPass=ae.ColorAlpha,this._plugins.precompile(...ve),this._bindParameters.oitPass=ae.FrontFace,this._plugins.precompile(...ve),this._bindParameters.oitPass=ae.NONE):this._plugins.precompile(...ve),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(Ne.HUD,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture()),i.release()}else if(this._renderContext.output=r,e===V.Occluded){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(v.DEPTH16,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(v.DEPTH16),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(e===V.Occluded?Re.HUD_OCCLUDED:Re.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...ve)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(G.ShadowHighlight,pe.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,{highlights:s}=r,a=e.acquire(i.width,i.height,"highlights",s.length>k?U.RG8UINT:U.R8UINT);a.acquireDepth(v.DEPTH24_STENCIL8),t.bindFramebuffer(a.fbo);const{gl:n}=t;return n.clearBufferuiv(n.COLOR,0,[0,0,0,0]),this._renderContext.output=G.Highlight,t.bindFramebuffer(a.fbo),z(t,e,i,r,(()=>this._renderHighlightGeometries())),this.performanceInfo.advance(Re.HIGHLIGHTS),a}_renderHighlightGeometries(){this._plugins.render(...Ue),this._rctx.clear(we.DEPTH),this._renderHUDElements(V.Both)}_renderShadowAccumulation(e,t,r){this._shadowAccumulator.updateDepthRange(e),this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,t,r)&&this.performanceInfo.advance(Re.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&q(this._renderContext.output)?(this._bindParameters.oitPass=ae.ColorAlpha,this._plugins.precompile(...Le),this._bindParameters.oitPass=ae.FrontFace,this._plugins.precompile(...Le),this._bindParameters.oitPass=ae.NONE):this._plugins.precompile(...Le)}_renderOIT(e,t,r=V.Both){const i=e===Ne.HUD,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=ae.ColorAlpha;const d=a?"oit hud color+alpha":"oit color+alpha",l=this.fboCache.acquire(s.width,s.height,d,U.RGBA16FLOAT),_=t===G.ColorEmission;_&&l.acquireColor(Ie,U.RGBA16FLOAT,"emissive"),l.acquireColor(_?Oe:Ie,U.R16FLOAT),a||l.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(l.fbo),this._rctx.clearFramebuffer([0,0,0,1]),_&&this._rctx.clearBuffer(1,C),n(),l.detachDepth(),h.oitPass=ae.FrontFace;const u=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return _&&u.acquireColor(Ie,U.RGBA16FLOAT,"emissive"),a?u.acquireDepth(v.DEPTH16):u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(I,!!a),n(),u.detachDepth(),h.oitPass=ae.NONE,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(we.COLOR)):this._framebuffer.bind(),this._oitblend??=new Y(this._techniques),this._oitblend.blend(this._rctx,l,u,h,_),a?.detachDepth(),u.release(),l.release(),this._renderContext.output=o,a}_renderOpaque(e){const t=this.plugins.produces(G.Color,...xe);if(t){this._plugins.render(pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN);const e=this._framebuffer;e.update((e=>this._renderNodes(N.OPAQUE_TERRAIN,e))),e.bind(),this._plugins.render(pe.OPAQUE_MATERIAL,pe.OPAQUE_MATERIAL_WITHOUT_NORMALS)}const r=this._framebuffer;r.update((e=>this._renderNodes(D.OPAQUE,e,t))),this.fboCache.debugCallback?.(D.OPAQUE,r.color.fbo),r.update((e=>this._renderNodes(N.OPAQUE_ENVIRONMENT,e))),this.fboCache.debugCallback?.(N.OPAQUE_ENVIRONMENT,r.color.fbo),this._renderTerrainDepth(e),this._renderEdges(be.OPAQUE)}_renderTransparent(e,t,r){const i=this._framebuffer;i.bind(),this._renderPlugins(pe.VOXEL,Re.VOXEL),this._renderHiddenTransparentEdges(),e&&(this._oitEnabled?this._renderOIT(Ne.Geometry,r):this._renderTransparentGeometry()),i.update((t=>this._renderNodes(D.TRANSPARENT,t,e))),this.fboCache.debugCallback?.(D.TRANSPARENT,i.color.fbo),this._renderGeometryDepth(t),this._renderHUDVisibility(),t||this._plugins.render(pe.LINE_CALLOUTS),this._renderEdges(be.TRANSPARENT);const s=this._hasTransparentTerrain?this._renderTransparentTerrain():null;s&&(this.performanceInfo.advance(Re.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(t?this._renderLineCallouts(V.Occluded):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,s.getTexture())),this._renderHUD(V.Occluded,i.color,r))),this._bindParameters.cullAboveTerrain=!1,s&&(i.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,s.getTexture()),s.release(),t&&(this._renderEdges(be.OPAQUE),e&&(this._oitEnabled?this._renderOIT(Ne.Geometry,r):this._renderTransparentGeometry(),this.performanceInfo.advance(Re.TRANSPARENT)),this._renderEdges(be.TRANSPARENT))),this._bindParameters.ssao=d(this._bindParameters.ssao),t&&this._renderLineCallouts(V.NotOccluded),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(Re.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(pe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),this.performanceInfo.advance(Re.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}_blitFBO(e,t=M,r=!0){return this._blit??=new W(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=R:(T(Ge,this._bindParameters.camera.viewMatrix),T(Fe,this._bindParameters.camera.projectionMatrix),E(qe,Ge,Fe),E(qe,this._renderContext.lastFrameCamera.viewMatrix,qe),E(qe,this._renderContext.lastFrameCamera.projectionMatrix,qe),this._reprojectionMatrix=qe);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=R,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(J.UPDATE)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}};var Ne;e([f({readOnly:!0})],De.prototype,"fullResolutionAtmosphere",null),e([f()],De.prototype,"_edgeView",void 0),e([f()],De.prototype,"updating",null),De=e([b("esri.views.3d.webgl-engine.lib.Renderer")],De),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(Ne||(Ne={}));const He=[pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN,pe.OPAQUE_MATERIAL,pe.TRANSPARENT_MATERIAL],ye=[pe.OPAQUE_MATERIAL_WITHOUT_NORMALS,pe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],xe=[pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN,pe.OPAQUE_MATERIAL,pe.OPAQUE_MATERIAL_WITHOUT_NORMALS],Le=[pe.TRANSPARENT_MATERIAL,pe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],Me=[pe.OPAQUE_MATERIAL,pe.TRANSPARENT_MATERIAL,pe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH],ve=[pe.LINE_CALLOUTS_HUD_DEPTH,pe.HUD_MATERIAL,pe.LABEL_MATERIAL],Ue=[pe.TRANSPARENT_MATERIAL,pe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,pe.OPAQUE_MATERIAL,pe.OPAQUE_MATERIAL_WITHOUT_NORMALS,pe.TRANSPARENT_TERRAIN,pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN],Fe=P(),Ge=P(),qe=P();function Ve(e){return t=>e.immediate.schedule(t)}export{De as Renderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../../../core/mathUtils.js";import{clone as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as o,is3DGeometryOutputMRT as a,isColorOrColorEmission as n,isColorEmission as h,ShaderOutput as c}from"../core/shaderLibrary/ShaderOutput.js";import{EmissionSource as p}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as u}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as m}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import f from"../lib/GLMaterial.js";import{Material as d}from"../lib/Material.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as g,intersectAabbInvDir as v}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as _}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as T}from"./DefaultBufferWriter.js";import{vertexAttributeLocations as A,PathPassParameters as O,PathTechnique as R}from"./PathTechnique.js";import{PathTechniqueConfiguration as y}from"./PathTechniqueConfiguration.js";import{alphaCutoff as E}from"../../../../webscene/support/AlphaCutoff.js";class P extends d{constructor(t,e){super(t,I),this.vertexAttributeLocations=A,this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[S.OPAQUE_MATERIAL,t=>(this.parameters.castShadows&&o(t)||a(t))&&!this.transparent],[S.TRANSPARENT_MATERIAL,t=>(this.parameters.castShadows&&o(t)||a(t))&&this.transparent]]),this._configuration=new y(e.spherical)}get hasEmissions(){return this.parameters.emissiveStrength>0}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=e.hasOccludees,n(t)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?u.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?u.WindingOrder:u.None,this._configuration.receiveShadows=e.shadowMap.enabled,this._configuration.receiveAmbientOcclusion=null!=e.ssao):this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?m.Schematic:m.Disabled,this._configuration.emissionSource=this.parameters.usePBR?p.SymbolColor:p.None,this._configuration.hasBloom=h(t),this._configuration.oitPass=e.oitPass,this._configuration.terrainDepthTest=e.terrainDepthTest,this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.snowCover=e.snowCover,this._configuration}isVisibleForOutput(t){return t!==c.Shadow&&t!==c.ShadowExcludeHighlight&&t!==c.ShadowHighlight||this.parameters.castShadows}get visible(){return this.parameters.opacity>=E}intersect(t,e,i,r,s,o){this._intersect(t,i,r,s,o)}intersectDraped(t,e,i,r){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersect(t,e,this._pp0,this._pp1,r)}_intersect(i,s,o,a,n){const h=i;if(!b(h))return;const c=h.path,p=e(this.parameters.size);if(this.parameters.vvSize){const{offset:e,factor:i,minSize:r,maxSize:s,fallback:o}=this.parameters.vvSize,a=c.sizeAttributeValue;Number.isNaN(a)?(p[0]*=o[0],p[1]*=o[2]):(p[0]*=t(e[0]+a*i[0],r[0],s[0]),p[1]*=t(e[2]+a*i[2],r[2],s[2]))}const u=new g(!1,s.options.normalRequired),m=Math.max(p[0],p[1]),l=i.boundingInfo;if(null==l)return void w(c,p,o,a,u,n);const f=r(l.bbMin[0]-m,l.bbMin[1]-m,l.bbMin[2]-m,l.bbMax[0]+m,l.bbMax[1]+m,l.bbMax[2]+m),d=[a[0]-o[0],a[1]-o[1],a[2]-o[2]],S=Math.sqrt(d[0]*d[0]+d[1]*d[1]+d[2]*d[2]),_=[S/d[0],S/d[1],S/d[2]];v(f,o,_,s.tolerance)&&w(c,p,o,a,u,n)}createBufferWriter(){return new T(this._layout)}get _layout(){const t=s().vec3f(_.POSITION).vec4f16(_.PROFILEVERTEXANDNORMAL).vec3f16(_.PROFILEAUXDATA).vec2i16(_.PROFILERIGHT,{glNormalized:!0}).vec2i16(_.PROFILEUP,{glNormalized:!0});return this.parameters.vvSize&&t.f32(_.SIZEFEATUREATTRIBUTE),this.parameters.vvColor&&t.f16(_.COLORFEATUREATTRIBUTE),this.parameters.vvOpacity&&t.f16(_.OPACITYFEATUREATTRIBUTE),l()&&t.vec4u8(_.OLIDCOLOR),t}createGLMaterial(t){return new j(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class j extends f{beginSlot(t){return this.getTechnique(R,t)}}function w(t,e,i,r,s,o){t.baked.size&&t.baked.size[0]===e[0]&&t.baked.size[1]===e[1]||t.baked.bake(e),t.baked.intersect(i,r,s,o)}class I extends O{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1}}export{I as Parameters,P as PathMaterial};
5
+ import{clamp as t}from"../../../../core/mathUtils.js";import{clone as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as o,is3DGeometryOutputMRT as a,isColorOrColorEmission as n,isColorEmission as h,ShaderOutput as c}from"../core/shaderLibrary/ShaderOutput.js";import{EmissionSource as p}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as u}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as m}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import f from"../lib/GLMaterial.js";import{Material as d}from"../lib/Material.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as g,intersectAabbInvDir as v}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as _}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as T}from"./DefaultBufferWriter.js";import{vertexAttributeLocations as A,PathPassParameters as O,PathTechnique as R}from"./PathTechnique.js";import{PathTechniqueConfiguration as y}from"./PathTechniqueConfiguration.js";import{alphaCutoff as E}from"../../../../webscene/support/AlphaCutoff.js";class P extends d{constructor(t,e){super(t,I),this.vertexAttributeLocations=A,this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[S.OPAQUE_MATERIAL,t=>(this.parameters.castShadows&&o(t)||a(t))&&!this.transparent],[S.TRANSPARENT_MATERIAL,t=>(this.parameters.castShadows&&o(t)||a(t))&&this.transparent]]),this._configuration=new y(e.spherical)}get hasEmissions(){return this.parameters.emissiveStrength>0}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=e.hasOccludees,n(t)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?u.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?u.WindingOrder:u.None,this._configuration.receiveShadows=e.shadowMap.enabled,this._configuration.receiveAmbientOcclusion=null!=e.ssao):this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?m.Schematic:m.Disabled,this._configuration.emissionSource=this.parameters.usePBR?p.SymbolColor:p.None,this._configuration.hasBloom=h(t),this._configuration.oitPass=e.oitPass,this._configuration.terrainDepthTest=e.terrainDepthTest,this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.snowCover=e.snowCover,this._configuration}isVisibleForOutput(t){return t!==c.Shadow&&t!==c.ShadowExcludeHighlight&&t!==c.ShadowHighlight||this.parameters.castShadows}get visible(){return this.parameters.opacity>=E}intersect(t,e,i,r,s,o){this._intersect(t,i,r,s,o)}intersectDraped(t,e,i,r){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersect(t,e,this._pp0,this._pp1,r)}_intersect(i,s,o,a,n){const h=i;if(!b(h))return;const c=h.path,p=e(this.parameters.size);if(this.parameters.vvSize){const{offset:e,factor:i,minSize:r,maxSize:s,fallback:o}=this.parameters.vvSize,a=c.sizeAttributeValue;Number.isNaN(a)?(p[0]*=o[0],p[1]*=o[2]):(p[0]*=t(e[0]+a*i[0],r[0],s[0]),p[1]*=t(e[2]+a*i[2],r[2],s[2]))}const u=new g(!1,s.options.normalRequired),m=Math.max(p[0],p[1]),l=i.boundingInfo;if(null==l)return void w(c,p,o,a,u,n);const f=r(l.bbMin[0]-m,l.bbMin[1]-m,l.bbMin[2]-m,l.bbMax[0]+m,l.bbMax[1]+m,l.bbMax[2]+m),d=[a[0]-o[0],a[1]-o[1],a[2]-o[2]],S=Math.sqrt(d[0]*d[0]+d[1]*d[1]+d[2]*d[2]),_=[S/d[0],S/d[1],S/d[2]];v(f,o,_,s.tolerance)&&w(c,p,o,a,u,n)}createBufferWriter(){return new T(this._layout)}get _layout(){const t=s().vec3f(_.POSITION).vec4f16(_.PROFILEVERTEXANDNORMAL).vec2i16(_.PROFILERIGHT,{glNormalized:!0}).vec2i16(_.PROFILEUP,{glNormalized:!0});return this.parameters.vvSize&&t.f32(_.SIZEFEATUREATTRIBUTE),t.vec3f16(_.PROFILEAUXDATA),this.parameters.vvColor&&t.f16(_.COLORFEATUREATTRIBUTE),this.parameters.vvOpacity&&t.f16(_.OPACITYFEATUREATTRIBUTE),l()&&t.vec4u8(_.OLIDCOLOR),t}createGLMaterial(t){return new j(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class j extends f{beginSlot(t){return this.getTechnique(R,t)}}function w(t,e,i,r,s,o){t.baked.size&&t.baked.size[0]===e[0]&&t.baked.size[1]===e[1]||t.baked.bake(e),t.baked.intersect(i,r,s,o)}class I extends O{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1}}export{I as Parameters,P as PathMaterial};
package/views/ui/UI.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import"../../intl.js";import o from"../../core/Accessor.js";import{isSome as e}from"../../core/arrayUtils.js";import n from"../../core/Evented.js";import{makeHandle as i}from"../../core/handleUtils.js";import{watch as r,initial as s}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import{cast as d}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{setCalciteModeClass as c}from"../../support/modeUtils.js";import l from"./Component.js";import{isRTL as h}from"../../widgets/support/widgetUtils.js";import{getLocale as m,onLocaleChange as u}from"../../intl/locale.js";const f={left:0,top:0,bottom:0,right:0},_={bottom:30,top:15,right:15,left:15},g="esri-ui",y={ui:g,corner:`${g}-corner`,innerContainer:`${g}-inner-container`,manualContainer:`${g}-manual-container`,cornerContainer:`${g}-corner-container`,topLeft:`${g}-top-left`,topRight:`${g}-top-right`,bottomLeft:`${g}-bottom-left`,bottomRight:`${g}-bottom-right`};function C(t){return t&&!t._started&&"function"==typeof t.postMixInProperties&&"function"==typeof t.buildRendering&&"function"==typeof t.postCreate&&"function"==typeof t.startup}function v(t){return 0===t?"0":`${t}px`}function b(t){const o="object"==typeof t&&null!==t&&Object.getPrototypeOf(t);return(null===o||o===Object.prototype)&&("component"in t||"index"in t||"position"in t)?t:null}function w(t,{top:o,bottom:e,left:n,right:i}){t.style.top=o,t.style.bottom=e,t.style.left=n,t.style.right=i}let P=class extends n.EventedAccessor{constructor(t){super(t),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentMap=new Map,this._removeWidgetHandleKey=Symbol("componentOnRemoveSymbol"),this._locale=m(),this.view=null,this._applyViewPadding=()=>{const t=this.container;t&&w(t,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const t=this._innerContainer;t&&w(t,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([r((()=>[this.view?.padding,this.container]),this._applyViewPadding,s),r((()=>this.padding),this._applyUIPadding,s),r((()=>[this.container,this._locale]),(([t,o])=>{t&&t.setAttribute("lang",o)}),s),u((t=>{this._locale=t}))])}destroy(){this.container=null;for(const t of this._components)t.destroy();this._components.length=0,this._componentMap.clear()}set container(t){const o=this._get("container");t!==o&&(t&&(t.classList.add(y.ui),c(t),this._attachContainers(t)),o&&(o.classList.remove(y.ui),w(o,{top:"",bottom:"",left:"",right:""}),o.textContent=""),this._set("container",t))}get height(){const t=this.view?.height??0;if(0===t)return t;const o=this._getViewPadding(),{top:e,bottom:n}=o;return Math.max(t-e-n,0)}get padding(){return this._get("padding")}set padding(t){this._overrideIfSome("padding",t)}castPadding(t){return"number"==typeof t?{bottom:t,top:t,right:t,left:t}:{..._,...t}}get width(){const t=this.view?.width??0;if(0===t)return t;const o=this._getViewPadding(),{left:e,right:n}=o;return Math.max(t-e-n,0)}add(t,o){let e,n,i;if(Array.isArray(t))return void t.forEach((t=>this.add(t,o)));const r=b(t);r&&({index:e,position:o,component:t,key:n}=r),o&&"object"==typeof o&&({index:e,key:n,position:o,internal:i}=o),!t||o&&!this._isValidPosition(o)||this._add(t,o,e,n,i)}remove(t,o){if(!t)return;if(Array.isArray(t))return t.map((t=>this.remove(t,o)));const e=this._find(t);if(e){if(this._componentMap.has(e)&&this._componentMap.get(e)?.key!==o)return;const t=this._components.indexOf(e),n=e.node.parentNode;return n?.removeChild(e.node),this._componentMap.delete(e),e.widget?.removeHandlesReference(this._removeWidgetHandleKey),this._components.splice(t,1)[0]}}empty(t,o={removeInternal:!1}){if(Array.isArray(t)){for(const e of t)this.empty(e,o);return}const e=this._positionNameToContainerLookup[t??"manual"],n=Array.prototype.slice.call(e.children).map((t=>this._findByNode(t))).filter((t=>{if(null==t)return!1;return!(this._componentMap.get(t)?.internal??!1)||o.removeInternal}));for(const i of n)this.remove(i)}move(t,o){if(Array.isArray(t)&&t.forEach((t=>this.move(t,o))),!t)return;let e;const n=b(t)||b(o);if(n&&(e=n.index,o=n.position,t=n.component||t),o&&!this._isValidPosition(o))return;const i=this.remove(t);i&&this.add(i,{position:o,index:e})}find(t){if(!t)return null;const o=this._findById(t);return o&&(o.widget||o.node)}getComponents(t,o={includeInternal:!1}){return t?Array.isArray(t)?t.flatMap((t=>this._getComponentsAtPosition(t,o))):this._getComponentsAtPosition(t,o):this._components.filter((t=>o.includeInternal||!this._componentMap.get(t)?.internal)).map((({widget:t,node:o})=>t??o))}getPosition(t){for(const o in this._positionNameToContainerLookup){if(this._positionNameToContainerLookup[o].contains(t))return o}return null}_add(t,e,n,r,s){t instanceof l||(t=new l({node:t}));const{widget:a}=t;null!=a&&a instanceof o&&a.addHandles(i((()=>{queueMicrotask((()=>this.remove(t)))})),this._removeWidgetHandleKey),this._place({component:t,position:e,index:n}),this._components.push(t),this._componentMap.set(t,{key:r,internal:s})}_find(t){return t?t instanceof l?this._findByComponent(t):"string"==typeof t?this._findById(t):this._findByNode(t.domNode||t):null}_getViewPadding(){return this.view?.padding??f}_attachContainers(t){t.appendChild(this._innerContainer),t.appendChild(this._manualContainer)}_initContainers(){const t=document.createElement("div");t.classList.add(y.innerContainer,y.cornerContainer);const o=document.createElement("div");o.classList.add(y.innerContainer,y.manualContainer);const e=document.createElement("div");e.classList.add(y.topLeft,y.corner),t.appendChild(e);const n=document.createElement("div");n.classList.add(y.topRight,y.corner),t.appendChild(n);const i=document.createElement("div");i.classList.add(y.bottomLeft,y.corner),t.appendChild(i);const r=document.createElement("div");r.classList.add(y.bottomRight,y.corner),t.appendChild(r),this._innerContainer=t,this._manualContainer=o;const s=h();this._cornerNameToContainerLookup={"top-left":e,"top-right":n,"bottom-left":i,"bottom-right":r,"top-leading":s?n:e,"top-trailing":s?e:n,"bottom-leading":s?r:i,"bottom-trailing":s?i:r},this._positionNameToContainerLookup={manual:o,...this._cornerNameToContainerLookup}}_isValidPosition(t){return!!this._positionNameToContainerLookup[t]}_place(t){const o=t.position??"manual",{component:e,index:n}=t,i=this._positionNameToContainerLookup[o],r=null!=n&&n>-1;if(C(e.widget)&&e.widget.startup(),!r)return void i.appendChild(e.node);const s=Array.from(i.children);if(0===n){const{firstChild:t}=i;return void(t?t.parentNode?.insertBefore(e.node,t):i.appendChild(e.node))}if(n>=s.length)return void i.appendChild(e.node);const a=s[n];a.parentNode?.insertBefore(e.node,a)}_toPixelPosition(t){return{top:v(t.top),left:v(t.left),right:v(t.right),bottom:v(t.bottom)}}_findByComponent(t){return this._components.find((o=>o===t))??null}_findById(t){return this._components.find((({id:o})=>o===t))??null}_findByNode(t){return this._components.find((({node:o})=>o===t))??null}_getComponentsAtPosition(t,o){const n=this._positionNameToContainerLookup[t];return Array.prototype.slice.call(n.children).map((t=>this._findByNode(t))).filter(e).filter((t=>o.includeInternal||!this._componentMap.get(t)?.internal)).map((({widget:t,node:o})=>t??o))}};t([a()],P.prototype,"_locale",void 0),t([a()],P.prototype,"container",null),t([a()],P.prototype,"height",null),t([a({value:_})],P.prototype,"padding",null),t([d("padding")],P.prototype,"castPadding",null),t([a()],P.prototype,"view",void 0),t([a()],P.prototype,"width",null),P=t([p("esri.views.ui.UI")],P);const L=P;export{L as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import"../../intl.js";import o from"../../core/Accessor.js";import{isSome as n}from"../../core/arrayUtils.js";import e from"../../core/Evented.js";import{makeHandle as i}from"../../core/handleUtils.js";import{watch as r,initial as s}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import{cast as p}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{setCalciteModeClass as c}from"../../support/modeUtils.js";import l from"./Component.js";import{isRTL as h}from"../../widgets/support/widgetUtils.js";import{getLocale as m,onLocaleChange as u}from"../../intl/locale.js";const f={left:0,top:0,bottom:0,right:0},_={bottom:30,top:15,right:15,left:15},g="esri-ui",y={ui:g,corner:`${g}-corner`,innerContainer:`${g}-inner-container`,manualContainer:`${g}-manual-container`,cornerContainer:`${g}-corner-container`,topLeft:`${g}-top-left`,topRight:`${g}-top-right`,bottomLeft:`${g}-bottom-left`,bottomRight:`${g}-bottom-right`};function C(t){return t&&!t._started&&"function"==typeof t.postMixInProperties&&"function"==typeof t.buildRendering&&"function"==typeof t.postCreate&&"function"==typeof t.startup}function v(t){return 0===t?"0":`${t}px`}function b(t){const o="object"==typeof t&&null!==t&&Object.getPrototypeOf(t);return(null===o||o===Object.prototype)&&("component"in t||"index"in t||"position"in t)?t:null}function w(t,{top:o,bottom:n,left:e,right:i}){t.style.top=o,t.style.bottom=n,t.style.left=e,t.style.right=i}let P=class extends e.EventedAccessor{constructor(t){super(t),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentMap=new Map,this._removeWidgetHandleKey=Symbol("componentOnRemoveSymbol"),this._locale=m(),this.view=null,this._applyViewPadding=()=>{const t=this.container;t&&w(t,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const t=this._innerContainer;t&&w(t,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([r((()=>[this.view?.padding,this.container]),this._applyViewPadding,s),r((()=>this.padding),this._applyUIPadding,s),r((()=>[this.container,this._locale]),(([t,o])=>{t&&t.setAttribute("lang",o)}),s),u((t=>{this._locale=t}))])}destroy(){this.container=null;for(const t of this._components)t.destroy();this._components.length=0,this._componentMap.clear()}set container(t){const o=this._get("container");t!==o&&(t&&(t.classList.add(y.ui),c(t),this._attachContainers(t)),o&&(o.classList.remove(y.ui),w(o,{top:"",bottom:"",left:"",right:""}),o.textContent=""),this._set("container",t))}get height(){const t=this.view?.height??0;if(0===t)return t;const o=this._getViewPadding(),{top:n,bottom:e}=o;return Math.max(t-n-e,0)}get padding(){return this._get("padding")}set padding(t){this._overrideIfSome("padding",t)}castPadding(t){return"number"==typeof t?{bottom:t,top:t,right:t,left:t}:{..._,...t}}get width(){const t=this.view?.width??0;if(0===t)return t;const o=this._getViewPadding(),{left:n,right:e}=o;return Math.max(t-n-e,0)}add(t,o){let n,e,i;if(Array.isArray(t))return void t.forEach((t=>this.add(t,o)));const r=b(t);r&&({index:n,position:o,component:t,key:e}=r),o&&"object"==typeof o&&({index:n,key:e,position:o,internal:i}=o),!t||o&&!this._isValidPosition(o)||this._add(t,o,n??this._components.length,e,i)}remove(t,o){if(!t)return;if(Array.isArray(t))return t.map((t=>this.remove(t,o)));const n=this._find(t);if(n){if(this._componentMap.has(n)&&this._componentMap.get(n)?.key!==o)return;const t=this._components.indexOf(n),e=n.node.parentNode;return e?.removeChild(n.node),this._componentMap.delete(n),n.widget?.removeHandlesReference(this._removeWidgetHandleKey),this._components.splice(t,1)[0]}}empty(t,o={removeInternal:!1}){if(Array.isArray(t)){for(const n of t)this.empty(n,o);return}const n=this._positionNameToContainerLookup[t??"manual"],e=Array.prototype.slice.call(n.children).map((t=>this._findByNode(t))).filter((t=>{if(null==t)return!1;return!(this._componentMap.get(t)?.internal??!1)||o.removeInternal}));for(const i of e)this.remove(i)}move(t,o){if(Array.isArray(t)&&t.forEach((t=>this.move(t,o))),!t)return;let n;const e=b(t)||b(o);if(e&&(n=e.index,o=e.position,t=e.component||t),o&&!this._isValidPosition(o))return;const i=this.remove(t);i&&this.add(i,{position:o,index:n})}find(t){if(!t)return null;const o=this._findById(t);return o&&(o.widget||o.node)}getComponents(t,o={includeInternal:!1}){return t?Array.isArray(t)?t.flatMap((t=>this._getComponentsAtPosition(t,o))):this._getComponentsAtPosition(t,o):this._components.filter((t=>o.includeInternal||!this._componentMap.get(t)?.internal)).map((({widget:t,node:o})=>t??o))}getPosition(t){for(const o in this._positionNameToContainerLookup){if(this._positionNameToContainerLookup[o].contains(t))return o}return null}_add(t,n,e,r,s){t instanceof l||(t=new l({node:t}));const{widget:a}=t;null!=a&&a instanceof o&&a.addHandles(i((()=>{queueMicrotask((()=>this.remove(t)))})),this._removeWidgetHandleKey),this._components.forEach((t=>{const o=this._componentMap.get(t);o&&o.index>=e&&o.index++})),this._place({component:t,position:n,index:e}),this._components.push(t),this._componentMap.set(t,{key:r,internal:s,index:e})}_find(t){return t?t instanceof l?this._findByComponent(t):"string"==typeof t?this._findById(t):this._findByNode(t.domNode||t):null}_getViewPadding(){return this.view?.padding??f}_attachContainers(t){t.appendChild(this._innerContainer),t.appendChild(this._manualContainer)}_initContainers(){const t=document.createElement("div");t.classList.add(y.innerContainer,y.cornerContainer);const o=document.createElement("div");o.classList.add(y.innerContainer,y.manualContainer);const n=document.createElement("div");n.classList.add(y.topLeft,y.corner),t.appendChild(n);const e=document.createElement("div");e.classList.add(y.topRight,y.corner),t.appendChild(e);const i=document.createElement("div");i.classList.add(y.bottomLeft,y.corner),t.appendChild(i);const r=document.createElement("div");r.classList.add(y.bottomRight,y.corner),t.appendChild(r),this._innerContainer=t,this._manualContainer=o;const s=h();this._cornerNameToContainerLookup={"top-left":n,"top-right":e,"bottom-left":i,"bottom-right":r,"top-leading":s?e:n,"top-trailing":s?n:e,"bottom-leading":s?r:i,"bottom-trailing":s?i:r},this._positionNameToContainerLookup={manual:o,...this._cornerNameToContainerLookup}}_isValidPosition(t){return!!this._positionNameToContainerLookup[t]}_place(t){const o=t.position??"manual",{component:n,index:e}=t,i=this._positionNameToContainerLookup[o],r=null!=e&&e>-1;if(C(n.widget)&&n.widget.startup(),!r)return void i.appendChild(n.node);const s=Array.from(i.children);if(0!==s.length){for(const t of s){const o=this._findByNode(t);if(o&&e<(this._componentMap.get(o)?.index??0))return void t.parentNode?.insertBefore(n.node,t)}i.appendChild(n.node)}else i.appendChild(n.node)}_toPixelPosition(t){return{top:v(t.top),left:v(t.left),right:v(t.right),bottom:v(t.bottom)}}_findByComponent(t){return this._components.find((o=>o===t))??null}_findById(t){return this._components.find((({id:o})=>o===t))??null}_findByNode(t){return this._components.find((({node:o})=>o===t))??null}_getComponentsAtPosition(t,o){const e=this._positionNameToContainerLookup[t];return Array.prototype.slice.call(e.children).map((t=>this._findByNode(t))).filter(n).filter((t=>o.includeInternal||!this._componentMap.get(t)?.internal)).map((({widget:t,node:o})=>t??o))}};t([a()],P.prototype,"_locale",void 0),t([a()],P.prototype,"container",null),t([a()],P.prototype,"height",null),t([a({value:_})],P.prototype,"padding",null),t([p("padding")],P.prototype,"castPadding",null),t([a()],P.prototype,"view",void 0),t([a()],P.prototype,"width",null),P=t([d("esri.views.ui.UI")],P);const L=P;export{L as default};