@arcgis/core 4.33.0-next.20250131 → 4.33.0-next.20250201

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 (317) hide show
  1. package/WebScene.js +1 -1
  2. package/arcade/featureset/support/shared.js +1 -1
  3. package/arcade/geometry/unitConversion.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{b68bddd0c4ca91493543.js → 06d489a44d88e38fb140.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{4696278d033907a067c7.js → 085462ba3da7849fc296.js} +1 -1
  7. package/assets/esri/core/workers/chunks/0a19e1aec6a5502e391a.js +1 -0
  8. package/assets/esri/core/workers/chunks/{7a273e6e411f6cc31b3f.js → 326a3f50e585e492b673.js} +1 -1
  9. package/assets/esri/core/workers/chunks/4decfae8bc5e80878bdd.js +1 -0
  10. package/assets/esri/core/workers/chunks/{e0de91eacf3a3b7eda55.js → 5b20ee64248f2d5c937f.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{bef27448b341e429eb31.js → 692b3d03346f030aa649.js} +7 -7
  12. package/assets/esri/core/workers/chunks/6ec108bd955e064256b5.js +1 -0
  13. package/assets/esri/core/workers/chunks/c94ec324ecad77c53a87.js +1 -0
  14. package/assets/esri/core/workers/chunks/{ef6afba80fa2086ec104.js → e9f7953938b9bc8e8abe.js} +1 -1
  15. package/assets/esri/core/workers/chunks/fb1a89f753057f889971.js +314 -0
  16. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +4 -1
  17. package/assets/esri/themes/dark/main.css +1 -1
  18. package/assets/esri/themes/light/main.css +1 -1
  19. package/assets/esri/themes/light/view.css +1 -1
  20. package/assets/esri/widgets/Directions/t9n/Directions.json +1 -1
  21. package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
  22. package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
  23. package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
  24. package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
  25. package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
  26. package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
  27. package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
  28. package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
  29. package/assets/esri/widgets/Directions/t9n/Directions_en.json +1 -1
  30. package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
  31. package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
  32. package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
  33. package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
  34. package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
  35. package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
  36. package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
  37. package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
  38. package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
  39. package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
  40. package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
  41. package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
  42. package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
  43. package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
  44. package/assets/esri/widgets/Directions/t9n/Directions_no.json +1 -1
  45. package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
  46. package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
  47. package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
  48. package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
  49. package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
  50. package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
  51. package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
  52. package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
  53. package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
  54. package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
  55. package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
  56. package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
  57. package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
  58. package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
  59. package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
  60. package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
  61. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  62. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  63. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  64. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  65. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  66. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  67. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  68. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  69. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  70. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  71. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  72. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  73. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  74. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  75. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  76. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  77. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  78. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  79. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  80. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  81. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  82. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  83. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  84. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  85. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  86. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  87. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  88. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  89. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  90. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  91. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  92. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  93. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  94. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  95. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  96. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  97. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  98. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  99. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  100. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ar.json +1 -1
  101. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bg.json +1 -1
  102. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bs.json +1 -1
  103. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ca.json +1 -1
  104. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_cs.json +1 -1
  105. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_da.json +1 -1
  106. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_de.json +1 -1
  107. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_el.json +1 -1
  108. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_es.json +1 -1
  109. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_et.json +1 -1
  110. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fi.json +1 -1
  111. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fr.json +1 -1
  112. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_he.json +1 -1
  113. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hr.json +1 -1
  114. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hu.json +1 -1
  115. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_id.json +1 -1
  116. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_it.json +1 -1
  117. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ja.json +1 -1
  118. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ko.json +1 -1
  119. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lt.json +1 -1
  120. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lv.json +1 -1
  121. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_nl.json +1 -1
  122. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_no.json +1 -1
  123. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pl.json +1 -1
  124. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-BR.json +1 -1
  125. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-PT.json +1 -1
  126. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ro.json +1 -1
  127. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ru.json +1 -1
  128. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sk.json +1 -1
  129. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sl.json +1 -1
  130. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sr.json +1 -1
  131. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sv.json +1 -1
  132. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_th.json +1 -1
  133. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_tr.json +1 -1
  134. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_uk.json +1 -1
  135. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_vi.json +1 -1
  136. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-CN.json +1 -1
  137. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-HK.json +1 -1
  138. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-TW.json +1 -1
  139. package/geometry/support/typeUtils.js +1 -1
  140. package/interfaces.d.ts +154 -7
  141. package/layers/FeatureLayer.js +1 -1
  142. package/layers/support/rasterFieldUtils.js +1 -1
  143. package/package.json +1 -1
  144. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  145. package/support/revision.js +1 -1
  146. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  147. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  148. package/views/2d/layers/features/layerAdapters/geometryUtils.js +1 -1
  149. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  150. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  151. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  152. package/views/3d/environment/CloudsComposition.js +1 -1
  153. package/views/3d/environment/CloudsCompositionTechnique.js +1 -1
  154. package/views/3d/environment/CloudsRenderer.js +1 -1
  155. package/views/3d/environment/CloudsTechnique.js +1 -1
  156. package/views/3d/environment/Fog.js +1 -1
  157. package/views/3d/environment/FogTechnique.js +1 -1
  158. package/views/3d/environment/LocalAtmosphere.js +1 -1
  159. package/views/3d/environment/MarsAtmosphere.js +1 -1
  160. package/views/3d/environment/NoiseTextureAtlas.js +1 -1
  161. package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
  162. package/views/3d/environment/Precipitation.js +1 -1
  163. package/views/3d/environment/PrecipitationTechnique.js +1 -1
  164. package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
  165. package/views/3d/interactive/editingTools/media/ControlPointOperations.js +1 -1
  166. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  167. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  168. package/views/3d/layers/GraphicsView3D.js +1 -1
  169. package/views/3d/layers/RouteLayerView3D.js +1 -1
  170. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  171. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  172. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  173. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  174. package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
  175. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
  176. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandEncoder.js +1 -1
  177. package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
  178. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  179. package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
  180. package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
  181. package/views/3d/support/hitTest.js +1 -1
  182. package/views/3d/terrain/BlendLayersTechnique.js +1 -1
  183. package/views/3d/terrain/OverlayRenderer.js +1 -1
  184. package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
  185. package/views/3d/terrain/TerrainRenderer.js +1 -1
  186. package/views/3d/terrain/TileCompositor.js +1 -1
  187. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  188. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  189. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  190. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  191. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  192. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  193. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  194. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  195. package/views/3d/webgl-engine/effects/bloom/BloomBlurTechnique.js +1 -1
  196. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechnique.js +1 -1
  197. package/views/3d/webgl-engine/effects/bloom/BloomDepthAdjustTechnique.js +1 -1
  198. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  199. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  200. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
  201. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  202. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +1 -1
  203. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  204. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  205. package/views/3d/webgl-engine/effects/haze/HazeCompositingTechnique.js +1 -1
  206. package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
  207. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  208. package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
  209. package/views/3d/webgl-engine/effects/highlight/HighlightDownsampleTechnique.js +1 -1
  210. package/views/3d/webgl-engine/effects/highlight/HighlightToSingleTechnique.js +1 -1
  211. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  212. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  213. package/views/3d/webgl-engine/effects/highlight/SingleHighlightApplyTechnique.js +1 -1
  214. package/views/3d/webgl-engine/effects/highlight/SingleHighlightBlurTechnique.js +1 -1
  215. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  216. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
  217. package/views/3d/webgl-engine/effects/laserlines/LaserlineTechnique.js +1 -1
  218. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  219. package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
  220. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  221. package/views/3d/webgl-engine/effects/smaa/SMAABlendWeightsTechnique.js +1 -1
  222. package/views/3d/webgl-engine/effects/smaa/SMAABlurTechnique.js +1 -1
  223. package/views/3d/webgl-engine/effects/smaa/SMAAEdgeDetectTechnique.js +1 -1
  224. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  225. package/views/3d/webgl-engine/effects/ssao/SSAOBlurTechnique.js +1 -1
  226. package/views/3d/webgl-engine/effects/ssao/SSAOTechnique.js +1 -1
  227. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  228. package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
  229. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  230. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  231. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  232. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  233. package/views/3d/webgl-engine/lib/GLMaterial.js +1 -1
  234. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  235. package/views/3d/webgl-engine/lib/IntersectorTarget.js +1 -1
  236. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  237. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  238. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  239. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  240. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  241. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  242. package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
  243. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  244. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  245. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
  246. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  247. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  248. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  249. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  250. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  251. package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
  252. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  253. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  254. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  255. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  256. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  257. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  258. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  259. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  260. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  261. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  262. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  263. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  264. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  265. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  266. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  267. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  268. package/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique.js +1 -1
  269. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  270. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  271. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  272. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  273. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +1 -1
  274. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  275. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  276. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  277. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  278. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  279. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  280. package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
  281. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  282. package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +1 -1
  283. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  284. package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
  285. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  286. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  287. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  288. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  289. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  290. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  291. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  292. package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
  293. package/views/draw/DrawOperation.js +1 -1
  294. package/views/draw/support/helpMessageUtils.js +1 -1
  295. package/views/draw/support/tooltipUtils.js +1 -1
  296. package/views/interactive/keybindings.js +1 -1
  297. package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
  298. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  299. package/views/interactive/snapping/snappingUtils.js +1 -1
  300. package/views/interactive/tooltip/content/tooltipContentFactory.js +1 -1
  301. package/views/interactive/tooltip/infos/DrawCircleTooltipInfo.js +1 -1
  302. package/views/interactive/tooltip/infos/DrawMultipointTooltipInfo.js +5 -0
  303. package/views/interactive/tooltip/infos/DrawRectangleTooltipInfo.js +1 -1
  304. package/views/layers/FeatureLayerView.js +1 -1
  305. package/views/layers/MediaLayerView.js +1 -1
  306. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  307. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  308. package/widgets/BatchAttributeForm.js +1 -1
  309. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  310. package/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel.d.ts +4 -0
  311. package/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel.js +1 -1
  312. package/widgets/support/widget.d.ts +9 -0
  313. package/assets/esri/core/workers/chunks/0bafa546602b776caf2f.js +0 -1
  314. package/assets/esri/core/workers/chunks/258b46b58a4860942f7c.js +0 -1
  315. package/assets/esri/core/workers/chunks/69ab4b780f7223cfd7dd.js +0 -1
  316. package/assets/esri/core/workers/chunks/83edac97a52b26ead1ea.js +0 -314
  317. package/assets/esri/core/workers/chunks/9ffa27d0517bad84572e.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{copy as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r,IDENTITY as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as s,t as e,h as a,l as n,c as o,n as h}from"../../../../chunks/vec32.js";import{create as d,UNIT_Z as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as l}from"../../../../chunks/vec42.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as m,fromPoints as y,copy as u}from"../../../../geometry/support/ray.js";import{ViewingMode as p}from"../../../ViewingMode.js";import{IntersectorOptions as g,StoreResults as _,IntersectorType as O}from"./IntersectorInterfaces.js";import{HudTarget as L}from"./IntersectorTarget.js";import{isValidIntersectorResult as v}from"./intersectorUtils.js";import{IntersectorTransform as j,getVerticalOffsetObject3D as w}from"./verticalOffsetUtils.js";const E=1e-5;class b{constructor(t){this.options=new g,this._results=new A,this.transform=new j,this.tolerance=E,this.verticalOffset=null,this._ray=m(),this._rayEnd=d(),this._rayBeginTransformed=d(),this._rayEndTransformed=d(),this.viewingMode=t??p.Global}get results(){return this._results}get ray(){return this._ray}get rayBegin(){return this._ray.origin}get rayEnd(){return this._rayEnd}reset(t,r,i){this.resetWithRay(y(t,r,this._ray),i)}resetWithRay(t,r){this.camera=r,t!==this._ray&&u(t,this._ray),0!==this.options.verticalOffset?this.viewingMode===p.Local?this._ray.origin[2]-=this.options.verticalOffset:this.verticalOffset=this.options.verticalOffset:this.verticalOffset=null,s(this._rayEnd,this._ray.origin,this._ray.direction),this._results.init(this._ray)}intersect(t=null,r,i,s,e){this.point=r,this.filterPredicate=s,this.tolerance=i??E;const a=w(this.verticalOffset);if(t&&t.length>0){const r=e?t=>{e(t)&&this.intersectObject(t)}:t=>{this.intersectObject(t)};for(const i of t){const t=i.getSpatialQueryAccelerator?.();null!=t?(null!=a?t.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,r,a):t.forEachAlongRay(this._ray.origin,this._ray.direction,r),this.options.selectionMode&&this.options.hud&&t.forEachDegenerateObject(r)):i.objects.forAll((t=>r(t)))}}this.sortResults()}intersectObject(t){const r=t.geometries;if(!r)return;const s=t.effectiveTransformation,a=w(this.verticalOffset);for(const n of r){if(!n.visible)continue;const{material:r,id:o}=n;if(!r.visible)continue;this.transform.setAndInvalidateLazyTransforms(s,n.transformation),e(this._rayBeginTransformed,this.rayBegin,this.transform.inverse),e(this._rayEndTransformed,this.rayEnd,this.transform.inverse);const h=this.transform.transform;null!=a&&(a.objectTransform=this.transform),r.intersect(n,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,((r,s,e,a,n,d)=>{if(r>=0){if(null!=this.filterPredicate&&!this.filterPredicate(this._ray.origin,this._rayEnd,r))return;const c=a?this._results.hud:this._results,l=a?a=>{const h=new L(t,o,e,d);a.set(O.HUD,h,r,s,i,n)}:i=>i.set(O.OBJECT,{object:t,geometryId:o,triangleNr:e},r,s,h,n);if((null==c.min.drapedLayerOrder||n>=c.min.drapedLayerOrder)&&(null==c.min.dist||r<c.min.dist)&&l(c.min),this.options.store!==_.MIN&&(null==c.max.drapedLayerOrder||n<c.max.drapedLayerOrder)&&(null==c.max.dist||r>c.max.dist)&&l(c.max),this.options.store===_.ALL)if(a){const t=new B(this._ray);l(t),this._results.hud.all.push(t)}else{const t=new I(this._ray);l(t),this._results.all.push(t)}}}))}}sortResults(t=this._results.all){t.sort(((t,r)=>t.dist!==r.dist?(t.dist??0)-(r.dist??0):t.drapedLayerOrder!==r.drapedLayerOrder?x(t.drapedLayerOrder,r.drapedLayerOrder):x(t.drapedLayerGraphicOrder,r.drapedLayerGraphicOrder)))}}function x(t,r){return(r??-Number.MAX_VALUE)-(t??-Number.MAX_VALUE)}function T(t){return new b(t)}class A{constructor(){this.min=new I(m()),this.max=new I(m()),this.hud={min:new B(m()),max:new B(m()),all:new Array},this.ground=new I(m()),this.all=[]}init(t){this.min.init(t),this.max.init(t),this.ground.init(t),this.all.length=0,this.hud.min.init(t),this.hud.max.init(t),this.hud.all.length=0}}class I{get ray(){return this._ray}get distanceInRenderSpace(){return null!=this.dist?(a(G,this.ray.direction,this.dist),n(G)):null}withinDistance(t){return!!v(this)&&this.distanceInRenderSpace<=t}getIntersectionPoint(t){return!!v(this)&&(a(G,this.ray.direction,this.dist),s(t,this.ray.origin,G),!0)}getTransformedNormal(t){return o(M,this.normal),M[3]=0,l(M,M,this.transformation),o(t,M),h(t,t)}constructor(t){this.intersector=O.OBJECT,this.normal=d(),this.transformation=r(),this._ray=m(),this.init(t)}init(t){this.dist=null,this.target=null,this.drapedLayerOrder=null,this.drapedLayerGraphicOrder=null,this.intersector=O.OBJECT,u(t,this._ray)}set(r,s,e,a,n,h,d){this.intersector=r,this.dist=e,o(this.normal,a??c),t(this.transformation,n??i),this.target=s,this.drapedLayerOrder=h,this.drapedLayerGraphicOrder=d}copy(r){u(r.ray,this._ray),this.intersector=r.intersector,this.dist=r.dist,this.target=r.target,this.drapedLayerOrder=r.drapedLayerOrder,this.drapedLayerGraphicOrder=r.drapedLayerGraphicOrder,o(this.normal,r.normal),t(this.transformation,r.transformation)}}class B extends I{constructor(){super(...arguments),this.intersector=O.HUD}}function R(t){return new I(t)}const G=d(),M=f();export{E as defaultTolerance,T as newIntersector,R as newIntersectorResult};
5
+ import{copy as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r,IDENTITY as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as s,t as e,h as n,l as a,c as o,n as h}from"../../../../chunks/vec32.js";import{create as d,UNIT_Z as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as l}from"../../../../chunks/vec42.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as f,fromPoints as y,copy as u}from"../../../../geometry/support/ray.js";import{ViewingMode as p}from"../../../ViewingMode.js";import{IntersectorOptions as g,StoreResults as _,IntersectorType as O}from"./IntersectorInterfaces.js";import{HudTarget as L}from"./IntersectorTarget.js";import{isValidIntersectorResult as j}from"./intersectorUtils.js";import{IntersectorTransform as v,getVerticalOffsetObject3D as b}from"./verticalOffsetUtils.js";const w=1e-5;class x{constructor(t){this.options=new g,this._results=new T,this.transform=new v,this.tolerance=w,this.verticalOffset=null,this._ray=f(),this._rayEnd=d(),this._rayBeginTransformed=d(),this._rayEndTransformed=d(),this.viewingMode=t??p.Global}get results(){return this._results}get ray(){return this._ray}get rayBegin(){return this._ray.origin}get rayEnd(){return this._rayEnd}reset(t,r,i){this.resetWithRay(y(t,r,this._ray),i)}resetWithRay(t,r){this.camera=r,t!==this._ray&&u(t,this._ray),0!==this.options.verticalOffset?this.viewingMode===p.Local?this._ray.origin[2]-=this.options.verticalOffset:this.verticalOffset=this.options.verticalOffset:this.verticalOffset=null,s(this._rayEnd,this._ray.origin,this._ray.direction),this._results.init(this._ray)}intersect(t=null,r,i,s,e){this.point=r,this.filterPredicate=s,this.tolerance=i??w;const n=b(this.verticalOffset);if(t&&t.length>0){const r=e?t=>{e(t)&&this.intersectObject(t)}:t=>{this.intersectObject(t)};for(const i of t){const t=i.getSpatialQueryAccelerator?.();null!=t?(null!=n?t.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,r,n):t.forEachAlongRay(this._ray.origin,this._ray.direction,r),this.options.selectionMode&&this.options.hud&&t.forEachDegenerateObject(r)):i.objects.forAll((t=>r(t)))}}this.sortResults()}intersectObject(t){const r=t.geometries;if(!r)return;const i=t.effectiveTransformation,s=b(this.verticalOffset);for(const n of r){if(!n.visible)continue;const{material:r,id:a}=n;if(!r.visible)continue;this.transform.setAndInvalidateLazyTransforms(i,n.transformation),e(this._rayBeginTransformed,this.rayBegin,this.transform.inverse),e(this._rayEndTransformed,this.rayEnd,this.transform.inverse);const o=this.transform.transform;null!=s&&(s.objectTransform=this.transform),r.intersect(n,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,((r,i,s,e,n,h)=>this.handleObjectIntersection({object:t,geometryId:a,primIndex:s},r,i,e,o,n,h)))}}handleObjectIntersection(t,r,s,e,n,a,o){if(r<0)return;if(null!=this.filterPredicate&&!this.filterPredicate(this._ray.origin,this._rayEnd,r))return;const h=e?this._results.hud:this._results,d=e?e=>{const n=new L(t.object,t.geometryId,t.primIndex,o);e.set(O.HUD,n,r,s,i,a)}:i=>i.set(O.OBJECT,t,r,s,n,a);if((null==h.min.drapedLayerOrder||a>=h.min.drapedLayerOrder)&&(null==h.min.dist||r<h.min.dist)&&d(h.min),this.options.store!==_.MIN&&(null==h.max.drapedLayerOrder||a<h.max.drapedLayerOrder)&&(null==h.max.dist||r>h.max.dist)&&d(h.max),this.options.store===_.ALL)if(e){const t=new B(this._ray);d(t),this._results.hud.all.push(t)}else{const t=new A(this._ray);d(t),this._results.all.push(t)}}sortResults(t=this._results.all){t.sort(((t,r)=>t.dist!==r.dist?(t.dist??0)-(r.dist??0):t.drapedLayerOrder!==r.drapedLayerOrder?E(t.drapedLayerOrder,r.drapedLayerOrder):E(t.drapedLayerGraphicOrder,r.drapedLayerGraphicOrder)))}}function E(t,r){return(r??-Number.MAX_VALUE)-(t??-Number.MAX_VALUE)}function I(t){return new x(t)}class T{constructor(){this.min=new A(f()),this.max=new A(f()),this.hud={min:new B(f()),max:new B(f()),all:new Array},this.ground=new A(f()),this.all=[]}init(t){this.min.init(t),this.max.init(t),this.ground.init(t),this.all.length=0,this.hud.min.init(t),this.hud.max.init(t),this.hud.all.length=0}}class A{get ray(){return this._ray}get distanceInRenderSpace(){return null!=this.dist?(n(G,this.ray.direction,this.dist),a(G)):null}withinDistance(t){return!!j(this)&&this.distanceInRenderSpace<=t}getIntersectionPoint(t){return!!j(this)&&(n(G,this.ray.direction,this.dist),s(t,this.ray.origin,G),!0)}getTransformedNormal(t){return o(M,this.normal),M[3]=0,l(M,M,this.transformation),o(t,M),h(t,t)}constructor(t){this.intersector=O.OBJECT,this.normal=d(),this.transformation=r(),this._ray=f(),this.init(t)}init(t){this.dist=null,this.target=null,this.drapedLayerOrder=null,this.drapedLayerGraphicOrder=null,this.intersector=O.OBJECT,u(t,this._ray)}set(r,s,e,n,a,h,d){this.intersector=r,this.dist=e,o(this.normal,n??c),t(this.transformation,a??i),this.target=s,this.drapedLayerOrder=h,this.drapedLayerGraphicOrder=d}copy(r){u(r.ray,this._ray),this.intersector=r.intersector,this.dist=r.dist,this.target=r.target,this.drapedLayerOrder=r.drapedLayerOrder,this.drapedLayerGraphicOrder=r.drapedLayerGraphicOrder,o(this.normal,r.normal),t(this.transformation,r.transformation)}}class B extends A{constructor(){super(...arguments),this.intersector=O.HUD}}function R(t){return new A(t)}const G=d(),M=m();export{w as defaultTolerance,I as newIntersector,R as newIntersectorResult};
@@ -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{clone as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";class t{constructor(s,t,r){this.object=s,this.geometryId=t,this.triangleNr=r}}class r extends t{constructor(t,r,c,e){super(t,r,c),this.center=null!=e?s(e):null}}class c extends r{}class e{constructor(s){this.layerUid=s}}class o extends e{constructor(s,t){super(s),this.graphicUid=t}}export{o as Graphic3DTarget,r as HudTarget,e as LayerTarget,t as ObjectTarget,c as ValidHudTarget};
5
+ import{clone as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";class t{constructor(s,t,r){this.object=s,this.geometryId=t,this.primIndex=r}}class r extends t{constructor(t,r,c,e){super(t,r,c),this.center=null!=e?s(e):null}}class c extends r{}class e{constructor(s){this.layerUid=s}}class o extends e{constructor(s,t){super(s),this.graphicUid=t}}export{o as Graphic3DTarget,r as HudTarget,e as LayerTarget,t as ObjectTarget,c as ValidHudTarget};
@@ -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"../../../../core/has.js";import{copy as t,multiply as e,hasIdentityRotation as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{m as o,t as a,j as n,i as m,g as h,p as c,c as l}from"../../../../chunks/vec32.js";import{fromValues as d,create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as g,c as f}from"../../../../chunks/sphere.js";import{maxScale as b}from"../../support/mathUtils.js";import{Object3DState as _}from"./basicInterfaces.js";import{ContentObject as p}from"./ContentObject.js";import{ContentObjectType as v}from"./ContentObjectType.js";import{Object3DOccludeeStateID as j,Object3DHighlightStateID as y}from"./Object3DStateID.js";import{assert as S}from"./Util.js";import{affectsGeometry as x}from"./VertexAttribute.js";import{addObject3DStateID as V,removeObject3DStateID as O}from"../materials/renderers/utils.js";class A extends p{get geometries(){return this._geometries}get transformation(){return this._transformation??s}set transformation(e){this._transformation=t(this._transformation??r(),e),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(e){this._shaderTransformation=e?t(this._shaderTransformation??r(),e):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}constructor(t={}){super(),this.type=v.Object,this._shaderTransformation=null,this._parentLayer=null,this._visible=!0,this.castShadow=t.castShadow??!0,this.usesVerticalDistanceToGround=t.usesVerticalDistanceToGround??!1,this.graphicUid=t.graphicUid,this.layerUid=t.layerUid,t.isElevationSource&&(this.lastValidElevationBB=new L),this._geometries=t.geometries?Array.from(t.geometries):new Array}dispose(){this._geometries.length=0}get parentLayer(){return this._parentLayer}set parentLayer(t){S(null==this._parentLayer||null==t,"Object3D can only be added to a single Layer"),this._parentLayer=t}addGeometry(t){t.visible=this._visible,this._geometries.push(t),this._emit("geometryAdded",{object:this,geometry:t}),this._invalidateBoundingVolume()}removeGeometry(t){const e=this._geometries.splice(t,1)[0];e&&(this._emit("geometryRemoved",{object:this,geometry:e}),this._invalidateBoundingVolume())}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(t,e,i=!1){this._emit("attributesChanged",{object:this,geometry:t,attribute:e,sync:i}),x(e)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(t){if(this._visible!==t){this._visible=t;for(const t of this._geometries)t.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const t=new j;for(const e of this._geometries)e.occludees=V(e.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const e of this._geometries)e.occludees=O(e.occludees,t);this._emit("occlusionChanged",this)}highlight(t){const e=new y(t);for(const i of this._geometries)i.addHighlight(e);return this._emit("highlightChanged",this),e}removeHighlight(t){for(const e of this._geometries)e.removeHighlight(t);this._emit("highlightChanged",this)}removeStateID(t){t.channel===_.Highlight?this.removeHighlight(t):this.removeOcclude(t)}getCombinedStaticTransformation(t,i){return e(i,this.transformation,t.transformation)}getCombinedShaderTransformation(t,i=r()){return e(i,this.effectiveTransformation,t.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=this._bvWorldSpace||new M,this._validateBoundingVolume(this._bvWorldSpace,E.WorldSpace)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=this._bvObjectSpace||new M,this._validateBoundingVolume(this._bvObjectSpace,E.ObjectSpace)),this._bvObjectSpace}_validateBoundingVolume(t,e){const i=e===E.ObjectSpace;for(const s of this._geometries){const e=s.boundingInfo;e&&T(e,t,i?s.transformation:this.getCombinedShaderTransformation(s))}o(g(t.bounds),t.min,t.max,.5);for(const s of this._geometries){const e=s.boundingInfo;if(null==e)continue;const r=i?s.transformation:this.getCombinedShaderTransformation(s),o=b(r);a(W,e.center,r);const m=n(W,g(t.bounds)),h=e.radius*o;t.bounds[3]=Math.max(t.bounds[3],m+h)}}_invalidateBoundingVolume(){const t=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this._parentLayer&&t&&this._parentLayer.notifyObjectBBChanged(this,t)}_emit(t,e){this._parentLayer&&this._parentLayer.events.emit(t,e)}get test(){}}class L{constructor(){this.min=d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.max=d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)}isEmpty(){return this.max[0]<this.min[0]&&this.max[1]<this.min[1]&&this.max[2]<this.min[2]}}class M extends L{constructor(){super(...arguments),this.bounds=f()}}function T(t,e,s){const r=t.bbMin,o=t.bbMax;if(i(s)){const t=m(C,s[12],s[13],s[14]);h(B,r,t),h(U,o,t);for(let i=0;i<3;++i)e.min[i]=Math.min(e.min[i],B[i]),e.max[i]=Math.max(e.max[i],U[i])}else if(a(B,r,s),c(r,o))for(let i=0;i<3;++i)e.min[i]=Math.min(e.min[i],B[i]),e.max[i]=Math.max(e.max[i],B[i]);else{a(U,o,s);for(let t=0;t<3;++t)e.min[t]=Math.min(e.min[t],B[t],U[t]),e.max[t]=Math.max(e.max[t],B[t],U[t]);for(let t=0;t<3;++t){l(B,r),l(U,o),B[t]=o[t],U[t]=r[t],a(B,B,s),a(U,U,s);for(let t=0;t<3;++t)e.min[t]=Math.min(e.min[t],B[t],U[t]),e.max[t]=Math.max(e.max[t],B[t],U[t])}}}const C=u(),B=u(),U=u(),W=u();var E;!function(t){t[t.WorldSpace=0]="WorldSpace",t[t.ObjectSpace=1]="ObjectSpace"}(E||(E={}));export{A as Object3D};
5
+ import"../../../../core/has.js";import{copy as t,multiply as e,hasIdentityRotation as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{m as o,t as a,j as n,i as m,g as h,p as c,c as l}from"../../../../chunks/vec32.js";import{fromValues as d,create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as g,c as f}from"../../../../chunks/sphere.js";import{maxScale as b}from"../../support/mathUtils.js";import{Object3DState as _}from"./basicInterfaces.js";import{ContentObject as p}from"./ContentObject.js";import{ContentObjectType as v}from"./ContentObjectType.js";import{Object3DOccludeeStateID as j,Object3DHighlightStateID as y}from"./Object3DStateID.js";import{assert as S}from"./Util.js";import{affectsGeometry as x}from"./VertexAttribute.js";import{addObject3DStateID as V,removeObject3DStateID as O}from"../materials/renderers/utils.js";class A extends p{get geometries(){return this._geometries}get transformation(){return this._transformation??s}set transformation(e){this._transformation=t(this._transformation??r(),e),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(e){this._shaderTransformation=e?t(this._shaderTransformation??r(),e):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}constructor(t={}){super(),this.type=v.Object,this._shaderTransformation=null,this._parentLayer=null,this._visible=!0,this.castShadow=t.castShadow??!0,this.usesVerticalDistanceToGround=t.usesVerticalDistanceToGround??!1,this.graphicUid=t.graphicUid,this.layerUid=t.layerUid,t.isElevationSource&&(this.lastValidElevationBB=new L),this._geometries=t.geometries?Array.from(t.geometries):new Array}dispose(){this._geometries.length=0}get parentLayer(){return this._parentLayer}set parentLayer(t){S(null==this._parentLayer||null==t,"Object3D can only be added to a single Layer"),this._parentLayer=t}addGeometry(t){t.visible=this._visible,this._geometries.push(t),this._emit("geometryAdded",{object:this,geometry:t}),this._invalidateBoundingVolume()}removeGeometry(t){const e=this._geometries.splice(t,1)[0];e&&(this._emit("geometryRemoved",{object:this,geometry:e}),this._invalidateBoundingVolume())}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(t,e,i=!1){this._emit("attributesChanged",{object:this,geometry:t,attribute:e,sync:i}),x(e)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(t){if(this._visible!==t){this._visible=t;for(const t of this._geometries)t.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const t=new j;for(const e of this._geometries)e.occludees=V(e.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const e of this._geometries)e.occludees=O(e.occludees,t);this._emit("occlusionChanged",this)}highlight(t){const e=new y(t);for(const i of this._geometries)i.addHighlight(e);return this._emit("highlightChanged",this),e}removeHighlight(t){for(const e of this._geometries)e.removeHighlight(t);this._emit("highlightChanged",this)}removeStateID(t){t.channel===_.Highlight?this.removeHighlight(t):this.removeOcclude(t)}getCombinedStaticTransformation(t,i){return e(i,this.transformation,t.transformation)}getCombinedShaderTransformation(t,i=r()){return e(i,this.effectiveTransformation,t.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=this._bvWorldSpace||new M,this._validateBoundingVolume(this._bvWorldSpace,E.WorldSpace)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=this._bvObjectSpace||new M,this._validateBoundingVolume(this._bvObjectSpace,E.ObjectSpace)),this._bvObjectSpace}_validateBoundingVolume(t,e){const i=e===E.ObjectSpace;for(const s of this._geometries){const e=s.boundingInfo;e&&T(e,t,i?s.transformation:this.getCombinedShaderTransformation(s))}o(g(t.bounds),t.min,t.max,.5);for(const s of this._geometries){const e=s.boundingInfo;if(null==e)continue;const r=i?s.transformation:this.getCombinedShaderTransformation(s),o=b(r);a(W,e.center,r);const m=n(W,g(t.bounds)),h=e.radius*o;t.bounds[3]=Math.max(t.bounds[3],m+h)}}_invalidateBoundingVolume(){const t=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this._parentLayer&&t&&this._parentLayer.notifyObjectBBChanged(this,t)}_emit(t,e){this._parentLayer&&this._parentLayer.events.emit(t,e)}get test(){}}class L{constructor(){this.min=d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.max=d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)}isEmpty(){return this.max[0]<this.min[0]&&this.max[1]<this.min[1]&&this.max[2]<this.min[2]}}class M extends L{constructor(){super(...arguments),this.bounds=f()}}function T(t,e,s){const r=t.bbMin,o=t.bbMax;if(i(s)){const t=m(C,s[12],s[13],s[14]);h(B,r,t),h(U,o,t);for(let i=0;i<3;++i)e.min[i]=Math.min(e.min[i],B[i]),e.max[i]=Math.max(e.max[i],U[i])}else if(a(B,r,s),c(r,o))for(let i=0;i<3;++i)e.min[i]=Math.min(e.min[i],B[i]),e.max[i]=Math.max(e.max[i],B[i]);else{a(U,o,s);for(let t=0;t<3;++t)e.min[t]=Math.min(e.min[t],B[t],U[t]),e.max[t]=Math.max(e.max[t],B[t],U[t]);for(let t=0;t<3;++t){l(B,r),l(U,o),B[t]=o[t],U[t]=r[t],a(B,B,s),a(U,U,s);for(let t=0;t<3;++t)e.min[t]=Math.min(e.min[t],B[t],U[t]),e.max[t]=Math.max(e.max[t],B[t],U[t])}}}const C=u(),B=u(),U=u(),W=u();var E;!function(t){t[t.WorldSpace=0]="WorldSpace",t[t.ObjectSpace=1]="ObjectSpace"}(E||(E={}));export{M as BoundingVolume,A as Object3D};
@@ -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 _}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as p,initial as u,sync as m}from"../../../../core/reactiveUtils.js";import{signal as c}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"../../../../core/accessorSupport/interfaces.js";import"../../../../core/accessorSupport/tracking/Flags.js";import"../../../../core/Warning.js";import"../../../../core/Error.js";import{equals as b,invert as T,multiply as A}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as E,create as P}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as R}from"../../../../chunks/vec42.js";import{ZEROS as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as I,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as w}from"../../../../geometry/support/Indices.js";import{RenderCategory as D,InternalRenderCategory as O}from"../../webgl.js";import{debugFlags as N}from"../../support/debugFlags.js";import{DepthFormat as y,ColorFormat as H}from"../../webgl/formats.js";import{FBOCache as x,defaultWebGLFBO as L}from"../core/FBOCache.js";import{RenderPassManager as M}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as U,isColorOrColorEmission as F}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as v}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{distanceFadeEnd as G}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as q}from"../effects/RenderNodes.js";import{releaseTechniques as j}from"../effects/RenderPlugin.js";import{RenderPluginManager as V}from"../effects/RenderPluginManager.js";import{Blit as B}from"../effects/blit/Blit.js";import{renderHighlightBuffer as Q}from"../effects/highlight/Highlight.js";import{OITBlend as W}from"../effects/transparency/OITBlend.js";import{AnimationTimer as k}from"./AnimationTimer.js";import{AnimationTimeStep as z}from"./AnimationTimeStep.js";import{RenderRequestType as X}from"./basicInterfaces.js";import{BoundingInfo as Y}from"./BoundingInfo.js";import{DepthRange as K}from"./DepthRange.js";import{depthRangeFromScene as J}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as Z}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as $}from"./MainFramebuffer.js";import{RenderOccludedFlag as ee}from"./Material.js";import{OITPass as te}from"./OITPass.js";import{RenderContext as re,defaultRenderOccludedMask as ie}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as se,RendererTarget as ae}from"./rendererUtils.js";import{setupFeatureDefaults as ne,RenderFeature as he}from"./RenderFeature.js";import{RenderPluginInput as oe}from"./RenderPluginInput.js";import{RenderSlot as de}from"./RenderSlot.js";import{ShadowAccumulator as _e}from"./ShadowAccumulator.js";import{ShadowMap as le,SnapshotSlot as pe}from"./ShadowMap.js";import ue from"./SliceHelper.js";import{Transparency as me}from"./edgeRendering/interfaces.js";import{MergedRenderer as ce}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ge}from"../parts/renderUtils.js";import{RendererPerformanceInfo as fe,PerformanceCategory as be}from"../statistics/RendererPerformanceInfo.js";import{RenderState as Te}from"../../../support/RenderState.js";import{PixelFormat as Ae,PixelType as Ee,DepthStencilAttachment as Pe,FramebufferBit as Re,ColorAttachment as Se}from"../../../webgl/enums.js";class Ie{constructor(e,t,r,s,a,n){this._stage=e,this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this._renderers=new Map,this.renderPassManager=new M,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=I(0,0,0,1),this._sliceHelper=new ue,this._blit=null,this._oitblend=null,this._state=c(Te.IDLE),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new z,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=c(0),this._lastFrameTime=g(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new oe,this._releaseNormals=e=>{e.some((({name:e})=>"normals"===e))&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this.fboCache=new x(s),this._renderStateFeatures=c(ne(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new $(this.fboCache),this.performanceInfo=new fe(this._rctx),this._shadowMap=new le(this.fboCache,e.viewingMode),this._shadowAccumulator=new _e(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}),((e,t,r)=>{const i=this._stage.view.qualitySettings.maximumPixelRatio;e.shadowMap.start(e.camera,t,r,!0,i),this._renderShadowCascades(U.Shadow,e.shadowMap),e.shadowMap.finish(),e.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(e.camera,e.contentCamera)}),n),this._renderContext=new re(this._rctx,this._shadowMap,r),this._nodes=new q(this._renderContext),this._plugins=new V({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._handles=[l((()=>this._stage.view.state.camera),(()=>n()),p),l((()=>N.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(me.TRANSPARENT):()=>{},n()}),u),l((()=>this._stage.view.environment.background?.color),(e=>{const t=e?i(e):C;R(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()}),p),l((()=>this._stage.view.state.camera.relativeElevation),(e=>this._inGlobeView=(e??1/0)>=G),p),l((()=>this._bindParameters.clouds.fadeFactor),(()=>this._bindParameters.fadeLighting()),m),l((()=>this._bindParameters.clouds.data?.state),(()=>n()),m),l((()=>this._stage.view.state.highlights),(e=>{this._bindParameters.highlights=e,this._updateHighlights(),n()}),u)]}destroy(){this._handles.forEach((e=>e.remove())),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._renderers.clear(),this._blit=null,this._oitblend=null,Y.prune(),ce.prune(),w()}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=ne(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(he.HighQualityTransparency)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(he.WaterReflection))}get _hasHighlights(){return this._plugins.produces(U.Highlight,de.OPAQUE_MATERIAL,de.TRANSPARENT_MATERIAL,de.DRAPED_MATERIAL,de.HUD_MATERIAL,de.LABEL_MATERIAL)}hasHighlightOptions(e){return this._plugins.hasHighlightOptions(e)}get _hasHUDHighlights(){return this._plugins.produces(U.Highlight,de.HUD_MATERIAL,de.LABEL_MATERIAL)}get hasSSAO(){return(this._stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(he.SSAO))&&!this._inGlobeView}get hasSMAA(){return this._stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(he.Antialiasing)}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(he.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 null!=this._edgeView&&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");_(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Fe(this._stage.view.resourceController)});return this._handles.push(l((()=>r.updating),(()=>this._requestRender()),m)),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&&b(this._bindParameters.ssr.reprojectionMatrix,E)}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){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);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 slicePlane(e){this._sliceHelper.plane!==e&&(this._sliceHelper.plane=e,this._requestRender())}get plugins(){return this._plugins}getMaterialRenderer(e){return this._renderers.get(e)}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,t){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:i,updates:s}=e;if(0===r.length&&0===i.length&&0===s.length)return;se(e).forEach(((r,i)=>{if(t.done)return;let s=this._renderers.get(i);null==s&&r.adds.length>0&&(s=new ce({material:i,highlightOrderMap:this._stage.view.state.highlightOrderMap}),s.initializeRenderContext(this._plugins.context),this._plugins.add(s),this._renderers.set(i,s)),s&&(s.modify(r),s.updateHighlights(this._stage.view.state.highlightOrderMap),0===s.numGeometries&&(this._renderers.delete(s.material),this._plugins.remove(s),s.destroy())),r.removes.forEach((t=>e.removes.removeUnordered(t))),r.adds.forEach((t=>e.adds.removeUnordered(t))),r.updates.forEach((t=>e.updates.removeUnordered(t))),t.madeProgress()})),this.updateHasFlags()}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(U.Color,...He),has.water=this._plugins.produces(U.Normal,de.DRAPED_WATER),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new k(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation),null!=e.forcedAnimationTime&&this._animationTimer.forceTime(e.forcedAnimationTime);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=ae.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 ge(this._pluginInput.get(D.FINAL),null)}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:_}=Z,l=this._stage.view,p=l.stateManager.camera,u=l.qualitySettings.fadeDuration,m=e===Te.IDLE?r:i,c=s((p.tilt-h)/(o-h),0,1),g=s((p.position.z??0-d)/(_-d),0,1),f=a(a(1,m,c),1,g),b=this._bindParameters.hudOccludedFragmentOpacity;if(u<=0||b===f||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=f,void(this._lastFrameTime=t);const T=t-this._lastFrameTime;this._lastFrameTime=t;const A=Math.min(Math.abs(r-i)*T/u,n);A>=Math.abs(f-b)?this._bindParameters.hudOccludedFragmentOpacity=f:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(f-b)*A,this._requestRender())}_render(e,t,r=ae.Default,i){this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r===ae.Default,this._disposeBindBuffers();const{camera:s,contentCamera:a,mode:n,alignPixelEnabled:h}=e;this._state.value=n;const o=this._nodes.produces("magnifier-color"),_=this._nodes.produces(D.FINAL),l=this._nodes.require("emissive",D.FINAL,D.COMPOSITE)>0&&this._plugins.hasEmissions,p=l?U.ColorEmission:U.Color;this._renderContext.time=t,this._renderContext.output=p,this._bindParameters.oitPass=te.NONE,this._bindParameters.alignPixelEnabled=h,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null,this._bindParameters.slicePlane=this._sliceHelper.plane,this._bindParameters.viewshedEnabled=this._nodes.produces(O.VIEWSHED),this._renderOverlay(t),s.setGLViewport(this._rctx);const u=this._framebuffer,m=u.initialize(s.fullWidth,s.fullHeight,this._backgroundColor,l);this.hasReflections?(m?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=m):m?.release(),this._ensureBindParametersCamera(s,a),this._updateHUDOccludedFragmentOpacity(n,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const c=this._highQualityTransparency&&this._hasTransparentTerrain,g=this._plugins.produces(U.Color,...Ne);this._precompilePrepasses(),this.performanceInfo.advance(be.PREPARE);const f=this._computeDepthRange(s);this._renderShadowMap(s,this._bindParameters.lighting.mainLight.direction,f),this._ensureBindParametersCamera(s,a),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(f,s,a),this._ensureBindParametersSSR(t),this._precompileShaders(c,g,p),this._renderContext.output=p,u.bind(),this._bindParameters.mainDepth=u.depth.attachment;const b=this.plugins.produces(U.Color,...Oe);b&&this._renderOpaqueGeometry(),u.update((e=>this._renderNodes(D.OPAQUE,e,b))),this.fboCache.debugCallback?.(D.OPAQUE,u.color.fbo),u.update((e=>this._renderNodes(O.OPAQUE_ENVIRONMENT,e))),this.fboCache.debugCallback?.(O.OPAQUE_ENVIRONMENT,u.color.fbo),this._renderTerrainDepth(c),this._renderEdges(me.OPAQUE),u.bind(),this._renderPlugins(de.VOXEL,be.VOXEL),this._renderHiddenTransparentEdges(),g&&(this._oitEnabled?this._renderOIT(Ce.Geometry,p):this._renderTransparentGeometry()),u.update((e=>this._renderNodes(D.TRANSPARENT,e,g))),this.fboCache.debugCallback?.(D.TRANSPARENT,u.color.fbo),this._renderGeometryDepth(c),this._renderHUDVisibility(),c||this._plugins.render(this._pluginInput,de.LINE_CALLOUTS);const T=r===ae.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;this._renderEdges(me.TRANSPARENT);const A=this._hasTransparentTerrain?this._renderTransparentTerrain():null;A&&(this.performanceInfo.advance(be.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(c?this._renderLineCallouts(v.Occluded):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,A.getTexture())),this._renderHUD(v.Occluded,u.color,p))),this._bindParameters.cullAboveTerrain=!1,A&&(u.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,A.getTexture()),A.release(),c&&(this._renderEdges(me.OPAQUE),g&&(this._oitEnabled?this._renderOIT(Ce.Geometry,p):this._renderTransparentGeometry(),this.performanceInfo.advance(be.TRANSPARENT)),this._renderEdges(me.TRANSPARENT))),this._bindParameters.ssao=d(this._bindParameters.ssao),c&&this._renderLineCallouts(v.NotOccluded),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment(),this._pluginInput.set(O.FOCUSAREA,this._renderFocusAreaGeometry()),u.update((e=>this._renderNodes(O.TRANSPARENT_ENVIRONMENT,e))),u.update((e=>this._renderNodes(O.VIEWSHED,e))),u.update((e=>this._renderNodes(O.LASERLINES,e))),u.update((e=>this._renderNodes(O.OCCLUDED,e))),this._pluginInput.set("highlights",this._renderHighlightPrepass()),u.update((e=>this._renderNodes(D.COMPOSITE,e))),this._pluginInput.release(O.FOCUSAREA);const E=!(r!==ae.Default||_||o&&!i),P=this._pluginInput.get(D.COMPOSITE),R=E?L:this.fboCache.acquire(P.fbo.width,P.fbo.height,O.ANTIALIASING),S=this._nodes.produces(O.ANTIALIASING)?this._renderNodes(O.ANTIALIASING,R):this._blitFBO(P,R,!1);let I;this._pluginInput.set(O.ANTIALIASING,S),this._hasHUDHighlights?(this._renderHUD(v.NotOccluded,S,p),I=this._renderNodes(O.HIGHLIGHTS,S)):(I=this._renderNodes(O.HIGHLIGHTS,S),this._renderHUD(v.NotOccluded,I,p));const C=this._renderNodes(O.MAGNIFIER,I);return o&&!i&&r===ae.Default&&!_&&this._blitFBO(C),_?(C.attachDepth(u.depth),this._blitFBO(this._renderNodes(D.FINAL,C)),C.detachDepth()):this._pluginInput.set(D.FINAL,C),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),u.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),r!==ae.Default&&(this._releaseFBOs(),this._disposeOffscreenBuffers()),new ge(this._pluginInput.get(D.FINAL),T)}_precompileShaders(e,t,r){if(++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._nodes.precompile(O.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=U.Depth,this._plugins.precompile(de.TRANSPARENT_TERRAIN),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(de.TRANSPARENT_TERRAIN),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._nodes.precompile(O.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(de.OCCLUSION_PIXELS),this._plugins.precompile(de.LINE_CALLOUTS),this._precompileHUD(v.Occluded),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(O.VIEWSHED,O.LASERLINES,O.OCCLUDED,O.ANTIALIASING,O.HIGHLIGHTS),this._precompileHUD(v.NotOccluded),this._hasHighlights){const e=this._bindParameters;e.highlights.forEach(((t,r)=>{e.highlightLevel=r,this._precompileAllGeometry(U.Highlight)})),e.highlightLevel=null}this._nodes.precompile(D.COMPOSITE,O.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),--this._plugins.context.techniques.precompiling}_updateHighlights(){const e=this._stage.view.state;this._renderers.forEach((t=>t.updateHighlights(e.highlightOrderMap)))}_renderFocusAreaGeometry(){if(!this._nodes.produces(O.FOCUSAREA))return null;const{width:e,height:t}=this._framebufferSize;let r=this.fboCache.acquire(e,t,O.FOCUSAREA);return r=this._nodes.render(r,this._pluginInput),this.performanceInfo.advance(be.FOCUS_AREA_MASK),r}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;++this._techniques.precompiling;const e=this._framebufferSize;let t=this.fboCache.acquire(e.width,e.height,"olid");return t.acquireDepth(y.DEPTH_STENCIL_TEXTURE),t=this._nodes.render(t,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(be.OBJECT_AND_LAYER_ID_COLOR),t}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=e===X.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(C),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],Ae.RGBA,Ee.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,Ae.RGBA,Ee.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,C),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===me.OPAQUE?be.OPAQUE_EDGES:be.TRANSPARENT_EDGES)}_renderOverlay(e){this._bindParameters.overlay=this.overlay?.render(e),this._bindParameters.overlay&&this.performanceInfo.advance(be.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(he.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(U.ShadowHighlight,this._shadowMap),i.moveSnapshot(pe.Highlight),this._renderShadowCascades(U.ShadowExcludeHighlight,this._shadowMap),i.copySnapshot(pe.ExcludeHighlight),this._renderShadowCascades(U.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(U.Shadow),i.finish(),e.setGLViewport(this._rctx),this.performanceInfo.advance(be.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){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(U.Depth)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._needsShadowAccumulation||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");if(e){const t=this._needsDepth?e.getAttachment(Pe):null;t?.retain(),this._pluginInput.set(O.SSAO,this._renderSSAO()),this._renderGeometryWithoutNormalsDepth(t)}else this._renderAllGeometryDepth()}_renderGeometryWithoutNormalsDepth(e){if(!this._needsDepth||!e)return void(this._bindParameters.depth=d(this._bindParameters.depth));const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"depth");r.attachDepth(e),e.release(),this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(Re.STENCIL),this._renderGeometryWithoutNormals(U.Depth),d(this._bindParameters.depth),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(be.DEPTH)}_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").acquireDepth(y.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(Re.DEPTH|Re.STENCIL),this.renderAllGeometry(U.Depth),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(be.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=U.Depth;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth").acquireDepth(y.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(Re.DEPTH|Re.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").acquireDepth(y.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(Re.DEPTH|Re.STENCIL),this._renderOpaqueAndTransparentGeometry(U.Depth),this._renderContext.output=t,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowAccumulation}_computeDepthRange(e){if(!this._needsDepthRange)return K.zero;const t=J(e,this._plugins.plugins,this._stage.layers);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}get _normalsRequired(){const e=this._nodes.require("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,O.VIEWSHED,O.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(U.Normal),this._needsDepth&&this._precompileAllGeometry(U.Depth),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(U.ShadowHighlight),this._precompileShadowCascades(U.ShadowExcludeHighlight),this._precompileShadowCascades(U.ShadowHighlight)):this._precompileShadowCascades(U.Shadow)),this._needsShadowAccumulation&&this._precompileAllGeometry(U.Shadow)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",H.RGBA);r.acquireDepth(y.DEPTH_STENCIL_TEXTURE),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._renderGeometryWithNormals(U.Normal);const i=this._nodes.optional("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,O.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(be.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return void e?.detachDepth();L.setName(O.SSAO);const t=this._nodes.render(L,this._pluginInput);return this._bindParameters.ssao=t,e.detachDepth(),this._pluginInput.release("normals"),this.performanceInfo.advance(be.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(de.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,...ye);this._renderContext.renderOccludedMask=ie}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,this._pluginInput),j(t))}))}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>ee.Occlude&&this._plugins.render(this._pluginInput,de.OCCLUDED_TERRAIN),this.renderSlots(e,...ye),this._renderContext.renderOccludedMask=ie}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,de.HUD_MATERIAL)}precompileViewshedShadowMap(){this._precompileAllGeometry(U.ViewshedShadow)}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(U.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(this._pluginInput,...we),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...De)}_precompileOpaqueGeometry(){this._plugins.precompile(...Oe)}_renderOpaqueGeometry(){this._plugins.render(this._pluginInput,...Oe)}_renderTransparentGeometry(){this._plugins.render(this._pluginInput,...Ne)}get _hasTransparentTerrain(){return this._plugins.produces(U.Color,de.TRANSPARENT_TERRAIN)}_renderTransparentTerrain(){const e=()=>this._plugins.render(this._pluginInput,de.TRANSPARENT_TERRAIN);if(!F(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,C),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,de.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",H.RGBA4),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(this._pluginInput,de.OCCLUSION_PIXELS),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(be.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===v.Occluded){const e=()=>this._plugins.render(this._pluginInput,de.LINE_CALLOUTS),t=this._framebufferSize,r=this.fboCache.acquireDepth(y.DEPTH16_BUFFER,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(this._pluginInput,de.LINE_CALLOUTS)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=U.Highlight,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&F(this._renderContext.output)?(this._bindParameters.oitPass=te.ColorAlpha,this._plugins.precompile(...He),this._bindParameters.oitPass=te.FrontFace,this._plugins.precompile(...He),this._bindParameters.oitPass=te.NONE):this._plugins.precompile(...He),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(Ce.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(y.DEPTH16_BUFFER,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(y.DEPTH16_BUFFER),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(e===v.Occluded?be.HUD_OCCLUDED:be.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,...He)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(U.ShadowHighlight,de.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,s=e.acquire(i.width,i.height,"highlights",H.RG);return s.acquireDepth(y.DEPTH_STENCIL_TEXTURE),t.bindFramebuffer(s.fbo),t.clearFramebuffer(C,!0),this._renderContext.output=U.Highlight,t.bindFramebuffer(s.fbo),Q(t,e,i,r,(()=>this._renderHighlightGeometries())),this.performanceInfo.advance(be.HIGHLIGHTS),s}_renderHighlightGeometries(){this._plugins.render(this._pluginInput,...xe),this._rctx.clear(Re.DEPTH),this._renderHUDElements(v.Both)}get _needsShadowAccumulation(){return this._shadowAccumulator.isAccumulating}_renderShadowAccumulation(e,t,r){this._needsShadowAccumulation&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,e,t,r)&&this.performanceInfo.advance(be.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&F(this._renderContext.output)?(this._bindParameters.oitPass=te.ColorAlpha,this._plugins.precompile(...Ne),this._bindParameters.oitPass=te.FrontFace,this._plugins.precompile(...Ne),this._bindParameters.oitPass=te.NONE):this._plugins.precompile(...Ne)}_renderOIT(e,t,r=v.Both){const i=e===Ce.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=te.ColorAlpha;const d=a?"oit hud color alpha":"oit color alpha",_=this.fboCache.acquire(s.width,s.height,d,H.RGBA16F),l=t===U.ColorEmission;l&&_.acquireColor(Se.COLOR_ATTACHMENT1,H.RGBA16F,"emissive"),_.acquireColor(l?Se.COLOR_ATTACHMENT2:Se.COLOR_ATTACHMENT1,H.R16F),a||_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer([0,0,0,1]),l&&this._rctx.gl.clearBufferfv(this._rctx.gl.COLOR,1,S),n(),_.detachDepth(),h.oitPass=te.FrontFace;const p=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return l&&p.acquireColor(Se.COLOR_ATTACHMENT1,H.RGBA,"emissive"),a?p.acquireDepth(y.DEPTH16_BUFFER):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(C,!!a),n(),p.detachDepth(),h.oitPass=te.NONE,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(Re.COLOR)):this._framebuffer.bind(),this._oitblend??=new W(this._techniques),this._oitblend.blend(this._rctx,_,p,h,l),a?.detachDepth(),p.release(),_.release(),this._renderContext.output=o,a}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(be.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(this._pluginInput,de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),this.performanceInfo.advance(be.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(this._pluginInput,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=L,r=!0){return this._blit??=new B(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=E:(T(Me,this._bindParameters.camera.viewMatrix),T(Le,this._bindParameters.camera.projectionMatrix),A(Ue,Me,Le),A(Ue,this._renderContext.lastFrameCamera.viewMatrix,Ue),A(Ue,this._renderContext.lastFrameCamera.projectionMatrix,Ue),this._reprojectionMatrix=Ue);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=E,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(X.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 Ce;e([f({readOnly:!0})],Ie.prototype,"fullResolutionAtmosphere",null),e([f()],Ie.prototype,"_edgeView",void 0),e([f()],Ie.prototype,"updating",null),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(Ce||(Ce={}));const we=[de.INTEGRATED_MESH,de.OPAQUE_TERRAIN,de.OPAQUE_MATERIAL,de.TRANSPARENT_MATERIAL],De=[de.OPAQUE_MATERIAL_WITHOUT_NORMALS,de.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],Oe=[de.INTEGRATED_MESH,de.OPAQUE_TERRAIN,de.OPAQUE_MATERIAL,de.OPAQUE_MATERIAL_WITHOUT_NORMALS],Ne=[de.TRANSPARENT_MATERIAL,de.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],ye=[de.OPAQUE_MATERIAL,de.TRANSPARENT_MATERIAL,de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH],He=[de.LINE_CALLOUTS_HUD_DEPTH,de.HUD_MATERIAL,de.LABEL_MATERIAL],xe=[de.TRANSPARENT_MATERIAL,de.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,de.OPAQUE_MATERIAL,de.OPAQUE_MATERIAL_WITHOUT_NORMALS,de.TRANSPARENT_TERRAIN,de.INTEGRATED_MESH,de.OPAQUE_TERRAIN],Le=P(),Me=P(),Ue=P();function Fe(e){return t=>e.immediate.schedule(t)}export{Ie 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 _}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as p,initial as u,sync as m}from"../../../../core/reactiveUtils.js";import{signal as c}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"../../../../core/accessorSupport/interfaces.js";import"../../../../core/accessorSupport/tracking/Flags.js";import"../../../../core/Warning.js";import"../../../../core/Error.js";import{equals as b,invert as T,multiply as A}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as E,create as P}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as R}from"../../../../chunks/vec42.js";import{ZEROS as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as I,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as w}from"../../../../geometry/support/Indices.js";import{RenderCategory as D,InternalRenderCategory as O}from"../../webgl.js";import{debugFlags as N}from"../../support/debugFlags.js";import{DepthFormat as y,ColorFormat as H}from"../../webgl/formats.js";import{FBOCache as x,defaultWebGLFBO as L}from"../core/FBOCache.js";import{RenderPassManager as M}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as U,isColorOrColorEmission as F}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as v}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{distanceFadeEnd as G}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as q}from"../effects/RenderNodes.js";import{RenderPluginManager as V}from"../effects/RenderPluginManager.js";import{Blit as j}from"../effects/blit/Blit.js";import{renderHighlightBuffer as B}from"../effects/highlight/Highlight.js";import{OITBlend as Q}from"../effects/transparency/OITBlend.js";import{AnimationTimer as W}from"./AnimationTimer.js";import{AnimationTimeStep as k}from"./AnimationTimeStep.js";import{RenderRequestType as z}from"./basicInterfaces.js";import{BoundingInfo as X}from"./BoundingInfo.js";import{DepthRange as Y}from"./DepthRange.js";import{depthRangeFromScene as K}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as J}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as Z}from"./MainFramebuffer.js";import{RenderOccludedFlag as $}from"./Material.js";import{OITPass as ee}from"./OITPass.js";import{RenderContext as te,defaultRenderOccludedMask as re}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as ie,RendererTarget as se}from"./rendererUtils.js";import{setupFeatureDefaults as ae,RenderFeature as ne}from"./RenderFeature.js";import{RenderPluginInput as he}from"./RenderPluginInput.js";import{RenderSlot as oe}from"./RenderSlot.js";import{ShadowAccumulator as de}from"./ShadowAccumulator.js";import{ShadowMap as _e,SnapshotSlot as le}from"./ShadowMap.js";import pe from"./SliceHelper.js";import{Transparency as ue}from"./edgeRendering/interfaces.js";import{MergedRenderer as me}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ce}from"../parts/renderUtils.js";import{RendererPerformanceInfo as ge,PerformanceCategory as fe}from"../statistics/RendererPerformanceInfo.js";import{RenderState as be}from"../../../support/RenderState.js";import{PixelFormat as Te,PixelType as Ae,DepthStencilAttachment as Ee,FramebufferBit as Pe,ColorAttachment as Re}from"../../../webgl/enums.js";class Se{constructor(e,t,r,s,a,n){this._stage=e,this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this._renderers=new Map,this.renderPassManager=new M,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=I(0,0,0,1),this._sliceHelper=new pe,this._blit=null,this._oitblend=null,this._state=c(be.IDLE),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new k,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=c(0),this._lastFrameTime=g(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new he,this._releaseNormals=e=>{e.some((({name:e})=>"normals"===e))&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this.fboCache=new x(s),this._renderStateFeatures=c(ae(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new Z(this.fboCache),this.performanceInfo=new ge(this._rctx),this._shadowMap=new _e(this.fboCache,e.viewingMode),this._shadowAccumulator=new de(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}),((e,t,r)=>{const i=this._stage.view.qualitySettings.maximumPixelRatio;e.shadowMap.start(e.camera,t,r,!0,i),this._renderShadowCascades(U.Shadow,e.shadowMap),e.shadowMap.finish(),e.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(e.camera,e.contentCamera)}),n),this._renderContext=new te(this._rctx,this._shadowMap,r),this._nodes=new q(this._renderContext),this._plugins=new V({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._handles=[l((()=>this._stage.view.state.camera),(()=>n()),p),l((()=>N.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(ue.TRANSPARENT):()=>{},n()}),u),l((()=>this._stage.view.environment.background?.color),(e=>{const t=e?i(e):C;R(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()}),p),l((()=>this._stage.view.state.camera.relativeElevation),(e=>this._inGlobeView=(e??1/0)>=G),p),l((()=>this._bindParameters.clouds.fadeFactor),(()=>this._bindParameters.fadeLighting()),m),l((()=>this._bindParameters.clouds.data?.state),(()=>n()),m),l((()=>this._stage.view.state.highlights),(e=>{this._bindParameters.highlights=e,this._updateHighlights(),n()}),u)]}destroy(){this._handles.forEach((e=>e.remove())),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._renderers.clear(),this._blit=null,this._oitblend=null,X.prune(),me.prune(),w()}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=ae(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(ne.HighQualityTransparency)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(ne.WaterReflection))}get _hasHighlights(){return this._plugins.produces(U.Highlight,oe.OPAQUE_MATERIAL,oe.TRANSPARENT_MATERIAL,oe.DRAPED_MATERIAL,oe.HUD_MATERIAL,oe.LABEL_MATERIAL)}hasHighlightOptions(e){return this._plugins.hasHighlightOptions(e)}get _hasHUDHighlights(){return this._plugins.produces(U.Highlight,oe.HUD_MATERIAL,oe.LABEL_MATERIAL)}get hasSSAO(){return(this._stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(ne.SSAO))&&!this._inGlobeView}get hasSMAA(){return this._stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(ne.Antialiasing)}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(ne.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 null!=this._edgeView&&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");_(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ue(this._stage.view.resourceController)});return this._handles.push(l((()=>r.updating),(()=>this._requestRender()),m)),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&&b(this._bindParameters.ssr.reprojectionMatrix,E)}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){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);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 slicePlane(e){this._sliceHelper.plane!==e&&(this._sliceHelper.plane=e,this._requestRender())}get plugins(){return this._plugins}getMaterialRenderer(e){return this._renderers.get(e)}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,t){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:i,updates:s}=e;if(0===r.length&&0===i.length&&0===s.length)return;ie(e).forEach(((r,i)=>{if(t.done)return;let s=this._renderers.get(i);null==s&&r.adds.length>0&&(s=new me({material:i,highlightOrderMap:this._stage.view.state.highlightOrderMap}),s.initializeRenderContext(this._plugins.context),this._plugins.add(s),this._renderers.set(i,s)),s&&(s.modify(r),s.updateHighlights(this._stage.view.state.highlightOrderMap),0===s.numGeometries&&(this._renderers.delete(s.material),this._plugins.remove(s),s.destroy())),r.removes.forEach((t=>e.removes.removeUnordered(t))),r.adds.forEach((t=>e.adds.removeUnordered(t))),r.updates.forEach((t=>e.updates.removeUnordered(t))),t.madeProgress()})),this.updateHasFlags()}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(U.Color,...ye),has.water=this._plugins.produces(U.Normal,oe.DRAPED_WATER),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new W(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation),null!=e.forcedAnimationTime&&this._animationTimer.forceTime(e.forcedAnimationTime);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=se.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 ce(this._pluginInput.get(D.FINAL),null)}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:_}=J,l=this._stage.view,p=l.stateManager.camera,u=l.qualitySettings.fadeDuration,m=e===be.IDLE?r:i,c=s((p.tilt-h)/(o-h),0,1),g=s((p.position.z??0-d)/(_-d),0,1),f=a(a(1,m,c),1,g),b=this._bindParameters.hudOccludedFragmentOpacity;if(u<=0||b===f||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=f,void(this._lastFrameTime=t);const T=t-this._lastFrameTime;this._lastFrameTime=t;const A=Math.min(Math.abs(r-i)*T/u,n);A>=Math.abs(f-b)?this._bindParameters.hudOccludedFragmentOpacity=f:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(f-b)*A,this._requestRender())}_render(e,t,r=se.Default,i){this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r===se.Default,this._disposeBindBuffers();const{camera:s,contentCamera:a,mode:n,alignPixelEnabled:h}=e;this._state.value=n;const o=this._nodes.produces("magnifier-color"),_=this._nodes.produces(D.FINAL),l=this._nodes.require("emissive",D.FINAL,D.COMPOSITE)>0&&this._plugins.hasEmissions,p=l?U.ColorEmission:U.Color;this._renderContext.time=t,this._renderContext.output=p,this._bindParameters.oitPass=ee.NONE,this._bindParameters.alignPixelEnabled=h,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null,this._bindParameters.slicePlane=this._sliceHelper.plane,this._bindParameters.viewshedEnabled=this._nodes.produces(O.VIEWSHED),this._renderOverlay(t),s.setGLViewport(this._rctx);const u=this._framebuffer,m=u.initialize(s.fullWidth,s.fullHeight,this._backgroundColor,l);this.hasReflections?(m?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=m):m?.release(),this._ensureBindParametersCamera(s,a),this._updateHUDOccludedFragmentOpacity(n,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const c=this._highQualityTransparency&&this._hasTransparentTerrain,g=this._plugins.produces(U.Color,...Oe);this._precompilePrepasses(),this.performanceInfo.advance(fe.PREPARE);const f=this._computeDepthRange(s);this._renderShadowMap(s,this._bindParameters.lighting.mainLight.direction,f),this._ensureBindParametersCamera(s,a),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(f,s,a),this._ensureBindParametersSSR(t),this._precompileShaders(c,g,p),this._renderContext.output=p,u.bind(),this._bindParameters.mainDepth=u.depth.attachment;const b=this.plugins.produces(U.Color,...De);b&&this._renderOpaqueGeometry(),u.update((e=>this._renderNodes(D.OPAQUE,e,b))),this.fboCache.debugCallback?.(D.OPAQUE,u.color.fbo),u.update((e=>this._renderNodes(O.OPAQUE_ENVIRONMENT,e))),this.fboCache.debugCallback?.(O.OPAQUE_ENVIRONMENT,u.color.fbo),this._renderTerrainDepth(c),this._renderEdges(ue.OPAQUE),u.bind(),this._renderPlugins(oe.VOXEL,fe.VOXEL),this._renderHiddenTransparentEdges(),g&&(this._oitEnabled?this._renderOIT(Ie.Geometry,p):this._renderTransparentGeometry()),u.update((e=>this._renderNodes(D.TRANSPARENT,e,g))),this.fboCache.debugCallback?.(D.TRANSPARENT,u.color.fbo),this._renderGeometryDepth(c),this._renderHUDVisibility(),c||this._plugins.render(this._pluginInput,oe.LINE_CALLOUTS);const T=r===se.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;this._renderEdges(ue.TRANSPARENT);const A=this._hasTransparentTerrain?this._renderTransparentTerrain():null;A&&(this.performanceInfo.advance(fe.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(c?this._renderLineCallouts(v.Occluded):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,A.getTexture())),this._renderHUD(v.Occluded,u.color,p))),this._bindParameters.cullAboveTerrain=!1,A&&(u.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,A.getTexture()),A.release(),c&&(this._renderEdges(ue.OPAQUE),g&&(this._oitEnabled?this._renderOIT(Ie.Geometry,p):this._renderTransparentGeometry(),this.performanceInfo.advance(fe.TRANSPARENT)),this._renderEdges(ue.TRANSPARENT))),this._bindParameters.ssao=d(this._bindParameters.ssao),c&&this._renderLineCallouts(v.NotOccluded),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment(),this._pluginInput.set(O.FOCUSAREA,this._renderFocusAreaGeometry()),u.update((e=>this._renderNodes(O.TRANSPARENT_ENVIRONMENT,e))),u.update((e=>this._renderNodes(O.VIEWSHED,e))),u.update((e=>this._renderNodes(O.LASERLINES,e))),u.update((e=>this._renderNodes(O.OCCLUDED,e))),this._pluginInput.set("highlights",this._renderHighlightPrepass()),u.update((e=>this._renderNodes(D.COMPOSITE,e))),this._pluginInput.release(O.FOCUSAREA);const E=!(r!==se.Default||_||o&&!i),P=this._pluginInput.get(D.COMPOSITE),R=E?L:this.fboCache.acquire(P.fbo.width,P.fbo.height,O.ANTIALIASING),S=this._nodes.produces(O.ANTIALIASING)?this._renderNodes(O.ANTIALIASING,R):this._blitFBO(P,R,!1);let I;this._pluginInput.set(O.ANTIALIASING,S),this._hasHUDHighlights?(this._renderHUD(v.NotOccluded,S,p),I=this._renderNodes(O.HIGHLIGHTS,S)):(I=this._renderNodes(O.HIGHLIGHTS,S),this._renderHUD(v.NotOccluded,I,p));const C=this._renderNodes(O.MAGNIFIER,I);return o&&!i&&r===se.Default&&!_&&this._blitFBO(C),_?(C.attachDepth(u.depth),this._blitFBO(this._renderNodes(D.FINAL,C)),C.detachDepth()):this._pluginInput.set(D.FINAL,C),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),u.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),r!==se.Default&&(this._releaseFBOs(),this._disposeOffscreenBuffers()),new ce(this._pluginInput.get(D.FINAL),T)}_precompileShaders(e,t,r){if(++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._nodes.precompile(O.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=U.Depth,this._plugins.precompile(oe.TRANSPARENT_TERRAIN),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(oe.TRANSPARENT_TERRAIN),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._nodes.precompile(O.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(oe.OCCLUSION_PIXELS),this._plugins.precompile(oe.LINE_CALLOUTS),this._precompileHUD(v.Occluded),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(O.VIEWSHED,O.LASERLINES,O.OCCLUDED,O.ANTIALIASING,O.HIGHLIGHTS),this._precompileHUD(v.NotOccluded),this._hasHighlights){const e=this._bindParameters;e.highlights.forEach(((t,r)=>{e.highlightLevel=r,this._precompileAllGeometry(U.Highlight)})),e.highlightLevel=null}this._nodes.precompile(D.COMPOSITE,O.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),--this._plugins.context.techniques.precompiling}_updateHighlights(){const e=this._stage.view.state;this._renderers.forEach((t=>t.updateHighlights(e.highlightOrderMap)))}_renderFocusAreaGeometry(){if(!this._nodes.produces(O.FOCUSAREA))return null;const{width:e,height:t}=this._framebufferSize;let r=this.fboCache.acquire(e,t,O.FOCUSAREA);return r=this._nodes.render(r,this._pluginInput),this.performanceInfo.advance(fe.FOCUS_AREA_MASK),r}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;++this._techniques.precompiling;const e=this._framebufferSize;let t=this.fboCache.acquire(e.width,e.height,"olid");return t.acquireDepth(y.DEPTH_STENCIL_TEXTURE),t=this._nodes.render(t,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(fe.OBJECT_AND_LAYER_ID_COLOR),t}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=e===z.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(C),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],Te.RGBA,Ae.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,Te.RGBA,Ae.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,C),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===ue.OPAQUE?fe.OPAQUE_EDGES:fe.TRANSPARENT_EDGES)}_renderOverlay(e){this._bindParameters.overlay=this.overlay?.render(e),this._bindParameters.overlay&&this.performanceInfo.advance(fe.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(ne.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(U.ShadowHighlight,this._shadowMap),i.moveSnapshot(le.Highlight),this._renderShadowCascades(U.ShadowExcludeHighlight,this._shadowMap),i.copySnapshot(le.ExcludeHighlight),this._renderShadowCascades(U.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(U.Shadow),i.finish(),e.setGLViewport(this._rctx),this.performanceInfo.advance(fe.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){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(U.Depth)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._needsShadowAccumulation||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");if(e){const t=this._needsDepth?e.getAttachment(Ee):null;t?.retain(),this._pluginInput.set(O.SSAO,this._renderSSAO()),this._renderGeometryWithoutNormalsDepth(t)}else this._renderAllGeometryDepth()}_renderGeometryWithoutNormalsDepth(e){if(!this._needsDepth||!e)return void(this._bindParameters.depth=d(this._bindParameters.depth));const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"depth");r.attachDepth(e),e.release(),this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(Pe.STENCIL),this._renderGeometryWithoutNormals(U.Depth),d(this._bindParameters.depth),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(fe.DEPTH)}_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").acquireDepth(y.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(Pe.DEPTH|Pe.STENCIL),this.renderAllGeometry(U.Depth),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(fe.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=U.Depth;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth").acquireDepth(y.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(Pe.DEPTH|Pe.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").acquireDepth(y.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(Pe.DEPTH|Pe.STENCIL),this._renderOpaqueAndTransparentGeometry(U.Depth),this._renderContext.output=t,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowAccumulation}_computeDepthRange(e){if(!this._needsDepthRange)return Y.zero;const t=K(e,this._plugins.plugins,this._stage.layers);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}get _normalsRequired(){const e=this._nodes.require("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,O.VIEWSHED,O.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(U.Normal),this._needsDepth&&this._precompileAllGeometry(U.Depth),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(U.ShadowHighlight),this._precompileShadowCascades(U.ShadowExcludeHighlight),this._precompileShadowCascades(U.ShadowHighlight)):this._precompileShadowCascades(U.Shadow)),this._needsShadowAccumulation&&this._precompileAllGeometry(U.Shadow)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",H.RGBA);r.acquireDepth(y.DEPTH_STENCIL_TEXTURE),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._renderGeometryWithNormals(U.Normal);const i=this._nodes.optional("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,O.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(fe.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return void e?.detachDepth();L.setName(O.SSAO);const t=this._nodes.render(L,this._pluginInput);return this._bindParameters.ssao=t,e.detachDepth(),this._pluginInput.release("normals"),this.performanceInfo.advance(fe.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(oe.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,...Ne);this._renderContext.renderOccludedMask=re}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,this._pluginInput)}))}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>$.Occlude&&this._plugins.render(this._pluginInput,oe.OCCLUDED_TERRAIN),this.renderSlots(e,...Ne),this._renderContext.renderOccludedMask=re}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,oe.HUD_MATERIAL)}precompileViewshedShadowMap(){this._precompileAllGeometry(U.ViewshedShadow)}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(U.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(this._pluginInput,...Ce),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...we)}_precompileOpaqueGeometry(){this._plugins.precompile(...De)}_renderOpaqueGeometry(){this._plugins.render(this._pluginInput,...De)}_renderTransparentGeometry(){this._plugins.render(this._pluginInput,...Oe)}get _hasTransparentTerrain(){return this._plugins.produces(U.Color,oe.TRANSPARENT_TERRAIN)}_renderTransparentTerrain(){const e=()=>this._plugins.render(this._pluginInput,oe.TRANSPARENT_TERRAIN);if(!F(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,C),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,oe.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",H.RGBA4),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(this._pluginInput,oe.OCCLUSION_PIXELS),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(fe.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===v.Occluded){const e=()=>this._plugins.render(this._pluginInput,oe.LINE_CALLOUTS),t=this._framebufferSize,r=this.fboCache.acquireDepth(y.DEPTH16_BUFFER,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(this._pluginInput,oe.LINE_CALLOUTS)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=U.Highlight,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&F(this._renderContext.output)?(this._bindParameters.oitPass=ee.ColorAlpha,this._plugins.precompile(...ye),this._bindParameters.oitPass=ee.FrontFace,this._plugins.precompile(...ye),this._bindParameters.oitPass=ee.NONE):this._plugins.precompile(...ye),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(Ie.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(y.DEPTH16_BUFFER,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(y.DEPTH16_BUFFER),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(e===v.Occluded?fe.HUD_OCCLUDED:fe.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,...ye)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(U.ShadowHighlight,oe.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,s=e.acquire(i.width,i.height,"highlights",H.RG);return s.acquireDepth(y.DEPTH_STENCIL_TEXTURE),t.bindFramebuffer(s.fbo),t.clearFramebuffer(C,!0),this._renderContext.output=U.Highlight,t.bindFramebuffer(s.fbo),B(t,e,i,r,(()=>this._renderHighlightGeometries())),this.performanceInfo.advance(fe.HIGHLIGHTS),s}_renderHighlightGeometries(){this._plugins.render(this._pluginInput,...He),this._rctx.clear(Pe.DEPTH),this._renderHUDElements(v.Both)}get _needsShadowAccumulation(){return this._shadowAccumulator.accumulating}_renderShadowAccumulation(e,t,r){this._needsShadowAccumulation&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,e,t,r)&&this.performanceInfo.advance(fe.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&F(this._renderContext.output)?(this._bindParameters.oitPass=ee.ColorAlpha,this._plugins.precompile(...Oe),this._bindParameters.oitPass=ee.FrontFace,this._plugins.precompile(...Oe),this._bindParameters.oitPass=ee.NONE):this._plugins.precompile(...Oe)}_renderOIT(e,t,r=v.Both){const i=e===Ie.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=ee.ColorAlpha;const d=a?"oit hud color alpha":"oit color alpha",_=this.fboCache.acquire(s.width,s.height,d,H.RGBA16F),l=t===U.ColorEmission;l&&_.acquireColor(Re.COLOR_ATTACHMENT1,H.RGBA16F,"emissive"),_.acquireColor(l?Re.COLOR_ATTACHMENT2:Re.COLOR_ATTACHMENT1,H.R16F),a||_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer([0,0,0,1]),l&&this._rctx.gl.clearBufferfv(this._rctx.gl.COLOR,1,S),n(),_.detachDepth(),h.oitPass=ee.FrontFace;const p=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return l&&p.acquireColor(Re.COLOR_ATTACHMENT1,H.RGBA,"emissive"),a?p.acquireDepth(y.DEPTH16_BUFFER):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(C,!!a),n(),p.detachDepth(),h.oitPass=ee.NONE,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(Pe.COLOR)):this._framebuffer.bind(),this._oitblend??=new Q(this._techniques),this._oitblend.blend(this._rctx,_,p,h,l),a?.detachDepth(),p.release(),_.release(),this._renderContext.output=o,a}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(fe.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(this._pluginInput,oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),this.performanceInfo.advance(fe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(this._pluginInput,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=L,r=!0){return this._blit??=new j(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=E:(T(Le,this._bindParameters.camera.viewMatrix),T(xe,this._bindParameters.camera.projectionMatrix),A(Me,Le,xe),A(Me,this._renderContext.lastFrameCamera.viewMatrix,Me),A(Me,this._renderContext.lastFrameCamera.projectionMatrix,Me),this._reprojectionMatrix=Me);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=E,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(z.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 Ie;e([f({readOnly:!0})],Se.prototype,"fullResolutionAtmosphere",null),e([f()],Se.prototype,"_edgeView",void 0),e([f()],Se.prototype,"updating",null),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(Ie||(Ie={}));const Ce=[oe.INTEGRATED_MESH,oe.OPAQUE_TERRAIN,oe.OPAQUE_MATERIAL,oe.TRANSPARENT_MATERIAL],we=[oe.OPAQUE_MATERIAL_WITHOUT_NORMALS,oe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],De=[oe.INTEGRATED_MESH,oe.OPAQUE_TERRAIN,oe.OPAQUE_MATERIAL,oe.OPAQUE_MATERIAL_WITHOUT_NORMALS],Oe=[oe.TRANSPARENT_MATERIAL,oe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],Ne=[oe.OPAQUE_MATERIAL,oe.TRANSPARENT_MATERIAL,oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH],ye=[oe.LINE_CALLOUTS_HUD_DEPTH,oe.HUD_MATERIAL,oe.LABEL_MATERIAL],He=[oe.TRANSPARENT_MATERIAL,oe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,oe.OPAQUE_MATERIAL,oe.OPAQUE_MATERIAL_WITHOUT_NORMALS,oe.TRANSPARENT_TERRAIN,oe.INTEGRATED_MESH,oe.OPAQUE_TERRAIN],xe=P(),Le=P(),Me=P();function Ue(e){return t=>e.immediate.schedule(t)}export{Se 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{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{equals as r}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as i}from"../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as a,sync as n}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{I as _,c as l}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as u}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{BindParameters as p}from"./BindParameters.js";import{DepthRange as d}from"./DepthRange.js";import{createQuadVAO as g}from"./glUtil3D.js";import{ShadowCastRenderer as f,shadowCastDisabledElevationThreshold as b,shadowCastDisableElevationMax as w,shadowCastDisableElevationMin as v}from"./ShadowCastRenderer.js";import{ShadowMap as A}from"./ShadowMap.js";import{S as R}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as y}from"../shaders/ShadowCastAccumulateTechnique.js";import{TaskPriority as j}from"../../../support/Scheduler.js";import{PixelFormat as S,PixelType as F,SizedPixelFormat as C,TextureWrapMode as P,FramebufferBit as D}from"../../../webgl/enums.js";import{FramebufferObject as x}from"../../../webgl/FramebufferObject.js";import{TextureDescriptor as E}from"../../../webgl/TextureDescriptor.js";import{vertexCount as q}from"../../../webgl/Util.js";let M=class extends t{constructor(e,t,r,i,s,h){super({}),this.fbos=e,this._techniques=t,this._stage=r,this._prepareForShadowMapPass=i,this._renderToShadowMap=s,this._requestRender=h,this._progress=0,this._sampleCount=0,this._passParameters=new u,this._cachedLightDirections=[],this._depthRange=d.zero,this._previewing=!1,this._cameraForcedForScreenshot=!1,this._shadowAccumulatorKey="shadowAccumulator",this._rctx=e.rctx,this._bindParameters=new p(new A(e,r.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=g(this._rctx),this._accumulationRenderer=new f(t,this._rctx,this,h);const c=this._stage.view.resourceController.scheduler;this.addHandles([c.registerTask(j.SHADOW_ACCUMULATOR,this),o((()=>r.renderView),(e=>{this.removeHandles(L),null!=e&&this.addHandles(e.events.on("force-camera-for-screenshot",(()=>this._cameraForcedForScreenshot=!0)),L)}),a),o((()=>this._previewing),(()=>this._requestRenderIfEnabled()),n)],this._shadowAccumulatorKey),t.precompile(y)}normalizeCtorArgs(){return{}}dispose(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=s(this._accumulationRenderer),this._bindParameters.shadowMap.dispose(),this._fbo=s(this._fbo),this._vao=s(this._vao),this._cachedLightDirections.length=0,this._sampleCount=0}get computedSamples(){return this._progress}get shadowCastTexture(){return this._fbo?.colorTexture}get isAccumulating(){return this._isPreviewing||this._isRefining}get _isRefining(){return this._isActive&&!this._isDoneAccumulating&&!this._previewing}get _isPreviewing(){return this._isActive&&this._previewing}get _isActive(){return null!=this._fbo&&this._sampleCount>0}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==d.zero&&this._opacityFromElevation>b}get _isDoneAccumulating(){return this._progress>=this._sampleCount}get _lightDirections(){return this._cachedLightDirections}set _lightDirections(e){const t=this._cachedLightDirections;if(r(t,e,_))return;const i=Math.min(R,e.length);t.length=i,this._sampleCount=i;for(let r=0;r<i;++r)t[r]=l(t[r]??m(),e[r]);this._invalidate()}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get running(){return this._isRefining&&this.canAccumulate&&this._progress>0}runTask(e){for(this._prepareForShadowMapPass(this._bindParameters);!e.done&&!this._isDoneAccumulating;)this._accumulateShadow(),e.madeProgress();this._requestRender()}renderAccumulation(e,t,r,i){if(this._depthRange=t,this._updateCamera(r),this._bindParameters.contentCamera=i,this._bindParameters.depth=e,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!this.isAccumulating||!this.canAccumulate)return!1;(this._previewing||0===this._progress||this._cameraForcedForScreenshot)&&this._clear();const s=(this._cameraForcedForScreenshot?this._sampleCount:T)-this._progress;for(let o=0;o<s;++o)this._accumulateShadow(),this._requestRender();return this._cameraForcedForScreenshot=!1,s>0}precompile(){this._accumulationRenderer.precompile()}render(e){this._accumulationRenderer.render(e)}setOptions(e){if(void 0!==e.enabled){const t=null!=this._fbo;e.enabled!==t&&(e.enabled?this._enable():this._disable())}void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._lightDirections=e.lightDirections),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){return!this._isActive||!this._fbo||this._progress<1||e<0||e>=this._fbo.width||t<0||t>=this._fbo.height?0:(this._fbo.readPixels(e,t,1,1,S.RGBA,F.UNSIGNED_BYTE,O),O[0]/this._progress)}_enable(){this._progress=0;const e=new E;e.pixelFormat=S.RED,e.internalFormat=C.R8,e.wrapMode=P.CLAMP_TO_EDGE,this._fbo=new x(this._rctx,e),this._requestRender()}_disable(){this._fbo=s(this._fbo),this._requestRender()}_invalidate(){this._progress=0,this._requestRenderIfEnabled()}_clear(){this._rctx.bindFramebuffer(this._fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(D.COLOR),this._progress=0}_accumulateShadow(){this._renderToShadowMap(this._bindParameters,this._lightDirections[this._progress++],this._depthRange);const e=this._techniques.acquire(y);this._rctx.bindFramebuffer(this._fbo),this._rctx.bindTechnique(e,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(e.primitiveType,0,q(this._vao,"geometry")),e.release()}_updateCamera(e){const t=this._fbo;if(null==t)return;const r=this._bindParameters.camera;e.equals(r)||r.copyFrom(e),t.resize(e.fullWidth,e.fullHeight),this._opacityFromElevation=1-i(v,w,e.relativeElevation)}_requestRenderIfEnabled(){this._fbo&&this._requestRender()}get test(){}};e([h()],M.prototype,"_progress",void 0),e([h()],M.prototype,"_sampleCount",void 0),e([h()],M.prototype,"_fbo",void 0),e([h()],M.prototype,"_depthRange",void 0),e([h()],M.prototype,"_previewing",void 0),e([h()],M.prototype,"_accumulationRenderer",void 0),e([h()],M.prototype,"_isRefining",null),e([h()],M.prototype,"_isActive",null),e([h()],M.prototype,"canAccumulate",null),e([h()],M.prototype,"_isDoneAccumulating",null),e([h()],M.prototype,"_opacityFromElevation",null),e([h()],M.prototype,"running",null),M=e([c("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],M);const T=6,L="renderView",O=new Uint8Array(4);export{M as ShadowAccumulator};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{equals as r}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as s}from"../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as a,sync as n}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{I as _,c as l}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as u}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{BindParameters as p}from"./BindParameters.js";import{DepthRange as d}from"./DepthRange.js";import{createQuadVAO as g}from"./glUtil3D.js";import{ShadowCastRenderer as f,shadowCastDisabledElevationThreshold as b,shadowCastDisableElevationMax as w,shadowCastDisableElevationMin as v}from"./ShadowCastRenderer.js";import{ShadowMap as y}from"./ShadowMap.js";import{S as R}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as A}from"../shaders/ShadowCastAccumulateTechnique.js";import{TaskPriority as j}from"../../../support/Scheduler.js";import{PixelFormat as S,PixelType as F,SizedPixelFormat as C,TextureWrapMode as x,FramebufferBit as P}from"../../../webgl/enums.js";import{FramebufferObject as D}from"../../../webgl/FramebufferObject.js";import{TextureDescriptor as E}from"../../../webgl/TextureDescriptor.js";import{vertexCount as q}from"../../../webgl/Util.js";let M=class extends t{constructor(e,t,r,s,i,h){super({}),this.fbos=e,this._techniques=t,this._stage=r,this._prepareForShadowMapPass=s,this._renderToShadowMap=i,this._requestRender=h,this._progress=0,this._sampleCount=0,this._passParameters=new u,this._cachedLightDirections=[],this._depthRange=d.zero,this._previewing=!1,this._cameraForcedForScreenshot=!1,this._shadowAccumulatorKey="shadowAccumulator",this._rctx=e.rctx,this._bindParameters=new p(new y(e,r.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=g(this._rctx),this._accumulationRenderer=new f(t,this._rctx,this,h);const c=this._stage.view.resourceController.scheduler;this.addHandles([c.registerTask(j.SHADOW_ACCUMULATOR,this),o((()=>r.renderView),(e=>{this.removeHandles(L),null!=e&&this.addHandles(e.events.on("force-camera-for-screenshot",(()=>this._cameraForcedForScreenshot=!0)),L)}),a),o((()=>this._previewing),(()=>this._requestRenderIfEnabled()),n)],this._shadowAccumulatorKey),t.precompile(A)}normalizeCtorArgs(){return{}}dispose(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=i(this._accumulationRenderer),this._bindParameters.shadowMap.dispose(),this._fbo=i(this._fbo),this._vao=i(this._vao),this._cachedLightDirections.length=0,this._sampleCount=0}get computedSamples(){return this._progress}get shadowCastTexture(){return this._fbo?.colorTexture}get accumulating(){return this._active&&this._previewing||this._refining}get _refining(){return this._active&&!this._doneAccumulating&&!this._previewing}get _active(){return null!=this._fbo&&this._sampleCount>0}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==d.zero&&this._opacityFromElevation>b}get _doneAccumulating(){return this._progress>=this._sampleCount}get _lightDirections(){return this._cachedLightDirections}set _lightDirections(e){const t=this._cachedLightDirections;if(r(t,e,_))return;const s=Math.min(R,e.length);t.length=s,this._sampleCount=s;for(let r=0;r<s;++r)t[r]=l(t[r]??m(),e[r]);this._invalidate()}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get running(){return this._refining&&this.canAccumulate&&this._progress>0}runTask(e){for(this._prepareForShadowMapPass(this._bindParameters);!e.done&&!this._doneAccumulating;)this._accumulateShadow(),e.madeProgress();this._requestRender()}renderAccumulation(e,t,r,s){if(this._depthRange=t,this._updateCamera(r),this._bindParameters.contentCamera=s,this._bindParameters.depth=e,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!this.accumulating||!this.canAccumulate)return!1;(this._previewing||0===this._progress||this._cameraForcedForScreenshot)&&this._clear();const i=(this._cameraForcedForScreenshot?this._sampleCount:T)-this._progress;for(let o=0;o<i;++o)this._accumulateShadow(),this._requestRender();return this._cameraForcedForScreenshot=!1,i>0}precompile(){this._accumulationRenderer.precompile()}render(e){this._accumulationRenderer.render(e)}setOptions(e){if(void 0!==e.enabled){const t=null!=this._fbo;e.enabled!==t&&(e.enabled?this._enable():this._disable())}void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._lightDirections=e.lightDirections),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){return!this._active||!this._fbo||this._progress<1||e<0||e>=this._fbo.width||t<0||t>=this._fbo.height?0:(this._fbo.readPixels(e,t,1,1,S.RGBA,F.UNSIGNED_BYTE,O),O[0]/this._progress)}_enable(){this._progress=0;const e=new E;e.pixelFormat=S.RED,e.internalFormat=C.R8,e.wrapMode=x.CLAMP_TO_EDGE,this._fbo=new D(this._rctx,e),this._requestRender()}_disable(){this._fbo=i(this._fbo),this._requestRender()}_invalidate(){this._progress=0,this._requestRenderIfEnabled()}_clear(){this._rctx.bindFramebuffer(this._fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(P.COLOR),this._progress=0}_accumulateShadow(){this._renderToShadowMap(this._bindParameters,this._lightDirections[this._progress++],this._depthRange);const e=this._techniques.get(A);this._rctx.bindFramebuffer(this._fbo),this._rctx.bindTechnique(e,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(e.primitiveType,0,q(this._vao,"geometry"))}_updateCamera(e){const t=this._fbo;if(null==t)return;const r=this._bindParameters.camera;e.equals(r)||r.copyFrom(e),t.resize(e.fullWidth,e.fullHeight),this._opacityFromElevation=1-s(v,w,e.relativeElevation)}_requestRenderIfEnabled(){this._fbo&&this._requestRender()}get test(){}};e([h()],M.prototype,"_progress",void 0),e([h()],M.prototype,"_sampleCount",void 0),e([h()],M.prototype,"_fbo",void 0),e([h()],M.prototype,"_depthRange",void 0),e([h()],M.prototype,"_previewing",void 0),e([h()],M.prototype,"_accumulationRenderer",void 0),e([h()],M.prototype,"_refining",null),e([h()],M.prototype,"_active",null),e([h()],M.prototype,"canAccumulate",null),e([h()],M.prototype,"_doneAccumulating",null),e([h()],M.prototype,"_opacityFromElevation",null),e([h()],M.prototype,"running",null),M=e([c("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],M);const T=6,L="renderView",O=new Uint8Array(4);export{M as ShadowAccumulator};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as s}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import{disposeMaybe as t}from"../../../../core/maybe.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as r,c as o}from"../../../../chunks/vec42.js";import{createQuadVAO as n}from"./glUtil3D.js";import{S as h}from"../../../../chunks/ShadowCastVisualize.glsl.js";import{ShadowCastVisualizeTechnique as d}from"../shaders/ShadowCastVisualizeTechnique.js";import{ShadowCastVisualizeTechniqueConfiguration as l}from"../shaders/ShadowCastVisualizeTechniqueConfiguration.js";import{vertexCount as _}from"../../../webgl/Util.js";const c=4e4,p=5e4,u=1/512;let m=class extends e{constructor(s,e,t,i){super({}),this._techniques=s,this._rctx=e,this._data=t,this._requestRender=i,this._passParameters=new h(this._data),this._configuration=new l,this._enabled=!1,this._vao=n(e)}dispose(){this._stop(),this._vao=t(this._vao)}precompile(){this._showVisualization&&this._techniques.precompile(d,this._configuration)}render(s){if(!this._showVisualization)return;this._passParameters.sampleScale=1/this._data.computedSamples;const e=this._techniques.acquire(d,this._configuration);this._rctx.bindVAO(this._vao),this._rctx.bindTechnique(e,s,this._passParameters),this._rctx.drawArrays(e.primitiveType,0,_(this._vao,"geometry")),e.release()}setOptions(s){void 0!==s.enabled&&this._setEnabled(s.enabled),void 0!==s.color&&this._setColor(s.color),void 0!==s.threshold&&(this._threshold=s.threshold),void 0!==s.visualization&&(this._visualization=s.visualization),void 0!==s.bandSize&&(this._bandSize=s.bandSize),void 0!==s.bandsEnabled&&(this._bandsEnabled=s.bandsEnabled)}get opacityFromElevation(){return this._passParameters.opacityFromElevation}set opacityFromElevation(s){this._passParameters.opacityFromElevation!==s&&(this._passParameters.opacityFromElevation=s,this.notifyChange("opacityFromElevation"))}get _showVisualization(){return this._enabled&&this._data.computedSamples>0&&this.opacityFromElevation>u}get _threshold(){return this._passParameters.threshold}set _threshold(s){this._threshold!==s&&(this._passParameters.threshold=s,this._requestRenderIfEnabled())}get _visualization(){return this._configuration.visualization}set _visualization(s){s!==this._visualization&&(this._configuration.visualization=s,this._requestRenderIfEnabled())}get _bandSize(){return this._passParameters.bandSize}set _bandSize(s){s!==this._bandSize&&(this._passParameters.bandSize=s,this._requestRenderIfEnabled())}get _bandsEnabled(){return this._configuration.bandsEnabled}set _bandsEnabled(s){s!==this._bandsEnabled&&(this._configuration.bandsEnabled=s,this._requestRenderIfEnabled())}_setColor(s){const e=this._passParameters.color;r(s,e)||(o(this._passParameters.color,s),this._requestRenderIfEnabled())}_setEnabled(s){s!==this._enabled&&(s?this._start():this._stop())}_requestRenderIfEnabled(){this._enabled&&this._requestRender()}_start(){this._enabled=!0,this._requestRender()}_stop(){this._enabled=!1,this._requestRender()}};s([i()],m.prototype,"opacityFromElevation",null),m=s([a("esri.views.3d.webgl-engine.lib.ShadowCastRenderer")],m);export{m as ShadowCastRenderer,p as shadowCastDisableElevationMax,c as shadowCastDisableElevationMin,u as shadowCastDisabledElevationThreshold};
5
+ import{_ as s}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{disposeMaybe as e}from"../../../../core/maybe.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as r,c as o}from"../../../../chunks/vec42.js";import{createQuadVAO as n}from"./glUtil3D.js";import{S as h}from"../../../../chunks/ShadowCastVisualize.glsl.js";import{ShadowCastVisualizeTechnique as d}from"../shaders/ShadowCastVisualizeTechnique.js";import{ShadowCastVisualizeTechniqueConfiguration as l}from"../shaders/ShadowCastVisualizeTechniqueConfiguration.js";import{vertexCount as _}from"../../../webgl/Util.js";const c=4e4,p=5e4,m=1/512;let u=class extends t{constructor(s,t,e,i){super({}),this._techniques=s,this._rctx=t,this._data=e,this._requestRender=i,this._passParameters=new h(this._data),this._configuration=new l,this._enabled=!1,this._vao=n(t)}dispose(){this._stop(),this._vao=e(this._vao)}precompile(){this._showVisualization&&this._techniques.precompile(d,this._configuration)}render(s){if(!this._showVisualization)return;this._passParameters.sampleScale=1/this._data.computedSamples;const t=this._techniques.get(d,this._configuration);this._rctx.bindVAO(this._vao),this._rctx.bindTechnique(t,s,this._passParameters),this._rctx.drawArrays(t.primitiveType,0,_(this._vao,"geometry"))}setOptions(s){void 0!==s.enabled&&this._setEnabled(s.enabled),void 0!==s.color&&this._setColor(s.color),void 0!==s.threshold&&(this._threshold=s.threshold),void 0!==s.visualization&&(this._visualization=s.visualization),void 0!==s.bandSize&&(this._bandSize=s.bandSize),void 0!==s.bandsEnabled&&(this._bandsEnabled=s.bandsEnabled)}get opacityFromElevation(){return this._passParameters.opacityFromElevation}set opacityFromElevation(s){this._passParameters.opacityFromElevation!==s&&(this._passParameters.opacityFromElevation=s,this.notifyChange("opacityFromElevation"))}get _showVisualization(){return this._enabled&&this._data.computedSamples>0&&this.opacityFromElevation>m}get _threshold(){return this._passParameters.threshold}set _threshold(s){this._threshold!==s&&(this._passParameters.threshold=s,this._requestRenderIfEnabled())}get _visualization(){return this._configuration.visualization}set _visualization(s){s!==this._visualization&&(this._configuration.visualization=s,this._requestRenderIfEnabled())}get _bandSize(){return this._passParameters.bandSize}set _bandSize(s){s!==this._bandSize&&(this._passParameters.bandSize=s,this._requestRenderIfEnabled())}get _bandsEnabled(){return this._configuration.bandsEnabled}set _bandsEnabled(s){s!==this._bandsEnabled&&(this._configuration.bandsEnabled=s,this._requestRenderIfEnabled())}_setColor(s){const t=this._passParameters.color;r(s,t)||(o(this._passParameters.color,s),this._requestRenderIfEnabled())}_setEnabled(s){s!==this._enabled&&(s?this._start():this._stop())}_requestRenderIfEnabled(){this._enabled&&this._requestRender()}_start(){this._enabled=!0,this._requestRender()}_stop(){this._enabled=!1,this._requestRender()}};s([i()],u.prototype,"opacityFromElevation",null),u=s([a("esri.views.3d.webgl-engine.lib.ShadowCastRenderer")],u);export{u as ShadowCastRenderer,p as shadowCastDisableElevationMax,c as shadowCastDisableElevationMin,m as shadowCastDisabledElevationThreshold};
@@ -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/Accessor.js";import"../../../../core/has.js";import{someMap as t}from"../../../../core/MapUtils.js";import s from"../../../../core/PooledArray.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a}from"../../../../chunks/sphere.js";import{OverlayTarget as d}from"../../terrain/Intersector.js";import{ShaderOutput as h}from"../core/shaderLibrary/ShaderOutput.js";import{releaseTechniques as l}from"../effects/RenderPlugin.js";import{ChangeSet as c}from"./ChangeSet.js";import{newIntersectorResult as p}from"./Intersector.js";import{StoreResults as m,IntersectorType as g}from"./IntersectorInterfaces.js";import{RenderOccludedFlag as u}from"./Material.js";import{DirtyOperation as _,DirtyState as y}from"./ModelDirtyTypes.js";import{splitRenderGeometryChangeSetByMaterial as f}from"./rendererUtils.js";import{RenderSlot as R}from"./RenderSlot.js";import{MergedRenderer as G}from"../materials/renderers/MergedRenderer.js";let v=class extends r{constructor(e){super(e),this._pending=new C,this._changes=new c,this._renderers=new Map,this._sortedRenderers=new s,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this._changes.prune(),this._renderers.forEach((e=>e.destroy())),this._renderers.clear(),this._sortedRenderers.clear(),this._geometries.clear(),this._pending.clear()}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _materials(){return this.rendererContext.materials}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlightOptions(e){return t(this._renderers,(r=>r.hasHighlightOptions(e)))}get hasWater(){return this._hasWater}get rendersOccludedDraped(){for(const e of this._renderers.values())if(0!==e.numGeometries&&!e.queryRenderOccludedState(u.Occlude))return!0;return!1}get isEmpty(){return!this.updating&&0===this._renderers.size&&0===this._geometries.size}getMaterialRenderer(e){return this._renderers.get(e)}get sortedRenderers(){return this._sortedRenderers}commitChanges(e){if(!this.updating)return!1;this._processAddsRemoves();const r=f(this._changes);let s=!1;return r.forEach(((r,t)=>{let i=this._renderers.get(t);!i&&r.adds.length>0&&(i=new G({material:t,highlightOrderMap:e}),i.initializeRenderContext(this.rendererContext.pluginContext,this._materials),this._renderers.set(t,i),s=!0),i&&(i.modify(r),i.updateHighlights(e),0===i.numGeometries&&(this._renderers.delete(t),i.destroy(),s=!0))})),this._changes.clear(),s&&this._updateSortedMaterialRenderers(),this._hasHighlights=t(this._renderers,(e=>{const r=e.produces.get(R.DRAPED_MATERIAL);return!!r&&r(h.Highlight)})),this._hasWater=t(this._renderers,(e=>{const r=e.produces.get(R.DRAPED_WATER);return!!r&&r(h.Normal)})),this.notifyChange("updating"),!0}updateHighlights(e){this._renderers.forEach((r=>r.updateHighlights(e)))}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);s&&this.notifyChange("updating"),r===_.UPDATE&&this._notifyGraphicGeometryChanged(e)}removeGeometries(e,r){const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),r===_.UPDATE&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=this._changes.updates.pushNew();e.renderGeometry=this._validateRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case y.TRANSFORMATION:case y.GEOMETRY:return this._notifyGraphicGeometryChanged(e);case y.VISIBILITY:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll((t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r)),r}precompile(e){return this._sortedRenderers.reduce(((r,t)=>t.precompile(e)||r),!1)}render(e){this._sortedRenderers.forAll((r=>{const t=r.acquireTechniques(e);t&&(r.render(e,t),l(t))}))}intersect(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;o&&(n.boundingSphere[0]-n.boundingSphere[3]<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),n.boundingSphere[0]+n.boundingSphere[3]>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)),i++}return i}_updateSortedMaterialRenderers(){this._sortedRenderers.clear();let e=0;for(const r of this._renderers.values())r.drapedPriority=e++,this._sortedRenderers.push(r);this._sortedRenderers.sort(((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0)))}_processAddsRemoves(){this._changes.adds.clear(),this._changes.removes.clear(),this._changes.adds.pushArray(Array.from(this._pending.adds)),this._changes.removes.pushArray(Array.from(this._pending.removes)),this._changes.updates.filterInPlace((({renderGeometry:e})=>!this._pending.has(e))),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible)return;let o=0;s+=e.transformation[12],o=e.transformation[13],O[0]=t[0]-s,O[1]=t[1]-o,e.screenToWorldRatio=this.rendererContext.screenToWorldRatio,e.material.intersectDraped(e,null,i,O,((t,s,o)=>{A(r,o,n,e.material.renderPriority,i,e.layerUid,e.graphicUid)}),r)}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._validateRenderGeometry(r);return e}_validateRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(a(e.boundingSphere))),e}get test(){}};e([i()],v.prototype,"drapeSource",void 0),e([i()],v.prototype,"updating",null),e([i()],v.prototype,"rctx",null),e([i({constructOnly:!0})],v.prototype,"rendererContext",void 0),e([i()],v.prototype,"_materials",null),e([i()],v.prototype,"_localOriginFactory",null),e([i({readOnly:!0})],v.prototype,"isEmpty",null),e([i()],v.prototype,"_renderers",void 0),e([i()],v.prototype,"_geometries",void 0),v=e([n("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],v);class C{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function A(e,r,t,s,i,n,o){const a=new d(n,o,r),h=r=>{r.set(g.OVERLAY,a,e.dist,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.dist||i.results.ground.dist<=i.results.min.dist)&&h(i.results.min),i.options.store!==m.MIN&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.dist||i.results.ground.dist>i.results.max.dist)&&h(i.results.max),i.options.store===m.ALL){const e=p(i.ray);h(e),i.results.all.push(e)}}const O=o();export{v as SortedRenderGeometryRenderer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import"../../../../core/has.js";import{someMap as t}from"../../../../core/MapUtils.js";import s from"../../../../core/PooledArray.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a}from"../../../../chunks/sphere.js";import{OverlayTarget as d}from"../../terrain/Intersector.js";import{ShaderOutput as h}from"../core/shaderLibrary/ShaderOutput.js";import{ChangeSet as l}from"./ChangeSet.js";import{newIntersectorResult as c}from"./Intersector.js";import{StoreResults as p,IntersectorType as m}from"./IntersectorInterfaces.js";import{RenderOccludedFlag as g}from"./Material.js";import{DirtyOperation as u,DirtyState as _}from"./ModelDirtyTypes.js";import{splitRenderGeometryChangeSetByMaterial as y}from"./rendererUtils.js";import{RenderSlot as f}from"./RenderSlot.js";import{MergedRenderer as R}from"../materials/renderers/MergedRenderer.js";let G=class extends r{constructor(e){super(e),this._pending=new v,this._changes=new l,this._renderers=new Map,this._sortedRenderers=new s,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this._changes.prune(),this._renderers.forEach((e=>e.destroy())),this._renderers.clear(),this._sortedRenderers.clear(),this._geometries.clear(),this._pending.clear()}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _materials(){return this.rendererContext.materials}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlightOptions(e){return t(this._renderers,(r=>r.hasHighlightOptions(e)))}get hasWater(){return this._hasWater}get rendersOccludedDraped(){for(const e of this._renderers.values())if(0!==e.numGeometries&&!e.queryRenderOccludedState(g.Occlude))return!0;return!1}get isEmpty(){return!this.updating&&0===this._renderers.size&&0===this._geometries.size}getMaterialRenderer(e){return this._renderers.get(e)}get sortedRenderers(){return this._sortedRenderers}commitChanges(e){if(!this.updating)return!1;this._processAddsRemoves();const r=y(this._changes);let s=!1;return r.forEach(((r,t)=>{let i=this._renderers.get(t);!i&&r.adds.length>0&&(i=new R({material:t,highlightOrderMap:e}),i.initializeRenderContext(this.rendererContext.pluginContext,this._materials),this._renderers.set(t,i),s=!0),i&&(i.modify(r),i.updateHighlights(e),0===i.numGeometries&&(this._renderers.delete(t),i.destroy(),s=!0))})),this._changes.clear(),s&&this._updateSortedMaterialRenderers(),this._hasHighlights=t(this._renderers,(e=>{const r=e.produces.get(f.DRAPED_MATERIAL);return!!r&&r(h.Highlight)})),this._hasWater=t(this._renderers,(e=>{const r=e.produces.get(f.DRAPED_WATER);return!!r&&r(h.Normal)})),this.notifyChange("updating"),!0}updateHighlights(e){this._renderers.forEach((r=>r.updateHighlights(e)))}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);s&&this.notifyChange("updating"),r===u.UPDATE&&this._notifyGraphicGeometryChanged(e)}removeGeometries(e,r){const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),r===u.UPDATE&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=this._changes.updates.pushNew();e.renderGeometry=this._validateRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case _.TRANSFORMATION:case _.GEOMETRY:return this._notifyGraphicGeometryChanged(e);case _.VISIBILITY:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll((t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r)),r}precompile(e){return this._sortedRenderers.reduce(((r,t)=>t.precompile(e)||r),!1)}render(e){this._sortedRenderers.forAll((r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)}))}intersect(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;o&&(n.boundingSphere[0]-n.boundingSphere[3]<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),n.boundingSphere[0]+n.boundingSphere[3]>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)),i++}return i}_updateSortedMaterialRenderers(){this._sortedRenderers.clear();let e=0;for(const r of this._renderers.values())r.drapedPriority=e++,this._sortedRenderers.push(r);this._sortedRenderers.sort(((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0)))}_processAddsRemoves(){this._changes.adds.clear(),this._changes.removes.clear(),this._changes.adds.pushArray(Array.from(this._pending.adds)),this._changes.removes.pushArray(Array.from(this._pending.removes)),this._changes.updates.filterInPlace((({renderGeometry:e})=>!this._pending.has(e))),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible)return;let o=0;s+=e.transformation[12],o=e.transformation[13],A[0]=t[0]-s,A[1]=t[1]-o,e.screenToWorldRatio=this.rendererContext.screenToWorldRatio,e.material.intersectDraped(e,null,i,A,((t,s,o)=>{C(r,o,n,e.material.renderPriority,i,e.layerUid,e.graphicUid)}),r)}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._validateRenderGeometry(r);return e}_validateRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(a(e.boundingSphere))),e}get test(){}};e([i()],G.prototype,"drapeSource",void 0),e([i()],G.prototype,"updating",null),e([i()],G.prototype,"rctx",null),e([i({constructOnly:!0})],G.prototype,"rendererContext",void 0),e([i()],G.prototype,"_materials",null),e([i()],G.prototype,"_localOriginFactory",null),e([i({readOnly:!0})],G.prototype,"isEmpty",null),e([i()],G.prototype,"_renderers",void 0),e([i()],G.prototype,"_geometries",void 0),G=e([n("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],G);class v{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function C(e,r,t,s,i,n,o){const a=new d(n,o,r),h=r=>{r.set(m.OVERLAY,a,e.dist,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.dist||i.results.ground.dist<=i.results.min.dist)&&h(i.results.min),i.options.store!==p.MIN&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.dist||i.results.ground.dist>i.results.max.dist)&&h(i.results.max),i.options.store===p.ALL){const e=c(i.ray);h(e),i.results.all.push(e)}}const A=o();export{G as SortedRenderGeometryRenderer};
@@ -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"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import s from"../../../../core/Logger.js";import{isPromiseLike as o,isAbortError as i}from"../../../../core/promiseUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{RenderRequestType as a}from"./basicInterfaces.js";import{ContentObjectType as h}from"./ContentObjectType.js";import{isFrameUpdateTexture as c}from"./ITexture.js";import{TextureTechnique as l}from"./TextureTechnique.js";import{TextureTechniqueConfiguration as p}from"./TextureTechniqueConfiguration.js";import{TaskPriority as d}from"../../../support/Scheduler.js";let m=class extends t{constructor(e,t,s){super({}),this._stage=e,this._techniques=t,this._rctx=s,this._textures=new Map,this._loadingCount=0,this._frameUpdates=new Map,this.events=new r,this._frameTask=e.view.resourceController.scheduler.registerTask(d.TEXTURE_UNLOAD)}normalizeCtorArgs(){return{}}destroy(){this._frameTask.remove(),this._stage.forEachOfType(h.Texture,(e=>e.unload()))}get updating(){return this._loadingCount>0||this._frameTask.updating}get textureTechnique(){return null==this._textureTechnique&&(this._textureTechnique=this._techniques.acquire(l,new p)),this._textureTechnique}acquire(e){const t=this._textures.get(e);return t?(t.ref(),t.loadingPromise??t):this._createNewRef(e)}update(){let e=!1;this._frameUpdates.forEach((t=>{const r=t.texture.frameUpdate(t.previousToken);r>=0&&r!==t.previousToken&&(t.previousToken=r,e=!0)})),e&&this.events.emit("changed",a.BACKGROUND)}_createNewRef(e){const t=this._stage.getObject(e);if(null==t)return null;const r=t.events.on("unloaded",(()=>{r.remove(),this._onTextureUnloaded(e)})),n=new _(e,(()=>{this._frameTask.schedule((()=>{n.isUnreferenced&&t.unload()}))}));return this._textures.set(e,n),n.ref(),t.glTexture?(this._updateGLTexture(n,t.glTexture),c(t)&&this._frameUpdates.set(e,{texture:t,previousToken:-1}),n):(this._loadingCount++,n.loadingPromise=this._stage.schedule((()=>{const r=t.load(this._rctx),u=r=>(this._loadingCount--,n.loadingPromise=null,this._updateGLTexture(n,r),c(t)&&this._frameUpdates.set(e,{texture:t,previousToken:-1}),n),a=e=>(this._loadingCount--,n.loadingPromise=null,i(e)||s.getLogger(this).error(e),null);return o(r)?r.then(u,a):u(r)})),n.loadingPromise)}_updateGLTexture(e,t){e.glTexture=t,this.events.emit("changed",a.UPDATE)}_onTextureUnloaded(e){this._textures.delete(e),this._frameUpdates.delete(e)}};e([n()],m.prototype,"_loadingCount",void 0),e([n()],m.prototype,"_frameTask",void 0),e([n()],m.prototype,"updating",null),m=e([u("esri.views.3d.webgl-engine.lib.TextureRepository")],m);class _{constructor(e,t){this.id=e,this._release=t,this._refCount=0}get isUnreferenced(){return 0===this._refCount}ref(){++this._refCount}release(){--this._refCount,this._refCount>0||(0!==this._refCount?(s.getLogger("esri.views.3d.webgl-engine.lib.TextureRepository.RefCountedTextureImpl").error("Cannot dereference texture that has no references!"),this._refCount=0):this._release())}}export{m as TextureRepository};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import s from"../../../../core/Logger.js";import{isPromiseLike as o,isAbortError as i}from"../../../../core/promiseUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{RenderRequestType as a}from"./basicInterfaces.js";import{ContentObjectType as h}from"./ContentObjectType.js";import{isFrameUpdateTexture as c}from"./ITexture.js";import{TextureTechnique as l}from"./TextureTechnique.js";import{TextureTechniqueConfiguration as p}from"./TextureTechniqueConfiguration.js";import{TaskPriority as d}from"../../../support/Scheduler.js";let m=class extends t{constructor(e,t,s){super({}),this._stage=e,this._techniques=t,this._rctx=s,this._textures=new Map,this._loadingCount=0,this._frameUpdates=new Map,this.events=new r,this._frameTask=e.view.resourceController.scheduler.registerTask(d.TEXTURE_UNLOAD)}normalizeCtorArgs(){return{}}destroy(){this._frameTask.remove(),this._stage.forEachOfType(h.Texture,(e=>e.unload()))}get updating(){return this._loadingCount>0||this._frameTask.updating}get textureTechnique(){return null==this._textureTechnique&&(this._textureTechnique=this._techniques.get(l,new p)),this._textureTechnique}acquire(e){const t=this._textures.get(e);return t?(t.ref(),t.loadingPromise??t):this._createNewRef(e)}update(){let e=!1;this._frameUpdates.forEach((t=>{const r=t.texture.frameUpdate(t.previousToken);r>=0&&r!==t.previousToken&&(t.previousToken=r,e=!0)})),e&&this.events.emit("changed",a.BACKGROUND)}_createNewRef(e){const t=this._stage.getObject(e);if(null==t)return null;const r=t.events.on("unloaded",(()=>{r.remove(),this._onTextureUnloaded(e)})),n=new _(e,(()=>{this._frameTask.schedule((()=>{n.isUnreferenced&&t.unload()}))}));return this._textures.set(e,n),n.ref(),t.glTexture?(this._updateGLTexture(n,t.glTexture),c(t)&&this._frameUpdates.set(e,{texture:t,previousToken:-1}),n):(this._loadingCount++,n.loadingPromise=this._stage.schedule((()=>{const r=t.load(this._rctx),u=r=>(this._loadingCount--,n.loadingPromise=null,this._updateGLTexture(n,r),c(t)&&this._frameUpdates.set(e,{texture:t,previousToken:-1}),n),a=e=>(this._loadingCount--,n.loadingPromise=null,i(e)||s.getLogger(this).error(e),null);return o(r)?r.then(u,a):u(r)})),n.loadingPromise)}_updateGLTexture(e,t){e.glTexture=t,this.events.emit("changed",a.UPDATE)}_onTextureUnloaded(e){this._textures.delete(e),this._frameUpdates.delete(e)}};e([n()],m.prototype,"_loadingCount",void 0),e([n()],m.prototype,"_frameTask",void 0),e([n()],m.prototype,"updating",null),m=e([u("esri.views.3d.webgl-engine.lib.TextureRepository")],m);class _{constructor(e,t){this.id=e,this._release=t,this._refCount=0}get isUnreferenced(){return 0===this._refCount}ref(){++this._refCount}release(){--this._refCount,this._refCount>0||(0!==this._refCount?(s.getLogger("esri.views.3d.webgl-engine.lib.TextureRepository.RefCountedTextureImpl").error("Cannot dereference texture that has no references!"),this._refCount=0):this._release())}}export{m as TextureRepository};
@@ -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{a as e}from"../../../../chunks/TextureOnly.glsl.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{makePipelineState as i,premultipliedAlphaToPremultipliedAlpha as l,defaultColorWrite as s}from"../../../webgl/renderState.js";class t extends o{constructor(o,i,l){super(o,i,new r(e,(()=>import("../core/shaderLibrary/util/TextureOnly.glsl.js"))),l)}initializePipeline(e){return e.hasAlpha?i({blending:l,colorWrite:s}):i({colorWrite:s})}}export{t as TextureTechnique};
5
+ import{a as e}from"../../../../chunks/TextureOnly.glsl.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{makePipelineState as i,premultipliedAlphaToPremultipliedAlpha as l,defaultColorWrite as s}from"../../../webgl/renderState.js";class t extends o{constructor(o,i){super(o,i,new r(e,(()=>import("../core/shaderLibrary/util/TextureOnly.glsl.js"))))}initializePipeline(e){return e.hasAlpha?i({blending:l,colorWrite:s}):i({colorWrite:s})}}export{t as TextureTechnique};
@@ -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 s from"../../../../core/Collection.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../core/maybe.js";import{watch as i,initial as o,when as a,sync as n}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{translate as c,fromTranslation as p,scale as w,mul as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as u,j as f}from"../../../../chunks/vec32.js";import{create as v,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as V}from"../../../../chunks/sphere.js";import{InternalRenderCategory as g}from"../../webgl.js";import b from"../../webgl/RenderNode.js";import{RenderRequestType as M}from"./basicInterfaces.js";import{RenderFeature as j}from"./RenderFeature.js";import{ViewshedShadowMap as S}from"./ViewshedShadowMap.js";import{V as y}from"../../../../chunks/Viewshed.glsl.js";import{ViewshedTechnique as R}from"../shaders/ViewshedTechnique.js";let P=class extends b{get shadowMap(){return this._shadowMap}get hasViewsheds(){return this._viewsheds.length>0}get _contentPixelRatio(){return this.view.state.contentPixelRatio}get _viewshedsInView(){return this._viewsheds.items.filter((e=>A(this.view,e)))}constructor(e){super(e),this._techniques=null,this._passParameters=new y,this._viewsheds=new s,this._shadowMap=null,this.consumes={required:[g.VIEWSHED,"normals"]},this.produces=g.VIEWSHED,this.requireGeometryDepth=!0}initialize(){this._shadowMap=new S(this.fboCache),this.addHandles([i((()=>this.view.resolutionScale),(e=>{const s=this._shadowMap;s&&(s.settings.textureSizeQuality=e)}),o),a((()=>!this.hasViewsheds),(()=>this._shadowMap?.dispose())),a((()=>this.view._stage.renderView.techniques),(e=>this._techniques=e),o),i((()=>this._viewshedsInView.map((e=>[e.observerRenderSpace,e.heading,e.tilt,e.farDistance,e.horizontalFieldOfView,e.verticalFieldOfView]))),(()=>this.requestRender(M.UPDATE)),n)])}destroy(){this._shadowMap=r(this._shadowMap)}precompile(){if(this.hasViewsheds){this._techniques?.precompile(R);for(const e of this._viewshedsInView)if(this._shadowMap?.isActive(e))return void this.view._stage.renderer.precompileViewshedShadowMap()}}render(e){const s=this.bindParameters,t=this.renderingContext,r=e.find((({name:e})=>e===g.VIEWSHED));if(!this.hasViewsheds||!s.depth)return r;this._passParameters.shadowMap=this._shadowMap??this._passParameters.shadowMap,this._passParameters.normals=e.find((({name:e})=>"normals"===e))?.getTexture();const i=this._techniques?.acquire(R);if(!i?.compiled)return this.requestRender(M.UPDATE),i?.release(),r;const o=this.view._stage.renderer.isFeatureEnabled(j.HighResolutionViewshed);for(const a of this._viewshedsInView){if(!this._renderShadowCubeMap(s,a,o)||!this._shadowMap?.ready)continue;const e=this._setupViewshedParameters(a,s.camera);t.bindTechnique(i,s,e),t.bindFramebuffer(r.fbo),t.screen.draw()}return i.release(),this.shadowMap?.dispose(),r}updateViewsheds(e){const s=this._viewsheds,{removes:t,adds:r}=e;if(t&&(Array.isArray(t)?s.removeMany(t):s.remove(t)),r)if(Array.isArray(r)){const e=r.filter((e=>!s.includes(e)));s.addMany(e)}else s.includes(r)||s.add(r)}_renderShadowCubeMap(e,s,t){const r=this._shadowMap;if(!r)return!1;const i=this.view.basemapTerrain.hasStencilEnabledExtents,o=r.start(e.camera,s,t,this._contentPixelRatio,i);return o&&r.faces.forEach((e=>this.view._stage.renderer.renderViewshedShadowMap(e))),r.finish(),o}_setupViewshedParameters(e,s){const r=this._shadowMap;if(!r)return this._passParameters;const i=this._passParameters,o=e.effectiveObserverRenderSpace;i.localOrigin=o,i.observerOffset=u(I,e.observerRenderSpace,e.effectiveObserverRenderSpace),i.fovs=[t(e.horizontalFieldOfView),t(e.verticalFieldOfView)],i.headingAndTilt=[t(e.heading),t(e.tiltParallelToSurface)],i.upVector=e.tiltedUpVector;const a=x(e.targetRenderSpace,o);i.targetVector=a;const n=new Array,h=new Array;for(let t=0;t<r.numActiveFaces;t++)c(O,r.viewshedViewMatrices[t],o),n.push(...O),q(r.viewshedProjectionMatrices[t],O,D),h.push(...D);return i.viewMatrices=n,i.projectionMatrices=h,i.volumeOffset=this.selectedViewshed?.()===e.viewshed?E(e,this.view,s.eye):0,i}get test(){return{viewsheds:this._viewsheds,shadowMap:this._shadowMap,viewshedsInView:this._viewshedsInView}}};function x(e,s){const t=v();return u(t,e,s)}function q(e,s,t){const r=_(.5,.5,.5);return p(t,r),w(t,t,r),l(t,t,e),l(t,t,s),t}function A(e,s){const t=V(s.observerRenderSpace,s.farDistanceRenderSpace);return!!e.ready&&e.frustum.intersectsSphere(t)}function E(e,s,t){if(null==e)return 0;const{observerRenderSpace:r,targetRenderSpace:i}=e,o=f(t,r)>f(t,i)?e.observer:e.target;return s.pixelSizeAt(o)}e([h()],P.prototype,"_techniques",void 0),e([h()],P.prototype,"selectedViewshed",void 0),e([h()],P.prototype,"shadowMap",null),e([h()],P.prototype,"hasViewsheds",null),e([h()],P.prototype,"_contentPixelRatio",null),e([h()],P.prototype,"_viewshedsInView",null),e([h()],P.prototype,"consumes",void 0),e([h()],P.prototype,"produces",void 0),P=e([d("esri.views.3d.webgl-engine.lib.Viewshed")],P);const I=v(),O=m(),D=m();export{P as Viewshed,E as computeOffsetScale};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import s from"../../../../core/Collection.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../core/maybe.js";import{watch as i,initial as o,when as a,sync as n}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{translate as c,fromTranslation as p,scale as w,mul as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as u,j as f}from"../../../../chunks/vec32.js";import{create as v,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as V}from"../../../../chunks/sphere.js";import{InternalRenderCategory as g}from"../../webgl.js";import b from"../../webgl/RenderNode.js";import{RenderRequestType as M}from"./basicInterfaces.js";import{RenderFeature as j}from"./RenderFeature.js";import{ViewshedShadowMap as S}from"./ViewshedShadowMap.js";import{V as y}from"../../../../chunks/Viewshed.glsl.js";import{ViewshedTechnique as R}from"../shaders/ViewshedTechnique.js";let P=class extends b{get shadowMap(){return this._shadowMap}get hasViewsheds(){return this._viewsheds.length>0}get _contentPixelRatio(){return this.view.state.contentPixelRatio}get _viewshedsInView(){return this._viewsheds.items.filter((e=>E(this.view,e)))}constructor(e){super(e),this._passParameters=new y,this._viewsheds=new s,this._shadowMap=null,this.consumes={required:[g.VIEWSHED,"normals"]},this.produces=g.VIEWSHED,this.requireGeometryDepth=!0}initialize(){this._shadowMap=new S(this.fboCache),this.addHandles([i((()=>this.view.resolutionScale),(e=>{const s=this._shadowMap;s&&(s.settings.textureSizeQuality=e)}),o),a((()=>!this.hasViewsheds),(()=>this._shadowMap?.dispose())),i((()=>this._viewshedsInView.map((e=>[e.observerRenderSpace,e.heading,e.tilt,e.farDistance,e.horizontalFieldOfView,e.verticalFieldOfView]))),(()=>this.requestRender(M.UPDATE)),n)])}destroy(){this._shadowMap=r(this._shadowMap)}precompile(){if(this.hasViewsheds){this.techniques.precompile(R);for(const e of this._viewshedsInView)if(this._shadowMap?.isActive(e))return void this.view._stage.renderer.precompileViewshedShadowMap()}}render(e){const s=this.bindParameters,t=this.renderingContext,r=e.find((({name:e})=>e===g.VIEWSHED));if(!this.hasViewsheds||!s.depth)return r;this._passParameters.shadowMap=this._shadowMap??this._passParameters.shadowMap,this._passParameters.normals=e.find((({name:e})=>"normals"===e))?.getTexture();const i=this.techniques.get(R);if(!i?.compiled)return this.requestRender(M.UPDATE),r;const o=this.view._stage.renderer.isFeatureEnabled(j.HighResolutionViewshed);for(const a of this._viewshedsInView){if(!this._renderShadowCubeMap(s,a,o)||!this._shadowMap?.ready)continue;const e=this._setupViewshedParameters(a,s.camera);t.bindTechnique(i,s,e),t.bindFramebuffer(r.fbo),t.screen.draw()}return this.shadowMap?.dispose(),r}updateViewsheds(e){const s=this._viewsheds,{removes:t,adds:r}=e;if(t&&(Array.isArray(t)?s.removeMany(t):s.remove(t)),r)if(Array.isArray(r)){const e=r.filter((e=>!s.includes(e)));s.addMany(e)}else s.includes(r)||s.add(r)}_renderShadowCubeMap(e,s,t){const r=this._shadowMap;if(!r)return!1;const i=this.view.basemapTerrain.hasStencilEnabledExtents,o=r.start(e.camera,s,t,this._contentPixelRatio,i);return o&&r.faces.forEach((e=>this.view._stage.renderer.renderViewshedShadowMap(e))),r.finish(),o}_setupViewshedParameters(e,s){const r=this._shadowMap;if(!r)return this._passParameters;const i=this._passParameters,o=e.effectiveObserverRenderSpace;i.localOrigin=o,i.observerOffset=u(O,e.observerRenderSpace,e.effectiveObserverRenderSpace),i.fovs=[t(e.horizontalFieldOfView),t(e.verticalFieldOfView)],i.headingAndTilt=[t(e.heading),t(e.tiltParallelToSurface)],i.upVector=e.tiltedUpVector;const a=x(e.targetRenderSpace,o);i.targetVector=a;const n=new Array,h=new Array;for(let t=0;t<r.numActiveFaces;t++)c(q,r.viewshedViewMatrices[t],o),n.push(...q),A(r.viewshedProjectionMatrices[t],q,D),h.push(...D);return i.viewMatrices=n,i.projectionMatrices=h,i.volumeOffset=this.selectedViewshed?.()===e.viewshed?I(e,this.view,s.eye):0,i}get test(){return{viewsheds:this._viewsheds,shadowMap:this._shadowMap,viewshedsInView:this._viewshedsInView}}};function x(e,s){const t=v();return u(t,e,s)}function A(e,s,t){const r=_(.5,.5,.5);return p(t,r),w(t,t,r),m(t,t,e),m(t,t,s),t}function E(e,s){const t=V(s.observerRenderSpace,s.farDistanceRenderSpace);return!!e.ready&&e.frustum.intersectsSphere(t)}function I(e,s,t){if(null==e)return 0;const{observerRenderSpace:r,targetRenderSpace:i}=e,o=f(t,r)>f(t,i)?e.observer:e.target;return s.pixelSizeAt(o)}e([h()],P.prototype,"selectedViewshed",void 0),e([h()],P.prototype,"shadowMap",null),e([h()],P.prototype,"hasViewsheds",null),e([h()],P.prototype,"_contentPixelRatio",null),e([h()],P.prototype,"_viewshedsInView",null),e([h()],P.prototype,"consumes",void 0),e([h()],P.prototype,"produces",void 0),P=e([d("esri.views.3d.webgl-engine.lib.Viewshed")],P);const O=v(),q=l(),D=l();export{P as Viewshed,I as computeOffsetScale};
@@ -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 e from"../../../../../core/PooledArray.js";import{transpose as r,invert as t}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{i}from"../../../../../chunks/vec32.js";import{debugFlags as o}from"../../../support/debugFlags.js";import{TwoVectorPosition as a}from"../../core/util/TwoVectorPosition.js";import{EdgeDrawParameters as n}from"./EdgeShaderParameters.js";import{EdgeShaderTechnique as l}from"./EdgeShaderTechnique.js";import{EdgeShaderTechniqueConfiguration as d}from"./EdgeShaderTechniqueConfiguration.js";import{Transparency as h}from"./interfaces.js";import{EdgeType as c}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{PrimitiveType as m}from"../../../../webgl/enums.js";const _=8,g=128,f={type:c.Solid,hasSlicePlane:!1,strokesTexture:null,legacy:!0,spherical:!0};class u{constructor(r,t,s){this.rctx=r,this._techniques=t,this._configuration=new d,this.refCount=0,this._renderables=new Set,this._sortedRenderables={[h.TRANSPARENT]:{[h.TRANSPARENT]:new e,[h.OPAQUE]:new e},[h.OPAQUE]:{[h.TRANSPARENT]:new e,[h.OPAQUE]:new e}},this._renderablesDirty=!1,this._drawParameters=new n,this._settings={...f,...s},this.key=u.getKey(this._settings.type,this._settings.hasSlicePlane,this._settings.legacy);const i=this._settings.strokesTexture.variants;this.writerSettings={variants:i,reducedPrecision:o.TESTS_DISABLE_OPTIMIZATIONS},this._configuration.legacy=this._settings.legacy,this._configuration.type=this._settings.type,this._configuration.silhouette=!1,this._configuration.hasSlicePlane=this._settings.hasSlicePlane,this._configuration.doublePrecisionRequiresObfuscation=r.driverTest.doublePrecisionRequiresObfuscation.result,this._configuration.spherical=s.spherical}addRenderable(e){this._renderables.add(e),this._renderablesDirty=!0}removeRenderable(e){this._renderables.delete(e),this._renderablesDirty=!0}setRenderablesDirty(){this._renderablesDirty=!0}forEachRenderable(e,r){this._renderablesDirty&&this._sortRenderables();const t=this._sortedRenderables[r];t[h.TRANSPARENT].forAll(e),t[h.OPAQUE].forAll(e)}acquireTechnique(e,r){return this._lastOriginId=null,this._configuration.terrainDepthTest=e.terrainDepthTest,this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.silhouette=r,this._techniques.acquire(l,this._configuration)}renderRegularEdges(e,r,t,s,i){this._render(e,r,r.regular.vao,t,s,i)}renderSilhouetteEdges(e,r,t,s,i){this._render(e,r,r.silhouette.vao,t,s,i)}_render(e,r,t,s,i,o){o>0&&(this._bindDraw(e,r,s,i),this.rctx.bindVAO(t),this.rctx.drawArraysInstanced(m.TRIANGLE_FAN,0,4,o))}_bindDraw(e,s,o,n){this._drawParameters.componentDataTexture=s.components.buffer.textureBuffer.texture,this._drawParameters.strokesTexture=this._settings.strokesTexture;const l=s.transform.origin;if(l){const r=l.origin.id;this._lastOriginId!==r&&(e.setUniformMatrix4fv("localView",l.viewMatrix),this._lastOriginId=r),e.setUniformMatrix4fv("model",s.transform.modelMatrix),this._drawParameters.slicePlaneLocalOrigin=l.origin.vec3}else{const e=new a(s.transform.position),o=r(T,t(T,s.transform.rotationScale));this._drawParameters.transformWorldFromModelTL=e.low,this._drawParameters.transformWorldFromModelTH=e.high,this._drawParameters.transformWorldFromModelRS=s.transform.rotationScale,this._drawParameters.transformNormalGlobalFromModel=o;const l=n.camera.viewInverseTransposeMatrix;i(this._drawParameters.slicePlaneLocalOrigin,l[3],l[7],l[11])}e.bindDraw(n,o,this._drawParameters)}_sortRenderables(){this._renderablesDirty=!1,this._sortedRenderables[h.TRANSPARENT][h.TRANSPARENT].clear(),this._sortedRenderables[h.TRANSPARENT][h.OPAQUE].clear(),this._sortedRenderables[h.OPAQUE][h.TRANSPARENT].clear(),this._sortedRenderables[h.OPAQUE][h.OPAQUE].clear(),this._renderables.forEach((e=>this._sortedRenderables[e.objectTransparency][e.edgeTransparency].push(e)));const e=(e,r)=>e.transform.origin?r.transform.origin?e.transform.origin.origin.id<r.transform.origin.origin.id?-1:e.transform.origin.origin.id>r.transform.origin.origin.id?1:0:1:0;this._sortedRenderables[h.TRANSPARENT][h.TRANSPARENT].sort(e),this._sortedRenderables[h.TRANSPARENT][h.OPAQUE].sort(e),this._sortedRenderables[h.OPAQUE][h.TRANSPARENT].sort(e),this._sortedRenderables[h.OPAQUE][h.OPAQUE].sort(e)}static getKey(e,r,t){return`edges-t:${e}:${r}:${t}`}}const T=s();export{u as EdgeRenderer,g as extensionLengthOffset,_ as lineWidthFractionFactor};
5
+ import e from"../../../../../core/PooledArray.js";import{transpose as r,invert as t}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{i}from"../../../../../chunks/vec32.js";import{debugFlags as o}from"../../../support/debugFlags.js";import{TwoVectorPosition as a}from"../../core/util/TwoVectorPosition.js";import{EdgeDrawParameters as n}from"./EdgeShaderParameters.js";import{EdgeShaderTechnique as l}from"./EdgeShaderTechnique.js";import{EdgeShaderTechniqueConfiguration as d}from"./EdgeShaderTechniqueConfiguration.js";import{Transparency as h}from"./interfaces.js";import{EdgeType as c}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{PrimitiveType as m}from"../../../../webgl/enums.js";const _=8,g=128,f={type:c.Solid,hasSlicePlane:!1,strokesTexture:null,legacy:!0,spherical:!0};class u{constructor(r,t,s){this.rctx=r,this._techniques=t,this._configuration=new d,this.refCount=0,this._renderables=new Set,this._sortedRenderables={[h.TRANSPARENT]:{[h.TRANSPARENT]:new e,[h.OPAQUE]:new e},[h.OPAQUE]:{[h.TRANSPARENT]:new e,[h.OPAQUE]:new e}},this._renderablesDirty=!1,this._drawParameters=new n,this._settings={...f,...s},this.key=u.getKey(this._settings.type,this._settings.hasSlicePlane,this._settings.legacy);const i=this._settings.strokesTexture.variants;this.writerSettings={variants:i,reducedPrecision:o.TESTS_DISABLE_OPTIMIZATIONS},this._configuration.legacy=this._settings.legacy,this._configuration.type=this._settings.type,this._configuration.silhouette=!1,this._configuration.hasSlicePlane=this._settings.hasSlicePlane,this._configuration.doublePrecisionRequiresObfuscation=r.driverTest.doublePrecisionRequiresObfuscation.result,this._configuration.spherical=s.spherical}addRenderable(e){this._renderables.add(e),this._renderablesDirty=!0}removeRenderable(e){this._renderables.delete(e),this._renderablesDirty=!0}setRenderablesDirty(){this._renderablesDirty=!0}forEachRenderable(e,r){this._renderablesDirty&&this._sortRenderables();const t=this._sortedRenderables[r];t[h.TRANSPARENT].forAll(e),t[h.OPAQUE].forAll(e)}acquireTechnique(e,r){return this._lastOriginId=null,this._configuration.terrainDepthTest=e.terrainDepthTest,this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.silhouette=r,this._techniques.get(l,this._configuration)}renderRegularEdges(e,r,t,s,i){this._render(e,r,r.regular.vao,t,s,i)}renderSilhouetteEdges(e,r,t,s,i){this._render(e,r,r.silhouette.vao,t,s,i)}_render(e,r,t,s,i,o){o>0&&(this._bindDraw(e,r,s,i),this.rctx.bindVAO(t),this.rctx.drawArraysInstanced(m.TRIANGLE_FAN,0,4,o))}_bindDraw(e,s,o,n){this._drawParameters.componentDataTexture=s.components.buffer.textureBuffer.texture,this._drawParameters.strokesTexture=this._settings.strokesTexture;const l=s.transform.origin;if(l){const r=l.origin.id;this._lastOriginId!==r&&(e.setUniformMatrix4fv("localView",l.viewMatrix),this._lastOriginId=r),e.setUniformMatrix4fv("model",s.transform.modelMatrix),this._drawParameters.slicePlaneLocalOrigin=l.origin.vec3}else{const e=new a(s.transform.position),o=r(T,t(T,s.transform.rotationScale));this._drawParameters.transformWorldFromModelTL=e.low,this._drawParameters.transformWorldFromModelTH=e.high,this._drawParameters.transformWorldFromModelRS=s.transform.rotationScale,this._drawParameters.transformNormalGlobalFromModel=o;const l=n.camera.viewInverseTransposeMatrix;i(this._drawParameters.slicePlaneLocalOrigin,l[3],l[7],l[11])}e.bindDraw(n,o,this._drawParameters)}_sortRenderables(){this._renderablesDirty=!1,this._sortedRenderables[h.TRANSPARENT][h.TRANSPARENT].clear(),this._sortedRenderables[h.TRANSPARENT][h.OPAQUE].clear(),this._sortedRenderables[h.OPAQUE][h.TRANSPARENT].clear(),this._sortedRenderables[h.OPAQUE][h.OPAQUE].clear(),this._renderables.forEach((e=>this._sortedRenderables[e.objectTransparency][e.edgeTransparency].push(e)));const e=(e,r)=>e.transform.origin?r.transform.origin?e.transform.origin.origin.id<r.transform.origin.origin.id?-1:e.transform.origin.origin.id>r.transform.origin.origin.id?1:0:1:0;this._sortedRenderables[h.TRANSPARENT][h.TRANSPARENT].sort(e),this._sortedRenderables[h.TRANSPARENT][h.OPAQUE].sort(e),this._sortedRenderables[h.OPAQUE][h.TRANSPARENT].sort(e),this._sortedRenderables[h.OPAQUE][h.OPAQUE].sort(e)}static getKey(e,r,t){return`edges-t:${e}:${r}:${t}`}}const T=s();export{u as EdgeRenderer,g as extensionLengthOffset,_ as lineWidthFractionFactor};
@@ -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{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{vertexAttributeLocations as s}from"./bufferLayouts.js";import{E as o}from"../../../../../chunks/EdgeShader.glsl.js";import{BlendOperation as t,BlendFactor as i,CompareFunction as d}from"../../../../webgl/enums.js";import{makePipelineState as n,separateBlendingParams as a,defaultColorWrite as l}from"../../../../webgl/renderState.js";class m extends r{constructor(r,t,i){super(r,t,new e(o,(()=>import("../../shaders/sources/edgeRenderer/EdgeShader.glsl.js"))),i,s)}initializePipeline(){return n({blending:a(i.ONE,i.ONE,i.ZERO,i.ONE,t.ADD,t.MAX),depthTest:{func:d.LEQUAL},colorWrite:l})}}export{m as EdgeShaderTechnique};
5
+ import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{vertexAttributeLocations as s}from"./bufferLayouts.js";import{E as o}from"../../../../../chunks/EdgeShader.glsl.js";import{BlendOperation as t,BlendFactor as i,CompareFunction as d}from"../../../../webgl/enums.js";import{makePipelineState as n,separateBlendingParams as a,defaultColorWrite as l}from"../../../../webgl/renderState.js";class m extends r{constructor(r,t){super(r,t,new e(o,(()=>import("../../shaders/sources/edgeRenderer/EdgeShader.glsl.js"))),s)}initializePipeline(){return n({blending:a(i.ONE,i.ONE,i.ZERO,i.ONE,t.ADD,t.MAX),depthTest:{func:d.LEQUAL},colorWrite:l})}}export{m as EdgeShaderTechnique};