@arcgis/core 5.1.0-next.78 → 5.1.0-next.79

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 (464) hide show
  1. package/analysis/ShadowCast/DiscreteOptions.d.ts +33 -6
  2. package/analysis/ShadowCast/DiscreteOptions.js +1 -1
  3. package/analysis/ShadowCast/MinDurationOptions.d.ts +6 -4
  4. package/analysis/ShadowCast/TotalDurationOptions.d.ts +33 -6
  5. package/analysis/ShadowCast/TotalDurationOptions.js +1 -1
  6. package/analysis/ShadowCast/colorStopsUtils.js +2 -0
  7. package/analysis/ShadowCastAnalysis.d.ts +24 -1
  8. package/analysis/ShadowCastAnalysis.js +1 -1
  9. package/analysis/Viewshed.d.ts +27 -0
  10. package/analysis/Viewshed.js +1 -1
  11. package/analysis/ViewshedAnalysis.js +1 -1
  12. package/arcade/FunctionWrapper.js +1 -1
  13. package/arcade/arcadeAsyncRuntime.js +1 -1
  14. package/arcade/arcadeCompiler.js +1 -1
  15. package/arcade/arcadeRuntime.js +1 -1
  16. package/arcade/compilerUtils.js +1 -1
  17. package/arcade/debug.d.ts +139 -0
  18. package/arcade/debug.js +2 -0
  19. package/arcade/featureSetCollection.js +1 -1
  20. package/arcade/featureSetUtils.js +1 -1
  21. package/arcade/featureset/actions/GroupBy.js +1 -1
  22. package/arcade/featureset/actions/OrderBy.js +1 -1
  23. package/arcade/functions/featuresetstring.js +1 -1
  24. package/arcade/languageUtils.js +1 -1
  25. package/arcade.d.ts +46 -2
  26. package/arcade.js +1 -1
  27. package/assets/esri/core/workers/RemoteClient.js +1 -1
  28. package/assets/esri/core/workers/chunks/{1c7183551f5269bdcf13.js → 01bd1b86ba899c6aa4c0.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{1f8ccf96069ac3a40c3d.js → 01ee18782a50279f907e.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{f81c6f6ccc201f584970.js → 022067e807905cabeaa1.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{11ea4be441a26134ce1f.js → 052cdc7aaa803b5873f0.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{b7bb7072dbee978f3ca3.js → 056fd7847caaff2c9514.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{8acee3fba488f202f82f.js → 05c3146d87d917606193.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{a8ca5d8740cc7e39197b.js → 0aebcbf41cb193e76809.js} +5 -5
  35. package/assets/esri/core/workers/chunks/{54023458195549f66215.js → 0b77c124b743067e4155.js} +1 -1
  36. package/assets/esri/core/workers/chunks/10408183681fd6c7b4ed.js +2 -0
  37. package/assets/esri/core/workers/chunks/{7595ceba529ed01c7590.js → 2c87c3112a43db8624f6.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{13e60f19f436b8d683ae.js → 3c9482764c9e4f8bcbb0.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{322c54081b25f1c53661.js → 3e37019eee1c49d2bf64.js} +1 -1
  40. package/assets/esri/core/workers/chunks/45c83eb7c2a06166e3b0.js +1 -0
  41. package/assets/esri/core/workers/chunks/48acd146bf0241d87647.js +1 -0
  42. package/assets/esri/core/workers/chunks/5818f1f526577068d6ca.js +2 -0
  43. package/assets/esri/core/workers/chunks/{34fe97bcacc0dfc5bce6.js → 5ccc325d83cec4f5ccdb.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{30e710ec4d22c43d4e7e.js → 5cffc7b49966201eccdb.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{1a87e9bbd85ba29b1514.js → 5da2051f548c2942e01a.js} +1 -1
  46. package/assets/esri/core/workers/chunks/5ec66e39e53c11e75179.js +2 -0
  47. package/assets/esri/core/workers/chunks/{0b1454a77a6a682541dc.js.LICENSE.txt → 5ec66e39e53c11e75179.js.LICENSE.txt} +9 -1
  48. package/assets/esri/core/workers/chunks/5f6fd20a7f4e80eafa25.js +1 -0
  49. package/assets/esri/core/workers/chunks/{abc06d10c7ac8ba5b0e4.js → 67ec1694d6e18b7c234c.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{32e22d6eee9fed1f70b0.js → 6d696beddcc5fbed5875.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{f590b60fca607d66001a.js → 716a4d7e8b908b81870b.js} +1 -1
  52. package/assets/esri/core/workers/chunks/71fe127734f33d020a44.js +1 -0
  53. package/assets/esri/core/workers/chunks/7cdd0492b2191df95102.js +2 -0
  54. package/assets/esri/core/workers/chunks/7cea68257d24ffd205bb.js +1 -0
  55. package/assets/esri/core/workers/chunks/7e530e635325dba07864.js +1 -0
  56. package/assets/esri/core/workers/chunks/8f6f5dad52747d252aac.js +596 -0
  57. package/assets/esri/core/workers/chunks/{d950d5c2844206502ff0.js → 992cd87ba0ab6346f692.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{73c87eb9bd8f0f848481.js → 9c11e1fe785e1385fdb1.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{5ed8d8b5336c81fbcda3.js → 9d216e30d04ea21fc8a2.js} +1 -1
  60. package/assets/esri/core/workers/chunks/a54aa93b6012a2597f82.js +1 -0
  61. package/assets/esri/core/workers/chunks/{cf14b3a44705dacefac4.js → a9b5ce00323cd5574bf7.js} +1 -1
  62. package/assets/esri/core/workers/chunks/ae6b3dfe5f757df539d6.js +1 -0
  63. package/assets/esri/core/workers/chunks/b14c4c3f295970f731ab.js +1 -0
  64. package/assets/esri/core/workers/chunks/{c70df6ed190f9ebcf6aa.js → bf2c202dec5ab7bc770b.js} +1 -1
  65. package/assets/esri/core/workers/chunks/c1d4110aa494a1dba3c4.js +1 -0
  66. package/assets/esri/core/workers/chunks/{85d8c7cc7f8decbe975d.js → c442916805975744dd92.js} +1 -1
  67. package/assets/esri/core/workers/chunks/dacc2e5fa462495ed1cc.js +2 -0
  68. package/assets/esri/core/workers/chunks/f227b34cce6843df0fb6.js +1 -0
  69. package/assets/esri/core/workers/chunks/{dda2cb5c073d1e65f14f.js → f43d628d47eec7d530c7.js} +1 -1
  70. package/assets/esri/core/workers/chunks/f7531aa69a87814c60d1.js +1 -0
  71. package/assets/esri/core/workers/chunks/{4ccb56333de0247dcb6f.js → fb100935fd8948d779f5.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{5ee4b630ad39c21d11db.js → fb9e3e7cd532ac4353f1.js} +12 -12
  73. package/assets/esri/core/workers/chunks/fc6ca7ffb9f1b875059c.js +1 -0
  74. package/assets/esri/core/workers/chunks/{3d9fcbe95dd22dbe730e.js → ffc4f3406ce383b9bd88.js} +1 -1
  75. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +6 -0
  76. package/assets/esri/themes/dark/main.css +1 -1
  77. package/assets/esri/themes/light/main.css +1 -1
  78. package/assets/esri/themes/light/view.css +1 -1
  79. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  80. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  81. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  82. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  83. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  84. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  85. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  86. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  87. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  88. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  89. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  90. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  91. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  92. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  93. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  94. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  95. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  96. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  97. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  98. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  99. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  100. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  101. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  102. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  103. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  104. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  105. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  106. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  107. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  108. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  109. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  110. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  111. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  112. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  113. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  114. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  115. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  116. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  117. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  118. package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
  119. package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
  120. package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
  121. package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
  122. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  123. package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
  124. package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
  125. package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
  126. package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
  127. package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
  128. package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
  129. package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
  130. package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
  131. package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
  132. package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
  133. package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
  134. package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
  135. package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
  136. package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
  137. package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
  138. package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
  139. package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
  140. package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
  141. package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
  142. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
  143. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
  144. package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
  145. package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
  146. package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
  147. package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
  148. package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
  149. package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
  150. package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
  151. package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
  152. package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
  153. package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
  154. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
  155. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
  156. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
  157. package/chunks/ImageMaterial.glsl.js +7 -5
  158. package/chunks/SlicePlaneMaterial.glsl.js +21 -13
  159. package/chunks/arcade.js +1 -1
  160. package/chunks/languageUtils.js +1 -1
  161. package/config.js +1 -1
  162. package/core/MapUtils.js +1 -1
  163. package/core/arrayUtils.js +1 -1
  164. package/kernel.js +1 -1
  165. package/layers/IntegratedMeshLayer.d.ts +18 -14
  166. package/layers/SceneLayer.d.ts +35 -1
  167. package/layers/SceneLayer.js +1 -1
  168. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  169. package/layers/scene/ModelFileInfo.d.ts +29 -0
  170. package/layers/scene/ModelFileInfo.js +2 -0
  171. package/layers/scene/ModelInfo.d.ts +38 -0
  172. package/layers/scene/ModelInfo.js +2 -0
  173. package/layers/scene/modelQuerySupport.js +2 -0
  174. package/layers/scene/types.d.ts +14 -0
  175. package/layers/support/infoFor3D.js +1 -1
  176. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  177. package/layers/types.d.ts +13 -1
  178. package/package.json +3 -3
  179. package/popup/Features.d.ts +1 -6
  180. package/popup/Features.js +1 -1
  181. package/popup/actions.js +1 -1
  182. package/renderers/visualVariables/support/ColorStop.js +1 -1
  183. package/support/arcadeUtils.js +1 -1
  184. package/support/revision.js +1 -1
  185. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  186. package/views/2d/engine/flow/styles/Particles.js +1 -1
  187. package/views/2d/engine/flow/styles/Streamlines.js +1 -1
  188. package/views/2d/engine/vectorTiles/Placement.js +1 -1
  189. package/views/2d/engine/vectorTiles/TextShaping.js +1 -1
  190. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  191. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  192. package/views/2d/engine/webgl/GlyphSource.js +1 -1
  193. package/views/2d/engine/webgl/Overlay.js +1 -1
  194. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  195. package/views/2d/engine/webgl/RenderingDevice.js +1 -1
  196. package/views/2d/engine/webgl/TextureManager.js +1 -1
  197. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  198. package/views/2d/engine/webgl/shaderGraph/GLSLShaderModule.js +1 -1
  199. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  200. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  201. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueProgramCache.js +1 -1
  202. package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
  203. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  204. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  205. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  206. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimationUniformInfo.js +1 -1
  207. package/views/2d/engine/webgl/shaderGraph/techniques/bitmap/BitmapTechnique.js +1 -1
  208. package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
  209. package/views/2d/engine/webgl/shaderGraph/techniques/bloom/BloomTechnique.js +1 -1
  210. package/views/2d/engine/webgl/shaderGraph/techniques/blur/BlurTechnique.js +1 -1
  211. package/views/2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js +1 -1
  212. package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +1 -1
  213. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPointShader.js +1 -1
  214. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
  215. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  216. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  217. package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
  218. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  219. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  220. package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
  221. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  222. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
  223. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  224. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  225. package/views/2d/engine/webgl/shaderGraph/techniques/flow/FlowTechnique.js +1 -1
  226. package/views/2d/engine/webgl/shaderGraph/techniques/grid/GridTechnique.js +1 -1
  227. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  228. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  229. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  230. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
  231. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  232. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  233. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  234. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  235. package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +1 -1
  236. package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
  237. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
  238. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
  239. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  240. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  241. package/views/2d/engine/webgl/shaderGraph/techniques/raster/VectorFieldTechnique.js +1 -1
  242. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/AspectTechnique.js +1 -1
  243. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BandArithmeticTechnique.js +1 -1
  244. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BaseRasterProcessorTechnique.js +1 -1
  245. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ColormapToRGBTechnique.js +1 -1
  246. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CompositeBandTechnique.js +1 -1
  247. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ComputeChangeTechnique.js +1 -1
  248. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ContrastBrightnessTechnique.js +1 -1
  249. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ConvolutionTechnique.js +1 -1
  250. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CurvatureTechnique.js +1 -1
  251. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ExtractBandTechnique.js +1 -1
  252. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/FocalStatisticsTechnique.js +1 -1
  253. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/GrayscaleTechnique.js +1 -1
  254. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/HillshadeTechnique.js +1 -1
  255. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/LocalTechnique.js +1 -1
  256. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/MaskTechnique.js +1 -1
  257. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/NDVITechnique.js +1 -1
  258. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/RemapTechnique.js +1 -1
  259. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
  260. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ShadedReliefTechnique.js +1 -1
  261. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SlopeTechnique.js +1 -1
  262. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SpectralConversionTechnique.js +1 -1
  263. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/StretchTechnique.js +1 -1
  264. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  265. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitmapShader.js +1 -1
  266. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js +1 -1
  267. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlitShader.js +1 -1
  268. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +1 -1
  269. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlurShader.js +1 -1
  270. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js +1 -1
  271. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
  272. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
  273. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js +1 -1
  274. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/EntityStorage.js +1 -1
  275. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientFillShader.js +1 -1
  276. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
  277. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
  278. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapResolveShader.js +1 -1
  279. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js +1 -1
  280. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/MosaicInfo.js +1 -1
  281. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js +1 -1
  282. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OverlayShader.js +1 -1
  283. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternFillShader.js +1 -1
  284. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternOutlineFillShader.js +1 -1
  285. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsDiffShader.js +1 -1
  286. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsMinMaxSumShader.js +1 -1
  287. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsStdDevShader.js +1 -1
  288. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsSumOfSquaredDiffShader.js +1 -1
  289. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
  290. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js +1 -1
  291. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js +1 -1
  292. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowImageryShader.js +1 -1
  293. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowUtils.js +1 -1
  294. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterColorizerShader.js +1 -1
  295. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterHighlightShader.js +1 -1
  296. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerLUTShader.js +1 -1
  297. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerShadedReliefShader.js +1 -1
  298. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerStretchShader.js +1 -1
  299. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterXYBandHighlightShader.js +1 -1
  300. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/lut.js +1 -1
  301. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
  302. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/BaseRasterProcessorShader.js +1 -1
  303. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ColormapToRGBShader.js +1 -1
  304. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ConvolutionShader.js +1 -1
  305. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
  306. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/FocalStatisticsShader.js +1 -1
  307. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/HillshadeShader.js +1 -1
  308. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MultiRasterMixin.js +1 -1
  309. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ShadedReliefShader.js +1 -1
  310. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
  311. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/projection.js +1 -1
  312. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/stretch.js +1 -1
  313. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderBackground.js +1 -1
  314. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderFill.js +1 -1
  315. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderIcon.js +1 -1
  316. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderLine.js +1 -1
  317. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderText.js +1 -1
  318. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vvUtils.js +1 -1
  319. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  320. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  321. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTechnique.js +1 -1
  322. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileStencilTechnique.js +1 -1
  323. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
  324. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +1 -1
  325. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
  326. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
  327. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
  328. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  329. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  330. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  331. package/views/3d/FocusAreasView.js +1 -1
  332. package/views/3d/StencilGeometry.js +2 -0
  333. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  334. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  335. package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
  336. package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
  337. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  338. package/views/3d/analysis/Viewshed/ViewshedShapeVisualElement.js +1 -1
  339. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  340. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  341. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  342. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  343. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  344. package/views/3d/focusAreaUtils.js +2 -0
  345. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  346. package/views/3d/layers/I3SMeshView3D.js +1 -1
  347. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  348. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  349. package/views/3d/layers/IntegratedMeshNormals.js +1 -1
  350. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  351. package/views/3d/layers/SceneLayerView3D.js +1 -1
  352. package/views/3d/layers/SceneLayerWorker.js +1 -1
  353. package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
  354. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  355. package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
  356. package/views/3d/layers/support/TemporalSceneLayerView.js +1 -1
  357. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  358. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  359. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
  360. package/views/3d/webgl-engine/effects/atmosphere/LocalAtmosphere.js +1 -1
  361. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  362. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  363. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  364. package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
  365. package/views/3d/webgl-engine/effects/clouds/CloudsTechnique.js +1 -1
  366. package/views/3d/webgl-engine/effects/clouds/NoiseTextureAtlas.js +1 -1
  367. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  368. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  369. package/views/3d/webgl-engine/effects/focusArea/focusAreaMaskUtils.js +2 -0
  370. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  371. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  372. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  373. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  374. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  375. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  376. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.js +1 -1
  377. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  378. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
  379. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  380. package/views/3d/webgl-engine/effects/precipitation/Precipitation.js +1 -1
  381. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  382. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  383. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  384. package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
  385. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  386. package/views/3d/webgl-engine/lib/Compositor.js +1 -1
  387. package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
  388. package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
  389. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  390. package/views/3d/webgl-engine/lib/Material.js +1 -1
  391. package/views/3d/webgl-engine/lib/Normals.js +1 -1
  392. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  393. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  394. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  395. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  396. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  397. package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
  398. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  399. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  400. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  401. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  402. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  403. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  404. package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
  405. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +10 -10
  406. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  407. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  408. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  409. package/views/View2D.js +1 -1
  410. package/views/draw/support/GraphicMover.js +1 -1
  411. package/views/draw/support/Reshape.js +1 -1
  412. package/views/draw/support/editingSessionUtils.js +1 -1
  413. package/views/webgl/FramebufferObject.js +1 -1
  414. package/widgets/BatchAttributeForm/css.js +1 -1
  415. package/widgets/BatchAttributeForm/inputs/GroupInput.d.ts +2 -1
  416. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.d.ts +54 -0
  417. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +2 -0
  418. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  419. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  420. package/widgets/BatchAttributeForm/inputs/types.d.ts +4 -3
  421. package/widgets/BatchAttributeForm/templates/AttachmentElementTemplate.js +1 -1
  422. package/widgets/BatchAttributeForm/templates/RelationshipElementTemplate.js +2 -0
  423. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  424. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  425. package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
  426. package/widgets/BatchAttributeForm.js +1 -1
  427. package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +21 -1
  428. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  429. package/widgets/CoordinateConversion/support/Format.js +1 -1
  430. package/widgets/CoordinateConversion/support/coordinateConversionUtils.js +1 -1
  431. package/widgets/CoordinateConversion.d.ts +21 -1
  432. package/widgets/CoordinateConversion.js +1 -1
  433. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  434. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  435. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  436. package/widgets/Editor/support/SketchController.js +1 -1
  437. package/widgets/Editor/workflowUtils.js +1 -1
  438. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  439. package/widgets/Sketch/SketchViewModel.js +1 -1
  440. package/widgets/support/ContingentValuesManager.js +1 -1
  441. package/widgets/types.d.ts +1 -1
  442. package/assets/esri/core/workers/chunks/07eff82916681fcff069.js +0 -1
  443. package/assets/esri/core/workers/chunks/0b1454a77a6a682541dc.js +0 -2
  444. package/assets/esri/core/workers/chunks/1c7fd0a229a8112b0539.js +0 -596
  445. package/assets/esri/core/workers/chunks/3697e51e1e4cf442f39a.js +0 -1
  446. package/assets/esri/core/workers/chunks/3cce9dad8ee0e4971d50.js +0 -1
  447. package/assets/esri/core/workers/chunks/3df8493b91aa3bce824d.js +0 -1
  448. package/assets/esri/core/workers/chunks/68a313155ddc29bd024d.js +0 -1
  449. package/assets/esri/core/workers/chunks/751609831b283903ba48.js +0 -1
  450. package/assets/esri/core/workers/chunks/7bacdd65a6cc4d284e0a.js +0 -2
  451. package/assets/esri/core/workers/chunks/7e97684e851274efd11f.js +0 -1
  452. package/assets/esri/core/workers/chunks/85aac8539996372f1ee8.js +0 -1
  453. package/assets/esri/core/workers/chunks/99d298d0039c536fcf3e.js +0 -1
  454. package/assets/esri/core/workers/chunks/9aaf78b831f8739bc127.js +0 -1
  455. package/assets/esri/core/workers/chunks/9b9916864b6575c42c8a.js +0 -1
  456. package/assets/esri/core/workers/chunks/bf7e019437a3b6036300.js +0 -2
  457. package/assets/esri/core/workers/chunks/d304343a781acfa3ff96.js +0 -1
  458. package/assets/esri/core/workers/chunks/dbb9bb28696ff9536678.js +0 -2
  459. package/assets/esri/core/workers/chunks/f09a41ad239d467d9438.js +0 -2
  460. package/assets/esri/core/workers/chunks/f6912532aae1638cbe8f.js +0 -1
  461. /package/assets/esri/core/workers/chunks/{7bacdd65a6cc4d284e0a.js.LICENSE.txt → 10408183681fd6c7b4ed.js.LICENSE.txt} +0 -0
  462. /package/assets/esri/core/workers/chunks/{f09a41ad239d467d9438.js.LICENSE.txt → 5818f1f526577068d6ca.js.LICENSE.txt} +0 -0
  463. /package/assets/esri/core/workers/chunks/{dbb9bb28696ff9536678.js.LICENSE.txt → 7cdd0492b2191df95102.js.LICENSE.txt} +0 -0
  464. /package/assets/esri/core/workers/chunks/{bf7e019437a3b6036300.js.LICENSE.txt → dacc2e5fa462495ed1cc.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as i,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as r,set as o,scale as n,floor as h,subtract as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,set as c,positiveInfinity as u,equals as d}from"../../../../geometry/support/aaBoundingBox.js";import{InternalRenderCategory as _}from"../../webgl.js";import g from"../../webgl/RenderNode.js";import{G as f}from"../../../../chunks/GaussianSplat.glsl.js";import{G as P}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as C}from"../shaders/GaussianSplatCompositionTechnique.js";import{GaussianSplatCompositionTechniqueConfiguration as b}from"../shaders/GaussianSplatCompositionTechniqueConfiguration.js";import{G as S}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as v}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatTechnique as x}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as q}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{ColorAttachment1 as w,DepthStencilAttachment as E,PrimitiveType as T}from"../../../webgl/enums.js";var D;let y=class extends g{static{D=this}constructor(e){super(e),this.produces=_.GAUSSIAN_SPLAT,this.consumes={required:[_.GAUSSIAN_SPLAT]},this._slicePlaneEnabled=!1,this.layerView=null,this._passParameters=new f,this._compositionPassParameters=new P,this._depthCompositionPassParameters=new S,this._compositionConfiguration=new b,this._clipBox=m(),this._previousCameraDirection=p(),this._previousSortRequestCameraDirection=p(),this._sortRequestDirectionEpsilon=.01,this._directionChangeEpsilon=.001,this._configuration=new q(e.view.state.isGlobal),c(this._clipBox,u)}async initialize(){this.addHandles([t(()=>this.view.state.camera,()=>this._onCameraChange()),t(()=>2===this.view.state.mode,()=>this.requestRender(1))])}precompile(){this._updateTechniqueConfiguration(),this.techniques.precompile(x,this._configuration),this._compositionConfiguration.hasEmission=this.bindParameters.hasEmission,this.techniques.precompile(C,this._compositionConfiguration),this.techniques.precompile(v)}render(e){const t=e.find(({name:e})=>e===this.produces);if(this._handleFading(),!this._data.visibleGaussians||!this._data.orderTexture.texture||!this._data.textureAtlas.texture)return t;const i=t.getAttachment(w);this._compositionConfiguration.hasEmission=null!=i;const s=this.techniques.getCompiled(x,this._configuration),a=this.techniques.getCompiled(C,this._compositionConfiguration),r=this.techniques.getCompiled(v);if(!s||!r||!a)return this.requestRender(1),t;const{fullWidth:o,fullHeight:n}=this.bindParameters.camera;this._prepareParameters(n,o);const h=this.renderingContext,l=this.fboCache,p=l.acquire(o,n,"gaussian color output"),m=t.getAttachment(E);p.attachDepth(m),this._renderGaussianColorAndDepth(p,s);const c=l.acquire(o,n,this.produces);return this._depthCompositionPassParameters.splatDepth=p.getTexture(w),c.attachDepth(t.getAttachment(E)),h.bindFramebuffer(c.fbo),h.bindTechnique(r,this.bindParameters,this._depthCompositionPassParameters),h.screen.draw(),this._compositionPassParameters.color=t.getTexture(),this._compositionPassParameters.splatColor=p.getTexture(),i?(c.acquireColor(w,8,"emissive"),this._compositionPassParameters.emission=t.getTexture(w)):this._compositionPassParameters.emission=null,h.bindFramebuffer(c.fbo),h.bindTechnique(a,this.bindParameters,this._compositionPassParameters),h.screen.draw(),p.release(),c}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}set clippingBox(e){const t=e||u;this._hasSameClipBox(t)||(c(this._clipBox,t),this._data.requestSort(),this.requestRender(1))}get clippingBox(){return this._clippingEnabled?this._clipBox:null}get _clippingEnabled(){return!d(this._clipBox,u,(e,t)=>e===t)}get _fragmentShadowsEnabled(){return 2===this.view.state.mode}get _data(){return this.layerView.data}get _fadeHelper(){return this.layerView.fadeHelper}_updateTechniqueConfiguration(){this._configuration.alphaCutoff=this.view.qualitySettings.gaussianSplat.minimumOpacity,this._configuration.fadingEnabled=this._fadeHelper.fadingEnabled,this._configuration.receiveShadows=this.bindParameters.shadowMap.ready,this._configuration.fragmentShadows=this._configuration.receiveShadows&&this._fragmentShadowsEnabled,this._configuration.hasShadowHighlights=this._configuration.fragmentShadows&&this.bindParameters.hasShadowHighlights,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasSlicePlane=this._slicePlaneEnabled&&null!=this.bindParameters.slicePlane}destroy(){super.destroy()}_onCameraChange(){const e=this.view.state.camera.ray.direction;if(!this._directionChanged(e))return;if(r(this._previousCameraDirection,e),!this._shouldRequestSort(e))return;this._data.requestSort()&&r(this._previousSortRequestCameraDirection,e)}_directionChanged(e){return Math.abs(e[0]-this._previousCameraDirection[0])>this._directionChangeEpsilon||Math.abs(e[1]-this._previousCameraDirection[1])>this._directionChangeEpsilon||Math.abs(e[2]-this._previousCameraDirection[2])>this._directionChangeEpsilon}_shouldRequestSort(e){return Math.abs(e[0]-this._previousSortRequestCameraDirection[0])>this._sortRequestDirectionEpsilon||Math.abs(e[1]-this._previousSortRequestCameraDirection[1])>this._sortRequestDirectionEpsilon||Math.abs(e[2]-this._previousSortRequestCameraDirection[2])>this._sortRequestDirectionEpsilon}_prepareParameters(e,t){this._passParameters.splatOrder=this._data.orderTexture.texture,this._passParameters.splatFading=this._data.fadingTexture.texture,this._passParameters.splatAtlas=this._data.textureAtlas.texture;const i=Math.tan(.5*this.camera.fovY),s=i/e*t;a(this._passParameters.tanFov,s,i),this._passParameters.focalLength=e/(2*i);const o=this.view.qualitySettings.gaussianSplat.minimumSplatPixelRadius;this._passParameters.minSplatRadius=o*Math.sqrt(t*e)/Math.sqrt(2073600),r(this._passParameters.origin,this.bindParameters.camera.eye),this._prepareHighPrecisionCameraPosition(),this._updateSlicePlaneLocalOrigin(),this._updateClipUniforms()}_updateClipUniforms(){if(this._clippingEnabled){const[e,t,i,s,a,r]=this._clipBox,[n,h,l]=this.camera.eye;o(this._passParameters.clipMinCameraRelative,e-n,t-h,i-l),o(this._passParameters.clipMaxCameraRelative,s-n,a-h,r-l)}}_updateSlicePlaneLocalOrigin(){this._passParameters.slicePlaneLocalOrigin=this.camera.eye}_hasSameClipBox(e){return d(this._clipBox,e,(e,t)=>e===t)}_renderGaussianColorAndDepth(e,t){const i=this.renderingContext;e.acquireColor(w,5,"gaussian depth output"),i.bindFramebuffer(e.fbo),i.setClearColor(0,0,0,0),i.clear(16384),this.renderingContext.bindTechnique(t,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(T.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}_prepareHighPrecisionCameraPosition(){n(this._passParameters.tileCameraPosition,this.camera.eye,1/D.tileSize),h(this._passParameters.tileCameraPosition,this._passParameters.tileCameraPosition),n(this._passParameters.cameraDelta,this._passParameters.tileCameraPosition,D.tileSize),l(this._passParameters.cameraDelta,this.camera.eye,this._passParameters.cameraDelta)}_handleFading(){if(0===this._fadeHelper.numFadingTiles)return void(this._previousFrameStart=null);this._previousFrameStart??=this.view.stage.renderer.renderContext.time;const e=this.view.stage?.renderer.renderContext.time-this._previousFrameStart;this._fadeHelper.updateAllTileFading(e),this._previousFrameStart=this.view.stage.renderer.renderContext.time,this._data.fadingTexture.updateTexture(this._data.textureAtlas.pageAllocator.pageCount)}static{this.tileSize=2.048}};e([i()],y.prototype,"produces",void 0),e([i()],y.prototype,"consumes",void 0),e([i({constructOnly:!0})],y.prototype,"layerView",void 0),y=D=e([s("esri.views.3d.webgl-engine.lib.GaussianSplatRenderNode")],y);export{y as GaussianSplatRenderNode};
2
+ import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as i,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as r,set as o,scale as n,floor as h,subtract as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,set as u,positiveInfinity as c,equals as d}from"../../../../geometry/support/aaBoundingBox.js";import{InternalRenderCategory as _}from"../../webgl.js";import g from"../../webgl/RenderNode.js";import{G as f}from"../../../../chunks/GaussianSplat.glsl.js";import{G as P}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as C}from"../shaders/GaussianSplatCompositionTechnique.js";import{GaussianSplatCompositionTechniqueConfiguration as b}from"../shaders/GaussianSplatCompositionTechniqueConfiguration.js";import{G as S}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as v}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatTechnique as x}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as q}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{ColorAttachment1 as w,DepthStencilAttachment as E,PrimitiveType as D}from"../../../webgl/enums.js";var y;let R=class extends g{static{y=this}constructor(e){super(e),this.produces=_.GAUSSIAN_SPLAT,this.consumes={required:[_.GAUSSIAN_SPLAT]},this._slicePlaneEnabled=!1,this.layerView=null,this._passParameters=new f,this._compositionPassParameters=new P,this._depthCompositionPassParameters=new S,this._compositionConfiguration=new b,this._clipBox=m(),this._previousCameraDirection=p(),this._previousSortRequestCameraDirection=p(),this._sortRequestDirectionEpsilon=.01,this._directionChangeEpsilon=.001,this._configuration=new q(e.view.state.isGlobal),u(this._clipBox,c)}async initialize(){this.addHandles([t(()=>this.view.state.camera,()=>this._onCameraChange()),t(()=>2===this.view.state.mode,()=>this.requestRender(1))])}render(e){const t=e.find(({name:e})=>e===this.produces);if(this._updateConfigurations(),this._handleFading(),!this._data.visibleGaussians||!this._data.orderTexture.texture||!this._data.textureAtlas.texture)return t;const i=t.getAttachment(w);this._compositionConfiguration.hasEmission=null!=i;const s=this.techniques.getCompiled(x,this._configuration),a=this.techniques.getCompiled(C,this._compositionConfiguration),r=this.techniques.getCompiled(v);if(!s||!r||!a)return this.requestRender(1),t;const{fullWidth:o,fullHeight:n}=this.bindParameters.camera;this._prepareParameters(n,o);const h=this.renderingContext,l=this.fboCache,p=l.acquire(o,n,"gaussian color output"),m=t.getAttachment(E);p.attachDepth(m),this._renderGaussianColorAndDepth(p,s);const u=l.acquire(o,n,this.produces);return this._depthCompositionPassParameters.splatDepth=p.getTexture(w),u.attachDepth(t.getAttachment(E)),h.bindFramebuffer(u.fbo),h.bindTechnique(r,this.bindParameters,this._depthCompositionPassParameters),h.screen.draw(),this._compositionPassParameters.color=t.getTexture(),this._compositionPassParameters.splatColor=p.getTexture(),i?(u.acquireColor(w,8,"emissive"),this._compositionPassParameters.emission=t.getTexture(w)):this._compositionPassParameters.emission=null,h.bindFramebuffer(u.fbo),h.bindTechnique(a,this.bindParameters,this._compositionPassParameters),h.screen.draw(),p.release(),u}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}set clippingBox(e){const t=e||c;this._hasSameClipBox(t)||(u(this._clipBox,t),this._data.requestSort(),this.requestRender(1))}get clippingBox(){return this._clippingEnabled?this._clipBox:null}get _clippingEnabled(){return!d(this._clipBox,c,(e,t)=>e===t)}get _fragmentShadowsEnabled(){return 2===this.view.state.mode}get _data(){return this.layerView.data}get _fadeHelper(){return this.layerView.fadeHelper}_updateConfigurations(){this._configuration.alphaCutoff=this.view.qualitySettings.gaussianSplat.minimumOpacity,this._configuration.fadingEnabled=this._fadeHelper.fadingEnabled,this._configuration.receiveShadows=this.bindParameters.shadowMap.ready,this._configuration.fragmentShadows=this._configuration.receiveShadows&&this._fragmentShadowsEnabled,this._configuration.hasShadowHighlights=this._configuration.fragmentShadows&&this.bindParameters.hasShadowHighlights,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasSlicePlane=this._slicePlaneEnabled&&null!=this.bindParameters.slicePlane,this._compositionConfiguration.hasEmission=this.bindParameters.hasEmission}destroy(){super.destroy()}_onCameraChange(){const e=this.view.state.camera.ray.direction;if(!this._directionChanged(e))return;if(r(this._previousCameraDirection,e),!this._shouldRequestSort(e))return;this._data.requestSort()&&r(this._previousSortRequestCameraDirection,e)}_directionChanged(e){return Math.abs(e[0]-this._previousCameraDirection[0])>this._directionChangeEpsilon||Math.abs(e[1]-this._previousCameraDirection[1])>this._directionChangeEpsilon||Math.abs(e[2]-this._previousCameraDirection[2])>this._directionChangeEpsilon}_shouldRequestSort(e){return Math.abs(e[0]-this._previousSortRequestCameraDirection[0])>this._sortRequestDirectionEpsilon||Math.abs(e[1]-this._previousSortRequestCameraDirection[1])>this._sortRequestDirectionEpsilon||Math.abs(e[2]-this._previousSortRequestCameraDirection[2])>this._sortRequestDirectionEpsilon}_prepareParameters(e,t){this._passParameters.splatOrder=this._data.orderTexture.texture,this._passParameters.splatFading=this._data.fadingTexture.texture,this._passParameters.splatAtlas=this._data.textureAtlas.texture;const i=Math.tan(.5*this.camera.fovY),s=i/e*t;a(this._passParameters.tanFov,s,i),this._passParameters.focalLength=e/(2*i);const o=this.view.qualitySettings.gaussianSplat.minimumSplatPixelRadius;this._passParameters.minSplatRadius=o*Math.sqrt(t*e)/Math.sqrt(2073600),r(this._passParameters.origin,this.bindParameters.camera.eye),this._prepareHighPrecisionCameraPosition(),this._updateSlicePlaneLocalOrigin(),this._updateClipUniforms()}_updateClipUniforms(){if(this._clippingEnabled){const[e,t,i,s,a,r]=this._clipBox,[n,h,l]=this.camera.eye;o(this._passParameters.clipMinCameraRelative,e-n,t-h,i-l),o(this._passParameters.clipMaxCameraRelative,s-n,a-h,r-l)}}_updateSlicePlaneLocalOrigin(){this._passParameters.slicePlaneLocalOrigin=this.camera.eye}_hasSameClipBox(e){return d(this._clipBox,e,(e,t)=>e===t)}_renderGaussianColorAndDepth(e,t){const i=this.renderingContext;e.acquireColor(w,5,"gaussian depth output"),i.bindFramebuffer(e.fbo),i.setClearColor(0,0,0,0),i.clear(16384),this.renderingContext.bindTechnique(t,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(D.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}_prepareHighPrecisionCameraPosition(){n(this._passParameters.tileCameraPosition,this.camera.eye,1/y.tileSize),h(this._passParameters.tileCameraPosition,this._passParameters.tileCameraPosition),n(this._passParameters.cameraDelta,this._passParameters.tileCameraPosition,y.tileSize),l(this._passParameters.cameraDelta,this.camera.eye,this._passParameters.cameraDelta)}_handleFading(){if(0===this._fadeHelper.numFadingTiles)return void(this._previousFrameStart=null);this._previousFrameStart??=this.view.stage.renderer.renderContext.time;const e=this.view.stage?.renderer.renderContext.time-this._previousFrameStart;this._fadeHelper.updateAllTileFading(e),this._previousFrameStart=this.view.stage.renderer.renderContext.time,this._data.fadingTexture.updateTexture(this._data.textureAtlas.pageAllocator.pageCount)}static{this.tileSize=2.048}};e([i()],R.prototype,"produces",void 0),e([i()],R.prototype,"consumes",void 0),e([i({constructOnly:!0})],R.prototype,"layerView",void 0),R=y=e([s("esri.views.3d.webgl-engine.lib.GaussianSplatRenderNode")],R);export{R as GaussianSplatRenderNode};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{generateUID as r}from"../../../../core/uid.js";import{isColor as e}from"../core/shaderLibrary/ShaderOutput.js";import{updateParameters as t}from"../materials/internal/MaterialUtil.js";import{NoParameters as s}from"../../../webgl/NoParameters.js";class i{constructor(e,s){this.id=r(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new s,t(this._parameters,e),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(r){return!1}setParameters(r,e=!0){t(this._parameters,r)&&(this.validateParameters(this._parameters),e&&this._parametersChanged())}validateParameters(r){}shouldRender(r){return this.visible&&this.isVisibleForOutput(r.output)&&(!this.parameters.isDecoration||r.bind.decorations)&&0!==(this.parameters.renderOccluded&r.renderOccludedMask)}isVisibleForOutput(r){return!0}get renderPriority(){return this._renderPriority}set renderPriority(r){r!==this._renderPriority&&(this._renderPriority=r,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return 0}getConfiguration(r){return this.updateConfiguration(r),this._configuration}updateConfiguration(r){this._configuration.output=r.output,this._configuration.hasEmission=r.hasEmission&&e(r.output),this._configuration.hasHighlightMixTexture=10===r.output&&null!=r.highlightMixTexture,this._configuration.useFloatBlend=r.useFloatBlend.value}}class a extends s{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}export{i as Material,a as MaterialParameters};
2
+ import{generateUID as r}from"../../../../core/uid.js";import{isColor as t}from"../core/shaderLibrary/ShaderOutput.js";import{updateParameters as e}from"../materials/internal/MaterialUtil.js";import{NoParameters as i}from"../../../webgl/NoParameters.js";class s{constructor(t,i){this.id=r(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new i,e(this._parameters,t),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(r){return!1}setParameters(r,t=!0){e(this._parameters,r)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(r){}shouldRender(r){return this.visible&&this.isVisibleForOutput(r.output)&&(!this.parameters.isDecoration||r.bind.decorations)&&0!==(this.parameters.renderOccluded&r.renderOccludedMask)}isVisibleForOutput(r){return!0}get renderPriority(){return this._renderPriority}set renderPriority(r){r!==this._renderPriority&&(this._renderPriority=r,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return 0}getConfiguration(r){return this.updateConfiguration(r),this._configuration}updateConfiguration(r){this._configuration.output=r.output,this._configuration.hasEmission=r.hasEmission&&t(r.output),this._configuration.hasHighlightMixTexture=10===r.output&&null!=r.highlightMixTexture,this._configuration.useFloatBlend=r.useFloatBlend.value,this._configuration.emissionDimmingPass=r.transparentWithoutDepthEmissionDimmingPass&&t(r.output)}}class a extends i{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}export{s as Material,a as MaterialParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clamp as t}from"../../../../core/mathUtils.js";import{normalize as r,transformMat3 as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newFloatArray as a}from"../../../../geometry/support/FloatArray.js";import{newShortArray as e}from"../../../../geometry/support/ShortArray.js";function s(t,r,o,n,a,e=2,s=0){const c=1/(Math.abs(o)+Math.abs(n)+Math.abs(a)),i=o*c,f=n*c,h=a<=0?(i>=0?1:-1)*(1-Math.abs(f)):i,u=a<=0?(f>=0?1:-1)*(1-Math.abs(i)):f,l=r*e+s;t[l]=m(h),t[l+1]=m(u)}function c(t){const r=t.length/3,o=e(2*r);let n=0;for(let a=0;a<r;++a)s(o,a,t[n++],t[n++],t[n++]);return o}function i(t,r){const a=t.length/3,e=new Int16Array(2*a);let c=0;const i=n();for(let n=0;n<a;++n)i[0]=t[c++],i[1]=t[c++],i[2]=t[c++],o(i,i,r),s(e,n,i[0],i[1],i[2]);return e}function f(t,o,n,a=2,e=0){const s=n*a+e,c=u(o[s]),i=u(o[s+1]),f=1-Math.abs(c)-Math.abs(i);return t[2]=f,f<0?(t[0]=(c>=0?1:-1)*(1-Math.abs(i)),t[1]=(i>=0?1:-1)*(1-Math.abs(c))):(t[0]=c,t[1]=i),r(t,t)}function h(t,r=2){const o=t.length/r,e=a(3*o),s=n();let c=0;for(let n=0;n<o;++n)f(s,t,n,r),e[c++]=s[0],e[c++]=s[1],e[c++]=s[2];return e}function m(r){return t(Math.round(32767*r),-32767,32767)}function u(r){return t(r/32767,-1,1)}export{i as compressAndTransformNormals,s as compressNormal,c as compressNormals,u as decodeInt16,f as decompressNormal,h as decompressNormals,m as encodeInt16};
2
+ import{clamp as t}from"../../../../core/mathUtils.js";import{normalize as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newFloatArray as a}from"../../../../geometry/support/FloatArray.js";import{newShortArray as n}from"../../../../geometry/support/ShortArray.js";function s(t,r,o,a,n,s=2,e=0){const i=1/(Math.abs(o)+Math.abs(a)+Math.abs(n)),c=o*i,f=a*i,h=n<=0?(c>=0?1:-1)*(1-Math.abs(f)):c,u=n<=0?(f>=0?1:-1)*(1-Math.abs(c)):f,l=r*s+e;t[l]=m(h),t[l+1]=m(u)}function e(t,r){const o=t.length/3;r??=n(2*o);let a=0;for(let n=0;n<o;++n)s(r,n,t[a++],t[a++],t[a++]);return r}function i(t,o,a,n=2,s=0){const e=a*n+s,i=f(o[e]),c=f(o[e+1]),m=1-Math.abs(i)-Math.abs(c);return t[2]=m,m<0?(t[0]=(i>=0?1:-1)*(1-Math.abs(c)),t[1]=(c>=0?1:-1)*(1-Math.abs(i))):(t[0]=i,t[1]=c),r(t,t)}function c(t,r=2){const n=t.length/r,s=a(3*n),e=o();let c=0;for(let o=0;o<n;++o)i(e,t,o,r),s[c++]=e[0],s[c++]=e[1],s[c++]=e[2];return s}function m(r){return t(Math.round(32767*r),-32767,32767)}function f(r){return t(r/32767,-1,1)}export{s as compressNormal,e as compressNormals,f as decodeInt16,i as decompressNormal,c as decompressNormals,m as encodeInt16};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isOITColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{defaultDepthWrite as t,separateBlendingParams as e,premultipliedAlpha as u,unpremultipliedAlphaToPremultipliedAlpha as n}from"../../../webgl/renderState.js";const c=e(1,0,1,771);function a(r,t=!1){switch(r){case 0:return t?u:n;case 1:return c;default:return null}}function l(r){if(r.draped)return null;switch(r.output){case 0:case 2:default:return r.writeDepth?t:null;case 1:return null}}function o(t,e=513){return{func:r(t)?515:e}}export{a as blending,c as blendingColorAlpha,o as depthTest,l as depthWrite};
2
+ import{isOITColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{defaultDepthWrite as t,modulateDestination as e,premultipliedAlpha as u,unpremultipliedAlphaToPremultipliedAlpha as n,separateBlendingParams as c}from"../../../webgl/renderState.js";const a=c(1,0,1,771);function i(r,t=!1,c=!1){if(c)return e;switch(r){case 0:return t?u:n;case 1:return a;default:return null}}function l(r){if(r.draped)return null;switch(r.output){case 0:case 2:default:return r.writeDepth?t:null;case 1:return null}}function o(t,e=513){return{func:r(t)?515:e}}export{i as blending,a as blendingColorAlpha,o as depthTest,l as depthWrite};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as u,sync as m}from"../../../../core/reactiveUtils.js";import{signal as _}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as b,invert as f,multiply as g,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as w,create as I}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as E}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as A,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as T}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as R,InternalRenderCategory as S,AllRenderNodeOutputs as O,AllInternalRenderNodeOutputs as D}from"../../webgl.js";import{minNearDistanceInMeters as F}from"../../state/NearFarHeuristic.js";import{debugFlags as G}from"../../support/debugFlags.js";import"../../webgl/ManagedDepthAttachment.js";import{FBOCache as x}from"../core/FBOCache.js";import{RenderPassManager as N}from"../core/renderPasses/RenderPassManager.js";import{isColor as H}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as y}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as v}from"../effects/RenderNodes.js";import{RenderPluginManager as M}from"../effects/RenderPluginManager.js";import{WeatherFader as L}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as q}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as j,renderHighlightBuffer as B}from"../effects/highlight/Highlight.js";import{OITBlend as V}from"../effects/transparency/OITBlend.js";import{AnimationTimer as k}from"./AnimationTimer.js";import{AnimationTimeStep as W}from"./AnimationTimeStep.js";import{BoundingInfo as Q}from"./BoundingInfo.js";import{Compositor as z}from"./Compositor.js";import{DepthRange as Y}from"./DepthRange.js";import{depthRangeFromScene as X}from"./depthRangeUtils.js";import{MainFramebuffer as $}from"./MainFramebuffer.js";import{RenderContext as J,defaultRenderOccludedMask as K}from"./RenderContext.js";import{RendererBase as Z}from"./RendererBase.js";import{setupFeatureDefaults as ee}from"./RenderFeature.js";import{RenderPluginInput as te}from"./RenderPluginInput.js";import{ShadowAccumulator as se}from"./ShadowAccumulator.js";import{ShadowMap as ie}from"./ShadowMap.js";import re from"./SliceHelper.js";import{MergedRenderer as ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ne}from"../parts/renderUtils.js";import{RendererPerformanceInfo as he,PerformanceCategory as oe}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as de,PixelType as le,ColorAttachment2 as ue,ColorAttachment0 as me}from"../../../webgl/enums.js";let _e=class extends Z{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new N,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new re,this.sceneDepthRange=_(Y.Infinite),this._state=_(2),this._hasGlobalIlluminationFlag=!!has("global-illumination"),this._hasAnimations=!1,this._animationTimestep=new W,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=_(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new te,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of Te)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new x(i),this._compositor=new z(i,s),this._renderStateFeatures=_(ee(e.view.qualityProfile));const a=new ie(this._fboCache,e.viewingMode);this._renderContext=new J(this._rctx,a,s),this._framebuffer=new $(this._fboCache,this._bindParameters),this._performanceInfo=new he(this._rctx),this._blit=new U(s),this._shadowAccumulator=new se(this.fboCache,s,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,s,i)=>{const r=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,s,i,!0,r),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},r),this._nodes=new v(this._renderContext),this._plugins=new M({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new L({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>G.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},u),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;E(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=y,l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},m),d(()=>this._bindParameters.clouds.data?.state,()=>r(),m),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},u),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,Q.prune(),ae.prune(),T()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new V(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=ee(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender()}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this.isFeatureEnabled(3)&&!this._inGlobeView}get hasGlobalIllumination(){return this._hasGlobalIlluminationFlag&&this.hasAmbientIllumination}get hasGlobalIlluminationHighQuality(){return this.hasGlobalIllumination&&this.isFeatureEnabled(10)}get _keepGlobalIlluminationShadingAlive(){return this._hasGlobalIlluminationFlag&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmissions(){return this._plugins.hasEmissions}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Fe(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),m)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),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.reprojection.matrix,w)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){void 0!==e.shadowMap&&this._bindParameters.shadowMap.enabled!==e.shadowMap&&(this._bindParameters.shadowMap.enabled=e.shadowMap,this._requestRender()),e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...we),has.water=this._plugins.produces(4,19),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);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(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,s,i=!1){try{return this._isRendering=!0,this._render(e,t,s,i)}catch(r){console.error(`Exception during rendering: ${r}:\n${r.stack}`)}finally{this._isRendering=!1}return new ne(this._pluginInput.get(R.FINAL),null)}_render(e,t,s,i){const r=0===s;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r,this._disposeBindBuffers();const{camera:a,contentCamera:o,mode:d,alignPixelEnabled:l}=e;this._state.value=d,this._renderContext.time=t,this._bindParameters.output=0,this._bindParameters.emissions=this._hasEmissions,this._bindParameters.alignPixelEnabled=l,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const u=!i||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=u?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(S.VIEWSHED),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(S.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(S.CUTFILL_COLOR),this._renderOverlay(),a.setGLViewport(this._rctx);const m=this._framebuffer,_=m.initialize(a.fullWidth,a.fullHeight,this._backgroundColor);this.hasReflections?(_?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor=_):_?.release(),this._ensureBindParameters(a,o,t),this._plugins.sortTestsTransparentOrderedSlots(Ee),this._plugins.prepareRender(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!i,this._hasTransparentGeometry=this._plugins.produces(0,...ce),this._precompilePrepasses(),this.performanceInfo.advance(oe.PREPARE);const p=this._computeShadowDepthRange(a);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(a,o,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p,!r),m.bind(),this._bindParameters.mainDepth=m.depth.attachment,this._precompileShaders(),this._bindParameters.output=0;this._bindParameters.hasOpaqueEmissions||0===this._bindParameters.emissions?(this._renderOpaque(),this._renderPreTransparent()):(this._bindParameters.emissions=0,this._renderOpaque(),this._renderPreTransparent(),this._bindParameters.emissions=2),this._renderTransparent(),this._bindParameters.reprojection.lastFrameColor=n(this._bindParameters.reprojection.lastFrameColor),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._bindParameters.shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(S.FOCUSAREA,this._renderFocusAreaGeometry()),m.update(e=>this._renderNodes(S.TRANSPARENT_ENVIRONMENT,e)),m.update(e=>this._renderNodes(S.VIEWSHED,e)),m.update(e=>this._renderNodes(S.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),m.update(e=>this._renderNodes(S.FOCUSAREA_COLOR,e)),m.update(e=>this._renderNodes(S.CUTFILL_COLOR,e)),this._pluginInput.release(S.FOCUSAREA),this._pluginInput.release(S.GROUND_DEPTH),m.update(e=>this._renderNodes(S.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===s?this._renderObjectAndLayerIdColor():null;m.update(e=>this._renderNodes(R.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),this.hasGlobalIllumination&&this._hasEmissions&&(this._bindParameters.reprojection.lastFrameEmission=m.color.obtainAttachment(de)),m.update(e=>this._renderNodes(S.ANTIALIASING,e));const b=this._hasTransparentGeometry?2:1;let f;return this._bindParameters.emissions=0,this._hasHUDHighlights&&m.update(e=>this._renderHUD(b,e)),m.update(e=>this._renderNodes(S.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||m.update(e=>this._renderHUD(b,e)),this._bindParameters.emissions=this._hasEmissions,m.update(e=>this._renderNodes(S.MAGNIFIER,e)),m.update(e=>this._renderNodes(R.FINAL,e)),r&&this._blit.toFramebuffer(this._rctx,m.color,this._bindParameters),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),m.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),r||(f=m.color,f.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new ne(f,c)}_precompileShaders(){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const e=this._bindParameters.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(e,S.OPAQUE_ENVIRONMENT,S.GAUSSIAN_SPLAT,S.OPAQUE_OCCLUSION_QUERY,S.VOXEL);2===this._bindParameters.emissions&&(this._bindParameters.emissions=0,this._precompileOpaqueGeometry(),this._bindParameters.emissions=2);const t=this._bindParameters;if(this._bindParameters.output=3,this._plugins.precompile(...be),this._bindParameters.output=0,this._plugins.precompile(...be),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(this._bindParameters,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(this._bindParameters,!1,1),this._precompileTransparentGeometry()}this._nodes.precompile(e,S.FOCUSAREA),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,e),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(e,S.TRANSPARENT_ENVIRONMENT,S.VIEWSHED,S.CUTFILL_COMPUTATION,S.CUTFILL_COLOR,S.LASERLINES,S.FOCUSAREA_COLOR,S.OCCLUDED,S.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=this._hasEmissions,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(e,S.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(e,R.COMPOSITE,S.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(8),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(S.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(oe.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,"olid");return i.acquireDepth(13),i=this._nodes.render(i,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(oe.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e;if(s||t){const e=s?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const r=Math.max(e,i);this._animationTimestep.frame(r,s)}}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.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._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,le.UNSIGNED_BYTE,t),r.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?oe.OPAQUE_EDGES:oe.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(oe.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(S.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(oe.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(S.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output;t.bindFramebuffer();for(const i of t.cascades)i.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(i.camera,i.camera),this.renderAllGeometry(e);t.finish(e),this._bindParameters.output=s}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._shadowAccumulator.accumulating+ +this._testsNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(S.AMBIENT_ILLUMINATION,this._hasGlobalIlluminationFlag?this._renderGlobalIllumination():this._renderSSAO());const t=this._needsDepth;t?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),this.performanceInfo.advance(oe.DEPTH)):e.detachDepth(),this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._hasGlobalIlluminationFlag&&(this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",13);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(oe.DEPTH)}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Y.Zero;const t=X(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Y.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<q)return void(this.sceneDepthRange.value=Y.Infinite);const t=e.clone();t.near=F,t.far=1e10;const s=X(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...O,S.VIEWSHED,S.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){this._normalsRequired?(this._precompilePlugins(4,fe),this._needsDepth&&this._precompilePlugins(3,ge)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(this._bindParameters.hasEmission,S.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&this._precompileAllGeometry(5),this.hasAmbientIllumination&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,S.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals",5);i.acquireDepth(13),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...fe);const r=this._nodes.optional("normals",...O,S.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(oe.NORMALS),i}_renderSSAO(){this._bindParameters.globalIlluminationEnabled=!1;const e=this._pluginInput.get("normals");return this.hasAmbientIllumination&&e?(this._bindParameters.ssao=this._nodes.produce(S.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(oe.AMBIENT_ILLUMINATION),this._bindParameters.ssao):null}_renderGlobalIllumination(){if(!this.hasGlobalIllumination)return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive,null;const e=this._nodes.produce(S.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIllumination=e,this._bindParameters.globalIlluminationEnabled=!0,this.performanceInfo.advance(oe.AMBIENT_ILLUMINATION),e}_releaseGlobalIlluminationBuffers(){this._bindParameters.reprojection.lastFrameDepth=h(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=h(this._bindParameters.reprojection.lastFrameEmission),this._bindParameters.globalIllumination=h(this._bindParameters.globalIllumination),this._bindParameters.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...be),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...Pe);this._renderContext.renderOccludedMask=K}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...Pe),this._renderContext.renderOccludedMask=K}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ae[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillOrthographicReferenceDepth(){this._precompilePlugins(9,Ce)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,s),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=i}renderCutFillOrthographicReferenceDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Ce),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,S.GROUND_DEPTH,13);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...ge)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...pe),this._nodes.precompile(this._bindParameters.hasEmission,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...pe)}_renderTransparentGeometry(){this._plugins.render(...ce),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...be)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...we),this._bindParameters.output=2,this._plugins.precompile(...we),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...we)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(de);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?oe.HUD_OCCLUDED:oe.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>j?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(13);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),B(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(oe.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...D)+this._nodes.optional("highlights",...D)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ie),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t){this._shadowAccumulator.updateDepthRange(e),this._bindParameters.output=0,this._shadowAccumulator.accumulating&&this._bindParameters.depth&&(this._shadowAccumulator.renderAccumulation(this._bindParameters,t)&&this.performanceInfo.advance(oe.ACCUMULATED_SHADOWS),this._bindParameters.depth=h(this._bindParameters.depth))}_precompileTransparentGeometry(){H(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...ce),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...ce),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...ce)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",u=this.fboCache.acquire(i,r,l,o),m=h.hasEmission&&(0===e||1!==t);m&&u.acquireColor(de,o,"oit emissive");const _=m?ue:de;u.acquireColor(_,this.hasFloatBlend?7:0,"oit alpha"),s||u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer([0,0,0,1]),m&&this._rctx.clearBuffer(1,C),a(),u.detachDepth(),h.output=2;const p=this.fboCache.acquire(i,r,s?"oit hud front":"oit front");m&&p.acquireColor(de,o,"oit emissive front"),s?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(C,s),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!s;let b;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(b=this.fboCache.acquire(i,r,"oit hud composite"),this._rctx.bindFramebuffer(b.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(_,0,"hud occlusion"),this._rctx.clearBuffer(_-me,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,u,p,h,m,c,e),b?.detachDepth(),s||c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(_)),p.release(),u.release(),h.output=d,b}get _hudDepthFormat(){return this.isFeatureEnabled(7)?13:12}get _needsOpaquePass(){return this.plugins.produces(0,...pe)||this.plugins.produces(5,...pe)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(S.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(R.OPAQUE,t,e)),this.fboCache.debugCallback?.(R.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(S.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(S.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(S.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(S.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(S.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(S.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(S.VOXEL,e)),this.fboCache.debugCallback?.(S.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;2===this._bindParameters.emissions&&e.ensureEmissionAttachment(),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(R.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(R.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(oe.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(8),this.performanceInfo.advance(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){const i=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(i,t.fbo);const r=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),r}_ensureBindParameters(e,t,s){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(s),this._ensureBindParametersScreenSpaceReflections(s),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(e){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,e,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(e){const{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=w);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(f(Se,t.viewMatrix),f(Re,t.projectionMatrix),g(Oe,Se,Re),g(Oe,s.viewMatrix,Oe),g(Oe,s.projectionMatrix,Oe),this._reprojectionMatrix=Oe):this._reprojectionMatrix=w,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(g(De,s.viewMatrix,Se),P(t,De)):P(t,w)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p()],_e.prototype,"_inGlobeView",void 0),e([p({readOnly:!0})],_e.prototype,"highResolutionAtmosphere",null),e([p()],_e.prototype,"_edgeView",void 0),e([p()],_e.prototype,"updating",null),_e=e([c("esri.views.3d.webgl-engine.lib.Renderer")],_e);const pe=[0,1,2,3],ce=[7,6,4,5],be=[7,6],fe=[0,1,2,4,...be],ge=[3,5],Pe=[2,4,8],we=[16,12,14,13],Ie=[4,5,2,3,0,1,...be],Ee=[4,8,5,11],Ae={0:[13],1:[12],2:[13,12],3:[13,12]},Ce=[0,1,...be],Te=["normals","highlights"],Re=I(),Se=I(),Oe=I(),De=I();function Fe(e){return t=>e.immediate.schedule(t)}export{_e as Renderer};
2
+ import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as m,sync as u}from"../../../../core/reactiveUtils.js";import{signal as _}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as b,invert as f,multiply as g,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as w,create as E}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as I}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as A,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as T}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as R,InternalRenderCategory as S,AllRenderNodeOutputs as O,AllInternalRenderNodeOutputs as D}from"../../webgl.js";import{minNearDistanceInMeters as F}from"../../state/NearFarHeuristic.js";import{debugFlags as G}from"../../support/debugFlags.js";import"../../webgl/ManagedDepthAttachment.js";import{FBOCache as x}from"../core/FBOCache.js";import{RenderPassManager as N}from"../core/renderPasses/RenderPassManager.js";import{isColor as H}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as y}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as v}from"../effects/RenderNodes.js";import{RenderPluginManager as M}from"../effects/RenderPluginManager.js";import{WeatherFader as L}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as q}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as j,renderHighlightBuffer as B}from"../effects/highlight/Highlight.js";import{OITBlend as V}from"../effects/transparency/OITBlend.js";import{AnimationTimer as k}from"./AnimationTimer.js";import{AnimationTimeStep as W}from"./AnimationTimeStep.js";import{BoundingInfo as Q}from"./BoundingInfo.js";import{Compositor as z}from"./Compositor.js";import{DepthRange as Y}from"./DepthRange.js";import{depthRangeFromScene as X}from"./depthRangeUtils.js";import{MainFramebuffer as $}from"./MainFramebuffer.js";import{RenderContext as J,defaultRenderOccludedMask as K}from"./RenderContext.js";import{RendererBase as Z}from"./RendererBase.js";import{setupFeatureDefaults as ee}from"./RenderFeature.js";import{RenderPluginInput as te}from"./RenderPluginInput.js";import{ShadowAccumulator as se}from"./ShadowAccumulator.js";import{ShadowMap as ie}from"./ShadowMap.js";import re from"./SliceHelper.js";import{MergedRenderer as ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ne}from"../parts/renderUtils.js";import{RendererPerformanceInfo as he,PerformanceCategory as oe}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as de,PixelType as le,ColorAttachment2 as me,ColorAttachment0 as ue,DrawBufferNone as _e}from"../../../webgl/enums.js";let pe=class extends Z{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new N,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new re,this.sceneDepthRange=_(Y.Infinite),this._state=_(2),this._hasGlobalIlluminationFlag=!!has("global-illumination"),this._hasAnimations=!1,this._animationTimestep=new W,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=_(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new te,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of Re)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new x(i),this._compositor=new z(i,s),this._renderStateFeatures=_(ee(e.view.qualityProfile));const a=new ie(this._fboCache,e.viewingMode);this._renderContext=new J(this._rctx,a,s),this._framebuffer=new $(this._fboCache,this._bindParameters),this._performanceInfo=new he(this._rctx),this._blit=new U(s),this._shadowAccumulator=new se(this.fboCache,s,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,s,i)=>{const r=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,s,i,!0,r),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},r),this._nodes=new v(this._renderContext),this._plugins=new M({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new L({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>G.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},m),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;I(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=y,l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},u),d(()=>this._bindParameters.clouds.data?.state,()=>r(),u),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},m),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,Q.prune(),ae.prune(),T()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new V(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=ee(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender()}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this.isFeatureEnabled(3)&&!this._inGlobeView}get hasGlobalIllumination(){return this._hasGlobalIlluminationFlag&&this.hasAmbientIllumination}get hasGlobalIlluminationHighQuality(){return this.hasGlobalIllumination&&this.isFeatureEnabled(10)}get _keepGlobalIlluminationShadingAlive(){return this._hasGlobalIlluminationFlag&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmissions(){return this._plugins.hasEmissions}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ge(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),u)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),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.reprojection.matrix,w)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){void 0!==e.shadowMap&&this._bindParameters.shadowMap.enabled!==e.shadowMap&&(this._bindParameters.shadowMap.enabled=e.shadowMap,this._requestRender()),e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...Ee),has.water=this._plugins.produces(4,19),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);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(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,s,i=!1){try{return this._isRendering=!0,this._render(e,t,s,i)}catch(r){console.error(`Exception during rendering: ${r}:\n${r.stack}`)}finally{this._isRendering=!1}return new ne(this._pluginInput.get(R.FINAL),null)}_render(e,t,s,i){const r=0===s;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r,this._disposeBindBuffers();const{camera:a,contentCamera:o,mode:d,alignPixelEnabled:l}=e;this._state.value=d,this._renderContext.time=t,this._bindParameters.output=0,this._bindParameters.emissions=this._hasEmissions,this._bindParameters.alignPixelEnabled=l,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const m=!i||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=m?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(S.VIEWSHED),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(S.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(S.CUTFILL_COLOR),this._renderOverlay(),a.setGLViewport(this._rctx);const u=this._framebuffer,_=u.initialize(a.fullWidth,a.fullHeight,this._backgroundColor);this.hasReflections?(_?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor=_):_?.release(),this._ensureBindParameters(a,o,t),this._plugins.sortTestsTransparentOrderedSlots(Ae),this._plugins.prepareRender(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!i,this._hasTransparentGeometry=this._plugins.produces(0,...be),this._precompilePrepasses(),this.performanceInfo.advance(oe.PREPARE);const p=this._computeShadowDepthRange(a);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(a,o,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p,!r),u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._precompileShaders(r),this._bindParameters.output=0;this._bindParameters.hasOpaqueEmissions||0===this._bindParameters.emissions?(this._renderOpaque(),this._renderPreTransparent()):(this._bindParameters.emissions=0,this._renderOpaque(),this._renderPreTransparent(),this._bindParameters.emissions=2),this._renderTransparent(),this._bindParameters.reprojection.lastFrameColor=n(this._bindParameters.reprojection.lastFrameColor),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._bindParameters.shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(S.FOCUSAREA,this._renderFocusAreaGeometry()),u.update(e=>this._renderNodes(S.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(S.VIEWSHED,e)),u.update(e=>this._renderNodes(S.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),u.update(e=>this._renderNodes(S.FOCUSAREA_COLOR,e)),u.update(e=>this._renderNodes(S.CUTFILL_COLOR,e)),this._pluginInput.release(S.FOCUSAREA),this._pluginInput.release(S.GROUND_DEPTH),u.update(e=>this._renderNodes(S.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===s?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(R.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),this.hasGlobalIllumination&&this._hasEmissions&&(this._bindParameters.reprojection.lastFrameEmission=u.color.obtainAttachment(de)),u.update(e=>this._renderNodes(S.ANTIALIASING,e));const b=this._hasTransparentGeometry?2:1;let f;return this._bindParameters.emissions=0,this._hasHUDHighlights&&u.update(e=>this._renderHUD(b,e)),u.update(e=>this._renderNodes(S.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||u.update(e=>this._renderHUD(b,e)),this._bindParameters.emissions=this._hasEmissions,u.update(e=>this._renderNodes(S.MAGNIFIER,e)),u.update(e=>this._renderNodes(R.FINAL,e)),r&&this._blit.toFramebuffer(this._rctx,u.color,this._bindParameters),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),u.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),r||(f=u.color,f.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new ne(f,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const t=this._bindParameters,s=t.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(s,S.OPAQUE_ENVIRONMENT,S.GAUSSIAN_SPLAT,S.OPAQUE_OCCLUSION_QUERY,S.VOXEL);if(2===this._bindParameters.emissions&&(this._bindParameters.emissions=0,this._precompileOpaqueGeometry(),this._bindParameters.emissions=2),this._bindParameters.output=3,this._plugins.precompile(...fe),this._bindParameters.output=0,this._plugins.precompile(...fe),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(this._bindParameters,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(this._bindParameters,!1,1),this._precompileTransparentGeometry()}this._nodes.precompile(s,S.FOCUSAREA),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,s),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(s,S.TRANSPARENT_ENVIRONMENT,S.VIEWSHED,S.CUTFILL_COMPUTATION,S.CUTFILL_COLOR,S.LASERLINES,S.FOCUSAREA_COLOR,S.OCCLUDED,S.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=this._hasEmissions,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(s,S.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(s,R.COMPOSITE,S.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(8),s&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(S.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(oe.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,"olid");return i.acquireDepth(13),i=this._nodes.render(i,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(oe.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e;if(s||t){const e=s?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const r=Math.max(e,i);this._animationTimestep.frame(r,s)}}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.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._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,le.UNSIGNED_BYTE,t),r.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?oe.OPAQUE_EDGES:oe.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(oe.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(S.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(oe.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(S.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output;t.bindFramebuffer();for(const i of t.cascades)i.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(i.camera,i.camera),this.renderAllGeometry(e);t.finish(e),this._bindParameters.output=s}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._shadowAccumulator.accumulating+ +this._testsNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(S.AMBIENT_ILLUMINATION,this._hasGlobalIlluminationFlag?this._renderGlobalIllumination():this._renderSSAO());const t=this._needsDepth;t?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),this.performanceInfo.advance(oe.DEPTH)):e.detachDepth(),this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._hasGlobalIlluminationFlag&&(this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",13);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(oe.DEPTH)}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Y.Zero;const t=X(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Y.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<q)return void(this.sceneDepthRange.value=Y.Infinite);const t=e.clone();t.near=F,t.far=1e10;const s=X(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...O,S.VIEWSHED,S.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){this._normalsRequired?(this._precompilePlugins(4,ge),this._needsDepth&&this._precompilePlugins(3,Pe)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(this._bindParameters.hasEmission,S.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&this._precompileAllGeometry(5),this.hasAmbientIllumination&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,S.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals",5);i.acquireDepth(13),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...ge);const r=this._nodes.optional("normals",...O,S.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(oe.NORMALS),i}_renderSSAO(){this._bindParameters.globalIlluminationEnabled=!1;const e=this._pluginInput.get("normals");return this.hasAmbientIllumination&&e?(this._bindParameters.ssao=this._nodes.produce(S.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(oe.AMBIENT_ILLUMINATION),this._bindParameters.ssao):null}_renderGlobalIllumination(){if(!this.hasGlobalIllumination)return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive,null;const e=this._nodes.produce(S.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIllumination=e,this._bindParameters.globalIlluminationEnabled=!0,this.performanceInfo.advance(oe.AMBIENT_ILLUMINATION),e}_releaseGlobalIlluminationBuffers(){this._bindParameters.reprojection.lastFrameDepth=h(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=h(this._bindParameters.reprojection.lastFrameEmission),this._bindParameters.globalIllumination=h(this._bindParameters.globalIllumination),this._bindParameters.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...fe),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...we);this._renderContext.renderOccludedMask=K}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...we),this._renderContext.renderOccludedMask=K}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ce[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillOrthographicReferenceDepth(){this._precompilePlugins(9,Te)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,s),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=i}renderCutFillOrthographicReferenceDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Te),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,S.GROUND_DEPTH,13);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Pe)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...ce),this._nodes.precompile(this._bindParameters.hasEmission,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...ce)}_renderTransparentGeometry(){this._plugins.render(...be),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...fe)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...Ee),this._bindParameters.output=2,this._plugins.precompile(...Ee),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...Ee)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(de);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?oe.HUD_OCCLUDED:oe.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>j?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(13);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),B(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(oe.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...D)+this._nodes.optional("highlights",...D)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ie),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t){this._shadowAccumulator.updateDepthRange(e),this._bindParameters.output=0,this._shadowAccumulator.accumulating&&this._bindParameters.depth&&(this._shadowAccumulator.renderAccumulation(this._bindParameters,t)&&this.performanceInfo.advance(oe.ACCUMULATED_SHADOWS),this._bindParameters.depth=h(this._bindParameters.depth))}_precompileTransparentGeometry(){H(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...be),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...be),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...be)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",m=this.fboCache.acquire(i,r,l,o),u=h.hasEmission&&(0===e||1!==t);u&&m.acquireColor(de,o,"oit emissive");const _=u?me:de;m.acquireColor(_,this.hasFloatBlend?7:0,"oit alpha"),s||m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer([0,0,0,1]),u&&this._rctx.clearBuffer(1,C),a(),m.detachDepth(),h.output=2;const p=this.fboCache.acquire(i,r,s?"oit hud front":"oit front");u&&p.acquireColor(de,o,"oit emissive front"),s?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(C,s),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!s;let b;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(b=this.fboCache.acquire(i,r,"oit hud composite"),this._rctx.bindFramebuffer(b.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(_,0,"hud occlusion"),this._rctx.clearBuffer(_-ue,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,m,p,h,u,c,e),b?.detachDepth(),s||c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(_)),p.release(),m.release(),h.output=d,b}get _hudDepthFormat(){return this.isFeatureEnabled(7)?13:12}get _needsOpaquePass(){return this.plugins.produces(0,...ce)||this.plugins.produces(5,...ce)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(S.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(R.OPAQUE,t,e)),this.fboCache.debugCallback?.(R.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(S.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(S.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(S.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(S.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(S.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(S.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(S.VOXEL,e)),this.fboCache.debugCallback?.(S.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;2===this._bindParameters.emissions&&e.ensureEmissionAttachment(),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(R.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(R.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),this._renderTransparentEnvironment()}_renderTransparentEnvironment(){if(this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(oe.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){const e=this._rctx.setDrawBuffers([_e,de]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){const i=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(i,t.fbo);const r=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),r}_ensureBindParameters(e,t,s){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(s),this._ensureBindParametersScreenSpaceReflections(s),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(e){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,e,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(e){const{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=w);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(f(Oe,t.viewMatrix),f(Se,t.projectionMatrix),g(De,Oe,Se),g(De,s.viewMatrix,De),g(De,s.projectionMatrix,De),this._reprojectionMatrix=De):this._reprojectionMatrix=w,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(g(Fe,s.viewMatrix,Oe),P(t,Fe)):P(t,w)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p()],pe.prototype,"_inGlobeView",void 0),e([p({readOnly:!0})],pe.prototype,"highResolutionAtmosphere",null),e([p()],pe.prototype,"_edgeView",void 0),e([p()],pe.prototype,"updating",null),pe=e([c("esri.views.3d.webgl-engine.lib.Renderer")],pe);const ce=[0,1,2,3],be=[7,6,4,5],fe=[7,6],ge=[0,1,2,4,...fe],Pe=[3,5],we=[2,4,8],Ee=[16,12,14,13],Ie=[4,5,2,3,0,1,...fe],Ae=[4,8,5,11],Ce={0:[13],1:[12],2:[13,12],3:[13,12]},Te=[0,1,...fe],Re=["normals","highlights"],Se=E(),Oe=E(),De=E(),Fe=E();function Ge(e){return t=>e.immediate.schedule(t)}export{pe as Renderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{sliceEquals as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as r}from"../../../../core/mathUtils.js";import{releaseMaybe as s,disposeMaybe as a}from"../../../../core/maybe.js";import{watch as o,sync as n}from"../../../../core/reactiveUtils.js";import{signal as h}from"../../../../core/signal.js";import{property as c,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{copy as l,equals as _}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as d}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{BindParameters as p}from"./BindParameters.js";import{DepthRange as f}from"./DepthRange.js";import{createQuadVAO as g}from"./glUtil3D.js";import{ShadowCastRenderer as b,shadowCastDisabledElevationThreshold as v,shadowCastDisableElevationMax as S,shadowCastDisableElevationMin as y}from"./ShadowCastRenderer.js";import{ShadowMap as w}from"./ShadowMap.js";import{S as A}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as R}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as F}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as C}from"../shaders/ShadowCastClearTechnique.js";import{TaskPriority as x}from"../../../support/Scheduler.js";import{PixelType as H}from"../../../webgl/enums.js";let P=class extends t{constructor(e,t,i,r,a,h){super({}),this._fbos=e,this._techniques=t,this._stage=i,this._prepareForShadowMapPass=r,this._renderToShadowMap=a,this._requestRender=h,this._primarySet=new T(new F(0),()=>this._requestRenderIfEnabled()),this._contextSet=new T(new F(1),()=>this._requestRenderIfEnabled()),this._passParameters=new d,this._depthRange=f.Zero,this._enabled=!1,this._previewing=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._bindParameters=new p(e.rctx,new w(e,i.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=g(e.rctx),this._accumulationRenderer=new b(t,e.rctx,this,h);const c=this._stage.view.resourceController.scheduler;this.addHandles([c.registerTask(x.SHADOW_ACCUMULATOR,this),o(()=>this._previewing,e=>{e?this._invalidateAccumulationSets():this._requestRenderIfEnabled()},n),o(()=>this._numActive,()=>this._numActiveChanged(),n),o(()=>this._depthRange,()=>this._invalidateAccumulationSets(),n),o(()=>this.readyToRun,e=>{e||(this._bindParameters.depth=s(this._bindParameters.depth),this.notifyChange("canAccumulate"))}),o(()=>this.accumulating&&this.canAccumulate,()=>this._precompile(),{sync:!0,once:!0})],this._shadowAccumulatorKey)}destroy(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=a(this._accumulationRenderer),this._fboHandle=a(this._fboHandle),this._vao=a(this._vao),this._bindParameters.destroy();for(const e of this._accumulationSets())e.destroy();this._contextSet=null,this._primarySet=null}*_accumulationSets(){yield this._primarySet,yield this._contextSet}get computedSamples(){return[this._primarySet.progress,this._contextSet.progress]}get shadowCastTexture(){return this._fboHandle?.getTexture()}get accumulating(){return this.active&&this._previewing||this._refining}get _refining(){return this.active&&!this._doneAccumulating&&!this._previewing}get active(){return this._enabled&&[...this._accumulationSets()].some(e=>e.active)}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==f.Zero&&this._opacityFromElevation>v}get _doneAccumulating(){return[...this._accumulationSets()].every(e=>e.doneAccumulating)}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get _numActive(){return[...this._accumulationSets()].reduce((e,t)=>e+(t.active?1:0),0)}get _colorFormat(){return 2===this._numActive?2:0}get readyToRun(){return this._refining&&this.canAccumulate&&[...this._accumulationSets()].some(e=>e.running)}runTask(e){this._clearBuffersOnAccumulationStart(),this._prepareForShadowMapPass(this._bindParameters);let t=!1;for(const i of this._accumulationSets())this._runTaskForSet(i,e)&&(t=!0);t&&this._requestRender()}_runTaskForSet(e,t){let i=!1;for(;!t.done&&!e.doneAccumulating;)this._accumulateShadow(e),t.madeProgress(),i=!0;return i}_precompile(){for(const e of this._accumulationSets())this._techniques.precompile(R,e.configuration),this._techniques.precompile(C,e.configuration)}renderAccumulation(e,t){return this._updateCamera(e.camera),this._bindParameters.contentCamera=e.contentCamera,e.depth?.retain(),this._bindParameters.depth?.release(),this._bindParameters.depth=e.depth,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!(!this.accumulating||!this.canAccumulate)&&(this._previewing||t?(this._clearFramebuffer(),this._reset()):this._clearBuffersOnAccumulationStart(),this._accumulateSetsForRenderFrame(t))}_clearBuffersOnAccumulationStart(){if([...this._accumulationSets()].every(e=>0===e.progress))this._clearFramebuffer();else for(const e of this._accumulationSets())0===e.progress&&this._clearFramebufferForSet(this._fboHandle,e)}_accumulateSetsForRenderFrame(e){let t=!1;for(const i of this._accumulationSets())this._accumulateSetForRenderFrame(i,e)&&(t=!0);return t&&this._requestRender(),t}_accumulateSetForRenderFrame(e,t){let i=t?e.sampleCount:Math.min(q,e.sampleCount);i-=e.progress;for(let r=0;r<i;++r)this._accumulateShadow(e);return i>0}precompile(){this._accumulationRenderer.precompile()}render(e){this._accumulationRenderer.render(e)}setParameters(e){void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._primarySet.lightDirections=e.lightDirections),void 0!==e.lightDirectionsContext&&(this._contextSet.lightDirections=e.lightDirectionsContext),!0===e.enabled?this._enable():!1===e.enabled&&this._disable(),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){const i=this._primarySet.progress;return!this.active||!this._fboHandle||i<1||e<0||e>=this._fboHandle.fbo.width||t<0||t>=this._fboHandle.fbo.height?0:(this._fboHandle.fbo.readPixels(e,t,1,1,6408,H.UNSIGNED_BYTE,j),j[0]/i)}_numActiveChanged(){if(!this._enabled||!this._fboHandle)return;const e=2===this._numActive,{width:t,height:i}=this._fboHandle.fbo,r=this._createFBO(t,i);e&&(this._clearFramebuffer(r),this._contextSet.reset()),this._rctx.blitFramebuffer(this._fboHandle.fbo,r.fbo),this._fboHandle.dispose(),this._fboHandle=r,this._requestRender()}_enable(){this._enabled||(this._enabled=!0,this._invalidateAccumulationSets())}_disable(){this._enabled&&(this._fboHandle=a(this._fboHandle),this._enabled=!1,this._requestRender())}_createFBO(e,t){return this._fbos.acquire(e,t,"shadow accumulation",this._colorFormat)}_invalidateAccumulationSets(){for(const e of this._accumulationSets())e.reset();this._requestRenderIfEnabled()}_reset(){for(const e of this._accumulationSets())e.reset()}_clearFramebuffer(e=this._fboHandle){e&&(this._rctx.bindFramebuffer(e.fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(16384))}_clearFramebufferForSet(e,t){if(!e)return;const i=this._techniques.get(C,t.configuration);this._rctx.bindFramebuffer(e.fbo),this._rctx.bindTechnique(i,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(i.primitiveType,0,this._vao.vertexCount("geometry"))}_accumulateShadow(e){this._renderToShadowMap(this._bindParameters,e.lightDirections[e.progress++],this._depthRange);const t=this._techniques.get(R,e.configuration);this._rctx.bindFramebuffer(this._fboHandle?.fbo),this._rctx.bindTechnique(t,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(t.primitiveType,0,this._vao.vertexCount("geometry"))}_updateCamera(e){if(!this._enabled)return;const t=this._bindParameters.camera;e.equals(t)||t.copyFrom(e),this._fboHandle?.fbo.width===e.fullWidth&&this._fboHandle?.fbo.height===e.fullHeight||(this._fboHandle?.release(),this._fboHandle=this._createFBO(e.fullWidth,e.fullHeight)),this._opacityFromElevation=1-r(y,S,e.relativeElevation)}_requestRenderIfEnabled(){this._enabled&&this._requestRender()}get _rctx(){return this._fbos.rctx}updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e)}get test(){}};e([c()],P.prototype,"_refining",null),e([c()],P.prototype,"active",null),e([c()],P.prototype,"canAccumulate",null),e([c()],P.prototype,"_doneAccumulating",null),e([c()],P.prototype,"_opacityFromElevation",null),e([c()],P.prototype,"_numActive",null),e([c()],P.prototype,"_colorFormat",null),e([c()],P.prototype,"readyToRun",null),e([c()],P.prototype,"_depthRange",void 0),e([c()],P.prototype,"_enabled",void 0),e([c()],P.prototype,"_previewing",void 0),e([c()],P.prototype,"_accumulationRenderer",void 0),P=e([u("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],P);const q=6,j=new Uint8Array(4);class T{constructor(e,t){this.configuration=e,this._notifyChange=t,this._cachedLightDirections=[],this._progress=h(0),this._sampleCount=h(0)}get progress(){return this._progress.value}set progress(e){this._progress.value=e}get sampleCount(){return this._sampleCount.value}get doneAccumulating(){return this.progress>=this.sampleCount}get running(){return this.progress>0}get active(){return this.sampleCount>0}get lightDirections(){return this._cachedLightDirections}set lightDirections(e){const t=this._cachedLightDirections,r=Math.min(A,e.length);if(!i(t,0,t.length,e,0,r,_)){t.length=r,this._sampleCount.value=r;for(let i=0;i<r;++i)t[i]=l(t[i]??m(),e[i]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}precompile(e){e.precompile(R,this.configuration),e.precompile(C,this.configuration)}}export{P as ShadowAccumulator};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{sliceEquals as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as s}from"../../../../core/mathUtils.js";import{releaseMaybe as r,disposeMaybe as a}from"../../../../core/maybe.js";import{watch as o,sync as n}from"../../../../core/reactiveUtils.js";import{signal as h}from"../../../../core/signal.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{copy as u,equals as m}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as d}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{F as p}from"../../../../chunks/FocusAreaMask.glsl.js";import{FocusAreaMaskTechnique as f}from"../effects/focusArea/FocusAreaMaskTechnique.js";import{volumeToVao as g}from"../effects/focusArea/focusAreaMaskUtils.js";import{BindParameters as b}from"./BindParameters.js";import{DepthRange as v}from"./DepthRange.js";import{createQuadVAO as S}from"./glUtil3D.js";import{ShadowCastRenderer as y,shadowCastDisabledElevationThreshold as w,shadowCastDisableElevationMax as A,shadowCastDisableElevationMin as F}from"./ShadowCastRenderer.js";import{ShadowMap as x}from"./ShadowMap.js";import{S as C}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as R}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as P}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as q}from"../shaders/ShadowCastClearTechnique.js";import{TaskPriority as j}from"../../../support/Scheduler.js";import{PrimitiveType as H,PixelType as T}from"../../../webgl/enums.js";import{DisposableFramebufferObject as V}from"../../../webgl/FramebufferObject.js";import{noParameters as D}from"../../../webgl/NoParameters.js";let E=class extends t{constructor(e,t,i,s,a,h){super({}),this._fbos=e,this._techniques=t,this._stage=i,this._prepareForShadowMapPass=s,this._renderToShadowMap=a,this._requestRender=h,this._analysisVolumeGeometry=null,this._primarySet=new O(new P(0),()=>this._requestRenderIfEnabled()),this._contextSet=new O(new P(1),()=>this._requestRenderIfEnabled()),this._passParameters=new d,this._maskParameters=new p,this._volumeVao=null,this._volumeVertexCount=0,this._depthRange=v.Zero,this._enabled=!1,this._previewing=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._bindParameters=new b(e.rctx,new x(e,i.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=S(e.rctx),this._accumulationRenderer=new y(t,e.rctx,this,h),this._tmpReadFbo=new V(e.rctx);const c=this._stage.view.resourceController.scheduler;this.addHandles([c.registerTask(j.SHADOW_ACCUMULATOR,this),o(()=>this._previewing,e=>{e?this._invalidateAccumulationSets():this._requestRenderIfEnabled()},n),o(()=>this._numActive,()=>this._numActiveChanged(),n),o(()=>this._depthRange,()=>this._invalidateAccumulationSets(),n),o(()=>this.readyToRun,e=>{e||(this._bindParameters.depth=r(this._bindParameters.depth),this.notifyChange("canAccumulate"))}),o(()=>this.accumulating&&this.canAccumulate,()=>this._precompile(),{sync:!0,once:!0})],this._shadowAccumulatorKey)}destroy(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=a(this._accumulationRenderer),this._fboHandle=a(this._fboHandle),this._vao=a(this._vao),this._volumeVao=a(this._volumeVao),this._tmpReadFbo=a(this._tmpReadFbo),this._bindParameters.destroy();for(const e of this._accumulationSets())e.destroy();this._contextSet=null,this._primarySet=null}*_accumulationSets(){yield this._primarySet,yield this._contextSet}get computedSamples(){return[this._primarySet.progress,this._contextSet.progress]}get shadowCastTexture(){return this._fboHandle?.getTexture()}get accumulating(){return this.active&&this._previewing||this._refining}get _refining(){return this.active&&!this._doneAccumulating&&!this._previewing}get active(){return this._enabled&&[...this._accumulationSets()].some(e=>e.active)}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==v.Zero&&this._opacityFromElevation>w}get _doneAccumulating(){return[...this._accumulationSets()].every(e=>e.doneAccumulating)}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get _numActive(){return[...this._accumulationSets()].reduce((e,t)=>e+(t.active?1:0),0)}get _colorFormat(){return 2===this._numActive?2:0}get readyToRun(){return this._refining&&this.canAccumulate&&[...this._accumulationSets()].some(e=>e.running)}get _analysisVolume(){return this._analysisVolumeGeometry}set _analysisVolume(e){if(this._analysisVolumeGeometry===e)return;if(this._invalidateAccumulationSets(),this._analysisVolumeGeometry=e,this._volumeVao=a(this._volumeVao),this._volumeVertexCount=0,null==e)return;const t=e.geometryVolume,{vao:i,vertexCount:s}=g(this._rctx,t);this._volumeVao=i,this._volumeVertexCount=s}runTask(e){this._clearBuffersOnAccumulationStart(),this._prepareForShadowMapPass(this._bindParameters);let t=!1;for(const i of this._accumulationSets())this._runTaskForSet(i,e)&&(t=!0);t&&this._requestRender()}_runTaskForSet(e,t){let i=!1;for(;!t.done&&!e.doneAccumulating;)this._accumulateShadow(e),t.madeProgress(),i=!0;return i}_precompile(){for(const e of this._accumulationSets())this._techniques.precompile(R,e.configuration),this._techniques.precompile(q,e.configuration);this._techniques.precompile(f)}renderAccumulation(e,t){return this._updateCamera(e.camera),this._bindParameters.contentCamera=e.contentCamera,e.depth?.retain(),this._bindParameters.depth?.release(),this._bindParameters.depth=e.depth,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!(!this.accumulating||!this.canAccumulate)&&(this._previewing||t?(this._clearFramebuffer(),this._reset()):this._clearBuffersOnAccumulationStart(),this._renderAreaMask(),this._accumulateSetsForRenderFrame(t))}_renderAreaMask(){const e=this._techniques.getCompiled(f),t=this._volumeVao,i=this._volumeVertexCount,s=this._fboHandle,r=this._analysisVolume;if(s?.detachDepth(),!e||!t||i<1||!s||!r)return;s.acquireDepth(13);const a=this._rctx,o=this._bindParameters,n=o.depth,h=this._tmpReadFbo;h.attachDepthStencil(n?.attachment),a.blitFramebuffer(h,s.fbo,256),h.detachDepthStencilTexture(),a.bindFramebuffer(s.fbo),a.setClearStencil(0),a.clear(1024),a.setViewport(0,0,o.camera.width,o.camera.height);const c=a.bindTechnique(e,o);a.setFaceCullingEnabled(!1),a.setStencilTestEnabled(!0),a.setStencilOpSeparate(1028,7680,34055,7680),a.setStencilOpSeparate(1029,7680,34056,7680),a.setDepthWriteEnabled(!1),this._maskParameters.origin=r.origin,c.bindDraw(o,D,this._maskParameters),a.bindVAO(t),a.setDepthTestEnabled(!0),a.setStencilWriteMask(255),a.setStencilFunction(519,0,255),a.setColorMask(!1,!1,!1,!1),a.drawArrays(H.TRIANGLES,0,i)}_clearBuffersOnAccumulationStart(){if([...this._accumulationSets()].every(e=>0===e.progress))this._clearFramebuffer();else for(const e of this._accumulationSets())0===e.progress&&this._clearFramebufferForSet(this._fboHandle,e)}_accumulateSetsForRenderFrame(e){let t=!1;for(const i of this._accumulationSets())this._accumulateSetForRenderFrame(i,e)&&(t=!0);return t&&this._requestRender(),t}_accumulateSetForRenderFrame(e,t){let i=t?e.sampleCount:Math.min(M,e.sampleCount);i-=e.progress;for(let s=0;s<i;++s)this._accumulateShadow(e);return i>0}precompile(){this._accumulationRenderer.precompile()}render(e){this._accumulationRenderer.render(e)}setParameters(e){void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._primarySet.lightDirections=e.lightDirections),void 0!==e.lightDirectionsContext&&(this._contextSet.lightDirections=e.lightDirectionsContext),!0===e.enabled?this._enable():!1===e.enabled&&this._disable(),void 0!==e.analysisVolume&&(this._analysisVolume=e.analysisVolume),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){const i=this._primarySet.progress;return!this.active||!this._fboHandle||i<1||e<0||e>=this._fboHandle.fbo.width||t<0||t>=this._fboHandle.fbo.height?0:(this._fboHandle.fbo.readPixels(e,t,1,1,6408,T.UNSIGNED_BYTE,k),k[0]/i)}_numActiveChanged(){if(!this._enabled||!this._fboHandle)return;const e=2===this._numActive,{width:t,height:i}=this._fboHandle.fbo,s=this._createFBO(t,i);e&&(this._clearFramebuffer(s),this._contextSet.reset()),this._rctx.blitFramebuffer(this._fboHandle.fbo,s.fbo),this._fboHandle.dispose(),this._fboHandle=s,this._requestRender()}_enable(){this._enabled||(this._enabled=!0,this._invalidateAccumulationSets())}_disable(){this._enabled&&(this._fboHandle=a(this._fboHandle),this._enabled=!1,this._requestRender())}_createFBO(e,t){return this._fbos.acquire(e,t,"shadow accumulation",this._colorFormat)}_invalidateAccumulationSets(){for(const e of this._accumulationSets())e.reset();this._requestRenderIfEnabled()}_reset(){for(const e of this._accumulationSets())e.reset()}_clearFramebuffer(e=this._fboHandle){e&&(this._rctx.bindFramebuffer(e.fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(16384))}_clearFramebufferForSet(e,t){if(!e)return;const i=this._techniques.get(q,t.configuration);this._rctx.bindFramebuffer(e.fbo),this._rctx.bindTechnique(i,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(i.primitiveType,0,this._vao.vertexCount("geometry"))}_accumulateShadow(e){this._renderToShadowMap(this._bindParameters,e.lightDirections[e.progress++],this._depthRange);const t=this._techniques.get(R,e.configuration);this._rctx.bindFramebuffer(this._fboHandle?.fbo),this._rctx.bindTechnique(t,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.setStencilTestEnabled(null!=this._analysisVolume),this._rctx.setStencilFunction(517,0,255),this._rctx.drawArrays(t.primitiveType,0,this._vao.vertexCount("geometry"))}_updateCamera(e){if(!this._enabled)return;const t=this._bindParameters.camera;e.equals(t)||t.copyFrom(e),this._fboHandle?.fbo.width===e.fullWidth&&this._fboHandle?.fbo.height===e.fullHeight||(this._fboHandle?.release(),this._fboHandle=this._createFBO(e.fullWidth,e.fullHeight)),this._opacityFromElevation=1-s(F,A,e.relativeElevation)}_requestRenderIfEnabled(){this._enabled&&this._requestRender()}get _rctx(){return this._fbos.rctx}updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e)}get test(){}};e([c()],E.prototype,"_refining",null),e([c()],E.prototype,"active",null),e([c()],E.prototype,"canAccumulate",null),e([c()],E.prototype,"_doneAccumulating",null),e([c()],E.prototype,"_opacityFromElevation",null),e([c()],E.prototype,"_numActive",null),e([c()],E.prototype,"_colorFormat",null),e([c()],E.prototype,"readyToRun",null),e([c()],E.prototype,"_depthRange",void 0),e([c()],E.prototype,"_enabled",void 0),e([c()],E.prototype,"_previewing",void 0),e([c()],E.prototype,"_accumulationRenderer",void 0),E=e([l("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],E);const M=6,k=new Uint8Array(4);class O{constructor(e,t){this.configuration=e,this._notifyChange=t,this._cachedLightDirections=[],this._progress=h(0),this._sampleCount=h(0)}get progress(){return this._progress.value}set progress(e){this._progress.value=e}get sampleCount(){return this._sampleCount.value}get doneAccumulating(){return this.progress>=this.sampleCount}get running(){return this.progress>0}get active(){return this.sampleCount>0}get lightDirections(){return this._cachedLightDirections}set lightDirections(e){const t=this._cachedLightDirections,s=Math.min(C,e.length);if(!i(t,0,t.length,e,0,s,m)){t.length=s,this._sampleCount.value=s;for(let i=0;i<s;++i)t[i]=u(t[i]??_(),e[i]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}precompile(e){e.precompile(R,this.configuration),e.precompile(q,this.configuration)}}export{E as ShadowAccumulator};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";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,subclass as d}from"../../../../core/accessorSupport/decorators.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{sub as f,distance as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as v,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Sphere as V}from"../../../../geometry/support/sphere.js";import{InternalRenderCategory as g}from"../../webgl.js";import b from"../../webgl/RenderNode.js";import{ViewshedShadowMap as M}from"./ViewshedShadowMap.js";import{V as S}from"../../../../chunks/Viewshed.glsl.js";import{ViewshedTechnique as y}from"../shaders/ViewshedTechnique.js";import{ColorAttachment0 as j}from"../../../webgl/enums.js";let x=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=>D(this.view,e))}constructor(e){super(e),this.isDecoration=!1,this._passParameters=new S,this._viewsheds=new s,this._shadowMap=null,this.consumes={required:[g.VIEWSHED,"normals"]},this.produces=g.VIEWSHED}initialize(){this._shadowMap=new M(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(1),n)])}destroy(){this._shadowMap=r(this._shadowMap)}precompile(){if(this.hasViewsheds){this.techniques.precompile(y);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||this.isDecoration&&!s.decorations)return r;const i=this.techniques.getCompiled(y);if(!i)return this.requestRender(1),r;const o=this.view.stage.renderer.isFeatureEnabled(6);this._passParameters.shadowMap=this._shadowMap??this._passParameters.shadowMap,this._passParameters.normals=e.find(({name:e})=>"normals"===e)?.getTexture();const a=r.obtainDepthTexture();for(const n of this._viewshedsInView){if(!this._renderShadowCubeMap(s,n,o)||!this._shadowMap?.ready)continue;const e=this._setupViewshedParameters(n,s.camera);t.bindFramebuffer(r.fbo),t.bindTechnique(i,s,e),t.setDrawBuffers([j]),t.screen.draw()}return this.shadowMap?.dispose(),r.attachDepth(a),a?.release(),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=f(E,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=R(e.targetRenderSpace,o);i.targetVector=a;const n=new Array,h=new Array;for(let t=0;t<r.numActiveFaces;t++)c(I,r.viewshedViewMatrices[t],o),n.push(...I),P(r.viewshedProjectionMatrices[t],I,O),h.push(...O);return i.viewMatrices=n,i.projectionMatrices=h,i.volumeOffset=this.selectedViewshed?.()===e.viewshed?A(e,this.view,s.eye):0,i}get test(){return{viewsheds:this._viewsheds,shadowMap:this._shadowMap,viewshedsInView:this._viewshedsInView}}};function R(e,s){const t=v();return f(t,e,s)}function P(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 D(e,s){const t=new V(s.observerRenderSpace,s.farDistanceRenderSpace);return!!e.ready&&e.frustum.intersectsSphere(t)}function A(e,s,t){if(null==e)return 0;const{observerRenderSpace:r,targetRenderSpace:i}=e,o=u(t,r)>u(t,i)?e.observer:e.target;return s.pixelSizeAt(o)}e([h()],x.prototype,"selectedViewshed",void 0),e([h()],x.prototype,"isDecoration",void 0),e([h()],x.prototype,"shadowMap",null),e([h()],x.prototype,"hasViewsheds",null),e([h()],x.prototype,"_contentPixelRatio",null),e([h()],x.prototype,"_viewshedsInView",null),e([h()],x.prototype,"consumes",void 0),e([h()],x.prototype,"produces",void 0),x=e([d("esri.views.3d.webgl-engine.lib.Viewshed")],x);const E=v(),I=m(),O=m();export{x as Viewshed,A as computeOffsetScale};
2
+ import{__decorate as e}from"tslib";import s from"../../../../core/Collection.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{watch as r,initial as a,when as o,sync as n}from"../../../../core/reactiveUtils.js";import{property as h,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{translate as c,fromTranslation as p,scale as l,mul as w}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{sub as f,distance as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as v,fromValues as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Sphere as _}from"../../../../geometry/support/sphere.js";import{InternalRenderCategory as V}from"../../webgl.js";import b from"../../webgl/RenderNode.js";import{ViewshedShadowMap as M}from"./ViewshedShadowMap.js";import{V as S}from"../../../../chunks/Viewshed.glsl.js";import{ViewshedTechnique as y}from"../shaders/ViewshedTechnique.js";import{ColorAttachment0 as j}from"../../../webgl/enums.js";let x=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=>P(this.view,e))}constructor(e){super(e),this.isDecoration=!1,this._passParameters=new S,this._viewsheds=new s,this._shadowMap=null,this.consumes={required:[V.VIEWSHED,"normals"]},this.produces=V.VIEWSHED}initialize(){this._shadowMap=new M(this.fboCache),this.addHandles([r(()=>this.view.resolutionScale,e=>{const s=this._shadowMap;s&&(s.settings.textureSizeQuality=e)},a),o(()=>!this.hasViewsheds,()=>this._shadowMap?.dispose()),r(()=>this._viewshedsInView.map(e=>[e.elevationAlignedObserverRenderSpace,e.heading,e.tilt,e.farDistance,e.horizontalFieldOfView,e.verticalFieldOfView]),()=>this.requestRender(1),n)])}destroy(){this._shadowMap=i(this._shadowMap)}precompile(){if(this.hasViewsheds)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,i=e.find(({name:e})=>e===V.VIEWSHED);if(!this.hasViewsheds||this.isDecoration&&!s.decorations)return i;const r=this.techniques.getCompiled(y);if(!r)return this.requestRender(1),i;const a=this.view.stage.renderer.isFeatureEnabled(6);this._passParameters.shadowMap=this._shadowMap??this._passParameters.shadowMap,this._passParameters.normals=e.find(({name:e})=>"normals"===e)?.getTexture();const o=i.obtainDepthTexture();for(const n of this._viewshedsInView){if(!this._renderShadowCubeMap(s,n,a)||!this._shadowMap?.ready)continue;const e=this._setupViewshedParameters(n,s.camera);t.bindFramebuffer(i.fbo),t.bindTechnique(r,s,e),t.setDrawBuffers([j]),t.screen.draw()}return this.shadowMap?.dispose(),i.attachDepth(o),o?.release(),i}updateViewsheds(e){const s=this._viewsheds,{removes:t,adds:i}=e;if(t&&(Array.isArray(t)?s.removeMany(t):s.remove(t)),i)if(Array.isArray(i)){const e=i.filter(e=>!s.includes(e));s.addMany(e)}else s.includes(i)||s.add(i)}_renderShadowCubeMap(e,s,t){const i=this._shadowMap;if(!i)return!1;const r=this.view.basemapTerrain.hasStencilEnabledExtents,a=i.start(e.camera,s,t,this._contentPixelRatio,r);return a&&i.faces.forEach(e=>this.view.stage.renderer.renderViewshedShadowMap(e)),i.finish(),a}_setupViewshedParameters(e,s){const i=this._shadowMap;if(!i)return this._passParameters;const r=this._passParameters,a=e.effectiveObserverRenderSpace;r.localOrigin=a,r.observerOffset=f(D,e.elevationAlignedObserverRenderSpace,e.effectiveObserverRenderSpace),r.fovs=[t(e.horizontalFieldOfView),t(e.verticalFieldOfView)],r.headingAndTilt=[t(e.heading),t(e.tiltParallelToSurface)],r.upVector=e.tiltedUpVector;const o=A(e.elevationAlignedTargetRenderSpace,a);r.targetVector=o;const n=new Array,h=new Array;for(let t=0;t<i.numActiveFaces;t++)c(E,i.viewshedViewMatrices[t],a),n.push(...E),R(i.viewshedProjectionMatrices[t],E,I),h.push(...I);return r.viewMatrices=n,r.projectionMatrices=h,r.volumeOffset=this.selectedViewshed?.()===e.viewshed?O(e,this.view,s.eye):0,r}get test(){return{viewsheds:this._viewsheds,shadowMap:this._shadowMap,viewshedsInView:this._viewshedsInView}}};function A(e,s){const t=v();return f(t,e,s)}function R(e,s,t){const i=g(.5,.5,.5);return p(t,i),l(t,t,i),w(t,t,e),w(t,t,s),t}function P(e,s){const t=new _(s.elevationAlignedObserverRenderSpace,s.farDistanceRenderSpace);return!!e.ready&&e.frustum.intersectsSphere(t)}function O(e,s,t){if(null==e)return 0;const{elevationAlignedObserverRenderSpace:i,elevationAlignedTargetRenderSpace:r}=e,a=u(t,i)>u(t,r)?e.observer:e.target;return s.pixelSizeAt(a)}e([h()],x.prototype,"selectedViewshed",void 0),e([h()],x.prototype,"isDecoration",void 0),e([h()],x.prototype,"shadowMap",null),e([h()],x.prototype,"hasViewsheds",null),e([h()],x.prototype,"_contentPixelRatio",null),e([h()],x.prototype,"_viewshedsInView",null),e([h()],x.prototype,"consumes",void 0),e([h()],x.prototype,"produces",void 0),x=e([d("esri.views.3d.webgl-engine.lib.Viewshed")],x);const D=v(),E=m(),I=m();export{x as Viewshed,O as computeOffsetScale};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import has from"../../../../core/has.js";import{clamp as t}from"../../../../core/mathUtils.js";import{releaseMaybe as e}from"../../../../core/maybe.js";import{fromRotation as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{sub as r,add as o,negate as a,transformMat4 as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyTextureResizeModulo as n}from"./textureUtils.js";import{ViewshedFaceCamera as l}from"./ViewshedFaceCamera.js";import{DepthStencilAttachment as u,SizedDepthFormat as m}from"../../../webgl/enums.js";import{isSizedDepthStencilFormat as f}from"../../../webgl/textureUtils.js";class d{constructor(){this.textureSizeQuality=1,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.textureSizeMultiple=128,this.toleranceSides=5,this.toleranceBottomTop=10}textureSizeModifier(t){const e=t?this.textureSizeModHighQuality:this.textureSizeModLowQuality;return this.textureSizeQuality*e}textureResizeModulo(t){return Math.ceil(t/this.textureSizeMultiple)*this.textureSizeMultiple}}const p=["front","left","right","back","top","bottom"];function g(t){return!["top","bottom"].includes(t)}class x{constructor(t){this._fbos=t,this._faces={},this._width=0,this._height=0,this.settings=new d,this._maxTextureSize=Math.min(has("esri-mobile")?4096:16384,t.rctx.parameters.maxTextureSize)}get depthTexture(){return this._handle?.getTexture(u)}get ready(){return null!=this.depthTexture&&0!==this._width&&0!==this._height}get nearFar(){const t=this.faces;return 0===t.length?null:t[0].nearFar}get numActiveFaces(){const t=this._faces;let e=0;return Object.keys(t).forEach(i=>{t[i]&&(e+=1)}),e}get faces(){const t=this._faces,e=[];for(const i of p){const s=t[i];s&&e.push(s)}return e}get atlasRegions(){return this.faces.map(t=>[t.x/this._width,(t.x+t.width)/this._width,t.y/this._height,(t.y+t.height)/this._height])}get viewshedProjectionMatrices(){return this.faces.map(t=>t.projectionMatrix)}get viewshedViewMatrices(){return this.faces.map(t=>t.viewMatrix)}_setupFaceCamera(e,n,u,m){const{effectiveObserverRenderSpace:f,tiltedUpVector:d,targetRenderSpace:p,farDistanceRenderSpace:x,horizontalFieldOfView:_,verticalFieldOfView:b}=n,w=c();r(w,p,f);const M=c(),S=c(),F=(t,e)=>{const r=c(),a=s();return i(a,t,e),h(r,w,a),o(r,f,r),r};let z,T=d;const v=Math.min(90,_),O=Math.min(90,Math.max(0,(_-90)/2));let j=-45,B=45,y=-45,k=45;if(g(e)){const e=e=>t(e,-45,45);y=e(-b/2)-this.settings.toleranceBottomTop,k=e(+b/2)+this.settings.toleranceBottomTop}switch(e){case"front":z=p,j=-v/2,B=v/2;break;case"left":z=F(Math.PI/2,d),j=45-O;break;case"right":z=F(-Math.PI/2,d),B=-45+O;break;case"top":z=o(M,f,d),T=a(S,w);break;case"bottom":z=r(M,f,d),T=w;break;case"back":z=F(Math.PI,d)}const V=new l({center:z,eye:f,up:T,far:x});V.sectionAnglesDeg=[j-this.settings.toleranceSides,B+this.settings.toleranceSides,y,k],V.fovY=Math.PI/2;const P=V.setViewport(u,m);return this._faces[e]=V,P}isActive(t){return this._computeActiveFaces(t).size>0}_computeActiveFaces(t){const e=new Set,{horizontalFieldOfView:i,verticalFieldOfView:s}=t,r=-s/2,o=s/2;return 0===i||0===s||(r<=45&&o>=-45&&e.add("front"),i>90&&(e.add("left"),e.add("right")),i>270&&e.add("back"),o>45-this.settings.toleranceBottomTop&&e.add("top"),r<-45+this.settings.toleranceBottomTop&&e.add("bottom")),e}_computeBaseTextureSize({pixelRatio:t,fullWidth:e,fullHeight:i},s,r,o){const a=s/t,h=this.settings.textureSizeModifier(r);return n(Math.max(e,i)*a*h,this._maxTextureSize/o)}_ensureFBO(t){const e=this._width,i=this._height,s=this._handle?.fbo;s&&s.width===e&&s.height===i&&t===f(s.depthStencilTexture?.descriptor?.internalFormat??m.DEPTH_COMPONENT16)||(this._handle?.release(),this._handle=this._allocateFBO(t))}_allocateFBO(t){const{_width:e,_height:i}=this,s=t?13:12,r=this._fbos.acquire(e,i,"viewshed shadow map",s);return r.getTexture(u)?.setShadowFiltering(!1),r}clearFBO(t){const e=this._fbos.rctx;this._ensureFBO(t),e.bindFramebuffer(this._handle?.fbo),e.setClearColor(1,1,1,1),e.clear(16640)}dispose(){this._debugFBO||(this._handle=e(this._handle))}start(t,e,i,s,r=!1){this._faces={};const o=this._computeActiveFaces(e),a=o.size;if(0===a)return!1;const h=this._computeBaseTextureSize(t,s,i,a);let c=0,n=0,l=0;return p.filter(t=>o.has(t)).forEach(t=>{const i=_(t,a);i>n&&(l=Math.max(l,c),c=0),n=i;const s=i*h;c+=this._setupFaceCamera(t,e,[c,s],h)}),l=Math.max(l,c),this._width=this.settings.textureResizeModulo(l),this._height=b(a)*h,this.clearFBO(r),!0}finish(){}get test(){}}function _(t,e){if(e<4)return 0;const i="front"===t||"left"===t;return 4===e?i?0:1:i||"right"===t?0:1}function b(t){return t<4?1:2}export{x as ViewshedShadowMap};
2
+ import has from"../../../../core/has.js";import{clamp as t}from"../../../../core/mathUtils.js";import{releaseMaybe as e}from"../../../../core/maybe.js";import{fromRotation as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{sub as r,add as o,negate as a,transformMat4 as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyTextureResizeModulo as n}from"./textureUtils.js";import{ViewshedFaceCamera as l}from"./ViewshedFaceCamera.js";import{DepthStencilAttachment as u,SizedDepthFormat as m}from"../../../webgl/enums.js";import{isSizedDepthStencilFormat as f}from"../../../webgl/textureUtils.js";class d{constructor(){this.textureSizeQuality=1,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.textureSizeMultiple=128,this.toleranceSides=5,this.toleranceBottomTop=10}textureSizeModifier(t){const e=t?this.textureSizeModHighQuality:this.textureSizeModLowQuality;return this.textureSizeQuality*e}textureResizeModulo(t){return Math.ceil(t/this.textureSizeMultiple)*this.textureSizeMultiple}}const p=["front","left","right","back","top","bottom"];function g(t){return!["top","bottom"].includes(t)}class x{constructor(t){this._fbos=t,this._faces={},this._width=0,this._height=0,this.settings=new d,this._maxTextureSize=Math.min(has("esri-mobile")?4096:16384,t.rctx.parameters.maxTextureSize)}get depthTexture(){return this._handle?.getTexture(u)}get ready(){return null!=this.depthTexture&&0!==this._width&&0!==this._height}get nearFar(){const t=this.faces;return 0===t.length?null:t[0].nearFar}get numActiveFaces(){const t=this._faces;let e=0;return Object.keys(t).forEach(i=>{t[i]&&(e+=1)}),e}get faces(){const t=this._faces,e=[];for(const i of p){const s=t[i];s&&e.push(s)}return e}get atlasRegions(){return this.faces.map(t=>[t.x/this._width,(t.x+t.width)/this._width,t.y/this._height,(t.y+t.height)/this._height])}get viewshedProjectionMatrices(){return this.faces.map(t=>t.projectionMatrix)}get viewshedViewMatrices(){return this.faces.map(t=>t.viewMatrix)}_setupFaceCamera(e,n,u,m){const{effectiveObserverRenderSpace:f,effectiveTargetRenderSpace:d,tiltedUpVector:p,farDistanceRenderSpace:x,horizontalFieldOfView:_,verticalFieldOfView:b}=n,w=c();r(w,d,f);const M=c(),S=c(),F=(t,e)=>{const r=c(),a=s();return i(a,t,e),h(r,w,a),o(r,f,r),r};let z,T=p;const v=Math.min(90,_),O=Math.min(90,Math.max(0,(_-90)/2));let j=-45,B=45,y=-45,k=45;if(g(e)){const e=e=>t(e,-45,45);y=e(-b/2)-this.settings.toleranceBottomTop,k=e(+b/2)+this.settings.toleranceBottomTop}switch(e){case"front":z=d,j=-v/2,B=v/2;break;case"left":z=F(Math.PI/2,p),j=45-O;break;case"right":z=F(-Math.PI/2,p),B=-45+O;break;case"top":z=o(M,f,p),T=a(S,w);break;case"bottom":z=r(M,f,p),T=w;break;case"back":z=F(Math.PI,p)}const V=new l({center:z,eye:f,up:T,far:x});V.sectionAnglesDeg=[j-this.settings.toleranceSides,B+this.settings.toleranceSides,y,k],V.fovY=Math.PI/2;const P=V.setViewport(u,m);return this._faces[e]=V,P}isActive(t){return this._computeActiveFaces(t).size>0}_computeActiveFaces(t){const e=new Set,{horizontalFieldOfView:i,verticalFieldOfView:s}=t,r=-s/2,o=s/2;return 0===i||0===s||(r<=45&&o>=-45&&e.add("front"),i>90&&(e.add("left"),e.add("right")),i>270&&e.add("back"),o>45-this.settings.toleranceBottomTop&&e.add("top"),r<-45+this.settings.toleranceBottomTop&&e.add("bottom")),e}_computeBaseTextureSize({pixelRatio:t,fullWidth:e,fullHeight:i},s,r,o){const a=s/t,h=this.settings.textureSizeModifier(r);return n(Math.max(e,i)*a*h,this._maxTextureSize/o)}_ensureFBO(t){const e=this._width,i=this._height,s=this._handle?.fbo;s&&s.width===e&&s.height===i&&t===f(s.depthStencilTexture?.descriptor?.internalFormat??m.DEPTH_COMPONENT16)||(this._handle?.release(),this._handle=this._allocateFBO(t))}_allocateFBO(t){const{_width:e,_height:i}=this,s=t?13:12,r=this._fbos.acquire(e,i,"viewshed shadow map",s);return r.getTexture(u)?.setShadowFiltering(!1),r}clearFBO(t){const e=this._fbos.rctx;this._ensureFBO(t),e.bindFramebuffer(this._handle?.fbo),e.setClearColor(1,1,1,1),e.clear(16640)}dispose(){this._debugFBO||(this._handle=e(this._handle))}start(t,e,i,s,r=!1){this._faces={};const o=this._computeActiveFaces(e),a=o.size;if(0===a)return!1;const h=this._computeBaseTextureSize(t,s,i,a);let c=0,n=0,l=0;return p.filter(t=>o.has(t)).forEach(t=>{const i=_(t,a);i>n&&(l=Math.max(l,c),c=0),n=i;const s=i*h;c+=this._setupFaceCamera(t,e,[c,s],h)}),l=Math.max(l,c),this._width=this.settings.textureResizeModulo(l),this._height=b(a)*h,this.clearFBO(r),!0}finish(){}get test(){}}function _(t,e){if(e<4)return 0;const i="front"===t||"left"===t;return 4===e?i?0:1:i||"right"===t?0:1}function b(t){return t<4?1:2}export{x as ViewshedShadowMap};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as i}from"tslib";import{SliceConfiguration as e}from"../core/shaderLibrary/Slice.glsl.js";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends e{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}i([t()],r.prototype,"hasHighlightMixTexture",void 0);export{r as DefaultTechniqueConfiguration};
2
+ import{__decorate as i}from"tslib";import{SliceConfiguration as e}from"../core/shaderLibrary/Slice.glsl.js";import{parameter as s}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class t extends e{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}i([s()],t.prototype,"hasHighlightMixTexture",void 0),i([s()],t.prototype,"emissionDimmingPass",void 0);export{t as DefaultTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as o}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as t}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as s,depthTest as i,blending as a}from"../lib/OrderIndependentTransparency.js";import{PositionUvGLLayout as n}from"../materials/DefaultLayouts.js";import{polygonOffset as l}from"../materials/PolygonOffset.js";import{C as p}from"../../../../chunks/CheckerBoard.glsl.js";import{makePipelineState as m,defaultColorWrite as c}from"../../../webgl/renderState.js";let d=class extends t{constructor(e,r){super(e,r,n),this.shader=new o(p,()=>import("./CheckerBoard.glsl.js"))}initializePipeline(e){const{output:r,transparent:o}=e;return m({blending:o?a(r):null,depthTest:i(r),depthWrite:s(e),colorWrite:c,polygonOffset:l(e)})}};d=e([r("esri.views.3d.webgl-engine.shaders.CheckerBoardTechnique")],d);export{d as CheckerBoardTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as o}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as t,depthTest as i,blending as n}from"../lib/OrderIndependentTransparency.js";import{PositionUvGLLayout as a}from"../materials/DefaultLayouts.js";import{polygonOffset as m}from"../materials/PolygonOffset.js";import{C as l}from"../../../../chunks/CheckerBoard.glsl.js";import{makePipelineState as p,defaultColorWrite as c}from"../../../webgl/renderState.js";let d=class extends s{constructor(e,r){super(e,r,a),this.shader=new o(l,()=>import("./CheckerBoard.glsl.js"))}initializePipeline(e){const{output:r,transparent:o}=e;return p({blending:o?n(r,!1,e.emissionDimmingPass):null,depthTest:i(r),depthWrite:t(e),colorWrite:c,polygonOffset:m(e)})}};d=e([r("esri.views.3d.webgl-engine.shaders.CheckerBoardTechnique")],d);export{d as CheckerBoardTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as o}from"../../support/buffer/glUtil.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{depthWrite as a,depthTest as c,blending as p}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as u,stencilBaseAllZerosParams as m,stencilWriteMaskOn as f}from"../lib/StencilUtils.js";import{polygonOffset as d}from"../materials/PolygonOffset.js";import{VisualVariablePassParameters as h}from"../materials/VisualVariablePassParameters.js";import{C as g}from"../../../../chunks/ColorMaterial.glsl.js";import{makePipelineState as j,defaultColorWrite as b,cullingParams as P}from"../../../webgl/renderState.js";class C extends h{constructor(){super(...arguments),this.color=t}}let S=class extends l{constructor(e,r){super(e,r,o(T(r))),this.shader=new s(g,()=>import("./ColorMaterial.glsl.js")),this.ignoreUnused=!0}_createPipeline(e,r){const{output:t,transparent:o,cullFace:i,draped:s,hasOccludees:l}=e;return j({blending:o?p(t):null,culling:P(i),depthTest:s?null:c(t),depthWrite:a(e),colorWrite:b,stencilWrite:l?f:null,stencilTest:l?r?u:m:null,polygonOffset:d(e)})}initializePipeline(e){return this._occludeePipelineState=this._createPipeline(e,!0),this._createPipeline(e,!1)}getPipeline(e,r){return r?this._occludeePipelineState:super.getPipeline(e)}};function T(e){const r=i().vec3f("position");return n()&&r.vec4u8("olidColor"),e.hasVVColor?r.f32("colorFeatureAttribute"):e.hasVertexColors&&r.vec4u8("color",{glNormalized:!0}),r.freeze()}S=e([r("esri.views.3d.webgl-engine.shaders.ColorMaterialTechnique")],S);export{C as ColorMaterialPassParameters,S as ColorMaterialTechnique,T as getLayout};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as i}from"../../support/buffer/glUtil.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{depthWrite as a,depthTest as c,blending as p}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as m,stencilBaseAllZerosParams as u,stencilWriteMaskOn as f}from"../lib/StencilUtils.js";import{polygonOffset as d}from"../materials/PolygonOffset.js";import{VisualVariablePassParameters as h}from"../materials/VisualVariablePassParameters.js";import{C as g}from"../../../../chunks/ColorMaterial.glsl.js";import{makePipelineState as j,defaultColorWrite as b,cullingParams as P}from"../../../webgl/renderState.js";class C extends h{constructor(){super(...arguments),this.color=t}}let S=class extends l{constructor(e,r){super(e,r,i(T(r))),this.shader=new s(g,()=>import("./ColorMaterial.glsl.js")),this.ignoreUnused=!0}_createPipeline(e,r){const{output:t,transparent:i,cullFace:o,draped:s,hasOccludees:l}=e;return j({blending:i?p(t,!1,e.emissionDimmingPass):null,culling:P(o),depthTest:s?null:c(t),depthWrite:a(e),colorWrite:b,stencilWrite:l?f:null,stencilTest:l?r?m:u:null,polygonOffset:d(e)})}initializePipeline(e){return this._occludeePipelineState=this._createPipeline(e,!0),this._createPipeline(e,!1)}getPipeline(e,r){return r?this._occludeePipelineState:super.getPipeline(e)}};function T(e){const r=o().vec3f("position");return n()&&r.vec4u8("olidColor"),e.hasVVColor?r.f32("colorFeatureAttribute"):e.hasVertexColors&&r.vec4u8("color",{glNormalized:!0}),r.freeze()}S=e([r("esri.views.3d.webgl-engine.shaders.ColorMaterialTechnique")],S);export{C as ColorMaterialPassParameters,S as ColorMaterialTechnique,T as getLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as o}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{a as s}from"../../../../chunks/Compositing.glsl.js";import{makePipelineState as t,defaultColorWrite as n,premultipliedAlpha as c,unpremultipliedAlphaToPremultipliedAlpha as l}from"../../../webgl/renderState.js";let a=class extends i{constructor(){super(...arguments),this.shader=new o(s,()=>import("./Compositing.glsl.js")),this.ignoreUnused=!0}initializePipeline(e){const{blitMode:r}=e;switch(r){case 0:case 3:return t({colorWrite:n});case 1:return t({blending:l,colorWrite:n});default:return t({blending:c,colorWrite:n})}}};a=e([r("esri.views.3d.webgl-engine.shaders.CompositingTechnique")],a);export{a as CompositingTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as o}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{a as s}from"../../../../chunks/Compositing.glsl.js";import{makePipelineState as t,defaultColorWrite as n,premultipliedAlpha as c,unpremultipliedAlphaToPremultipliedAlpha as l}from"../../../webgl/renderState.js";let a=class extends i{constructor(){super(...arguments),this.shader=new o(s,()=>import("./Compositing.glsl.js"))}initializePipeline(e){const{blitMode:r}=e;switch(r){case 0:case 3:return t({colorWrite:n});case 1:return t({blending:l,colorWrite:n});default:return t({blending:c,colorWrite:n})}}};a=e([r("esri.views.3d.webgl-engine.shaders.CompositingTechnique")],a);export{a as CompositingTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as i,freeze as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as l}from"../../support/buffer/glUtil.js";import{newLayout as n}from"../../support/buffer/InterleavedLayout.js";import{VertexNormalPassParameters as a,VertexNormalDrawParameters as c}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as h}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as u}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as m}from"../effects/geometry/olidUtils.js";import{depthWrite as p,depthTest as d,blending as f}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as g,stencilBaseAllZerosParams as v,stencilWriteMaskOn as b}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as S}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as y}from"../materials/pbrUtils.js";import{polygonOffset as j}from"../materials/PolygonOffset.js";import{D as T}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as x,cullingParams as C,defaultColorWrite as P}from"../../../webgl/renderState.js";import{alphaCutoff as O}from"../../../../webscene/support/AlphaCutoff.js";class D extends a{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=y,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=i,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=s(.2,.2,.2),this.diffuse=s(.8,.8,.8),this.externalColor=o(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=r(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=O,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class V extends c{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}let w=class extends u{constructor(e,t){let i=l(z(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat(l(S(t)))),super(e,t,i),this.shader=new h(T,()=>import("./DefaultMaterial.glsl.js")),this.ignoreUnused=!0}_makePipeline(e,t){const{output:i,transparent:s,cullFace:r,customDepthTest:o,hasOccludees:l}=e;return x({blending:s?f(i):null,culling:M(e)?C(r):null,depthTest:d(i,A(o)),depthWrite:p(e),colorWrite:P,stencilWrite:l?b:null,stencilTest:l?t?g:v:null,polygonOffset:j(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function A(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function M(e){return 0!==e.cullFace||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}function z(e){const t=n().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&m()&&t.vec4u8("olidColor"),t}w=e([t("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],w);export{V as DefaultMaterialDrawParameters,D as DefaultMaterialPassParameters,w as DefaultMaterialTechnique,z as getLayout};
2
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as i,freeze as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as l}from"../../support/buffer/glUtil.js";import{newLayout as n}from"../../support/buffer/InterleavedLayout.js";import{VertexNormalPassParameters as a,VertexNormalDrawParameters as c}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as h}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as u}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as m}from"../effects/geometry/olidUtils.js";import{depthWrite as p,blending as d,depthTest as f}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as g,stencilBaseAllZerosParams as v,stencilWriteMaskOn as b}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as S}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as y}from"../materials/pbrUtils.js";import{polygonOffset as j}from"../materials/PolygonOffset.js";import{D as P}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as T,cullingParams as x,defaultColorWrite as C}from"../../../webgl/renderState.js";import{alphaCutoff as O}from"../../../../webscene/support/AlphaCutoff.js";class D extends a{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=y,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=i,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=s(.2,.2,.2),this.diffuse=s(.8,.8,.8),this.externalColor=o(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=r(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=O,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class V extends c{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}let w=class extends u{constructor(e,t){let i=l(z(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat(l(S(t)))),super(e,t,i),this.shader=new h(P,()=>import("./DefaultMaterial.glsl.js")),this.ignoreUnused=!0}_makePipeline(e,t){const{output:i,transparent:s,cullFace:r,customDepthTest:o,hasOccludees:l}=e;return T({blending:s?d(i,!1,e.emissionDimmingPass):null,culling:M(e)?x(r):null,depthTest:f(i,A(o)),depthWrite:p(e),colorWrite:C,stencilWrite:l?b:null,stencilTest:l?t?g:v:null,polygonOffset:j(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function A(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function M(e){return 0!==e.cullFace||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}function z(e){const t=n().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&m()&&t.vec4u8("olidColor"),t}w=e([t("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],w);export{V as DefaultMaterialDrawParameters,D as DefaultMaterialPassParameters,w as DefaultMaterialTechnique,z as getLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{glLayout as r}from"../../support/buffer/glUtil.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as l,depthTest as o,blending as n}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as p,stencilBaseAllZerosParams as a,stencilWriteMaskOn as c}from"../lib/StencilUtils.js";import{PositionUvLayout as m}from"../materials/DefaultLayouts.js";import{polygonOffset as u}from"../materials/PolygonOffset.js";import{I as d}from"../../../../chunks/ImageMaterial.glsl.js";import{makePipelineState as f,defaultColorWrite as h,cullingParams as g}from"../../../webgl/renderState.js";let j=class extends s{constructor(e,t){super(e,t,r(P(t))),this.shader=new i(d,()=>import("./ImageMaterial.glsl.js")),this.ignoreUnused=!0}_getPipelineState(e,t){const{output:r,hasOccludees:i,cullFace:s}=e;return f({blending:n(r,!0),culling:g(s),depthTest:o(r),depthWrite:l(e),colorWrite:h,stencilWrite:i?c:null,stencilTest:i?t?p:a:null,polygonOffset:u(e)})}initializePipeline(e){return this._occludeePipeline=this._getPipelineState(e,!0),this._getPipelineState(e,!1)}getPipeline(e,t){return t?this._occludeePipeline:super.getPipeline(e)}};function P(e){let t=m;return e.perspectiveInterpolation&&(t=t.clone().f32("perspectiveDivide")),t}j=e([t("esri.views.3d.webgl-engine.shaders.ImageMaterialTechnique")],j);export{j as ImageMaterialTechnique,P as getLayout};
2
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{glLayout as i}from"../../support/buffer/glUtil.js";import{ReloadableShader as r}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as l,depthTest as o,blending as n}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as a,stencilBaseAllZerosParams as p,stencilWriteMaskOn as c}from"../lib/StencilUtils.js";import{PositionUvLayout as m}from"../materials/DefaultLayouts.js";import{polygonOffset as u}from"../materials/PolygonOffset.js";import{I as d}from"../../../../chunks/ImageMaterial.glsl.js";import{makePipelineState as f,defaultColorWrite as g,cullingParams as h}from"../../../webgl/renderState.js";let j=class extends s{constructor(e,t){super(e,t,i(P(t))),this.shader=new r(d,()=>import("./ImageMaterial.glsl.js")),this.ignoreUnused=!0}_getPipelineState(e,t){const{output:i,hasOccludees:r,cullFace:s}=e;return f({blending:n(i,!0,e.emissionDimmingPass),culling:h(s),depthTest:o(i),depthWrite:l(e),colorWrite:g,stencilWrite:r?c:null,stencilTest:r?t?a:p:null,polygonOffset:u(e)})}initializePipeline(e){return this._occludeePipeline=this._getPipelineState(e,!0),this._getPipelineState(e,!1)}getPipeline(e,t){return t?this._occludeePipeline:super.getPipeline(e)}};function P(e){let t=m;return e.perspectiveInterpolation&&(t=t.clone().f32("perspectiveDivide")),t}j=e([t("esri.views.3d.webgl-engine.shaders.ImageMaterialTechnique")],j);export{j as ImageMaterialTechnique,P as getLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{glLayout as i}from"../../support/buffer/glUtil.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{ReloadableShader as l}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as n,depthTest as o,blending as c}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as p,stencilBaseAllZerosParams as u,stencilWriteMaskOn as a,stencilToolTransparentOccluderParams as d,depthCompareAlways as h,stencilToolMaskOccluderParams as f,stencilWriteMaskOff as m,depthCompareLess as P}from"../lib/StencilUtils.js";import{L as g}from"../../../../chunks/LineMarker.glsl.js";import{makePipelineState as T,defaultColorWrite as b,unpremultipliedAlphaToPremultipliedAlpha as W}from"../../../webgl/renderState.js";let _=class extends s{constructor(e,t){super(e,t,i(S(t))),this.shader=new l(g,()=>import("./LineMarker.glsl.js"))}_makePipelineState(e,t){const{output:i,space:r,hasOccludees:l}=e;return T({blending:c(i),depthTest:0===r?null:o(i),depthWrite:n(e),colorWrite:b,stencilWrite:l?a:null,stencilTest:l?t?p:u:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(e){return e.occluder?(this._occluderPipelineTransparent=T({blending:W,depthTest:h,depthWrite:null,colorWrite:b,stencilWrite:null,stencilTest:d}),this._occluderPipelineOpaque=T({blending:W,depthTest:h,depthWrite:null,colorWrite:b,stencilWrite:m,stencilTest:f}),this._occluderPipelineMaskWrite=T({blending:null,depthTest:P,depthWrite:null,colorWrite:null,stencilWrite:a,stencilTest:p})):this._occluderPipelineTransparent=this._occluderPipelineOpaque=this._occluderPipelineMaskWrite=null,this._occludeePipelineState=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:11===e.occluder?this._occluderPipelineTransparent??super.getPipeline(e):10===e.occluder?this._occluderPipelineOpaque??super.getPipeline(e):this._occluderPipelineMaskWrite??super.getPipeline(e)}};function S(e){const t=r().vec3f("position").vec4f16("previousDelta").vec2f16("uv0");return e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color",{glNormalized:!0}),e.hasVVOpacity&&t.f32("opacityFeatureAttribute"),e.hasVVSize?t.f32("sizeFeatureAttribute"):t.f16("size"),e.worldSpace&&t.vec3f16("normal"),t.freeze()}_=e([t("esri.views.3d.webgl-engine.shaders.LineMarkerTechnique")],_);export{_ as LineMarkerTechnique,S as getLayout};
2
+ import{__decorate as e}from"tslib";import{subclass as i}from"../../../../core/accessorSupport/decorators.js";import{glLayout as t}from"../../support/buffer/glUtil.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{ReloadableShader as l}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as n,depthTest as o,blending as c}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as p,stencilBaseAllZerosParams as u,stencilWriteMaskOn as a,stencilToolTransparentOccluderParams as d,depthCompareAlways as h,stencilToolMaskOccluderParams as m,stencilWriteMaskOff as f,depthCompareLess as P}from"../lib/StencilUtils.js";import{L as g}from"../../../../chunks/LineMarker.glsl.js";import{makePipelineState as T,defaultColorWrite as b,unpremultipliedAlphaToPremultipliedAlpha as W}from"../../../webgl/renderState.js";let _=class extends s{constructor(e,i){super(e,i,t(S(i))),this.shader=new l(g,()=>import("./LineMarker.glsl.js"))}_makePipelineState(e,i){const{output:t,space:r,hasOccludees:l}=e;return T({blending:c(t,!1,e.emissionDimmingPass),depthTest:0===r?null:o(t),depthWrite:n(e),colorWrite:b,stencilWrite:l?a:null,stencilTest:l?i?p:u:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(e){return e.occluder?(this._occluderPipelineTransparent=T({blending:W,depthTest:h,depthWrite:null,colorWrite:b,stencilWrite:null,stencilTest:d}),this._occluderPipelineOpaque=T({blending:W,depthTest:h,depthWrite:null,colorWrite:b,stencilWrite:f,stencilTest:m}),this._occluderPipelineMaskWrite=T({blending:null,depthTest:P,depthWrite:null,colorWrite:null,stencilWrite:a,stencilTest:p})):this._occluderPipelineTransparent=this._occluderPipelineOpaque=this._occluderPipelineMaskWrite=null,this._occludeePipelineState=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,i){return i?this._occludeePipelineState:11===e.occluder?this._occluderPipelineTransparent??super.getPipeline(e):10===e.occluder?this._occluderPipelineOpaque??super.getPipeline(e):this._occluderPipelineMaskWrite??super.getPipeline(e)}};function S(e){const i=r().vec3f("position").vec4f16("previousDelta").vec2f16("uv0");return e.hasVVColor?i.f32("colorFeatureAttribute"):i.vec4u8("color",{glNormalized:!0}),e.hasVVOpacity&&i.f32("opacityFeatureAttribute"),e.hasVVSize?i.f32("sizeFeatureAttribute"):i.f16("size"),e.worldSpace&&i.vec3f16("normal"),i.freeze()}_=e([i("esri.views.3d.webgl-engine.shaders.LineMarkerTechnique")],_);export{_ as LineMarkerTechnique,S as getLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{glLayout as o}from"../../support/buffer/glUtil.js";import{newLayout as t}from"../../support/buffer/InterleavedLayout.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{blending as n}from"../lib/OrderIndependentTransparency.js";import{polygonOffset as p}from"../materials/PolygonOffset.js";import{M as m}from"../../../../chunks/MeasurementArrow.glsl.js";import{PrimitiveType as l}from"../../../webgl/enums.js";import{makePipelineState as a,defaultColorWrite as f,defaultDepthWrite as u}from"../../../webgl/renderState.js";let c=class extends i{constructor(e,r){super(e,r,o(d)),this.shader=new s(m,()=>import("./MeasurementArrow.glsl.js")),this.primitiveType=l.TRIANGLE_STRIP}initializePipeline(e){const{output:r,transparent:o}=e;return a({blending:o?n(r):null,polygonOffset:p(e),depthTest:{func:513},depthWrite:u,colorWrite:f})}};c=e([r("esri.views.3d.webgl-engine.shaders.MeasurementArrowTechnique")],c);const d=t().vec3f("position").vec3f("normal").vec2f("uv0").f32("length");export{c as MeasurementArrowTechnique,d as layout};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{glLayout as s}from"../../support/buffer/glUtil.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{ReloadableShader as t}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{blending as n}from"../lib/OrderIndependentTransparency.js";import{polygonOffset as m}from"../materials/PolygonOffset.js";import{M as p}from"../../../../chunks/MeasurementArrow.glsl.js";import{PrimitiveType as l}from"../../../webgl/enums.js";import{makePipelineState as a,defaultColorWrite as f,defaultDepthWrite as u}from"../../../webgl/renderState.js";let c=class extends i{constructor(e,r){super(e,r,s(d)),this.shader=new t(p,()=>import("./MeasurementArrow.glsl.js")),this.primitiveType=l.TRIANGLE_STRIP}initializePipeline(e){const{output:r,transparent:s}=e;return a({blending:s?n(r,!1,e.emissionDimmingPass):null,polygonOffset:m(e),depthTest:{func:513},depthWrite:e.emissionDimmingPass?null:u,colorWrite:f})}};c=e([r("esri.views.3d.webgl-engine.shaders.MeasurementArrowTechnique")],c);const d=o().vec3f("position").vec3f("normal").vec2f("uv0").f32("length");export{c as MeasurementArrowTechnique,d as layout};
@@ -1,15 +1,15 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isColor as o,isOITColor as l,isOITFrontFace as r}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as a}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as i}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as s}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{If as e,glsl as t}from"../core/shaderModules/glsl.js";import{alphaCutoff as n}from"./alphaCutoff.glsl.js";import{ditherNoise as f}from"./ditherNoise.glsl.js";import{oitResolution as u}from"./oitResolution.glsl.js";function d(d,p){d.include(i,p),d.include(a,p);const{fragment:g,outputs:m}=d;g.include(s);const{output:c,hasEmission:C,discardInvisibleFragments:h,oitPremultipliedAlpha:v,snowCover:b,useFloatBlend:A}=p,$=11===c,j=l(c),y=r(c),E=o(c)&&!j;let O=0;(E||j)&&m.add("fragColor","vec4",O++),C&&m.add("fragEmission","vec4",O++),j&&m.add("fragAlpha","float",O++),g.include(n),g.include(u,p),g.include(f,p),g.code.add(t`
3
- void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${e(b,", float snow")}) {
4
- ${e($,"finalColor.a = 1.0;")}
5
- ${e(h,"if (finalColor.a < alphaCutoff) { discard; }")}
6
- ${e(j||C,"float noise = ditherNoise(finalColor);")}
2
+ import{isColor as o,isOITColor as l,isOITFrontFace as i}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as r}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as a}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as s}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{EmissionDimming as e}from"../core/shaderLibrary/util/EmissionDimming.glsl.js";import{If as t,glsl as n}from"../core/shaderModules/glsl.js";import{alphaCutoff as f}from"./alphaCutoff.glsl.js";import{ditherNoise as m}from"./ditherNoise.glsl.js";import{oitResolution as u}from"./oitResolution.glsl.js";function d(d,g){d.include(a,g),d.include(r,g);const{fragment:p,outputs:c}=d;p.include(s);const{output:C,hasEmission:h,discardInvisibleFragments:v,oitPremultipliedAlpha:b,snowCover:A,useFloatBlend:$,emissionDimmingPass:y}=g,E=11===C,j=l(C),O=i(C),L=o(C)&&!j;let S=0;(L||j)&&c.add("fragColor","vec4",S++),h&&c.add("fragEmission","vec4",S++),j&&c.add("fragAlpha","float",S++),p.include(f),p.include(u,g),p.include(m,g),y&&p.include(e),p.code.add(n`
3
+ void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${t(A,", float snow")}) {
4
+ ${t(E,"finalColor.a = 1.0;")}
5
+ ${t(v,"if (finalColor.a < alphaCutoff) { discard; }")}
6
+ ${t(j||h,"float noise = ditherNoise(finalColor);")}
7
7
 
8
- ${e(j,`fragColor = ${e(v,"finalColor","premultiplyAlpha(finalColor)")};\n fragColor = vec4(fragColor.rgb * floatBlendOutputScale + noise, fragColor.a);\n float scaledAlpha = finalColor.a * floatBlendOutputScale;\n fragAlpha = scaledAlpha + noise;\n ${e(!A,"fragAlpha = fragAlpha < alphaCutoff ? scaledAlpha : fragAlpha;")}`)}
9
- ${e(y&&v&&h,"finalColor.rgb /= finalColor.a;")}
10
- ${e(E,"fragColor = finalColor;")}
11
- ${e(C,`fragEmission = ${e(b,"mix(finalColor.a * getEmissions(emissiveSymbolColor), vec4(0.0), snow);","finalColor.a * getEmissions(emissiveSymbolColor);")}\n fragEmission = vec4(fragEmission.rgb * floatBlendOutputScale + noise, fragEmission.a);`)}
8
+ ${t(j,`fragColor = ${t(b,"finalColor","premultiplyAlpha(finalColor)")};\n fragColor = vec4(fragColor.rgb * floatBlendOutputScale + noise, fragColor.a);\n float scaledAlpha = finalColor.a * floatBlendOutputScale;\n fragAlpha = scaledAlpha + noise;\n ${t(!$,"fragAlpha = fragAlpha < alphaCutoff ? scaledAlpha : fragAlpha;")}`)}
9
+ ${t(O&&b&&v,"finalColor.rgb /= finalColor.a;")}
10
+ ${t(L,"fragColor = finalColor;")}
11
+ ${t(h,y?"fragEmission = vec4(emissionDimming(premultiplyAlpha(finalColor).rgb, finalColor.a), 0.0);":`fragEmission = ${t(A,"mix(finalColor.a * getEmissions(emissiveSymbolColor), vec4(0.0), snow);","finalColor.a * getEmissions(emissiveSymbolColor);")}\n fragEmission = vec4(fragEmission.rgb * floatBlendOutputScale + noise, fragEmission.a);`)}
12
12
  calculateOcclusionAndOutputHighlight();
13
- ${e($,"outputObjectAndLayerIdColor();")}
13
+ ${t(E,"outputObjectAndLayerIdColor();")}
14
14
  }
15
15
  `)}export{d as outputColorHighlightOLID};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{glLayout as i}from"../../support/buffer/glUtil.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{ReloadableShader as l}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{depthWrite as o,depthTest as c,blending as u}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as p,stencilBaseAllZerosParams as a,stencilWriteMaskOn as d,stencilToolTransparentOccluderParams as f,depthCompareAlways as m,stencilToolMaskOccluderParams as h,stencilWriteMaskOff as g,depthCompareLess as b}from"../lib/StencilUtils.js";import{getRibbonLineLayerPolygonOffset as P}from"../materials/PolygonOffset.js";import{R as T}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as W}from"../../../webgl/enums.js";import{makePipelineState as j,defaultColorWrite as v,unpremultipliedAlphaToPremultipliedAlpha as S}from"../../../webgl/renderState.js";let _=class extends s{constructor(e,t){super(e,t,i(y(t))),this.shader=new l(T,()=>import("./RibbonLine.glsl.js")),this.ignoreUnused=!0,this.primitiveType=t.wireframe?W.LINES:W.TRIANGLE_STRIP}_makePipelineState(e,t){const{output:i,hasOccludees:r}=e;return j({blending:u(i),depthTest:c(i),depthWrite:o(e),colorWrite:v,stencilWrite:r?d:null,stencilTest:r?t?p:a:null,polygonOffset:P(e)})}initializePipeline(e){if(e.occluder){const{hasOccludees:t}=e;this._occluderPipelineTransparent=j({blending:S,polygonOffset:P(e),depthTest:m,depthWrite:null,colorWrite:v,stencilWrite:null,stencilTest:t?f:null}),this._occluderPipelineOpaque=j({blending:S,polygonOffset:P(e),depthTest:t?m:b,depthWrite:null,colorWrite:v,stencilWrite:t?g:null,stencilTest:t?h:null}),this._occluderPipelineMaskWrite=j({blending:null,polygonOffset:P(e),depthTest:b,depthWrite:null,colorWrite:null,stencilWrite:t?d:null,stencilTest:t?p:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(t)return this._occludeePipeline;switch(e.occluder){case 11:return this._occluderPipelineTransparent??super.getPipeline(e);case 10:return this._occluderPipelineOpaque??super.getPipeline(e);default:e.occluder;case void 0:case null:return this._occluderPipelineMaskWrite??super.getPipeline(e)}}};function y(e){const t=r().vec3f("position").vec4f16("previousDelta").vec4f16("nextDelta").f32("u0").vec2f16("lineParameters");return e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color",{glNormalized:!0}),e.hasVVSize?t.f32("sizeFeatureAttribute"):t.f32("size"),e.hasVVOpacity&&t.f32("opacityFeatureAttribute"),n()&&t.vec4u8("olidColor"),e.hasAnimation&&t.vec4f16("timeStamps"),t}_=e([t("esri.views.3d.webgl-engine.shaders.RibbonLineTechnique")],_);export{_ as RibbonLineTechnique,y as getLayout};
2
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{glLayout as i}from"../../support/buffer/glUtil.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{ReloadableShader as l}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{depthWrite as o,depthTest as c,blending as u}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as p,stencilBaseAllZerosParams as a,stencilWriteMaskOn as d,stencilToolTransparentOccluderParams as f,depthCompareAlways as m,stencilToolMaskOccluderParams as h,stencilWriteMaskOff as g,depthCompareLess as b}from"../lib/StencilUtils.js";import{getRibbonLineLayerPolygonOffset as P}from"../materials/PolygonOffset.js";import{R as T}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as W}from"../../../webgl/enums.js";import{makePipelineState as j,defaultColorWrite as v,unpremultipliedAlphaToPremultipliedAlpha as S}from"../../../webgl/renderState.js";let _=class extends s{constructor(e,t){super(e,t,i(y(t))),this.shader=new l(T,()=>import("./RibbonLine.glsl.js")),this.ignoreUnused=!0,this.primitiveType=t.wireframe?W.LINES:W.TRIANGLE_STRIP}_makePipelineState(e,t){const{output:i,hasOccludees:r}=e;return j({blending:u(i,!1,e.emissionDimmingPass),depthTest:c(i),depthWrite:o(e),colorWrite:v,stencilWrite:r?d:null,stencilTest:r?t?p:a:null,polygonOffset:P(e)})}initializePipeline(e){if(e.occluder){const{hasOccludees:t}=e;this._occluderPipelineTransparent=j({blending:S,polygonOffset:P(e),depthTest:m,depthWrite:null,colorWrite:v,stencilWrite:null,stencilTest:t?f:null}),this._occluderPipelineOpaque=j({blending:S,polygonOffset:P(e),depthTest:t?m:b,depthWrite:null,colorWrite:v,stencilWrite:t?g:null,stencilTest:t?h:null}),this._occluderPipelineMaskWrite=j({blending:null,polygonOffset:P(e),depthTest:b,depthWrite:null,colorWrite:null,stencilWrite:t?d:null,stencilTest:t?p:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(t)return this._occludeePipeline;switch(e.occluder){case 11:return this._occluderPipelineTransparent??super.getPipeline(e);case 10:return this._occluderPipelineOpaque??super.getPipeline(e);default:e.occluder;case void 0:case null:return this._occluderPipelineMaskWrite??super.getPipeline(e)}}};function y(e){const t=r().vec3f("position").vec4f16("previousDelta").vec4f16("nextDelta").f32("u0").vec2f16("lineParameters");return e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color",{glNormalized:!0}),e.hasVVSize?t.f32("sizeFeatureAttribute"):t.f32("size"),e.hasVVOpacity&&t.f32("opacityFeatureAttribute"),n()&&t.vec4u8("olidColor"),e.hasAnimation&&t.vec4f16("timeStamps"),t}_=e([t("esri.views.3d.webgl-engine.shaders.RibbonLineTechnique")],_);export{_ as RibbonLineTechnique,y as getLayout};