@arcgis/core 5.1.0-next.87 → 5.1.0-next.88

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 (190) hide show
  1. package/Graphic.js +1 -1
  2. package/analysis/LineOfSightAnalysisObserver.d.ts +2 -2
  3. package/analysis/LineOfSightAnalysisTarget.d.ts +2 -2
  4. package/applications/Components/arcadeUtils.d.ts +23 -0
  5. package/applications/Components/arcadeUtils.js +2 -0
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/00e9e25269d5776f8645.js +1 -0
  8. package/assets/esri/core/workers/chunks/015fc0a17b17d69cc3bb.js +1 -0
  9. package/assets/esri/core/workers/chunks/0a6df243b18acae471be.js +1 -0
  10. package/assets/esri/core/workers/chunks/0cc4b3100a7a453bd058.js +1 -0
  11. package/assets/esri/core/workers/chunks/10cf6a70bf79f04a7208.js +1 -0
  12. package/assets/esri/core/workers/chunks/169ca3724053fc046d1b.js +1 -0
  13. package/assets/esri/core/workers/chunks/206bdfd868a9ef88f3a8.js +1 -0
  14. package/assets/esri/core/workers/chunks/2343b1105bc4c1b4a086.js +1 -0
  15. package/assets/esri/core/workers/chunks/{f89b7b0ccfbd1e5f9a0f.js → 3092184350d66c79f610.js} +1 -1
  16. package/assets/esri/core/workers/chunks/3469df5c4846b0cee012.js +1 -0
  17. package/assets/esri/core/workers/chunks/{26f804c92077c11c626d.js → 394812e19b6915d560b0.js} +1 -1
  18. package/assets/esri/core/workers/chunks/3feec3d08424b94e1bcf.js +1 -0
  19. package/assets/esri/core/workers/chunks/{ce4dfc3a470230ddc9e4.js → 43f58604ba4a94a9167c.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{ff57a071156d8a7e47be.js → 456d269e3982c437010a.js} +1 -1
  21. package/assets/esri/core/workers/chunks/46b16501db6681dc467b.js +1 -0
  22. package/assets/esri/core/workers/chunks/48549d3d7bf0154c0afa.js +1 -0
  23. package/assets/esri/core/workers/chunks/{713ab619060bd5087479.js → 4baf66314f82cfa76beb.js} +182 -157
  24. package/assets/esri/core/workers/chunks/{1ab66600579fa4232d7b.js → 4dc91c2208201ba34c90.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{b14c4c3f295970f731ab.js → 500be1fb7cc9efec875c.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{fc6ca7ffb9f1b875059c.js → 51716e411fad624ac21c.js} +1 -1
  27. package/assets/esri/core/workers/chunks/54c035cdc171998d0776.js +1 -0
  28. package/assets/esri/core/workers/chunks/{b23e677c33db6f9bac8a.js → 566f6319ded0634769e0.js} +1 -1
  29. package/assets/esri/core/workers/chunks/752f4e0e2961fc315dca.js +1 -0
  30. package/assets/esri/core/workers/chunks/7ba67f1d7831a5576a5a.js +1 -0
  31. package/assets/esri/core/workers/chunks/{186bfde8c552e3b42302.js → 7ef51b0ebd560113ae7e.js} +1 -1
  32. package/assets/esri/core/workers/chunks/7f0f10946f05a09b5654.js +1 -0
  33. package/assets/esri/core/workers/chunks/{fce2306a1b31c6680f90.js → 7f34fa9f154f5101cb13.js} +1 -1
  34. package/assets/esri/core/workers/chunks/8178e9ba3c568d406a87.js +1 -0
  35. package/assets/esri/core/workers/chunks/83f1871d04c979fa23b7.js +1 -0
  36. package/assets/esri/core/workers/chunks/85da2987e17b6755a94e.js +1 -0
  37. package/assets/esri/core/workers/chunks/8a5a827ee557d9f9a66e.js +1 -0
  38. package/assets/esri/core/workers/chunks/9c09097e390985bbac58.js +1 -0
  39. package/assets/esri/core/workers/chunks/a432219de6a873f88776.js +1 -0
  40. package/assets/esri/core/workers/chunks/{455d08294e0f5c5509ff.js → a6b75576d598ec161cc4.js} +1 -1
  41. package/assets/esri/core/workers/chunks/b2662bfdbd1e3623ceb9.js +1 -0
  42. package/assets/esri/core/workers/chunks/b4bac22467e96be7a974.js +1 -0
  43. package/assets/esri/core/workers/chunks/{5166f204fd078dced5db.js → baea6f86b2dbe067940e.js} +1 -1
  44. package/assets/esri/core/workers/chunks/c3e89c7c7b677bd18557.js +1 -0
  45. package/assets/esri/core/workers/chunks/cb81d524f12edcadb9bb.js +1 -0
  46. package/assets/esri/core/workers/chunks/cc0f3b9b153a0c232afe.js +1 -0
  47. package/assets/esri/core/workers/chunks/cd0c232f4e3868d91a05.js +1 -0
  48. package/assets/esri/core/workers/chunks/{9bd713d96502ddc2ce25.js → d8ccc713c5ad93e7a0c3.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{e66b9d00d02fc08cbb2d.js → da008d6a3afb30d18392.js} +1 -1
  50. package/assets/esri/core/workers/chunks/dde94664110ff231a52d.js +1 -0
  51. package/assets/esri/core/workers/chunks/de3e5d82502ee15b7eae.js +1 -0
  52. package/assets/esri/core/workers/chunks/e6fe8b5fbe95de01453b.js +1 -0
  53. package/assets/esri/core/workers/chunks/ee7e9bca57160694b3c4.js +1 -0
  54. package/assets/esri/core/workers/chunks/f36345ebb9851ab92453.js +1 -0
  55. package/assets/esri/core/workers/chunks/{c503c79ba5761f7abbeb.js → fa869bfe4366f7f49cca.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{d8de7fe49dba9ed589df.js → fade7b878a9498382bb2.js} +1 -1
  57. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  58. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  59. package/assets/esri/libs/text/pkg/bundle_bg.wasm +0 -0
  60. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
  61. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bg.json +1 -1
  62. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bs.json +1 -1
  63. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ca.json +1 -1
  64. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_cs.json +1 -1
  65. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_da.json +1 -1
  66. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_de.json +1 -1
  67. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_el.json +1 -1
  68. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_es.json +1 -1
  69. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_et.json +1 -1
  70. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fi.json +1 -1
  71. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fr.json +1 -1
  72. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_he.json +1 -1
  73. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hr.json +1 -1
  74. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hu.json +1 -1
  75. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_id.json +1 -1
  76. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_it.json +1 -1
  77. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ja.json +1 -1
  78. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ko.json +1 -1
  79. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lt.json +1 -1
  80. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lv.json +1 -1
  81. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_nl.json +1 -1
  82. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_no.json +1 -1
  83. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pl.json +1 -1
  84. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-BR.json +1 -1
  85. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-PT.json +1 -1
  86. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ro.json +1 -1
  87. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ru.json +1 -1
  88. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sk.json +1 -1
  89. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sl.json +1 -1
  90. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sr.json +1 -1
  91. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sv.json +1 -1
  92. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_th.json +1 -1
  93. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_tr.json +1 -1
  94. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_uk.json +1 -1
  95. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_vi.json +1 -1
  96. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-CN.json +1 -1
  97. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-HK.json +1 -1
  98. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-TW.json +1 -1
  99. package/chunks/GlobalIllumination.glsl.js +25 -17
  100. package/chunks/GlowBlur.glsl.js +11 -8
  101. package/chunks/OITBlend.glsl.js +1 -1
  102. package/chunks/bundle2.js +1 -1
  103. package/config.js +1 -1
  104. package/core/has.js +1 -1
  105. package/interfaces.d.ts +0 -3
  106. package/kernel.js +1 -1
  107. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  108. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  109. package/layers/graphics/data/QueryEngineResult.js +1 -1
  110. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  111. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  112. package/layers/mixins/ArcGISImageService.js +1 -1
  113. package/layers/support/SubtypeSublayer.js +1 -1
  114. package/layers/support/capabilities.js +1 -1
  115. package/layers/support/layerUtils.js +1 -1
  116. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  117. package/networks/CircuitManager.d.ts +33 -25
  118. package/networks/CircuitManager.js +1 -1
  119. package/networks/support/typeUtils.d.ts +4 -1
  120. package/networks/support/typeUtils.js +1 -1
  121. package/package.json +1 -1
  122. package/renderers/ClassBreaksRenderer.js +1 -1
  123. package/renderers/UniqueValueRenderer.js +1 -1
  124. package/renderers/support/scaleDependentSymbolUtils.js +2 -0
  125. package/rest/networks/circuits/queryCircuits.js +1 -1
  126. package/rest/networks/circuits/support/QueryCircuitsParameters.d.ts +21 -15
  127. package/rest/networks/circuits/support/QueryCircuitsParameters.js +1 -1
  128. package/rest/query/operations/query.js +1 -1
  129. package/rest/support/Query.js +1 -1
  130. package/support/revision.js +1 -1
  131. package/third-party-notices.txt +19 -12
  132. package/views/2d/engine/webgl/GlyphSDFCreator.js +1 -1
  133. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  134. package/views/3d/analysis/LineOfSight/LineOfSightAuthoringStore.js +2 -0
  135. package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +2 -0
  136. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  137. package/views/3d/analysis/LineOfSight/LineOfSightDrawToolRenderer.js +2 -0
  138. package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +2 -0
  139. package/views/3d/analysis/LineOfSight/LineOfSightPlacementTool.js +2 -0
  140. package/views/3d/analysis/LineOfSight/LineOfSightRootPlugin.js +2 -0
  141. package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +2 -0
  142. package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
  143. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  144. package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
  145. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  146. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +149 -0
  147. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +2 -2
  148. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  149. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  150. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +1 -1
  151. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  152. package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
  153. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  154. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  155. package/webmap/utils.js +1 -1
  156. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  157. package/assets/esri/core/workers/chunks/0c074c46d106ca4d3bad.js +0 -1
  158. package/assets/esri/core/workers/chunks/1f16bc8c02d8c4b2f693.js +0 -1
  159. package/assets/esri/core/workers/chunks/29878b52aa12b3815230.js +0 -1
  160. package/assets/esri/core/workers/chunks/2c916b93d8a6e6b9c0d7.js +0 -1
  161. package/assets/esri/core/workers/chunks/3ea5a18b264628dc37f0.js +0 -1
  162. package/assets/esri/core/workers/chunks/41913575dd45c65d645e.js +0 -1
  163. package/assets/esri/core/workers/chunks/46e622857ba92a72a317.js +0 -1
  164. package/assets/esri/core/workers/chunks/49e8144effc299dfcd66.js +0 -1
  165. package/assets/esri/core/workers/chunks/4d0f793dee4ad919221b.js +0 -1
  166. package/assets/esri/core/workers/chunks/65ac73de5bb133c6bf89.js +0 -1
  167. package/assets/esri/core/workers/chunks/67ec1694d6e18b7c234c.js +0 -1
  168. package/assets/esri/core/workers/chunks/6e526c06825ecc6c99c0.js +0 -1
  169. package/assets/esri/core/workers/chunks/6f7aaba26773fe416ac2.js +0 -1
  170. package/assets/esri/core/workers/chunks/7acf82763aeba44049d0.js +0 -1
  171. package/assets/esri/core/workers/chunks/88eb1e4320c4ada01711.js +0 -1
  172. package/assets/esri/core/workers/chunks/8af9a78cf316581ea482.js +0 -1
  173. package/assets/esri/core/workers/chunks/96bba4d93a32ad34a1c8.js +0 -1
  174. package/assets/esri/core/workers/chunks/97719271a3e4c9f2b2c9.js +0 -1
  175. package/assets/esri/core/workers/chunks/9ea23cd4b2664c08b670.js +0 -1
  176. package/assets/esri/core/workers/chunks/a1a12552d34ea9eea130.js +0 -1
  177. package/assets/esri/core/workers/chunks/ac5999c88c27b49cd760.js +0 -1
  178. package/assets/esri/core/workers/chunks/b575292013bceef9b015.js +0 -1
  179. package/assets/esri/core/workers/chunks/bbc27d9285162696d089.js +0 -1
  180. package/assets/esri/core/workers/chunks/bc8a74da48b08309875f.js +0 -1
  181. package/assets/esri/core/workers/chunks/cd7159600ce132e32d04.js +0 -1
  182. package/assets/esri/core/workers/chunks/ce66c551b7083913eee5.js +0 -1
  183. package/assets/esri/core/workers/chunks/cf7acf5acb6d322fd996.js +0 -1
  184. package/assets/esri/core/workers/chunks/d9c3f14eee4db7a7137b.js +0 -1
  185. package/assets/esri/core/workers/chunks/db3c484bfa607dec6050.js +0 -1
  186. package/assets/esri/core/workers/chunks/dcc719e15b2e0cce1f3b.js +0 -1
  187. package/assets/esri/core/workers/chunks/f43d628d47eec7d530c7.js +0 -1
  188. package/assets/esri/core/workers/chunks/fae147d03ed723ab234d.js +0 -1
  189. package/assets/esri/core/workers/chunks/fcf51697c361e0075cc2.js +0 -1
  190. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +0 -132
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../../../core/has.js";import{property as t,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{AnalysisToolBase as o}from"../../../interactive/AnalysisToolBase.js";const r={ready:"ready",creating:"creating",created:"created"};let a=class extends o{constructor(e){super(e),this.analysisViewData=null,this.removeIncompleteOnCancel=!1}get state(){return this.active?r.creating:null!=this.analysis.observer?.position?r.created:r.ready}place(e){return this.analysisViewData.interactive=!0,Promise.reject(new Error("not implemented"))}activate(){throw this.view.activeTool=null,new Error("not implemented")}deactivate(){this.onDeactivate()}continue(){throw new Error("not implemented")}stop(){this.view.activeTool=null}get testInfo(){}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}};e([t({constructOnly:!0})],a.prototype,"view",void 0),e([t({constructOnly:!0})],a.prototype,"analysis",void 0),e([t({constructOnly:!0})],a.prototype,"analysisViewData",void 0),e([t()],a.prototype,"state",null),e([t()],a.prototype,"removeIncompleteOnCancel",void 0),a=e([i("esri.views.3d.analysis.LineOfSight.LineOfSightTool2")],a);export{a as LineOfSightTool2};
2
+ import{__decorate as t}from"tslib";import"../../../../core/has.js";import{onAbort as e}from"../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as i,on as s}from"../../../../core/reactiveUtils.js";import{property as a,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{LineOfSightAuthoringStore as n}from"./LineOfSightAuthoringStore.js";import{LineOfSightPlacementTool as l}from"./LineOfSightPlacementTool.js";import{ExclusiveOperationManager as c}from"../../../analysis/ExclusiveOperationManager.js";import{AnalysisToolBase as p}from"../../../interactive/AnalysisToolBase.js";const h={ready:"ready",created:"created"};let m=class extends p{constructor(t){super(t),this._authoringStore=new n,this._operationManager=new c,this.analysisViewData=null,this.removeIncompleteOnCancel=!1,this._placementTool=new l({...t,authoringStore:this._authoringStore,parent:this})}get active(){return this._placementTool.active}get state(){return this._placementTool.active?this._placementTool.state:null!=this.analysis.observer?.position?h.created:h.ready}get cursor(){return this._placementTool.cursor}get updating(){return this._placementTool.updating}initialize(){this.view.tools.add(this._placementTool),this.addHandles(o(()=>this.editable,t=>{this.analysisViewData.editable=t},i))}destroy(){this._operationManager.destroy(),this._placementTool.stop(),this.view.tools.remove(this._placementTool),this._placementTool.destroy()}place(t){return this.analysisViewData.interactive=!0,this._operationManager.start("place",async(t,a)=>{const r=this.analysis.clone();let n=!1,l=!1;const c=()=>{l||(l=!0,this.stop(),a.aborted||!this.analysis.valid||this.analysis.equals(r)?t.reject():t.resolve({}))};t.handles.push(e(a,()=>this.stop()),s(()=>this._placementTool,"cancel",()=>c()),o(()=>this._placementTool.active,t=>{t?n=!0:n&&c()},i)),this.resetCreated(),this.continue()},t)}activate(){this.view.focus(),this.continue()}deactivate(){this.onDeactivate()}continue(){this._placementTool.continue()}stop(){this._placementTool.stop(),this.view.activeTool===this&&(this.view.activeTool=null)}resetCreated(){this._placementTool.resetCreated()}get testInfo(){}};t([a({constructOnly:!0})],m.prototype,"view",void 0),t([a({constructOnly:!0})],m.prototype,"analysis",void 0),t([a({constructOnly:!0})],m.prototype,"analysisViewData",void 0),t([a()],m.prototype,"active",null),t([a()],m.prototype,"state",null),t([a()],m.prototype,"cursor",null),t([a()],m.prototype,"updating",null),t([a()],m.prototype,"removeIncompleteOnCancel",void 0),m=t([r("esri.views.3d.analysis.LineOfSight.LineOfSightTool2")],m);export{m as LineOfSightTool2};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import i from"../../../core/Collection.js";import s from"../../../core/Error.js";import has from"../../../core/has.js";import{abortMaybe as e,destroyMaybe as o}from"../../../core/maybe.js";import{property as r,subclass as n}from"../../../core/accessorSupport/decorators.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"./AnalysisView3D.js";import{LineOfSightController as p}from"./LineOfSight/LineOfSightController.js";import{LineOfSightTool as u}from"./LineOfSight/LineOfSightTool.js";import{LineOfSightTool2 as h}from"./LineOfSight/LineOfSightTool2.js";import{LineOfSightVisualization as y}from"./LineOfSight/LineOfSightVisualization.js";import{connectAnalysisViewToTool as c,removeAnalysisViewTool as g,startPlaceOperation as f}from"../../analysis/analysisViewUtils.js";function m(){return has("enable-feature:analysis-drawtool-line-of-sight")??!1}function d(){return m()?h:u}let v=class extends a{constructor(t){super(t),this.type="line-of-sight-view-3d",this.analysis=null,this.tool=null,this.computations=new i,this.cursorTarget=null,this.editable=!0,this.elevationAlignedObserver=null,this.observerEngineLocation=l(),this.userOperation=null}initialize(){const t=this.view,i=this.analysis;this._analysisController=new p({analysis:i,analysisViewData:this,view:t}),this._analysisVisualization=new y({analysis:i,analysisViewData:this,view:t,isDecoration:!this.parent}),this.addHandles([this._analysisController.on("result-changed",t=>{t.target!==this.cursorTarget&&this.emit("result-changed",t)}),c(this,d())])}destroy(){g(this),this.userOperation=e(this.userOperation),this._analysisController=o(this._analysisController),this._analysisVisualization=o(this._analysisVisualization)}get visible(){return super.visible}set visible(t){super.visible=t}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get results(){return this.computations.map(t=>t.result)}get priority(){return this._analysisController.priority}set priority(t){this._analysisController.priority=t}get updating(){return null!=this._analysisController&&this._analysisController.updating||null!=this._analysisVisualization&&this._analysisVisualization.updating}place(t){if(m()){if(null==this.tool||null==this.tool.place)throw new s("LineOfSightAnalysisView3D:place","LineOfSightTool with placement support is not available");return this.tool.place(t)}return f(this,{placementOptions:t})}getResultForTarget(t){return this.computations.find(i=>i.target===t)?.result}get testInfo(){}};t([r({readOnly:!0})],v.prototype,"type",void 0),t([r({constructOnly:!0,nonNullable:!0})],v.prototype,"analysis",void 0),t([r()],v.prototype,"tool",void 0),t([r({readOnly:!0})],v.prototype,"results",null),t([r()],v.prototype,"priority",null),t([r()],v.prototype,"computations",void 0),t([r()],v.prototype,"cursorTarget",void 0),t([r()],v.prototype,"editable",void 0),t([r()],v.prototype,"elevationAlignedObserver",void 0),t([r()],v.prototype,"observerEngineLocation",void 0),t([r()],v.prototype,"updating",null),t([r()],v.prototype,"userOperation",void 0),t([r()],v.prototype,"_analysisController",void 0),t([r()],v.prototype,"_analysisVisualization",void 0),v=t([n("esri.views.3d.analysis.LineOfSightAnalysisView3D")],v);const O=v;export{O as default};
2
+ import{__decorate as t}from"tslib";import i from"../../../core/Collection.js";import s from"../../../core/Error.js";import has from"../../../core/has.js";import{abortMaybe as e,destroyMaybe as o}from"../../../core/maybe.js";import{property as r,subclass as n}from"../../../core/accessorSupport/decorators.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"./AnalysisView3D.js";import{LineOfSightController as p}from"./LineOfSight/LineOfSightController.js";import{LineOfSightTool as u}from"./LineOfSight/LineOfSightTool.js";import{LineOfSightTool2 as h}from"./LineOfSight/LineOfSightTool2.js";import{LineOfSightVisualization as y}from"./LineOfSight/LineOfSightVisualization.js";import{connectAnalysisViewToTool as c,removeAnalysisViewTool as g,startPlaceOperation as f}from"../../analysis/analysisViewUtils.js";function m(){return has("enable-feature:analysis-drawtool-line-of-sight")??!1}function d(){return m()?h:u}let v=class extends l{constructor(t){super(t),this.type="line-of-sight-view-3d",this.analysis=null,this.tool=null,this.computations=new i,this.cursorTarget=null,this.editable=!0,this.elevationAlignedObserver=null,this.observerEngineLocation=a(),this.userOperation=null}initialize(){const t=this.view,i=this.analysis;this._analysisController=new p({analysis:i,analysisViewData:this,view:t}),this._analysisVisualization=new y({analysis:i,analysisViewData:this,view:t,isDecoration:!this.parent}),this.addHandles([this._analysisController.on("result-changed",t=>{t.target!==this.cursorTarget&&this.emit("result-changed",t)}),c(this,d())])}destroy(){g(this),this.userOperation=e(this.userOperation),this._analysisController=o(this._analysisController),this._analysisVisualization=o(this._analysisVisualization)}get visible(){return super.visible}set visible(t){super.visible=t}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get results(){return this.computations.map(t=>t.result)}get priority(){return this._analysisController.priority}set priority(t){this._analysisController.priority=t}get updating(){return null!=this._analysisController&&this._analysisController.updating||null!=this._analysisVisualization&&this._analysisVisualization.updating}place(t){if(m()){if(this.interactive=!0,null==this.tool||null==this.tool.place)throw new s("LineOfSightAnalysisView3D:place","LineOfSightTool with placement support is not available");return this.tool.place(t)}return f(this,{placementOptions:t})}getResultForTarget(t){return this.computations.find(i=>i.target===t)?.result}get testInfo(){}};t([r({readOnly:!0})],v.prototype,"type",void 0),t([r({constructOnly:!0,nonNullable:!0})],v.prototype,"analysis",void 0),t([r()],v.prototype,"tool",void 0),t([r({readOnly:!0})],v.prototype,"results",null),t([r()],v.prototype,"priority",null),t([r()],v.prototype,"computations",void 0),t([r()],v.prototype,"cursorTarget",void 0),t([r()],v.prototype,"editable",void 0),t([r()],v.prototype,"elevationAlignedObserver",void 0),t([r()],v.prototype,"observerEngineLocation",void 0),t([r()],v.prototype,"updating",null),t([r()],v.prototype,"userOperation",void 0),t([r()],v.prototype,"_analysisController",void 0),t([r()],v.prototype,"_analysisVisualization",void 0),v=t([n("esri.views.3d.analysis.LineOfSightAnalysisView3D")],v);const O=v;export{O as default};
@@ -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/Error.js";import{makeHandle as i}from"../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../core/maybe.js";import s from"../../../core/ReactiveMap.js";import{property as n,subclass as l}from"../../../core/accessorSupport/decorators.js";import{projectAsync as h}from"../../../geometry/projectionUtils.js";import{hydrateGraphic as a}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as o,hasTimeOptions as p}from"../../../layers/support/timeSupport.js";import u from"../../../rest/support/AttributeBinsQuery.js";import g from"../../../rest/support/Query.js";import{isGraphic as y}from"../../../support/graphicInstanceUtils.js";import{LayerView3D as c}from"./LayerView3D.js";import{attributeLookup as d}from"./support/attributeUtils.js";import{normalizeHighlightTarget as m,emptyHighlightHandle as f,isObjectId as P}from"./support/highlightUtils.js";import{RefreshableLayerView as b}from"../../layers/RefreshableLayerView.js";import{getHighlightName as v}from"../../support/highlightOptionsUtils.js";import{hasLayerBasedScaleVisibility as w,isInEffectiveScaleRange as I}from"../../support/layerViewUtils.js";const _=_=>{const j=b(c(_));let S=class extends j{constructor(){super(...arguments),this.updatePolicy=1,this.slicePlaneEnabled=!1,this._highlightCounter=new s,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){const e=this.layer;"isTable"in e&&e.isTable?this.addResolvingPromise(Promise.reject(new t("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e}))):(this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference="local"===this.view.viewingMode?await h(this.layer.fullExtent,this.view.spatialReference).catch(()=>null):null;const e=await this.createGraphicsPipeline();this.destroyed?e.destroy():(this.graphicsPipeline=e,await e.when())})()),this.notifyChange("updating"))}destroy(){this.graphicsPipeline=r(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return w()?I(this.layer.effectiveScaleRange,this.view.scale):!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return o(p(this.layer)?this.layer:null,this.view?.timeExtent,this._get("timeExtent"))}get highlightIds(){return Array.from(this._highlightCounter.keys())}get hasHighlight(){return this.highlightIds.length>0}getHit(e,t){const i=this.graphicsPipeline.findGraphic(t=>t.uid===e);if(null==i)return null;const r=a(i,this.layer,this.layer.graphicOrigin);return{type:"graphic",graphic:r,layer:r.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.graphicsQuery.queryForSymbologySnapping(e,t)}queryAggregates(e,t){throw new Error("missing implementation")}queryFeatures(e,t){return this.graphicsPipeline.graphicsQuery.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryAttributeBins(e,t){return this.graphicsPipeline.graphicsQuery.executeAttributeBinsQuery(this._ensureAttributeBinsQuery(e),t?.signal)}queryExtent(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return null==e?this.createQuery():g.from(e)}_ensureAttributeBinsQuery(e){const t=u.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}_addHighlightIds(e){this._highlightCounter.batch(()=>{for(const t of e){const e=this._highlightCounter.get(t)??0;this._highlightCounter.set(t,e+1)}})}_removeHighlightIds(e){this._highlightCounter.batch(()=>{for(const t of e){let e=this._highlightCounter.get(t);null!=e&&(e--,e>0?this._highlightCounter.set(t,e):this._highlightCounter.delete(t))}})}highlight(e,t){const r=v(t),s=this.layer.objectIdField,n=m(e);if(0===n.length)return f;if(y(n[0])){const e=n;if(null!=d(this.layer.fieldsIndex,e[0].attributes,s)){const t=e.map(e=>d(this.layer.fieldsIndex,e.attributes,s)),n=this.graphicsPipeline.highlightByObjectIds(t,r);return this._addHighlightIds(t),i(()=>{this._removeHighlightIds(t),n.remove()})}return this.graphicsPipeline.highlightByGraphics(e,r)}if(P(n[0])){const e=n;this._addHighlightIds(e);const t=this.graphicsPipeline.highlightByObjectIds(e,r);return i(()=>{t.remove(),this._removeHighlightIds(e)})}return f}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!(!this.graphicsPipeline||this.graphicsPipeline.destroyed)&&!(!this.graphicsPipeline?.updating&&this.view?.groundView?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new t("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}};return e([n()],S.prototype,"graphicsPipeline",void 0),e([n({readOnly:!0})],S.prototype,"dataUpdating",null),e([n()],S.prototype,"suspended",void 0),e([n({readOnly:!0})],S.prototype,"legendEnabled",null),e([n({readOnly:!0})],S.prototype,"visibleAtCurrentScale",null),e([n()],S.prototype,"updating",void 0),e([n({readOnly:!0})],S.prototype,"updatePolicy",void 0),e([n({type:Boolean})],S.prototype,"slicePlaneEnabled",void 0),e([n({readOnly:!0})],S.prototype,"suspendInfo",void 0),e([n()],S.prototype,"symbologySnappingSupported",null),e([n({readOnly:!0})],S.prototype,"hasAllFeatures",null),e([n({readOnly:!0})],S.prototype,"hasAllFeaturesInView",null),e([n({readOnly:!0})],S.prototype,"hasFullGeometries",null),e([n({readOnly:!0})],S.prototype,"timeExtent",null),e([n()],S.prototype,"highlightIds",null),e([n()],S.prototype,"hasHighlight",null),S=e([l("esri.views.3d.layers.FeatureLikeLayerViewBase3D")],S),S};export{_ as FeatureLikeLayerViewBase3D};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{makeHandle as i}from"../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../core/maybe.js";import s from"../../../core/ReactiveMap.js";import{property as n,subclass as l}from"../../../core/accessorSupport/decorators.js";import{projectAsync as h}from"../../../geometry/projectionUtils.js";import{hydrateGraphic as a}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as o,hasTimeOptions as p}from"../../../layers/support/timeSupport.js";import u from"../../../rest/support/AttributeBinsQuery.js";import g from"../../../rest/support/Query.js";import{isGraphic as y}from"../../../support/graphicInstanceUtils.js";import{LayerView3D as c}from"./LayerView3D.js";import{attributeLookup as d}from"./support/attributeUtils.js";import{normalizeHighlightTarget as m,emptyHighlightHandle as f,isObjectId as P}from"./support/highlightUtils.js";import{RefreshableLayerView as b}from"../../layers/RefreshableLayerView.js";import{getHighlightName as w}from"../../support/highlightOptionsUtils.js";import{hasLayerBasedScaleVisibility as v,isInEffectiveScaleRange as I}from"../../support/layerViewUtils.js";const _=_=>{const j=b(c(_));let S=class extends j{constructor(){super(...arguments),this.updatePolicy=1,this.slicePlaneEnabled=!1,this._highlightCounter=new s,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){const e=this.layer;"isTable"in e&&e.isTable?this.addResolvingPromise(Promise.reject(new t("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e}))):(this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference="local"===this.view.viewingMode?await h(this.layer.fullExtent,this.view.spatialReference).catch(()=>null):null,await this._updatingRequiredPromise;const e=await this.createGraphicsPipeline();this.destroyed?e.destroy():(this.graphicsPipeline=e,await e.when())})()),this.notifyChange("updating"))}destroy(){this.graphicsPipeline=r(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return v()?I(this.layer.effectiveScaleRange,this.view.scale):!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return o(p(this.layer)?this.layer:null,this.view?.timeExtent,this._get("timeExtent"))}get highlightIds(){return Array.from(this._highlightCounter.keys())}get hasHighlight(){return this.highlightIds.length>0}getHit(e,t){const i=this.graphicsPipeline.findGraphic(t=>t.uid===e);if(null==i)return null;const r=a(i,this.layer,this.layer.graphicOrigin);return{type:"graphic",graphic:r,layer:r.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.graphicsQuery.queryForSymbologySnapping(e,t)}queryAggregates(e,t){throw new Error("missing implementation")}queryFeatures(e,t){return this.graphicsPipeline.graphicsQuery.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryAttributeBins(e,t){return this.graphicsPipeline.graphicsQuery.executeAttributeBinsQuery(this._ensureAttributeBinsQuery(e),t?.signal)}queryExtent(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return null==e?this.createQuery():g.from(e)}_ensureAttributeBinsQuery(e){const t=u.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}_addHighlightIds(e){this._highlightCounter.batch(()=>{for(const t of e){const e=this._highlightCounter.get(t)??0;this._highlightCounter.set(t,e+1)}})}_removeHighlightIds(e){this._highlightCounter.batch(()=>{for(const t of e){let e=this._highlightCounter.get(t);null!=e&&(e--,e>0?this._highlightCounter.set(t,e):this._highlightCounter.delete(t))}})}highlight(e,t){const r=w(t),s=this.layer.objectIdField,n=m(e);if(0===n.length)return f;if(y(n[0])){const e=n;if(null!=d(this.layer.fieldsIndex,e[0].attributes,s)){const t=e.map(e=>d(this.layer.fieldsIndex,e.attributes,s)),n=this.graphicsPipeline.highlightByObjectIds(t,r);return this._addHighlightIds(t),i(()=>{this._removeHighlightIds(t),n.remove()})}return this.graphicsPipeline.highlightByGraphics(e,r)}if(P(n[0])){const e=n;this._addHighlightIds(e);const t=this.graphicsPipeline.highlightByObjectIds(e,r);return i(()=>{t.remove(),this._removeHighlightIds(e)})}return f}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!(!this.graphicsPipeline||this.graphicsPipeline.destroyed)&&!(!this.graphicsPipeline?.updating&&this.view?.groundView?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new t("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}};return e([n()],S.prototype,"graphicsPipeline",void 0),e([n({readOnly:!0})],S.prototype,"dataUpdating",null),e([n()],S.prototype,"suspended",void 0),e([n({readOnly:!0})],S.prototype,"legendEnabled",null),e([n({readOnly:!0})],S.prototype,"visibleAtCurrentScale",null),e([n()],S.prototype,"updating",void 0),e([n({readOnly:!0})],S.prototype,"updatePolicy",void 0),e([n({type:Boolean})],S.prototype,"slicePlaneEnabled",void 0),e([n({readOnly:!0})],S.prototype,"suspendInfo",void 0),e([n()],S.prototype,"symbologySnappingSupported",null),e([n({readOnly:!0})],S.prototype,"hasAllFeatures",null),e([n({readOnly:!0})],S.prototype,"hasAllFeaturesInView",null),e([n({readOnly:!0})],S.prototype,"hasFullGeometries",null),e([n({readOnly:!0})],S.prototype,"timeExtent",null),e([n()],S.prototype,"highlightIds",null),e([n()],S.prototype,"hasHighlight",null),S=e([l("esri.views.3d.layers.FeatureLikeLayerViewBase3D")],S),S};export{_ as FeatureLikeLayerViewBase3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{isColorHighlightOrOLID as e}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(t){super(),this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.polygonOffset=0,this.vertexPositionRotationType=1,this.vertexNormalRotationType=0,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.receiveAmbientOcclusion=!0,this.receiveGlobalIllumination=!1,this.receiveShadows=!0,this.hasShadowHighlights=!1,this.transparent=!0,this.screenSpaceReflections=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.enableOITOffset=!1,this.sphereDepthInterpolate=!1,this.writeDepth=!0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0,this.sphericalSR=t.sphericalSR,this.useFloatBlend=t.useFloatBlend}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&e(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}t([o()],s.prototype,"useFloatBlend",void 0),t([o({count:12})],s.prototype,"output",void 0),t([o({count:3})],s.prototype,"textureCoordinateType",void 0),t([o({count:2})],s.prototype,"componentDataType",void 0),t([o({count:3})],s.prototype,"cullFace",void 0),t([o({count:3})],s.prototype,"vertexDiscardMode",void 0),t([o({count:3})],s.prototype,"doubleSidedMode",void 0),t([o({count:4})],s.prototype,"alphaDiscardMode",void 0),t([o({count:4})],s.prototype,"integratedMeshMode",void 0),t([o({count:7})],s.prototype,"pbrMode",void 0),t([o({count:3})],s.prototype,"normalType",void 0),t([o({count:8})],s.prototype,"emissionSource",void 0),t([o({count:3})],s.prototype,"shadeNormals",void 0),t([o({count:5})],s.prototype,"polygonOffset",void 0),t([o({count:2})],s.prototype,"vertexPositionRotationType",void 0),t([o({count:2})],s.prototype,"vertexNormalRotationType",void 0),t([o()],s.prototype,"hasEmission",void 0),t([o()],s.prototype,"hasVertexColors",void 0),t([o()],s.prototype,"hasSlicePlane",void 0),t([o()],s.prototype,"isGroundSlice",void 0),t([o()],s.prototype,"hasColorTexture",void 0),t([o()],s.prototype,"hasHighlightMixTexture",void 0),t([o()],s.prototype,"emissionDimmingPass",void 0),t([o()],s.prototype,"receiveAmbientOcclusion",void 0),t([o()],s.prototype,"receiveGlobalIllumination",void 0),t([o()],s.prototype,"receiveShadows",void 0),t([o()],s.prototype,"hasShadowHighlights",void 0),t([o()],s.prototype,"transparent",void 0),t([o()],s.prototype,"screenSpaceReflections",void 0),t([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),t([o()],s.prototype,"hasOcclusionTexture",void 0),t([o()],s.prototype,"hasNormalTexture",void 0),t([o()],s.prototype,"hasOccludees",void 0),t([o()],s.prototype,"terrainDepthTest",void 0),t([o()],s.prototype,"cullAboveTerrain",void 0),t([o()],s.prototype,"hasNormalTextureTransform",void 0),t([o()],s.prototype,"cloudReflections",void 0),t([o()],s.prototype,"snowCover",void 0),t([o()],s.prototype,"renderOccluded",void 0),t([o()],s.prototype,"enableOITOffset",void 0),t([o()],s.prototype,"sphereDepthInterpolate",void 0);export{s as ComponentTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{isColorHighlightOrOLID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(e){super(),this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.polygonOffset=0,this.vertexPositionRotationType=1,this.vertexNormalRotationType=0,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.receiveAmbientOcclusion=!0,this.receiveGlobalIllumination=!1,this.receiveShadows=!0,this.hasShadowHighlights=!1,this.transparent=!0,this.screenSpaceReflections=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.enableOITOffset=!1,this.sphereDepthInterpolate=!1,this.writeDepth=!0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=75,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0,this.sphericalSR=e.sphericalSR,this.useFloatBlend=e.useFloatBlend}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}e([o()],s.prototype,"useFloatBlend",void 0),e([o({count:12})],s.prototype,"output",void 0),e([o({count:3})],s.prototype,"textureCoordinateType",void 0),e([o({count:2})],s.prototype,"componentDataType",void 0),e([o({count:3})],s.prototype,"cullFace",void 0),e([o({count:3})],s.prototype,"vertexDiscardMode",void 0),e([o({count:3})],s.prototype,"doubleSidedMode",void 0),e([o({count:4})],s.prototype,"alphaDiscardMode",void 0),e([o({count:4})],s.prototype,"integratedMeshMode",void 0),e([o({count:7})],s.prototype,"pbrMode",void 0),e([o({count:3})],s.prototype,"normalType",void 0),e([o({count:8})],s.prototype,"emissionSource",void 0),e([o({count:3})],s.prototype,"shadeNormals",void 0),e([o({count:5})],s.prototype,"polygonOffset",void 0),e([o({count:2})],s.prototype,"vertexPositionRotationType",void 0),e([o({count:2})],s.prototype,"vertexNormalRotationType",void 0),e([o()],s.prototype,"hasEmission",void 0),e([o()],s.prototype,"hasVertexColors",void 0),e([o()],s.prototype,"hasSlicePlane",void 0),e([o()],s.prototype,"isGroundSlice",void 0),e([o()],s.prototype,"hasColorTexture",void 0),e([o()],s.prototype,"hasHighlightMixTexture",void 0),e([o()],s.prototype,"emissionDimmingPass",void 0),e([o()],s.prototype,"receiveAmbientOcclusion",void 0),e([o()],s.prototype,"receiveGlobalIllumination",void 0),e([o()],s.prototype,"receiveShadows",void 0),e([o()],s.prototype,"hasShadowHighlights",void 0),e([o()],s.prototype,"transparent",void 0),e([o()],s.prototype,"screenSpaceReflections",void 0),e([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([o()],s.prototype,"hasOcclusionTexture",void 0),e([o()],s.prototype,"hasNormalTexture",void 0),e([o()],s.prototype,"hasOccludees",void 0),e([o()],s.prototype,"terrainDepthTest",void 0),e([o()],s.prototype,"cullAboveTerrain",void 0),e([o()],s.prototype,"hasNormalTextureTransform",void 0),e([o()],s.prototype,"cloudReflections",void 0),e([o()],s.prototype,"snowCover",void 0),e([o()],s.prototype,"renderOccluded",void 0),e([o()],s.prototype,"enableOITOffset",void 0),e([o()],s.prototype,"sphereDepthInterpolate",void 0);export{s as ComponentTechniqueConfiguration};
@@ -0,0 +1,149 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform as t}from"../../shaderModules/Float2BindUniform.js";import{FloatBindUniform as o}from"../../shaderModules/FloatBindUniform.js";import{If as r,glsl as i}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as n}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as a}from"../../shaderModules/Texture2DBindUniform.js";function c(c,s){const d=c.fragment;d.include(e),d.uniforms.add(new t("nearFar",e=>e.camera.nearFar),new a("depthMap",e=>e.depth?.attachment),new n("proj",e=>e.camera.projectionMatrix),new o("invResolutionHeight",e=>1/e.camera.height),new n("reprojectionMatrix",e=>e.reprojection.matrix)).code.add(i`
3
+ vec2 reprojectionCoordinate(vec3 projectionCoordinate) {
4
+ vec4 clipDepthCoordinate = proj * vec4(0.0, 0.0, -projectionCoordinate.z, 1.0);
5
+ vec4 reprojectedCoordinate = reprojectionMatrix * vec4(
6
+ clipDepthCoordinate.w * (projectionCoordinate.xy * 2.0 - 1.0),
7
+ clipDepthCoordinate.z,
8
+ clipDepthCoordinate.w
9
+ );
10
+ reprojectedCoordinate.xy /= reprojectedCoordinate.w;
11
+ return reprojectedCoordinate.xy * 0.5 + 0.5;
12
+ }
13
+
14
+ vec4 applyProjectionMat(mat4 projectionMat, vec3 viewPosition) {
15
+ vec4 projectedCoordinate = projectionMat * vec4(viewPosition, 1.0);
16
+ projectedCoordinate.xy /= projectedCoordinate.w;
17
+ projectedCoordinate.xy = projectedCoordinate.xy*0.5 + 0.5;
18
+ return projectedCoordinate;
19
+ }
20
+
21
+ vec3 screenSpaceIntersectionWithLimits(
22
+ vec3 rayDirection,
23
+ vec3 startPosition,
24
+ vec3 viewDirection,
25
+ vec3 normal,
26
+ float rayStepOffset,
27
+ float rayMarchMaxReach,
28
+ float rayMarchMaxSteps
29
+ ) {
30
+ vec3 viewPosition = startPosition;
31
+
32
+ // Project the start position to the screen
33
+ vec4 projectedCoordStart = applyProjectionMat(proj, viewPosition);
34
+ vec3 homogeneousStart = viewPosition / projectedCoordStart.w;
35
+ float inverseWStart = 1.0 / projectedCoordStart.w;
36
+
37
+ // Advance the position in the ray direction
38
+ viewPosition += rayDirection;
39
+
40
+ vec4 projectedCoordVanishingPoint = applyProjectionMat(proj, rayDirection);
41
+
42
+ // Project the advanced position to the screen
43
+ vec4 projectedCoordEnd = applyProjectionMat(proj, viewPosition);
44
+ vec3 homogeneousEnd = viewPosition / projectedCoordEnd.w;
45
+ float inverseWEnd = 1.0 / projectedCoordEnd.w;
46
+
47
+ // Calculate the ray direction in screen space
48
+ vec2 projectedCoordDirection = (projectedCoordEnd.xy - projectedCoordStart.xy);
49
+ vec2 vanishingPointScreenOffset = (projectedCoordVanishingPoint.xy - projectedCoordStart.xy);
50
+
51
+ float rayMarchDistance = ${s.useProjectedRayLength?"length(vanishingPointScreenOffset.xy)":"abs(vanishingPointScreenOffset.y)"};
52
+ float clampedRayMarchDistance = min(rayMarchDistance, rayMarchMaxReach);
53
+
54
+ float projectedCoordDirectionLength = length(projectedCoordDirection);
55
+
56
+ // normalize the projection direction depending on maximum steps
57
+ // this determines how blocky the ray march looks
58
+ vec2 projectedStep = clampedRayMarchDistance * projectedCoordDirection / (rayMarchMaxSteps * projectedCoordDirectionLength);
59
+
60
+ // Normalize the homogeneous camera space coordinates
61
+ vec3 homogeneousStep = clampedRayMarchDistance * (homogeneousEnd - homogeneousStart) / (rayMarchMaxSteps * projectedCoordDirectionLength);
62
+ float inverseWStep = clampedRayMarchDistance * (inverseWEnd - inverseWStart) / (rayMarchMaxSteps * projectedCoordDirectionLength);
63
+
64
+ // initialize the variables for ray marching
65
+ vec2 projectedPosition = projectedCoordStart.xy;
66
+ vec3 homogeneousPosition = homogeneousStart;
67
+ float inverseW = inverseWStart;
68
+ float rayStartZ = -startPosition.z; // estimated ray start depth value
69
+ float rayEndZ = -startPosition.z; // estimated ray end depth value
70
+ float previousEstimatedZ = -startPosition.z;
71
+ float rayDepthDelta = 0.0;
72
+ float estimatedDepthDifference;
73
+ float sampledDepth;
74
+
75
+ if (dot(normal, rayDirection) < 0.0 || dot(-viewDirection, normal) < 0.0) {
76
+ return vec3(projectedPosition, 0.0);
77
+ }
78
+
79
+ float previousEstimatedDepthDifference = 0.0;
80
+
81
+ projectedPosition = clamp(
82
+ projectedPosition + rayStepOffset * projectedStep,
83
+ vec2(0.0),
84
+ vec2(0.999)
85
+ );
86
+ homogeneousPosition.z += rayStepOffset * homogeneousStep.z;
87
+ inverseW += rayStepOffset * inverseWStep;
88
+
89
+ int rayMarchMaxStepsInt = int(rayMarchMaxSteps);
90
+ for(int stepIndex = 0; stepIndex < rayMarchMaxStepsInt - 1; ++stepIndex) {
91
+ sampledDepth = -linearDepthFromTexture(depthMap, projectedPosition); // get linear depth from the depth buffer
92
+
93
+ // Estimate depth of the marching ray
94
+ rayStartZ = previousEstimatedZ;
95
+ estimatedDepthDifference = -rayStartZ - sampledDepth;
96
+ rayEndZ = (homogeneousStep.z * 0.5 + homogeneousPosition.z)/ ((inverseWStep * 0.5 + inverseW));
97
+ rayDepthDelta = rayEndZ - rayStartZ;
98
+ previousEstimatedZ = rayEndZ;
99
+
100
+ if(-rayEndZ > nearFar[1] || -rayEndZ < nearFar[0] || projectedPosition.y < 0.0 || projectedPosition.y > 1.0 ) {
101
+ return vec3(projectedPosition, 0.);
102
+ }
103
+
104
+ // If we detect a hit - return the intersection point, two conditions:
105
+ // - estimatedDepthDifference > 0.0 - sampled point depth is in front of estimated depth
106
+ // - if difference between estimatedDepthDifference and rayDepthDelta is not too large
107
+ // - if difference between estimatedDepthDifference and 0.025/abs(inverseW) is not too large
108
+ // - if the sampled depth is not behind far plane or in front of near plane
109
+
110
+ if(estimatedDepthDifference < 0.025 / abs(inverseW) + abs(rayDepthDelta) &&
111
+ estimatedDepthDifference > 0.0 &&
112
+ sampledDepth > nearFar[0] &&
113
+ sampledDepth < nearFar[1] &&
114
+ abs(projectedPosition.y - projectedCoordStart.y) > invResolutionHeight) {
115
+ float hitInterpolationWeight = estimatedDepthDifference / (estimatedDepthDifference - previousEstimatedDepthDifference);
116
+ vec2 refinedProjectedPosition = mix(projectedPosition - projectedStep, projectedPosition, 1.0 - hitInterpolationWeight);
117
+ if (abs(refinedProjectedPosition.y - projectedCoordStart.y) > invResolutionHeight) {
118
+ return vec3(refinedProjectedPosition, sampledDepth);
119
+ }
120
+ else {
121
+ return vec3(projectedPosition, sampledDepth);
122
+ }
123
+ }
124
+
125
+ ${r(!s.clampRayToScreen,"if (projectedPosition.x <= 0.0 || projectedPosition.x >= 1.0) {\n return vec3(projectedPosition, 0.0);\n }")}
126
+
127
+ // Continue with ray marching
128
+ projectedPosition = projectedPosition + projectedStep;
129
+ homogeneousPosition.z += homogeneousStep.z;
130
+ inverseW += inverseWStep;
131
+ previousEstimatedDepthDifference = estimatedDepthDifference;
132
+
133
+ ${r(s.clampRayToScreen,"projectedPosition = clamp(projectedPosition, vec2(0.0), vec2(0.999));")}
134
+ }
135
+ return vec3(projectedPosition, 0.0);
136
+ }
137
+
138
+ vec3 screenSpaceIntersection(vec3 rayDirection, vec3 startPosition, vec3 viewDirection, vec3 normal, float rayStepOffset) {
139
+ return screenSpaceIntersectionWithLimits(
140
+ rayDirection,
141
+ startPosition,
142
+ viewDirection,
143
+ normal,
144
+ rayStepOffset,
145
+ ${i.float(s.rayMarchMaxReach)},
146
+ ${i.float(s.rayMarchMaxSteps)}
147
+ );
148
+ }
149
+ `)}export{c as ScreenSpaceRayMarching};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{FoamColor as e}from"./FoamRendering.glsl.js";import{Gamma as o}from"./Gamma.glsl.js";import{PhysicallyBasedRenderingWater as t}from"./PhysicallyBasedRendering.glsl.js";import{distanceFadeStart as r,distanceFadeEnd as i}from"./ScreenSpaceConstants.js";import{ScreenSpaceReflections as n}from"./ScreenSpaceReflections.glsl.js";import{CloudsParallaxShading as a}from"../util/CloudsParallaxShading.glsl.js";import{FloatBindUniform as l}from"../../shaderModules/FloatBindUniform.js";import{glsl as d}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as c}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as s}from"../../shaderModules/Texture2DBindUniform.js";import{ToneMapping as f}from"../../../shaders/ToneMapping.glsl.js";function m(m,v){const u=m.fragment;u.include(t,v),u.include(o),u.include(e),v.cloudReflections&&m.include(a),m.include(n,v),u.include(f,v),u.constants.add("fresnelSky","vec3",[.02,1,15]),u.constants.add("fresnelMaterial","vec2",[.02,.1]),u.constants.add("roughness","float",.015),u.constants.add("foamIntensityExternal","float",1.7),u.constants.add("ssrIntensity","float",.65),u.constants.add("ssrHeightFadeStart","float",r),u.constants.add("ssrHeightFadeEnd","float",i),u.constants.add("waterDiffusion","float",.92),u.constants.add("waterSeaColorMod","float",.8),u.constants.add("correctionViewingPowerFactor","float",.4),u.constants.add("skyZenitColor","vec3",[.52,.68,.9]),u.constants.add("skyColor","vec3",[.67,.79,.9]),u.constants.add("cloudFresnelModifier","vec2",[1.2,.01]),u.code.add(d`PBRShadingWater shadingInfo;
2
+ import{FoamColor as e}from"./FoamRendering.glsl.js";import{Gamma as o}from"./Gamma.glsl.js";import{PhysicallyBasedRenderingWater as t}from"./PhysicallyBasedRendering.glsl.js";import{distanceFadeStart as r,distanceFadeEnd as i}from"./ScreenSpaceConstants.js";import{ScreenSpaceRayMarching as n}from"./ScreenSpaceRayMarching.glsl.js";import{CloudsParallaxShading as a}from"../util/CloudsParallaxShading.glsl.js";import{FloatBindUniform as l}from"../../shaderModules/FloatBindUniform.js";import{glsl as d}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as c}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as s}from"../../shaderModules/Texture2DBindUniform.js";import{ToneMapping as f}from"../../../shaders/ToneMapping.glsl.js";function m(m,v){const u=m.fragment;u.include(t,v),u.include(o),u.include(e),v.cloudReflections&&m.include(a),v.screenSpaceReflections&&m.include(n,v),u.include(f,v),u.constants.add("fresnelSky","vec3",[.02,1,15]),u.constants.add("fresnelMaterial","vec2",[.02,.1]),u.constants.add("roughness","float",.015),u.constants.add("foamIntensityExternal","float",1.7),u.constants.add("ssrIntensity","float",.65),u.constants.add("ssrHeightFadeStart","float",r),u.constants.add("ssrHeightFadeEnd","float",i),u.constants.add("waterDiffusion","float",.92),u.constants.add("waterSeaColorMod","float",.8),u.constants.add("correctionViewingPowerFactor","float",.4),u.constants.add("skyZenitColor","vec3",[.52,.68,.9]),u.constants.add("skyColor","vec3",[.67,.79,.9]),u.constants.add("cloudFresnelModifier","vec2",[1.2,.01]),u.code.add(d`PBRShadingWater shadingInfo;
3
3
  vec3 getSkyGradientColor(in float cosTheta, in vec3 horizon, in vec3 zenit) {
4
4
  float exponent = pow((1.0 - cosTheta), fresnelSky[2]);
5
5
  return mix(zenit, horizon, exponent);
@@ -46,7 +46,7 @@ vec3 viewNormal = normalize(viewNormalVectorCoordinate.xyz);
46
46
  vec4 viewUp = view * vec4(localUp, 0.0);
47
47
  vec3 viewNormalCorrectedSSR = mix(viewUp.xyz, viewNormal, correctionViewingFactor);
48
48
  vec3 reflected = normalize(reflect(viewDir, viewNormalCorrectedSSR));
49
- vec3 hitCoordinate = screenSpaceIntersection(reflected, viewPosition, viewDir, viewUp.xyz, 0.0, false);
49
+ vec3 hitCoordinate = screenSpaceIntersection(reflected, viewPosition, viewDir, viewUp.xyz, 0.0);
50
50
  vec3 reflectedColor = vec3(0.0);
51
51
  if (hitCoordinate.z > 0.0)
52
52
  {
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import"../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js";import"../../core/shaderLibrary/util/CameraSpace.glsl.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4BindUniform.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../webgl/enums.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlobalIlluminationPassParameters,b as build}from"../../../../../chunks/GlobalIllumination.glsl.js";
2
+ import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import"../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import"../../core/shaderLibrary/util/CameraSpace.glsl.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4BindUniform.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../webgl/enums.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlobalIlluminationPassParameters,c as build,d as defaultRayMarchMaxReach,b as defaultRayMarchMaxSteps}from"../../../../../chunks/GlobalIllumination.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{abortMaybe as r,disposeMaybe as s}from"../../../../../core/maybe.js";import{throwIfAborted as a,isAbortError as i}from"../../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as n}from"../../../../../core/reactiveUtils.js";import{property as l,subclass as m}from"../../../../../core/accessorSupport/decorators.js";import{set as u}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{requestImage as h}from"../../../../../request/image.js";import{InternalRenderCategory as c}from"../../../webgl.js";import p from"../../../webgl/RenderNode.js";import{G as d}from"../../../../../chunks/GlobalIllumination.glsl.js";import{G as f}from"../../../../../chunks/GlobalIlluminationBlur.glsl.js";import{GlobalIlluminationBlurTechnique as _}from"./GlobalIlluminationBlurTechnique.js";import{GlobalIlluminationTechnique as b}from"./GlobalIlluminationTechnique.js";import{GlobalIlluminationTechniqueConfiguration as g}from"./GlobalIlluminationTechniqueConfiguration.js";import{G as w}from"../../../../../chunks/GlobalIlluminationUpscale.glsl.js";import{GlobalIlluminationUpscaleTechnique as P}from"./GlobalIlluminationUpscaleTechnique.js";import{DepthStencilAttachment as x,ColorAttachment1 as T,SizedPixelFormat as I}from"../../../../webgl/enums.js";import C from"../../../../webgl/Texture.js";import{TextureDescriptor as q}from"../../../../webgl/TextureDescriptor.js";const j=1,M=.25;let B=class extends p{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=c.AMBIENT_ILLUMINATION,this._passParameters=new d,this._drawParameters=new f,this._drawParametersUpscale=new w,this._maxFrames=255,this._configuration=new g,this._resetBuffer=!1}async initialize(){this._abortController=new AbortController;const e=this._abortController.signal;try{const t=(await import("./BlueNoise.js")).data;a(e),await this._loadBlueNoiseTexture(t,e),a(e)}catch(r){i(r)||t.getLogger(this).errorOnce("Failed to load blue noise texture:",r)}this.addHandles(o(()=>this.view.stage.renderer.hasGlobalIllumination,()=>{this.resetAccumulation(),this.requestRender(1)},n))}precompile(){this._canRender&&(this._configuration.hasEmission=this.bindParameters.hasEmission,this.techniques.precompile(b,this._configuration),this.techniques.precompile(_),this._needsUpscalePass(this._mode)&&this.techniques.precompile(P))}destroy(){this._abortController=r(this._abortController),this._passParameters.noiseTexture=s(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),s=t?.getTexture(x),a=this._mode;if(!r||!s)return this._emptyOutput;if(this.view.stage.renderView.updating&&this.resetAccumulation(),0===a)return this._resetBuffer=!1,this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this.requestRender(1),this._emptyOutput;const i=this.bindParameters;this._configuration.hasEmission=i.hasEmission;const o=this.techniques.getCompiled(b,this._configuration),n=this.techniques.getCompiled(_),l=this._needsUpscalePass(a),m=l?M:1,h=l?this.techniques.getCompiled(P):null;if(!o||!n||l&&!h)return this.requestRender(1),this._emptyOutput;const p=this.renderingContext,{camera:d}=i;this._passParameters.normalTexture=r,this._passParameters.depthTexture=s,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.scaleGlobalIllumination=m;const{fullWidth:f,fullHeight:g}=d,w=Math.max(1,Math.floor(f*m)),I=Math.max(1,Math.floor(g*m)),C=this.fboCache.acquire(w,I,"global illumination input").acquireColor(T,0);p.bindFramebuffer(C.fbo),p.setViewport(0,0,w,I),p.bindTechnique(o,i,this._passParameters,this._drawParameters),p.screen.draw();const q=C.obtainAttachment(T),B=Math.max(1,Math.round(w/j)),G=Math.max(1,Math.round(I/j)),N=this.fboCache.acquire(B,G,"global illumination blur horizontal");p.bindFramebuffer(N.fbo),this._drawParameters.texture=C.getTexture(),this._drawParameters.weightTexture=q.attachment,u(this._drawParameters.blurSize,0,j/I),p.bindTechnique(n,i,this._passParameters,this._drawParameters),p.setViewport(0,0,B,G),p.screen.draw(),C.release();const A=l?"global illumination blur vertical":c.AMBIENT_ILLUMINATION,F=this.fboCache.acquire(B,G,A);p.bindFramebuffer(F.fbo),p.setViewport(0,0,B,G),p.setClearColor(1,1,1,0),p.clear(16384),this._drawParameters.texture=N.getTexture(),this._drawParameters.weightTexture=q.attachment,u(this._drawParameters.blurSize,j/B,0),p.bindTechnique(n,i,this._passParameters,this._drawParameters),p.setViewport(0,0,B,G),p.screen.draw(),N.release(),F.attachColor(q,T),q.release();let U=F;return h&&(U=this.fboCache.acquire(f,g,c.AMBIENT_ILLUMINATION).acquireColor(T,0),p.bindFramebuffer(U.fbo),p.setViewport(0,0,f,g),p.setClearColor(1,1,1,0),p.clear(16384),this._drawParametersUpscale.colorTexture=F.getTexture(),this._drawParametersUpscale.weightTexture=F.getTexture(T),p.bindTechnique(h,i,this._passParameters,this._drawParametersUpscale),p.screen.draw(),F.release()),p.setViewport4fv(d.fullViewport),this._passParameters.frameCount=(this._passParameters.frameCount+1)%64,++this._passParameters.accumulatedFrames,this._passParameters.accumulatedFrames<this._maxFrames&&this.requestRender(1),U}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,s=this.fboCache.acquire(t,r,c.AMBIENT_ILLUMINATION).acquireColor(T,0);return e.bindFramebuffer(s.fbo),e.setViewport(0,0,t,r),e.clearBuffer(0,[0,0,0,1]),e.clearBuffer(1,[0,0,0,0]),s}async _loadBlueNoiseTexture(e,t){a(t);const r=await h(e,{signal:t});if(a(t),!r)return;const s=new q;s.internalFormat=I.RGBA8,s.wrapMode=10497,s.isImmutable=!0,this._passParameters.noiseTexture=new C(this.renderingContext,s,r)}get _canRender(){const e=this.bindParameters;return!(!this._passParameters.noiseTexture||!e.reprojection.lastFrameColor||e.hasEmission&&!e.reprojection.lastFrameEmission||!e.reprojection.lastFrameDepth||!e.globalIllumination||this._resetBuffer)}get _mode(){const{hasGlobalIlluminationHighQuality:e,hasGlobalIllumination:t}=this.view.stage.renderer;return e?2:t?1:0}resetAccumulation(){this._passParameters.accumulatedFrames=0}_needsUpscalePass(e){return 1===e}get test(){}};e([l()],B.prototype,"consumes",void 0),e([l()],B.prototype,"produces",void 0),e([l()],B.prototype,"_abortController",void 0),B=e([m("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],B);export{B as GlobalIllumination,j as blurSizePixels};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Logger.js";import{abortMaybe as r,disposeMaybe as s}from"../../../../../core/maybe.js";import{throwIfAborted as a,isAbortError as i}from"../../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as n}from"../../../../../core/reactiveUtils.js";import{property as l,subclass as m}from"../../../../../core/accessorSupport/decorators.js";import{set as u}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{requestImage as h}from"../../../../../request/image.js";import{InternalRenderCategory as c}from"../../../webgl.js";import p from"../../../webgl/RenderNode.js";import{G as d}from"../../../../../chunks/GlobalIllumination.glsl.js";import{G as f}from"../../../../../chunks/GlobalIlluminationBlur.glsl.js";import{GlobalIlluminationBlurTechnique as _}from"./GlobalIlluminationBlurTechnique.js";import{GlobalIlluminationTechnique as b}from"./GlobalIlluminationTechnique.js";import{GlobalIlluminationTechniqueConfiguration as g}from"./GlobalIlluminationTechniqueConfiguration.js";import{G as w}from"../../../../../chunks/GlobalIlluminationUpscale.glsl.js";import{GlobalIlluminationUpscaleTechnique as P}from"./GlobalIlluminationUpscaleTechnique.js";import{DepthStencilAttachment as x,ColorAttachment1 as T,SizedPixelFormat as I}from"../../../../webgl/enums.js";import C from"../../../../webgl/Texture.js";import{TextureDescriptor as q}from"../../../../webgl/TextureDescriptor.js";const j=1,A=.25;let B=class extends p{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=c.AMBIENT_ILLUMINATION,this._passParameters=new d,this._drawParameters=new f,this._drawParametersUpscale=new w,this._maxFrames=255,this._configuration=new g,this._resetBuffer=!1}async initialize(){this._abortController=new AbortController;const e=this._abortController.signal;try{const t=(await import("./BlueNoise.js")).data;a(e),await this._loadBlueNoiseTexture(t,e),a(e)}catch(r){i(r)||t.getLogger(this).errorOnce("Failed to load blue noise texture:",r)}this.addHandles(o(()=>this.view.stage.renderer.hasGlobalIllumination,()=>{this.resetAccumulation(),this.requestRender(1)},n))}precompile(){this._canRender&&(this._configuration.hasEmission=this.bindParameters.hasEmission,this.techniques.precompile(b,this._configuration),this.techniques.precompile(_),this._needsUpscalePass(this._mode)&&this.techniques.precompile(P))}destroy(){this._abortController=r(this._abortController),this._passParameters.noiseTexture=s(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),s=t?.getTexture(x),a=this._mode;if(!r||!s)return this._emptyOutput;if(this.view.stage.renderView.updating&&this.resetAccumulation(),0===a)return this._resetBuffer=!1,this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this.requestRender(1),this._emptyOutput;const i=this.bindParameters;this._configuration.hasEmission=i.hasEmission;const o=this.techniques.getCompiled(b,this._configuration),n=this.techniques.getCompiled(_),l=this._needsUpscalePass(a),m=l?A:1,h=l?this.techniques.getCompiled(P):null;if(!o||!n||l&&!h)return this.requestRender(1),this._emptyOutput;const p=this.renderingContext,{camera:d}=i;this._passParameters.normalTexture=r,this._passParameters.depthTexture=s,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.scaleGlobalIllumination=m;const{fullWidth:f,fullHeight:g}=d,w=Math.max(1,Math.floor(f*m)),I=Math.max(1,Math.floor(g*m)),C=this.fboCache.acquire(w,I,"global illumination input").acquireColor(T,0);p.bindFramebuffer(C.fbo),p.setViewport(0,0,w,I),p.bindTechnique(o,i,this._passParameters,this._drawParameters),p.screen.draw();const q=C.obtainAttachment(T),B=Math.max(1,Math.round(w/j)),M=Math.max(1,Math.round(I/j)),G=this.fboCache.acquire(B,M,"global illumination blur horizontal");p.bindFramebuffer(G.fbo),this._drawParameters.texture=C.getTexture(),this._drawParameters.weightTexture=q.attachment,u(this._drawParameters.blurSize,0,j/I),p.bindTechnique(n,i,this._passParameters,this._drawParameters),p.setViewport(0,0,B,M),p.screen.draw(),C.release();const N=l?"global illumination blur vertical":c.AMBIENT_ILLUMINATION,F=this.fboCache.acquire(B,M,N);p.bindFramebuffer(F.fbo),p.setViewport(0,0,B,M),p.setClearColor(1,1,1,0),p.clear(16384),this._drawParameters.texture=G.getTexture(),this._drawParameters.weightTexture=q.attachment,u(this._drawParameters.blurSize,j/B,0),p.bindTechnique(n,i,this._passParameters,this._drawParameters),p.setViewport(0,0,B,M),p.screen.draw(),G.release(),F.attachColor(q,T),q.release();let U=F;return h&&(U=this.fboCache.acquire(f,g,c.AMBIENT_ILLUMINATION).acquireColor(T,0),p.bindFramebuffer(U.fbo),p.setViewport(0,0,f,g),p.setClearColor(1,1,1,0),p.clear(16384),this._drawParametersUpscale.colorTexture=F.getTexture(),this._drawParametersUpscale.weightTexture=F.getTexture(T),p.bindTechnique(h,i,this._passParameters,this._drawParametersUpscale),p.screen.draw(),F.release()),p.setViewport4fv(d.fullViewport),this._passParameters.frameCount=(this._passParameters.frameCount+1)%64,++this._passParameters.accumulatedFrames,this._passParameters.accumulatedFrames<this._maxFrames&&this.requestRender(1),U}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,s=this.fboCache.acquire(t,r,c.AMBIENT_ILLUMINATION).acquireColor(T,0);return e.bindFramebuffer(s.fbo),e.setViewport(0,0,t,r),e.clearBuffer(0,[0,0,0,1]),e.clearBuffer(1,[0,0,0,0]),s}async _loadBlueNoiseTexture(e,t){a(t);const r=await h(e,{signal:t});if(a(t),!r)return;const s=new q;s.internalFormat=I.RGBA8,s.wrapMode=10497,s.isImmutable=!0,this._passParameters.noiseTexture=new C(this.renderingContext,s,r)}get _canRender(){const e=this.bindParameters;return!(!this._passParameters.noiseTexture||!e.reprojection.lastFrameColor||e.hasEmission&&!e.reprojection.lastFrameEmission||!e.reprojection.lastFrameDepth||!e.globalIllumination||this._resetBuffer)}get _mode(){const{hasGlobalIlluminationHighQuality:e,hasGlobalIllumination:t}=this.view.stage.renderer;return e?2:t?1:0}resetAccumulation(){this._passParameters.accumulatedFrames=0}_needsUpscalePass(e){return 1===e}get test(){return{passParameters:this._passParameters,restartAccumulation:()=>{this.resetAccumulation(),this._passParameters.frameCount=0,this._resetBuffer=!0,this.requestRender(1)}}}};e([l()],B.prototype,"consumes",void 0),e([l()],B.prototype,"produces",void 0),e([l()],B.prototype,"_abortController",void 0),B=e([m("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],B);export{B as GlobalIllumination,j as blurSizePixels};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as o}from"tslib";import{parameter as s,ShaderTechniqueConfiguration as i}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends i{constructor(){super(...arguments),this.hasEmission=!1}}o([s()],r.prototype,"hasEmission",void 0);export{r as GlobalIlluminationTechniqueConfiguration};
2
+ import{__decorate as s}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as r}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{d as a,b as e}from"../../../../../chunks/GlobalIllumination.glsl.js";class i extends r{constructor(){super(...arguments),this.hasEmission=!1,this.rayMarchMaxReach=a,this.rayMarchMaxSteps=e,this.useProjectedRayLength=!0,this.clampRayToScreen=!1}}s([o()],i.prototype,"hasEmission",void 0);export{i as GlobalIlluminationTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{releaseMaybe as e}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{length as a}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getReferenceEllipsoid as h}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as l}from"../../../webgl.js";import{TransparentEnvironment as c}from"../TransparentEnvironment.js";import{G as m}from"../../../../../chunks/GlowBlur.glsl.js";import{GlowBlurTechnique as u}from"./GlowBlurTechnique.js";import{GlowBlurTechniqueConfiguration as p}from"./GlowBlurTechniqueConfiguration.js";import{G as d,a as _,m as g}from"../../../../../chunks/GlowComposition.glsl.js";import{GlowCompositionTechnique as b}from"./GlowCompositionTechnique.js";import{GlowCompositionTechniqueConfiguration as f}from"./GlowCompositionTechniqueConfiguration.js";import{floatBlendReductionFactor as P}from"../../shaders/oitResolution.glsl.js";import{ColorAttachment1 as w,DepthStencilAttachment as C}from"../../../../webgl/enums.js";let F=class extends c{constructor(t){super(t),this.consumes={required:[l.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=l.TRANSPARENT_ENVIRONMENT,this._mode=0,this._intensity=.5,this._scatteringFactors={realistic:new d([32,16,8,4,2,1],1),maximumFog:new d([0,.27,.6,1.05,1.58,2.1],6),cartographicMin:new d([.4,.18,.25,.12,.05,0],1),cartographicDefault:new d([1.17,1.08,.78,.4,.26,.11],4),cartographicMax:new d([3.59,3.9,2.46,1.4,.93,.44],13)},this._blurHorizontalConfiguration=new p,this._blurVerticalConfiguration=new p,this._compositionConfiguration=new f,this._compositionParameters=new _,this._blurParameters=new m,this._blurScalePerLod=3.06,this._logicalBlurRadius=.0037;const e=h(t.view.spatialReference);this._atmosphereRadius=e.radius+e.atmosphereHeight}initialize(){this.addHandles([i(()=>this._updateFogParameters(),()=>{},r),i(()=>this._updateParameters(),()=>{},r)])}_updateParameters(){const t=this.view.environment.lighting.glow;this._mode=null==t?this.view.environment.atmosphereEnabled?0:2:1,t&&(this._intensity=t.intensity),this._compositionParameters.minDisperse.preset=this._preset,this.requestRender(1)}_updateFogParameters(){const{weather:t,weatherAvailable:e}=this.view.environment;this._compositionParameters.distanceModifier=e?t.fogOpacity:0,this._compositionParameters.maxDisperse=this._scatteringFactors.maximumFog,this.requestRender(1)}precompile(){this._compositionConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionConfiguration.blurEnabled=2!==this._mode,this._compositionConfiguration.blurEnabled&&(this.techniques.precompile(u,this._blurHorizontalConfiguration),this._blurVerticalConfiguration.glowStage=1,this.techniques.precompile(u,this._blurVerticalConfiguration)),this.techniques.precompile(b,this._compositionConfiguration)}render(t){const i=t.find(({name:t})=>t===l.TRANSPARENT_ENVIRONMENT),r=i.getAttachment(w);if(!r?.attachment)return i;const s=i.getTexture(),o=i.getAttachment(C),n=this.fboCache,{fullWidth:h,fullHeight:c}=this.bindParameters.camera,m=this.renderingContext;if(this._compositionConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionParameters.color=s,this._compositionParameters.emission=r.attachment,2===this._mode){this._compositionConfiguration.blurEnabled=!1;const t=this.techniques.getCompiled(b,this._compositionConfiguration);if(!t)return this.requestRender(1),i;const e=n.acquire(s.descriptor.width,s.descriptor.height,this.produces);return this._setupFBO(e,h,c),m.bindTechnique(t,this.bindParameters,this._compositionParameters),m.screen.draw(),e.attachDepth(o),e.attachColor(r,w),e}this._compositionConfiguration.blurEnabled=!0;const p=this.techniques.getCompiled(u,this._blurHorizontalConfiguration),d=this.techniques.getCompiled(u,this._blurVerticalConfiguration),_=this.techniques.getCompiled(b,this._compositionConfiguration);if(!p||!d||!_)return this.requestRender(1),i;const g=this.bindParameters.camera,f=a(g.eye);this._compositionParameters.atmosphereC=f**2-this._atmosphereRadius**2,this._renderGlowMipMap(p,d);const P=n.acquire(s.descriptor.width,s.descriptor.height,this.produces);return P.acquireColor(w,this.bindParameters.useFloatBlend.value?8:5,"emissive glow"),this._setupFBO(P,h,c,!0),m.bindTechnique(_,this.bindParameters,this._compositionParameters),m.screen.draw(),this._compositionParameters.lodTexture=e(this._compositionParameters.lodTexture),P.attachDepth(o),P}_renderGlowMipMap(t,e){const i=this.fboCache,{fullWidth:r,fullHeight:s}=this.bindParameters.camera,o=this.renderingContext;let a=Math.ceil(.5*r),n=Math.ceil(.5*s);const h=5;for(this._blurParameters.input=this._compositionParameters.emission,this._blurParameters.inputScale=P,this._blurParameters.level=0,this._blurParameters.blurRadius=this._logicalBlurRadius,this._compositionParameters.lodTexture=i.acquire(a,n,"glow mipmap",9);a>1&&n>1&&this._blurParameters.level<h;){const r=i.acquire(a,n,"glow horizontal",8);this._setupFBO(r,a,n),o.bindTechnique(t,this.bindParameters,this._blurParameters),o.screen.draw(),this._blurParameters.inputScale=1,this._blurParameters.input=r.getTexture(),this._setupFBO(this._compositionParameters.lodTexture,a,n,!1,this._blurParameters.level),o.bindTechnique(e,this.bindParameters,this._blurParameters),o.screen.draw(),r.release(),a=Math.ceil(.5*a),n=Math.ceil(.5*n),this._blurParameters.input=this._compositionParameters.lodTexture.getTexture(),this._blurParameters.blurRadius*=this._blurScalePerLod,++this._blurParameters.level}this._compositionParameters.lodTexture.fbo.level=0}get _preset(){return 0===this._mode?this._scatteringFactors.realistic.preset:this._intensity<=.5?g(this._scatteringFactors.cartographicMin.preset,this._scatteringFactors.cartographicDefault.preset,2*this._intensity):g(this._scatteringFactors.cartographicDefault.preset,this._scatteringFactors.cartographicMax.preset,2*(this._intensity-.5))}_setupFBO(t,e,i,r=!1,s=0){t.fbo.level=s;const o=this.renderingContext;o.bindFramebuffer(t.fbo),o.setViewport(0,0,e,i),o.setClearColor(0,0,0,0),o.clear(16384),r&&o.clearBuffer(1,n)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setBlurLodCombination:t=>{this._compositionParameters.dispersionWeight=t},preset:this._preset,setMinDisperse:(t,e)=>{0===this._mode?this._scatteringFactors.realistic.preset[t]=e:(this._scatteringFactors.cartographicMin.preset[t]=e,this._scatteringFactors.cartographicMax.preset[t]=e)},toggleTonemapping:t=>{this._compositionConfiguration.tonemappingEnabled=t,this.requestRender(1)}}}};t([s()],F.prototype,"consumes",void 0),t([s()],F.prototype,"produces",void 0),F=t([o("esri.views.3d.webgl-engine.effects.glow.Glow")],F);export{F as Glow};
2
+ import{__decorate as t}from"tslib";import{releaseMaybe as e}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{length as a}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getReferenceEllipsoid as h}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as l}from"../../../webgl.js";import{TransparentEnvironment as c}from"../TransparentEnvironment.js";import{G as m}from"../../../../../chunks/GlowBlur.glsl.js";import{GlowBlurTechnique as u}from"./GlowBlurTechnique.js";import{GlowBlurTechniqueConfiguration as p}from"./GlowBlurTechniqueConfiguration.js";import{G as d,a as _,m as g}from"../../../../../chunks/GlowComposition.glsl.js";import{GlowCompositionTechnique as b}from"./GlowCompositionTechnique.js";import{GlowCompositionTechniqueConfiguration as f}from"./GlowCompositionTechniqueConfiguration.js";import{floatBlendReductionFactor as P}from"../../shaders/oitResolution.glsl.js";import{ColorAttachment1 as w,DepthStencilAttachment as C}from"../../../../webgl/enums.js";let F=class extends c{constructor(t){super(t),this.consumes={required:[l.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=l.TRANSPARENT_ENVIRONMENT,this._mode=0,this._intensity=.5,this._scatteringFactors={realistic:new d([32,16,8,4,2,1],1),maximumFog:new d([0,.27,.6,1.05,1.58,2.1],6),cartographicMin:new d([.4,.18,.25,.12,.05,0],1),cartographicDefault:new d([1.17,1.08,.78,.4,.26,.11],4),cartographicMax:new d([3.59,3.9,2.46,1.4,.93,.44],13)},this._blurHorizontalConfiguration=new p,this._blurVerticalConfiguration=new p,this._compositionConfiguration=new f,this._compositionParameters=new _,this._blurParameters=new m,this._blurScalePerLod=3.06,this._logicalBlurRadius=.0037;const e=h(t.view.spatialReference);this._atmosphereRadius=e.radius+e.atmosphereHeight}initialize(){this.addHandles([i(()=>this._updateFogParameters(),()=>{},r),i(()=>this._updateParameters(),()=>{},r)])}_updateParameters(){const t=this.view.environment.lighting.glow;this._mode=null==t?this.view.environment.atmosphereEnabled?0:2:1,t&&(this._intensity=t.intensity),this._compositionParameters.minDisperse.preset=this._preset,this.requestRender(1)}_updateFogParameters(){const{weather:t,weatherAvailable:e}=this.view.environment;this._compositionParameters.distanceModifier=e?t.fogOpacity:0,this._compositionParameters.maxDisperse=this._scatteringFactors.maximumFog,this.requestRender(1)}precompile(){this._compositionConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionConfiguration.blurEnabled=2!==this._mode,this._compositionConfiguration.blurEnabled&&(this.techniques.precompile(u,this._blurHorizontalConfiguration),this._blurVerticalConfiguration.glowStage=1,this.techniques.precompile(u,this._blurVerticalConfiguration)),this.techniques.precompile(b,this._compositionConfiguration)}render(t){const i=t.find(({name:t})=>t===l.TRANSPARENT_ENVIRONMENT),r=i.getAttachment(w);if(!r?.attachment)return i;const s=i.getTexture(),o=i.getAttachment(C),n=this.fboCache,{fullWidth:h,fullHeight:c}=this.bindParameters.camera,m=this.renderingContext;if(this._compositionConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionParameters.color=s,this._compositionParameters.emission=r.attachment,2===this._mode){this._compositionConfiguration.blurEnabled=!1;const t=this.techniques.getCompiled(b,this._compositionConfiguration);if(!t)return this.requestRender(1),i;const e=n.acquire(s.descriptor.width,s.descriptor.height,this.produces);return this._setupFBO(e,h,c),m.bindTechnique(t,this.bindParameters,this._compositionParameters),m.screen.draw(),e.attachDepth(o),e.attachColor(r,w),e}this._compositionConfiguration.blurEnabled=!0;const p=this.techniques.getCompiled(u,this._blurHorizontalConfiguration),d=this.techniques.getCompiled(u,this._blurVerticalConfiguration),_=this.techniques.getCompiled(b,this._compositionConfiguration);if(!p||!d||!_)return this.requestRender(1),i;const g=this.bindParameters.camera,f=a(g.eye);this._compositionParameters.atmosphereC=f**2-this._atmosphereRadius**2,this._renderGlowMipMap(p,d);const P=n.acquire(s.descriptor.width,s.descriptor.height,this.produces);return P.acquireColor(w,this.bindParameters.useFloatBlend.value?8:5,"emissive glow"),this._setupFBO(P,h,c,!0),m.bindTechnique(_,this.bindParameters,this._compositionParameters),m.screen.draw(),this._compositionParameters.lodTexture=e(this._compositionParameters.lodTexture),P.attachDepth(o),P}_renderGlowMipMap(t,e){const i=this.fboCache,{fullWidth:r,fullHeight:s}=this.bindParameters.camera,o=this.renderingContext;let a=Math.ceil(.5*r),n=Math.ceil(.5*s);const h=5;this._blurParameters.input=this._compositionParameters.emission,this._blurParameters.inputScale=P,this._blurParameters.level=0,this._blurParameters.blurRadius=this._logicalBlurRadius;const l=i.acquire(a,n,"glow horizontal",8);for(this._compositionParameters.lodTexture=i.acquire(a,n,"glow mipmap",9);a>1&&n>1&&this._blurParameters.level<h;)this._setupFBO(l,a,n),o.bindTechnique(t,this.bindParameters,this._blurParameters),o.screen.draw(),this._blurParameters.inputScale=1,this._blurParameters.input=l.getTexture(),this._setupFBO(this._compositionParameters.lodTexture,a,n,!1,this._blurParameters.level),o.bindTechnique(e,this.bindParameters,this._blurParameters),o.screen.draw(),a=Math.ceil(.5*a),n=Math.ceil(.5*n),this._blurParameters.input=this._compositionParameters.lodTexture.getTexture(),this._blurParameters.blurRadius*=this._blurScalePerLod,++this._blurParameters.level;l.release(),this._compositionParameters.lodTexture.fbo.level=0}get _preset(){return 0===this._mode?this._scatteringFactors.realistic.preset:this._intensity<=.5?g(this._scatteringFactors.cartographicMin.preset,this._scatteringFactors.cartographicDefault.preset,2*this._intensity):g(this._scatteringFactors.cartographicDefault.preset,this._scatteringFactors.cartographicMax.preset,2*(this._intensity-.5))}_setupFBO(t,e,i,r=!1,s=0){t.fbo.level=s;const o=this.renderingContext;o.bindFramebuffer(t.fbo),o.setViewport(0,0,e,i),o.setClearColor(0,0,0,0),o.clear(16384),r&&o.clearBuffer(1,n)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setBlurLodCombination:t=>{this._compositionParameters.dispersionWeight=t},preset:this._preset,setMinDisperse:(t,e)=>{0===this._mode?this._scatteringFactors.realistic.preset[t]=e:(this._scatteringFactors.cartographicMin.preset[t]=e,this._scatteringFactors.cartographicMax.preset[t]=e)},toggleTonemapping:t=>{this._compositionConfiguration.tonemappingEnabled=t,this.requestRender(1)}}}};t([s()],F.prototype,"consumes",void 0),t([s()],F.prototype,"produces",void 0),F=t([o("esri.views.3d.webgl-engine.effects.glow.Glow")],F);export{F as Glow};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as i}from"./TriangleTechniqueConfiguration.js";class o extends i{constructor(e){super(),this.spherical=e,this.receiveGlobalIllumination=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.writeDepth=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.draped=!1,this.textureCoordinateType=0,this.emissionSource=0,this.pbrMode=3,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!0,this.highStepCount=!0,this.useFillLights=!1,this.overlayEnabled=!1,this.snowCover=!1}get discardInvisibleFragments(){return this.transparent&&this.writeDepth}}e([t()],o.prototype,"receiveGlobalIllumination",void 0),e([t()],o.prototype,"receiveShadows",void 0),e([t()],o.prototype,"hasShadowHighlights",void 0),e([t()],o.prototype,"writeDepth",void 0),e([t()],o.prototype,"screenSpaceReflections",void 0),e([t()],o.prototype,"cloudReflections",void 0),e([t()],o.prototype,"draped",void 0);export{o as WaterTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as i}from"./TriangleTechniqueConfiguration.js";class o extends i{constructor(e){super(),this.spherical=e,this.receiveGlobalIllumination=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.writeDepth=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.draped=!1,this.textureCoordinateType=0,this.emissionSource=0,this.pbrMode=3,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!0,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=150,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.useFillLights=!1,this.overlayEnabled=!1,this.snowCover=!1}get discardInvisibleFragments(){return this.transparent&&this.writeDepth}}e([t()],o.prototype,"receiveGlobalIllumination",void 0),e([t()],o.prototype,"receiveShadows",void 0),e([t()],o.prototype,"hasShadowHighlights",void 0),e([t()],o.prototype,"writeDepth",void 0),e([t()],o.prototype,"screenSpaceReflections",void 0),e([t()],o.prototype,"cloudReflections",void 0),e([t()],o.prototype,"draped",void 0);export{o as WaterTechniqueConfiguration};
@@ -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{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as s}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{when as a,initial as h,watch as d,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../../core/scheduling.js";import{Milliseconds as p}from"../../../../core/time.js";import{property as m,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{isMoon as u,isMars as g}from"../../../../geometry/ellipsoidUtils.js";import{ComponentObjectCollection as w}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as _}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as v}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ChapmanAtmosphere as x}from"../effects/atmosphere/ChapmanAtmosphere.js";import{LocalAtmosphere as j}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as y}from"../effects/atmosphere/MarsAtmosphere.js";import{CloudsComposition as R}from"../effects/clouds/CloudsComposition.js";import{Fog as b}from"../effects/fog/Fog.js";import{ObjectAndLayerIDRenderNode as A}from"../effects/geometry/ObjectAndLayerIDRenderNode.js";import{olidEnabled as C}from"../effects/geometry/olidUtils.js";import{RenderOccludedRenderNode as S}from"../effects/geometry/RenderOccludedRenderNode.js";import{GlobalIllumination as T}from"../effects/globalIllumination/GlobalIllumination.js";import{Glow as O}from"../effects/glow/Glow.js";import{Haze as U}from"../effects/haze/Haze.js";import{Highlight as q}from"../effects/highlight/Highlight.js";import{ShadowHighlight as M}from"../effects/highlight/ShadowHighlight.js";import{ShadowHighlightBuffer as L}from"../effects/highlight/ShadowHighlightBuffer.js";import{Magnifier as D}from"../effects/magnifier/Magnifier.js";import{SMAA as k}from"../effects/smaa/SMAA.js";import{SSAO as F}from"../effects/ssao/SSAO.js";import{Stars as W}from"../effects/stars/Stars.js";import{GLMaterialRepository as B}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as H}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as E}from"../lib/Renderer.js";import{RenderingContext as I}from"../lib/RenderingContext.js";import{RenderingContextOptions as G}from"../lib/RenderingContextOptions.js";import{TextureRepository as N}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as P}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as z}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as V}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as X}from"./contextCache.js";import{removeLoadedShaderModules as Q}from"./renderUtils.js";import{ScreenshotManager as J,ScreenshotContext as K}from"./ScreenshotManager.js";import{contextCache as Y}from"./testUtils.js";import{noBudget as Z}from"../../../support/Scheduler.js";import{checkWebGLError as $}from"../../../webgl/checkWebGLError.js";let ee=class extends t{constructor(e,t){super(e),this.olidRenderHelper=C()?new H:null,this.waterTextures=new V,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.glow=null,this.fog=null,this.test=null,this._initializeContext(t);const{memoryController:r}=t.view.resourceController;this.stippleTextures=z(this._rctx,r),this.markerTextures=P(this._rctx,r),this.techniques=new v(new _(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new N(t),this.addHandles(this.textures.events.on("changed",e=>this.requestRender(e)));const s=new B(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new E(t,s,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([a(()=>t.view.ready,()=>this._createRenderNodes(),h),d(()=>this.waterTextures.updating,()=>this.requestRender(),h),d(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),l)]);const i={renderScene:(e,t,r,s)=>this.renderer.render(e,t,r,s),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,s)=>t.options.screenshot.renderOverlay(e,r,s)};this._screenshotManager=new J(this._rctx,i,e=>t.view.overlayManager.updateOverlays(Z,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=o(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=o(this._rctx),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;if(new W({view:e}),u(e.spatialReference)||(this.glow=new O({view:e}),2===t?new j({view:e}):g(e.spatialReference)?new y({view:e}):(new x({view:e}),new R({view:e}),new U({view:e}),this.fog=new b({view:e}))),has("global-illumination")){const t=new T({view:e});this.test&&(this.test.globalIllumination=t)}else new F({view:e});new k({view:e,isEnabled:()=>this.renderer.hasSMAA}),new D({view:e}),new q({view:e}),new L({view:e}),new M({view:e,viewingMode:t}),new S({view:e}),C()&&new A({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0;case 0:this._needsRender=!0}}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,n,o=n){const a=i.constrainWindowSize(t,r,n*i.pixelRatio,o*i.pixelRatio),h=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,h);const d=(e,t,r)=>s(t,e)*(r[1]-r[0])+r[0];let l=Number.MAX_VALUE;for(let s=0;s<a[2]*a[3];s++){const e=d(4*s,h,i.nearFar);l>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(l=e)}if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&l>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(l=s)}return l===Number.MAX_VALUE?void 0:l}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){Q(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,s=0,i=!1;const n={preRender:({time:i})=>{r=this.updating,s=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),i=this.test?.time??i;const n=p(i-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(n>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,i)&&this.requestRender(0),this._lastAnimationUpdate=i)},render:({time:e})=>{if((this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const r=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,e=this.test?.time??e,this.renderer.render(t,e,0),i=!0,r&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();const r=new K(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{i&&(this.renderer.finish(2===t.mode?s:1),i=!1)}};this._frameTask=c(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const s={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",s);if(null==n)return void i.getLogger(this).error("A WebGL2 context could not be created.");$(n,!0),this._rctx=te(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&i.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new w(this.renderer.renderPassManager,this._viewingMode,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){null!=this.test?.time&&null!=e.fadeDuration&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=p(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}};function te(e,t){const r=new G(t);if(Y.enabled){let t=re.get(e);return 1===t?.refCount?(t.configure(r),t.ref(),t):(t=new I(e,r),re.set(e,t),t.ref(),t)}return new I(e,r)}e([m({type:Boolean,readOnly:!0})],ee.prototype,"updating",null),e([m({constructOnly:!0})],ee.prototype,"view",void 0),e([m({readOnly:!0})],ee.prototype,"componentObjectCollection",null),e([m()],ee.prototype,"_componentObjectCollection",void 0),e([m()],ee.prototype,"_needsUpdate",void 0),e([m()],ee.prototype,"_needsWaterReflectionUpdate",void 0),ee=e([f("esri.views.3d.webgl-engine.parts.RenderView")],ee);const re=X();export{ee as RenderView};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as s}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{when as a,initial as h,watch as l,syncAndInitial as d}from"../../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../../core/scheduling.js";import{Milliseconds as p}from"../../../../core/time.js";import{property as m,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{isMoon as f,isMars as g}from"../../../../geometry/ellipsoidUtils.js";import{ComponentObjectCollection as w}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as _}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as v}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ChapmanAtmosphere as x}from"../effects/atmosphere/ChapmanAtmosphere.js";import{LocalAtmosphere as j}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as y}from"../effects/atmosphere/MarsAtmosphere.js";import{CloudsComposition as R}from"../effects/clouds/CloudsComposition.js";import{Fog as b}from"../effects/fog/Fog.js";import{ObjectAndLayerIDRenderNode as A}from"../effects/geometry/ObjectAndLayerIDRenderNode.js";import{olidEnabled as C}from"../effects/geometry/olidUtils.js";import{RenderOccludedRenderNode as S}from"../effects/geometry/RenderOccludedRenderNode.js";import{GlobalIllumination as T}from"../effects/globalIllumination/GlobalIllumination.js";import{Glow as O}from"../effects/glow/Glow.js";import{Haze as U}from"../effects/haze/Haze.js";import{Highlight as q}from"../effects/highlight/Highlight.js";import{ShadowHighlight as M}from"../effects/highlight/ShadowHighlight.js";import{ShadowHighlightBuffer as L}from"../effects/highlight/ShadowHighlightBuffer.js";import{Magnifier as D}from"../effects/magnifier/Magnifier.js";import{SMAA as k}from"../effects/smaa/SMAA.js";import{SSAO as F}from"../effects/ssao/SSAO.js";import{Stars as W}from"../effects/stars/Stars.js";import{GLMaterialRepository as B}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as H}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as E}from"../lib/Renderer.js";import{RenderingContext as I}from"../lib/RenderingContext.js";import{RenderingContextOptions as G}from"../lib/RenderingContextOptions.js";import{TextureRepository as N}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as P}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as z}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as V}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as X}from"./contextCache.js";import{removeLoadedShaderModules as Q}from"./renderUtils.js";import{ScreenshotManager as J,ScreenshotContext as K}from"./ScreenshotManager.js";import{contextCache as Y}from"./testUtils.js";import{noBudget as Z}from"../../../support/Scheduler.js";import{checkWebGLError as $}from"../../../webgl/checkWebGLError.js";let ee=class extends t{constructor(e,t){super(e),this.olidRenderHelper=C()?new H:null,this.waterTextures=new V,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.glow=null,this.fog=null,this.globalIllumination=null,this.test=null,this._initializeContext(t);const{memoryController:r}=t.view.resourceController;this.stippleTextures=z(this._rctx,r),this.markerTextures=P(this._rctx,r),this.techniques=new v(new _(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new N(t),this.addHandles(this.textures.events.on("changed",e=>this.requestRender(e)));const s=new B(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new E(t,s,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([a(()=>t.view.ready,()=>this._createRenderNodes(),h),l(()=>this.waterTextures.updating,()=>this.requestRender(),h),l(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),d)]);const i={renderScene:(e,t,r,s)=>this.renderer.render(e,t,r,s),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,s)=>t.options.screenshot.renderOverlay(e,r,s)};this._screenshotManager=new J(this._rctx,i,e=>t.view.overlayManager.updateOverlays(Z,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=o(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=o(this._rctx),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;new W({view:e}),f(e.spatialReference)||(this.glow=new O({view:e}),2===t?new j({view:e}):g(e.spatialReference)?new y({view:e}):(new x({view:e}),new R({view:e}),new U({view:e}),this.fog=new b({view:e}))),has("global-illumination")?this.globalIllumination=new T({view:e}):new F({view:e}),new k({view:e,isEnabled:()=>this.renderer.hasSMAA}),new D({view:e}),new q({view:e}),new L({view:e}),new M({view:e,viewingMode:t}),new S({view:e}),C()&&new A({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0;case 0:this._needsRender=!0}}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,n,o=n){const a=i.constrainWindowSize(t,r,n*i.pixelRatio,o*i.pixelRatio),h=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,h);const l=(e,t,r)=>s(t,e)*(r[1]-r[0])+r[0];let d=Number.MAX_VALUE;for(let s=0;s<a[2]*a[3];s++){const e=l(4*s,h,i.nearFar);d>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(d=e)}if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&d>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(d=s)}return d===Number.MAX_VALUE?void 0:d}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){Q(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,s=0,i=!1;const n={preRender:({time:i})=>{r=this.updating,s=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),i=this.test?.time??i;const n=p(i-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(n>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,i)&&this.requestRender(0),this._lastAnimationUpdate=i)},render:({time:e})=>{if((this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const r=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,e=this.test?.time??e,this.renderer.render(t,e,0),i=!0,r&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();const r=new K(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{i&&(this.renderer.finish(2===t.mode?s:1),i=!1)}};this._frameTask=c(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const s={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",s);if(null==n)return void i.getLogger(this).error("A WebGL2 context could not be created.");$(n,!0),this._rctx=te(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&i.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new w(this.renderer.renderPassManager,this._viewingMode,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){null!=this.test?.time&&null!=e.fadeDuration&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=p(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}};function te(e,t){const r=new G(t);if(Y.enabled){let t=re.get(e);return 1===t?.refCount?(t.configure(r),t.ref(),t):(t=new I(e,r),re.set(e,t),t.ref(),t)}return new I(e,r)}e([m({type:Boolean,readOnly:!0})],ee.prototype,"updating",null),e([m({constructOnly:!0})],ee.prototype,"view",void 0),e([m({readOnly:!0})],ee.prototype,"componentObjectCollection",null),e([m()],ee.prototype,"_componentObjectCollection",void 0),e([m()],ee.prototype,"_needsUpdate",void 0),e([m()],ee.prototype,"_needsWaterReflectionUpdate",void 0),ee=e([u("esri.views.3d.webgl-engine.parts.RenderView")],ee);const re=X();export{ee as RenderView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as o}from"../materials/DefaultTechniqueConfiguration.js";class i extends o{constructor(e){super(),this.spherical=e,this.overlayMode=0,this.tileBlendInput=0,this.transparencyMode=0,this.pbrMode=5,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.tileBorders=!1,this.normalType=1,this.textureCoordinateType=1,this.emissionSource=0,this.highStepCount=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0,this.draped=!1,this.discardInvisibleFragments=!0,this.oitPremultipliedAlpha=!0,this.snowCover=!1}get overlayEnabled(){return 0!==this.overlayMode}get hasWater(){return 11!==this.output}}e([t({count:3})],i.prototype,"overlayMode",void 0),e([t({count:3})],i.prototype,"tileBlendInput",void 0),e([t({count:4})],i.prototype,"transparencyMode",void 0),e([t({count:7})],i.prototype,"pbrMode",void 0),e([t()],i.prototype,"receiveShadows",void 0),e([t()],i.prototype,"hasShadowHighlights",void 0),e([t()],i.prototype,"textureFadingEnabled",void 0),e([t()],i.prototype,"renderOccluded",void 0),e([t()],i.prototype,"screenSpaceReflections",void 0),e([t()],i.prototype,"cloudReflections",void 0),e([t()],i.prototype,"receiveAmbientOcclusion",void 0),e([t()],i.prototype,"receiveGlobalIllumination",void 0),e([t()],i.prototype,"tileBorders",void 0);export{i as TerrainTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as o}from"../materials/DefaultTechniqueConfiguration.js";class i extends o{constructor(e){super(),this.spherical=e,this.overlayMode=0,this.tileBlendInput=0,this.transparencyMode=0,this.pbrMode=5,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.tileBorders=!1,this.normalType=1,this.textureCoordinateType=1,this.emissionSource=0,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=75,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0,this.draped=!1,this.discardInvisibleFragments=!0,this.oitPremultipliedAlpha=!0,this.snowCover=!1}get overlayEnabled(){return 0!==this.overlayMode}get hasWater(){return 11!==this.output}}e([t({count:3})],i.prototype,"overlayMode",void 0),e([t({count:3})],i.prototype,"tileBlendInput",void 0),e([t({count:4})],i.prototype,"transparencyMode",void 0),e([t({count:7})],i.prototype,"pbrMode",void 0),e([t()],i.prototype,"receiveShadows",void 0),e([t()],i.prototype,"hasShadowHighlights",void 0),e([t()],i.prototype,"textureFadingEnabled",void 0),e([t()],i.prototype,"renderOccluded",void 0),e([t()],i.prototype,"screenSpaceReflections",void 0),e([t()],i.prototype,"cloudReflections",void 0),e([t()],i.prototype,"receiveAmbientOcclusion",void 0),e([t()],i.prototype,"receiveGlobalIllumination",void 0),e([t()],i.prototype,"tileBorders",void 0);export{i as TerrainTechniqueConfiguration};
package/webmap/utils.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../core/Version.js";function r(e){return null!=e&&"object"==typeof e&&"declaredClass"in e&&"esri.WebMap"===e.declaredClass}const o=new e(2,36,"webmap");export{o as currentVersion,r as isWebMap};
2
+ import e from"../core/Version.js";function r(e){return null!=e&&"object"==typeof e&&"declaredClass"in e&&"esri.WebMap"===e.declaredClass}const o=new e(2,37,"webmap");export{o as currentVersion,r as isWebMap};