@arcgis/core 6.0.0-next.36 → 6.0.0-next.37
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{0202eb8c2b2865f99981.js → 00311d1b18d5952a014b.js} +1 -1
- package/assets/esri/core/workers/chunks/0b21d0e2e5a91c34a108.js +1 -0
- package/assets/esri/core/workers/chunks/{f717005e14a7e9141df7.js → 2050c844b5a29b1df28a.js} +1 -1
- package/assets/esri/core/workers/chunks/2c3612379111457c3221.js +1 -0
- package/assets/esri/core/workers/chunks/2f9072563194026e320e.js +1 -0
- package/assets/esri/core/workers/chunks/{d9a240a3c6bf85124474.js → 342a97974a78007b25e0.js} +1 -1
- package/assets/esri/core/workers/chunks/34467f7d84baffd772a3.js +1 -0
- package/assets/esri/core/workers/chunks/{4d18b48d4a282a0f341c.js → 427d929dc7f89b0a1ea9.js} +1 -1
- package/assets/esri/core/workers/chunks/432728c557be5dfa26b5.js +1 -0
- package/assets/esri/core/workers/chunks/46969f379623810b2eca.js +1 -0
- package/assets/esri/core/workers/chunks/592b5db1459c02cf6a0c.js +1 -0
- package/assets/esri/core/workers/chunks/6a21dc13a465757ba007.js +1 -0
- package/assets/esri/core/workers/chunks/{379db67f78161ebd5468.js → 7023651ed6398dcf8efb.js} +1 -1
- package/assets/esri/core/workers/chunks/{90360c0bd053d3e3fd77.js → 7027a0e7bfabb3bb7fc2.js} +1 -1
- package/assets/esri/core/workers/chunks/78818c2a898444f7e890.js +1 -0
- package/assets/esri/core/workers/chunks/{40c2674dae73f0942751.js → 7d497df6e13162156342.js} +1 -1
- package/assets/esri/core/workers/chunks/8a3dfe997712dc2ddead.js +1 -0
- package/assets/esri/core/workers/chunks/{81bcc495e6eaf2cf7474.js → 8f82a0a6747f673a2a7e.js} +1 -1
- package/assets/esri/core/workers/chunks/9826baa3c15ea2062669.js +1 -0
- package/assets/esri/core/workers/chunks/{d3369ffed19f4c264dcd.js → 9ab0735e86cf8932bf9d.js} +1 -1
- package/assets/esri/core/workers/chunks/ab0ea4042f4e13874aed.js +1 -0
- package/assets/esri/core/workers/chunks/ab98ade3257360015d6c.js +1 -0
- package/assets/esri/core/workers/chunks/{796c6195b6bf59dcc9bd.js → b25a05c58b0fd0f6ac60.js} +1 -1
- package/assets/esri/core/workers/chunks/b90271ce38522bcf813b.js +1 -0
- package/assets/esri/core/workers/chunks/ba91df9835cdea7698a9.js +1 -0
- package/assets/esri/core/workers/chunks/bfe13ac9fa1aafb190a1.js +1 -0
- package/assets/esri/core/workers/chunks/ce0274847ccce6a1ac53.js +1 -0
- package/assets/esri/core/workers/chunks/cf2e5f827cea7d7319ce.js +1 -0
- package/assets/esri/core/workers/chunks/dae2036faa28dade2119.js +1 -0
- package/assets/esri/core/workers/chunks/{e8fb2ba7b7a4f0916325.js → eed4b90494a54f8b337b.js} +1 -1
- package/assets/esri/core/workers/chunks/fc77eb7683e708774168.js +1 -0
- package/chunks/Clouds.glsl.js +7 -11
- package/config.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/kernel.js +1 -1
- package/layers/BaseElevationLayer.js +1 -1
- package/layers/ElevationLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/IntegratedMeshLayer.d.ts +2 -0
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/video/VideoController.js +3 -3
- package/layers/video/types.d.ts +12 -0
- package/package.json +3 -3
- package/views/2d/engine/Bitmap.js +1 -1
- package/views/2d/engine/flow/styles/Imagery.js +1 -1
- package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
- package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
- package/views/2d/engine/webgl/Overlay.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
- package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
- package/views/2d/engine/webgl/animations/store/AnimationStore.js +1 -1
- package/views/2d/engine/webgl/collisions/LabelStore.js +1 -1
- package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTexture.js +1 -1
- package/views/2d/engine/webgl/textureUtils.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/webglDeps.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/engineContent/marker.js +1 -1
- package/views/3d/support/flow/StreamlineResources3D.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianTileBuilder.js +2 -0
- package/views/3d/support/gaussianSplatting/formatConstants.js +2 -0
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl/RenderNode.d.ts +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +15 -11
- package/views/3d/webgl-engine/effects/atmosphere/LocalAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/Magnifier.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/effects/stars/Stars.js +1 -1
- package/views/3d/webgl-engine/lib/AttributeView.js +1 -1
- package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/DDSUtil.js +1 -1
- package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderUtils.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +1 -1
- package/views/3d/webgl-engine/lib/VerticesView.js +2 -0
- package/views/3d/webgl-engine/lib/attributeViewUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
- package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
- package/views/3d/webgl-engine/materials/internal/lineMarkerBufferUtils.js +2 -0
- package/views/3d/webgl-engine/materials/internal/ribbonLineBufferUtils.js +2 -0
- package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
- package/views/draw/support/ManagedTooltipField.js +1 -1
- package/views/support/TextureCompressionHelper.js +1 -1
- package/views/support/imageReprojection.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/rasterUtils.js +1 -1
- package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
- package/views/webgl/textureUtils.js +1 -1
- package/widgets/ScaleRangeSlider/types.d.ts +3 -3
- package/assets/esri/core/workers/chunks/039d9bc5b5015012f811.js +0 -1
- package/assets/esri/core/workers/chunks/08140725277de5d2e41a.js +0 -1
- package/assets/esri/core/workers/chunks/16cda273927ab0a39544.js +0 -1
- package/assets/esri/core/workers/chunks/29c610ce1c81ebb84a6b.js +0 -1
- package/assets/esri/core/workers/chunks/3223f9fbc76ba9ef8d13.js +0 -1
- package/assets/esri/core/workers/chunks/3fdcc383bbd9cf0d274c.js +0 -1
- package/assets/esri/core/workers/chunks/46c290108a90518ef695.js +0 -1
- package/assets/esri/core/workers/chunks/48b8b57f559a53c6c513.js +0 -1
- package/assets/esri/core/workers/chunks/4a979fce1c971b614a18.js +0 -1
- package/assets/esri/core/workers/chunks/5bd1414220e42cb8ebcf.js +0 -1
- package/assets/esri/core/workers/chunks/5d781c2c6204cffffd0d.js +0 -1
- package/assets/esri/core/workers/chunks/723df53cfa0189837d01.js +0 -1
- package/assets/esri/core/workers/chunks/7400b8c454b47ee4fb3c.js +0 -1
- package/assets/esri/core/workers/chunks/7af4edc6e87d27b9d467.js +0 -1
- package/assets/esri/core/workers/chunks/990e96139b5a1dccb061.js +0 -1
- package/assets/esri/core/workers/chunks/a607541959169741a943.js +0 -1
- package/assets/esri/core/workers/chunks/aa779896fd9e5c341349.js +0 -1
- package/assets/esri/core/workers/chunks/c131e0dd180a4c10e12e.js +0 -1
- package/assets/esri/core/workers/chunks/f3b4159c0722df8ffe13.js +0 -1
- package/assets/esri/core/workers/chunks/f75eec2cbc541eec9712.js +0 -1
|
@@ -202,7 +202,7 @@ export interface RenderNodeProperties extends Partial<Pick<RenderNode, "produces
|
|
|
202
202
|
* @see [Sample - Custom Render Node - Windmills](https://developers.arcgis.com/javascript/latest/sample-code/custom-render-node-windmills/)
|
|
203
203
|
*/
|
|
204
204
|
export default abstract class RenderNode extends Accessor {
|
|
205
|
-
constructor(properties
|
|
205
|
+
constructor(properties: RenderNodeProperties);
|
|
206
206
|
/** Get the render representation of the current camera of a view. */
|
|
207
207
|
get camera(): RenderCamera;
|
|
208
208
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as t}from"../../webgl/ManagedDepthTexture.js";import n from"../../webgl/ManagedFBO.js";import{isDepthFormat as r,formatString as i,DepthTextureFormats as a,ColorFormats as o}from"./FBOCacheFormats.js";import{FBOCacheUsage as s}from"./FBOCacheUsage.js";import{FBOPool as c}from"./FBOPool.js";import{DepthStencilAttachment as l,ColorAttachment0 as u}from"../../../webgl/enums.js";import{DisposableFramebufferObject as d}from"../../../webgl/FramebufferObject.js";import f
|
|
2
|
+
import e from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as t}from"../../webgl/ManagedDepthTexture.js";import n from"../../webgl/ManagedFBO.js";import{isDepthFormat as r,formatString as i,DepthTextureFormats as a,ColorFormats as o}from"./FBOCacheFormats.js";import{FBOCacheUsage as s}from"./FBOCacheUsage.js";import{FBOPool as c}from"./FBOPool.js";import{DepthStencilAttachment as l,ColorAttachment0 as u}from"../../../webgl/enums.js";import{DisposableFramebufferObject as d}from"../../../webgl/FramebufferObject.js";import{Texture as f}from"../../../webgl/Texture.js";class p{constructor(e){this.rctx=e,this._interactive=!1,this._usage=new s,this._acquired=new Set,this._cache=new c(e.newCache,`FBOCache`),this._colorCache=new c(e.newCache,`ColorAttachmentCache`),this._depthCache=new c(e.newCache,`DepthAttachmentCache`)}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?.(),this._usage.clear()}frameEnd(){this.debugCallback&&(this._usage.summarize(),this._acquired.forEach(e=>this.debugCallback?.(e.name,e.fbo)))}get usedMemory(){return this._acquired.values().reduce((e,t)=>e+t.usedMemory,this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e,this._interactive=e}get interactive(){return this._interactive}acquire(e,t,a,o=5){let s=g(o,e,t),c=this._cache.pop(s),{rctx:f}=this;if(c){c.retain(),c.setName(a);let e=c.getAttachment(l);e&&(e.name=h);let t=c.getAttachment(u);t&&(t.name=m(0)),f.unbindTexture(c.fbo.colorTexture)}else{let i=new d(f);c=new n(s,a,i,(n,r,i)=>{r??=5,i??=m(n-u);let a=this._acquireColor(r,e,t,i);return this.rctx.unbindTexture(a.attachment),c.attachColor(a,n),a.release(),c},n=>{n??=14;let r=this.acquireDepth(n,e,t,`${c.name} ${h}`);return c.attachDepth(r),r.release(),c},()=>{if(!c)return;this.debugCallback?.(c.name,c.fbo),this._acquired.delete(c);let e=r(o);e&&c.getAttachment(l)!=null||!e&&c.getAttachment(u)!=null?(e?(c.fbo?.invalidateAttachments([l]),c.detachAllColors()):(c.fbo?.invalidateAttachments([u]),c.detachAllButColor0()),this._trackRelease(c),this._cache.put(c)):c.dispose()}),r(o)?c.acquireDepth(o):c.acquireColor(u,o)}return this._trackAcquire(c,`f `+i(o),e,t),this._trackHandle(c)}acquireDepth(e,n,r,o){let s=g(e,n,r),c=this._depthCache.pop(s);if(c)c.retain(),c.attachment.setShadowFiltering(!1);else{let i=new f(this.rctx,{...a[e],width:n,height:r});c=new t(s,i,()=>{this._trackRelease(c),this._depthCache.put(c)})}return c.name=o,this._trackAcquire(c,`d `+i(e),n,r),c}_acquireColor(t,n,r,a){let s=g(t,n,r),c=this._colorCache.pop(s);if(c)c.retain();else{let i=new f(this.rctx,{...o[t],width:n,height:r,isImmutable:!0});c=new e(s,i,()=>{this._trackRelease(c),this._colorCache.put(c)})}return c.name=a,this._trackAcquire(c,`c `+i(t),n,r),c}_trackHandle(e){return this._acquired.add(e),e}_trackAcquire(e,t,n,r){this.debugCallback&&this._usage.add(e,t,n,r)}_trackRelease(e){this.debugCallback&&this._usage.remove(e)}}function m(e=0){return`color${e}`}const h=`depth`;function g(e,t,n){return`${t}x${n}:${e}`}export{p as FBOCache};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as r,transpose as i,invert as a}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as s,copy as c}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MaterialPassParameters as u,ShadowMapPassParameters as d,HighlightPassParameters as f,ViewshedShadowMapPassParameters as p,AllRenderPasses as m}from"./AllRenderPasses.js";import{TwoVectorPosition as h}from"../util/TwoVectorPosition.js";import{SyncRenderPlugin as g}from"../../effects/RenderPlugin.js";import{getEmissions as _}from"../../effects/emissive/emissions.js";import{DepthRange as v}from"../../lib/DepthRange.js";import{SizedPixelFormat as y,DataType as b}from"../../../../webgl/enums.js";import x
|
|
2
|
+
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as r,transpose as i,invert as a}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as s,copy as c}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MaterialPassParameters as u,ShadowMapPassParameters as d,HighlightPassParameters as f,ViewshedShadowMapPassParameters as p,AllRenderPasses as m}from"./AllRenderPasses.js";import{TwoVectorPosition as h}from"../util/TwoVectorPosition.js";import{SyncRenderPlugin as g}from"../../effects/RenderPlugin.js";import{getEmissions as _}from"../../effects/emissive/emissions.js";import{DepthRange as v}from"../../lib/DepthRange.js";import{SizedPixelFormat as y,DataType as b}from"../../../../webgl/enums.js";import{Texture as x}from"../../../../webgl/Texture.js";import{TextureDescriptor as S}from"../../../../webgl/TextureDescriptor.js";let C=class extends g{constructor(){super(...arguments),this.produces=new Map([[2,e=>this._produces(e,2)],[4,e=>this._produces(e,4)],[0,e=>this._produces(e,0)],[6,e=>this._produces(e,6)],[9,e=>this._produces(e,9)]]),this._drawParametersArray=[],this._drawParametersSet=new Set,this._materialPassParameters=new u,this._shadowPassParameters=new d,this._highlightPassParameters=new f,this._viewshedPassParameters=new p,this._systems=[]}initializeRenderContext(e){this._context=e,this._passes=new m(e,this)}get rctx(){return this._context.renderContext.rctx}get bind(){return this._context.renderContext.bind}uninitializeRenderContext(){}dispose(){this._context=null,this._systems.length=0,this._transformationTexture=t(this._transformationTexture),Object.values(this._passes).forEach(e=>e.destroy())}register(e){this._systems.push(e)}_produces(e,t){return!!this._invoke(e,t,e=>e.count>0)}prepareRender(e){let{_systems:n,_passes:r}=this;n.length!==0&&(this._drawParametersSet.clear(),this._drawParametersArray.length=0,this._transformationTexture=t(this._transformationTexture),Object.values(this._passes).forEach(e=>e.prepareSubmit()),n.forEach(t=>t.submit(r,e.bind)),this._updateTransformationTexture(),Object.values(this._passes).forEach(e=>e.finishSubmit()),this._context.techniques.frameUpdate())}acquireTechniques(e){if(this._systems.length===0)return null;let{output:t,bind:n}=e;return this._invoke(t,n.slot,(t,r)=>(this._updateParameters(n.camera,r,n.slot),r.transformationTexture=this._transformationTexture,t.acquire(r,e.bind)))}render(e,t){this._invoke(e.output,e.bind.slot,(n,r)=>n.dispatch(r,e.bind,t))}_invoke(e,t,n){switch(t){case 2:switch(e){case 0:case 1:case 2:case 3:case 4:case 11:return n(this._passes.opaque,this._materialPassParameters);case 10:return n(this._passes.highlight,this._highlightPassParameters);case 5:return n(this._passes.shadowMap,this._shadowPassParameters);case 6:return n(this._passes.highlightShadowMap,this._shadowPassParameters);case 7:return n(this._passes.defaultShadowMap,this._shadowPassParameters);case 8:return n(this._passes.viewshedShadowMap,this._viewshedPassParameters)}break;case 4:switch(e){case 0:case 1:case 2:case 3:case 4:case 11:return n(this._passes.transparent,this._materialPassParameters)}break;case 0:switch(e){case 0:case 1:case 2:case 3:case 4:case 11:case 9:return n(this._passes.integratedMesh,this._materialPassParameters);case 10:return n(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}break;case 6:switch(e){case 0:case 1:case 2:return n(this._passes.transparentIntegratedMesh,this._materialPassParameters)}break;case 9:switch(e){case 0:case 1:case 2:case 3:case 4:case 11:return n(this._passes.occludedGround,this._materialPassParameters)}}return null}requestRender(){this._context.requestRender()}queryDepthRange(e){return this._systems.reduce((t,n)=>t.union(n.queryDepthRange(e)),new v)}get emissions(){return _(this._systems)}_updateParameters(e,t,n){let o=e.viewInverseTransposeMatrix,l=n===4,u=n===9;s(w,o[3],o[7],o[11]),E.set(w),c(t.transformWorldFromViewTH,E.high),c(t.transformWorldFromViewTL,E.low),c(t.slicePlaneLocalOrigin,w),r(t.transformViewFromCameraRelativeRS,e.viewMatrix),t.identifier===0&&(this._materialPassParameters.transparent=l,this._materialPassParameters.occludedGround=u,i(T,t.transformViewFromCameraRelativeRS),a(t.transformNormalViewFromGlobal,T))}hasHighlight(e){return this._systems.some(t=>t.hasHighlight(e))}registerDrawParameters(e){if(!this._drawParametersSet.has(e)){this._drawParametersSet.add(e);let t=this._drawParametersArray.length;this._drawParametersArray.push(e),e.setTransformationDrawId(t)}}_updateTransformationTexture(){let e=this._drawParametersArray.length;if(e===0)return;let t=2**Math.ceil(Math.log2(e)),n=new Float32Array(t*15);for(let t=0;t<e;t++){let e=this._drawParametersArray[t];e.setTransformationDrawId(t);let r=t*15;n.set(e.transformationFloats,r)}if(this._transformationTexture&&this._transformationTexture.descriptor.height>=e)this._transformationTexture.updateData(0,0,0,5,e,n);else{this._transformationTexture?.dispose();let e=new S(5,t);e.internalFormat=y.RGB32F,e.dataType=b.FLOAT,e.hasMipmap=!1,e.isImmutable=!0,e.pixelFormat=6407,e.samplingMode=9728,this._transformationTexture=new x(this.rctx,e,n)}}};C=e([n(`esri.views.3d.webgl-engine.core.renderPasses.RenderPassManager`)],C);const w=l(),T=o(),E=new h;export{C as RenderPassManager};
|
|
@@ -23,7 +23,7 @@ posView /= factor;
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
return groundRelative;
|
|
26
|
-
}`),(!p.draped||p.hasVerticalOffset)&&m.uniforms.add(n),p.draped||(m.uniforms.add(new c(`hudPixelSizePerDistance`,e=>Math.tan(e.camera.fovY/2)/(e.camera.fullViewport[
|
|
26
|
+
}`),(!p.draped||p.hasVerticalOffset)&&m.uniforms.add(n),p.draped||(m.uniforms.add(new c(`hudPixelSizePerDistance`,e=>Math.tan(e.camera.fovY/2)/(e.camera.fullViewport[3]/2))),m.code.add(u`
|
|
27
27
|
void applyHUDVerticalGroundOffset(vec3 normalModel, inout vec3 posModel, inout vec3 posView) {
|
|
28
28
|
float distanceToCamera = length(posView);
|
|
29
29
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{
|
|
2
|
+
import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{gaussianSplatGridCellSize as t}from"../../../../support/gaussianSplatting/formatConstants.js";import{Float3PassUniform as n}from"../../shaderModules/Float3PassUniform.js";import{glsl as r}from"../../shaderModules/glsl.js";import{NoParameters as i}from"../../../../../webgl/NoParameters.js";class a extends i{constructor(){super(...arguments),this.tileCameraPosition=e(),this.cameraDelta=e()}}function o(e){e.code.add(r`float unpackOpacity(uvec4 packedGaussian) {
|
|
3
3
|
return float((packedGaussian.w >> 24u) & 0xffu) / 255.0;
|
|
4
4
|
}
|
|
5
5
|
vec4 unpackColor(uvec4 packedGaussian) {
|
|
@@ -9,14 +9,14 @@ color.g = float((packedGaussian.w >> 9u) & 0xffu);
|
|
|
9
9
|
color.b = float((packedGaussian.w >> 16u) & 0xfeu);
|
|
10
10
|
color.a = float((packedGaussian.w >> 24u) & 0xffu);
|
|
11
11
|
return color / 255.0;
|
|
12
|
-
}`),e.code.add(
|
|
12
|
+
}`),e.code.add(r`vec3 unpackScale(uvec4 packedGaussian) {
|
|
13
13
|
uint sx = (packedGaussian.z >> 10u) & 0xffu;
|
|
14
14
|
uint sy = (packedGaussian.z >> 18u) & 0xffu;
|
|
15
15
|
uint szLow = (packedGaussian.z >> 26u) & 0x3fu;
|
|
16
16
|
uint szHigh = packedGaussian.a & 0x3u;
|
|
17
17
|
uint sz = szLow | (szHigh << 6u);
|
|
18
18
|
return exp(vec3(sx, sy, sz) / 16.0 - 10.0);
|
|
19
|
-
}`),e.code.add(
|
|
19
|
+
}`),e.code.add(r`const uint MASK_9_BITS = 0x1FFu;
|
|
20
20
|
const float SQRT_HALF = 0.7071067811865476;
|
|
21
21
|
vec4 unpackQuaternion(uvec4 packedGaussian) {
|
|
22
22
|
uint packedRotation = packedGaussian.x;
|
|
@@ -28,7 +28,7 @@ vec4 quaternion = vec4(components, sqrt(1.0 - dot(components, components)));
|
|
|
28
28
|
return largestComponent == 0u ? quaternion.wzyx :
|
|
29
29
|
largestComponent == 1u ? quaternion.zwyx :
|
|
30
30
|
largestComponent == 2u ? quaternion.zywx : quaternion.zyxw;
|
|
31
|
-
}`),e.code.add(
|
|
31
|
+
}`),e.code.add(r`vec3 unpackTileOriginRelativePosition(uvec4 packedGaussian) {
|
|
32
32
|
uint packedPositionLow = packedGaussian.y;
|
|
33
33
|
uint packedPositionHigh = packedGaussian.z;
|
|
34
34
|
uint x = packedPositionLow & 0x3FFFu;
|
|
@@ -37,10 +37,14 @@ uint zLow = (packedPositionLow >> 28u) & 0xFu;
|
|
|
37
37
|
uint zHigh = packedPositionHigh & 0x3FFu;
|
|
38
38
|
uint z = zLow | (zHigh << 4u);
|
|
39
39
|
return vec3(float(x), float(y), float(z));
|
|
40
|
-
}`),e.uniforms.add(new
|
|
41
|
-
vec3
|
|
42
|
-
|
|
43
|
-
vec3
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
}`),e.uniforms.add(new n(`tileCameraPosition`,e=>e.tileCameraPosition),new n(`cameraDelta`,e=>e.cameraDelta)).code.add(r`
|
|
41
|
+
vec3 unpackCameraRelativeGaussianPosition(uvec4 packedHeader, highp vec3 position) {
|
|
42
|
+
// Unpack the header
|
|
43
|
+
vec3 tileOrigin = uintBitsToFloat(packedHeader.xyz);
|
|
44
|
+
float invPosScale = 1.0 / exp2(float(packedHeader.w & 0xfu));
|
|
45
|
+
vec3 delta = tileOrigin.xyz - tileCameraPosition;
|
|
46
|
+
vec3 cameraRelativePosition = position * invPosScale + delta * ${r.float(t)} - cameraDelta;
|
|
47
|
+
|
|
48
|
+
return cameraRelativePosition;
|
|
49
|
+
}
|
|
50
|
+
`)}export{o as GaussianSplatUnpacking,a as GaussianSplatUnpackingPassParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as n,initial as r}from"../../../../../core/reactiveUtils.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{copy as a}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{InternalRenderCategory as s}from"../../../webgl.js";import{glLayout as c}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as l}from"../OpaqueEnvironment.js";import{S as u}from"../../../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as d,layout as f}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as p}from"./SimpleAtmosphereTechniqueConfiguration.js";import{earthAtmosphereTextureSimple as m}from"./SimpleAtmosphereTexture.js";import{createPolySphereData as h}from"../../lib/GeometryUtil.js";import{VertexArrayObject as g}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as _,PrimitiveType as v}from"../../../../webgl/enums.js";import y
|
|
2
|
+
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as n,initial as r}from"../../../../../core/reactiveUtils.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{copy as a}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{InternalRenderCategory as s}from"../../../webgl.js";import{glLayout as c}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as l}from"../OpaqueEnvironment.js";import{S as u}from"../../../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as d,layout as f}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as p}from"./SimpleAtmosphereTechniqueConfiguration.js";import{earthAtmosphereTextureSimple as m}from"./SimpleAtmosphereTexture.js";import{createPolySphereData as h}from"../../lib/GeometryUtil.js";import{VertexArrayObject as g}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as _,PrimitiveType as v}from"../../../../webgl/enums.js";import{Texture as y}from"../../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as x}from"../../../../webgl/VertexBuffer.js";let S=class extends l{constructor(){super(...arguments),this._configuration=new p,this._passParameters=new u,this._vao=null,this._vaoCount=0}initialize(){this._configuration.geometry=1,this.addHandles([n(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),r)])}destroy(){this._passParameters.texture=t(this._passParameters.texture),this._vao=t(this._vao)}render(e){let t=e.find(({name:e})=>e===s.OPAQUE_ENVIRONMENT),n=this.techniques.getCompiled(d,this._configuration);if(!n)return this.requestRender(1),t;let r=this.renderingContext;if(this._vao||(this._vao=C(r),this._vaoCount=this._vao.vertexCount(`geometry`)),!this._passParameters.texture){let e=new b(1,512);e.wrapMode=33071,e.flipped=!0,this._passParameters.texture=new y(r,e,m)}let i=r.bindTechnique(n,this.bindParameters,this._passParameters);return r.setDrawBuffers([_]),w(T,this.bindParameters.camera.viewMatrix),i.setUniformMatrix4fv(`view`,T),r.bindVAO(this._vao),i.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(v.TRIANGLES,0,this._vaoCount),t}};S=e([i(`esri.views.3d.webgl-engine.effects.atmosphere.LocalAtmosphere`)],S);function C(e){let{data:t,indices:n}=h(1,2,!1)[0][1],r=f.createBuffer(n.length),i=r.position;for(let e=0;e<n.length;++e){let r=n[e%3==0?e+2:e%3==2?e-2:e]*3;i.set(e,0,t[r]),i.set(e,1,t[r+1]),i.set(e,2,t[r+2])}return new g(e,new x(e,c(f),r.buffer))}function w(e,t){a(e,t),e[12]=0,e[13]=0,e[14]=0,e[15]=1}const T=o();export{S as LocalAtmosphere};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{lerp as t,clamp as n}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,initial as a}from"../../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{lookAt as s}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as l}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as u,scale as d,add as f,distance as p,cross as m,squaredLength as h}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../../geometry/ellipsoidUtils.js";import{newFloatArray as v}from"../../../../../geometry/support/FloatArray.js";import{InternalRenderCategory as y}from"../../../webgl.js";import{makePiecewiseLinearFunction as b}from"../../../support/mathUtils.js";import{glLayout as x}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as S}from"../OpaqueEnvironment.js";import{computeInnerAltitudeFade as C,innerAtmosphereDepth as w}from"./atmosphereUtils.js";import{marsAtmosphereTextureSimple as T}from"./MarsAtmosphereTexture.js";import{S as E}from"../../../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as D,layout as O}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as k}from"./SimpleAtmosphereTechniqueConfiguration.js";import{createQuadVAO as A}from"../../lib/glUtil3D.js";import{project as j}from"../../lib/Util.js";import{VertexArrayObject as M}from"../../lib/VertexArrayObject.js";import{PrimitiveType as N}from"../../../../webgl/enums.js";import P
|
|
2
|
+
import{__decorate as e}from"tslib";import{lerp as t,clamp as n}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,initial as a}from"../../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{lookAt as s}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as l}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as u,scale as d,add as f,distance as p,cross as m,squaredLength as h}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../../geometry/ellipsoidUtils.js";import{newFloatArray as v}from"../../../../../geometry/support/FloatArray.js";import{InternalRenderCategory as y}from"../../../webgl.js";import{makePiecewiseLinearFunction as b}from"../../../support/mathUtils.js";import{glLayout as x}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as S}from"../OpaqueEnvironment.js";import{computeInnerAltitudeFade as C,innerAtmosphereDepth as w}from"./atmosphereUtils.js";import{marsAtmosphereTextureSimple as T}from"./MarsAtmosphereTexture.js";import{S as E}from"../../../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as D,layout as O}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as k}from"./SimpleAtmosphereTechniqueConfiguration.js";import{createQuadVAO as A}from"../../lib/glUtil3D.js";import{project as j}from"../../lib/Util.js";import{VertexArrayObject as M}from"../../lib/VertexArrayObject.js";import{PrimitiveType as N}from"../../../../webgl/enums.js";import{Texture as P}from"../../../../webgl/Texture.js";import{TextureDescriptor as F}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as I}from"../../../../webgl/VertexBuffer.js";const L=-w,R=()=>1-511/512,z=b([[50,1-460/512],[500,1-400/512],[5e3,1-250/512],[5e4,1-300/512]]);let B=class extends S{constructor(e){super(e),this._passParameters=new E,this._configuration=new k,this._vao=null,this._fadeVao=null,this._texV1=1;let t=e.view,{outerAtmosphereRimWidth:n,radius:r}=_(t.spatialReference);this._planetRadius=r,this._innerRimFactor=1+L/r,this._middleRimFactor=1+0/r,this._outerRimFactor=1+n/r,this._texV0=0/n,this._texVScale=this._texV1-this._texV0}initialize(){this.addHandles(i(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),a))}destroy(){this._passParameters.texture=r(this._passParameters.texture),this._fadeVao=r(this._fadeVao),this._vao=r(this._vao)}render(e){let t=e.find(({name:e})=>e===y.OPAQUE_ENVIRONMENT);this._update();let n=this.renderingContext;if(!this._passParameters.texture){let e=new F(1,512);e.wrapMode=33071,e.flipped=!0,this._passParameters.texture=new P(n,e,T)}if(this._passParameters.undergroundFadeAlpha<1){this._vao??=this._createRibbon(n),this._configuration.geometry=0;let e=this.techniques.getCompiled(D,this._configuration);if(!e)return this.requestRender(1),t;n.bindTechnique(e,this.bindParameters,this._passParameters),n.bindVAO(this._vao),n.drawArrays(N.TRIANGLES,0,this._vao.vertexCount(`geometry`))}if(this._passParameters.undergroundFadeAlpha>0){this._fadeVao??=A(n),this._configuration.geometry=2;let e=this.techniques.getCompiled(D,this._configuration);if(!e)return this.requestRender(1),t;n.bindTechnique(e,this.bindParameters,this._passParameters),n.bindVAO(this._fadeVao),n.drawArrays(N.TRIANGLE_STRIP,0,this._fadeVao.vertexCount(`geometry`))}return t}_update(){let e=this.bindParameters.camera,r=g(),i=this._planetRadius,a=u(e.eye),o=a-i;if(o<0){let e=Math.min(-o/5e3,1);this._passParameters.undergroundFadeAlpha=e}else this._passParameters.undergroundFadeAlpha=0;let s=Math.max(50,o),c=i+L;this._passParameters.innerScale=G(i+s,i,c)-1,this._passParameters.altitudeFade=C(o),d(r,e.eye,(i+50)/a),V(r,e.center,e.up,i,this._passParameters.silhouette);let f=this._computeScreenRimWidth(e,r,e.up,this._passParameters.silhouette),p=R(),m=z(o),h=this._texV0+p*this._texVScale,_=this._texV0+f*m*this._texVScale;if(o>50){V(e.eye,e.center,e.up,i,this._passParameters.silhouette);let r=this._computeScreenRimWidth(e,e.eye,e.up,this._passParameters.silhouette),a=n((r-1.5)/(f-1.5),0,1);h=this._texV0+a*p*this._texVScale,_=this._texV0+t(this._texV1,f*m,a)*this._texVScale}l(this._passParameters.texV,h,_)}_createRibbon(e){let t=v(1155),n=new Uint32Array(1920);t[0]=0,t[1]=0,t[2]=-1;for(let e=0;e<128;e++){let r=e*9+3;t[r]=e,t[r+1]=this._innerRimFactor,t[r+2]=-1,t[r+3]=e,t[r+4]=this._middleRimFactor,t[r+5]=0,t[r+6]=e,t[r+7]=this._outerRimFactor,t[r+8]=1;let i=3*e+1,a=e===127?1:i+3,o=e*15;n[o]=i,n[o+1]=i+1,n[o+2]=a+1,n[o+3]=a+1,n[o+4]=a,n[o+5]=i,n[o+6]=i+1,n[o+7]=i+2,n[o+8]=a+2,n[o+9]=a+2,n[o+10]=a+1,n[o+11]=i+1,n[o+12]=i,n[o+13]=a,n[o+14]=0}let r=O.createBuffer(n.length),i=r.position;for(let e=0;e<n.length;++e){let r=n[e]*3;i.set(e,0,t[r]),i.set(e,1,t[r+1]),i.set(e,2,t[r+2])}return new M(e,new I(e,x(O),r.buffer))}_computeScreenRimWidth(e,t,n,r){return f(U,r.center,r.v2),d(W,U,this._outerRimFactor),s(H,t,U,n),j(U,H,e.projectionMatrix,e.viewport,U),j(W,H,e.projectionMatrix,e.viewport,W),p(U,W)/e.height}};B=e([o(`esri.views.3d.webgl-engine.effects.atmosphere.MarsAtmosphere`)],B);function V(e,t,n,r,i){let a=u(e),o=r*Math.sqrt(a*a-r*r)/a,s=Math.sqrt(r*r-o*o),c=i.v1,l=i.v2;return d(i.center,e,s/a),m(c,e,t),h(c)<1&&m(c,e,n),d(c,c,o/u(c)),m(l,c,e),d(l,l,o/u(l)),o}const H=c(),U=g(),W=g();function G(e,t,n){let r=Math.sqrt(e*e-t*t),i=Math.sqrt(e*e-n*n);return e*e/(r*i+t*n)}export{B as MarsAtmosphere};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{lerp as n}from"../../../../../core/mathUtils.js";import{destroyMaybe as r,disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as a,initial as o}from"../../../../../core/reactiveUtils.js";import{signal as s}from"../../../../../core/signal.js";import{property as c,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as u}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{targetTo as d}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{equals as p,copy as m,set as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{clone as g,ZEROS as _,zeros as v}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as y}from"../../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{zeros as b}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as x}from"../../../../../geometry/ellipsoidUtils.js";import{C as S,c as C}from"../../../../../chunks/Clouds.glsl.js";import{cloudPresets as w}from"./CloudsPresets.js";import{CloudsTechnique as T}from"./CloudsTechnique.js";import{CloudsTechniqueConfiguration as E}from"./CloudsTechniqueConfiguration.js";import{NoiseTextureAtlas as D}from"./NoiseTextureAtlas.js";import{TaskPriority as O}from"../../../../support/Scheduler.js";import{Yield as k}from"../../../../support/Yield.js";import{ColorAttachment0 as A}from"../../../../webgl/enums.js";import{DisposableFramebufferObject as j}from"../../../../webgl/FramebufferObject.js";import{TextureDescriptor as M}from"../../../../webgl/TextureDescriptor.js";let N=class extends t{constructor(e){super(e),this._state=s(0),this._passParameters=new S,this._weatherTileCount=128,this._sliceIndex=0,this._tileIndex=0,this._tilesPerSlice=1,this.coverage=n(w.default.coverage[0],w.default.coverage[1],.5),this.density=n(w.default.density[0],w.default.density[1],.5),this.absorption=n(w.default.absorption[0],w.default.absorption[1],.5),this.cloudSize=n(w.default.cloudSize[0],w.default.cloudSize[1],.5),this.detailSize=n(w.default.detailSize[0],w.default.detailSize[1],.5),this.smoothness=n(w.default.smoothness[0],w.default.smoothness[1],.5),this.cloudHeight=n(w.default.cloudHeight[0],w.default.cloudHeight[1],.5),this.raymarchingSteps=w.default.raymarchingSteps,this._viewMatrix=f(),this._dirty=!0,this.readyToRun=!0,this._configuration=new E}initialize(){let e=x(this.view.spatialReference);this._passParameters.cloudRadius=.5*e.radius;let t=()=>this.setDirty();this.addHandles([this.view.resourceController.scheduler.registerTask(O.CLOUDS_GENERATOR,this),a(()=>this.coverage,t,o),a(()=>this.density,t,o),a(()=>this.absorption,t,o),a(()=>this.cloudSize,t,o),a(()=>this.detailSize,t,o),a(()=>this.smoothness,t,o),a(()=>this.cloudHeight,t,o),a(()=>this.raymarchingSteps,t,o)]);let n=g(this._computeWeatherTile()),r=0;this.addHandles(a(()=>{let e=this._computeWeatherTile();return p(n,e)||(++r,m(n,e)),r},t))}destroy(){this.destroyCubeMap(),this._passParameters.noiseTexture=r(this._passParameters.noiseTexture)}_acquireTechnique(){switch(this.raymarchingSteps){case 0:this._tilesPerSlice=1;break;case 1:this._tilesPerSlice=4;break;case 3:case 2:this._tilesPerSlice=8;break;default:this.raymarchingSteps}return this._configuration.steps=this.raymarchingSteps,this._configuration.writeTextureChannels=1-this.parameters.readChannels,this.context.techniques.getCompiled(T,this._configuration)}_computeWeatherTile(){let{camera:e,environment:t}=this.view,{latitude:n,longitude:r}=e.position;if(n==null||r==null)return _;h(L,(n+90)/180,(r+180)/360);let i=Math.floor(this._weatherTileCount*Math.abs(2*L[0]-1));L[0]=Math.floor(2*this._weatherTileCount*L[0]),L[1]=Math.floor(4*(this._weatherTileCount-i)*L[1]);let a=0,o=0;if(t?.lighting?.type!==`virtual`&&t?.lighting?.date!=null){let e=new Date(t.lighting.date);e.setUTCHours(t.lighting.date.getUTCHours()+(t.lighting.displayUTCOffset??0)),a=e.getUTCMonth()*31+e.getUTCDate(),o=e.getUTCFullYear()}return L[0]=(L[0]+a)%(2*this._weatherTileCount),L[1]=(L[1]+o%100)%(4*this._weatherTileCount),L}get state(){return this._state.value}set state(e){this._state.value=e}get usedMemory(){return(this._fbo?.usedMemory??0)+(this._passParameters.noiseTexture?.textureAtlas?.usedMemory??0)}_ensureNoiseTexture(){return this._passParameters.noiseTexture??=new D({context:this.context}),this._passParameters.noiseTexture}
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{lerp as n}from"../../../../../core/mathUtils.js";import{destroyMaybe as r,disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as a,initial as o}from"../../../../../core/reactiveUtils.js";import{signal as s}from"../../../../../core/signal.js";import{property as c,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as u}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{targetTo as d}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{equals as p,copy as m,set as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{clone as g,ZEROS as _,zeros as v}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as y}from"../../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{zeros as b}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as x}from"../../../../../geometry/ellipsoidUtils.js";import{C as S,c as C}from"../../../../../chunks/Clouds.glsl.js";import{cloudPresets as w}from"./CloudsPresets.js";import{CloudsTechnique as T}from"./CloudsTechnique.js";import{CloudsTechniqueConfiguration as E}from"./CloudsTechniqueConfiguration.js";import{NoiseTextureAtlas as D}from"./NoiseTextureAtlas.js";import{TaskPriority as O}from"../../../../support/Scheduler.js";import{Yield as k}from"../../../../support/Yield.js";import{ColorAttachment0 as A}from"../../../../webgl/enums.js";import{DisposableFramebufferObject as j}from"../../../../webgl/FramebufferObject.js";import{TextureDescriptor as M}from"../../../../webgl/TextureDescriptor.js";let N=class extends t{constructor(e){super(e),this._state=s(0),this._passParameters=new S,this._weatherTileCount=128,this._sliceIndex=0,this._tileIndex=0,this._tilesPerSlice=1,this.coverage=n(w.default.coverage[0],w.default.coverage[1],.5),this.density=n(w.default.density[0],w.default.density[1],.5),this.absorption=n(w.default.absorption[0],w.default.absorption[1],.5),this.cloudSize=n(w.default.cloudSize[0],w.default.cloudSize[1],.5),this.detailSize=n(w.default.detailSize[0],w.default.detailSize[1],.5),this.smoothness=n(w.default.smoothness[0],w.default.smoothness[1],.5),this.cloudHeight=n(w.default.cloudHeight[0],w.default.cloudHeight[1],.5),this.raymarchingSteps=w.default.raymarchingSteps,this._viewMatrix=f(),this._dirty=!0,this.readyToRun=!0,this._configuration=new E}initialize(){let e=x(this.view.spatialReference);this._passParameters.cloudRadius=.5*e.radius;let t=()=>this.setDirty();this.addHandles([this.view.resourceController.scheduler.registerTask(O.CLOUDS_GENERATOR,this),a(()=>this.coverage,t,o),a(()=>this.density,t,o),a(()=>this.absorption,t,o),a(()=>this.cloudSize,t,o),a(()=>this.detailSize,t,o),a(()=>this.smoothness,t,o),a(()=>this.cloudHeight,t,o),a(()=>this.raymarchingSteps,t,o)]);let n=g(this._computeWeatherTile()),r=0;this.addHandles(a(()=>{let e=this._computeWeatherTile();return p(n,e)||(++r,m(n,e)),r},t))}destroy(){this.destroyCubeMap(),this._passParameters.noiseTexture=r(this._passParameters.noiseTexture)}_acquireTechnique(){switch(this.raymarchingSteps){case 0:this._tilesPerSlice=1;break;case 1:this._tilesPerSlice=4;break;case 3:case 2:this._tilesPerSlice=8;break;default:this.raymarchingSteps}return this._configuration.steps=this.raymarchingSteps,this._configuration.writeTextureChannels=1-this.parameters.readChannels,this.context.techniques.getCompiled(T,this._configuration)}_computeWeatherTile(){let{camera:e,environment:t}=this.view,{latitude:n,longitude:r}=e.position;if(n==null||r==null)return _;h(L,(n+90)/180,(r+180)/360);let i=Math.floor(this._weatherTileCount*Math.abs(2*L[0]-1));L[0]=Math.floor(2*this._weatherTileCount*L[0]),L[1]=Math.floor(4*(this._weatherTileCount-i)*L[1]);let a=0,o=0;if(t?.lighting?.type!==`virtual`&&t?.lighting?.date!=null){let e=new Date(t.lighting.date);e.setUTCHours(t.lighting.date.getUTCHours()+(t.lighting.displayUTCOffset??0)),a=e.getUTCMonth()*31+e.getUTCDate(),o=e.getUTCFullYear()}return L[0]=(L[0]+a)%(2*this._weatherTileCount),L[1]=(L[1]+o%100)%(4*this._weatherTileCount),L}get state(){return this._state.value}set state(e){this._state.value=e}get usedMemory(){return(this._fbo?.usedMemory??0)+(this._passParameters.noiseTexture?.textureAtlas?.usedMemory??0)}_ensureNoiseTexture(){return this._passParameters.noiseTexture??=new D({context:this.context}),this._passParameters.noiseTexture}_ensureCubemap(e){let t=this.context.rctx;if(this._fbo==null){let n=new M(e,e/2);n.target=35866,n.depth=6,n.wrapMode=33071,this._fbo=new j(t,n),this.parameters.data=this,this.parameters.absorption=this.absorption,this.parameters.coverage=this.coverage}return t.unbindTexture(this._fbo.colorTexture),this._fbo}_clearCubemap(){if(this._fbo==null)return;let e=this.context.rctx;e.bindFramebuffer(this._fbo),this.parameters.readChannels===1?e.setColorMask(!0,!0,!1,!1):e.setColorMask(!1,!1,!0,!0),e.setClearColor(0,1,0,1);for(let t=0;t<6;++t)this._fbo.setColorTextureTarget(35866,A,t),e.gl.clear(16384);e.setClearColor(1,1,1,1),e.setColorMask(!0,!0,!0,!0)}get cubeMap(){return this._fbo}get parameters(){return this.context.bind.clouds}destroyCubeMap(){this._fbo=i(this._fbo),this.parameters.data=null}applyPreset(e,t){let r=e.median,i=e=>{let i=n(e[0],e[1],r);return t<.5?n(e[0],i,t*2):n(i,e[1],(t-.5)*2)};this.coverage=i(e.coverage),this.density=i(e.density),this.absorption=i(e.absorption),this.cloudSize=i(e.cloudSize),this.detailSize=i(e.detailSize),this.smoothness=i(e.smoothness),this.cloudHeight=i(e.cloudHeight),this.raymarchingSteps=e.raymarchingSteps}setDirty(){this._dirty=this.readyToRun=!0}runTask(e){if(this.state===3)return k;if(this._dirty&&=(this._sliceIndex=this._tileIndex=0,this.state=1,this._passParameters.absorption=this.absorption,this._passParameters.density=this.density,this._passParameters.cloudSize=this.cloudSize,this._passParameters.detailSize=this.detailSize,this._passParameters.smoothness=this.smoothness,this._passParameters.cloudHeight=this.cloudHeight,this._passParameters.coverage=this.coverage,this._ensureNoiseTexture().updateWeatherMap(this._computeWeatherTile()),!1),this._passParameters.coverage===0){this._clearCubemap(),this._sliceIndex=this._tileIndex=0,this.state=2,this.readyToRun=!1,e.madeProgress();return}let t=this._acquireTechnique();if(!this._ensureNoiseTexture().textureAtlas||!t)return k;let n=P[this._sliceIndex],r=F[this._sliceIndex];d(this._viewMatrix,I,n,r),u(this._passParameters.viewMatrix,this._viewMatrix);let i=this.context.rctx,a=i.getViewport(),o=C/this._tilesPerSlice,s=this._tileIndex*o;i.setViewport(0,s,C,o);let c=this._ensureCubemap(C);return i.bindFramebuffer(c),this._passParameters.lastSlice=this._sliceIndex===5,i.bindTechnique(t,this.context.bind,this._passParameters),c.setColorTextureTarget(35866,A,this._sliceIndex),i.screen.draw(),i.gl.flush(),i.setViewport(a.x,a.y,a.width,a.height),this.requestRender(),++this._tileIndex,this._sliceIndex===5&&this._tileIndex===this._tilesPerSlice?(this._sliceIndex=this._tileIndex=0,this.state=2,this.readyToRun=!1):this._tileIndex===this._tilesPerSlice&&(++this._sliceIndex,this._tileIndex=0),e.madeProgress(),k}};e([c({constructOnly:!0})],N.prototype,`context`,void 0),e([c({constructOnly:!0})],N.prototype,`view`,void 0),e([c({constructOnly:!0})],N.prototype,`requestRender`,void 0),e([c()],N.prototype,`coverage`,void 0),e([c()],N.prototype,`density`,void 0),e([c()],N.prototype,`absorption`,void 0),e([c()],N.prototype,`cloudSize`,void 0),e([c()],N.prototype,`detailSize`,void 0),e([c()],N.prototype,`smoothness`,void 0),e([c()],N.prototype,`cloudHeight`,void 0),e([c()],N.prototype,`raymarchingSteps`,void 0),e([c()],N.prototype,`readyToRun`,void 0),N=e([l(`esri.views.3d.webgl-engine.effects.clouds.CloudsRenderer`)],N);const P=[y(1,0,0),y(-1,0,0),y(0,1,0),y(0,-1,0),y(0,0,1),y(0,0,1)],F=[y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,1,0),y(0,1,0)],I=b(),L=v();export{N as CloudsRenderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{equals as t}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{releaseMaybe as n,disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,initial as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{set as c}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as l}from"../../../webgl.js";import u from"../../../webgl/RenderNode.js";import{HighlightApplyTechnique as d}from"./HighlightApplyTechnique.js";import{H as f}from"../../../../../chunks/HighlightBlur.glsl.js";import{HighlightBlurTechnique as p}from"./HighlightBlurTechnique.js";import{H as m,g as h}from"../../../../../chunks/HighlightDownsample.glsl.js";import{HighlightDownsampleTechnique as g}from"./HighlightDownsampleTechnique.js";import{HighlightPassParameters as _}from"./HighlightPassParameters.js";import{m as v}from"../../../../../chunks/HighlightSharpApply.glsl.js";import{HighlightSharpApplyTechnique as y}from"./HighlightSharpApplyTechnique.js";import{HighlightToSingleTechnique as b}from"./HighlightToSingleTechnique.js";import{Compositor as x}from"../../lib/Compositor.js";import{NoVertex as S}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as C}from"../../lib/VertexArrayObject.js";import{BufferObject as w}from"../../../../webgl/BufferObject.js";import{ColorAttachment0 as T,PrimitiveType as E,DataType as D}from"../../../../webgl/enums.js";import O
|
|
2
|
+
import{__decorate as e}from"tslib";import{equals as t}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{releaseMaybe as n,disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,initial as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{set as c}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as l}from"../../../webgl.js";import u from"../../../webgl/RenderNode.js";import{HighlightApplyTechnique as d}from"./HighlightApplyTechnique.js";import{H as f}from"../../../../../chunks/HighlightBlur.glsl.js";import{HighlightBlurTechnique as p}from"./HighlightBlurTechnique.js";import{H as m,g as h}from"../../../../../chunks/HighlightDownsample.glsl.js";import{HighlightDownsampleTechnique as g}from"./HighlightDownsampleTechnique.js";import{HighlightPassParameters as _}from"./HighlightPassParameters.js";import{m as v}from"../../../../../chunks/HighlightSharpApply.glsl.js";import{HighlightSharpApplyTechnique as y}from"./HighlightSharpApplyTechnique.js";import{HighlightToSingleTechnique as b}from"./HighlightToSingleTechnique.js";import{Compositor as x}from"../../lib/Compositor.js";import{NoVertex as S}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as C}from"../../lib/VertexArrayObject.js";import{BufferObject as w}from"../../../../webgl/BufferObject.js";import{ColorAttachment0 as T,PrimitiveType as E,DataType as D}from"../../../../webgl/enums.js";import{Texture as O}from"../../../../webgl/Texture.js";import{TextureDescriptor as k}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as A}from"../../../../webgl/VertexBuffer.js";let j=class extends u{constructor(e){super(e),this.consumes={required:[l.HIGHLIGHT,`highlights`]},this.produces=l.HIGHLIGHT,this._renderSharpHighlights=(e,t,n)=>{let{techniques:r}=this,i=r.getCompiled(y);if(!i||!this._compositor.isPremultipliedAlphaReady(!1))return!1;let a=this._prepareAndDownSample(t),{fullWidth:o,fullHeight:s,pixelRatio:c,fullViewport:l}=this.bindParameters.camera,u=this.fboCache.acquire(o,s,`highlight overlay`,5);this._clearHighlightOverlay(u),this._passParameters.pixelRatio=Math.min(c,v);let{renderingContext:d,bindParameters:f,_passParameters:p}=this,m=this.view.stage.renderView.renderer;for(let e=0;e<n.length;++e){let{name:t}=n[e];m.hasHighlight(t)&&(p.highlightLevel=e,d.bindFramebuffer(u.fbo),d.setViewport4fv(f.camera.fullViewport),d.bindTechnique(i,f,p),this._renderGrid(a))}let h=this.antialias.isEnabled()?this.antialias.renderTo(u,`highlight antialiasing`,{coverageTexture:a.coverage.getTexture(),horizontalCellCount:a.horizontalCellCount,verticalCellCount:a.verticalCellCount,draw:()=>this._renderGrid(a)}):u;h!==u&&u.release();let{_compositor:g}=this;return d.bindFramebuffer(e.fbo),d.setDrawBuffers([T]),d.setViewport4fv(l),g.compositePreMultipliedAlpha(this.bindParameters,h.getTexture(),!1),h.release(),!0},this._renderGaussianHighlights=(e,t,n)=>{let{renderingContext:r,bindParameters:i,fboCache:a,_passParameters:o,techniques:s}=this,l=s.getCompiled(b),u=s.getCompiled(p),f=s.getCompiled(d);if(!l||!u||!f)return!1;let m=this._prepareAndDownSample(t),{width:h,height:g}=t.descriptor,{fullWidth:_,fullHeight:v,pixelRatio:y,fullViewport:x}=i.camera,S=Math.ceil(_/y),C=Math.ceil(v/y),{_highlightBlurDrawParameters:w}=this,E=this.view.stage.renderView.renderer;for(let t=0;t<n.length;++t){let{name:s}=n[t];if(!E.hasHighlight(s))continue;o.highlightLevel=t,r.setClearColor(0,0,0,0);let d=a.acquire(h,g,`single highlight`,2);r.bindFramebuffer(d.fbo),r.setViewport(0,0,h,g),r.clear(16384),r.bindTechnique(l,i,o),this._renderGrid(m),w.blurInput=d.getTexture(),c(w.blurSize,1/S,0);let p=a.acquire(S,C,`single highlight blur`,2);r.unbindTexture(p.fbo?.colorTexture),r.bindFramebuffer(p.fbo),r.setViewport(0,0,S,C),r.clear(16384),r.bindTechnique(u,i,o,w),this._renderGrid(m),d.release(),c(w.blurSize,0,1/C),o.highlightBlurTexture=p.getTexture(),r.bindFramebuffer(e.fbo),r.setDrawBuffers([T]),r.setViewport4fv(x),r.bindTechnique(f,i,o,w),this._renderGrid(m),p.release()}return!0},this._downsampleDrawParameters=new m,this._passParameters=new _,this._highlightBlurDrawParameters=new f,this._compositor=null,this._grid=new M}initialize(){this._compositor=new x(this.renderingContext,this.techniques),this.addHandles([i(()=>this._optionsData,e=>this._updateOptionsTexture(e),a)])}destroy(){this._grid.coverage=n(this._grid.coverage),this._grid.vao=r(this._grid.vao),this._passParameters.highlightOptionsTexture=n(this._passParameters.highlightOptionsTexture)}get _optionsData(){let e=new Uint8Array(128),n=0;for(let t of this.view.state.highlights){let r=n*4,i=n*4+64;++n;let{color:a}=t,o=t.haloColor??a;e[r+0]=a.r,e[r+1]=a.g,e[r+2]=a.b,e[r+3]=t.fillOpacity*a.a*255,e[i+0]=o.r,e[i+1]=o.g,e[i+2]=o.b,e[i+3]=t.haloOpacity*o.a*255}let r=this._get(`_optionsData`);return t(e,r)?r:e}_updateOptionsTexture(e){if(this._passParameters.highlightOptionsTexture==null){let e=new k(16,2);e.internalFormat=6408,e.samplingMode=9728,this._passParameters.highlightOptionsTexture=new O(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(e),this.requestRender(1)}render(e){let t=e.find(({name:e})=>e===l.HIGHLIGHT),{techniques:n,bindParameters:r,_passParameters:i}=this;if(!r.decorations)return t;if(!n.getCompiled(g))return this.requestRender(1),t;let a=this.view.stage.renderer.isFeatureEnabled(13),o=e.find(({name:e})=>e===`highlights`).getTexture(),s=a?this._renderSharpHighlights:this._renderGaussianHighlights,c=a?this._renderGaussianHighlights:this._renderSharpHighlights;return!s(t,o,r.highlights)&&(this.requestRender(1),!c(t,o,r.highlights))||(i.coverageTexture=null,i.highlightTexture=null),t}_clearHighlightOverlay(e){let{renderingContext:t}=this;t.bindFramebuffer(e.fbo),t.setViewport4fv(this.bindParameters.camera.fullViewport),t.setClearColor(0,0,0,0),t.clear(16384)}_prepareAndDownSample(e){this._passParameters.highlightTexture=e,this._gridUpdateResources(e);let t=this.techniques.get(g),n=this._gridComputeCoverage(t,e),{horizontalCellCount:r,verticalCellCount:i}=n,a=this._passParameters;return a.horizontalCellCount=r,a.verticalCellCount=i,a.coverageTexture=n.coverage?.getTexture(),n}_renderGrid(e){let t=e.verticalCellCount*e.horizontalCellCount;this.renderingContext.bindVAO(e.vao),this.renderingContext.drawElementsInstanced(E.TRIANGLES,6,D.UNSIGNED_BYTE,0,t)}_gridUpdateResources(e){let t=this._grid,{width:n,height:r}=e.descriptor;if(t.horizontalCellCount=Math.ceil(n/h),t.verticalCellCount=Math.ceil(r/h),t.vao)return;let i=this.renderingContext,a=w.createIndex(i,35044,F);t.vao=new C(i,new A(i,S),a)}_gridComputeCoverage(e,t){let n=this.renderingContext,r=this._grid,i=t.descriptor,a=Math.ceil(i.width/h),o=Math.ceil(i.height/h);this._downsampleDrawParameters.input=t;let{highlights:s}=this.bindParameters;r.coverage?.release();let c=this.fboCache.acquire(a,o,`highlight coverage`,s.length>L?3:1);return r.coverage=c,n.bindFramebuffer(c.fbo),n.bindTechnique(e,this.bindParameters,this._passParameters,this._downsampleDrawParameters),n.setViewport(0,0,a,o),n.screen.draw(),r}get test(){}};e([o()],j.prototype,`consumes`,void 0),e([o()],j.prototype,`produces`,void 0),e([o({constructOnly:!0})],j.prototype,`antialias`,void 0),e([o()],j.prototype,`_optionsData`,null),j=e([s(`esri.views.3d.webgl-engine.effects.highlight.Highlight`)],j);class M{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}let N=0;function P(e){let t=0;for(let n of e){let{name:e}=n;t+=e.length;let{color:r,fillOpacity:i,haloColor:a,haloOpacity:o}=n;t+=r.r+r.g+r.b+r.a+i,t+=a?a.r+a.g+a.b+a.a+o:0}let n=e.at(0);if(n){let{shadowOpacity:e,shadowDifference:r,shadowColor:i}=n;t+=e+r+i.r+i.g+i.b+i.a}return N+++(t>=0?0:1)}const F=new Uint8Array([0,1,2,2,1,3]);function I(e,t,n,r,i,a,o=0){let{highlights:s}=i,l=s.length>1?t.acquire(n,r,`highlight mix`,s.length>L?3:1):null,{gl:u}=e;if(l){let t=e.boundFramebuffer;e.bindFramebuffer(l.fbo),u.clearBufferuiv(u.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}let d=l?.getTexture();i.highlightMixTexture=d,c(i.highlightMixOrigin,o,0),s.forEach((t,s)=>{if(s>0){let t=O.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(d,t),e.setActiveTexture(t),u.copyTexSubImage2D(3553,0,0,0,o,0,n,r),e.bindTexture(null,t)}e.clear(256),i.highlightLevel=s,a()}),i.highlightLevel=null,i.highlightMixTexture=null,l?.release()}const L=4;export{j as Highlight,L as maxHighlightsPerChannel,I as renderHighlightBuffer,P as trackHighlightOptions};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{createTask as t}from"../../../../../core/asyncUtils.js";import{clamp as n}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{createScreenPointArray as o,createRenderScreenPointArray as s,screenPointObjectToArray as c}from"../../../../../core/screenUtils.js";import{isSVG as l}from"../../../../../core/urlUtils.js";import{property as u,subclass as d}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as f}from"../../../../../request/image.js";import{InternalRenderCategory as p}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{M as h}from"../../../../../chunks/Magnifier.glsl.js";import{MagnifierTechnique as g}from"./MagnifierTechnique.js";import{createQuadVAO as _}from"../../lib/glUtil3D.js";import{loadMagnifierResources as v}from"../../../../magnifier/resources.js";import{ColorAttachment0 as y,PrimitiveType as b}from"../../../../webgl/enums.js";import x
|
|
2
|
+
import{__decorate as e}from"tslib";import{createTask as t}from"../../../../../core/asyncUtils.js";import{clamp as n}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{createScreenPointArray as o,createRenderScreenPointArray as s,screenPointObjectToArray as c}from"../../../../../core/screenUtils.js";import{isSVG as l}from"../../../../../core/urlUtils.js";import{property as u,subclass as d}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as f}from"../../../../../request/image.js";import{InternalRenderCategory as p}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{M as h}from"../../../../../chunks/Magnifier.glsl.js";import{MagnifierTechnique as g}from"./MagnifierTechnique.js";import{createQuadVAO as _}from"../../lib/glUtil3D.js";import{loadMagnifierResources as v}from"../../../../magnifier/resources.js";import{ColorAttachment0 as y,PrimitiveType as b}from"../../../../webgl/enums.js";import{Texture as x}from"../../../../webgl/Texture.js";import{TextureDescriptor as S}from"../../../../webgl/TextureDescriptor.js";let C=class extends m{constructor(){super(...arguments),this.consumes={required:[p.MAGNIFIER]},this.produces=p.MAGNIFIER,this._imageSources=null,this._imageLoadTask=null,this._passParameters=new h,this._magnifier=null,this._tmpScreenPoint=o(),this._tmpRenderPoint=s()}initialize(){this.addHandles([i(()=>this.view.magnifier,e=>this._update(e),a)])}_update(e){if(e===this._magnifier)return;this.removeAllHandles(),this._magnifier=e;let t=()=>{let e=this._validMagnifier;e?(this._loadResources(e),this.produces=p.MAGNIFIER):this.produces=`disabled`,this.requestRender()};this._magnifier&&this.addHandles(i(()=>this._magnifier?.version,t)),t()}get _validMagnifier(){return this._magnifier?.visible&&this._magnifier?.position&&this._magnifier?.size>0?this._magnifier:null}get _factor(){return this._magnifier?.factor||1}destroy(){this._magnifier=null,this._imageLoadTask!=null&&(this._imageLoadTask.task.abort(),this._imageLoadTask=null),this._disposeTextures(),this._vao=r(this._vao)}_disposeTextures(){this._passParameters.mask=r(this._passParameters.mask),this._passParameters.overlay=r(this._passParameters.overlay),this._passParameters.input=r(this._passParameters.input)}render(){let e=this._validMagnifier,t=this.input;if(e==null)return t;if(this._imageSources==null)return this.requestRender(1),t;let r=this.renderingContext,i=this.camera.pixelRatio,a=Math.ceil(i*e.size);this._vao??=_(r,0,0,1);let o=this.techniques.getCompiled(g);if(this._ensureTextureResources(r,a),!o||!this._passParameters.input)return this.requestRender(1),t;let s=Math.ceil(1/this._factor*a),l=this._passParameters.input;l.resize(s,s),c(e.position,this._tmpScreenPoint);let u=this.camera.screenToRender(this._tmpScreenPoint,this._tmpRenderPoint),d=this.camera.fullWidth,f=this.camera.fullHeight,p=.5*s,m=.5*s;u[0]=n(u[0],p,d-p-1),u[1]=n(u[1],m,f-m-1);let h=Math.floor(u[0]-p),v=Math.floor(u[1]-m);return r.bindFramebuffer(t.fbo),o.program.bindTexture(`textureInput`,l),r.gl.copyTexImage2D(l.descriptor.target,0,l.descriptor.pixelFormat,h,v,s,s,0),this._passParameters.magnifier=e,r.bindTechnique(o,this.bindParameters,this._passParameters),r.setDrawBuffers([y]),r.bindVAO(this._vao),r.drawArrays(b.TRIANGLE_STRIP,0,4),t}_loadResources(e){let{maskUrl:n,overlayUrl:r}=e;(this._imageLoadTask?.maskUrl!==n||this._imageLoadTask?.overlayUrl!==r)&&(this._imageLoadTask?.task.abort(),this._imageLoadTask=this._imageSources=null),this._imageSources||this._imageLoadTask||(this._imageLoadTask={maskUrl:n,overlayUrl:r,task:t(async e=>{let t=n==null||r==null?v(e):null,i=n==null?t.then(e=>e.mask):f(n,{signal:e}),a=r==null?t.then(e=>e.overlay):f(r,{signal:e});this._imageSources={mask:await i,overlay:await a}})})}_ensureTextureResources(e,t){this._imageSources==null||this._passParameters.size===t&&this._passParameters.input&&this._passParameters.mask&&this._passParameters.overlay||(this._disposeTextures(),this._imageSources.overlay.width=this._imageSources.mask.width=t,this._imageSources.overlay.height=this._imageSources.mask.height=t,this._passParameters.overlay=new x(e,this._createTextureDescriptor(t,6408,this._imageSources.overlay),this._imageSources.overlay),this._passParameters.mask=new x(e,this._createTextureDescriptor(t,6406,this._imageSources.mask),this._imageSources.mask),this._passParameters.input=new x(e,this._createTextureDescriptor(t,6408,null)))}_createTextureDescriptor(e,t,n){let r=this.renderingContext,i=new S(e);return i.pixelFormat=i.internalFormat=t,i.wrapMode=33071,i.flipped=!!n,i.preMultiplyAlpha=!(t!==6408||!n||l(n.src)&&r.driverTest.svgPremultipliesAlpha.result),i}};e([u()],C.prototype,`consumes`,void 0),e([u()],C.prototype,`produces`,void 0),e([u()],C.prototype,`_imageSources`,void 0),e([u()],C.prototype,`_imageLoadTask`,void 0),C=e([d(`esri.views.3d.webgl-engine.effects.magnifier.Magnifier`)],C);export{C as Magnifier};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Logger.js";import{abortMaybe as n,disposeMaybe as r}from"../../../../../core/maybe.js";import{throwIfAborted as i,isAbortError as a}from"../../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as u}from"../../../../../request/image.js";import{InternalRenderCategory as d}from"../../../webgl.js";import f from"../../../webgl/RenderNode.js";import{SMAABlendWeightsTechnique as p}from"./SMAABlendWeightsTechnique.js";import{SMAABlurTechnique as m}from"./SMAABlurTechnique.js";import{SMAAEdgeDetectTechnique as h}from"./SMAAEdgeDetectTechnique.js";import{SMAAPassParameters as g}from"./SMAAPassParameters.js";import{SMAATechniqueConfiguration as _}from"./SMAATechniqueConfiguration.js";import v
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Logger.js";import{abortMaybe as n,disposeMaybe as r}from"../../../../../core/maybe.js";import{throwIfAborted as i,isAbortError as a}from"../../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as u}from"../../../../../request/image.js";import{InternalRenderCategory as d}from"../../../webgl.js";import f from"../../../webgl/RenderNode.js";import{SMAABlendWeightsTechnique as p}from"./SMAABlendWeightsTechnique.js";import{SMAABlurTechnique as m}from"./SMAABlurTechnique.js";import{SMAAEdgeDetectTechnique as h}from"./SMAAEdgeDetectTechnique.js";import{SMAAPassParameters as g}from"./SMAAPassParameters.js";import{SMAATechniqueConfiguration as _}from"./SMAATechniqueConfiguration.js";import{Texture as v}from"../../../../webgl/Texture.js";import{TextureDescriptor as y}from"../../../../webgl/TextureDescriptor.js";let b=class extends f{constructor(e){super(e),this.consumes={required:[d.ANTIALIASING]},this.produces=`disabled`,this._areaTexture=null,this._searchTexture=null,this._configuration=new _,this._smaaParameters=new g}initialize(){this.addHandles([o(()=>this.isEnabled(),e=>e?this.view.addUpdatingPromise(this.enable()):this.disable(),s)])}async enable(){if(this.destroyed||(this.produces=d.ANTIALIASING,this.requestRender(1),this._abortController||this._areaTexture&&this._searchTexture))return;this._abortController=new AbortController;let e=this._abortController.signal;try{let t=await import(`./SMAAData.js`);i(e),await this._loadTextures(t,e),i(e),this.requestRender(1)}catch(e){a(e)||t.getLogger(this).errorOnce(e)}this._abortController=null}async _loadTextures(e,t){i(t);let[n,r]=await Promise.allSettled([u(e.areaTexture,{signal:t}),u(e.searchTexure,{signal:t})]);if(i(t),n.status!==`fulfilled`||r.status!==`fulfilled`)return;let a=this.renderingContext;this._areaTexture=x(a,9729,6407,n.value),this._searchTexture=x(a,9728,6409,r.value)}disable(){this.produces=`disabled`,this.requestRender(1)}destroy(){this._abortController=n(this._abortController),this._searchTexture=r(this._searchTexture),this._areaTexture=r(this._areaTexture)}render(){return this.renderTo(this.input,d.ANTIALIASING)}renderTo(e,t,n){this._configuration.useHighlightGrid=n!=null;let r=this.techniques.getCompiled(h,this._configuration),i=this.techniques.getCompiled(p,this._configuration),a=this.techniques.getCompiled(m,this._configuration);if(!this._areaTexture||!this._searchTexture||!r||!i||!a)return this.requestRender(1),e;let{width:o,height:s}=e.fbo,c=this.renderingContext,l=this._smaaParameters;l.highlightTexture=e.getTexture(),l.coverageTexture=n?.coverageTexture,l.horizontalCellCount=n?.horizontalCellCount??0,l.verticalCellCount=n?.verticalCellCount??0,c.setViewport(0,0,o,s);let u=this.fboCache.acquire(o,s,`smaa edges`,2);c.bindFramebuffer(u.fbo),c.setClearColor(0,0,0,1),c.clear(16384),l.color=e.getTexture();let d=this.bindParameters;c.bindTechnique(r,d,l),n?n.draw():c.screen.draw();let f=this.fboCache.acquire(o,s,`smaa blend`);c.bindFramebuffer(f.fbo),c.setClearColor(0,0,1,1),c.clear(16384),l.inputTexture=u.getTexture(),l.areaTexture=this._areaTexture,l.searchTexture=this._searchTexture,c.bindTechnique(i,d,l),n?n.draw():c.screen.draw(),u.release();let g=this.fboCache.acquire(o,s,t);return c.bindFramebuffer(g.fbo),c.setClearColor(0,+!n,0,+!n),c.clear(16384),l.inputTexture=f.getTexture(),c.bindTechnique(a,d,l),n?n.draw():c.screen.draw(),f.release(),g.moveAttachments(e),l.highlightTexture=null,l.coverageTexture=null,g}};e([c()],b.prototype,`consumes`,void 0),e([c()],b.prototype,`produces`,void 0),e([c({constructOnly:!0})],b.prototype,`isEnabled`,void 0),e([c()],b.prototype,`_abortController`,void 0),b=e([l(`esri.views.3d.webgl-engine.effects.smaa.SMAA`)],b);function x(e,t,n,r){let i=new y(r.width,r.height);return i.pixelFormat=n,i.wrapMode=33071,i.samplingMode=t,new v(e,i,r)}export{b as SMAA};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{clamp as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as n}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{Milliseconds as a}from"../../../../../core/time.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as s}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as c}from"../../../webgl.js";import{distanceFadeEnd as l,distanceFadeStart as u}from"../../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{AmbientIllumination as d}from"../AmbientIllumination.js";import{g as f}from"../../../../../chunks/SSAO.glsl.js";import{SSAOBlurTechnique as p}from"./SSAOBlurTechnique.js";import{noiseData as m}from"./SSAONoiseData.js";import{SSAOPassParameters as h,BlurDrawParameters as g}from"./SSAOParameters.js";import{SSAOTechnique as _}from"./SSAOTechnique.js";import{DepthStencilAttachment as v}from"../../../../webgl/enums.js";import y
|
|
2
|
+
import{__decorate as e}from"tslib";import{clamp as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as n}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{Milliseconds as a}from"../../../../../core/time.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as s}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as c}from"../../../webgl.js";import{distanceFadeEnd as l,distanceFadeStart as u}from"../../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{AmbientIllumination as d}from"../AmbientIllumination.js";import{g as f}from"../../../../../chunks/SSAO.glsl.js";import{SSAOBlurTechnique as p}from"./SSAOBlurTechnique.js";import{noiseData as m}from"./SSAONoiseData.js";import{SSAOPassParameters as h,BlurDrawParameters as g}from"./SSAOParameters.js";import{SSAOTechnique as _}from"./SSAOTechnique.js";import{DepthStencilAttachment as v}from"../../../../webgl/enums.js";import{Texture as y}from"../../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../../webgl/TextureDescriptor.js";const x=2;let S=class extends d{constructor(e){super(e),this._enableTime=a(0),this._passParameters=new h,this._drawParameters=new g}initialize(){let e=Uint8Array.from(atob(m),e=>e.charCodeAt(0)),t=new b(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new y(this.renderingContext,t,e),this.addHandles(r(()=>this._useSSAO,e=>{this._enableTime=a(0),e?this._enable():this._disable()},i))}destroy(){this._passParameters.noiseTexture=n(this._passParameters.noiseTexture)}render(e){let n=e.find(({name:e})=>e===`normals`),r=n?.getTexture(),i=n?.getTexture(v);if(!r||!i)return;let o=this.techniques.getCompiled(_),d=this.techniques.getCompiled(p);if(!o||!d){this._enableTime=a(performance.now()),this.requestRender(1);return}this._enableTime===0&&(this._enableTime=a(performance.now()));let m=this.renderingContext,h=this.view.qualitySettings.fadeDuration,g=this.bindParameters,y=g.camera,b=y.relativeElevation,x=t((l-b)/(l-u),0,1),S=h>0?Math.min(h,performance.now()-this._enableTime)/h:1,w=S*x;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/y.computeScreenPixelSizeAtDistance(1),this._passParameters.intensity=4*C/f(y)**6*w;let T=y.fullViewport[2],E=y.fullViewport[3],D=this.fboCache.acquire(T,E,`ssao input`,2);m.bindFramebuffer(D.fbo),m.setViewport(0,0,T,E),m.bindTechnique(o,g,this._passParameters,this._drawParameters),m.screen.draw();let O=Math.round(T/2),k=Math.round(E/2),A=this.fboCache.acquire(O,k,`ssao blur`,0);m.bindFramebuffer(A.fbo),this._drawParameters.colorTexture=D.getTexture(),s(this._drawParameters.blurSize,0,2/E),m.bindTechnique(d,g,this._passParameters,this._drawParameters),m.setViewport(0,0,O,k),m.screen.draw(),D.release();let j=this.fboCache.acquire(O,k,c.AMBIENT_ILLUMINATION,0);return m.bindFramebuffer(j.fbo),m.setViewport(0,0,T,E),m.setClearColor(1,1,1,0),m.clear(16384),this._drawParameters.colorTexture=A.getTexture(),s(this._drawParameters.blurSize,2/T,0),m.bindTechnique(d,g,this._passParameters,this._drawParameters),m.setViewport(0,0,O,k),m.screen.draw(),m.setViewport4fv(y.fullViewport),A.release(),S<1&&this.requestRender(2),j}};S=e([o(`esri.views.3d.webgl-engine.effects.ssao.SSAO`)],S);const C=.5;export{S as SSAO,x as blurSizePixels};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{fetchAsset as t}from"../../../../../assets.js";import{createTask as n}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Error.js";import i from"../../../../../core/Logger.js";import{abortMaybe as a,disposeMaybe as o}from"../../../../../core/maybe.js";import{isAbortError as s,throwIfAborted as c}from"../../../../../core/promiseUtils.js";import{watch as l,initial as u,syncAndInitial as d}from"../../../../../core/reactiveUtils.js";import{subclass as f}from"../../../../../core/accessorSupport/decorators.js";import{copy as p,rotateZ as m,multiply as h,invertOrIdentity as g}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{squaredLength as _}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{getReferenceEllipsoid as v}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as y}from"../../../webgl.js";import{glLayout as b}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as x}from"../OpaqueEnvironment.js";import{DeepSkyPassParameters as S,DeepSkyTechnique as C}from"./DeepSkyTechnique.js";import{StarPassParameters as w,StarsTechnique as T,layout as E}from"./StarsTechnique.js";import{getDailyRotationCoefficient as D,computeDayDuration as O,eq2ec as k,ec2eq as A}from"./starsUtils.js";import{VertexArrayObject as j}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as M,PrimitiveType as N}from"../../../../webgl/enums.js";import P
|
|
2
|
+
import{__decorate as e}from"tslib";import{fetchAsset as t}from"../../../../../assets.js";import{createTask as n}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Error.js";import i from"../../../../../core/Logger.js";import{abortMaybe as a,disposeMaybe as o}from"../../../../../core/maybe.js";import{isAbortError as s,throwIfAborted as c}from"../../../../../core/promiseUtils.js";import{watch as l,initial as u,syncAndInitial as d}from"../../../../../core/reactiveUtils.js";import{subclass as f}from"../../../../../core/accessorSupport/decorators.js";import{copy as p,rotateZ as m,multiply as h,invertOrIdentity as g}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{squaredLength as _}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{getReferenceEllipsoid as v}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as y}from"../../../webgl.js";import{glLayout as b}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as x}from"../OpaqueEnvironment.js";import{DeepSkyPassParameters as S,DeepSkyTechnique as C}from"./DeepSkyTechnique.js";import{StarPassParameters as w,StarsTechnique as T,layout as E}from"./StarsTechnique.js";import{getDailyRotationCoefficient as D,computeDayDuration as O,eq2ec as k,ec2eq as A}from"./starsUtils.js";import{VertexArrayObject as j}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as M,PrimitiveType as N}from"../../../../webgl/enums.js";import{Texture as P}from"../../../../webgl/Texture.js";import{TextureDescriptor as F}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as I}from"../../../../webgl/VertexBuffer.js";let L=class extends x{constructor(){super(...arguments),this._numPoints=0,this._passParameters=new w,this._deepSkyPassParameters=new S}initialize(){this.addHandles([l(()=>this.view.environment.starsEnabled,e=>e?this._enable():this._disable(),u),l(()=>this.view.environment.lighting.type===`virtual`?null:this.view.environment.lighting.date,e=>this._update(e),d)])}_enable(){super._enable(),this._bandTextureTask=this._createLoadBandTextureTask(),this._loadDataTask=this._createLoadDataTask()}get loading(){return!!this._loadDataTask&&!this._loadDataTask.finished||!!this._bandTextureTask&&!this._bandTextureTask.finished}destroy(){this._bandTextureTask=a(this._bandTextureTask),this._bandTexture=o(this._bandTexture),this._loadDataTask=a(this._loadDataTask),this._numPoints=0,this._vao=o(this._vao),this._starData=null}render(e){let t=e.find(({name:e})=>e===y.OPAQUE_ENVIRONMENT),n=this.techniques.getCompiled(T),r=this.techniques.getCompiled(C);if(this.loading||!n||!r)return this.requestRender(1),t;let i=this.renderingContext;return this._bandTexture&&(this._deepSkyPassParameters.bandTexture=this._bandTexture,this._deepSkyPassParameters.heightAboveSeaLevelSquared=_(this.bindParameters.camera.eye),i.bindTechnique(r,this.bindParameters,this._deepSkyPassParameters),i.setDrawBuffers([M]),i.screen.draw()),this._starData&&(this._vao??=this._ensureResources(this._starData),i.bindTechnique(n,this.bindParameters,this._passParameters),i.setDrawBuffers([M]),i.bindVAO(this._vao),i.drawArrays(N.POINTS,0,this._numPoints)),t}_ensureResources(e){this._numPoints=e.byteLength/G;let t=new Float32Array(e,0,this._numPoints*2),n=new Uint8Array(e,this._numPoints*2*4,this._numPoints);return R(this.renderingContext,t,n,this._numPoints)}_update(e){let t=v(this.view.spatialReference).radius,n=t*.05,r=t*.3;if(this._deepSkyPassParameters.radiusCloseToGround=(t+r)**2,this._deepSkyPassParameters.radiusBrightnessTransitionEnd=(t+r+n)**2,!e)return;let i=D(e),a=2*O(e),o=p(this._passParameters.modelMatrix,k);m(o,o,-a*Math.PI),h(o,A,o),m(o,o,-i*Math.PI),g(this._deepSkyPassParameters.inverseModelMatrix,o),this.requestRender(1)}_createLoadDataTask(){if(this._starData)return null;let e=n(async e=>{let{data:n}=await t(H,{responseType:`array-buffer`,signal:e});z(n),this._starData=n});return e.promise.catch(e=>{s(e)||i.getLogger(this).error(e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}_createLoadBandTextureTask(){if(this._bandTexture)return null;let e=n(async e=>{let{data:n}=await t(U,{responseType:`blob`,signal:e});c(e);let r=await createImageBitmap(n,{colorSpaceConversion:`none`,premultiplyAlpha:`none`});try{c(e);let t=new F(r.width,r.height);t.wrapMode=33071,t.maxAnisotropy=8,t.pixelFormat=6407,this._bandTexture=new P(this.renderingContext,t,r)}finally{r.close()}});return e.promise.catch(e=>{s(e)||i.getLogger(this).warn(`Failed to load Milky Way band texture.`,e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}};L=e([f(`esri.views.3d.webgl-engine.effects.stars.Stars`)],L);function R(e,t,n,r){let i=E.createBuffer(r),a=i.position,o=i.color,s=i.size;for(let e=0;e<r;e++){let r=t[e*2],i=t[e*2+1];a.set(e,0,-Math.cos(r)*Math.sin(i)),a.set(e,1,-Math.sin(r)*Math.sin(i)),a.set(e,2,-Math.cos(i));let c=V(n[e]),l=B(W[c[1]]);o.set(e,0,l[0]),o.set(e,1,l[1]),o.set(e,2,l[2]),o.set(e,3,255),s.set(e,c[0])}return new j(e,new I(e,b(E),i.buffer))}function z(e){if(!e)throw new r(`stars:no-data-received`,`Failed to create stars because star catalogue is missing`);let t=e.byteLength/G;if(t%1!=0||t>5e4||t<5e3)throw new r(`stars:invalid-data`,`Failed to create stars because star catalogue data is invalid`)}function B(e){return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function V(e){return e>=192?[2.9,e-192]:e>=160?[2.5,e-160]:e>=128?[2,e-128]:e>=96?[1.5,e-96]:e>=64?[1,e-64]:e>=32?[.7,e-32]:[.4,e]}const H=`esri/views/3d/environment/resources/stars.wsv`,U=`esri/views/3d/environment/resources/milkyway-band.avif`,W=[`9bb2ff`,`9eb5ff`,`aabfff`,`bbccff`,`ccd8ff `,`dae2ff`,`e4e9ff`,`eeefff`,`f8f6ff`,`fff9fb`,`fff5ef`,`fff1e5`,`ffeddb`,`ffe9d2`,`ffe6ca`,`ffe3c3`,`ffe0bb`,`ffddb4`,`ffdaad`,`ffd6a5`,`ffd29c`,`ffcc8f`,`ffc178`,`ffa94b`,`ff7b00`],G=9;export{L as Stars};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
function
|
|
2
|
+
import{VerticesView as e}from"./VerticesView.js";function t(e,t){return e.size===t?new n(e):null}class n extends e{constructor(e){super(e),this._attribute=e}get count(){return this._attribute.indices.length}_getOffset(e){return this._attribute.indices[e]*this._attribute.stride}}export{n as AttributeView,t as createAttributeView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Logger.js";import{getBasisTranscoder as t}from"../../../../libs/basisu/BasisUTranscoder.js";import{readKTX2TextureMetadata as n,readBasisTextureMetadata as r}from"../../../../libs/basisu/textureMetadata.js";import{CompressedTextureFormat as i,SizedPixelFormat as a}from"../../../webgl/enums.js";import o
|
|
2
|
+
import e from"../../../../core/Logger.js";import{getBasisTranscoder as t}from"../../../../libs/basisu/BasisUTranscoder.js";import{readKTX2TextureMetadata as n,readBasisTextureMetadata as r}from"../../../../libs/basisu/textureMetadata.js";import{CompressedTextureFormat as i,SizedPixelFormat as a}from"../../../webgl/enums.js";import{Texture as o}from"../../../webgl/Texture.js";import{getFormatBytesPerElement as s}from"../../../webgl/Util.js";const c=()=>e.getLogger(`esri.views.3d.webgl-engine.lib.BasisUtil`);let l=null,u=null;async function d(){return u??(u=t(),l=await u),u}function f(e,t){let n=r(e);return n?m(n,t):0}function p(e,t){let r=n(e);return r?m(r,t):0}function m({levels:e,hasAlpha:t,width:n,height:r},a){let o=s(t?i.COMPRESSED_RGBA8_ETC2_EAC:i.COMPRESSED_RGB8_ETC2),c=a&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(n*r*o*c)}function h(e){return e.getNumImages()>=1&&!e.isUASTC()}function g(e){return e.getFaces()>=1&&(e.isETC1S()||e.isUASTC())}function _(e,t,n,r){return e?n?{basisFormat:1,internalFormat:r?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}:{basisFormat:0,internalFormat:r?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2}:t?n?{basisFormat:3,internalFormat:i.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{basisFormat:2,internalFormat:i.COMPRESSED_RGB_S3TC_DXT1_EXT}:{basisFormat:13,internalFormat:r?a.SRGB8_ALPHA8:6408}}async function v(e,t,n){l??=await d();let r=new l.BasisFile(new Uint8Array(n));if(!h(r))return null;r.startTranscoding();let i=b(e,t,r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),(e,t)=>r.getImageTranscodedSizeInBytes(0,e,t),(e,t,n)=>r.transcodeImage(n,0,e,t,0,0));return r.close(),r.delete(),i}async function y(e,t,n,r=!1){l??=await d();let i=new l.KTX2File(new Uint8Array(n));if(!g(i))return null;let a=r&&i.getDFDTransferFunc()===2;i.startTranscoding();let o=b(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,n)=>i.transcodeImage(n,e,0,0,t,0,-1,-1),a);return i.close(),i.delete(),o}function b(e,t,n,r,i,a,s,c,l=!1){let{compressedTextureETC:u,compressedTextureS3TC:d}=e.capabilities,{basisFormat:f,internalFormat:p}=_(u!=null,d!=null,r,l),m=t.hasMipmap?n:Math.min(1,n),h=[];for(let e=0;e<m;e++)h.push(new Uint8Array(s(e,f))),c(e,f,h[e]);return t.internalFormat=p,t.hasMipmap=h.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=i,t.height=a,new o(e,t,{type:`compressed`,levels:h})}function x(e,t,n){let r=S(n,t.hasMipmap??!1);if(r==null)throw Error(`KTX1 texture data is null`);let{textureData:i,internalFormat:a,width:s,height:c}=r;return t.samplingMode=i.levels.length>1?9987:9729,t.hasMipmap=i.levels.length>1,t.internalFormat=a,t.width=s,t.height=c,new o(e,t,i)}function S(e,t){let n=new Uint32Array(e.buffer,e.byteOffset,16);if(n[0]!==1481919403||n[1]!==3140563232||n[2]!==169478669)return c().error(`Invalid magic number in KTX1 header`),null;if(n[3]!==67305985||n[5]!==1||n[7]!==i.COMPRESSED_RGB8_ETC2||n[8]!==6407)return c().error(`Unsupported KTX1 image`),null;let r=n[7],a=1,o=n[9],s=n[10];if(o&3||s&3)return null;let l=o,u=s;t!==!1&&(a=Math.max(1,n[14]));let d,f,p=e.byteOffset+64,m=[];for(let t=0;t<a;++t)f=(e[p]|e[p+1]<<8|e[p+2]<<16|e[p+3]<<24)>>>0,p+=4,d=new Uint8Array(e.buffer,p,f),m.push(d),p+=f,o=Math.max(1,o>>1),s=Math.max(1,s>>1);return{textureData:{type:`compressed`,levels:m},internalFormat:r,width:l,height:u}}export{g as checkKTX2,S as createKTX1TextureData,v as createTextureBasis,x as createTextureKTX1,y as createTextureKTX2,f as estimateMemoryBasis,p as estimateMemoryKTX2,d as loadBasisTranscoder,_ as selectBasisTextureFormats};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{releaseMaybe as e}from"../../../../core/maybe.js";import{signal as t}from"../../../../core/signal.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import r from"../../webgl/RenderCamera.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{CloudsParameters as a}from"../effects/clouds/CloudsParameters.js";import{ReprojectionUniforms as o}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as s}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as c}from"../lighting/SceneLighting.js";class l{constructor(e,t){this.width=e,this.height=t}}class u{constructor(e){this.shadowMap=e,this.output=0,this.slot=2,this.
|
|
2
|
+
import{releaseMaybe as e}from"../../../../core/maybe.js";import{signal as t}from"../../../../core/signal.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import r from"../../webgl/RenderCamera.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{CloudsParameters as a}from"../effects/clouds/CloudsParameters.js";import{ReprojectionUniforms as o}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as s}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as c}from"../lighting/SceneLighting.js";class l{constructor(e,t){this.width=e,this.height=t}}class u{constructor(e){this.shadowMap=e,this.output=0,this.slot=2,this.planarDistanceToGroundRatio=1,this.metersPerRenderUnit=1,this.hasOccludees=!1,this._emissions=t(0),this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=t(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.frameRendererTarget=0,this.overlayStretch=1,this.viewshedEnabled=!1,this.laserlinesEnabled=!1,this.shadowAnalysisEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this._camera=t(new r),this._inverseViewport=n(),this._oldLighting=new c,this._newLighting=new c,this._fadedLighting=new c,this._lighting=this._newLighting,this.screenSpaceReflections=new s,this.reprojection=new o,this.highlights=[],this.highlightMixOrigin=n(),this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new a,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=e(this.depth),this.shadowMap?.dispose()}get emissions(){return this._emissions.value}set emissions(e){this._emissions.value=e}get hasEmission(){switch(this.output){case 0:return this.hasOpaqueEmission;case 1:case 2:return this.hasTransparentEmission;default:return!1}}get hasOpaqueEmission(){return this.emissions===1||this.emissions===3}get hasTransparentEmission(){return this.emissions===2||this.emissions===3}get hasEmissions(){return this.emissions!==0}get camera(){return this._camera.value}set camera(e){this._camera.value=e,this._inverseViewport[0]=1/e.fullViewport[2],this._inverseViewport[1]=1/e.fullViewport[3]}get enableOITOffset(){return this.camera.relativeElevation<5e5}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(e,t,n,r){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=n,this._newLighting.set(e),this._oldLighting.updateLegacy(),r===1&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return this.frameRendererTarget!==3&&i(this.output)&&this.screenSpaceReflections.enabled&&this.reprojection.lastFrameColor!=null}get highlight(){return this.highlightLevel==null?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(e){e&&(e.name=`geometry depth`),this._depth=e}get occluder(){return this.slot===10||this.slot===11?this.slot:null}}export{u as BindParameters,l as ViewportSize};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Logger.js";import{CompressedTextureFormat as t}from"../../../webgl/enums.js";import n
|
|
2
|
+
import e from"../../../../core/Logger.js";import{CompressedTextureFormat as t}from"../../../webgl/enums.js";import{Texture as n}from"../../../webgl/Texture.js";const r=()=>e.getLogger(`esri.views.3d.webgl-engine.lib.DDSUtil`);function i(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function a(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}const o=i(`DXT1`),s=i(`DXT3`),c=i(`DXT5`);function l(e,t,r){let i=u(r,t.hasMipmap??!1);if(i==null)throw Error(`DDS texture data is null`);let{textureData:a,internalFormat:o,width:s,height:c}=i;return t.samplingMode=a.levels.length>1?9987:9729,t.hasMipmap=a.levels.length>1,t.internalFormat=o,t.width=s,t.height=c,new n(e,t,a)}function u(e,n){let i=new Int32Array(e.buffer,e.byteOffset,31);if(i[0]!==542327876)return r().error(`Invalid magic number in DDS header`),null;if(!(i[20]&4))return r().error(`Unsupported format, must contain a FourCC code`),null;let l=i[21],u,d;switch(l){case o:u=8,d=t.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case s:u=16,d=t.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case c:u=16,d=t.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return r().error(`Unsupported FourCC code:`,a(l)),null}let f=1,p=i[4],m=i[3];(p&3||m&3)&&(r().warn(`Rounding up compressed texture size to nearest multiple of 4.`),p=p+3&-4,m=m+3&-4);let h=p,g=m;i[2]&131072&&n!==!1&&(f=Math.max(1,i[7]));let _,v,y=e.byteOffset+i[1]+4,b=[];for(let t=0;t<f;++t)v=(p+3>>2)*(m+3>>2)*u,_=new Uint8Array(e.buffer,y,v),b.push(_),y+=v,p=Math.max(1,p>>1),m=Math.max(1,m>>1);return{textureData:{type:`compressed`,levels:b},internalFormat:d,width:h,height:g}}export{l as createDDSTexture,u as createDDSTextureData};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../core/maybe.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{createQuadVAO as a}from"./glUtil3D.js";import{SortedRenderGeometryRenderer as o}from"./SortedRenderGeometryRenderer.js";import{HeatmapPassParameters as s,HeatmapTechnique as c}from"../shaders/HeatmapTechnique.js";import{HeatmapTechniqueConfiguration as l}from"../shaders/HeatmapTechniqueConfiguration.js";import{PixelType as u}from"../../../webgl/enums.js";import{DisposableFramebufferObject as d}from"../../../webgl/FramebufferObject.js";import f
|
|
2
|
+
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../core/maybe.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{createQuadVAO as a}from"./glUtil3D.js";import{SortedRenderGeometryRenderer as o}from"./SortedRenderGeometryRenderer.js";import{HeatmapPassParameters as s,HeatmapTechnique as c}from"../shaders/HeatmapTechnique.js";import{HeatmapTechniqueConfiguration as l}from"../shaders/HeatmapTechniqueConfiguration.js";import{PixelType as u}from"../../../webgl/enums.js";import{DisposableFramebufferObject as d}from"../../../webgl/FramebufferObject.js";import{Texture as f}from"../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../webgl/TextureDescriptor.js";let m=class extends o{constructor(e){super(e),this.pixelRatio=1,this._colorRampData=new Uint8ClampedArray(4),this.type=`draped-heatmap`,this._passParameters=new s,this._configuration=new l;let t=new p;t.pixelFormat=e.pixelFormat,t.internalFormat=e.internalFormat,t.dataType=e.dataType,t.samplingMode=e.samplingMode,t.wrapMode=33071;let n=e.rendererContext.rctx;this._densityMap=new d(n,t),this._vao=a(n),this._configuration.usesHalfFloat=e.dataType!==u.FLOAT,e.rendererContext.pluginContext.techniques.precompile(c,this._configuration)}initialize(){let e=this._colorRampData,t=new p(e.length/4,1);t.wrapMode=33071,this._colorRamp=new f(this.rctx,t,e),this._passParameters.densityMap=this._densityMap.colorTexture,this.addHandles(n(()=>[this.colorRampData,this.minDensity,this.maxDensity,this.fieldTotal,this.pixelRatio,this.searchRadius],()=>this.rendererContext.notifyContentChanged()))}destroy(){this._densityMap=t(this._densityMap),this._vao=t(this._vao),this._colorRamp=t(this._colorRamp)}get searchRadius(){return this._passParameters.searchRadius}set searchRadius(e){e!==this._passParameters.searchRadius&&(this._passParameters.searchRadius=e,this.notifyChange(`searchRadius`))}get minDensity(){return this._passParameters.minDensity}set minDensity(e){e!==this._passParameters.minDensity&&(this._passParameters.minDensity=e,this.notifyChange(`minDensity`))}get maxDensity(){return this._passParameters.maxDensity}set maxDensity(e){e!==this._passParameters.maxDensity&&(this._passParameters.maxDensity=e,this.notifyChange(`maxDensity`))}get fieldTotal(){return this._passParameters.fieldTotal}set fieldTotal(e){this._passParameters.fieldTotal=e,this.notifyChange(`fieldTotal`)}get colorRampData(){return this._colorRampData}set colorRampData(e){let{colorRamp:t}=this._passParameters;if(t!=null&&e!==this._colorRampData){let n=t.descriptor.width,r=e.length/4;r!==n&&t.resize(r,1),t.setData(e)}this._colorRampData=e}get _colorRamp(){return this._passParameters.colorRamp}set _colorRamp(e){this._passParameters.colorRamp=e}get hasHighlights(){return!1}get hasWater(){return!1}render(e){let t=this.sortedRenderers;if(t.length===0)return;let n=this.rctx.boundFramebuffer,r=this.rctx.getViewport(),{pixelRatio:i}=this,a=Math.ceil(r.width*i),o=Math.ceil(r.height*i);this._densityMap.resize(a,o),this.rctx.bindFramebuffer(this._densityMap),this.rctx.setViewport(0,0,a,o),this.rctx.clear(16384);let s=!1;if(t.forAll(t=>{let n=t.acquireTechniques(e);n&&(t.render(e,n),s=!0)}),this.rctx.bindFramebuffer(n),this.rctx.setViewport(r.x,r.y,r.width,r.height),!s)return;this.rctx.bindVAO(this._vao);let l=this.rendererContext.pluginContext.techniques.get(c,this._configuration);this.rctx.bindTechnique(l,e.bind,this._passParameters),this.rctx.drawArrays(l.primitiveType,0,this._vao.vertexCount(`geometry`))}};e([r()],m.prototype,`searchRadius`,null),e([r()],m.prototype,`minDensity`,null),e([r()],m.prototype,`maxDensity`,null),e([r()],m.prototype,`fieldTotal`,null),e([r()],m.prototype,`pixelRatio`,void 0),e([r()],m.prototype,`colorRampData`,null),e([r({constructOnly:!0})],m.prototype,`dataType`,void 0),e([r({constructOnly:!0})],m.prototype,`samplingMode`,void 0),e([r({constructOnly:!0})],m.prototype,`pixelFormat`,void 0),e([r({constructOnly:!0})],m.prototype,`internalFormat`,void 0),e([r()],m.prototype,`_colorRampData`,void 0),m=e([i(`esri.views.3d.webgl-engine.lib.DrapedHeatmapRenderer`)],m);export{m as DrapedHeatmapRenderer};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../../core/has.js";import{disposeMaybe as t,destroyMaybe as n}from"../../../../core/maybe.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{multiply as a,fromTranslation as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as c,sub as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderNodeOutput as d}from"../../webgl.js";import{debugFlags as f}from"../../support/debugFlags.js";import{glLayout as p}from"../../support/buffer/glUtil.js";import{newLayout as m}from"../../support/buffer/InterleavedLayout.js";import h from"../../webgl/RenderNode.js";import{Pos2Locations as g}from"./DefaultVertexBufferLayouts.js";import{VertexArrayObject as _}from"./VertexArrayObject.js";import{TaskPriority as v}from"../../../support/Scheduler.js";import{Yield as y}from"../../../support/Yield.js";import{BufferObject as b}from"../../../webgl/BufferObject.js";import{PrimitiveType as x,DataType as S,PixelType as C}from"../../../webgl/enums.js";import{makePipelineState as w,defaultColorWrite as T}from"../../../webgl/renderState.js";import{Sync as E}from"../../../webgl/Sync.js";import D
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../../core/has.js";import{disposeMaybe as t,destroyMaybe as n}from"../../../../core/maybe.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{multiply as a,fromTranslation as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as c,sub as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderNodeOutput as d}from"../../webgl.js";import{debugFlags as f}from"../../support/debugFlags.js";import{glLayout as p}from"../../support/buffer/glUtil.js";import{newLayout as m}from"../../support/buffer/InterleavedLayout.js";import h from"../../webgl/RenderNode.js";import{Pos2Locations as g}from"./DefaultVertexBufferLayouts.js";import{VertexArrayObject as _}from"./VertexArrayObject.js";import{TaskPriority as v}from"../../../support/Scheduler.js";import{Yield as y}from"../../../support/Yield.js";import{BufferObject as b}from"../../../webgl/BufferObject.js";import{PrimitiveType as x,DataType as S,PixelType as C}from"../../../webgl/enums.js";import{makePipelineState as w,defaultColorWrite as T}from"../../../webgl/renderState.js";import{Sync as E}from"../../../webgl/Sync.js";import{Texture as D}from"../../../webgl/Texture.js";import{TextureDescriptor as O}from"../../../webgl/TextureDescriptor.js";import{getFormatComponents as k}from"../../../webgl/Util.js";import{fromLayout as A}from"../../../webgl/VertexAttributeLocations.js";import{VertexBuffer as j}from"../../../webgl/VertexBuffer.js";let M=class extends h{constructor(e){super(e),this.category=d.COMPOSITE,this._debugVao=null,this._debugVaoLength=0,this.readyToRun=!1,this.done=!0,this._start=!1,this._origin=u(),this._textureWidth=256,this._uploadBuffer=new Float32Array(this._textureWidth*3),this._counter=0,this._width=0,this._height=0,this._pipeline=w({colorWrite:T})}initialize(){this.addHandles(this.view.resourceController.scheduler.registerTask(v.OCCLUSION_QUERY,this)),this.produces=`disabled`,this.consumes.required=[this.category]}destroy(){this._debugVao=t(this._debugVao),this._sync=n(this._sync),this._pixelBuffer=t(this._pixelBuffer),this._texture=t(this._texture)}precompile(){this._ensureProgram(this.renderingContext),this._debug&&this._ensureDebugProgram(this.renderingContext)}render(){let e=this.input,t=this.renderingContext;if(this._debug){let n=this._ensureDebugProgram(t);t.useProgram(n),L(n,this.camera,this._origin),t.bindTexture(this._texture,1),n.setUniform1i(`positionTex`,1),t.bindFramebuffer(e.fbo),t.bindVAO(this._ensureDebugVao(t,this._width*this._height)),t.setDepthWriteEnabled(!1),t.setDepthTestEnabled(!1),n.setUniform4f(`color`,1,0,0,1),t.drawArrays(x.POINTS,0,this._counter),t.setDepthTestEnabled(!0),n.setUniform4f(`color`,0,1,0,1),t.drawArrays(x.POINTS,0,this._counter)}let n=this.gl,r=e.getTexture(n.DEPTH_STENCIL_ATTACHMENT),i=this.view.stage?.renderer.fboCache;if(!r||!i||this._sync||!this._start)return e;this._start=!1,this.produces=f.OCCLUSION_QUERY_DEBUG_PIXEL?this.category:`disabled`;let a=i.acquire(this._width,this._height,`hud visibility`,10);t.bindFramebuffer(a.fbo),t.setPipelineState(this._pipeline);let o=this._ensureProgram(t);return t.useProgram(o),L(o,this.camera,this._origin),t.bindTexture(r,0),o.setUniform1i(`depthTex`,0),t.bindTexture(this._texture,1),o.setUniform1i(`positionTex`,1),o.setUniform1i(`count`,this._counter),t.screen.draw(),this.pixelFormat??=n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT)===6403&&n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)===S.FLOAT?6403:6408,this._pixelBuffer??=b.createPixelPack(t,n.STREAM_READ),this._pixelBuffer.setSize(this._width*this._height*this._formatComponents*4),t.bindBuffer(this._pixelBuffer),n.readPixels(0,0,this._width,this._height,this.pixelFormat,S.FLOAT,0),t.unbindBuffer(35051),t.bindFramebuffer(null),a.release(),this._sync=new E(n),setTimeout(()=>this.readyToRun=!0,0),e}get _debug(){return!1}get _formatComponents(){return this.pixelFormat?k(this.pixelFormat):1}runTask(){if(!this._sync||!this._pixelBuffer)this.readyToRun=!1;else{try{if(!this._sync.poll())return y}catch{this.readyToRun=!1,this._sync=n(this._sync);return}this.readyToRun=!1,this._sync=n(this._sync),this._cpuBuffer=new Float32Array(this._width*this._height*this._formatComponents),this._pixelBuffer.getSubData(this._cpuBuffer),this.done=!0}}cancel(){this._start=!1,this._sync=n(this._sync)}init(e,t){this.cancel();let n=this._textureWidth;if(this._width=n,this._height=Math.ceil(e/n),this._counter=0,this._texture?.dispose(),this._height===0)return;let r=new O(this._width,this._height);r.pixelFormat=6407,r.dataType=C.FLOAT,r.samplingMode=9728,this._texture=new D(this.renderingContext,r),this.done=!1,c(this._origin,Math.fround(t[0]),Math.fround(t[1]),Math.fround(t[2]))}addPosition(e){let t=this._width;if(this._counter>=t*this._height)return-1;let n=this._counter%t;return l(R,e,this._origin),this._uploadBuffer[n*3+0]=R[0],this._uploadBuffer[n*3+1]=R[1],this._uploadBuffer[n*3+2]=R[2],n===t-1&&this._flush(),this._counter++}start(){if(this._width===0||this._height===0){this.done=!0;return}let e=this._width;this._counter%e>0&&this._flush(),this.produces=this.category,this._start=!0,this.requestRender(1)}getOcclusion(e){return this._cpuBuffer?.[e*this._formatComponents]??-1}get usedMemory(){return(this._texture?.usedMemory??0)+(this._pixelBuffer?.usedMemory??0)+(this._uploadBuffer?.length??0)*4+(this._cpuBuffer?.length??0)*4}_flush(){let e=this._width,t=Math.floor(this._counter/e);this._texture?.updateData(0,0,t,e,1,this._uploadBuffer)}_ensureProgram(e){return this._program??=e.programCache.get(F,I,g),this._program}_ensureDebugProgram(e){return this._debugProgram??=e.programCache.get(N,P,V),this._debugProgram}_ensureDebugVao(e,n){if(!this._debugVao||this._debugVaoLength<n){let r=new Float32Array(n);for(let e=0;e<n;e++)r[e]=e;this._debugVao=t(this._debugVao),this._debugVao=new _(e,new j(e,B,r))}return this._debugVao}};e([r()],M.prototype,`category`,void 0),e([r()],M.prototype,`pixelFormat`,void 0),e([r()],M.prototype,`_formatComponents`,null),e([r()],M.prototype,`readyToRun`,void 0),e([r()],M.prototype,`done`,void 0),M=e([i(`esri.views.3d.webgl-engine.lib.GPUPointOcclusionQuery`)],M);const N=`#version 300 es
|
|
3
3
|
precision highp float;
|
|
4
4
|
precision highp int;
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{set as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as t,scale as n,floor as r,subtract as i,set as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{positiveInfinity as o}from"../../../../geometry/support/aaBoundingBox.js";function
|
|
2
|
+
import{set as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as t,scale as n,floor as r,subtract as i,set as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{positiveInfinity as o}from"../../../../geometry/support/aaBoundingBox.js";import{gaussianSplatGridCellSize as s}from"../../support/gaussianSplatting/formatConstants.js";function c(e){return e.visibleGaussians>0&&e.orderTexture.texture!=null&&e.textureAtlas.texture!=null&&e.headerTexture.texture!=null}function l(e){return e.laserlinesEnabled||e.viewshedEnabled}function u(e){return e.viewshedEnabled}function d(n,r,i){f(n,r,i,i.eye),n.splatFading=r.data.fadingTexture.texture;let{fullHeight:a,fullWidth:o}=i,s=Math.tan(i.fovY*.5),c=s/a*o;e(n.tanFov,c,s),n.focalLength=a/(2*s),t(n.origin,i.eye)}function f(e,t,c,l){let u=t.data;e.splatOrder=u.orderTexture.texture,e.splatAtlas=u.textureAtlas.texture,e.splatHeader=u.headerTexture.texture;let{fullHeight:d,fullWidth:f}=c;e.minSplatRadius=t.view.qualitySettings.gaussianSplat.minimumPixelRadius*Math.sqrt(f*d)/1440,n(e.tileCameraPosition,l,1/s),r(e.tileCameraPosition,e.tileCameraPosition),n(e.cameraDelta,e.tileCameraPosition,s),i(e.cameraDelta,l,e.cameraDelta),e.slicePlaneLocalOrigin=l;let[p,m,h,g,_,v]=t.clippingBox||o,[y,b,x]=l;a(e.clipMinCameraRelative,p-y,m-b,h-x),a(e.clipMaxCameraRelative,g-y,_-b,v-x)}export{c as canRenderGaussianSplats,d as prepareGaussianSplatPerspectiveParameters,f as prepareGaussianSplatRenderParameters,u as requiresPreciseColorDepth,l as requiresPreciseDepth};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import{EventEmitter as t}from"../../../../core/Evented.js";import has from"../../../../core/has.js";import{disposeMaybe as n,removeMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as i,onAbort as a,createAbortError as o}from"../../../../core/promiseUtils.js";import{isUint8Array as s,isArrayBuffer as c,isTypedArray as l}from"../../../../core/typedArrayUtil.js";import{generateUID as u}from"../../../../core/uid.js";import{isBlobProtocol as d,isDataProtocol as f}from"../../../../core/urlUtils.js";import{whenVideoPlayable as p}from"../../../../layers/support/videoUtils.js";import{requestImage as m}from"../../../../request/image.js";import{loadImage as h}from"../../../../request/loadImage.js";import{createTextureKTX1 as g,createTextureKTX2 as _,createTextureBasis as v,estimateMemoryKTX2 as y,estimateMemoryBasis as b}from"./BasisUtil.js";import{createDDSTexture as x}from"./DDSUtil.js";import{ensureImageMaxSize as S}from"./textureUtils.js";import{assert as C}from"./Util.js";import w
|
|
2
|
+
import e from"../../../../core/Error.js";import{EventEmitter as t}from"../../../../core/Evented.js";import has from"../../../../core/has.js";import{disposeMaybe as n,removeMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as i,onAbort as a,createAbortError as o}from"../../../../core/promiseUtils.js";import{isUint8Array as s,isArrayBuffer as c,isTypedArray as l}from"../../../../core/typedArrayUtil.js";import{generateUID as u}from"../../../../core/uid.js";import{isBlobProtocol as d,isDataProtocol as f}from"../../../../core/urlUtils.js";import{whenVideoPlayable as p}from"../../../../layers/support/videoUtils.js";import{requestImage as m}from"../../../../request/image.js";import{loadImage as h}from"../../../../request/loadImage.js";import{createTextureKTX1 as g,createTextureKTX2 as _,createTextureBasis as v,estimateMemoryKTX2 as y,estimateMemoryBasis as b}from"./BasisUtil.js";import{createDDSTexture as x}from"./DDSUtil.js";import{ensureImageMaxSize as S}from"./textureUtils.js";import{assert as C}from"./Util.js";import{Texture as w}from"../../../webgl/Texture.js";import{TextureDescriptor as T}from"../../../webgl/TextureDescriptor.js";import{isCompressedFormat as E,isSizedPixelFormat as D,isSizedDepthFormat as O,isSizedDepthStencilFormat as k}from"../../../webgl/textureUtils.js";import{getFormatComponents as A}from"../../../webgl/Util.js";const j=!!has(`esri-tests-disable-gpu-memory-measurements`);class M{constructor(e,n){this._data=e,this.id=u(),this.events=new t,this._parameters={...F,...n},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!d(e.src)&&(e.preload!==`auto`||!e.crossOrigin)&&(e.preload=`auto`,e.crossOrigin=`anonymous`,e.src=e.src,e.paused&&e.autoplay)){let t=[];p(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){f(e.src)||d(e.src)||e.crossOrigin||(e.crossOrigin=`anonymous`,e.src=e.src)}_createDescriptor(e){let t=new T;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t.isImmutable=this._parameters.immutable===!0&&I(this._parameters.internalFormat),t}get texture(){return this._texture??this._emptyTexture}get loaded(){return this._texture!=null}get usedMemory(){return j?0:this._texture?.usedMemory??N(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;let t=this._data;return t==null?(this._texture=new w(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),typeof t==`string`?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):s(t)&&this._parameters.encoding===`image/vnd-ms.dds`?this._loadFromDDSData(e,t):c(t)&&this._parameters.encoding===`image/vnd-ms.dds`?this._loadFromDDSData(e,new Uint8Array(t)):s(t)&&this._parameters.encoding===`image/ktx`?this._loadFromKTX1(e,t):c(t)&&this._parameters.encoding===`image/ktx`?this._loadFromKTX1(e,new Uint8Array(t)):(c(t)||s(t))&&this._parameters.encoding===`image/ktx2`?this._loadFromKTX2(e,t):(c(t)||s(t))&&this._parameters.encoding===`image/x.basis`?this._loadFromBasis(e,t):c(t)?this._loadFromPixelData(e,new Uint8Array(t)):l(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return this._texture==null||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=x(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX1(e,t){return this._texture=g(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>_(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>v(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){C(this._parameters.width>0&&this._parameters.height>0);let n=this._createDescriptor(e);return(n.pixelFormat===6407||n.pixelFormat===6408)&&(n.compress=this._parameters.compressionOptions),n.width=this._parameters.width??0,n.height=this._parameters.height??0,this._texture=new w(e,n,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async n=>{let r=await m(t,{signal:n});return i(n),this._loadFromImage(e,r)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async n=>{let r=await h(t,t.src,!1,n);return i(n),this._loadFromImage(e,r)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(t,n){return this._loadAsync(i=>new Promise((s,c)=>{let l=()=>{n.removeEventListener(`loadeddata`,u),n.removeEventListener(`error`,d),r(f)},u=()=>{n.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),s(this._loadFromImage(t,n)))},d=t=>{l(),c(t||new e(`texture:load-error`,`Failed to load video`))};n.addEventListener(`loadeddata`,u),n.addEventListener(`error`,d);let f=a(i,()=>d(o()))}))}_loadFromImage(e,t){let n=t;n instanceof HTMLVideoElement||(n=S(n,e.parameters));let r=P(n);this._parameters.width=r.width,this._parameters.height=r.height;let i=this._createDescriptor(e);return i.width=r.width,i.height=r.height,i.compress=this._parameters.compressionOptions,this._texture=new w(e,i,n),this._emptyTexture=null,this.events.emit(`loaded`),this._texture}_loadAsync(e){let t=new AbortController;this._loadingController=t;let n=e(t.signal);this._loadingPromise=n;let r=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===n&&(this._loadingPromise=null),this._emptyTexture=null};return n.then(r,r),n}unload(){if(this._texture=n(this._texture),this._emptyTexture=null,this._loadingController!=null){let e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit(`unloaded`)}get parameters(){return this._parameters}}function N(e,t){if(e==null)return 0;if(c(e)||s(e))return t.encoding===`image/ktx2`?y(e,!!t.mipmap):t.encoding===`image/x.basis`?b(e,!!t.mipmap):e.byteLength;let{width:n,height:r}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?P(e):t,i=t.pixelFormat??6408,a=A(i);return(t.mipmap?4/3:1)*n*r*a||0}function P(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const F={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1};function I(e){return e!=null&&(E(e)||D(e)||O(e)||k(e))}export{M as ManagedTexture};
|