@arcgis/core 4.33.0-next.20250421 → 4.33.0-next.20250423
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.
- package/arcade/geometry/constructors.js +1 -1
- package/assets/components/assets/icon/mosaicMethodBlend16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodBlend24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodBlend32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodByAttribute16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodByAttribute24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodByAttribute32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodClosestToCenter16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodClosestToCenter24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodClosestToCenter32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodClosestToNadir16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodClosestToNadir24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodClosestToNadir32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodFirst16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodFirst24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodFirst32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodLast16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodLast24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodLast32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodLockRaster16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodLockRaster24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodLockRaster32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMaximum16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMaximum24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMaximum32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMean16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMean24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMean32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMinimum16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMinimum24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMinimum32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodNone16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodNone24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodNone32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodNorthWest16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodNorthWest24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodNorthWest32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodSeamline16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodSeamline24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodSeamline32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodSum16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodSum24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodSum32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{b2f9f0767dadf185120c.js → 00612d6e05b1c8647668.js} +1 -1
- package/assets/esri/core/workers/chunks/{f54546c155fba2fd3a7e.js → 05d7d8ff3e4cbad32580.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1e275607d9754079f60.js → 079434fe765c53d304f2.js} +1 -1
- package/assets/esri/core/workers/chunks/{0eed612e82a279ac8d1e.js → 11b55e7e76e50fe11bbe.js} +1 -1
- package/assets/esri/core/workers/chunks/235efd948ae470a6f238.js +1 -0
- package/assets/esri/core/workers/chunks/{0c6f2808c57ff820bfdd.js → 30551c1d3e4fa7be86c1.js} +2 -2
- package/assets/esri/core/workers/chunks/{0c6f2808c57ff820bfdd.js.LICENSE.txt → 30551c1d3e4fa7be86c1.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/3293b4041c222299428f.js +1 -0
- package/assets/esri/core/workers/chunks/{78242f2bf742b33d99fa.js → 3795793643f4db64af0e.js} +1 -1
- package/assets/esri/core/workers/chunks/{38f9ede26098eb03ca2d.js → 3cf001abca8ad933bccf.js} +2 -2
- package/assets/esri/core/workers/chunks/{38f9ede26098eb03ca2d.js.LICENSE.txt → 3cf001abca8ad933bccf.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{a91f2d1deb950f46ad09.js → 4f8782b3b6ad414409e8.js} +1 -1
- package/assets/esri/core/workers/chunks/{dbaa4b8d37aab40d7bd1.js → 543eb46b55cacd6e1dbc.js} +2 -2
- package/assets/esri/core/workers/chunks/{dbaa4b8d37aab40d7bd1.js.LICENSE.txt → 543eb46b55cacd6e1dbc.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{93f792f5b94f3745b57d.js → 577f24923fa4d08360e4.js} +2 -2
- package/assets/esri/core/workers/chunks/{93f792f5b94f3745b57d.js.LICENSE.txt → 577f24923fa4d08360e4.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{f46c4a69ef2f763e905b.js → 5d63dfa5a60c88e03b28.js} +1 -1
- package/assets/esri/core/workers/chunks/7bfa18dd8771d4932533.js +1 -0
- package/assets/esri/core/workers/chunks/{96cddbbeef61a4f33f29.js → 7c42281188b874ffcdad.js} +1 -1
- package/assets/esri/core/workers/chunks/82555a39a60110ca2713.js +1 -0
- package/assets/esri/core/workers/chunks/8dd26b12c625d20196ed.js +319 -0
- package/assets/esri/core/workers/chunks/{736a11e64e5f03e3936b.js → 9408a72968cbd985dd24.js} +53 -53
- package/assets/esri/core/workers/chunks/{c2f38c66fae2cdb57445.js → 96e5d192c8d23c1e324f.js} +1 -1
- package/assets/esri/core/workers/chunks/{796cf1c2ca9955595836.js → 9b2ab27159500315fbc1.js} +1 -1
- package/assets/esri/core/workers/chunks/a79511b926a2830bb160.js +1 -0
- package/assets/esri/core/workers/chunks/{814d72abbfdd4552e4ec.js → ac9c6779771ec855da79.js} +2 -2
- package/assets/esri/core/workers/chunks/{814d72abbfdd4552e4ec.js.LICENSE.txt → ac9c6779771ec855da79.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{ef6e805c49e1afdf966b.js → c054198c6438cb57f188.js} +1 -1
- package/assets/esri/core/workers/chunks/c5d786166a5609b85276.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{601fc99426f0213b0769.js → cbec01223d51cdb9ee79.js} +1 -1
- package/assets/esri/core/workers/chunks/{90c893959145827961ac.js → cd9343c78a7c3acdbbcd.js} +1 -1
- package/assets/esri/core/workers/chunks/d81bebbb6fe000200d35.js +1 -0
- package/assets/esri/core/workers/chunks/{5db336767959507c07e5.js → d8dc922f7466300b668f.js} +2 -2
- package/assets/esri/core/workers/chunks/{5db336767959507c07e5.js.LICENSE.txt → d8dc922f7466300b668f.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/e524462c63834fae7e01.js +2 -0
- package/assets/esri/core/workers/chunks/{02176f84d6d57f1bc1c8.js.LICENSE.txt → e524462c63834fae7e01.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{e7e987558cf017c62458.js → ebfa4a0334401f5e004a.js} +1 -1
- package/assets/esri/core/workers/chunks/{60d3b329e69f3cddb7f4.js → fa8a3c75f9b41d31559b.js} +1 -1
- package/assets/esri/core/workers/chunks/fd36b7aaf0d8e0c84471.js +1 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Bufferer-CicaNej1.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/GeodeticDistanceCalculator-CcF1gMZX.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +5 -0
- package/chunks/Point2D.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/QuadraticBezier.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/chunks/relateOperator.js +1 -1
- package/chunks/vxlLayer.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
- package/geometry/operators/gx/operatorSimplifyOGC.js +5 -0
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/simplifyOGCOperator.d.ts +6 -0
- package/geometry/operators/simplifyOGCOperator.js +5 -0
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/interfaces.d.ts +463 -55
- package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/layers/support/wmsUtils.js +1 -1
- package/package.json +2 -2
- package/smartMapping/renderers/size.d.ts +1 -0
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/referenceSizeUtils.js +1 -1
- package/smartMapping/renderers/support/regenerateUtils.js +1 -1
- package/smartMapping/renderers/support/rendererUtils.js +1 -1
- package/smartMapping/renderers/support/spikeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/versionManagement/utils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/PipelineCommand.js +1 -1
- package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/TileActionSynchronizer.js +5 -0
- package/views/3d/terrain/OverlayRenderTargets.js +1 -1
- package/views/3d/webgl/ManagedFBO.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/interactive/Tooltip.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +4 -0
- package/views/layers/LineOfSightLayerView.js +5 -0
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/formats.js +5 -0
- package/views/webgl/textureUtils.js +1 -1
- package/widgets/Print/CustomTemplate.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Print/utils.js +1 -1
- package/widgets/Print.js +1 -1
- package/assets/esri/core/workers/chunks/02176f84d6d57f1bc1c8.js +0 -2
- package/assets/esri/core/workers/chunks/0a7cba60a5286ba621d4.js +0 -1
- package/assets/esri/core/workers/chunks/2cbab0c078d0b844934c.js +0 -1
- package/assets/esri/core/workers/chunks/38557792ff9516fc991b.js +0 -1
- package/assets/esri/core/workers/chunks/82353e59ac6d909dcf41.js +0 -1
- package/assets/esri/core/workers/chunks/873327fc41edd3830afa.js +0 -319
- package/assets/esri/core/workers/chunks/d28e2c9bdf514236b011.js +0 -1
- package/assets/esri/core/workers/chunks/daa54c8a317c27881763.js +0 -1
- package/assets/esri/core/workers/chunks/e15c612caadf7bac4ab9.js +0 -1
- package/views/3d/webgl/formats.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 e from"../core/Collection.js";import{makeHandle as r}from"../core/handleUtils.js";import
|
|
5
|
+
import e from"../core/Collection.js";import{makeHandle as r}from"../core/handleUtils.js";import o from"../core/Logger.js";import{getOrCreateMapValue as t}from"../core/MapUtils.js";import n from"../rest/featureService/FeatureService.js";import s from"./VersioningState.js";import a from"./VersionManagementService.js";import{createVersionAdapters as i}from"./versionAdapters/utils.js";async function c(r,o){let t;if("layers"in r){const e=i(r.allTables.concat(r.allLayers).filter((e=>"group"!==e.type)).toArray());r.utilityNetworks&&r.utilityNetworks.forEach((r=>{const o=i([r]);e.push(...o)})),t=e}else t=new e(r);const c=new Map;for(const n of t){const r=c.get(n.featureServiceUrl);r?r.push(n):c.set(n.featureServiceUrl,new e([n]))}const l=new e;for(const[e,i]of c){const r=new n({url:e});if(await r.load(),!r.versionManagementServiceUrl)continue;const t=new a({url:r.versionManagementServiceUrl});l.push(new s({versionManagementService:t,versionableItems:i,usePersistentReadSessions:o}))}return l}const l=new Map;async function f(e,n=!1){const s=e.map;s.loaded||await s.load();const a=await c(s,n);return t(l,e,(()=>(e.addHandles(r((()=>{l.delete(e),a.forEach((e=>e.destroy()))}))),a.forEach((e=>e.load().catch((e=>{o.getLogger("esri.versionManagement.VersioningState").error("Failed to load Versioning State",e)})))),a)))}export{c as createVersioningStates,f as getVersioningStates};
|
|
@@ -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 t}from"../../../core/colorUtils.js";import{clamp as r,lerp as s}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{i as h,l as c,k as p}from"../../../chunks/vec32.js";import{s as u}from"../../../chunks/vec42.js";import{ZEROS as d}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{earth as f}from"../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as l}from"../webgl.js";import{innerAtmosphereDepth as g,computeInnerAltitudeFade as b}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as _,ChapmanAtmosphereTechnique as P}from"./ChapmanAtmosphereTechnique.js";import{ChapmanAtmosphereTechniqueConfiguration as j}from"./ChapmanAtmosphereTechniqueConfiguration.js";import{
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{unitRGBAFromColor as t}from"../../../core/colorUtils.js";import{clamp as r,lerp as s}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{i as h,l as c,k as p}from"../../../chunks/vec32.js";import{s as u}from"../../../chunks/vec42.js";import{ZEROS as d}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{earth as f}from"../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as l}from"../webgl.js";import{innerAtmosphereDepth as g,computeInnerAltitudeFade as b}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as _,ChapmanAtmosphereTechnique as P}from"./ChapmanAtmosphereTechnique.js";import{ChapmanAtmosphereTechniqueConfiguration as j}from"./ChapmanAtmosphereTechniqueConfiguration.js";import{OpaqueEnvironment as w}from"../webgl-engine/effects/OpaqueEnvironment.js";import{RenderRequestType as v}from"../webgl-engine/lib/basicInterfaces.js";import{createQuadVAO as q,Layout as A}from"../webgl-engine/lib/glUtil3D.js";import{applyTextureResizeModulo as T}from"../webgl-engine/lib/textureUtils.js";import{A as x}from"../../../chunks/AtmosphereCompositing.glsl.js";import{AtmosphereCompositingTechnique as C}from"../webgl-engine/shaders/AtmosphereCompositingTechnique.js";import{DepthStencilAttachment as E,PrimitiveType as R}from"../../webgl/enums.js";import{ColorFormat as D}from"../../webgl/formats.js";import k from"../../../webscene/background/ColorBackground.js";let y=class extends w{constructor(){super(...arguments),this.requireGeometryDepth=!0,this._compositingPassParameters=new x,this._vao=null,this._passParameters=new _,this._configuration=new j}initialize(){this.techniques.precompile(P,this._configuration),this.techniques.precompile(C),this._configuration.reduced=!0,this.techniques.precompile(P,this._configuration),this._configuration.reduced=!1,this.addHandles([o((()=>this.view.environment.background),(e=>{const r=e instanceof k?t(e.color):d;h(this._passParameters.backgroundColor,r[0]*r[3],r[1]*r[3],r[2]*r[3])}),a),o((()=>this.view.stage?.renderer?.fullResolutionAtmosphere),(e=>this._configuration.reduced=!e),a),o((()=>this.view.environment.atmosphereEnabled),(e=>e?this._enable():this._disable()),a)])}destroy(){this._vao=i(this._vao)}render(e){const t=e.find((({name:e})=>e===l.OPAQUE_ENVIRONMENT));if(!this.bindParameters.mainDepth)return t;const r=this.renderingContext;this._vao??=q(r,A.Pos2Tex);const i=t.getAttachment(E);this._update();const o=this.techniques.get(P,this._configuration);if(!o.compiled)return this.requestRender(v.UPDATE),t;if(!this._configuration.reduced)return t.detachDepth(),r.bindFramebuffer(t.fbo),r.bindTechnique(o,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(R.TRIANGLE_STRIP,0,4),t.attachDepth(i),t;const a=this.techniques.get(C);if(!a.compiled)return this.requestRender(v.UPDATE),t;const n=r.getViewport(),m=this.bindParameters.camera,h=c(m.eye)-f.radius;let p;const u=f.atmosphereHeight;if(h<u){const e=Math.min(1,Math.max(0,h/u));p=s(.2,.3,e)}else{const e=Math.min(1,Math.max(0,(h-u)/(15*u)));p=s(.3,.6,e)}const d=this.renderingContext.parameters.maxTextureSize,g=T(Math.round(p*m.fullViewport[2]),d),b=T(Math.round(p*m.fullViewport[3]),d);r.setViewport(0,0,g,b);const _=this.fboCache.acquire(g,b,"chapman",D.RGBA8);return r.bindFramebuffer(_.fbo),r.clearFramebuffer([0,0,0,1],!0,!0),r.bindTechnique(o,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(R.TRIANGLE_STRIP,0,4),r.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=_.getTexture(),t.detachDepth(),r.bindFramebuffer(t.fbo),r.bindTechnique(a,this.bindParameters,this._compositingPassParameters),r.screen.draw(),t.attachDepth(i),_.release(),t}_update(){const e=this.bindParameters.camera,t=p(e.eye),s=Math.sqrt(t),i=t-this._passParameters.radii[1]**2,o=r((s-this._passParameters.radii[0])/f.atmosphereHeight,0,1);u(this._passParameters.heightParameters,s,t,i,o);const a=this.view.basemapTerrain?.getLowerBoundRadius()??0;m(this._passParameters.radii,a,a+f.atmosphereHeight),this._passParameters.innerFadeDistance=2*Math.sqrt((2*a-g)*g),this._passParameters.altitudeFade=b(s-a)}};y=e([n("esri.views.3d.environment.ChapmanAtmosphere")],y);export{y as ChapmanAtmosphere};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as s}from"../../../chunks/tslib.es6.js";import{createTask as i}from"../../../core/asyncUtils.js";import e from"../../../core/Error.js";import{destroyMaybe as a,abortMaybe as t}from"../../../core/maybe.js";import{isAborted as r}from"../../../core/promiseUtils.js";import{watch as n,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import{subclass as y}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as w}from"./LayerView3D.js";import h from"../../layers/LayerView.js";const
|
|
5
|
+
import{_ as s}from"../../../chunks/tslib.es6.js";import{createTask as i}from"../../../core/asyncUtils.js";import e from"../../../core/Error.js";import{destroyMaybe as a,abortMaybe as t}from"../../../core/maybe.js";import{isAborted as r}from"../../../core/promiseUtils.js";import{watch as n,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import{subclass as y}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as w}from"./LayerView3D.js";import h from"../../layers/LayerView.js";import c from"../../layers/LineOfSightLayerView.js";const p="analysis-view-handles";let d=class extends(w(c(h))){constructor(s){super(s),this.type="line-of-sight-3d",this._analysisModule=null}initialize(){this.addHandles(n((()=>this.layer.analysis),(s=>{this._destroyAnalysisView(),null!=s&&this._createAnalysisView(s)}),l),p)}destroy(){this.removeHandles(p),this._destroyAnalysisView()}async whenAnalysisView(){if(null!=this.analysisView)return this.analysisView;if(null!=this._createAnalysisViewTask)return this._createAnalysisViewTask.promise;throw new e("layerview:no-analysisview-for-analysis","The analysis has not been set on the LineOfSightLayer of this layer view")}isUpdating(){return null!=this._createAnalysisViewTask||null!=this.analysisView&&this.analysisView.updating}_createAnalysisView(s){const e=i((async i=>(this.analysisView=await this._createAnalysisViewPromise(s,i),this._createAnalysisViewTask===e&&(this._createAnalysisViewTask=null),this.analysisView)));this._createAnalysisViewTask=e}_destroyAnalysisView(){this.analysisView=a(this.analysisView),this._createAnalysisViewTask=t(this._createAnalysisViewTask)}async _createAnalysisViewPromise(s,i){let a=this._analysisModule;if(null==a){const s=await this._loadAnalysisModule();this._analysisModule=s,a=s}const t=new a.default({analysis:s,view:this.view,parent:this});if(await t.when(),r(i))throw t.destroy(),new e("layerview:no-analysisview-for-analysis","The analysis has not been added to the LineOfSightLayer of this layer view",{analysis:s});return t}_loadAnalysisModule(){return import("../analysis/LineOfSightAnalysisView3D.js")}};s([o()],d.prototype,"type",void 0),s([o()],d.prototype,"analysisView",void 0),s([o()],d.prototype,"_createAnalysisViewTask",void 0),d=s([y("esri.views.3d.layers.LineOfSightLayerView3D")],d);const V=d;export{V as default};
|
|
@@ -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/Evented.js";import{throwIfAborted as r}from"../../../../../core/promiseUtils.js";import{watch as a,initial as n}from"../../../../../core/reactiveUtils.js";import{property as i}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import o from"../../../../../geometry/Extent.js";import{initializeProjection as
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Evented.js";import{throwIfAborted as r}from"../../../../../core/promiseUtils.js";import{watch as a,initial as n}from"../../../../../core/reactiveUtils.js";import{property as i}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import o from"../../../../../geometry/Extent.js";import{initializeProjection as c,project as u}from"../../../../../geometry/projection.js";import m from"../../../../../geometry/SpatialReference.js";import{QueryEngine as d}from"../../../../../layers/graphics/data/QueryEngine.js";import l from"../../../../../rest/support/Query.js";import{joinCommands as p}from"./PipelineCommand.js";import{Tile3DManager as y}from"./Tile3DManager.js";import{TileActionSynchronizer as h,TileActionType as f}from"./TileActionSynchronizer.js";import{TiledFeatureStore as _}from"./featureSet/TiledFeatureStore.js";import{Tile3DFetcher as g}from"./fetching/Tile3DFetcher.js";import{RenderCommandContext as C}from"./rendering/RenderCommandContext.js";import{UniqueValueFeatureRenderer as w}from"./symbolization/UniqueValueFeatureRenderer.js";import{RenderCoordsHelper as S}from"../../../support/RenderCoordsHelper.js";let v=class extends t.EventedAccessor{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new _,this._actionSynchronizer=new h(p,(e=>this._createCommand(e))),this._tileManager=null,this._renderer=null,this._fetcher=null,this._queryEngine=null,this._defaultQueryJSON=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager?.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,baseQuery:i,url:s,objectIdField:p,capabilities:h,fieldsIndex:f,timeInfo:_,elevationInfo:v,fullExtent:x}){const R=m.fromJSON(e),Q=m.fromJSON(t);this._fetcher=new g(R,l.fromJSON(i),s,p,h),this._queryEngine=new d({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",objectIdField:p,fieldsIndex:f,availableFields:[p],spatialReference:e,featureStore:this._featureStore,timeInfo:_});const F={createTexture:async(e,t)=>{const r={data:e,parameters:t};return await this.remoteClient.invoke("createTexture",r,{transferList:[e.buffer]})},releaseTexture:async e=>{const t={uid:e};await this.remoteClient.invoke("releaseTexture",t)},createMaterial:async e=>{const t={materialJSON:e};await this.remoteClient.invoke("createMaterial",t)},createDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("createDirectRenderer",t)},createLodRenderer:async(e,t,r)=>{const a={rendererId:e,lodRenderGeometry:t};await this.remoteClient.invoke("createLoDRenderer",a,{transferList:r})},executeRenderCommands:async e=>{const t={commands:e.commands};await this.remoteClient.invoke("dispatchRenderCommands",t,{transferList:e.transferList})},applyElevationAlignmentTo:async e=>{const t={mapPoints:e};return await this.remoteClient.invoke("applyElevationAlignment",t,{transferList:[e.buffer]})}};this._renderer=new w({viewSpatialReference:R,renderSpatialReference:Q,renderCoordsHelper:S.create(r,Q),renderCommandContext:new C(r,F),elevationInfo:v??{},mainThreadDelegate:F}),this._defaultQueryJSON=new l({outSpatialReference:R}).toJSON();let E=null;if(null!=x){const e=o.fromJSON(x);await c(e.spatialReference,R),E=u(e,R)}return this._tileManager=new y({loadTile:(e,t)=>this._fetcher.fetch(e,t),synchronizer:this._actionSynchronizer,extent:E}),this.addHandles(a((()=>this.updating),(e=>{this.emit("notify-updating",{updating:e})})),n),await this._renderer.load(),j}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async onTileTreeChange(e){return await this._tileManager.onTileTreeChange(e),j}async onElevationChange(e){return j}async onLayerOpacityChange(e){const t=await this._renderer.createUpdateLayerOpacityCommand(e);return await t.execute(),j}async _createAddFeatureDataCommand(e,t){const a=this._featureStore,n=await this._renderer.createAddCommand(e);return r(t),n.appendPipelineStateCommand((()=>{a.addTile(e)})),n}async _createRemoveFeatureDataCommand(e){const t=this._featureStore,r=this._renderer,a=await r.createRemoveCommand(e);return a.appendPipelineStateCommand((()=>{t.removeTile(e)})),a}async _createUpdateFeatureDataVisibilityCommand(e,t){const a=this._renderer,n=await a.createUpdateVisibilityCommand(e);return r(t),n}_ensureQuery(e){return e??this._defaultQueryJSON}async _createCommand(e){switch(e.type){case f.ADD:return await this._createAddFeatureDataCommand(e.data);case f.REMOVE:return await this._createRemoveFeatureDataCommand(e.data.id);case f.UPDATE_VISIBILITY:return await this._createUpdateFeatureDataVisibilityCommand(e.data)}}};e([i()],v.prototype,"updating",null),v=e([s("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],v);const x=v,j={result:void 0};export{x as default};
|
|
@@ -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
|
-
class e{constructor(e,n,t){this.renderCommandContext=e,this.renderCommandBuffer=n,this.pipelineStateCommands=t}append(e){this.appendRenderCommands(e.renderCommandBuffer),this.appendPipelineStateCommands(e.pipelineStateCommands)}appendRenderCommands(e){this.renderCommandBuffer.commands.push(...e.commands),this.renderCommandBuffer.transferList.push(...e.transferList)}appendPipelineStateCommand(e){this.pipelineStateCommands.push(e)}appendPipelineStateCommands(e){for(const n of e)this.appendPipelineStateCommand(n)}async execute(){for(const e of this.pipelineStateCommands)e();await this.renderCommandContext.dispatchRenderCommands(this.renderCommandBuffer)}}export{e as PipelineCommand};
|
|
5
|
+
class e{constructor(e,n,t){this.renderCommandContext=e,this.renderCommandBuffer=n,this.pipelineStateCommands=t}append(e){this.appendRenderCommands(e.renderCommandBuffer),this.appendPipelineStateCommands(e.pipelineStateCommands)}appendRenderCommands(e){this.renderCommandBuffer.commands.push(...e.commands),this.renderCommandBuffer.transferList.push(...e.transferList)}appendPipelineStateCommand(e){this.pipelineStateCommands.push(e)}appendPipelineStateCommands(e){for(const n of e)this.appendPipelineStateCommand(n)}async execute(){for(const e of this.pipelineStateCommands)e();await this.renderCommandContext.dispatchRenderCommands(this.renderCommandBuffer)}}function n(e){if(0===e.length)return null;return e.reduce(((e,n)=>(e.append(n),e)))}export{e as PipelineCommand,n as joinCommands};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Accessor.js";import{
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Accessor.js";import{createTask as o}from"../../../../../core/asyncUtils.js";import has from"../../../../../core/has.js";import{throwIfAborted as s,throwIfNotAbortError as i}from"../../../../../core/promiseUtils.js";import a from"../../../../../core/ReactiveMap.js";import{property as r}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{fromExtent as l,intersects as d}from"../../../../../geometry/support/aaBoundingRect.js";import{TileAction as c,TileActionType as u}from"./TileActionSynchronizer.js";import{FeatureData as f}from"./featureData/FeatureData.js";let p=class extends e{constructor(t){super(t),this._updatingCount=0,this.extent=null,this._tileHandles=new a,this._wanted=new a}destroy(){this._tileHandles.clear(),this._wanted.clear()}get updating(){return this._updatingCount>0}get _boundingRect(){const{extent:t}=this;return null==t?null:l(t)}get _missingTiles(){const t=new Array,e=this._wanted,o=this._tileHandles;for(const s of e.values())null==o.get(s.id)?.featureData&&t.push(s);return t}async onTileTreeChange(t){++this._updatingCount;try{const{added:e,removed:o}=t,s=this._tileHandles,{_boundingRect:i}=this,a=null!=i?e.filter((t=>d(i,t.extent))):e,r=this._wanted,n=new Array;for(const{id:t}of o)r.delete(t);for(const t of a)r.set(t.id,t);const l=this._missingTiles;for(const t of o){const{id:e}=t;if(l.some((e=>h(e,t)||h(t,e))))continue;const o=s.get(e);null!=o&&n.push(this._removeTile(o))}for(const t of a)n.push(this._addTile(t));const c=await Promise.allSettled(n);for(const t of c)"rejected"===t.status&&console.error(t.reason)}finally{--this._updatingCount}}async _removeTile(t){t.loadTask.abort(),this._tileHandles.delete(t.id),this._validate();const{featureData:e}=t;null!=e&&await this.synchronizer.enqueueActions([new c(t.id,u.REMOVE,e)])}async _addTile(t){const{_tileHandles:e}=this,a=e.get(t.id);if(null!=a){if(!_(a)||a.featureData.isFullyEnabled)return;return a.featureData.enableAll(),void await this._onTileLoad(a)}const r=new m(t,o((async e=>{const o=await this.loadTile(t,e);return s(e),new f(o)})));this._tileHandles.set(r.id,r);try{await r.loadTask.promise}catch(n){return void i(n)}w(r),await this._onTileLoad(r)}async _onTileLoad(t){const{_wanted:e,_tileHandles:o,_missingTiles:s}=this,i=t.descriptor,a=new Array,r=new Set;for(const n of o.values()){if(n===t)continue;const{descriptor:l,id:d}=n;if(e.has(d)||s.some((t=>h(t,l)||h(l,t)))){if(_(n)){if(h(i,l)){const t=n.featureData;for(const e of t.objectIds())r.add(e)}if(h(l,i)){const e=t.featureData,o=new Set(e.objectIds()),{featureData:s}=n;s.disableObjectIds(o),a.push(new c(d,u.UPDATE_VISIBILITY,s)),this._validateRemoval(s,o)}}}else{o.delete(d),n.loadTask.abort();const{featureData:t}=n;null!=t&&a.push(new c(d,u.REMOVE,t))}}r.size>0&&(t.featureData.disableObjectIds(r),this._validateRemoval(t.featureData,r)),this._validate(),a.push(new c(t.id,u.ADD,t.featureData)),await this.synchronizer.enqueueActions(a)}_validate(){if(!has("feature-pipeline-3d-test-validation"))return;const t=new Array;for(const e of this._tileHandles.values()){if(!_(e))continue;const{featureData:o}=e;t.push({featureData:o,objectIds:new Set(o.enabledObjectIds())})}for(let e=0;e<t.length;++e){const{featureData:o,objectIds:s}=t[e];for(let i=e+1;i<t.length;++i){const{featureData:e,objectIds:a}=t[i];for(const t of a)if(s.has(t))throw new Error(`${o.id} and ${e.id} both contain ${t}.`)}}}_validateRemoval(t,e){if(has("feature-pipeline-3d-test-validation"))for(const o of t.enabledObjectIds())if(e.has(o))throw new Error(`Failed to remove ${o} from ${t.id}!`)}};function h({lij:[t,e,o]},{lij:[s,i,a]}){const r=s-t;return r>=0&&e===i>>r&&o===a>>r}t([r()],p.prototype,"updating",null),t([r({constructOnly:!0})],p.prototype,"loadTile",void 0),t([r({constructOnly:!0})],p.prototype,"synchronizer",void 0),t([r()],p.prototype,"_updatingCount",void 0),t([r()],p.prototype,"extent",void 0),t([r()],p.prototype,"_boundingRect",null),t([r()],p.prototype,"_missingTiles",null),p=t([n("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],p);class m{constructor(t,e){this.descriptor=t,this.loadTask=e}get id(){return this.descriptor.id}get featureData(){return this.loadTask.value}}function _(t){return null!=t.featureData}function w(t){if(!_(t))throw new Error}export{p as Tile3DManager};
|
|
@@ -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{isSome as e}from"../../../../../core/arrayUtils.js";import{createResolver as t}from"../../../../../core/promiseUtils.js";class s{constructor(e,t){this._joinCommands=e,this._createCommand=t,this._executing=new Set,this._nextEvents=new Map}async enqueueActions(e){const{_executing:t}=this;return e.every((e=>!t.has(e.tileId)))?await this._executeActions(e):await this._scheduleActions(e)}async _scheduleActions(t){const{_nextEvents:s}=this,o=new Set(t.map((e=>s.get(e.tileId))).filter(e));let i;if(0!==o.size){const e=new Array,r=new Array;for(const t of o)e.push(t.actions),r.push(t.resolver);e.push(t);for(const t of e)for(const e of t)s.delete(e.tileId);const a=e.reduce(c);i=new n(a),i.resolver.promise.then((()=>{for(const e of r)e.resolve()}),(e=>{for(const t of r)t.reject(e)}))}else i=new n(t);for(const e of i.actions)s.set(e.tileId,i);return this._validate(),await i.resolver.promise}async _executeActions(t){const s=t.map((e=>e.tileId)),{_executing:n}=this;for(const e of s)n.add(e);this._validate();try{const s=(await Promise.allSettled(t.map(this._createCommand))).map((e=>"fulfilled"===e.status?e.value:null)).filter(e);if(0===s.length)return;const n=this._joinCommands(s);await(n?.execute())}finally{for(const e of s)n.delete(e);this._executeTails(s)}}_executeTails(t){const{_nextEvents:s}=this,n=new Set(t.map((e=>s.get(e))).filter(e));if(0===n.size)return;const{_executing:o}=this;for(const e of n){if(!e.actions.some((e=>o.has(e.tileId)))){for(const t of e.actions)s.delete(t.tileId);this._executeActions(e.actions).then((()=>{e.resolver.resolve()}),(t=>{e.resolver.reject(t)}))}}}_validate(){const{_nextEvents:e}=this,t=Array.from(new Set(e.values()));if(0===t.length)return;if(t.some((t=>t.actions.some((({tileId:s})=>e.get(s)!==t)))))throw new Error("Mismatch between map and event")}}class n{constructor(e){this.actions=e,this.resolver=t()}}class o{constructor(e,t,s){this.tileId=e,this.type=t,this.data=s}toString(){return`${this.tileId}: ${this.type}`}}var i,r;function c(e,t){const s=new Array(e.length).fill(!0),n=new Array(t.length).fill(!0);e:for(let i=0;i<e.length;++i){const o=e[i];for(let e=0;e<t.length;++e){if(!n[e])continue;switch(a(o,t[e])){case r.NONE:break;case r.OVERWRITE:s[i]=!1;continue e;case r.REDUNDANT:n[e]=!1;break;case r.ANNIHILATE:s[i]=!1,n[e]=!1;continue e}}}const o=new Array;for(let i=0;i<e.length;++i)s[i]&&o.push(e[i]);for(let i=0;i<t.length;++i)n[i]&&o.push(t[i]);return o}function a(e,t){if(e.tileId!==t.tileId)return r.NONE;if(e.type===i.ADD&&t.type===i.REMOVE)return r.ANNIHILATE;if(e.type===i.ADD&&t.type===i.UPDATE_VISIBILITY)return r.REDUNDANT;if(e.type===i.REMOVE&&t.type===i.ADD)return r.ANNIHILATE;if(e.type===i.UPDATE_VISIBILITY&&t.type===i.REMOVE)return r.OVERWRITE;if(e.type===i.UPDATE_VISIBILITY&&t.type===i.UPDATE_VISIBILITY)return r.OVERWRITE;throw new Error("Impossible sequence of actions")}!function(e){e.ADD="ADD",e.REMOVE="REMOVE",e.UPDATE_VISIBILITY="UPDATE_VISIBILITY"}(i||(i={})),function(e){e.NONE="NONE",e.ANNIHILATE="ANNIHILATE",e.OVERWRITE="OVERWRITE",e.REDUNDANT="REDUNDANT"}(r||(r={}));export{r as JoinResult,o as TileAction,s as TileActionSynchronizer,i as TileActionType,c as joinActionLists,a as joinActions};
|
|
@@ -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{OverlayContent as e}from"./OverlayContent.js";import{OverlayFramebufferObject as r}from"./OverlayFramebufferObject.js";import{
|
|
5
|
+
import{OverlayContent as e}from"./OverlayContent.js";import{OverlayFramebufferObject as r}from"./OverlayFramebufferObject.js";import{ShaderOutput as o}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{olidEnabled as t}from"../webgl-engine/effects/geometry/olidUtils.js";import{ColorFormat as l}from"../../webgl/formats.js";class s{constructor(e,o,t,s,i=l.RGBA8_MIPMAP){this.output=t,this.content=s,this.fbo=new r(e,i,o)}get valid(){return this.fbo.valid}}class i{constructor(r){this.targets=[new s(r,"overlay color",o.Color,e.Color),new s(r,"overlay IM color",o.Color,e.ColorNoRasterImage),new s(r,"overlay highlight",o.Highlight,e.Highlight,l.RG8UI),new s(r,"overlay water",o.Normal,e.WaterNormal),new s(r,"overlay occluded",o.Color,e.Occluded)],t()&&this.targets.push(new s(r,"overlay olid",o.ObjectAndLayerIdColor,e.ObjectAndLayerIdColor,l.RGBA8))}getTexture(e){return this.targets[e]?.fbo.texture}dispose(){for(const e of this.targets)e.fbo.dispose()}computeValidity(){return this.targets.reduce(((e,r,o)=>r.valid?e|=1<<o:e),0)}}export{i as OverlayRenderTargets,s as RenderTargetDescriptor};
|
|
@@ -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{someMap as t}from"../../../core/MapUtils.js";import{releaseMaybe as e}from"../../../core/maybe.js";import{RenderCategory as h}from"../webgl.js";import{isManagedDepthTexture as
|
|
5
|
+
import{someMap as t}from"../../../core/MapUtils.js";import{releaseMaybe as e}from"../../../core/maybe.js";import{RenderCategory as h}from"../webgl.js";import{isManagedDepthTexture as o}from"./ManagedDepthTexture.js";import{ManagedFBOResource as r,AttachmentType as s}from"./ManagedFBOResource.js";import{DepthStencilAttachment as i,ColorAttachment0 as a}from"../../webgl/enums.js";class c extends r{constructor(t,e,o,r,i,a){super(t,a),this.fbo=o,this.type=s.FBO,this._colors=new Map,this._name=h.COMPOSITE,this.acquireColor=null,this.acquireDepth=null,this._name=e,this.acquireDepth=r,this.acquireColor=i}dispose(){this.fbo?.dispose()}get cachedMemory(){return this.fbo?.usedMemory||0}get numberOfColorAttachments(){return this._colors.size}get name(){return this._name}setName(t){this._name=t}getTexture(t=a){return t===i?this.fbo?.depthStencilTexture:this.fbo?.getColorTexture(t)}getAttachment(t=a){return t===i?this._depth:this._colors.get(t)}hasAttachment(e){return t(this._colors,(t=>t.name===e))}attachDepth(t){return t?.retain(),this.detachDepth(),t&&this.fbo?.attachDepthStencil(t.attachment),this._depth=t,this}detachDepth(){this.fbo?.detachDepthStencilTexture(),this.fbo?.detachDepthStencilBuffer(),this._depth=e(this._depth)}obtainDepthTexture(){const t=this._depth;return o(t)?(this.fbo?.detachDepthStencilTexture(),this._depth=null,t):null}attachColor(t,e){return t.retain(),this.detachColor(e),this.fbo?.attachColorTexture(t.attachment,e),this._colors.set(e,t),this}detachColor(t){this.fbo?.detachColorTexture(t);const e=this._colors.get(t);this._colors.delete(t),e?.release()}detachAll(){this._colors.forEach(((t,e)=>this.detachColor(e))),this.detachDepth()}detachAllButColor0(){this._colors.forEach(((t,e)=>{e!==a&&this.detachColor(e)})),this.detachDepth()}}export{c as default};
|
|
@@ -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{
|
|
5
|
+
import e from"../../../../core/Error.js";import{ManagedColorAttachment as t}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthAttachment as r}from"../../webgl/ManagedDepthAttachment.js";import a from"../../webgl/ManagedFBO.js";import{AttachmentType as o}from"../../webgl/ManagedFBOResource.js";import{FBOPool as n}from"./FBOPool.js";import{PixelFormat as c,SizedPixelFormat as i,TextureWrapMode as s,TextureSamplingMode as h,PixelType as m,SizedDepthFormat as _,SizedDepthStencilFormat as l,ColorAttachment0 as p,UnsizedDepthFormat as d}from"../../../webgl/enums.js";import{ColorFormat as u,DepthFormat as E,depthFormatTextureDisambiguationOffset as T,depthFormatRenderbufferDisambiguationOffset as w}from"../../../webgl/formats.js";import{FramebufferObject as C}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as f}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as A}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as M}from"../../../webgl/Texture.js";import{TextureDescriptor as R}from"../../../webgl/TextureDescriptor.js";import{isDepthAndOrStencilFormat as F,isSizedDepthFormat as D}from"../../../webgl/textureUtils.js";class N{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new n(e.newCache,"FBOCache"),this._depthCache=new n(e.newCache,"DepthAttachmentCache"),this._colorCache=new n(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===o.FBO&&e(t.name,t.fbo,t.numberOfColorAttachments)))}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+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(t,r,o,n=u.RGBA8){const c=O(n,t,r);let i=this._cache.pop(c);const{rctx:s}=this;if(i){i.retain(),i.setName(o);const{fbo:t}=i;if(!t)throw new e("renderer","attempt to use a not existing framebuffer");s.temporaryBindFramebufferObject(t,(()=>{s.setDrawBuffers([p]),s.unbindTexture(t.colorTexture)}))}else{const e=new C(s);i=new a(c,o,e,(e=>{e??=E.DEPTH24_STENCIL8_TEXTURE;const a=this._acquireDepth(e,t,r,`${i.name} depth`);return i.attachDepth(a),a.release(),i}),((e,a,o)=>{a??=u.RGBA8;const n=this._acquireColor(a,t,r,o??`${i.name} color ${e}`);return this.rctx.unbindTexture(n.attachment),i.attachColor(n,e),n.release(),i}),(()=>{this.debugCallback?.(i.name,i.fbo,i.numberOfColorAttachments),this._acquired.delete(i),null!=i?.getAttachment(p)?(i.fbo?.invalidateAttachments([p],!0),i.detachAllButColor0(),this._cache.put(i)):i?.dispose()})),F(n)?i.acquireDepth(n):i.acquireColor(p,n,o)}return this._trackHandle(i)}acquireDepth(e,t,r,a){return this._acquireDepth(e,t,r,a)}_acquireDepth(e,t,a,o){const n=O(e,t,a);let c=this._depthCache.pop(n);if(c)c.retain();else{const o=e>T,i=o?e-T:e-w,s=o?new M(this.rctx,U(i,t,a)):new f(this.rctx,new A(i,t,a)),h=new r(n,s,(()=>{this._depthCache.put(h)}));c=h}return c.name=o,c}_acquireColor(e,r,a,o){const n=O(e,r,a),c=this._colorCache.pop(n);if(c)return c.retain(),c.name=o,c;const i=new t(n,new M(this.rctx,{...H[e],width:r,height:a}),(()=>{this._colorCache.put(i)}));return i.name=o,i}_trackHandle(e){return this._acquired.add(e),e}}const b=new a("default","default",null,(()=>b),(()=>b),(()=>{}));function O(e,t,r){return`${e}x${t}x${r}`}b.release=()=>!1;const G=new R;G.pixelFormat=c.RED,G.internalFormat=i.R8,G.wrapMode=s.CLAMP_TO_EDGE;const g=new R;g.pixelFormat=c.RED_INTEGER,g.internalFormat=i.R8UI,g.wrapMode=s.CLAMP_TO_EDGE,g.samplingMode=h.NEAREST;const P=new R;P.pixelFormat=c.RG,P.internalFormat=i.RG8,P.wrapMode=s.CLAMP_TO_EDGE;const x=new R;x.pixelFormat=c.RG_INTEGER,x.internalFormat=i.RG8UI,x.wrapMode=s.CLAMP_TO_EDGE,x.samplingMode=h.NEAREST;const I=new R;I.internalFormat=i.RGBA4,I.dataType=m.UNSIGNED_SHORT_4_4_4_4,I.wrapMode=s.CLAMP_TO_EDGE;const L=new R;L.wrapMode=s.CLAMP_TO_EDGE;const S=new R;S.wrapMode=s.CLAMP_TO_EDGE,S.samplingMode=h.LINEAR_MIPMAP_LINEAR,S.hasMipmap=!0,S.maxAnisotropy=8;const y=new R;y.pixelFormat=c.RED,y.dataType=m.HALF_FLOAT,y.internalFormat=i.R16F,y.samplingMode=h.NEAREST;const B=new R;B.dataType=m.HALF_FLOAT,B.internalFormat=i.RGBA16F,B.samplingMode=h.NEAREST;const j=new R;j.dataType=m.HALF_FLOAT,j.internalFormat=i.RGBA16F,j.wrapMode=s.CLAMP_TO_EDGE;const H={[u.R8]:G,[u.R8UI]:g,[u.RG8]:P,[u.RG8UI]:x,[u.RGBA4]:I,[u.RGBA8]:L,[u.RGBA8_MIPMAP]:S,[u.R16F]:y,[u.RGBA16F_NEAREST]:B,[u.RGBA16F]:j},q={[_.DEPTH_COMPONENT16]:m.UNSIGNED_SHORT,[_.DEPTH_COMPONENT24]:m.UNSIGNED_INT,[_.DEPTH_COMPONENT32F]:m.FLOAT,[l.DEPTH24_STENCIL8]:m.UNSIGNED_INT_24_8,[l.DEPTH32F_STENCIL8]:m.FLOAT_32_UNSIGNED_INT_24_8_REV};function U(e,t,r){const a=new R(t,r);return a.pixelFormat=D(e)?d.DEPTH_COMPONENT:d.DEPTH_STENCIL,a.dataType=q[e],a.samplingMode=h.NEAREST,a.wrapMode=s.CLAMP_TO_EDGE,a.internalFormat=e,a.hasMipmap=!1,a.isImmutable=!0,a}export{N as FBOCache,b as defaultWebGLFBO};
|
|
@@ -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 o}from"../../../../../core/reactiveUtils.js";import{property as s}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{InternalRenderCategory as a}from"../../../webgl.js";import{
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{lerp as t}from"../../../../../core/mathUtils.js";import{watch as r,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{property as s}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{InternalRenderCategory as a}from"../../../webgl.js";import{TransparentEnvironment as m}from"../TransparentEnvironment.js";import{B as n,a as l}from"../../../../../chunks/BloomBlur.glsl.js";import{BloomBlurTechnique as u}from"./BloomBlurTechnique.js";import{BloomBlurTechniqueConfiguration as c}from"./BloomBlurTechniqueConfiguration.js";import{B as h}from"../../../../../chunks/BloomComposition.glsl.js";import{BloomCompositionTechnique as p}from"./BloomCompositionTechnique.js";import{BloomCompositionTechniqueConfiguration as b}from"./BloomCompositionTechniqueConfiguration.js";import{blurRadiusPresets as _,lodFactorsPresets as f,normalizePreset as d}from"./BloomPresets.glsl.js";import{RenderRequestType as g}from"../../lib/basicInterfaces.js";import{ColorAttachment1 as P,DepthStencilAttachment as T,FramebufferBit as R}from"../../../../webgl/enums.js";import{ColorFormat as C}from"../../../../webgl/formats.js";let j=class extends m{constructor(e){super(e),this.consumes={required:[a.TRANSPARENT_ENVIRONMENT,"emissive"]},this._blurHorizontalConfiguration=new c,this._blurVerticalConfiguration=new c,this._compositionConfiguration=new b,this._compositionParameters=new h,this._blurParameters=new n,this._blurScale=3.06,this._bloomResults=new Array}initialize(){this.addHandles([r((()=>this._updateFogParameters()),(()=>{}),o),r((()=>this.view.qualitySettings.bloom),(e=>{e?(this._enable(),this.precompile()):this._disable()}),o)])}destroy(){}_updateFogParameters(){const e=this.view.environment.weather;if("sunny"===e.type||"cloudy"===e.type)this._blurParameters.blurRadius=_[e.type];else{const r="foggy"===e.type?e.fogStrength:e.precipitation;this._blurParameters.blurRadius=t(_.cloudy,_[e.type],r)}this._compositionParameters.lodFactors=f[e.type].far,this._compositionParameters.lodFactorsFront=f[e.type].near,this.requestRender(g.UPDATE)}precompile(){this.techniques.precompile(u,this._blurHorizontalConfiguration),this._blurVerticalConfiguration.bloomStage=l.Vertical,this.techniques.precompile(u,this._blurVerticalConfiguration),this.techniques.precompile(p,this._compositionConfiguration)}render(e){const t=e.find((({name:e})=>e===a.TRANSPARENT_ENVIRONMENT)),r=t.getAttachment(P)?.attachment;if(!r)return t;const o=this.techniques.get(u,this._blurHorizontalConfiguration),s=this.techniques.get(u,this._blurVerticalConfiguration),i=this.techniques.get(p,this._compositionConfiguration);if(!o.compiled||!s.compiled||!i.compiled)return this.requestRender(g.UPDATE),t;const m=t.getTexture(),n=this.fboCache,{fullWidth:l,fullHeight:c}=this.bindParameters.camera,h=this.renderingContext;let b=r,_=l,f=c;const d=5,R=this._blurParameters.blurRadius;for(let a=0;a<d;a++){const e=n.acquire(_,f,"bloomHorizontal",C.RGBA16F);this._blurParameters.color=b,this._prepareFBO(e,_,f),h.bindTechnique(o,this.bindParameters,this._blurParameters),h.screen.draw();const t=n.acquire(_,f,"bloomVertical",C.RGBA16F);this._blurParameters.color=e.getTexture(),this._prepareFBO(t,_,f),h.bindTechnique(s,this.bindParameters,this._blurParameters),h.screen.draw(),e.release(),this._bloomResults[a]=t,_=Math.ceil(_/2),f=Math.ceil(f/2),b=this._bloomResults[a].getTexture(),this._blurParameters.blurRadius*=this._blurScale}this._blurParameters.blurRadius=R,this._compositionParameters.color=m,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 j=this.acquireOutputFramebuffer();return this._prepareFBO(j,l,c),h.bindTechnique(i,this.bindParameters,this._compositionParameters),h.screen.draw(),this._bloomResults.forEach((e=>e.release())),j.attachDepth(t.getAttachment(T)),j.attachColor(t.getAttachment(P),P),j}_prepareFBO(e,t,r){const o=this.renderingContext;o.bindFramebuffer(e.fbo),o.setViewport(0,0,t,r),o.setClearColor(0,0,0,0),o.clear(R.COLOR)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setLodFactors:e=>{this._compositionParameters.lodFactors=d(e)}}}};e([s()],j.prototype,"consumes",void 0),j=e([i("esri.views.3d.webgl-engine.effects.bloom.BloomRenderNode")],j);export{j 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 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
|
|
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 i from"../../../webgl/RenderNode.js";import{If as c,glsl as s}from"../../core/shaderModules/glsl.js";import{Default3D as a}from"../../lib/DefaultVertexAttributeLocations.js";import{FramebufferBit as l,ColorAttachment0 as u,BlendFactor as p,SizedPixelFormat as h,PixelFormat as f,DataType as d}from"../../../../webgl/enums.js";import{ColorFormat as m}from"../../../../webgl/formats.js";import{alphaCutoff as v}from"../../../../../webscene/support/AlphaCutoff.js";let g=class extends i{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(l.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,i){t===x.ON&&(n=e.width,i=e.height);const c=[];for(let l=0;l<Math.min(r,e.colorAttachments.length);++l){const r=e.getColorTexture(u+l);r&&c.push(F(r))}const s=this.renderingContext,{colorTexture:a,depthStencilTexture:f}=e,d=a?.descriptor,v=this._ensureShader(s,null!=f,c),g=this.fboCache.acquire(n,i,"fbo visualizer");let T=!1;a&&(T="float"===c[0]&&!a.descriptor.hasMipmap,T&&e.colorTexture?.generateMipmap()),s.useProgram(v),s.bindFramebuffer(g.fbo);let R=0;const b=[u],C=null!=f;if(s.bindTexture(a,R),v.setUniform1i("colorTex",R),f){R++,s.bindTexture(f,R),v.setUniform1i("depthTex",R);const e=u+R;g.acquireColor(e,m.RGBA8,"depth to color"),b.push(e)}for(let l=1;l<r;++l){R++;const r=u+R,t=C?1:0;s.bindTexture(e.getColorTexture(r-t),R);const o="colorTex"+(R-t);v.setUniform1i(o,R),g.acquireColor(r,m.RGBA8),b.push(r)}s.gl.drawBuffers(b);const B=s.getViewport();s.setViewport(0,0,n,i),s.setClearColor(0,0,0,0),s.clear(l.COLOR),s.setBlendingEnabled(!0),s.setBlendFunction(p.ONE,p.ONE_MINUS_SRC_ALPHA);const A="linear-depth"===o||o.includes("shadow"),y="overlay highlight"===o||"highlights"===o||"highlight mix"===o,I="highlight coverage"===o,_=d?.internalFormat,G=A?3:y?5:I?6:_===h.R16F||_===h.R32F||_===h.R8?1:_===h.RG8?2:_===h.RGBA16F?4:_===h.RG8UI?7:0;return v.setUniform1i("inputType",G),A&&v.setUniform2fv("nearFar",this.camera.nearFar),s.screen.draw(),s.bindFramebuffer(null),s.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(l.COLOR),n.setBlendingEnabled(!0),n.setBlendFunction(p.ONE,p.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,f.RGBA,d.UNSIGNED_BYTE,new Uint8Array(a.data.buffer)),n.bindFramebuffer(null),i?.release(),a}_ensureShader(e,r,t){const o=R({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 }",l=(e,r)=>{let t="";const o=e?1:0;for(let n=1;n<r.length;++n){const e=r[n];t+=`layout(location = ${s.int(o+n)}) out vec4 fragColor${s.int(n)};\n uniform ${T(e)} colorTex${s.int(n)};`}return t},u=e=>{let r="";for(let t=1;t<e.length;++t){const o=e[t],n=`texture(colorTex${s.int(t)}, uv)`,i="float"===o?n:`vec4( vec2(${n}), 0.0, 1.0)`;r+=`fragColor${s.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 ${c(r,"layout(location = 1) out vec4 fragDepth;\n uniform sampler2D depthTex;")}\n ${l(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 < ${s.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(t.length>1,u(t))}\n }\n }`,h=e.programCache.acquire(i,p,a);return this._program.set(o,h),h}};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 h.R8I:case h.R16I:case h.R32I:case h.RG8I:case h.RG16I:case h.RG32I:case h.RGB8I:case h.RGB16I:case h.RGB32I:case h.RGBA8I:case h.RGBA16I:case h.RGBA32I:return"int";case h.R8UI:case h.R16UI:case h.R32UI:case h.RG8UI:case h.RG16UI:case h.RG32UI:case h.RGB8UI:case h.RGB16UI:case h.RGB32UI:case h.RGBA8UI:case h.RGBA16UI:case h.RGBA32UI:return"uint";default:return"float"}}function R(e){const{hasDepthAttachment:r,colorAttachmentTypes:t}=e;return`${r?"Depth":""}${t.reduceRight(((e,r)=>e+`|C${r}`),"")}`}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 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
|
|
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 i from"../../../webgl/RenderNode.js";import{FocusAreaMaskTechnique as n}from"./FocusAreaMaskTechnique.js";import{Default3D as a}from"../../lib/DefaultVertexAttributeLocations.js";import{Pos3 as c}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as h}from"../../lib/VertexArrayObject.js";import{F as p}from"../../../../../chunks/FocusAreaMask.glsl.js";import{BufferObject as u}from"../../../../webgl/BufferObject.js";import{DepthStencilAttachment as l,FramebufferBit as m,Face as d,StencilOperation as f,CompareFunction as g,PrimitiveType as A,Usage as E}from"../../../../webgl/enums.js";import{ColorFormat as b}from"../../../../webgl/formats.js";import{noParameters as w}from"../../../../webgl/NoParameters.js";let _=class extends i{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 p}initialize(){this.updateGeometries()}destroy(){this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0}precompile(){this.techniques.precompile(n)}render(e){const t=this.techniques.get(n),s=this.bindParameters,i=s.camera,a=i.fullViewport[2],c=i.fullViewport[3],h=this.fboCache.acquire(a,c,r.FOCUSAREA,b.RGBA8);if(!t.compiled||!this._vaos)return this.requestRender(),h;const p=e.find((({name:e})=>e===o.TRANSPARENT)),u=this.renderingContext;h.attachDepth(p.getAttachment(l)),u.bindFramebuffer(h.fbo),u.clear(m.COLOR|m.STENCIL),u.setViewport(0,0,a,c),u.clear(m.STENCIL,0);const E=u.bindTechnique(t,s);u.setFaceCullingEnabled(!1),u.setStencilTestEnabled(!0),u.setStencilOpSeparate(d.FRONT,f.KEEP,f.INCR_WRAP,f.KEEP),u.setStencilOpSeparate(d.BACK,f.KEEP,f.DECR_WRAP,f.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,w,this._maskParameters),u.bindVAO(e),u.setDepthTestEnabled(!0),u.setStencilWriteMask(255),u.setStencilFunction(g.ALWAYS,0,255),u.setColorMask(!1,!1,!1,!1),u.drawArrays(A.TRIANGLES,0,t),u.setDepthTestEnabled(!1),u.setStencilWriteMask(0),u.setStencilFunction(g.NOTEQUAL,0,255),u.setColorMask(!0,!0,!0,!0),u.drawArrays(A.TRIANGLES,0,t)}return h}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 h(this.renderingContext,a,new Map([["geometry",c]]),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()],_.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 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 i from"../../../webgl/RenderNode.js";import{Blit as c}from"../blit/Blit.js";import{StencilBits as l}from"../../lib/basicInterfaces.js";import{RenderOccludedFlag as a}from"../../lib/Material.js";import{RenderSlot as d}from"../../lib/RenderSlot.js";import{BlitMode as p}from"../../shaders/CompositingTechniqueConfiguration.js";import{DepthStencilAttachment as u}from"../../../../webgl/enums.js";let
|
|
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 i from"../../../webgl/RenderNode.js";import{Blit as c}from"../blit/Blit.js";import{StencilBits as l}from"../../lib/basicInterfaces.js";import{RenderOccludedFlag as a}from"../../lib/Material.js";import{RenderSlot as d}from"../../lib/RenderSlot.js";import{BlitMode as p}from"../../shaders/CompositingTechniqueConfiguration.js";import{DepthStencilAttachment as u}from"../../../../webgl/enums.js";import{DepthFormat as m}from"../../../../webgl/formats.js";let f=class extends i{constructor(e){super(e),this.consumes={required:[n.OCCLUDED]},this.produces=n.OCCLUDED,this._blit=new c(e.view.stage.renderView.techniques,p.PremultipliedAlpha)}precompile(){const e=this.view.stage.renderer;e.plugins.plugins.forAll((r=>{e.precompileSlots(r,d.OCCLUDED_TERRAIN,d.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(a.OccludeAndTransparentStencil)&&(s|=a.OccludeAndTransparentStencil,h.push(e))})),h.length>0&&(t.renderSlots(h,d.OCCLUDER_MATERIAL),s&a.OccludeAndTransparentStencil&&this._renderAndComposite(r,.5,(()=>t.renderSlots(h,d.TRANSPARENT_OCCLUDER_MATERIAL)),!1,!1)),h.clear(),t.plugins.plugins.forAll((e=>{if(!e.material)return;const r=e.queryRenderOccludedState(a.OccludeAndTransparent),t=e.queryRenderOccludedState(a.Transparent),o=e.queryRenderOccludedState(a.Opaque);(r||t||o)&&(s|=r?a.OccludeAndTransparent:t?a.Transparent:a.Opaque,h.push(e))})),s|=t.plugins.renderOccludedFlags,!s)return r;for(const o of g)s&o&&this._renderAndComposite(r,o===a.Opaque?1:.5,(()=>t.renderOccludedSlots(h,o)),!0,l.OutlineVisualElementMask);return h.clear(),r}_renderAndComposite(e,r,t,s,n){const i=this.renderingContext,{width:c,height:l}=e.fbo,a=this.fboCache.acquire(c,l,"tmp color"),d=s?this.fboCache.acquireDepth(m.DEPTH24_STENCIL8_TEXTURE,c,l,"tmp depth"):e.getAttachment(u);a.attachDepth(d),i.bindFramebuffer(a.fbo),i.clearFramebuffer(o,s,n),t(),a.detachDepth(),this._blit.blend(i,a,e,this.bindParameters,r),s&&d.release(),a.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=[a.OccludeAndTransparent,a.Transparent,a.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{
|
|
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{TransparentEnvironment as l}from"../TransparentEnvironment.js";import{H as f}from"../../../../../chunks/HazeCompositing.glsl.js";import{HazeCompositingTechnique as _}from"./HazeCompositingTechnique.js";import{HazePassParameters as g,HazeTechnique as b}from"./HazeTechnique.js";import{HazeTechniqueConfiguration as w}from"./HazeTechniqueConfiguration.js";import{createQuadVAO as P,Layout as j}from"../../lib/glUtil3D.js";import{applyTextureResizeModulo as v}from"../../lib/textureUtils.js";import{DepthStencilAttachment as A,PrimitiveType as T}from"../../../../webgl/enums.js";import{ColorFormat as C}from"../../../../webgl/formats.js";let x=class extends l{constructor(e){super(e),this._compositingPassParameters=new f,this._passParameters=new g,this._hazeConfiguration=new w,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(b,new w);const s=new w;s.reduced=!0,t.precompile(b,s),t.precompile(_)}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??=P(r,j.Pos2Tex);const i=this.techniques.get(b,this._hazeConfiguration);if(!i.compiled)return s;const o=s.getAttachment(A);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(_);if(!a.compiled)return s;const n=r.getViewport(),m=this.camera,c=h(m.eye)-u.radius;let p;const l=u.atmosphereHeight;if(c<l){const e=Math.min(1,Math.max(0,c/l));p=t(.4,.5,e)}else{const e=Math.min(1,Math.max(0,(c-l)/(15*l)));p=t(.5,1,e)}const f=this.renderingContext.parameters.maxTextureSize,g=v(Math.round(p*m.fullViewport[2]),f),w=v(Math.round(p*m.fullViewport[3]),f);r.setViewport(0,0,g,w);const T=this.fboCache.acquire(g,w,"haze",C.RGBA8);return r.bindFramebuffer(T.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=T.getTexture(),s.detachDepth(),r.bindFramebuffer(s.fbo),r.bindTechnique(a,this.bindParameters,this._compositingPassParameters),r.screen.draw(),s.attachDepth(o),T.release(),s}_renderCommon(e){null!=this._vao&&(e.bindVAO(this._vao),e.drawArrays(T.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 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
|
|
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 a from"../../../webgl/RenderNode.js";import{HighlightApplyTechnique as g}from"./HighlightApplyTechnique.js";import{HighlightBlurTechnique as c}from"./HighlightBlurTechnique.js";import{HighlightDownsampleTechnique as u}from"./HighlightDownsampleTechnique.js";import{HighlightPassParameters as m}from"./HighlightPassParameters.js";import{HighlightToSingleTechnique as p}from"./HighlightToSingleTechnique.js";import{RenderRequestType as d}from"../../lib/basicInterfaces.js";import{Default3D as f}from"../../lib/DefaultVertexAttributeLocations.js";import{NoVertex as b}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as T}from"../../lib/VertexArrayObject.js";import{H as w}from"../../../../../chunks/HighlightBlur.glsl.js";import{H as x,g as C}from"../../../../../chunks/HighlightDownsample.glsl.js";import{BufferObject as v}from"../../../../webgl/BufferObject.js";import{PixelFormat as _,TextureSamplingMode as j,FramebufferBit as H,Usage as P,TextureType as R,PrimitiveType as O,DataType as q}from"../../../../webgl/enums.js";import{ColorFormat as D}from"../../../../webgl/formats.js";import{Texture as I}from"../../../../webgl/Texture.js";import{TextureDescriptor as y}from"../../../../webgl/TextureDescriptor.js";let A=class extends a{constructor(){super(...arguments),this.produces=l.HIGHLIGHTS,this.consumes={required:[l.HIGHLIGHTS,"highlights"]},this._downsampleDrawParameters=new x,this._passParameters=new m,this._highlightBlurDrawParameters=new w,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=_.RGBA,e.samplingMode=j.NEAREST,this._passParameters.highlightOptionsTexture=new I(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(E(this.view.state.highlights)),this.requestRender(d.UPDATE)}precompile(){this.techniques.precompile(u),this.techniques.precompile(p),this.techniques.precompile(c),this.techniques.precompile(g)}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(u);if(!h.compiled)return this.requestRender(d.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(O.TRIANGLES,6,q.UNSIGNED_BYTE,0,t)},{camera:c}=i,m=()=>{o.bindFramebuffer(t.fbo),o.setViewport4fv(c.fullViewport)};return this._renderHighlightPostprocess(n,a,g,m),s.highlightTexture=null,s.coverageTexture=null,t}_renderHighlightPostprocess(e,t,r,i){const{fboCache:s,techniques:o,bindParameters:h,_passParameters:l,renderingContext:a}=this,u=o.get(p),m=o.get(c),f=o.get(g);if(!f.compiled||!m.compiled||!u.compiled)return void this.requestRender(d.UPDATE);l.highlightTexture=e;const b=t(),{width:T,height:w}=e.descriptor;l.highlightTexture=e;const{camera:x}=h,{fullWidth:C,fullHeight:v,pixelRatio:_}=x,j=Math.ceil(C/_),P=Math.ceil(v/_),{_highlightBlurDrawParameters:R}=this,O=this.view.stage.renderView.renderer,{highlights:q}=h;for(let g=0;g<q.length;++g){const{name:e}=q[g];if(!O.hasHighlight(e))continue;l.highlightLevel=g,a.setClearColor(0,0,0,0);const t=s.acquire(T,w,"single highlight",D.RG8);a.bindFramebuffer(t.fbo),a.setViewport(0,0,T,w),a.clear(H.COLOR),a.bindTechnique(u,h,l),r(b),R.blurInput=t.getTexture(),n(R.blurSize,1/j,0);const o=s.acquire(j,P,"single highlight blur h",D.RG8);a.unbindTexture(o.fbo?.colorTexture),a.bindFramebuffer(o.fbo),a.setViewport(0,0,j,P),a.clear(H.COLOR),a.bindTechnique(m,h,l,R),r(b),t.release(),n(R.blurSize,0,1/P),l.highlightBlurTexture=o.getTexture(),i(),a.bindTechnique(f,h,l,R),r(b),o.release()}}_gridUpdateResources(e){const t=this._grid,{width:r,height:i}=e.descriptor;if(t.horizontalCellCount=Math.ceil(r/C),t.verticalCellCount=Math.ceil(i/C),t.vao)return;const s=this.renderingContext,o=v.createIndex(s,P.STATIC_DRAW,L);t.vao=new T(s,f,new Map([["geometry",b]]),new Map([["geometry",v.createVertex(s,P.STATIC_DRAW)]]),o)}_gridComputeCoverage(e,t,r){const i=this.renderingContext,s=this._grid,o=t.descriptor,h=Math.ceil(o.width/C),n=Math.ceil(o.height/C);this._downsampleDrawParameters.input=t;const{highlights:l}=r;s.coverage?.release();const a=this.fboCache.acquire(h,n,"highlight coverage",l.length>B?D.RG8UI:D.R8UI);return s.coverage=a,i.bindFramebuffer(a.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?D.RG8UI:D.R8UI):null,{gl:a}=e;if(l){const t=e.getBoundFramebufferObject();e.bindFramebuffer(l.fbo),a.clearBufferuiv(a.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}const g=l?.getTexture();i.highlightMixTexture=g,n(i.highlightMixOrigin,o,0),h.forEach(((t,h)=>{if(h>0){const t=I.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(g,t),e.setActiveTexture(t),a.copyTexSubImage2D(R.TEXTURE_2D,0,0,0,o,0,r.width,r.height),e.bindTexture(null,t)}e.clear(H.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};
|
|
@@ -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{disposeMaybe as r}from"../../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{watch as s,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{property as a}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{requestImage as n}from"../../../../../support/requestImageUtils.js";import{InternalRenderCategory as c,RenderCategory as h}from"../../../webgl.js";import
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{watch as s,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{property as a}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{requestImage as n}from"../../../../../support/requestImageUtils.js";import{InternalRenderCategory as c,RenderCategory as h}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{SMAABlendWeightsTechnique as l}from"./SMAABlendWeightsTechnique.js";import{SMAABlurTechnique as u}from"./SMAABlurTechnique.js";import{SMAAEdgeDetectTechnique as p}from"./SMAAEdgeDetectTechnique.js";import{SMAAPassParameters as d}from"./SMAAPassParameters.js";import{RenderRequestType as f}from"../../lib/basicInterfaces.js";import{PixelFormat as b,TextureSamplingMode as T,FramebufferBit as x,TextureWrapMode as _}from"../../../../webgl/enums.js";import{ColorFormat as g}from"../../../../webgl/formats.js";import{Texture as A}from"../../../../webgl/Texture.js";import{TextureDescriptor as C}from"../../../../webgl/TextureDescriptor.js";let w=class extends m{constructor(e){super(e),this.produces="disabled",this.consumes={required:[c.ANTIALIASING],optional:[h.COMPOSITE]},this._areaTexture=null,this._searchTexture=null,this._smaaParameters=new d}initialize(){this.addHandles([s((()=>this.isEnabled()),(e=>e?this.enable():this.disable()),i)])}async enable(){if(this.produces=c.ANTIALIASING,this._abortController||this._areaTexture&&this._searchTexture)return;this._abortController=new AbortController;const e=this._abortController.signal;try{const r=await import("./SMAAData.js");await this._loadTextures(r,e),this.requestRender(f.UPDATE)}catch{}this._abortController=null}async _loadTextures(e,r){t(r);const[s,i]=await Promise.allSettled([n(e.areaTexture,{signal:r}),n(e.searchTexure,{signal:r})]);if(t(r),"fulfilled"!==s.status||"fulfilled"!==i.status)return;const a=this.renderingContext;this._areaTexture=j(a,T.LINEAR,b.RGB,s.value),this._searchTexture=j(a,T.NEAREST,b.LUMINANCE,i.value)}disable(){this.produces="disabled"}destroy(){this._searchTexture=r(this._searchTexture),this._areaTexture=r(this._areaTexture)}precompile(){this.techniques.precompile(p),this.techniques.precompile(l),this.techniques.precompile(u)}render(e){const r=e.find((({name:e})=>e===c.ANTIALIASING));if(!this._areaTexture||!this._searchTexture)return this.requestRender(f.UPDATE),r;const t=this.techniques.get(p),s=this.techniques.get(l),i=this.techniques.get(u);if(!t.compiled||!s.compiled||!i.compiled)return this.requestRender(f.UPDATE),r;const a=e.find((({name:e})=>e===h.COMPOSITE));if(!a)return r;const o=a.fbo.width,n=a.fbo.height,m=this.renderingContext;m.setViewport(0,0,o,n);const d=this.fboCache.acquire(o,n,"smaa edges",g.RG8);m.bindFramebuffer(d.fbo),m.setClearColor(0,0,0,1),m.clear(x.COLOR),this._smaaParameters.color=a.getTexture();const b=this.bindParameters;m.bindTechnique(t,b,this._smaaParameters),m.screen.draw();const T=this.fboCache.acquire(o,n,"smaa blend");return m.bindFramebuffer(T.fbo),m.setClearColor(0,0,1,1),m.clear(x.COLOR),this._smaaParameters.inputTexture=d.getTexture(),this._smaaParameters.areaTexture=this._areaTexture,this._smaaParameters.searchTexture=this._searchTexture,m.bindTechnique(s,b,this._smaaParameters),m.screen.draw(),d.release(),m.bindFramebuffer(r.fbo),m.setClearColor(0,1,0,1),m.clear(x.COLOR),this._smaaParameters.inputTexture=T.getTexture(),m.bindTechnique(i,b,this._smaaParameters),m.screen.draw(),T.release(),r}};function j(e,r,t,s){const i=new C;return i.pixelFormat=t,i.wrapMode=_.CLAMP_TO_EDGE,i.width=s.width,i.height=s.height,i.samplingMode=r,new A(e,i,s)}e([a()],w.prototype,"produces",void 0),e([a()],w.prototype,"consumes",void 0),e([a({constructOnly:!0})],w.prototype,"isEnabled",void 0),e([a()],w.prototype,"_abortController",void 0),w=e([o("esri.views.3d.webgl-engine.effects.smaa.SMAA")],w);export{w as SMAA};
|
|
@@ -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{clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{watch as t}from"../../../../../core/reactiveUtils.js";import{Milliseconds as i}from"../../../../../core/time.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 a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as n}from"../../../webgl.js";import
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{watch as t}from"../../../../../core/reactiveUtils.js";import{Milliseconds as i}from"../../../../../core/time.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 a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as n}from"../../../webgl.js";import p from"../../../webgl/RenderNode.js";import{distanceFadeEnd as c,distanceFadeStart as h}from"../../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{SSAOBlurTechnique as u}from"./SSAOBlurTechnique.js";import{noiseData as l}from"./SSAONoiseData.js";import{SSAOPassParameters as d,BlurDrawParameters as f}from"./SSAOParameters.js";import{SSAOTechnique as b}from"./SSAOTechnique.js";import{RenderRequestType as w}from"../../lib/basicInterfaces.js";import{g as T}from"../../../../../chunks/SSAO.glsl.js";import{TextureWrapMode as S,PixelFormat as _,DepthStencilAttachment as P,FramebufferBit as j}from"../../../../webgl/enums.js";import{ColorFormat as g}from"../../../../webgl/formats.js";import{Texture as x}from"../../../../webgl/Texture.js";import{TextureDescriptor as q}from"../../../../webgl/TextureDescriptor.js";const A=2;let O=class extends p{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=n.SSAO,this.isEnabled=()=>!1,this._enableTime=i(0),this._passParameters=new d,this._drawParameters=new f}initialize(){const e=Uint8Array.from(atob(l),(e=>e.charCodeAt(0))),r=new q;r.wrapMode=S.CLAMP_TO_EDGE,r.pixelFormat=_.RGB,r.wrapMode=S.REPEAT,r.hasMipmap=!0,r.width=32,r.height=32,this._passParameters.noiseTexture=new x(this.renderingContext,r,e),this.techniques.precompile(b),this.techniques.precompile(u),this.addHandles(t((()=>this.isEnabled()),(()=>this._enableTime=i(0))))}destroy(){this._passParameters.noiseTexture=s(this._passParameters.noiseTexture)}render(e){const s=this.bindParameters,t=e.find((({name:e})=>"normals"===e)),o=t?.getTexture(),a=t?.getTexture(P),p=this.fboCache,l=s.camera,d=l.fullViewport[2],f=l.fullViewport[3],S=Math.round(d/A),_=Math.round(f/A),x=this.techniques.get(b),q=this.techniques.get(u);if(!x.compiled||!q.compiled)return this._enableTime=i(performance.now()),this.requestRender(w.UPDATE),p.acquire(S,_,n.SSAO,g.R8);0===this._enableTime&&(this._enableTime=i(performance.now()));const O=this.renderingContext,R=this.view.qualitySettings.fadeDuration,v=l.relativeElevation,C=r((c-v)/(c-h),0,1),E=R>0?Math.min(R,performance.now()-this._enableTime)/R:1,V=E*C;this._passParameters.normalTexture=o,this._passParameters.depthTexture=a,this._passParameters.projScale=1/l.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*y/T(l)**6*V;const D=p.acquire(d,f,"ssao input",g.RG8);O.bindFramebuffer(D.fbo),O.setViewport(0,0,d,f),O.bindTechnique(x,s,this._passParameters,this._drawParameters),O.screen.draw();const M=p.acquire(S,_,"ssao blur",g.R8);O.bindFramebuffer(M.fbo),this._drawParameters.colorTexture=D.getTexture(),m(this._drawParameters.blurSize,0,A/f),O.bindTechnique(q,s,this._passParameters,this._drawParameters),O.setViewport(0,0,S,_),O.screen.draw(),D.release();const L=p.acquire(S,_,n.SSAO,g.R8);return O.bindFramebuffer(L.fbo),O.setViewport(0,0,d,f),O.setClearColor(1,1,1,0),O.clear(j.COLOR),this._drawParameters.colorTexture=M.getTexture(),m(this._drawParameters.blurSize,A/d,0),O.bindTechnique(q,s,this._passParameters,this._drawParameters),O.setViewport(0,0,S,_),O.screen.draw(),O.setViewport4fv(l.fullViewport),M.release(),E<1&&this.requestRender(w.UPDATE),L}};e([o()],O.prototype,"consumes",void 0),e([o()],O.prototype,"produces",void 0),e([o({constructOnly:!0})],O.prototype,"isEnabled",void 0),O=e([a("esri.views.3d.webgl-engine.effects.ssao.SSAO")],O);const y=.5;export{O as SSAO,A as blurSizePixels};
|
|
@@ -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{releaseMaybe as e}from"../../../../core/maybe.js";import{c as t}from"../../../../chunks/vec42.js";import{ZEROS as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{
|
|
5
|
+
import{releaseMaybe as e}from"../../../../core/maybe.js";import{c as t}from"../../../../chunks/vec42.js";import{ZEROS as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ViewportSize as r}from"./BindParameters.js";import{FramebufferBit as o,ColorAttachment1 as h}from"../../../webgl/enums.js";import{ColorFormat as c,DepthFormat as l}from"../../../webgl/formats.js";import{ensureAttachmentMaxSize as _}from"../../../webgl/FramebufferObject.js";class a{constructor(e){this._fbos=e,this._requiresEmission=!1,this._size=new r(0,0),this._clearColor=s()}dispose(){this._color=e(this._color),this.releaseDepth()}initialize(e,i,s,r){this._size.width=e,this._size.height=i,_(this._size,this._fbos.rctx.parameters.maxTextureSize);const o=this._color;return this._color=null,this.releaseDepth(),this._requiresEmission=r,t(this._clearColor,s),o}releaseDepth(){this._color?.detachDepth(),this._depth=e(this._depth)}update(e){const t=this._ensureColor();t.attachDepth(this.depth),this._color=e(t)}bind(){const{rctx:e}=this._fbos,t=null==this._color;this.color.attachDepth(this.depth),e.bindFramebuffer(this.color.fbo),t&&(e.setClearStencil(0),e.setClearColor(this._clearColor[0],this._clearColor[1],this._clearColor[2],this._clearColor[3]),e.clear(o.COLOR|o.DEPTH|o.STENCIL),this._requiresEmission&&e.clearBuffer(1,i))}_acquireColor(){return this._requiresEmission?this._fbos.acquire(this._size.width,this._size.height,"acquired-color").acquireColor(h,c.RGBA16F,"emissive"):this._fbos.acquire(this._size.width,this._size.height,"acquired-color")}_acquireDepth(){return this._fbos.acquireDepth(l.DEPTH24_STENCIL8_TEXTURE,this._size.width,this._size.height,"depth")}get size(){return this._size}get color(){return this._ensureColor()}get depth(){return this._depth??=this._acquireDepth(),this._depth}_ensureColor(){return this._color??=this._acquireColor(),this._color}}export{a as MainFramebuffer};
|