@arcgis/core 4.33.0-next.20250312 → 4.33.0-next.20250314

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 (174) hide show
  1. package/Basemap.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/065ae931b5891847a06f.js +1 -0
  4. package/assets/esri/core/workers/chunks/{4263eee3247aaf4e64bf.js → 147e412de9972da16a1d.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{3ee2cf2db08164cde43c.js → 23aa7254fffe67e3f1bc.js} +74 -75
  6. package/assets/esri/core/workers/chunks/29ba2022c2978e9bd53e.js +1 -0
  7. package/assets/esri/core/workers/chunks/2b21152c7e2d9c170ed7.js +1 -0
  8. package/assets/esri/core/workers/chunks/7ded83eb64eff069b761.js +1 -0
  9. package/assets/esri/core/workers/chunks/a7a1832274892e99c388.js +1 -0
  10. package/assets/esri/core/workers/chunks/c43c273725b1a33712ec.js +314 -0
  11. package/assets/esri/core/workers/chunks/{2c227d97d00b3849f441.js → d459c790a3b89ac53d2d.js} +1 -1
  12. package/chunks/ComponentShader.glsl.js +7 -8
  13. package/chunks/FocusAreaMask.glsl.js +2 -1
  14. package/chunks/HighlightApply.glsl.js +27 -132
  15. package/chunks/{SingleHighlightBlur.glsl.js → HighlightBlur.glsl.js} +4 -4
  16. package/chunks/HighlightDownsample.glsl.js +8 -8
  17. package/chunks/HighlightToSingle.glsl.js +2 -2
  18. package/chunks/ShadowHighlight.glsl.js +5 -6
  19. package/chunks/Terrain.glsl.js +15 -16
  20. package/core/has.js +1 -1
  21. package/layers/VoxelWasmPerSceneView.js +1 -1
  22. package/layers/orientedImagery/transformations/utils.js +1 -1
  23. package/layers/support/layerUtils.js +1 -1
  24. package/package.json +1 -1
  25. package/support/revision.js +1 -1
  26. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  27. package/views/2d/engine/webgl/Painter.js +1 -1
  28. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  29. package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
  30. package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
  31. package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
  32. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  33. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  34. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  35. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  36. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  37. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  38. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  39. package/views/3d/environment/CloudsRenderer.js +1 -1
  40. package/views/3d/environment/EnvironmentManager.js +1 -1
  41. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  42. package/views/3d/environment/Fog.js +1 -1
  43. package/views/3d/environment/MarsAtmosphere.js +1 -1
  44. package/views/3d/environment/Precipitation.js +1 -1
  45. package/views/3d/interactive/Manipulator3D.js +1 -1
  46. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
  47. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  48. package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
  49. package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
  50. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  51. package/views/3d/interactive/visualElements/VisualElement.js +1 -1
  52. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  53. package/views/3d/layers/DrapedSubView3D.js +5 -0
  54. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  55. package/views/3d/layers/I3SMeshView3D.js +1 -1
  56. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  57. package/views/3d/layers/ImagerySubView3D.js +5 -0
  58. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  59. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  60. package/views/3d/layers/Lyr3DWasm.js +1 -1
  61. package/views/3d/layers/MediaLayerView3D.js +1 -1
  62. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  63. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  64. package/views/3d/layers/SubView3D.js +5 -0
  65. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  66. package/views/3d/layers/WMSLayerView3D.js +1 -1
  67. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  68. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  69. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  70. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  71. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  72. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  73. package/views/3d/layers/graphics/Labeler.js +1 -1
  74. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  75. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  76. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
  77. package/views/3d/layers/graphics/pipeline/featureData/processingUtils.js +1 -1
  78. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  79. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  80. package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
  81. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
  82. package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
  83. package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
  84. package/views/3d/layers/graphics/pipeline/utils.js +1 -1
  85. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  86. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  87. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  88. package/views/3d/state/ViewStateManager.js +1 -1
  89. package/views/3d/state/controllers/FovController.js +1 -1
  90. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  91. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  92. package/views/3d/state/controllers/RotateController.js +1 -1
  93. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  94. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  95. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  96. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  97. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  98. package/views/3d/support/MemoryController.js +1 -1
  99. package/views/3d/support/SceneViewPerformanceInfo.js +1 -1
  100. package/views/3d/support/SharedSymbolResources.js +1 -1
  101. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  102. package/views/3d/support/flowUtils.js +5 -0
  103. package/views/3d/terrain/OverlayManager.js +1 -1
  104. package/views/3d/terrain/OverlayRenderTargets.js +1 -1
  105. package/views/3d/terrain/OverlayRenderer.js +1 -1
  106. package/views/3d/terrain/TerrainSurface.js +1 -1
  107. package/views/3d/terrain/TileCompositor.js +1 -1
  108. package/views/3d/terrain/TileRenderer.js +1 -1
  109. package/views/3d/webgl/ManagedFBO.js +1 -1
  110. package/views/3d/webgl/RenderNode.js +1 -1
  111. package/views/3d/webgl/formats.js +1 -1
  112. package/views/3d/webgl-engine/Stage.js +1 -1
  113. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  114. package/views/3d/webgl-engine/core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js +2 -2
  115. package/views/3d/webgl-engine/core/shaderLibrary/HighlightReadBitmap.glsl.js +3 -3
  116. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +7 -8
  117. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +18 -18
  118. package/views/3d/webgl-engine/core/shaderModules/UintTexture2DBindUniform.js +5 -0
  119. package/views/3d/webgl-engine/core/shaderModules/UintTexture2DDrawUniform.js +5 -0
  120. package/views/3d/webgl-engine/core/shaderModules/UintTexture2DPassUniform.js +5 -0
  121. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  122. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  123. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  124. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  125. package/views/3d/webgl-engine/effects/geometry/ObjectAndLayerIDRenderNode.js +1 -1
  126. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  127. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  128. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  129. package/views/3d/webgl-engine/effects/highlight/HighlightBlurTechnique.js +5 -0
  130. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  131. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  132. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  133. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  134. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  135. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  136. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  137. package/views/3d/webgl-engine/lib/Program.js +1 -1
  138. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  139. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  140. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  141. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  142. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  143. package/views/3d/webgl-engine/shaders/{SingleHighlightBlur.glsl.js → HighlightBlur.glsl.js} +1 -1
  144. package/views/3d/webgl-engine/shaders/HighlightDownsample.glsl.js +1 -1
  145. package/views/3d/webgl-engine/shaders/HighlightToSingle.glsl.js +1 -1
  146. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  147. package/views/FocusAreas.js +1 -1
  148. package/views/SceneView.js +1 -1
  149. package/views/support/imageReprojection.js +1 -1
  150. package/views/webgl/FramebufferObject.js +1 -1
  151. package/views/webgl/Program.js +1 -1
  152. package/views/webgl/RenderingContext.js +1 -1
  153. package/views/webgl/ShaderBuilder.js +1 -1
  154. package/views/webgl/ShaderTranspiler.js +1 -1
  155. package/views/webgl/Texture.js +1 -1
  156. package/views/webgl/ValidatedTextureDescriptor.js +1 -1
  157. package/views/webgl/capabilities/Capabilities.js +1 -1
  158. package/views/webgl/checkWebGLError.js +1 -1
  159. package/views/webgl/enums.js +1 -1
  160. package/views/webgl/testFloatBufferBlend.js +1 -1
  161. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  162. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  163. package/widgets/OrientedImageryViewer/dataCaptureUtils.js +1 -1
  164. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  165. package/assets/esri/core/workers/chunks/15fe629cd4da1bb2169f.js +0 -1
  166. package/assets/esri/core/workers/chunks/8196ff250c0de00104f7.js +0 -1
  167. package/assets/esri/core/workers/chunks/be883ebdbaf11647b718.js +0 -1
  168. package/assets/esri/core/workers/chunks/d0ad20548eb4786b7750.js +0 -314
  169. package/assets/esri/core/workers/chunks/d374d2a1487faee3672d.js +0 -1
  170. package/assets/esri/core/workers/chunks/dbdca19978fbee8dc106.js +0 -1
  171. package/chunks/SingleHighlightApply.glsl.js +0 -32
  172. package/views/3d/webgl-engine/effects/highlight/SingleHighlightApplyTechnique.js +0 -5
  173. package/views/3d/webgl-engine/effects/highlight/SingleHighlightBlurTechnique.js +0 -5
  174. package/views/3d/webgl-engine/shaders/SingleHighlightApply.glsl.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import"../../../core/has.js";import r from"../../../core/PooledArray.js";import{isPromiseLike as s}from"../../../core/promiseUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{isIntersectionHandler as o}from"../state/helpers/SceneIntersectionHelper.js";import{ChangeSet as d}from"./lib/ChangeSet.js";import{UpdatePolicy as a}from"./lib/UpdatePolicy.js";import{isWebGLLayer as h}from"./lib/WebGLLayer.js";import{Model as y}from"./parts/Model.js";import{RenderView as c}from"./parts/RenderView.js";import{TaskPriority as l,noBudget as m}from"../../support/Scheduler.js";import{Yield as p}from"../../support/Yield.js";let _=class extends t{constructor(e){super(e),this._model=new y,this._layers=new r,this._asyncChangeSet=new d,this._syncChangeSet=new d,this._layerSyncSet=new Set}initialize(){this._set("renderView",new c({stage:this})),this._frameTask=this.view.resourceController.scheduler.registerTask(l.STAGE,this),this.addHandles(this._frameTask)}destroy(){this.renderView.destroy()}get viewingMode(){return this.view.state.viewingMode}get updating(){return this.running||this.renderView.updating||this._frameTask.updating}get renderer(){return this.renderView?.renderer}add(e){this._model.add(e),h(e)&&this._addLayer(e),this.renderView.requestRender()}remove(e){null!=e&&!this.destroyed&&this._model.remove(e)&&(h(e)&&this._removeLayer(e),this.renderView.requestRender())}addMany(e){null!=e&&(this._model.addMany(e),this.renderView.requestRender())}removeMany(e){null!=e&&(this._model?.removeMany(e),this.renderView?.requestRender())}forEachOfType(e,t){this._model.forEachOfType(e,t)}handleEvent(e,t){this.destroyed||(this._model.dirtySet[e](t),this.renderView.requestRender())}get running(){return this._model.dirtySet.dirty||!this._asyncChangeSet.empty}runTask(e){if(this._frameTask.processQueue(e),this._commit(e),!e.hasProgressed)return p}_commit(e){const t=this._model.dirtySet;this._asyncChangeSet.empty||e.done||(this.renderer.modify(this._asyncChangeSet,e),this.renderView.requestRender(),e.madeProgress()),this._layers.forAll((r=>{if(e.done)return;const s=this._layerSyncSet.has(r.id)||r.updatePolicy===a.SYNC,i=s?this._syncChangeSet:this._asyncChangeSet;t.commitLayer(r.id,i),this._layerSyncSet.delete(r.id),i.empty||(this.renderer.modify(i,s?m:e),this.renderView.requestRender(),e.madeProgress())})),this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,m),this.renderView.requestRender(),e.madeProgress()),this._layers.forAll((r=>{e.done||this._layerSyncSet.has(r.id)||r.updatePolicy!==a.ASYNC||(t.commitLayer(r.id,this._asyncChangeSet),this._asyncChangeSet.empty||(this.renderer.modify(this._asyncChangeSet,e),this.renderView.requestRender(),e.madeProgress()))})),this._layerSyncSet.clear(),this.notifyChange("running")}commitSyncLayers(){const e=this._model.dirtySet;this._layers.forAll((t=>{this._layerSyncSet.has(t.id)||t.updatePolicy===a.SYNC?(e.commitLayer(t.id,this._syncChangeSet),this._layerSyncSet.delete(t.id)):e.commitSyncUpdates(t.id,this._syncChangeSet)}));for(const t of this._layerSyncSet)e.commitLayer(t,this._syncChangeSet);this._layerSyncSet.clear(),this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,m),this.renderView.requestRender())}_commitLayer(e){this._model.dirtySet.commitLayer(e.id,this._syncChangeSet),this._layerSyncSet.delete(e.id),this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,m),this.renderView.requestRender())}schedule(e,t){return this._frameTask.schedule(e,t)}reschedule(e,t){return this._frameTask.reschedule(e,t)}syncLayer(e){this._layerSyncSet.add(e),this.renderView.requestRender()}getObject(e){return this._model.getObject(e)}get layers(){return this._layers}_addLayer(e){this._layers.includes(e)||this._layers.push(e)}_removeLayer(e){this._commitLayer(e),null!=this._layers.removeUnordered(e)&&(this._model.dirtySet.getResidentRenderGeometries(e.id,this._syncChangeSet.removes),this.renderer.modify(this._syncChangeSet,m))}addRenderPlugin(e,t){const r=this.renderer.plugins.add(e,t),i=()=>{o(e)&&this.view.sceneIntersectionHelper.addIntersectionHandler(e)};if(s(r))return r.then(i);i()}removeRenderPlugin(e){this.destroyed||(o(e)&&this.view.sceneIntersectionHelper.removeIntersectionHandler(e),this.renderer.plugins.remove(e))}get performanceInfo(){return this._model.getStats()}get test(){}};e([i({constructOnly:!0})],_.prototype,"view",void 0),e([i({constructOnly:!0})],_.prototype,"options",void 0),e([i({readOnly:!0})],_.prototype,"viewingMode",null),e([i({constructOnly:!0})],_.prototype,"container",void 0),e([i({readOnly:!0})],_.prototype,"updating",null),e([i({constructOnly:!0})],_.prototype,"_model",void 0),e([i()],_.prototype,"renderView",void 0),e([i({readOnly:!0})],_.prototype,"renderer",null),e([i({readOnly:!0})],_.prototype,"running",null),_=e([n("esri.views.3d.webgl-engine.Stage")],_);export{_ as Stage};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import"../../../core/has.js";import r from"../../../core/PooledArray.js";import{isPromiseLike as s}from"../../../core/promiseUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{isIntersectionHandler as o}from"../state/helpers/SceneIntersectionHelper.js";import{TextureCollection as d}from"../support/TextureCollection.js";import{ChangeSet as h}from"./lib/ChangeSet.js";import{UpdatePolicy as a}from"./lib/UpdatePolicy.js";import{isWebGLLayer as y}from"./lib/WebGLLayer.js";import{Model as c}from"./parts/Model.js";import{RenderView as l}from"./parts/RenderView.js";import{TaskPriority as m,noBudget as p}from"../../support/Scheduler.js";import{Yield as u}from"../../support/Yield.js";let _=class extends t{constructor(e){super(e),this._model=new c,this._layers=new r,this._asyncChangeSet=new h,this._syncChangeSet=new h,this._layerSyncSet=new Set,this.textures=new d(this,e.view.resourceController.scheduler),this._frameTask=e.view.resourceController.scheduler.registerTask(m.STAGE,this),this.addHandles(this._frameTask)}initialize(){this._renderView=new l({stage:this})}destroy(){this.textures.destroy(),this.renderView.destroy()}get viewingMode(){return this.view.state.viewingMode}get updating(){return this.running||this.renderView.updating||this._frameTask.updating||this.textures.updating}get renderView(){return this._renderView}get renderer(){return this.renderView.renderer}add(e){this._model.add(e),y(e)&&this._addLayer(e),this.renderView.requestRender()}remove(e){null!=e&&!this.destroyed&&this._model.remove(e)&&(y(e)&&this._removeLayer(e),this.renderView.requestRender())}addMany(e){null!=e&&(this._model.addMany(e),this.renderView.requestRender())}removeMany(e){null!=e&&(this._model?.removeMany(e),this.renderView.requestRender())}forEachOfType(e,t){this._model.forEachOfType(e,t)}handleEvent(e,t){this.destroyed||(this._model.dirtySet[e](t),this.renderView.requestRender())}get running(){return this._model.dirtySet.dirty||!this._asyncChangeSet.empty}runTask(e){if(this._frameTask.processQueue(e),this._commit(e),!e.hasProgressed)return u}_commit(e){const t=this._model.dirtySet;this._asyncChangeSet.empty||e.done||(this.renderer.modify(this._asyncChangeSet,e),this.renderView.requestRender(),e.madeProgress()),this._layers.forAll((r=>{if(e.done)return;const s=this._layerSyncSet.has(r.id)||r.updatePolicy===a.SYNC,i=s?this._syncChangeSet:this._asyncChangeSet;t.commitLayer(r.id,i),this._layerSyncSet.delete(r.id),i.empty||(this.renderer.modify(i,s?p:e),this.renderView.requestRender(),e.madeProgress())})),this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,p),this.renderView.requestRender(),e.madeProgress()),this._layers.forAll((r=>{e.done||this._layerSyncSet.has(r.id)||r.updatePolicy!==a.ASYNC||(t.commitLayer(r.id,this._asyncChangeSet),this._asyncChangeSet.empty||(this.renderer.modify(this._asyncChangeSet,e),this.renderView.requestRender(),e.madeProgress()))})),this._layerSyncSet.clear(),this.notifyChange("running")}commitSyncLayers(){const e=this._model.dirtySet;this._layers.forAll((t=>{this._layerSyncSet.has(t.id)||t.updatePolicy===a.SYNC?(e.commitLayer(t.id,this._syncChangeSet),this._layerSyncSet.delete(t.id)):e.commitSyncUpdates(t.id,this._syncChangeSet)}));for(const t of this._layerSyncSet)e.commitLayer(t,this._syncChangeSet);this._layerSyncSet.clear(),this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,p),this.renderView.requestRender())}_commitLayer(e){this._model.dirtySet.commitLayer(e.id,this._syncChangeSet),this._layerSyncSet.delete(e.id),this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,p),this.renderView.requestRender())}schedule(e,t){return this._frameTask.schedule(e,t)}reschedule(e,t){return this._frameTask.reschedule(e,t)}syncLayer(e){this._layerSyncSet.add(e),this.renderView.requestRender()}getObject(e){return this._model.getObject(e)}get layers(){return this._layers}_addLayer(e){this._layers.includes(e)||this._layers.push(e)}_removeLayer(e){this._commitLayer(e),null!=this._layers.removeUnordered(e)&&(this._model.dirtySet.getResidentRenderGeometries(e.id,this._syncChangeSet.removes),this.renderer.modify(this._syncChangeSet,p))}addRenderPlugin(e,t){const r=this.renderer.plugins.add(e,t),i=()=>{o(e)&&this.view.sceneIntersectionHelper.addIntersectionHandler(e)};if(s(r))return r.then(i);i()}removeRenderPlugin(e){this.destroyed||(o(e)&&this.view.sceneIntersectionHelper.removeIntersectionHandler(e),this.renderer.plugins.remove(e))}get performanceInfo(){return this._model.getStats()}get test(){}};e([i({constructOnly:!0})],_.prototype,"view",void 0),e([i({constructOnly:!0})],_.prototype,"options",void 0),e([i({readOnly:!0})],_.prototype,"viewingMode",null),e([i({constructOnly:!0})],_.prototype,"container",void 0),e([i({readOnly:!0})],_.prototype,"updating",null),e([i({constructOnly:!0})],_.prototype,"_model",void 0),e([i()],_.prototype,"_renderView",void 0),e([i({readOnly:!0})],_.prototype,"renderer",null),e([i()],_.prototype,"textures",void 0),e([i({readOnly:!0})],_.prototype,"running",null),_=e([n("esri.views.3d.webgl-engine.Stage")],_);export{_ as Stage};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{ColorFormat as t,DepthFormat as r}from"../../webgl/formats.js";import{ManagedColorAttachment as a}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthAttachment as o}from"../../webgl/ManagedDepthAttachment.js";import c from"../../webgl/ManagedFBO.js";import{AttachmentType as i}from"../../webgl/ManagedFBObject.js";import{FBOPool as h}from"./FBOPool.js";import{PixelFormat as n,SizedPixelFormat as s,TextureWrapMode as m,PixelType as _,TextureSamplingMode as d,RenderbufferFormat as l,ColorAttachment as u}from"../../../webgl/enums.js";import{FramebufferObject as p}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as f}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as w}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as E}from"../../../webgl/Texture.js";import{TextureDescriptor as C}from"../../../webgl/TextureDescriptor.js";class T{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new h(e.newCache,"FBOCache"),this._depthCache=new h(e.newCache,"DepthAttachmentCache"),this._colorCache=new h(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.()}frameEnd(){const e=this.debugCallback;e&&this._acquired.forEach((t=>t.type===i.FBO&&e(t.name,t.fbo,t.numberOfColorAttachments)))}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+("getTexture"in t?t.getTexture()?.usedMemory??0:t.cachedMemory)),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e}acquire(a,o,i,h=t.RGBA){const n=A(h,a,o);let s=this._cache.pop(n);if(s){s.retain(),s.setName(i);const t=this.rctx.getBoundFramebufferObject();if(this.rctx.bindFramebuffer(s.fbo),this.rctx.setDrawBuffers([u.COLOR_ATTACHMENT0]),!s.fbo)throw new e("attempt to use a not existing framebuffer");this.rctx.unbindTexture(s.fbo.colorTexture),this.rctx.bindFramebuffer(t)}else s=new c(n,i,new p(this.rctx,{...G[h],width:a,height:o}),(e=>{e??=r.DEPTH_STENCIL_TEXTURE;const t=this._acquireDepth(e,s.fbo.width,s.fbo.height,`${s.name} depth`);return s.attachDepth(t),t.release(),s}),((e,r,c)=>{r??=t.RGBA;const i=this._acquireColor(r,a,o,c??`${s.name} color ${e}`);return this.rctx.unbindTexture(i.attachment),s.attachColor(i,e),i.release(),s}),(()=>{this.debugCallback?.(s.name,s.fbo,s.numberOfColorAttachments),this._acquired.delete(s),s.detachAll(),this._cache.put(s)}));return this._trackHandle(s)}acquireDepth(e,t,r,a){return this._acquireDepth(e,t,r,a)}_acquireDepth(e,t,a,c){const i=A(e,t,a),h=this._depthCache.pop(i);if(h)return h.retain(),h.name=c,this._trackHandle(h);const n=e===r.DEPTH_STENCIL_TEXTURE?new o(i,new E(this.rctx,{...P[e],width:t,height:a}),(()=>{this._acquired.delete(n),this._depthCache.put(n)})):new o(i,new f(this.rctx,{...P[e],width:t,height:a}),(()=>{this._acquired.delete(n),this._depthCache.put(n)}));return n.name=c,this._trackHandle(n)}_acquireColor(e,t,r,o){const c=A(e,t,r),i=this._colorCache.pop(c);if(i)return i.retain(),i.name=o,this._trackHandle(i);const h=new a(c,new E(this.rctx,{...G[e],width:t,height:r}),(()=>{this._acquired.delete(h),this._colorCache.put(h)}));return h.name=o,this._trackHandle(h)}_trackHandle(e){return this._acquired.add(e),e}}const b=new c("default","default",null,(()=>b),(()=>b),(()=>{}));function A(e,t,r){return`${e}x${t}x${r}`}b.release=()=>!1;const M=new C;M.pixelFormat=n.RED,M.internalFormat=s.R8,M.wrapMode=m.CLAMP_TO_EDGE;const g=new C;g.pixelFormat=n.RG,g.internalFormat=s.RG8,g.wrapMode=m.CLAMP_TO_EDGE;const R=new C;R.internalFormat=s.RGBA4,R.dataType=_.UNSIGNED_SHORT_4_4_4_4,R.wrapMode=m.CLAMP_TO_EDGE;const F=new C;F.wrapMode=m.CLAMP_TO_EDGE;const x=new C;x.wrapMode=m.CLAMP_TO_EDGE,x.samplingMode=d.LINEAR_MIPMAP_LINEAR,x.hasMipmap=!0,x.maxAnisotropy=8;const D=new C;D.pixelFormat=n.RED,D.dataType=_.HALF_FLOAT,D.internalFormat=s.R16F,D.samplingMode=d.NEAREST;const O=new C;O.dataType=_.HALF_FLOAT,O.internalFormat=s.RGBA16F,O.samplingMode=d.NEAREST;const G={[t.RED]:M,[t.RG]:g,[t.RGBA4]:R,[t.RGBA]:F,[t.RGBA_MIPMAP]:x,[t.R16F]:D,[t.RGBA16F]:O},N=new C;N.pixelFormat=n.DEPTH_STENCIL,N.dataType=_.UNSIGNED_INT_24_8,N.samplingMode=d.NEAREST,N.wrapMode=m.CLAMP_TO_EDGE,N.internalFormat=n.DEPTH24_STENCIL8;const P={[r.DEPTH_STENCIL_TEXTURE]:N,[r.DEPTH16_BUFFER]:new w(l.DEPTH_COMPONENT16,4)};export{T as FBOCache,b as defaultWebGLFBO};
5
+ import e from"../../../../core/Error.js";import{ColorFormat as t,DepthFormat as r}from"../../webgl/formats.js";import{ManagedColorAttachment as a}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthAttachment as o}from"../../webgl/ManagedDepthAttachment.js";import i from"../../webgl/ManagedFBO.js";import{AttachmentType as n}from"../../webgl/ManagedFBObject.js";import{FBOPool as c}from"./FBOPool.js";import{PixelFormat as h,SizedPixelFormat as s,TextureWrapMode as m,TextureSamplingMode as _,PixelType as d,RenderbufferFormat as l,ColorAttachment0 as p}from"../../../webgl/enums.js";import{FramebufferObject as u}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as E}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as f}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as w}from"../../../webgl/Texture.js";import{TextureDescriptor as T}from"../../../webgl/TextureDescriptor.js";class C{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new c(e.newCache,"FBOCache"),this._depthCache=new c(e.newCache,"DepthAttachmentCache"),this._colorCache=new c(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.()}frameEnd(){const e=this.debugCallback;e&&this._acquired.forEach((t=>t.type===n.FBO&&e(t.name,t.fbo,t.numberOfColorAttachments)))}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+("getTexture"in t?t.getTexture()?.usedMemory??0:t.cachedMemory)),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e}acquire(a,o,n,c=t.RGBA){const h=R(c,a,o);let s=this._cache.pop(h);if(s){s.retain(),s.setName(n);const t=this.rctx.getBoundFramebufferObject();if(this.rctx.bindFramebuffer(s.fbo),this.rctx.setDrawBuffers([p]),!s.fbo)throw new e("attempt to use a not existing framebuffer");this.rctx.unbindTexture(s.fbo.colorTexture),this.rctx.bindFramebuffer(t)}else s=new i(h,n,new u(this.rctx,{...P[c],width:a,height:o}),(e=>{e??=r.DEPTH_STENCIL_TEXTURE;const t=this._acquireDepth(e,s.fbo.width,s.fbo.height,`${s.name} depth`);return s.attachDepth(t),t.release(),s}),((e,r,i)=>{r??=t.RGBA;const n=this._acquireColor(r,a,o,i??`${s.name} color ${e}`);return this.rctx.unbindTexture(n.attachment),s.attachColor(n,e),n.release(),s}),(()=>{this.debugCallback?.(s.name,s.fbo,s.numberOfColorAttachments),this._acquired.delete(s),s.detachAll(),this._cache.put(s)}));return this._trackHandle(s)}acquireDepth(e,t,r,a){return this._acquireDepth(e,t,r,a)}_acquireDepth(e,t,a,i){const n=R(e,t,a),c=this._depthCache.pop(n);if(c)return c.retain(),c.name=i,this._trackHandle(c);const h=e===r.DEPTH_STENCIL_TEXTURE?new o(n,new w(this.rctx,{...I[e],width:t,height:a}),(()=>{this._acquired.delete(h),this._depthCache.put(h)})):new o(n,new E(this.rctx,{...I[e],width:t,height:a}),(()=>{this._acquired.delete(h),this._depthCache.put(h)}));return h.name=i,this._trackHandle(h)}_acquireColor(e,t,r,o){const i=R(e,t,r),n=this._colorCache.pop(i);if(n)return n.retain(),n.name=o,this._trackHandle(n);const c=new a(i,new w(this.rctx,{...P[e],width:t,height:r}),(()=>{this._acquired.delete(c),this._colorCache.put(c)}));return c.name=o,this._trackHandle(c)}_trackHandle(e){return this._acquired.add(e),e}}const b=new i("default","default",null,(()=>b),(()=>b),(()=>{}));function R(e,t,r){return`${e}x${t}x${r}`}b.release=()=>!1;const A=new T;A.pixelFormat=h.RED,A.internalFormat=s.R8,A.wrapMode=m.CLAMP_TO_EDGE;const M=new T;M.pixelFormat=h.RED_INTEGER,M.internalFormat=s.R8UI,M.wrapMode=m.CLAMP_TO_EDGE,M.samplingMode=_.NEAREST;const g=new T;g.pixelFormat=h.RG,g.internalFormat=s.RG8,g.wrapMode=m.CLAMP_TO_EDGE;const F=new T;F.pixelFormat=h.RG_INTEGER,F.internalFormat=s.RG8UI,F.wrapMode=m.CLAMP_TO_EDGE,F.samplingMode=_.NEAREST;const D=new T;D.internalFormat=s.RGBA4,D.dataType=d.UNSIGNED_SHORT_4_4_4_4,D.wrapMode=m.CLAMP_TO_EDGE;const x=new T;x.wrapMode=m.CLAMP_TO_EDGE;const G=new T;G.wrapMode=m.CLAMP_TO_EDGE,G.samplingMode=_.LINEAR_MIPMAP_LINEAR,G.hasMipmap=!0,G.maxAnisotropy=8;const N=new T;N.pixelFormat=h.RED,N.dataType=d.HALF_FLOAT,N.internalFormat=s.R16F,N.samplingMode=_.NEAREST;const O=new T;O.dataType=d.HALF_FLOAT,O.internalFormat=s.RGBA16F,O.samplingMode=_.NEAREST;const P={[t.RED]:A,[t.R8UI]:M,[t.RG]:g,[t.RG8UI]:F,[t.RGBA4]:D,[t.RGBA]:x,[t.RGBA_MIPMAP]:G,[t.R16F]:N,[t.RGBA16F]:O},L=new T;L.pixelFormat=h.DEPTH_STENCIL,L.dataType=d.UNSIGNED_INT_24_8,L.samplingMode=_.NEAREST,L.wrapMode=m.CLAMP_TO_EDGE,L.internalFormat=h.DEPTH24_STENCIL8;const I={[r.DEPTH_STENCIL_TEXTURE]:L,[r.DEPTH16_BUFFER]:new f(l.DEPTH_COMPONENT16,4)};export{C as FBOCache,b as defaultWebGLFBO};
@@ -2,11 +2,11 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{set as e}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{glsl as i}from"../shaderModules/glsl.js";import{Integer2PassUniform as t}from"../shaderModules/Integer2PassUniform.js";import{IntegerPassUniform as o}from"../shaderModules/IntegerPassUniform.js";import{Texture2DPassUniform as n}from"../shaderModules/Texture2DPassUniform.js";import{g as c}from"../../../../../chunks/HighlightDownsample.glsl.js";function s(l){const{vertex:s}=l;s.uniforms.add(new n("coverageTexture",(e=>e.coverageTexture)),new t("highlightRenderCellCount",(l=>e(r,l.horizontalCellCount,l.verticalCellCount))),new t("highlightTextureResolution",(({highlightTexture:l})=>e(r,l.descriptor.width,l.descriptor.height))),new o("highlightLevel",(e=>e.highlightLevel))).constants.add("cellSize","int",c),l.varyings.add("sUV","vec2"),l.varyings.add("vOutlinePossible","float"),s.code.add(i`const ivec2 cellVertices[4] = ivec2[4](ivec2(0,0), ivec2(1,0), ivec2(0,1), ivec2(1,1));`).main.add(i`int cellIndex = gl_InstanceID;
5
+ import{set as e}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{glsl as i}from"../shaderModules/glsl.js";import{Integer2PassUniform as t}from"../shaderModules/Integer2PassUniform.js";import{IntegerPassUniform as o}from"../shaderModules/IntegerPassUniform.js";import{UintTexture2DPassUniform as n}from"../shaderModules/UintTexture2DPassUniform.js";import{g as c}from"../../../../../chunks/HighlightDownsample.glsl.js";function s(l){const{vertex:s}=l;s.uniforms.add(new n("coverageTexture",(e=>e.coverageTexture)),new t("highlightRenderCellCount",(l=>e(r,l.horizontalCellCount,l.verticalCellCount))),new t("highlightTextureResolution",(({highlightTexture:l})=>e(r,l.descriptor.width,l.descriptor.height))),new o("highlightLevel",(e=>e.highlightLevel))).constants.add("cellSize","int",c),l.varyings.add("sUV","vec2"),l.varyings.add("vOutlinePossible","float"),s.code.add(i`const ivec2 cellVertices[4] = ivec2[4](ivec2(0,0), ivec2(1,0), ivec2(0,1), ivec2(1,1));`),s.main.add(i`int cellIndex = gl_InstanceID;
6
6
  int cellX = cellIndex % highlightRenderCellCount[0];
7
7
  int cellY = (cellIndex - cellX) / highlightRenderCellCount[0];
8
8
  ivec2 cellPos = ivec2(cellX, cellY);
9
- uvec2 covTexel = uvec2(texelFetch(coverageTexture, cellPos, 0).rg * 255.0);
9
+ uvec2 covTexel = texelFetch(coverageTexture, cellPos, 0).rg;
10
10
  int channelIndex = (highlightLevel >> 2) & 3;
11
11
  uint channelValue = covTexel[channelIndex];
12
12
  int highlightIndex = (highlightLevel & 3) << 1;
@@ -6,10 +6,10 @@ import{glsl as e}from"../shaderModules/glsl.js";function l(l){const{fragment:t}=
6
6
  int llc = (highlightLevel & 3) << 1;
7
7
  return (channel >> llc) & 3u;
8
8
  }
9
- uint readChannel(vec2 texel, int highlightLevel) {
9
+ uint readChannel(uvec2 texel, int highlightLevel) {
10
10
  int lic = (highlightLevel >> 2) & 1;
11
- return uint(texel[lic] * 255.0);
11
+ return texel[lic];
12
12
  }
13
- uint readLevelBits(vec2 texel, int highlightLevel) {
13
+ uint readLevelBits(uvec2 texel, int highlightLevel) {
14
14
  return readChannelBits(readChannel(texel, highlightLevel), highlightLevel);
15
15
  }`)}export{l as HighlightReadBitmap};
@@ -2,13 +2,13 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{HighlightReadBitmap as i}from"../HighlightReadBitmap.glsl.js";import{ShaderOutput as t}from"../ShaderOutput.js";import{glsl as e}from"../../shaderModules/glsl.js";import{Integer2BindUniform as l}from"../../shaderModules/Integer2BindUniform.js";import{IntegerBindUniform as h}from"../../shaderModules/IntegerBindUniform.js";import{Texture2DBindUniform as g}from"../../shaderModules/Texture2DBindUniform.js";function d(d,u){const{fragment:o}=d;u.output===t.Highlight?(o.uniforms.add(new g("depthTexture",(i=>i.mainDepth)),new g("highlightTexture",(i=>i.highlightMixTexture)),new h("highlightLevel",(i=>i.highlightLevel??0)),new l("highlightMixOrigin",(i=>i.highlightMixOrigin))),d.outputs.add("fragHighlight","vec2",0),d.include(i),o.code.add(e`vec2 getAccumulatedHighlight() {
6
- return texelFetch(highlightTexture, ivec2(gl_FragCoord.xy) - highlightMixOrigin, 0).rg;
5
+ import{HighlightReadBitmap as i}from"../HighlightReadBitmap.glsl.js";import{ShaderOutput as e}from"../ShaderOutput.js";import{glsl as t}from"../../shaderModules/glsl.js";import{Integer2BindUniform as h}from"../../shaderModules/Integer2BindUniform.js";import{IntegerBindUniform as l}from"../../shaderModules/IntegerBindUniform.js";import{Texture2DBindUniform as g}from"../../shaderModules/Texture2DBindUniform.js";import{UintTexture2DPassUniform as d}from"../../shaderModules/UintTexture2DPassUniform.js";function u(u,o){const{fragment:r}=u;o.output===e.Highlight?(r.uniforms.add(new g("depthTexture",(i=>i.mainDepth)),new d("highlightMixTexture",((i,e)=>e.highlightMixTexture)),new l("highlightLevel",(i=>i.highlightLevel??0)),new h("highlightMixOrigin",(i=>i.highlightMixOrigin))),u.outputs.add("fragHighlight","uvec2",0),u.include(i),r.code.add(t`uvec2 getAccumulatedHighlight() {
6
+ return texelFetch(highlightMixTexture, ivec2(gl_FragCoord.xy) - highlightMixOrigin, 0).rg;
7
7
  }
8
8
  void outputHighlight(bool occluded) {
9
9
  if (highlightLevel == 0) {
10
10
  uint bits = occluded ? 3u : 1u;
11
- fragHighlight = vec2(float(bits) / 255.0, 0.0);
11
+ fragHighlight = uvec2(bits, 0);
12
12
  } else {
13
13
  int ll = (highlightLevel & 3) << 1;
14
14
  int li = (highlightLevel >> 2) & 3;
@@ -18,9 +18,8 @@ bits = 3u << ll;
18
18
  } else {
19
19
  bits = 1u << ll;
20
20
  }
21
- vec2 combinedHighlight = getAccumulatedHighlight();
22
- uint accumulatedI = uint(combinedHighlight[li] * 255.0);
23
- combinedHighlight[li] = float(bits | accumulatedI) / 255.0;
21
+ uvec2 combinedHighlight = getAccumulatedHighlight();
22
+ combinedHighlight[li] |= bits;
24
23
  fragHighlight = combinedHighlight;
25
24
  }
26
25
  }
@@ -30,8 +29,8 @@ return gl_FragCoord.z > sceneDepth + 5e-7;
30
29
  }
31
30
  void calculateOcclusionAndOutputHighlight() {
32
31
  outputHighlight(isHighlightOccluded());
33
- }`),u.canHaveOverlay&&o.code.add(e`void calculateOcclusionAndOutputHighlightOverlay(vec2 highlightToAdd) {
32
+ }`),o.canHaveOverlay&&r.code.add(t`void calculateOcclusionAndOutputHighlightOverlay(uvec2 highlightToAdd) {
34
33
  uint levelBits = readLevelBits(highlightToAdd, highlightLevel);
35
34
  if ((levelBits & 1u) == 0u) { discard; }
36
35
  outputHighlight(isHighlightOccluded());
37
- }`)):o.code.add(e`void calculateOcclusionAndOutputHighlight() {}`)}export{d as OutputHighlight};
36
+ }`)):r.code.add(t`void calculateOcclusionAndOutputHighlight() {}`)}export{u as OutputHighlight};
@@ -2,7 +2,7 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{hasArea as o,width as r,height as t}from"../../../../../../geometry/support/aaBoundingRect.js";import{OverlayIndex as a}from"../../../../terrain/interfaces.js";import{OverlayContent as l}from"../../../../terrain/OverlayContent.js";import{RenderPassIdentifier as i}from"../../renderPasses/RenderPassIdentifier.js";import{isColorOrColorEmission as n,ShaderOutput as v}from"../ShaderOutput.js";import{addMainLightDirection as d,addMainLightIntensity as s}from"../shading/MainLighting.glsl.js";import{PBRMode as c}from"../shading/PhysicallyBasedRenderingParameters.glsl.js";import{Water as x}from"../shading/Water.glsl.js";import{Float4DrawUniform as u}from"../../shaderModules/Float4DrawUniform.js";import{FloatPassUniform as y}from"../../shaderModules/FloatPassUniform.js";import{glsl as m}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as p}from"../../shaderModules/Texture2DPassUniform.js";import{Uniform as f}from"../../../../../webgl/Uniform.js";var C;function g(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new u("overlayTexOffset",((e,o)=>b(e,o))),new u("overlayTexScale",((e,o)=>V(e,o)))),t.constants.add("overlayOpacity","float",1),t.uniforms.add(new p("ovColorTex",((e,o)=>T(e,o)))),h(e,o)}function O(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new w("overlayTexOffset"),new w("overlayTexScale")),t.uniforms.add(new y("overlayOpacity",(e=>e.overlayOpacity)),new p("ovColorTex",((e,o)=>o.overlay?.getTexture(e.overlayContent)))),h(e,o)}function h(e,o){const r=o.pbrMode===c.Water||o.pbrMode===c.WaterOnIntegratedMesh||o.pbrMode===c.TerrainWithWater;r&&e.include(x,o);const{vertex:t,fragment:a}=e;e.varyings.add("vtcOverlay","vec4"),t.code.add(m`void setOverlayVTC(in vec2 uv) {
5
+ import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{hasArea as o,width as r,height as t}from"../../../../../../geometry/support/aaBoundingRect.js";import{OverlayIndex as a}from"../../../../terrain/interfaces.js";import{OverlayContent as l}from"../../../../terrain/OverlayContent.js";import{RenderPassIdentifier as i}from"../../renderPasses/RenderPassIdentifier.js";import{ShaderOutput as n,isColorOrColorEmission as s}from"../ShaderOutput.js";import{addMainLightDirection as d,addMainLightIntensity as v}from"../shading/MainLighting.glsl.js";import{PBRMode as c}from"../shading/PhysicallyBasedRenderingParameters.glsl.js";import{Water as u}from"../shading/Water.glsl.js";import{Float4DrawUniform as x}from"../../shaderModules/Float4DrawUniform.js";import{FloatPassUniform as y}from"../../shaderModules/FloatPassUniform.js";import{glsl as m}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as p}from"../../shaderModules/Texture2DPassUniform.js";import{UintTexture2DPassUniform as f}from"../../shaderModules/UintTexture2DPassUniform.js";import{Uniform as g}from"../../../../../webgl/Uniform.js";var h;function C(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new x("overlayTexOffset",((e,o)=>V(e,o))),new x("overlayTexScale",((e,o)=>I(e,o)))),t.constants.add("overlayOpacity","float",1),t.uniforms.add(new p("ovColorTex",((e,o)=>b(e,o)))),T(e,o)}function O(e,o){const{vertex:r,fragment:t}=e,{output:a}=o;r.uniforms.add(new M("overlayTexOffset"),new M("overlayTexScale")),t.uniforms.add(new y("overlayOpacity",(e=>e.overlayOpacity))),a!==n.Highlight&&t.uniforms.add(new p("ovColorTex",((e,o)=>o.overlay?.getTexture(e.overlayContent)))),T(e,o)}function T(e,o){const r=o.pbrMode===c.Water||o.pbrMode===c.WaterOnIntegratedMesh||o.pbrMode===c.TerrainWithWater;r&&e.include(u,o);const{vertex:t,fragment:a,varyings:i}=e;i.add("vtcOverlay","vec4");const{output:s}=o,x=s===n.Highlight;t.code.add(m`void setOverlayVTC(in vec2 uv) {
6
6
  vtcOverlay = vec4(uv, uv) * overlayTexScale + overlayTexOffset;
7
7
  }`),a.code.add(m`bool isValid(vec2 uv, vec2 dxdy) {
8
8
  return (uv.x >= 0.0 + dxdy.x) && (uv.x <= 1.0 - dxdy.x) && (uv.y >= 0.0 + dxdy.y) && (uv.y <= 1.0 - dxdy.y);
@@ -13,17 +13,7 @@ vec4 color1 = texture(ov0Tex, vec2(texCoords.z * 0.5 + 0.5, texCoords.w));
13
13
  bool isValid0 = isValid(texCoords.xy, fwidth(texCoords.xy));
14
14
  bool isValid1 = isValid(texCoords.zw, vec2(0.0, 0.0));
15
15
  return mix(color1 * float(isValid1), color0, float(isValid0));
16
- }`),a.code.add(m`vec4 getCombinedOverlayColor() {
17
- return overlayOpacity * getOverlayColor(ovColorTex, vtcOverlay);
18
- }`),a.code.add(m`vec4 getOverlayColorTexel() {
19
- vec4 texCoords = vtcOverlay;
20
- vec2 texDim = vec2(textureSize(ovColorTex, 0));
21
- vec4 color0 = texelFetch(ovColorTex, ivec2(vec2(texCoords.x * 0.5, texCoords.y) * texDim), 0);
22
- vec4 color1 = texelFetch(ovColorTex, ivec2(vec2(texCoords.z * 0.5 + 0.5, texCoords.w) * texDim), 0);
23
- bool isValid0 = isValid(texCoords.xy, fwidth(texCoords.xy));
24
- bool isValid1 = isValid(texCoords.zw, vec2(0.0, 0.0));
25
- return mix(color1 * float(isValid1), color0, float(isValid0));
26
- }`),a.code.add(m`vec2 getAllOverlayHighlightValuesEncoded() {
16
+ }`),x?(a.uniforms.add(new f("overlayHighlightTexture",((e,o)=>o.overlay?.getTexture(l.Highlight)))),a.code.add(m`uvec2 getAllOverlayHighlightValuesEncoded() {
27
17
  vec4 texCoords = vtcOverlay;
28
18
  vec2 uvInner = texCoords.xy;
29
19
  vec2 uvOuter = texCoords.zw;
@@ -31,17 +21,27 @@ bool isValidInner = isValid(uvInner, fwidth(uvInner));
31
21
  bool isValidOuter = isValid(uvOuter, vec2(0.0, 0.0));
32
22
  vec2 texelCoordInner = uvInner * vec2(0.5, 1.0);
33
23
  vec2 texelCoordOuter = uvOuter * vec2(0.5, 1.0) + vec2(0.5,0.0);
34
- vec2 texDim = vec2(textureSize(ovColorTex, 0));
35
- vec2 texelValueInner = texelFetch(ovColorTex, ivec2(texelCoordInner * texDim), 0).rg;
36
- vec2 texelValueOuter = texelFetch(ovColorTex, ivec2(texelCoordOuter * texDim), 0).rg;
24
+ vec2 texDim = vec2(textureSize(overlayHighlightTexture, 0));
25
+ uvec2 texelValueInner = texelFetch(overlayHighlightTexture, ivec2(texelCoordInner * texDim), 0).rg;
26
+ uvec2 texelValueOuter = texelFetch(overlayHighlightTexture, ivec2(texelCoordOuter * texDim), 0).rg;
37
27
  return
38
28
  isValidInner ? texelValueInner :
39
29
  isValidOuter ? texelValueOuter :
40
- vec2(0.0);
41
- }`),r&&(d(a),s(a),a.code.add(m`vec4 getOverlayWaterColor(vec4 maskInput, vec4 colorInput, vec3 vposEyeDir,
30
+ uvec2(0);
31
+ }`)):(a.code.add(m`vec4 getCombinedOverlayColor() {
32
+ return overlayOpacity * getOverlayColor(ovColorTex, vtcOverlay);
33
+ }`),a.code.add(m`vec4 getOverlayColorTexel() {
34
+ vec4 texCoords = vtcOverlay;
35
+ vec2 texDim = vec2(textureSize(ovColorTex, 0));
36
+ vec4 color0 = texelFetch(ovColorTex, ivec2(vec2(texCoords.x * 0.5, texCoords.y) * texDim), 0);
37
+ vec4 color1 = texelFetch(ovColorTex, ivec2(vec2(texCoords.z * 0.5 + 0.5, texCoords.w) * texDim), 0);
38
+ bool isValid0 = isValid(texCoords.xy, fwidth(texCoords.xy));
39
+ bool isValid1 = isValid(texCoords.zw, vec2(0.0, 0.0));
40
+ return mix(color1 * float(isValid1), color0, float(isValid0));
41
+ }`)),r&&(d(a),v(a),a.code.add(m`vec4 getOverlayWaterColor(vec4 maskInput, vec4 colorInput, vec3 vposEyeDir,
42
42
  float shadow, vec3 localUp, mat3 tbn, vec3 position, vec3 positionWorld) {
43
43
  vec3 n = normalize(tbn * (2.0 * maskInput.rgb - vec3(1.0)));
44
44
  vec3 v = vposEyeDir;
45
45
  vec3 final = getSeaColor(n, v, mainLightDirection, colorInput.rgb, mainLightIntensity, localUp, 1.0 - shadow, maskInput.w, position, positionWorld);
46
46
  return vec4(final, colorInput.w);
47
- }`))}function T(e,o){return e.identifier===i.Material&&n(e.output)?o.overlay?.getTexture(l.ColorNoRasterImage):e.identifier===i.Material&&e.output===v.ObjectAndLayerIdColor?o.overlay?.getTexture(l.ObjectAndLayerIdColor):e.identifier===i.Highlight?o.overlay?.getTexture(l.Highlight):null}function b(e,l){const i=l.overlay?.overlays[a.INNER]?.extent;o(i)&&(I[0]=e.toMapSpace[0]/r(i)-i[0]/r(i),I[1]=e.toMapSpace[1]/t(i)-i[1]/t(i));const n=l.overlay?.overlays[a.OUTER]?.extent;return o(n)&&(I[2]=e.toMapSpace[0]/r(n)-n[0]/r(n),I[3]=e.toMapSpace[1]/t(n)-n[1]/t(n)),I}function V(e,l){const i=l.overlay?.overlays[a.INNER]?.extent;o(i)&&(I[0]=e.toMapSpace[2]/r(i),I[1]=e.toMapSpace[3]/t(i));const n=l.overlay?.overlays[a.OUTER]?.extent;return o(n)&&(I[2]=e.toMapSpace[2]/r(n),I[3]=e.toMapSpace[3]/t(n)),I}!function(e){e[e.Disabled=0]="Disabled",e[e.Enabled=1]="Enabled",e[e.EnabledWithWater=2]="EnabledWithWater",e[e.COUNT=3]="COUNT"}(C||(C={}));const I=e();class w extends f{constructor(e){super(e,"vec4")}}export{g as OverlayIM,C as OverlayMode,O as OverlayTerrain,T as getIMColorTexture};
47
+ }`))}function b(e,o){return e.identifier===i.Material&&s(e.output)?o.overlay?.getTexture(l.ColorNoRasterImage):e.identifier===i.Material&&e.output===n.ObjectAndLayerIdColor?o.overlay?.getTexture(l.ObjectAndLayerIdColor):e.identifier===i.Highlight?o.overlay?.getTexture(l.Highlight):null}function V(e,l){const i=l.overlay?.overlays[a.INNER]?.extent;o(i)&&(w[0]=e.toMapSpace[0]/r(i)-i[0]/r(i),w[1]=e.toMapSpace[1]/t(i)-i[1]/t(i));const n=l.overlay?.overlays[a.OUTER]?.extent;return o(n)&&(w[2]=e.toMapSpace[0]/r(n)-n[0]/r(n),w[3]=e.toMapSpace[1]/t(n)-n[1]/t(n)),w}function I(e,l){const i=l.overlay?.overlays[a.INNER]?.extent;o(i)&&(w[0]=e.toMapSpace[2]/r(i),w[1]=e.toMapSpace[3]/t(i));const n=l.overlay?.overlays[a.OUTER]?.extent;return o(n)&&(w[2]=e.toMapSpace[2]/r(n),w[3]=e.toMapSpace[3]/t(n)),w}!function(e){e[e.Disabled=0]="Disabled",e[e.Enabled=1]="Enabled",e[e.EnabledWithWater=2]="EnabledWithWater",e[e.COUNT=3]="COUNT"}(h||(h={}));const w=e();class M extends g{constructor(e){super(e,"vec4")}}export{C as OverlayIM,h as OverlayMode,O as OverlayTerrain,b as getIMColorTexture};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{BindType as r}from"../../../../webgl/BindType.js";import{Uniform as e}from"../../../../webgl/Uniform.js";class o extends e{constructor(e,o){super(e,"usampler2D",r.Bind,((r,s)=>r.bindTexture(e,o(s))))}}export{o as UintTexture2DBindUniform};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{BindType as r}from"../../../../webgl/BindType.js";import{Uniform as e}from"../../../../webgl/Uniform.js";class o extends e{constructor(e,o){super(e,"usampler2D",r.Draw,((r,s,t)=>r.bindTexture(e,o(s,t))))}}export{o as UintTexture2DDrawUniform};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{BindType as r}from"../../../../webgl/BindType.js";import{Uniform as e}from"../../../../webgl/Uniform.js";class s extends e{constructor(e,s){super(e,"usampler2D",r.Pass,((r,o,t)=>r.bindTexture(e,s(o,t))))}}export{s as UintTexture2DPassUniform};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{lerp as t}from"../../../../../core/mathUtils.js";import{watch as r,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators/subclass.js";import{RenderCategory as a}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{b as l,c as u,a as n}from"../../../../../chunks/BloomBlur.glsl.js";import{BloomBlurTechnique as h}from"./BloomBlurTechnique.js";import{BloomBlurTechniqueConfiguration as c}from"./BloomBlurTechniqueConfiguration.js";import{a as p,e as b}from"../../../../../chunks/BloomComposition.glsl.js";import{BloomCompositionTechnique as d}from"./BloomCompositionTechnique.js";import{a as _}from"../../../../../chunks/BloomDepthAdjust.glsl.js";import{BloomDepthAdjustTechnique as g}from"./BloomDepthAdjustTechnique.js";import{RenderRequestType as f}from"../../lib/basicInterfaces.js";import{ColorAttachment as P,FramebufferBit as T}from"../../../../webgl/enums.js";let C=class extends m{constructor(e){super(e),this.consumes={required:[a.COMPOSITE,"emissive"]},this.produces=a.COMPOSITE,this._blurHorizontalConfiguration=new c,this._blurVerticalConfiguration=new c,this._compositionParameters=new p,this._depthAdjustParameters=new _,this._blurParameters=new l,this._blurScale=3.06,this._bloomResults=new Array}initialize(){this.addHandles([r((()=>this._updateFogParameters()),(()=>{}),s)])}destroy(){}_updateFogParameters(){const e=this.view.environment.weather;if("sunny"===e.type||"cloudy"===e.type)this._blurParameters.blurRadius=u[e.type],this._compositionParameters.exposure=b[e.type];else{const r="foggy"===e.type?e.fogStrength:e.precipitation;this._blurParameters.blurRadius=t(u[e.type],.004,r),this._compositionParameters.exposure=t(3,b[e.type],1-r)}this.requestRender(f.UPDATE)}precompile(){this._blurHorizontalConfiguration.bloomStage=n.Horizontal,this._blurVerticalConfiguration.bloomStage=n.Vertical,this.techniques.precompile(h,this._blurHorizontalConfiguration),this.techniques.precompile(h,this._blurVerticalConfiguration),this.techniques.precompile(d),this.techniques.precompile(g)}render(e){const t=e.find((({name:e})=>e===a.COMPOSITE)),r=t.getAttachment(P.COLOR_ATTACHMENT1)?.attachment;if(!r)return t;const s=this.techniques.get(h,this._blurHorizontalConfiguration),o=this.techniques.get(h,this._blurVerticalConfiguration),i=this.techniques.get(d),m=this.techniques.get(g);if(!(s.compiled&&o.compiled&&i.compiled&&m.compiled))return this.requestRender(f.UPDATE),t;const l=t.getTexture(),u=this.fboCache,{fullWidth:n,fullHeight:c}=this.bindParameters.camera,p=this.renderingContext,b=u.acquire(n,c,"emissiveDepthAdjusted");this._depthAdjustParameters.color=r,this._prepareFBO(b,n,c),p.bindTechnique(m,this.bindParameters,this._depthAdjustParameters),p.screen.draw();let _=b.getTexture(),T=Math.round(n/2),C=Math.round(c/2);const j=5,q=this._blurParameters.blurRadius;for(let a=0;a<j;a++){const e=u.acquire(T,C,"bloomHorizontal");this._blurParameters.color=_,this._prepareFBO(e,T,C),p.bindTechnique(s,this.bindParameters,this._blurParameters),p.screen.draw(),0===a&&b.release();const t=u.acquire(T,C,"bloomVertical");this._blurParameters.color=e.getTexture(),this._prepareFBO(t,T,C),p.bindTechnique(o,this.bindParameters,this._blurParameters),p.screen.draw(),e.release(),this._bloomResults[a]=t,T=Math.ceil(T/2),C=Math.ceil(C/2),_=this._bloomResults[a].getTexture(),this._blurParameters.blurRadius*=this._blurScale}this._blurParameters.blurRadius=q,this._compositionParameters.color=l,this._compositionParameters.bloomTexture0=this._bloomResults[0].getTexture(),this._compositionParameters.bloomTexture1=this._bloomResults[1].getTexture(),this._compositionParameters.bloomTexture2=this._bloomResults[2].getTexture(),this._compositionParameters.bloomTexture3=this._bloomResults[3].getTexture(),this._compositionParameters.bloomTexture4=this._bloomResults[4].getTexture();const R=this.acquireOutputFramebuffer();return this._prepareFBO(R,n,c),p.bindTechnique(i,this.bindParameters,this._compositionParameters),p.screen.draw(),this._bloomResults.forEach((e=>e.release())),R.attachDepth(t.getAttachment(this.gl.DEPTH_STENCIL_ATTACHMENT)),R.attachColor(t.getAttachment(P.COLOR_ATTACHMENT1),P.COLOR_ATTACHMENT1),R}_prepareFBO(e,t,r){const s=this.renderingContext;s.bindFramebuffer(e.fbo),s.setViewport(0,0,t,r),s.setClearColor(0,0,0,0),s.clear(T.COLOR)}get test(){return{compositionParameters:this._compositionParameters,depthAdjustParameters:this._depthAdjustParameters,blurParameters:this._blurParameters}}};e([o()],C.prototype,"consumes",void 0),e([o()],C.prototype,"produces",void 0),C=e([i("esri.views.3d.webgl-engine.effects.bloom.BloomRenderNode")],C);export{C as BloomRenderNode};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{lerp as t}from"../../../../../core/mathUtils.js";import{watch as r,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators/subclass.js";import{RenderCategory as a}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{b as u,c as l,a as n}from"../../../../../chunks/BloomBlur.glsl.js";import{BloomBlurTechnique as h}from"./BloomBlurTechnique.js";import{BloomBlurTechniqueConfiguration as c}from"./BloomBlurTechniqueConfiguration.js";import{a as p,e as b}from"../../../../../chunks/BloomComposition.glsl.js";import{BloomCompositionTechnique as d}from"./BloomCompositionTechnique.js";import{a as _}from"../../../../../chunks/BloomDepthAdjust.glsl.js";import{BloomDepthAdjustTechnique as g}from"./BloomDepthAdjustTechnique.js";import{RenderRequestType as f}from"../../lib/basicInterfaces.js";import{ColorAttachment1 as P,DepthStencilAttachment as j,FramebufferBit as T}from"../../../../webgl/enums.js";let q=class extends m{constructor(e){super(e),this.consumes={required:[a.COMPOSITE,"emissive"]},this.produces=a.COMPOSITE,this._blurHorizontalConfiguration=new c,this._blurVerticalConfiguration=new c,this._compositionParameters=new p,this._depthAdjustParameters=new _,this._blurParameters=new u,this._blurScale=3.06,this._bloomResults=new Array}initialize(){this.addHandles([r((()=>this._updateFogParameters()),(()=>{}),s)])}destroy(){}_updateFogParameters(){const e=this.view.environment.weather;if("sunny"===e.type||"cloudy"===e.type)this._blurParameters.blurRadius=l[e.type],this._compositionParameters.exposure=b[e.type];else{const r="foggy"===e.type?e.fogStrength:e.precipitation;this._blurParameters.blurRadius=t(l[e.type],.004,r),this._compositionParameters.exposure=t(3,b[e.type],1-r)}this.requestRender(f.UPDATE)}precompile(){this._blurHorizontalConfiguration.bloomStage=n.Horizontal,this._blurVerticalConfiguration.bloomStage=n.Vertical,this.techniques.precompile(h,this._blurHorizontalConfiguration),this.techniques.precompile(h,this._blurVerticalConfiguration),this.techniques.precompile(d),this.techniques.precompile(g)}render(e){const t=e.find((({name:e})=>e===a.COMPOSITE)),r=t.getAttachment(P)?.attachment;if(!r)return t;const s=this.techniques.get(h,this._blurHorizontalConfiguration),o=this.techniques.get(h,this._blurVerticalConfiguration),i=this.techniques.get(d),m=this.techniques.get(g);if(!(s.compiled&&o.compiled&&i.compiled&&m.compiled))return this.requestRender(f.UPDATE),t;const u=t.getTexture(),l=this.fboCache,{fullWidth:n,fullHeight:c}=this.bindParameters.camera,p=this.renderingContext,b=l.acquire(n,c,"emissiveDepthAdjusted");this._depthAdjustParameters.color=r,this._prepareFBO(b,n,c),p.bindTechnique(m,this.bindParameters,this._depthAdjustParameters),p.screen.draw();let _=b.getTexture(),T=Math.round(n/2),q=Math.round(c/2);const C=5,x=this._blurParameters.blurRadius;for(let a=0;a<C;a++){const e=l.acquire(T,q,"bloomHorizontal");this._blurParameters.color=_,this._prepareFBO(e,T,q),p.bindTechnique(s,this.bindParameters,this._blurParameters),p.screen.draw(),0===a&&b.release();const t=l.acquire(T,q,"bloomVertical");this._blurParameters.color=e.getTexture(),this._prepareFBO(t,T,q),p.bindTechnique(o,this.bindParameters,this._blurParameters),p.screen.draw(),e.release(),this._bloomResults[a]=t,T=Math.ceil(T/2),q=Math.ceil(q/2),_=this._bloomResults[a].getTexture(),this._blurParameters.blurRadius*=this._blurScale}this._blurParameters.blurRadius=x,this._compositionParameters.color=u,this._compositionParameters.bloomTexture0=this._bloomResults[0].getTexture(),this._compositionParameters.bloomTexture1=this._bloomResults[1].getTexture(),this._compositionParameters.bloomTexture2=this._bloomResults[2].getTexture(),this._compositionParameters.bloomTexture3=this._bloomResults[3].getTexture(),this._compositionParameters.bloomTexture4=this._bloomResults[4].getTexture();const R=this.acquireOutputFramebuffer();return this._prepareFBO(R,n,c),p.bindTechnique(i,this.bindParameters,this._compositionParameters),p.screen.draw(),this._bloomResults.forEach((e=>e.release())),R.attachDepth(t.getAttachment(j)),R.attachColor(t.getAttachment(P),P),R}_prepareFBO(e,t,r){const s=this.renderingContext;s.bindFramebuffer(e.fbo),s.setViewport(0,0,t,r),s.setClearColor(0,0,0,0),s.clear(T.COLOR)}get test(){return{compositionParameters:this._compositionParameters,depthAdjustParameters:this._depthAdjustParameters,blurParameters:this._blurParameters}}};e([o()],q.prototype,"consumes",void 0),e([o()],q.prototype,"produces",void 0),q=e([i("esri.views.3d.webgl-engine.effects.bloom.BloomRenderNode")],q);export{q as BloomRenderNode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as t}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderCategory as n}from"../../../webgl.js";import{ColorFormat as i}from"../../../webgl/formats.js";import s from"../../../webgl/RenderNode.js";import{If as c,glsl as a}from"../../core/shaderModules/glsl.js";import{Default3D as l}from"../../lib/DefaultVertexAttributeLocations.js";import{FramebufferBit as u,ColorAttachment as h,BlendFactor as p,SizedPixelFormat as d,PixelFormat as f,DataType as m}from"../../../../webgl/enums.js";import{alphaCutoff as v}from"../../../../../webscene/support/AlphaCutoff.js";let x=class extends s{constructor(e){super(e),this.destroyedCB=null,this.produces=n.FINAL,this.consumes={required:[n.FINAL]},this.clearColor=t,this._focusedFBOType=0,this._program=new Map}destroy(){this._program.forEach((e=>e.dispose())),this._program.clear(),this.destroyedCB()}render(e){const r=e.find((({name:e})=>e===n.FINAL));if(!this._focusedFBO)return r;const o=this.renderingContext;o.bindFramebuffer(r.fbo),o.setClearColor(0,0,0,0),o.clear(u.COLOR);const t=this._ensureShader(o,!1,0);return o.useProgram(t),o.bindTexture(this._focusedFBO.getTexture(),0),t.setUniform1i("colorTex",0),t.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&t.setUniform2fv("nearFar",this.camera.nearFar),o.screen.draw(),r}getDownscaledFBO(e,r,o,t,n,s){o===g.ON&&(n=e.width,s=e.height);const c=this.renderingContext,{colorTexture:a,depthStencilTexture:l}=e,f=a?.descriptor,m=this._ensureShader(c,null!=l,r),v=this.fboCache.acquire(n,s,"fbo visualizer"),x=!f?.hasMipmap&&!f?.isImmutable;x&&a?.generateMipmap(),c.useProgram(m),c.bindFramebuffer(v.fbo);let T=0;const F=[h.COLOR_ATTACHMENT0],C=null!=l;if(c.bindTexture(a,T),m.setUniform1i("colorTex",T),l){T++,c.bindTexture(l,T),m.setUniform1i("depthTex",T);const e=h.COLOR_ATTACHMENT0+T;v.acquireColor(e,i.RGBA,"depth to color"),F.push(e)}for(let u=0;u<r;u++){T++;const r=h.COLOR_ATTACHMENT0+T,o=C?1:0;c.bindTexture(e.getColorTexture(r-o),T),m.setUniform1i("colorTex"+(T-o-1),T),v.acquireColor(r,i.RGBA),F.push(r)}c.gl.drawBuffers(F);const b=c.getViewport();c.setViewport(0,0,n,s),c.setClearColor(0,0,0,0),c.clear(u.COLOR),c.setBlendingEnabled(!0),c.setBlendFunction(p.ONE,p.ONE_MINUS_SRC_ALPHA);const O="linear-depth"===t||t.includes("shadow"),_="overlay highlight"===t||"highlights"===t||"highlight mix"===t,y="highlight coverage"===t,A=f?.internalFormat,w=O?3:_?5:y?6:A===d.R16F||A===d.R32F||A===d.R8?1:A===d.RG8?2:A===d.RGBA16F?4:0;return m.setUniform1i("inputType",w),O&&m.setUniform2fv("nearFar",this.camera.nearFar),c.screen.draw(),c.bindFramebuffer(null),c.setViewport(b.x,b.y,b.width,b.height),o===g.ON&&(this._focusedFBO=v,this._focusedFBOType=w),x&&e.colorTexture?.clearMipmap(),v}clearFocusedFBO(){this._focusedFBO=null}getPreviewContent(e,r,o,t){if(!o)return null;const n=this.renderingContext,i=this.fboCache.acquire(e,r,"fbo visualizer");n.bindFramebuffer(i?.fbo),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(u.COLOR),n.setBlendingEnabled(!0),n.setBlendFunction(p.ONE,p.ONE_MINUS_SRC_ALPHA),n.setViewport(0,0,e,r);const s=this._ensureShader(n,!1,0);n.useProgram(s),n.bindTexture(o.getColorTexture(t),0),s.setUniform1i("colorTex",0),s.setUniform1i("inputType",0),n.screen.draw();const c=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,f.RGBA,m.UNSIGNED_BYTE,new Uint8Array(c.data.buffer)),n.bindFramebuffer(null),i?.release(),c}_ensureShader(e,r,o){const t={hasDepth:r,attachments:o},n=this._program.get(t);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",s=(e,r)=>{let o="";const t=e?2:1;for(let n=0;n<r;n++)o+=`layout(location = ${a.int(t+n)}) out vec4 fragColor${a.int(n)};\n uniform sampler2D colorTex${a.int(n)};`;return o},u=e=>{let r="";for(let o=0;o<e;o++)r+=`fragColor${a.int(o)} = texture(colorTex${a.int(o)}, uv);`;return r},h=`#version 300 es\n precision highp float;\n\n in vec2 uv;\n uniform sampler2D colorTex;\n layout(location = 0) out vec4 fragColor;\n ${c(r,"layout(location = 1) out vec4 fragDepth;\n uniform sampler2D depthTex;")}\n ${s(r,o)}\n uniform int inputType;\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaTofloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaTofloat(depth));\n }\n\n float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }\n\n void main() {\n vec4 color;\n if(inputType == 1) {\n color = vec4(vec3(texture(colorTex, uv).r), 1.0);\n } else if(inputType == 2) {\n color = vec4(texture(colorTex, uv).rg, 0.0, 1.0);\n } else if(inputType == 3) {\n float depth = 1.0 - ((-linearDepthFromTexture(colorTex, uv) - nearFar[0]) / (nearFar[1] - nearFar[0]));\n color = vec4(vec3(depth), depth >= 0.999 ? 0.0 : 1.0);\n } else if(inputType == 4) {\n color = texture(colorTex, uv);\n color = vec4(color.rgb / color.a, color.a);\n } else if(inputType == 5) {\n vec2 texDim = vec2(textureSize(colorTex, 0));\n ivec2 iuv = ivec2(uv*texDim);\n vec2 hh = texelFetch(colorTex,iuv,0).rg;\n uvec2 uhh = uvec2(vec2(hh) * 255.0);\n color = vec4(\n ((uhh.x & 0x3u) != 0u) ? 1.0 : 0.0,\n ((uhh.x & 0xcu) != 0u) ? 1.0 : 0.0,\n ((uhh.y & 0xfu) != 0u) ? 1.0 : 0.0,\n 1.0);\n } else if(inputType == 6) {\n vec2 texDim = vec2(textureSize(colorTex, 0));\n ivec2 iuv = ivec2(uv*texDim);\n uvec2 hh = uvec2(texelFetch(colorTex,iuv,0).rg * 255.0);\n color = vec4(\n ((hh & uvec2(0x55u)) != uvec2(0u)) ? 1.0 : 0.0,\n ((hh & uvec2(0xaau)) != uvec2(0u)) ? 1.0 : 0.0,\n 0.0,\n 1.0);\n } else {\n color = texture(colorTex, uv);\n }\n\n\n if(color.a < ${a.float(v)})\n discard;\n else {\n fragColor = color;\n ${c(r,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n ${c(o>0,u(o))}\n }\n }`;return this._program.set(t,e.programCache.acquire(i,h,l)),this._program.get(t)}};var g;e([r()],x.prototype,"destroyedCB",void 0),e([r()],x.prototype,"produces",void 0),e([r()],x.prototype,"consumes",void 0),e([r()],x.prototype,"clearColor",void 0),x=e([o("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],x),function(e){e[e.ON=0]="ON",e[e.OFF=1]="OFF"}(g||(g={}));export{g as FocusState,x as RenderNodeVisualizerNode};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as t}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderCategory as n}from"../../../webgl.js";import{ColorFormat as i}from"../../../webgl/formats.js";import c from"../../../webgl/RenderNode.js";import{If as s,glsl as a}from"../../core/shaderModules/glsl.js";import{Default3D as l}from"../../lib/DefaultVertexAttributeLocations.js";import{FramebufferBit as u,ColorAttachment0 as p,BlendFactor as h,SizedPixelFormat as f,PixelFormat as d,DataType as m}from"../../../../webgl/enums.js";import{alphaCutoff as v}from"../../../../../webscene/support/AlphaCutoff.js";let g=class extends c{constructor(e){super(e),this.destroyedCB=null,this.produces=n.FINAL,this.consumes={required:[n.FINAL]},this.clearColor=o,this._focusedFBOType=0,this._program=new Map}destroy(){this._program.forEach((e=>e.dispose())),this._program.clear(),this.destroyedCB()}render(e){const r=e.find((({name:e})=>e===n.FINAL));if(!this._focusedFBO)return r;const t=this.renderingContext;t.bindFramebuffer(r.fbo),t.setClearColor(0,0,0,0),t.clear(u.COLOR);const o=this._focusedFBO.getTexture(),i=[F(o)],c=this._ensureShader(t,!1,i);return t.useProgram(c),t.bindTexture(o,0),c.setUniform1i("colorTex",0),c.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&c.setUniform2fv("nearFar",this.camera.nearFar),t.screen.draw(),r}getDownscaledFBO(e,r,t,o,n,c){t===x.ON&&(n=e.width,c=e.height);const s=[];for(let i=0;i<Math.min(r+1,e.colorAttachments.length);++i){const r=e.getColorTexture(p+i);r&&s.push(F(r))}const a=this.renderingContext,{colorTexture:l,depthStencilTexture:d}=e,m=l?.descriptor,v=this._ensureShader(a,null!=d,s),g=this.fboCache.acquire(n,c,"fbo visualizer");let T=!1;l&&(T="float"===s[0]&&!l.descriptor.hasMipmap,T&&e.colorTexture?.generateMipmap()),a.useProgram(v),a.bindFramebuffer(g.fbo);let R=0;const b=[p],C=null!=d;if(a.bindTexture(l,R),v.setUniform1i("colorTex",R),d){R++,a.bindTexture(d,R),v.setUniform1i("depthTex",R);const e=p+R;g.acquireColor(e,i.RGBA,"depth to color"),b.push(e)}for(let u=0;u<r;u++){R++;const r=p+R,t=C?1:0;a.bindTexture(e.getColorTexture(r-t),R),v.setUniform1i("colorTex"+(R-t-1),R),g.acquireColor(r,i.RGBA),b.push(r)}a.gl.drawBuffers(b);const B=a.getViewport();a.setViewport(0,0,n,c),a.setClearColor(0,0,0,0),a.clear(u.COLOR),a.setBlendingEnabled(!0),a.setBlendFunction(h.ONE,h.ONE_MINUS_SRC_ALPHA);const A="linear-depth"===o||o.includes("shadow"),_="overlay highlight"===o||"highlights"===o||"highlight mix"===o,I="highlight coverage"===o,y=m?.internalFormat,G=A?3:_?5:I?6:y===f.R16F||y===f.R32F||y===f.R8?1:y===f.RG8?2:y===f.RGBA16F?4:y===f.RG8UI?7:0;return v.setUniform1i("inputType",G),A&&v.setUniform2fv("nearFar",this.camera.nearFar),a.screen.draw(),a.bindFramebuffer(null),a.setViewport(B.x,B.y,B.width,B.height),t===x.ON&&(this._focusedFBO=g,this._focusedFBOType=G),T&&e.colorTexture?.clearMipmap(),g}clearFocusedFBO(){this._focusedFBO=null}getPreviewContent(e,r,t,o){if(!t)return null;const n=this.renderingContext,i=this.fboCache.acquire(e,r,"fbo visualizer");n.bindFramebuffer(i?.fbo),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(u.COLOR),n.setBlendingEnabled(!0),n.setBlendFunction(h.ONE,h.ONE_MINUS_SRC_ALPHA);const c=t.getColorTexture(o);n.setViewport(0,0,e,r);const s=this._ensureShader(n,!1,[F(c)]);n.useProgram(s),n.bindTexture(c,0),s.setUniform1i("colorTex",0),s.setUniform1i("inputType",0),n.screen.draw();const a=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,d.RGBA,m.UNSIGNED_BYTE,new Uint8Array(a.data.buffer)),n.bindFramebuffer(null),i?.release(),a}_ensureShader(e,r,t){const o={hasDepthAttachment:r,colorAttachmentTypes:t},n=this._program.get(o);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",c=(e,r)=>{let t="";const o=e?2:1;for(let n=0;n<r.length-1;n++){const e=r[n+1];t+=`layout(location = ${a.int(o+n)}) out vec4 fragColor${a.int(n)};\n uniform ${T(e)} colorTex${a.int(n)};`}return t},u=e=>{let r="";for(let t=0;t<e.length-1;t++){const o=e[t+1],n=`texture(colorTex${a.int(t)}, uv)`,i="float"===o?n:`vec4( vec2(${n}), 0.0, 1.0)`;r+=`fragColor${a.int(t)} = ${i};`}return r},p=`#version 300 es\n precision highp float;\n precision highp usampler2D;\n\n in vec2 uv;\n uniform ${T(t[0])} colorTex;\n layout(location = 0) out vec4 fragColor;\n ${s(r,"layout(location = 1) out vec4 fragDepth;\n uniform sampler2D depthTex;")}\n ${c(r,t)}\n uniform int inputType;\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaTofloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaTofloat(depth));\n }\n\n ${"float"===t[0]?"float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }":"float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);\n }"}\n\n void main() {\n vec4 color;\n if (inputType == 1) {\n color = vec4(vec3(texture(colorTex, uv).r), 1.0);\n } else if (inputType == 2) {\n color = vec4(texture(colorTex, uv).rg, 0.0, 1.0);\n } else if (inputType == 3) {\n float depth = 1.0 - ((-linearDepthFromTexture(colorTex, uv) - nearFar[0]) / (nearFar[1] - nearFar[0]));\n color = vec4(vec3(depth), depth >= 0.999 ? 0.0 : 1.0);\n } else if (inputType == 4) {\n color = vec4(texture(colorTex, uv));\n color = vec4(color.rgb / color.a, color.a);\n } else if (inputType == 5) {\n color = vec4(texture(colorTex, uv)) * 255.0;\n color = vec4(color.rgb / color.a, color.a);\n } else if(inputType == 6) {\n vec2 texDim = vec2(textureSize(colorTex, 0));\n ivec2 iuv = ivec2(uv*texDim);\n uvec2 hh = uvec2(texelFetch(colorTex,iuv,0).rg);\n color = vec4(\n ((hh & uvec2(0x55u)) != uvec2(0u)) ? 1.0 : 0.0,\n ((hh & uvec2(0xaau)) != uvec2(0u)) ? 1.0 : 0.0,\n 0.0,\n 1.0);\n } else {\n color = vec4(texture(colorTex, uv));\n }\n\n\n if(color.a < ${a.float(v)})\n discard;\n else {\n fragColor = color;\n ${s(r,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n ${s(t.length>1,u(t))}\n }\n }`;return this._program.set(o,e.programCache.acquire(i,p,l)),this._program.get(o)}};var x;function T(e){switch(e){case"float":return"sampler2D";case"uint":return"usampler2D";case"int":return"isampler2D"}}function F(e){if(!e)return"float";const{internalFormat:r}=e.descriptor;switch(r){case f.R8I:case f.R16I:case f.R32I:case f.RG8I:case f.RG16I:case f.RG32I:case f.RGB8I:case f.RGB16I:case f.RGB32I:case f.RGBA8I:case f.RGBA16I:case f.RGBA32I:return"int";case f.R8UI:case f.R16UI:case f.R32UI:case f.RG8UI:case f.RG16UI:case f.RG32UI:case f.RGB8UI:case f.RGB16UI:case f.RGB32UI:case f.RGBA8UI:case f.RGBA16UI:case f.RGBA32UI:return"uint";default:return"float"}}e([r()],g.prototype,"destroyedCB",void 0),e([r()],g.prototype,"produces",void 0),e([r()],g.prototype,"consumes",void 0),e([r()],g.prototype,"clearColor",void 0),g=e([t("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],g),function(e){e[e.ON=0]="ON",e[e.OFF=1]="OFF"}(x||(x={}));export{x as FocusState,g as RenderNodeVisualizerNode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{RenderCategory as o,InternalRenderCategory as t}from"../../../webgl.js";import i from"../../../webgl/RenderNode.js";import{FocusAreaColorTechnique as c}from"./FocusAreaColorTechnique.js";import{F as a}from"../../../../../chunks/FocusAreaColor.glsl.js";let n=class extends i{constructor(e){super({...e,view:e.focusAreas.view}),this.consumes={required:[o.COMPOSITE,t.FOCUSAREA]},this.produces=o.COMPOSITE,this._passParameters=new a}precompile(){this.techniques.precompile(c)}render(e){const r=this.techniques.get(c),s=e.find((({name:e})=>e===o.COMPOSITE));if(!r.compiled)return this.requestRender(),s;const i=this.bindParameters,a=i.camera,n=a.fullViewport[2],p=a.fullViewport[3],m=e.find((({name:e})=>e===t.FOCUSAREA)),h=this.fboCache.acquire(n,p,this.produces),d=this.renderingContext;return d.gl.clear(d.gl.STENCIL_BUFFER_BIT),d.bindFramebuffer(h.fbo),this._passParameters.color=s.getTexture(),this._passParameters.focusArea=m.getTexture(),this._passParameters.effect=u[this.focusAreas.style],d.bindTechnique(r,i,this._passParameters),d.screen.draw(),h.attachDepth(s.getAttachment(this.gl.DEPTH_STENCIL_ATTACHMENT)),h}};var p;e([r()],n.prototype,"consumes",void 0),e([r()],n.prototype,"produces",void 0),e([r({constructOnly:!0})],n.prototype,"focusAreas",void 0),n=e([s("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaColorNode")],n),function(e){e[e.NONE=0]="NONE",e[e.BRIGHT=1]="BRIGHT",e[e.DARK=2]="DARK"}(p||(p={}));const u={none:p.NONE,bright:p.BRIGHT,dark:p.DARK};export{n as FocusAreaColorNode};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{RenderCategory as o,InternalRenderCategory as t}from"../../../webgl.js";import i from"../../../webgl/RenderNode.js";import{FocusAreaColorTechnique as c}from"./FocusAreaColorTechnique.js";import{F as a}from"../../../../../chunks/FocusAreaColor.glsl.js";import{FramebufferBit as n,DepthStencilAttachment as p}from"../../../../webgl/enums.js";let m=class extends i{constructor(e){super({...e,view:e.focusAreas.view}),this.consumes={required:[o.COMPOSITE,t.FOCUSAREA]},this.produces=o.COMPOSITE,this._passParameters=new a}precompile(){this.techniques.precompile(c)}render(e){const r=this.techniques.get(c),s=e.find((({name:e})=>e===o.COMPOSITE));if(!r.compiled)return this.requestRender(),s;const i=this.bindParameters,a=i.camera,m=a.fullViewport[2],u=a.fullViewport[3],h=e.find((({name:e})=>e===t.FOCUSAREA)),d=this.fboCache.acquire(m,u,this.produces),l=this.renderingContext;return l.clear(n.STENCIL),l.bindFramebuffer(d.fbo),this._passParameters.color=s.getTexture(),this._passParameters.focusArea=h.getTexture(),this._passParameters.effect=f[this.focusAreas.style],l.bindTechnique(r,i,this._passParameters),l.screen.draw(),d.attachDepth(s.getAttachment(p)),d}};var u;e([r()],m.prototype,"consumes",void 0),e([r()],m.prototype,"produces",void 0),e([r({constructOnly:!0})],m.prototype,"focusAreas",void 0),m=e([s("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaColorNode")],m),function(e){e[e.NONE=0]="NONE",e[e.BRIGHT=1]="BRIGHT",e[e.DARK=2]="DARK"}(u||(u={}));const f={none:u.NONE,bright:u.BRIGHT,dark:u.DARK};export{m as FocusAreaColorNode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{InternalRenderCategory as r,RenderCategory as o}from"../../../webgl.js";import{ColorFormat as i}from"../../../webgl/formats.js";import n from"../../../webgl/RenderNode.js";import{FocusAreaMaskTechnique as a}from"./FocusAreaMaskTechnique.js";import{Default3D as c}from"../../lib/DefaultVertexAttributeLocations.js";import{Pos3 as h}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as p}from"../../lib/VertexArrayObject.js";import{F as l}from"../../../../../chunks/FocusAreaMask.glsl.js";import{BufferObject as u}from"../../../../webgl/BufferObject.js";import{FramebufferBit as m,Face as d,StencilOperation as g,CompareFunction as f,PrimitiveType as A,Usage as E}from"../../../../webgl/enums.js";import{noParameters as _}from"../../../../webgl/NoParameters.js";let b=class extends n{constructor(e){super({...e,view:e.focusAreas.view}),this.consumes={required:[r.FOCUSAREA,o.TRANSPARENT]},this.produces=r.FOCUSAREA,this._vaos=new Array,this._counts=new Array,this._origins=new Array,this._maskParameters=new l}initialize(){this.updateGeometries()}destroy(){this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0}precompile(){this.techniques.precompile(a)}render(e){const t=this.techniques.get(a),s=this.bindParameters,n=s.camera,c=n.fullViewport[2],h=n.fullViewport[3],p=this.fboCache.acquire(c,h,r.FOCUSAREA,i.RGBA);if(!t.compiled||!this._vaos)return this.requestRender(),p;const l=e.find((({name:e})=>e===o.TRANSPARENT)),u=this.renderingContext;p.attachDepth(l.getAttachment(this.gl.DEPTH_STENCIL_ATTACHMENT)),u.bindFramebuffer(p.fbo),u.clear(m.COLOR|m.STENCIL),u.setViewport(0,0,c,h),u.gl.clearStencil(0),u.gl.clear(u.gl.STENCIL_BUFFER_BIT),u.setClearStencil(0);const E=u.bindTechnique(t,s);u.setFaceCullingEnabled(!1),u.setStencilTestEnabled(!0),u.setStencilOpSeparate(d.FRONT,g.KEEP,g.INCR_WRAP,g.KEEP),u.setStencilOpSeparate(d.BACK,g.KEEP,g.DECR_WRAP,g.KEEP),u.setDepthWriteEnabled(!1);for(let r=0;r<this._vaos.length;r++){const e=this._vaos[r],t=this._counts[r];this._maskParameters.origin=this._origins[r],E.bindDraw(s,_,this._maskParameters),u.bindVAO(e),u.setDepthTestEnabled(!0),u.setStencilWriteMask(255),u.setStencilFunction(f.ALWAYS,0,255),u.setColorMask(!1,!1,!1,!1),u.drawArrays(A.TRIANGLES,0,t),u.setDepthTestEnabled(!1),u.setStencilWriteMask(0),u.setStencilFunction(f.NOTEQUAL,0,255),u.setColorMask(!0,!0,!0,!0),u.drawArrays(A.TRIANGLES,0,t)}return p}updateGeometries(){if(!this.view._stage)return;this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0;const e=this.focusAreas.geometries;for(const t of e){const e=new Array,s=t.indicesBottom;for(let n=0;n<s.length;n++)e.push(t.positions[3*(s[n]-1)]),e.push(t.positions[3*(s[n]-1)+1]),e.push(t.positions[3*(s[n]-1)+2]);const r=t.indicesExtruded;for(let n=0;n<r.length;n++)e.push(t.positions[3*r[n]]),e.push(t.positions[3*r[n]+1]),e.push(t.positions[3*r[n]+2]);const o=new Float32Array(e),i=new p(this.renderingContext,c,new Map([["geometry",h]]),new Map([["geometry",u.createVertex(this.renderingContext,E.STATIC_DRAW,o)]]));this._vaos.push(i),this._counts.push(s.length+r.length),this._origins.push(t.origin)}this.requestRender()}};e([t()],b.prototype,"consumes",void 0),e([t()],b.prototype,"produces",void 0),e([t({constructOnly:!0})],b.prototype,"focusAreas",void 0),b=e([s("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaMaskNode")],b);class w{constructor(e,t,s,r,o,i){this.positions=e,this.indicesBottom=t,this.indicesExtruded=s,this.height=r,this.origin=o,this.color=i}}var R;!function(e){e[e.NONE=0]="NONE",e[e.BRIGHT=1]="BRIGHT",e[e.DARK=2]="DARK"}(R||(R={}));export{R as FocusAreaEffect,w as FocusAreaGeometry,b as FocusAreaMaskNode};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{InternalRenderCategory as r,RenderCategory as o}from"../../../webgl.js";import{ColorFormat as i}from"../../../webgl/formats.js";import n from"../../../webgl/RenderNode.js";import{FocusAreaMaskTechnique as a}from"./FocusAreaMaskTechnique.js";import{Default3D as c}from"../../lib/DefaultVertexAttributeLocations.js";import{Pos3 as h}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as p}from"../../lib/VertexArrayObject.js";import{F as u}from"../../../../../chunks/FocusAreaMask.glsl.js";import{BufferObject as l}from"../../../../webgl/BufferObject.js";import{DepthStencilAttachment as m,FramebufferBit as d,Face as f,StencilOperation as g,CompareFunction as A,PrimitiveType as E,Usage as b}from"../../../../webgl/enums.js";import{noParameters as w}from"../../../../webgl/NoParameters.js";let _=class extends n{constructor(e){super({...e,view:e.focusAreas.view}),this.consumes={required:[r.FOCUSAREA,o.TRANSPARENT]},this.produces=r.FOCUSAREA,this._vaos=new Array,this._counts=new Array,this._origins=new Array,this._maskParameters=new u}initialize(){this.updateGeometries()}destroy(){this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0}precompile(){this.techniques.precompile(a)}render(e){const t=this.techniques.get(a),s=this.bindParameters,n=s.camera,c=n.fullViewport[2],h=n.fullViewport[3],p=this.fboCache.acquire(c,h,r.FOCUSAREA,i.RGBA);if(!t.compiled||!this._vaos)return this.requestRender(),p;const u=e.find((({name:e})=>e===o.TRANSPARENT)),l=this.renderingContext;p.attachDepth(u.getAttachment(m)),l.bindFramebuffer(p.fbo),l.clear(d.COLOR|d.STENCIL),l.setViewport(0,0,c,h),l.clear(d.STENCIL,0);const b=l.bindTechnique(t,s);l.setFaceCullingEnabled(!1),l.setStencilTestEnabled(!0),l.setStencilOpSeparate(f.FRONT,g.KEEP,g.INCR_WRAP,g.KEEP),l.setStencilOpSeparate(f.BACK,g.KEEP,g.DECR_WRAP,g.KEEP),l.setDepthWriteEnabled(!1);for(let r=0;r<this._vaos.length;r++){const e=this._vaos[r],t=this._counts[r];this._maskParameters.origin=this._origins[r],b.bindDraw(s,w,this._maskParameters),l.bindVAO(e),l.setDepthTestEnabled(!0),l.setStencilWriteMask(255),l.setStencilFunction(A.ALWAYS,0,255),l.setColorMask(!1,!1,!1,!1),l.drawArrays(E.TRIANGLES,0,t),l.setDepthTestEnabled(!1),l.setStencilWriteMask(0),l.setStencilFunction(A.NOTEQUAL,0,255),l.setColorMask(!0,!0,!0,!0),l.drawArrays(E.TRIANGLES,0,t)}return p}updateGeometries(){if(!this.view.stage)return;this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0;const e=this.focusAreas.geometries;for(const t of e){const e=new Array,s=t.indicesBottom;for(let n=0;n<s.length;n++)e.push(t.positions[3*(s[n]-1)]),e.push(t.positions[3*(s[n]-1)+1]),e.push(t.positions[3*(s[n]-1)+2]);const r=t.indicesExtruded;for(let n=0;n<r.length;n++)e.push(t.positions[3*r[n]]),e.push(t.positions[3*r[n]+1]),e.push(t.positions[3*r[n]+2]);const o=new Float32Array(e),i=new p(this.renderingContext,c,new Map([["geometry",h]]),new Map([["geometry",l.createVertex(this.renderingContext,b.STATIC_DRAW,o)]]));this._vaos.push(i),this._counts.push(s.length+r.length),this._origins.push(t.origin)}this.requestRender()}};e([t()],_.prototype,"consumes",void 0),e([t()],_.prototype,"produces",void 0),e([t({constructOnly:!0})],_.prototype,"focusAreas",void 0),_=e([s("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaMaskNode")],_);class R{constructor(e,t,s,r,o,i){this.positions=e,this.indicesBottom=t,this.indicesExtruded=s,this.height=r,this.origin=o,this.color=i}}var S;!function(e){e[e.NONE=0]="NONE",e[e.BRIGHT=1]="BRIGHT",e[e.DARK=2]="DARK"}(S||(S={}));export{S as FocusAreaEffect,R as FocusAreaGeometry,_ as FocusAreaMaskNode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as s}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import t from"../../../webgl/RenderNode.js";import{ShaderOutput as d}from"../../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as i}from"../../core/shaderLibrary/hud/HUDRenderStyle.js";import{FramebufferBit as c}from"../../../../webgl/enums.js";let m=class extends t{constructor(e){super(e),this.consumes={required:["olid"]},this.produces="olid"}destroy(){}render(e){const r=e.find((({name:e})=>"olid"===e)),o=this.renderingContext;return o.bindFramebuffer(r.fbo),o.clearFramebuffer(s,!0,!0),this.view._stage.renderer.renderAllGeometry(d.ObjectAndLayerIdColor),o.clear(c.DEPTH|c.STENCIL),this.view._stage.renderer.renderHUD(i.NotOccluded),r}};e([r()],m.prototype,"consumes",void 0),e([r()],m.prototype,"produces",void 0),m=e([o("esri.views.3d.webgl-engine.effects.geometry.ObjectAndLayerIDRenderNode")],m);export{m as ObjectAndLayerIDRenderNode};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as s}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import t from"../../../webgl/RenderNode.js";import{ShaderOutput as d}from"../../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as i}from"../../core/shaderLibrary/hud/HUDRenderStyle.js";import{FramebufferBit as c}from"../../../../webgl/enums.js";let m=class extends t{constructor(e){super(e),this.consumes={required:["olid"]},this.produces="olid"}destroy(){}render(e){const r=e.find((({name:e})=>"olid"===e)),o=this.renderingContext;return o.bindFramebuffer(r.fbo),o.clearFramebuffer(s,!0,!0),this.view.stage.renderer.renderAllGeometry(d.ObjectAndLayerIdColor),o.clear(c.DEPTH|c.STENCIL),this.view.stage.renderer.renderHUD(i.NotOccluded),r}};e([r()],m.prototype,"consumes",void 0),e([r()],m.prototype,"produces",void 0),m=e([o("esri.views.3d.webgl-engine.effects.geometry.ObjectAndLayerIDRenderNode")],m);export{m as ObjectAndLayerIDRenderNode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import r from"../../../../../core/PooledArray.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as n}from"../../../webgl.js";import{DepthFormat as i}from"../../../webgl/formats.js";import c from"../../../webgl/RenderNode.js";import{Blit as l}from"../blit/Blit.js";import{StencilBits as a}from"../../lib/basicInterfaces.js";import{RenderOccludedFlag as d}from"../../lib/Material.js";import{RenderSlot as p}from"../../lib/RenderSlot.js";import{BlitMode as u}from"../../shaders/CompositingTechniqueConfiguration.js";import{DepthStencilAttachment as m}from"../../../../webgl/enums.js";let f=class extends c{constructor(e){super(e),this.consumes={required:[n.OCCLUDED]},this.produces=n.OCCLUDED,this._blit=new l(e.view._stage.renderView.techniques,u.PremultipliedAlpha)}precompile(){const e=this.view._stage.renderer;e.plugins.plugins.forAll((r=>{e.precompileSlots(r,p.OCCLUDED_TERRAIN,p.TRANSPARENT_OCCLUDER_MATERIAL),r.material&&e.precompileOccludedSlots(r,g)}))}render(e){const r=e.find((({name:e})=>e===this.produces)),t=this.view._stage.renderer;let s=0;if(h.clear(),t.plugins.plugins.forAll((e=>{if(!e.material)return;e.queryRenderOccludedState(d.OccludeAndTransparentStencil)&&(s|=d.OccludeAndTransparentStencil,h.push(e))})),h.length>0&&(t.renderSlots(h,p.OCCLUDER_MATERIAL),s&d.OccludeAndTransparentStencil&&this._renderAndComposite(r,.5,(()=>t.renderSlots(h,p.TRANSPARENT_OCCLUDER_MATERIAL)),!1,!1)),h.clear(),t.plugins.plugins.forAll((e=>{if(!e.material)return;const r=e.queryRenderOccludedState(d.OccludeAndTransparent),t=e.queryRenderOccludedState(d.Transparent),o=e.queryRenderOccludedState(d.Opaque);(r||t||o)&&(s|=r?d.OccludeAndTransparent:t?d.Transparent:d.Opaque,h.push(e))})),s|=t.plugins.renderOccludedFlags,!s)return r;for(const o of g)s&o&&this._renderAndComposite(r,o===d.Opaque?1:.5,(()=>t.renderOccludedSlots(h,o)),!0,a.OutlineVisualElementMask);return h.clear(),r}_renderAndComposite(e,r,t,s,n){const c=this.renderingContext,{width:l,height:a}=e.fbo,d=this.fboCache.acquire(l,a,"tmp color"),p=s?this.fboCache.acquireDepth(i.DEPTH_STENCIL_TEXTURE,l,a,"tmp depth"):e.getAttachment(m);d.attachDepth(p),c.bindFramebuffer(d.fbo),c.clearFramebuffer(o,s,n),t(),d.detachDepth(),this._blit.blend(c,d,e,this.bindParameters,r),s&&p.release(),d.release()}};e([t()],f.prototype,"consumes",void 0),e([t()],f.prototype,"produces",void 0),f=e([s("esri.views.3d.webgl-engine.effects.geometry.RenderOccludedRenderNode")],f);const h=new r,g=[d.OccludeAndTransparent,d.Transparent,d.Opaque];export{f as RenderOccludedRenderNode};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import r from"../../../../../core/PooledArray.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as n}from"../../../webgl.js";import{DepthFormat as i}from"../../../webgl/formats.js";import c from"../../../webgl/RenderNode.js";import{Blit as l}from"../blit/Blit.js";import{StencilBits as a}from"../../lib/basicInterfaces.js";import{RenderOccludedFlag as d}from"../../lib/Material.js";import{RenderSlot as p}from"../../lib/RenderSlot.js";import{BlitMode as u}from"../../shaders/CompositingTechniqueConfiguration.js";import{DepthStencilAttachment as m}from"../../../../webgl/enums.js";let f=class extends c{constructor(e){super(e),this.consumes={required:[n.OCCLUDED]},this.produces=n.OCCLUDED,this._blit=new l(e.view.stage.renderView.techniques,u.PremultipliedAlpha)}precompile(){const e=this.view.stage.renderer;e.plugins.plugins.forAll((r=>{e.precompileSlots(r,p.OCCLUDED_TERRAIN,p.TRANSPARENT_OCCLUDER_MATERIAL),r.material&&e.precompileOccludedSlots(r,g)}))}render(e){const r=e.find((({name:e})=>e===this.produces)),t=this.view.stage.renderer;let s=0;if(h.clear(),t.plugins.plugins.forAll((e=>{if(!e.material)return;e.queryRenderOccludedState(d.OccludeAndTransparentStencil)&&(s|=d.OccludeAndTransparentStencil,h.push(e))})),h.length>0&&(t.renderSlots(h,p.OCCLUDER_MATERIAL),s&d.OccludeAndTransparentStencil&&this._renderAndComposite(r,.5,(()=>t.renderSlots(h,p.TRANSPARENT_OCCLUDER_MATERIAL)),!1,!1)),h.clear(),t.plugins.plugins.forAll((e=>{if(!e.material)return;const r=e.queryRenderOccludedState(d.OccludeAndTransparent),t=e.queryRenderOccludedState(d.Transparent),o=e.queryRenderOccludedState(d.Opaque);(r||t||o)&&(s|=r?d.OccludeAndTransparent:t?d.Transparent:d.Opaque,h.push(e))})),s|=t.plugins.renderOccludedFlags,!s)return r;for(const o of g)s&o&&this._renderAndComposite(r,o===d.Opaque?1:.5,(()=>t.renderOccludedSlots(h,o)),!0,a.OutlineVisualElementMask);return h.clear(),r}_renderAndComposite(e,r,t,s,n){const c=this.renderingContext,{width:l,height:a}=e.fbo,d=this.fboCache.acquire(l,a,"tmp color"),p=s?this.fboCache.acquireDepth(i.DEPTH_STENCIL_TEXTURE,l,a,"tmp depth"):e.getAttachment(m);d.attachDepth(p),c.bindFramebuffer(d.fbo),c.clearFramebuffer(o,s,n),t(),d.detachDepth(),this._blit.blend(c,d,e,this.bindParameters,r),s&&p.release(),d.release()}};e([t()],f.prototype,"consumes",void 0),e([t()],f.prototype,"produces",void 0),f=e([s("esri.views.3d.webgl-engine.effects.geometry.RenderOccludedRenderNode")],f);const h=new r,g=[d.OccludeAndTransparent,d.Transparent,d.Opaque];export{f as RenderOccludedRenderNode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{lerp as t,clamp as s,smoothstep as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{l as h,k as c}from"../../../../../chunks/vec32.js";import{s as p}from"../../../../../chunks/vec42.js";import{earth as u}from"../../../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as d}from"../../../webgl.js";import{ColorFormat as l}from"../../../webgl/formats.js";import{TransparentEnvironment as _}from"../TransparentEnvironment.js";import{H as f}from"../../../../../chunks/HazeCompositing.glsl.js";import{HazeCompositingTechnique as g}from"./HazeCompositingTechnique.js";import{HazePassParameters as b,HazeTechnique as w}from"./HazeTechnique.js";import{HazeTechniqueConfiguration as P}from"./HazeTechniqueConfiguration.js";import{createQuadVAO as j,Layout as T}from"../../lib/glUtil3D.js";import{applyTextureResizeModulo as v}from"../../lib/textureUtils.js";import{PrimitiveType as A}from"../../../../webgl/enums.js";let C=class extends _{constructor(e){super(e),this._compositingPassParameters=new f,this._passParameters=new b,this._hazeConfiguration=new P,this._vao=null,this.requireGeometryDepth=!0,this._oldAmount=1,this._newAmount=1,this._amount=this._newAmount;const t=e.view._stage.renderView.techniques;t.precompile(w,new P);const s=new P;s.reduced=!0,t.precompile(w,s),t.precompile(g)}initialize(){this.addHandles([o((()=>this.view.environment.atmosphereEnabled),(e=>e?this._enable():this._disable()),a),o((()=>this.view._stage?.renderer.renderContext.bind.clouds.fadeFactor??1),(e=>this._fade(e)),a),o((()=>this.view.environment.weather.type),(e=>this._newAmount="rainy"===e?0:1),a),o((()=>this.view._stage.renderer?.fullResolutionAtmosphere),(e=>this._hazeConfiguration.reduced=!e),a)])}_fade(e){e>=1?(this._amount=this._newAmount,this._oldAmount=this._newAmount):this._amount=e<=0?this._oldAmount:t(this._oldAmount,this._newAmount,e)}destroy(){this._vao=i(this._vao)}render(e){const s=e.find((({name:e})=>e===d.TRANSPARENT_ENVIRONMENT));if(!this.bindParameters.mainDepth)return s;const r=this.renderingContext;this._vao??=j(r,T.Pos2Tex);const i=this.techniques.get(w,this._hazeConfiguration);if(!i.compiled)return s;const o=s.getAttachment(r.gl.DEPTH_STENCIL_ATTACHMENT);if(this._update(),!this._hazeConfiguration.reduced)return s.detachDepth(),r.bindFramebuffer(s.fbo),r.bindTechnique(i,this.bindParameters,this._passParameters),this._renderCommon(r),s.attachDepth(o),s;const a=this.techniques.get(g);if(!a.compiled)return s;const n=r.getViewport(),m=this.camera,c=h(m.eye)-u.radius;let p;const _=u.atmosphereHeight;if(c<_){const e=Math.min(1,Math.max(0,c/_));p=t(.4,.5,e)}else{const e=Math.min(1,Math.max(0,(c-_)/(15*_)));p=t(.5,1,e)}const f=this.renderingContext.parameters.maxTextureSize,b=v(Math.round(p*m.fullViewport[2]),f),P=v(Math.round(p*m.fullViewport[3]),f);r.setViewport(0,0,b,P);const A=this.fboCache.acquire(b,P,"haze",l.RGBA);return r.bindFramebuffer(A.fbo),r.clearFramebuffer([0,0,0,1],!0,!0),r.bindTechnique(i,this.bindParameters,this._passParameters),this._renderCommon(r),r.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=A.getTexture(),s.detachDepth(),r.bindFramebuffer(s.fbo),r.bindTechnique(a,this.bindParameters,this._compositingPassParameters),r.screen.draw(),s.attachDepth(o),A.release(),s}_renderCommon(e){null!=this._vao&&(e.bindVAO(this._vao),e.drawArrays(A.TRIANGLE_STRIP,0,4))}_update(){const e=this.bindParameters.camera,i=c(e.eye),o=Math.sqrt(i),a=i-this._passParameters.radii[1]*this._passParameters.radii[1],n=s((o-this._passParameters.radii[0])/u.atmosphereHeight,0,1);p(this._passParameters.heightParameters,o,i,a,n);const h=this.view.basemapTerrain?.getLowerBoundRadius()??0;m(this._passParameters.radii,h,h+u.atmosphereHeight),this._passParameters.hazeStrength=t(t(.6,1,r(9500,10500,o-u.radius)),1,this._amount)}};C=e([n("esri.views.3d.webgl-engine.effects.haze.Haze")],C);export{C as Haze};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{lerp as t,clamp as s,smoothstep as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{l as h,k as c}from"../../../../../chunks/vec32.js";import{s as p}from"../../../../../chunks/vec42.js";import{earth as u}from"../../../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as d}from"../../../webgl.js";import{ColorFormat as l}from"../../../webgl/formats.js";import{TransparentEnvironment as f}from"../TransparentEnvironment.js";import{H as _}from"../../../../../chunks/HazeCompositing.glsl.js";import{HazeCompositingTechnique as g}from"./HazeCompositingTechnique.js";import{HazePassParameters as b,HazeTechnique as w}from"./HazeTechnique.js";import{HazeTechniqueConfiguration as P}from"./HazeTechniqueConfiguration.js";import{createQuadVAO as j,Layout as v}from"../../lib/glUtil3D.js";import{applyTextureResizeModulo as A}from"../../lib/textureUtils.js";import{DepthStencilAttachment as T,PrimitiveType as C}from"../../../../webgl/enums.js";let x=class extends f{constructor(e){super(e),this._compositingPassParameters=new _,this._passParameters=new b,this._hazeConfiguration=new P,this._vao=null,this.requireGeometryDepth=!0,this._oldAmount=1,this._newAmount=1,this._amount=this._newAmount;const t=e.view.stage.renderView.techniques;t.precompile(w,new P);const s=new P;s.reduced=!0,t.precompile(w,s),t.precompile(g)}initialize(){this.addHandles([o((()=>this.view.environment.atmosphereEnabled),(e=>e?this._enable():this._disable()),a),o((()=>this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1),(e=>this._fade(e)),a),o((()=>this.view.environment.weather.type),(e=>this._newAmount="rainy"===e?0:1),a),o((()=>this.view.stage.renderer?.fullResolutionAtmosphere),(e=>this._hazeConfiguration.reduced=!e),a)])}_fade(e){e>=1?(this._amount=this._newAmount,this._oldAmount=this._newAmount):this._amount=e<=0?this._oldAmount:t(this._oldAmount,this._newAmount,e)}destroy(){this._vao=i(this._vao)}render(e){const s=e.find((({name:e})=>e===d.TRANSPARENT_ENVIRONMENT));if(!this.bindParameters.mainDepth)return s;const r=this.renderingContext;this._vao??=j(r,v.Pos2Tex);const i=this.techniques.get(w,this._hazeConfiguration);if(!i.compiled)return s;const o=s.getAttachment(T);if(this._update(),!this._hazeConfiguration.reduced)return s.detachDepth(),r.bindFramebuffer(s.fbo),r.bindTechnique(i,this.bindParameters,this._passParameters),this._renderCommon(r),s.attachDepth(o),s;const a=this.techniques.get(g);if(!a.compiled)return s;const n=r.getViewport(),m=this.camera,c=h(m.eye)-u.radius;let p;const f=u.atmosphereHeight;if(c<f){const e=Math.min(1,Math.max(0,c/f));p=t(.4,.5,e)}else{const e=Math.min(1,Math.max(0,(c-f)/(15*f)));p=t(.5,1,e)}const _=this.renderingContext.parameters.maxTextureSize,b=A(Math.round(p*m.fullViewport[2]),_),P=A(Math.round(p*m.fullViewport[3]),_);r.setViewport(0,0,b,P);const C=this.fboCache.acquire(b,P,"haze",l.RGBA);return r.bindFramebuffer(C.fbo),r.clearFramebuffer([0,0,0,1],!0,!0),r.bindTechnique(i,this.bindParameters,this._passParameters),this._renderCommon(r),r.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=C.getTexture(),s.detachDepth(),r.bindFramebuffer(s.fbo),r.bindTechnique(a,this.bindParameters,this._compositingPassParameters),r.screen.draw(),s.attachDepth(o),C.release(),s}_renderCommon(e){null!=this._vao&&(e.bindVAO(this._vao),e.drawArrays(C.TRIANGLE_STRIP,0,4))}_update(){const e=this.bindParameters.camera,i=c(e.eye),o=Math.sqrt(i),a=i-this._passParameters.radii[1]*this._passParameters.radii[1],n=s((o-this._passParameters.radii[0])/u.atmosphereHeight,0,1);p(this._passParameters.heightParameters,o,i,a,n);const h=this.view.basemapTerrain?.getLowerBoundRadius()??0;m(this._passParameters.radii,h,h+u.atmosphereHeight),this._passParameters.hazeStrength=t(t(.6,1,r(9500,10500,o-u.radius)),1,this._amount)}};x=e([n("esri.views.3d.webgl-engine.effects.haze.Haze")],x);export{x as Haze};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import{releaseMaybe as t,disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as l}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as a}from"../../../webgl.js";import{ColorFormat as g}from"../../../webgl/formats.js";import c from"../../../webgl/RenderNode.js";import{HighlightApplyTechnique as u}from"./HighlightApplyTechnique.js";import{HighlightDownsampleTechnique as m}from"./HighlightDownsampleTechnique.js";import{HighlightPassParameters as p}from"./HighlightPassParameters.js";import{HighlightToSingleTechnique as d}from"./HighlightToSingleTechnique.js";import{SingleHighlightApplyTechnique as f}from"./SingleHighlightApplyTechnique.js";import{SingleHighlightBlurTechnique as b}from"./SingleHighlightBlurTechnique.js";import{RenderRequestType as T}from"../../lib/basicInterfaces.js";import{Default3D as w}from"../../lib/DefaultVertexAttributeLocations.js";import{NoVertex as x}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as _}from"../../lib/VertexArrayObject.js";import{H as C,g as v}from"../../../../../chunks/HighlightDownsample.glsl.js";import{S as j}from"../../../../../chunks/SingleHighlightBlur.glsl.js";import{BufferObject as H}from"../../../../webgl/BufferObject.js";import{PixelFormat as q,TextureSamplingMode as P,FramebufferBit as R,Usage as D,TextureType as O,PrimitiveType as S,DataType as A}from"../../../../webgl/enums.js";import{Texture as E}from"../../../../webgl/Texture.js";import{TextureDescriptor as y}from"../../../../webgl/TextureDescriptor.js";let I=class extends c{constructor(){super(...arguments),this.produces=a.HIGHLIGHTS,this.consumes={required:[a.HIGHLIGHTS,"highlights"]},this._useMultipleHighlights=!1,this._downsampleDrawParameters=new C,this._passParameters=new p,this._singleHighlightBlurDrawParameters=new j,this._grid=new M}initialize(){this.addHandles([r((()=>this._updateOptionsTexture()),(()=>{}),s)])}destroy(){this._grid.coverage=t(this._grid.coverage),this._grid.vao=i(this._grid.vao),this._passParameters.highlightOptionsTexture=t(this._passParameters.highlightOptionsTexture)}_updateOptionsTexture(){if(null==this._passParameters.highlightOptionsTexture){const e=new y(16,2);e.internalFormat=q.RGBA,e.samplingMode=P.NEAREST,this._passParameters.highlightOptionsTexture=new E(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(U(this.view.state.highlights)),this.requestRender(T.UPDATE)}precompile(){this.techniques.precompile(m),this._useMultipleHighlights?this.techniques.precompile(u):(this.techniques.precompile(d),this.techniques.precompile(b),this.techniques.precompile(f))}render(e){const t=e.find((({name:e})=>e===a.HIGHLIGHTS)),{techniques:i,bindParameters:r,_passParameters:s,renderingContext:o}=this;if(!r.decorations)return t;const h=i.get(m);if(!h.compiled)return this.requestRender(T.UPDATE),t;const l=e.find((({name:e})=>"highlights"===e)).getTexture(),n=()=>{this._gridUpdateResources(l);const e=this._gridComputeCoverage(h,l,r),{horizontalCellCount:t,verticalCellCount:i}=e;return s.horizontalCellCount=t,s.verticalCellCount=i,s.coverageTexture=e.coverage?.getTexture(),e},g=e=>{const t=e.verticalCellCount*e.horizontalCellCount;o.bindVAO(e.vao),o.drawElementsInstanced(S.TRIANGLES,6,A.UNSIGNED_BYTE,0,t)},{camera:c}=r,u=()=>{o.bindFramebuffer(t.fbo),o.setViewport4fv(c.fullViewport)};return this._useMultipleHighlights?this._renderMultiple(l,n,g,u):this._renderSingle(l,n,g,u),s.highlightTexture=null,s.coverageTexture=null,t}_renderMultiple(e,t,i,r){const{techniques:s,bindParameters:o,_passParameters:h,renderingContext:l}=this,n=s.get(u);if(!n.compiled)return void this.requestRender(T.UPDATE);const a=t();h.highlightTexture=e,h.pixelRatio=o.camera.pixelRatio,l.bindTechnique(n,o,h),r(),i(a)}_renderSingle(e,t,i,r){const{fboCache:s,techniques:o,bindParameters:h,_passParameters:n,renderingContext:a}=this,c=o.get(d),u=o.get(b),m=o.get(f);if(!m.compiled||!u.compiled||!c.compiled)return void this.requestRender(T.UPDATE);const p=t(),{width:w,height:x}=e.descriptor;n.highlightTexture=e;const{camera:_}=h,{fullWidth:C,fullHeight:v,pixelRatio:j}=_,H=Math.ceil(C/j),q=Math.ceil(v/j),{_singleHighlightBlurDrawParameters:P}=this,D=this.view._stage.renderView.renderer,{highlights:O}=h;for(let d=0;d<O.length;++d){const{name:e}=O[d];if(!D.hasHighlight(e))continue;n.highlightLevel=d,a.setClearColor(0,0,0,0);const t=s.acquire(w,x,"single highlight",g.RG);a.bindFramebuffer(t.fbo),a.setViewport(0,0,w,x),a.clear(R.COLOR),a.bindTechnique(c,h,n),i(p),P.blurInput=t.getTexture(),l(P.blurSize,1/H,0);const o=s.acquire(H,q,"single highlight blur h",g.RG);a.unbindTexture(o.fbo?.colorTexture),a.bindFramebuffer(o.fbo),a.setViewport(0,0,H,q),a.clear(R.COLOR),a.bindTechnique(u,h,n,P),i(p),t.release(),l(P.blurSize,0,1/q),n.singleHighlightBlurTexture=o.getTexture(),r(),a.bindTechnique(m,h,n,P),i(p),o.release()}}_gridUpdateResources(e){const t=this._grid,{width:i,height:r}=e.descriptor;if(t.horizontalCellCount=Math.ceil(i/v),t.verticalCellCount=Math.ceil(r/v),t.vao)return;const s=this.renderingContext,o=H.createIndex(s,D.STATIC_DRAW,F);t.vao=new _(s,w,new Map([["geometry",x]]),new Map([["geometry",H.createVertex(s,D.STATIC_DRAW)]]),o)}_gridComputeCoverage(e,t,i){const r=this.renderingContext,s=this._grid,o=t.descriptor,h=Math.ceil(o.width/v),l=Math.ceil(o.height/v);this._downsampleDrawParameters.input=t,s.coverage?.release();const n=this.fboCache.acquire(h,l,"highlight coverage",g.RG);return s.coverage=n,r.bindFramebuffer(n.fbo),r.bindTechnique(e,i,this._passParameters,this._downsampleDrawParameters),r.setViewport(0,0,h,l),r.screen.draw(),s}get test(){}};e([o()],I.prototype,"produces",void 0),e([o()],I.prototype,"consumes",void 0),I=e([h("esri.views.3d.webgl-engine.effects.highlight.Highlight")],I);class M{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}function U(e){const t=new Uint8Array(128);let i=0;for(const r of e){const e=4*i,s=4*i+64;++i;const{color:o}=r,h=r.haloColor??o;t[e+0]=o.r,t[e+1]=o.g,t[e+2]=o.b,t[e+3]=r.fillOpacity*o.a*255,t[s+0]=h.r,t[s+1]=h.g,t[s+2]=h.b,t[s+3]=r.haloOpacity*h.a*255}return t}let G=0;function L(e){let t=0;for(const r of e){const{name:e}=r;t+=e.length;const{color:i,fillOpacity:s,haloColor:o,haloOpacity:h}=r;t+=i.r+i.g+i.b+i.a+s,t+=o?o.r+o.g+o.b+o.a+h:0}const i=e.at(0);if(i){const{shadowOpacity:e,shadowDifference:r,shadowColor:s}=i;t+=e+r+s.r+s.g+s.b+s.a}return G+++(t>=0?0:1)}const F=new Uint8Array([0,1,2,2,1,3]);function V(e,t,i,r,s,o=0){const h=r.highlights,a=h.length>1?t.acquire(i.width,i.height,"highlight mix",g.RG):null;if(a){const t=e.getBoundFramebufferObject();e.bindFramebuffer(a.fbo),e.clearFramebuffer(n),e.bindFramebuffer(t)}const c=a?.getTexture();r.highlightMixTexture=c,l(r.highlightMixOrigin,o,0),h.forEach(((t,h)=>{h>0&&(e.bindTexture(c,E.TEXTURE_UNIT_FOR_UPDATES),e.gl.copyTexSubImage2D(O.TEXTURE_2D,0,0,0,o,0,i.width,i.height),e.bindTexture(null,E.TEXTURE_UNIT_FOR_UPDATES)),e.clear(R.DEPTH),r.highlightLevel=h,s()})),r.highlightLevel=null,r.highlightMixTexture=null,a?.release()}export{I as Highlight,V as renderHighlightBuffer,L as trackHighlightOptions};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import{releaseMaybe as t,disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as l}from"../../../webgl.js";import{ColorFormat as a}from"../../../webgl/formats.js";import g from"../../../webgl/RenderNode.js";import{HighlightApplyTechnique as c}from"./HighlightApplyTechnique.js";import{HighlightBlurTechnique as u}from"./HighlightBlurTechnique.js";import{HighlightDownsampleTechnique as m}from"./HighlightDownsampleTechnique.js";import{HighlightPassParameters as p}from"./HighlightPassParameters.js";import{HighlightToSingleTechnique as d}from"./HighlightToSingleTechnique.js";import{RenderRequestType as f}from"../../lib/basicInterfaces.js";import{Default3D as b}from"../../lib/DefaultVertexAttributeLocations.js";import{NoVertex as T}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as w}from"../../lib/VertexArrayObject.js";import{H as x}from"../../../../../chunks/HighlightBlur.glsl.js";import{H as C,g as v}from"../../../../../chunks/HighlightDownsample.glsl.js";import{BufferObject as _}from"../../../../webgl/BufferObject.js";import{PixelFormat as j,TextureSamplingMode as H,FramebufferBit as P,Usage as R,TextureType as O,PrimitiveType as q,DataType as D}from"../../../../webgl/enums.js";import{Texture as I}from"../../../../webgl/Texture.js";import{TextureDescriptor as y}from"../../../../webgl/TextureDescriptor.js";let A=class extends g{constructor(){super(...arguments),this.produces=l.HIGHLIGHTS,this.consumes={required:[l.HIGHLIGHTS,"highlights"]},this._downsampleDrawParameters=new C,this._passParameters=new p,this._highlightBlurDrawParameters=new x,this._grid=new U}initialize(){this.addHandles([i((()=>this._updateOptionsTexture()),(()=>{}),s)])}destroy(){this._grid.coverage=t(this._grid.coverage),this._grid.vao=r(this._grid.vao),this._passParameters.highlightOptionsTexture=t(this._passParameters.highlightOptionsTexture)}_updateOptionsTexture(){if(null==this._passParameters.highlightOptionsTexture){const e=new y(16,2);e.internalFormat=j.RGBA,e.samplingMode=H.NEAREST,this._passParameters.highlightOptionsTexture=new I(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(E(this.view.state.highlights)),this.requestRender(f.UPDATE)}precompile(){this.techniques.precompile(m),this.techniques.precompile(d),this.techniques.precompile(u),this.techniques.precompile(c)}render(e){const t=e.find((({name:e})=>e===l.HIGHLIGHTS)),{techniques:r,bindParameters:i,_passParameters:s,renderingContext:o}=this;if(!i.decorations)return t;const h=r.get(m);if(!h.compiled)return this.requestRender(f.UPDATE),t;const n=e.find((({name:e})=>"highlights"===e)).getTexture();s.highlightTexture=n;const a=()=>{this._gridUpdateResources(n);const e=this._gridComputeCoverage(h,n,i),{horizontalCellCount:t,verticalCellCount:r}=e;return s.horizontalCellCount=t,s.verticalCellCount=r,s.coverageTexture=e.coverage?.getTexture(),e},g=e=>{const t=e.verticalCellCount*e.horizontalCellCount;o.bindVAO(e.vao),o.drawElementsInstanced(q.TRIANGLES,6,D.UNSIGNED_BYTE,0,t)},{camera:c}=i,u=()=>{o.bindFramebuffer(t.fbo),o.setViewport4fv(c.fullViewport)};return this._renderHighlightPostprocess(n,a,g,u),s.highlightTexture=null,s.coverageTexture=null,t}_renderHighlightPostprocess(e,t,r,i){const{fboCache:s,techniques:o,bindParameters:h,_passParameters:l,renderingContext:g}=this,m=o.get(d),p=o.get(u),b=o.get(c);if(!b.compiled||!p.compiled||!m.compiled)return void this.requestRender(f.UPDATE);l.highlightTexture=e;const T=t(),{width:w,height:x}=e.descriptor;l.highlightTexture=e;const{camera:C}=h,{fullWidth:v,fullHeight:_,pixelRatio:j}=C,H=Math.ceil(v/j),R=Math.ceil(_/j),{_highlightBlurDrawParameters:O}=this,q=this.view.stage.renderView.renderer,{highlights:D}=h;for(let c=0;c<D.length;++c){const{name:e}=D[c];if(!q.hasHighlight(e))continue;l.highlightLevel=c,g.setClearColor(0,0,0,0);const t=s.acquire(w,x,"single highlight",a.RG);g.bindFramebuffer(t.fbo),g.setViewport(0,0,w,x),g.clear(P.COLOR),g.bindTechnique(m,h,l),r(T),O.blurInput=t.getTexture(),n(O.blurSize,1/H,0);const o=s.acquire(H,R,"single highlight blur h",a.RG);g.unbindTexture(o.fbo?.colorTexture),g.bindFramebuffer(o.fbo),g.setViewport(0,0,H,R),g.clear(P.COLOR),g.bindTechnique(p,h,l,O),r(T),t.release(),n(O.blurSize,0,1/R),l.highlightBlurTexture=o.getTexture(),i(),g.bindTechnique(b,h,l,O),r(T),o.release()}}_gridUpdateResources(e){const t=this._grid,{width:r,height:i}=e.descriptor;if(t.horizontalCellCount=Math.ceil(r/v),t.verticalCellCount=Math.ceil(i/v),t.vao)return;const s=this.renderingContext,o=_.createIndex(s,R.STATIC_DRAW,L);t.vao=new w(s,b,new Map([["geometry",T]]),new Map([["geometry",_.createVertex(s,R.STATIC_DRAW)]]),o)}_gridComputeCoverage(e,t,r){const i=this.renderingContext,s=this._grid,o=t.descriptor,h=Math.ceil(o.width/v),n=Math.ceil(o.height/v);this._downsampleDrawParameters.input=t;const{highlights:l}=r;s.coverage?.release();const g=this.fboCache.acquire(h,n,"highlight coverage",l.length>B?a.RG8UI:a.R8UI);return s.coverage=g,i.bindFramebuffer(g.fbo),i.bindTechnique(e,r,this._passParameters,this._downsampleDrawParameters),i.setViewport(0,0,h,n),i.screen.draw(),s}get test(){}};e([o()],A.prototype,"produces",void 0),e([o()],A.prototype,"consumes",void 0),A=e([h("esri.views.3d.webgl-engine.effects.highlight.Highlight")],A);class U{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}function E(e){const t=new Uint8Array(128);let r=0;for(const i of e){const e=4*r,s=4*r+64;++r;const{color:o}=i,h=i.haloColor??o;t[e+0]=o.r,t[e+1]=o.g,t[e+2]=o.b,t[e+3]=i.fillOpacity*o.a*255,t[s+0]=h.r,t[s+1]=h.g,t[s+2]=h.b,t[s+3]=i.haloOpacity*h.a*255}return t}let S=0;function G(e){let t=0;for(const i of e){const{name:e}=i;t+=e.length;const{color:r,fillOpacity:s,haloColor:o,haloOpacity:h}=i;t+=r.r+r.g+r.b+r.a+s,t+=o?o.r+o.g+o.b+o.a+h:0}const r=e.at(0);if(r){const{shadowOpacity:e,shadowDifference:i,shadowColor:s}=r;t+=e+i+s.r+s.g+s.b+s.a}return S+++(t>=0?0:1)}const L=new Uint8Array([0,1,2,2,1,3]);function M(e,t,r,i,s,o=0){const{highlights:h}=i,l=h.length>1?t.acquire(r.width,r.height,"highlight mix",h.length>B?a.RG8UI:a.R8UI):null,{gl:g}=e;if(l){const t=e.getBoundFramebufferObject();e.bindFramebuffer(l.fbo),g.clearBufferuiv(g.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}const c=l?.getTexture();i.highlightMixTexture=c,n(i.highlightMixOrigin,o,0),h.forEach(((t,h)=>{if(h>0){const t=I.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(c,t),e.setActiveTexture(t),g.copyTexSubImage2D(O.TEXTURE_2D,0,0,0,o,0,r.width,r.height),e.bindTexture(null,t)}e.clear(P.DEPTH),i.highlightLevel=h,s()})),i.highlightLevel=null,i.highlightMixTexture=null,l?.release()}const B=4;export{A as Highlight,B as maxHighlightsPerChannel,M as renderHighlightBuffer,G as trackHighlightOptions};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../../chunks/HighlightBlur.glsl.js";import{makePipelineState as o,defaultColorWrite as s}from"../../../../webgl/renderState.js";class l extends r{constructor(r,o){super(r,o,new e(i,(()=>import("../../shaders/HighlightBlur.glsl.js"))))}initializePipeline(){return o({colorWrite:s})}}export{l as HighlightBlurTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{unitRGBAFromColor as s}from"../../../../../core/colorUtils.js";import{smoothstep as t,clamp as i}from"../../../../../core/mathUtils.js";import{watch as r,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{n as c,i as p,f as n}from"../../../../../chunks/vec32.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as d}from"../../../../ViewingMode.js";import{RenderCategory as l}from"../../../webgl.js";import g from"../../../webgl/RenderNode.js";import{ShadowHighlightPassParameters as u,ShadowHighlightTechnique as f}from"./ShadowHighlightTechnique.js";import{RenderRequestType as w}from"../../lib/basicInterfaces.js";import{defaultShadowOpacity as _,defaultShadowDifference as O,defaultShadowColor as y}from"../../../../support/HighlightDefaults.js";const P=1/512,b=4e4,j=5e4;let v=class extends g{constructor(e){super(e),this.produces=l.COMPOSITE,this.consumes={required:[l.COMPOSITE,"highlights"]},this._passParameters=new u,this._maxOpacity=1,this._shadowDifference=.2}initialize(){this.addHandles([r((()=>this.view.highlightOptions.shadowOpacity),(e=>{this._passParameters.shadowOpacity=e??_,this._updateOccludedShadowOpacity(),this._ensureMaxOpacity()}),a),r((()=>this.view.highlightOptions.shadowDifference),(e=>{this._shadowDifference=e??O,this._updateOccludedShadowOpacity(),this._ensureMaxOpacity()}),a),r((()=>this.view.highlightOptions.shadowColor),(e=>{this._passParameters.shadowColor=s(e??y),this._ensureMaxOpacity()}),a)])}_updateOccludedShadowOpacity(){this._passParameters.occludedShadowOpacity=this._passParameters.shadowOpacity*(1-this._shadowDifference)}_ensureMaxOpacity(){const e=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity);this._maxOpacity=e*this._passParameters.shadowColor[3],this.requestRender(w.UPDATE)}precompile(){this.techniques.precompile(f)}render(e){const s=e.find((({name:e})=>e===l.COMPOSITE)),t=this.bindParameters;if(!t.shadowHighlightsVisible||!t.depth||!this._ensureIfVisible(t.camera,t.lighting.mainLight.direction))return s;const i=this.techniques.get(f);if(i.compiled){this._passParameters.highlight=e.find((({name:e})=>"highlights"===e))?.getTexture(),this._passParameters.origin=t.camera.center;const r=this.renderingContext;r.bindFramebuffer(s.fbo),r.bindTechnique(i,t,this._passParameters),r.screen.draw()}else this.requestRender(w.UPDATE);return s}_ensureIfVisible(e,s){this._passParameters.opacityElevation=1-t(b,j,e.relativeElevation);const r=this.viewingMode===d.Global?c(x,e.center):p(x,0,0,1),a=n(r,s);return this._passParameters.dayNightTerminator=t(0,1,i(30*a,0,1)),this._maxOpacity*this._passParameters.opacityElevation*this._passParameters.dayNightTerminator>=P}};e([o()],v.prototype,"produces",void 0),e([o()],v.prototype,"consumes",void 0),e([o({constructOnly:!0})],v.prototype,"viewingMode",void 0),v=e([h("esri.views.3d.webgl-engine.effects.highlight.ShadowHighlight")],v);const x=m();export{v as ShadowHighlight};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{unitRGBAFromColor as s}from"../../../../../core/colorUtils.js";import{smoothstep as t,clamp as i}from"../../../../../core/mathUtils.js";import{watch as r,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{n as c,i as p,f as n}from"../../../../../chunks/vec32.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as d}from"../../../../ViewingMode.js";import{RenderCategory as l}from"../../../webgl.js";import g from"../../../webgl/RenderNode.js";import{ShadowHighlightPassParameters as u,ShadowHighlightTechnique as f}from"./ShadowHighlightTechnique.js";import{RenderRequestType as w}from"../../lib/basicInterfaces.js";import{defaultShadowOpacity as _,defaultShadowDifference as O,defaultShadowColor as y}from"../../../../support/HighlightDefaults.js";const P=1/512,b=4e4,j=5e4;let v=class extends g{constructor(e){super(e),this.produces=l.COMPOSITE,this.consumes={required:[l.COMPOSITE,"highlights"]},this._passParameters=new u,this._maxOpacity=1,this._shadowDifference=.2}initialize(){this.addHandles([r((()=>this.view.highlightOptions.shadowOpacity),(e=>{this._passParameters.shadowOpacity=e??_,this._updateOccludedShadowOpacity(),this._ensureMaxOpacity()}),a),r((()=>this.view.highlightOptions.shadowDifference),(e=>{this._shadowDifference=e??O,this._updateOccludedShadowOpacity(),this._ensureMaxOpacity()}),a),r((()=>this.view.highlightOptions.shadowColor),(e=>{this._passParameters.shadowColor=s(e??y),this._ensureMaxOpacity()}),a)])}_updateOccludedShadowOpacity(){this._passParameters.occludedShadowOpacity=this._passParameters.shadowOpacity*(1-this._shadowDifference)}_ensureMaxOpacity(){const e=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity);this._maxOpacity=e*this._passParameters.shadowColor[3],this.requestRender(w.UPDATE)}precompile(){this.techniques.precompile(f)}render(e){const s=e.find((({name:e})=>e===l.COMPOSITE)),t=this.bindParameters;if(!t.shadowHighlightsVisible||!t.depth||!this._ensureIfVisible(t.camera,t.lighting.mainLight.direction))return s;const i=this.techniques.get(f);if(i.compiled){this._passParameters.highlightTexture=e.find((({name:e})=>"highlights"===e))?.getTexture(),this._passParameters.origin=t.camera.center;const r=this.renderingContext;r.bindFramebuffer(s.fbo),r.bindTechnique(i,t,this._passParameters),r.screen.draw()}else this.requestRender(w.UPDATE);return s}_ensureIfVisible(e,s){this._passParameters.opacityElevation=1-t(b,j,e.relativeElevation);const r=this.viewingMode===d.Global?c(x,e.center):p(x,0,0,1),a=n(r,s);return this._passParameters.dayNightTerminator=t(0,1,i(30*a,0,1)),this._maxOpacity*this._passParameters.opacityElevation*this._passParameters.dayNightTerminator>=P}};e([o()],v.prototype,"produces",void 0),e([o()],v.prototype,"consumes",void 0),e([o({constructOnly:!0})],v.prototype,"viewingMode",void 0),v=e([h("esri.views.3d.webgl-engine.effects.highlight.ShadowHighlight")],v);const x=m();export{v as ShadowHighlight};