@arcgis/core 5.2.0-next.76 → 5.2.0-next.78
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/{dbdd96e558936955acdb.js → 040a73b2a23577e1eabd.js} +1 -1
- package/assets/esri/core/workers/chunks/{bad2c7219e95750906e1.js → 05663093b1d2a268b953.js} +1 -1
- package/assets/esri/core/workers/chunks/{755b2d883fba90c4e688.js → 06c8547521ce9c97b258.js} +2 -2
- package/assets/esri/core/workers/chunks/{a014c17fc210620da738.js → 17e9324a02b69733307a.js} +2 -2
- package/assets/esri/core/workers/chunks/29a20a37e7837142fa6b.js +2 -0
- package/assets/esri/core/workers/chunks/{4945d6b0ca1812864185.js → 385b23d4bd5275031fb6.js} +1 -1
- package/assets/esri/core/workers/chunks/3958d92c737b3a2a3bc2.js +1 -0
- package/assets/esri/core/workers/chunks/{9c3e6325dc60bcaf44d7.js → 4115bab15c19b4f5ae08.js} +1 -1
- package/assets/esri/core/workers/chunks/{ff578f0ca68d652fece5.js → 57e26a86d46e02c89c4f.js} +1 -1
- package/assets/esri/core/workers/chunks/{8b980c6b92cc4ea68ede.js → 81cd0cb9ae1371765d32.js} +1 -1
- package/assets/esri/core/workers/chunks/{de927b1460bc384f5b87.js → 83556c9f6f85c2a46779.js} +1 -1
- package/assets/esri/core/workers/chunks/{f4aa6e90200f61e623e5.js → 8762da315cf5086167c3.js} +1 -1
- package/assets/esri/core/workers/chunks/{46e56fac44e0fd26ba1d.js → 95956d62591d689f1135.js} +1 -1
- package/assets/esri/core/workers/chunks/{9e2e4d197a7a57c2a691.js → ac2ba5c3d613d7d5183a.js} +1 -1
- package/assets/esri/core/workers/chunks/{94b9a61b4dbb83425a78.js → b2812279662f1a5f8d06.js} +1 -1
- package/assets/esri/core/workers/chunks/b82763e9401b16121f8d.js +2 -0
- package/assets/esri/core/workers/chunks/{83e54166ba634ec2bd89.js → c69cf08da4e4c2c824ee.js} +10 -10
- package/assets/esri/core/workers/chunks/{6c740c411b085d2d08c4.js → cd74de12005834244a47.js} +1 -1
- package/assets/esri/core/workers/chunks/{6e45ecf359bce3417f5d.js → ef803fb25741e9f2a0a1.js} +1 -1
- package/assets/esri/core/workers/chunks/f3bbebedad51f776bb98.js +1 -0
- package/assets/esri/core/workers/chunks/{a91c1d782346a9c7e1ef.js → f703bc002c732d1c045d.js} +1 -1
- package/assets/esri/core/workers/chunks/fdd4f78facec6387cdb0.js +1 -0
- package/assets/esri/core/workers/chunks/ffd5285c7b2c83208f87.js +2 -0
- package/config.js +1 -1
- package/geometry/support/webMercatorUtils.d.ts +38 -14
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/VectorTileLayer.d.ts +40 -22
- package/layers/mixins/RasterJobHandlerMixin.js +1 -1
- package/layers/support/RasterJobHandler.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/package.json +4 -4
- package/support/revision.js +1 -1
- package/views/2d/engine/BitmapTile.js +1 -1
- package/views/2d/engine/flow/styles/Imagery.js +1 -1
- package/views/2d/engine/flow/styles/Particles.js +1 -1
- package/views/2d/engine/flow/styles/Streamlines.js +1 -1
- package/views/2d/engine/imagery/RasterTile.js +1 -1
- package/views/2d/engine/imagery/RasterVFTile.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
- package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
- package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/RenderingDevice.js +1 -1
- package/views/2d/engine/webgl/TileContainer.js +1 -1
- package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
- package/views/2d/engine/webgl/normalizedTileUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/bitmap/BitmapTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPointShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/flow/FlowTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/VectorFieldTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitmapShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/Tile.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileInfo.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterColorizerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/MagDirShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/ScalarShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderBackground.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderCircle.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderFill.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderIcon.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderLine.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderOutline.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderText.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileStencilTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/utility/DebugOverlayTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/support/DisplayGL.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/state/HUDOccludedFragmentOpacity.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/support/GaussianSplatSortWorker.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/PatchRenderDataWaterproofness.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TerrainWaterproofnessDiagnostics.js +2 -0
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/support/waitForResources.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/UniformBufferLayout.js +1 -1
- package/views/webgl/UniformBufferObject.js +1 -1
- package/widgets/Feature/FeatureViewModel.d.ts +4 -3
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/Features/FeaturesViewModel.d.ts +4 -2
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/Popup/PopupViewModel.d.ts +1 -0
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/assets/esri/core/workers/chunks/0502641d9a214b37ff29.js +0 -1
- package/assets/esri/core/workers/chunks/4f8ce5887102971bfa34.js +0 -2
- package/assets/esri/core/workers/chunks/532e3a59888e4cc13bd3.js +0 -2
- package/assets/esri/core/workers/chunks/a19be304219808268039.js +0 -2
- package/assets/esri/core/workers/chunks/b950ddafba8125c84a5b.js +0 -1
- package/assets/esri/core/workers/chunks/de9a1cce70581920f248.js +0 -1
- package/views/2d/engine/webgl/shaderGraph/types.js +0 -2
- package/views/2d/engine/webgl/shaderGraph/uniformBufferUtils.js +0 -2
- /package/assets/esri/core/workers/chunks/{755b2d883fba90c4e688.js.LICENSE.txt → 06c8547521ce9c97b258.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{a014c17fc210620da738.js.LICENSE.txt → 17e9324a02b69733307a.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{4f8ce5887102971bfa34.js.LICENSE.txt → 29a20a37e7837142fa6b.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{a19be304219808268039.js.LICENSE.txt → b82763e9401b16121f8d.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{532e3a59888e4cc13bd3.js.LICENSE.txt → ffd5285c7b2c83208f87.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.78",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"type": "module",
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@amcharts/amcharts5": "~5.20.
|
|
23
|
-
"@arcgis/toolkit": "^5.2.0-next.
|
|
22
|
+
"@amcharts/amcharts5": "~5.20.2",
|
|
23
|
+
"@arcgis/toolkit": "^5.2.0-next.73",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
25
25
|
"@esri/calcite-components": "^5.2.0-next.43",
|
|
26
|
-
"@vaadin/grid": "~25.2.
|
|
26
|
+
"@vaadin/grid": "~25.2.8",
|
|
27
27
|
"@zip.js/zip.js": "~2.8.34",
|
|
28
28
|
"luxon": "~3.7.2",
|
|
29
29
|
"marked": "~18.0.9",
|
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const c="20260816",f="536f4c6f959aa1765dc3376cc1190ff951b08e49";export{c as buildDate,f as commitHash};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{Bitmap as t}from"./Bitmap.js";import{TiledDisplayObject as s}from"./webgl/TiledDisplayObject.js";class
|
|
2
|
+
import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{Bitmap as t}from"./Bitmap.js";import{TiledDisplayObject as s}from"./webgl/TiledDisplayObject.js";class i extends s{constructor(e,s,i,r,a,o,n=null){super(e,s,i,r,a,o),this.bitmap=new t(n),this.bitmap.coordScale=[a,o],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy()}beforeRender(e){this.bitmap.beforeRender(e),super.beforeRender(e)}afterRender(e){this.bitmap.afterRender(e),super.afterRender(e)}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{displayViewScreenMat3:e(),tileMat3:e()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}}export{i as BitmapTile};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{timeExtentsEqual as a,getFlowFloatUniforms as e,getFlowColorUniforms as s}from"../utils.js";import{AFlowResources as r}from"./AFlowResources.js";import{Mesh as i}from"../../webgl/meshing/Mesh.js";import{FlowImageryShader as o}from"../../webgl/shaderGraph/techniques/shaders/flow/FlowImageryShader.js";import{PrimitiveType as m,DataType as n}from"../../../../webgl/enums.js";import l from"../../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../../webgl/TextureDescriptor.js";import{VertexElementDescriptor as h}from"../../../../webgl/VertexElementDescriptor.js";class c{constructor(t){this._params=t,this.supportsContinuation=!1,this.slideoutDuration=0,this.animated=!1}isCompatible(t){if(!(t instanceof c))return!1;if(!a(this._params.timeExtent,t._params.timeExtent))return!1;let e=!0;return e=e&&this._params.loadImagery===t._params.loadImagery,e=e&&this._params.color.kind===t._params.color.kind,e=e&&this._params.opacity.kind===t._params.opacity.kind,e}updateResource(t){t.update(this._params.color,this._params.opacity)}async load(a,e,s){const{extent:r,size:i}=a;t(s);const o=await this._params.loadImagery(r,i[0],i[1],this._params.timeExtent,s);return new d(o,a,[],o,{color:this._params.color,opacity:this._params.opacity})}}const u=[new h("position",2,n.UNSIGNED_SHORT,0,8),new h("texcoord",2,n.UNSIGNED_SHORT,4,8)];class d extends r{static{this._shader=new o}constructor(t,a,e,s,r){super(a,e,s),this._flowData=t,this._values=r,this.kind="imagery"}attach(t){const{context:a}=t,{width:e,height:s}=this._flowData;this.mesh=new i(a,{vertex:{geometry:{data:new Uint16Array([0,0,0,1,e,0,1,1,0,s,0,0,e,s,1,0]),layout:u}},groups:[{primitive:m.TRIANGLE_STRIP}],parts:[{group:0,start:0,count:4}]});let r=1e6,o=-1e6;for(let i=0;i<s;i++)for(let t=0;t<e;t++)if(0!==this._flowData.mask[i*e+t]){const a=this._flowData.data[2*(i*e+t)],s=this._flowData.data[2*(i*e+t)+1],m=Math.sqrt(a*a+s*s);r=Math.min(r,m),o=Math.max(o,m)}const n=new Uint8Array(4*e*s);for(let i=0;i<s;i++)for(let t=0;t<e;t++)if(0!==this._flowData.mask[i*e+t]){const a=this._flowData.data[2*(i*e+t)],s=this._flowData.data[2*(i*e+t)+1],m=(Math.sqrt(a*a+s*s)-r)/(o-r);n[4*(i*e+t)]=255*m,n[4*(i*e+t)+1]=0,n[4*(i*e+t)+2]=0,n[4*(i*e+t)+3]=255}else n[4*(i*e+t)]=0,n[4*(i*e+t)+1]=0,n[4*(i*e+t)+2]=0,n[4*(i*e+t)+3]=0;const h=new p(e,s);h.internalFormat=6408,h.wrapMode=33071,h.flipped=!0;const c=new l(a,h,n);this.texture=c,this.min=r,this.max=o,this._flowData=null}detach(){this.mesh.destroy(),this.texture.dispose()}get ready(){return!0}update(t,a){this._values={color:t,opacity:a}}getProgramSpec(t){return{shader:d._shader,uniforms:{transform:{localToScreenMat3:t.localToScreenMat3},state:{time:t.time,displayOpacity:t.displayOpacity,startTime:t.startTime,endTime:t.endTime},config:{min:this.min,max:this.max},color:s(this._values.color),opacity:e(this._values.opacity)},textures:{texture:{texture:this.texture,unit:0}},defines:{vvColor:"ramp"===this._values.color.kind,vvOpacity:"ramp"===this._values.opacity.kind},optionalAttributes:null}}}export{c as Imagery,d as ImageryResources};
|
|
2
|
+
import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{timeExtentsEqual as a,getFlowFloatUniforms as e,getFlowColorUniforms as s}from"../utils.js";import{AFlowResources as r}from"./AFlowResources.js";import{Mesh as i}from"../../webgl/meshing/Mesh.js";import{FlowImageryShader as o}from"../../webgl/shaderGraph/techniques/shaders/flow/FlowImageryShader.js";import{PrimitiveType as m,DataType as n}from"../../../../webgl/enums.js";import l from"../../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../../webgl/TextureDescriptor.js";import{VertexElementDescriptor as h}from"../../../../webgl/VertexElementDescriptor.js";class c{constructor(t){this._params=t,this.supportsContinuation=!1,this.slideoutDuration=0,this.animated=!1}isCompatible(t){if(!(t instanceof c))return!1;if(!a(this._params.timeExtent,t._params.timeExtent))return!1;let e=!0;return e=e&&this._params.loadImagery===t._params.loadImagery,e=e&&this._params.color.kind===t._params.color.kind,e=e&&this._params.opacity.kind===t._params.opacity.kind,e}updateResource(t){t.update(this._params.color,this._params.opacity)}async load(a,e,s){const{extent:r,size:i}=a;t(s);const o=await this._params.loadImagery(r,i[0],i[1],this._params.timeExtent,s);return new d(o,a,[],o,{color:this._params.color,opacity:this._params.opacity})}}const u=[new h("position",2,n.UNSIGNED_SHORT,0,8),new h("texcoord",2,n.UNSIGNED_SHORT,4,8)];class d extends r{static{this._shader=new o}constructor(t,a,e,s,r){super(a,e,s),this._flowData=t,this._values=r,this.kind="imagery"}attach(t){const{context:a}=t,{width:e,height:s}=this._flowData;this.mesh=new i(a,{vertex:{geometry:{data:new Uint16Array([0,0,0,1,e,0,1,1,0,s,0,0,e,s,1,0]),layout:u}},groups:[{primitive:m.TRIANGLE_STRIP}],parts:[{group:0,start:0,count:4}]});let r=1e6,o=-1e6;for(let i=0;i<s;i++)for(let t=0;t<e;t++)if(0!==this._flowData.mask[i*e+t]){const a=this._flowData.data[2*(i*e+t)],s=this._flowData.data[2*(i*e+t)+1],m=Math.sqrt(a*a+s*s);r=Math.min(r,m),o=Math.max(o,m)}const n=new Uint8Array(4*e*s);for(let i=0;i<s;i++)for(let t=0;t<e;t++)if(0!==this._flowData.mask[i*e+t]){const a=this._flowData.data[2*(i*e+t)],s=this._flowData.data[2*(i*e+t)+1],m=(Math.sqrt(a*a+s*s)-r)/(o-r);n[4*(i*e+t)]=255*m,n[4*(i*e+t)+1]=0,n[4*(i*e+t)+2]=0,n[4*(i*e+t)+3]=255}else n[4*(i*e+t)]=0,n[4*(i*e+t)+1]=0,n[4*(i*e+t)+2]=0,n[4*(i*e+t)+3]=0;const h=new p(e,s);h.internalFormat=6408,h.wrapMode=33071,h.flipped=!0;const c=new l(a,h,n);this.texture=c,this.min=r,this.max=o,this._flowData=null}detach(){this.mesh.destroy(),this.texture.dispose()}get ready(){return!0}update(t,a){this._values={color:t,opacity:a}}getProgramSpec(t){return{shader:d._shader,uniforms:{view:t.view,transform:{localToScreenMat3:t.localToScreenMat3},state:{time:t.time,displayOpacity:t.displayOpacity,startTime:t.startTime,endTime:t.endTime},config:{min:this.min,max:this.max},color:s(this._values.color),opacity:e(this._values.opacity)},textures:{texture:{texture:this.texture,unit:0}},defines:{vvColor:"ramp"===this._values.color.kind,vvOpacity:"ramp"===this._values.opacity.kind},optionalAttributes:null}}}export{c as Imagery,d as ImageryResources};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{deserializeFlowPaths as
|
|
2
|
+
import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{deserializeFlowPaths as e}from"../flowPathsIO.js";import{areStreamlinesCompatible as s,getFlowFloatUniforms as a,getFlowColorUniforms as i}from"../utils.js";import{AFlowResources as r}from"./AFlowResources.js";import{Mesh as o}from"../../webgl/meshing/Mesh.js";import{FlowParticlesShader as n}from"../../webgl/shaderGraph/techniques/shaders/flow/FlowParticlesShader.js";import{getPositions as p}from"../../../../support/flow/utils.js";import{PrimitiveType as m,DataType as h}from"../../../../webgl/enums.js";import{VertexElementDescriptor as l}from"../../../../webgl/VertexElementDescriptor.js";class c{constructor(t){this._params=t,this.supportsContinuation=!1,this.slideoutDuration=0}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof c&&s(this._params,t._params)}updateResource(t){t.update(this._params)}async load(s,a,i){const{extent:r,size:o}=s;t(i);const n=await this._params.loadImagery(r,o[0],o[1],this._params.timeExtent,i),m={...n,data:n.data.slice(),mask:n.mask?.slice()},h=a&&this._params.simulationSettings.continuous?p(a.flowPaths,a.query,s,this._params.flowSpeed):[],{vertexData:l,indexData:c,pathData:d}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,n,{positions:h},i),_=e(d);return new u(l,c,s,_,m,this._params)}}const d=[new l("xyts0",4,h.FLOAT,0,64),new l("xyts1",4,h.FLOAT,16,64),new l("typeIdFirstTimeLastTime",4,h.FLOAT,32,64),new l("extrudeInfo",4,h.FLOAT,48,64)];class u extends r{static{this._shader=new n}constructor(t,e,s,a,i,r){super(s,a,i),this._vertexData=t,this._indexData=e,this._params=r,this.kind="particles",this.update(r)}attach(t){const{context:e}=t;this.mesh=new o(e,{vertex:{geometry:{data:this._vertexData,layout:d}},index:{indices:{data:this._indexData}},groups:[{index:"indices",primitive:m.TRIANGLES}],parts:[{group:0,start:0,count:this._indexData.length}]}),this._vertexData=null,this._indexData=null}detach(){this.mesh.destroy()}get ready(){return!0}update(t){this._params=t,this._values={color:this._params.color,opacity:this._params.opacity,size:this._params.size}}getProgramSpec(t){return{shader:u._shader,uniforms:{view:t.view,transform:{localToScreenMat3:t.localToScreenMat3},state:{time:t.time,displayOpacity:t.displayOpacity,startTime:t.startTime,endTime:t.endTime},config:{trailLength:this._params.trailLength,flowSpeed:this._params.flowSpeed,featheringSize:this._params.featheringSize,featheringOffset:this._params.featheringOffset,introFade:this._params.introFade?1:0,fadeToZero:this._params.fadeToZero?1:0,decayRate:this._params.decayRate},color:i(this._values.color),opacity:a(this._values.opacity),size:a(this._values.size)},textures:{},defines:{vvColor:"ramp"===this._values.color.kind,vvOpacity:"ramp"===this._values.opacity.kind,vvSize:"ramp"===this._values.size.kind},optionalAttributes:null}}}export{c as Particles,u as ParticlesResources};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{deserializeFlowPaths as e}from"../flowPathsIO.js";import{areStreamlinesCompatible as s,getFlowFloatUniforms as a,getFlowColorUniforms as i}from"../utils.js";import{AFlowResources as r}from"./AFlowResources.js";import{Mesh as o}from"../../webgl/meshing/Mesh.js";import{FlowStreamlinesShader as n}from"../../webgl/shaderGraph/techniques/shaders/flow/FlowStreamlinesShader.js";import{getPositions as m}from"../../../../support/flow/utils.js";import{PrimitiveType as p,DataType as h}from"../../../../webgl/enums.js";import{VertexElementDescriptor as l}from"../../../../webgl/VertexElementDescriptor.js";class d{constructor(t){this._params=t,this.supportsContinuation=!1,this.slideoutDuration=20}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof d&&s(this._params,t._params)}updateResource(t){t.update(this._params)}async load(s,a,i){const{extent:r,size:o}=s;t(i);const n=await this._params.loadImagery(r,o[0],o[1],this._params.timeExtent,i),p={...n,data:n.data.slice(),mask:n.mask?.slice()},h=a&&this._params.simulationSettings.continuous?m(a.flowPaths,a.query,s,this._params.flowSpeed):[],{vertexData:l,indexData:d,pathData:u}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,n,{positions:h},i),_=e(u);return new c(l,d,s,_,p,this._params)}}const u=[new l("positionAndSide",3,h.FLOAT,0,36),new l("timeInfo",3,h.FLOAT,12,36),new l("extrude",2,h.FLOAT,24,36),new l("speed",1,h.FLOAT,32,36)];class c extends r{static{this._shader=new n}constructor(t,e,s,a,i,r){super(s,a,i),this._vertexData=t,this._indexData=e,this._params=r,this.kind="streamlines",this.update(r)}attach(t){const{context:e}=t;this.mesh=new o(e,{vertex:{geometry:{data:this._vertexData,layout:u}},index:{indices:{data:this._indexData}},groups:[{index:"indices",primitive:p.TRIANGLES}],parts:[{group:0,start:0,count:this._indexData.length}]}),this._vertexData=null,this._indexData=null}detach(){this.mesh.destroy()}get ready(){return!0}update(t){this._params=t,this._values={color:this._params.color,opacity:this._params.opacity,size:this._params.size}}getProgramSpec(t){return{shader:c._shader,uniforms:{transform:{localToScreenMat3:t.localToScreenMat3},state:{time:t.time-this.query.time,displayOpacity:t.displayOpacity,startTime:t.startTime-this.query.time,endTime:t.endTime-this.query.time},config:{trailLength:this._params.trailLength,flowSpeed:this._params.flowSpeed,featheringSize:this._params.featheringSize,featheringOffset:this._params.featheringOffset,introFade:this._params.introFade?1:0,fadeToZero:this._params.fadeToZero?1:0,decayRate:this._params.decayRate},color:i(this._values.color),opacity:a(this._values.opacity),size:a(this._values.size)},textures:{},defines:{vvColor:"ramp"===this._values.color.kind,vvOpacity:"ramp"===this._values.opacity.kind,vvSize:"ramp"===this._values.size.kind},optionalAttributes:null}}}export{d as default};
|
|
2
|
+
import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{deserializeFlowPaths as e}from"../flowPathsIO.js";import{areStreamlinesCompatible as s,getFlowFloatUniforms as a,getFlowColorUniforms as i}from"../utils.js";import{AFlowResources as r}from"./AFlowResources.js";import{Mesh as o}from"../../webgl/meshing/Mesh.js";import{FlowStreamlinesShader as n}from"../../webgl/shaderGraph/techniques/shaders/flow/FlowStreamlinesShader.js";import{getPositions as m}from"../../../../support/flow/utils.js";import{PrimitiveType as p,DataType as h}from"../../../../webgl/enums.js";import{VertexElementDescriptor as l}from"../../../../webgl/VertexElementDescriptor.js";class d{constructor(t){this._params=t,this.supportsContinuation=!1,this.slideoutDuration=20}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof d&&s(this._params,t._params)}updateResource(t){t.update(this._params)}async load(s,a,i){const{extent:r,size:o}=s;t(i);const n=await this._params.loadImagery(r,o[0],o[1],this._params.timeExtent,i),p={...n,data:n.data.slice(),mask:n.mask?.slice()},h=a&&this._params.simulationSettings.continuous?m(a.flowPaths,a.query,s,this._params.flowSpeed):[],{vertexData:l,indexData:d,pathData:u}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,n,{positions:h},i),_=e(u);return new c(l,d,s,_,p,this._params)}}const u=[new l("positionAndSide",3,h.FLOAT,0,36),new l("timeInfo",3,h.FLOAT,12,36),new l("extrude",2,h.FLOAT,24,36),new l("speed",1,h.FLOAT,32,36)];class c extends r{static{this._shader=new n}constructor(t,e,s,a,i,r){super(s,a,i),this._vertexData=t,this._indexData=e,this._params=r,this.kind="streamlines",this.update(r)}attach(t){const{context:e}=t;this.mesh=new o(e,{vertex:{geometry:{data:this._vertexData,layout:u}},index:{indices:{data:this._indexData}},groups:[{index:"indices",primitive:p.TRIANGLES}],parts:[{group:0,start:0,count:this._indexData.length}]}),this._vertexData=null,this._indexData=null}detach(){this.mesh.destroy()}get ready(){return!0}update(t){this._params=t,this._values={color:this._params.color,opacity:this._params.opacity,size:this._params.size}}getProgramSpec(t){return{shader:c._shader,uniforms:{view:t.view,transform:{localToScreenMat3:t.localToScreenMat3},state:{time:t.time-this.query.time,displayOpacity:t.displayOpacity,startTime:t.startTime-this.query.time,endTime:t.endTime-this.query.time},config:{trailLength:this._params.trailLength,flowSpeed:this._params.flowSpeed,featheringSize:this._params.featheringSize,featheringOffset:this._params.featheringOffset,introFade:this._params.introFade?1:0,fadeToZero:this._params.fadeToZero?1:0,decayRate:this._params.decayRate},color:i(this._values.color),opacity:a(this._values.opacity),size:a(this._values.size)},textures:{},defines:{vvColor:"ramp"===this._values.color.kind,vvOpacity:"ramp"===this._values.opacity.kind,vvSize:"ramp"===this._values.size.kind},optionalAttributes:null}}}export{d as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{RasterBitmap as e}from"./RasterBitmap.js";import{TiledDisplayObject as s}from"../webgl/TiledDisplayObject.js";class i extends s{constructor(t,s,i,a,r,l,n=null){super(t,s,i,a,r,l),this.bitmap=null,this.bitmap=new e(n,null,null),this.bitmap.coordScale=[r,l],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy(),this.bitmap=null,this.stage=null}set stencilRef(t){this.bitmap.stencilRef=t}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{displayViewScreenMat3:t(),tileMat3:t()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){
|
|
2
|
+
import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{RasterBitmap as e}from"./RasterBitmap.js";import{TiledDisplayObject as s}from"../webgl/TiledDisplayObject.js";class i extends s{constructor(t,s,i,a,r,l,n=null){super(t,s,i,a,r,l),this.bitmap=null,this.bitmap=new e(n,null,null),this.bitmap.coordScale=[r,l],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy(),this.bitmap=null,this.stage=null}set stencilRef(t){this.bitmap.stencilRef=t}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{displayViewScreenMat3:t(),tileMat3:t()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}}export{i as RasterTile};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{RasterVFDisplayObject as e}from"./RasterVFDisplayObject.js";import{TiledDisplayObject as s}from"../webgl/TiledDisplayObject.js";class a extends s{constructor(t,s,a,i,l,r,o=null){super(t,s,a,i,l,r),this.tileData=new e(o),this.tileData.coordScale=[l,r],this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(t){this.tileData.stencilRef=t}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{displayViewScreenMat3:t(),tileMat3:t()}}onAttach(){this.tileData.stage=this.stage}onDetach(){
|
|
2
|
+
import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{RasterVFDisplayObject as e}from"./RasterVFDisplayObject.js";import{TiledDisplayObject as s}from"../webgl/TiledDisplayObject.js";class a extends s{constructor(t,s,a,i,l,r,o=null){super(t,s,a,i,l,r),this.tileData=new e(o),this.tileData.coordScale=[l,r],this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(t){this.tileData.stencilRef=t}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{displayViewScreenMat3:t(),tileMat3:t()}}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}}export{a as RasterVFTile};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{MinPriority as e}from"../../../../core/MemCache.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{create as o}from"../../../../geometry/support/aaBoundingRect.js";import{tileSizeInPixels as s}from"./constants.js";import{TileHandler as r}from"./TileHandler.js";import{VectorTile as n}from"./VectorTile.js";import l from"../../tiling/TileInfoViewPOT.js";import a from"../../tiling/TileKey.js";class h extends r{constructor(e,t,i,o,s){super(e,t,i,e.tileInfo.lods.length-1,o),this._memCache=s,this.type="TileHandler3D",this._vectorTiles=new Map,this._ongoingTileRequests=new Map,this._ongoingRequestToController=new Map,this.
|
|
2
|
+
import{MinPriority as e}from"../../../../core/MemCache.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{create as o}from"../../../../geometry/support/aaBoundingRect.js";import{tileSizeInPixels as s}from"./constants.js";import{TileHandler as r}from"./TileHandler.js";import{VectorTile as n}from"./VectorTile.js";import l from"../../tiling/TileInfoViewPOT.js";import a from"../../tiling/TileKey.js";class h extends r{constructor(e,t,i,o,s){super(e,t,i,e.tileInfo.lods.length-1,o),this._memCache=s,this.type="TileHandler3D",this._vectorTiles=new Map,this._ongoingTileRequests=new Map,this._ongoingRequestToController=new Map,this._tileInfoView=new l(e.tileInfo,e.fullExtent)}destroy(){super.destroy(),this._ongoingRequestToController.forEach(e=>e.abort()),this._ongoingRequestToController.clear(),this._ongoingTileRequests.clear(),this._vectorTiles.clear()}async getVectorTile(r,l){const h=new a(r[0],r[1],r[2],0);let g=this._vectorTiles.get(h.id)??this._memCache.get(h.id);if(g)return g.retain(),g;const c=await this._getVectorTileData(h);if(t(l),!this._layer)return null;if(g=this._vectorTiles.get(h.id)??this._memCache.get(h.id),g)return g.retain(),g;const T=this._layer.tileInfo.getTileBounds(o(),h),m=this._tileInfoView.getTileResolution(r[0]);return g=new n(h,m,T[0],T[3],s,s,this._styleRepository,this),g.setData(c),c&&(g.retain(),this._memCache.put(h.id,g,e),this._vectorTiles.set(h.id,g)),g.neededForCoverage=!0,g.transforms.tileUnitsToPixels=i(1/8,0,0,0,1/8,0,0,0,1),g}updateTileSize(e){this._memCache.updateSize(e.id)}onDisposeTile(e){this._vectorTiles.delete(e.id)}_getVectorTileData(e){const t=e.id;if(this._ongoingTileRequests.has(t))return this._ongoingTileRequests.get(t);const i=new AbortController,o={signal:i.signal},s=this._getParsedVectorTileData(e,o).then(e=>(this._ongoingTileRequests.delete(t),this._ongoingRequestToController.delete(t),e)).catch(()=>(this._ongoingTileRequests.delete(t),this._ongoingRequestToController.delete(t),null));return this._ongoingTileRequests.set(t,s),this._ongoingRequestToController.set(t,i),s}_getParsedVectorTileData(e,t){return this.fetchTileData(e,t).then(i=>this.parseTileData({key:e,data:i},t))}}export{h as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{RenderingDevice as e}from"../webgl/RenderingDevice.js";import{simplePipelineState as t}from"../webgl/shaderGraph/utils.js";import{VTLTechniquesRepo as i}from"../webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js";const
|
|
2
|
+
import{RenderingDevice as e}from"../webgl/RenderingDevice.js";import{simplePipelineState as t}from"../webgl/shaderGraph/utils.js";import{VTLTechniquesRepo as i}from"../webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js";const r=1e-6;class n{constructor(t,r){this.spriteMosaic=t,this.glyphMosaic=r,this._vtlTechniques=new i,this._context=null,this._vtlTechniques.startup(),this._renderingDevice=new e}dispose(){this._vtlTechniques&&this._vtlTechniques.shutdown(this._context),this.spriteMosaic.dispose(),this._renderingDevice.dispose(),this._context=null}drawSymbols(e,t,i){const n=i.layers;e.renderPass="translucent";const a=this._vtlTechniques.getTechnique(3);s[0]=t;for(let o=0;o<n.length;o++){const t=n[o];if(3!==t.type)continue;const i=t.getLayoutProperty("visibility");if(i&&1===i.getValue())continue;const l=e.displayLevel;void 0!==t.minzoom&&t.minzoom>l+r||void 0!==t.maxzoom&&t.maxzoom<=l-r||(e.styleLayerUID=t.uid,e.styleLayer=t,a.render(e,{tiles:s}))}s[0]=null}drawBackground(e,t,i){if(0===i.backgroundBucketIds.length)return;const{displayLevel:n,requiredLevel:a}=e;t.key.level=a,this._renderingDevice.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:!1,depth:{write:!1,test:519}}),e.renderPass="background";const o=this._vtlTechniques.getTechnique(0);s[0]=t,i.backgroundBucketIds.forEach(t=>{const a=i.getLayerById(t);if(0!==a.type)return;const l=a.getLayoutProperty("visibility");l&&1===l.getValue()||void 0!==a.minzoom&&a.minzoom>n+r||void 0!==a.maxzoom&&a.maxzoom<=n-r||(e.styleLayerUID=a.uid,e.styleLayer=a,o.render(e,{tiles:s}))}),s[0]=null}drawTile(e,i,r,n){const s=r.layers,a=n?e=>n!==e.type||!i.layerData.has(e.uid):e=>!i.layerData.has(e.uid),o=s.filter(e=>{if(a(e))return!1;const t=e.getLayoutProperty("visibility");return 1!==t?.getValue()}),{context:l}=e,c=l.getPipelineState(),{depthWrite:d}=c;i.disposeLayerData();let u=0,h=1;void 0!==d?.zNear&&void 0!==d.zFar&&(u=d.zNear,h=d.zFar),this._renderingDevice.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"none"},stencil:!1,depth:{write:{zNear:u,zFar:h},test:515}}),e.renderPass="opaque";for(let t=o.length-1;t>=0;--t)this._renderStyleLayer(o[t],e,i);this._renderingDevice.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:!1,depth:{write:!1,test:515}}),e.renderPass="translucent",o.forEach(t=>this._renderStyleLayer(t,e,i)),this._renderingDevice.setPipelineState(t),l.setPipelineState(c),this._context||(this._context=e.context)}setShader(e){return this._renderingDevice.setShader(e)}setPipelineState(e){return this._renderingDevice.setPipelineState(e)}getPipelineState(){return this._renderingDevice.getPipelineState()}submitDraw(e,t,i){return this._renderingDevice.submitDraw(e,t,i)}submitDrawMesh(e,t,i,r){this._renderingDevice.submitDrawMesh(e,t,i,r)}submitDrawMeshUntyped(e,t,i,r){this._renderingDevice.submitDrawMeshUntyped(e,t,i,r)}updatePipelineState(e){return this._renderingDevice.updatePipelineState(e)}setStencilRef(e,t){return this._renderingDevice.setStencilRef(e,t)}_renderStyleLayer(e,t,i){const{renderPass:n}=t;let a;switch(e.type){case 0:if("background"!==n)return;a=this._vtlTechniques.getTechnique(0);break;case 1:if("opaque"!==n&&"translucent"!==n)return;a=this._vtlTechniques.getTechnique(1);break;case 2:if("translucent"!==n)return;a=this._vtlTechniques.getTechnique(2);break;case 4:if("translucent"!==n)return;a=this._vtlTechniques.getTechnique(4);break;case 3:if("translucent"!==n)return;a=this._vtlTechniques.getTechnique(3)}const{displayLevel:o}=t,{minzoom:l,maxzoom:c}=e;if(void 0!==l&&l>o+r||void 0!==c&&c<=o-r||!a)return;const d=this._renderingDevice.getPipelineState();3===e.type&&this._renderingDevice.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:!1,depth:!1}),t.styleLayerUID=e.uid,t.styleLayer=e,s[0]=i,a.render(t,{tiles:s}),s[0]=null,3===e.type&&this._renderingDevice.setPipelineState(d)}}const s=[null];export{n as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{create as e}from"../../../../geometry/support/aaBoundingRect.js";import t from"../../../../layers/support/TileInfo.js";import{tileSizeInTileUnits as s,tileSizeInPixels as r}from"./constants.js";import{SymbolFader as i}from"./decluttering/SymbolFader.js";import{writeOpacityToBuffers as o}from"./decluttering/util.js";import{RenderableTile as l}from"../webgl/RenderableTile.js";import n from"../webgl/TileContainer.js";import{simplePipelineState as a}from"../webgl/shaderGraph/utils.js";import{VTLTechniquesRepo as d}from"../webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js";import h from"../../tiling/TileCoverage.js";import c from"../../tiling/TileKey.js";const u=1e-6;function y(e,t){if(e){const s=e.getLayoutProperty("visibility");if(!s||1!==s.getValue()&&(void 0===e.minzoom||e.minzoom<t+u)&&(void 0===e.maxzoom||e.maxzoom>=t-u))return!0}return!1}class m extends n{constructor(e){super(e),this._backgroundTiles=[],this._techniques=new d,this._computeDisplayInfoView(e),this._techniques.startup()}destroy(){super.destroy(),this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,null!=this._symbolFader&&(this._symbolFader.clear(),this._symbolFader=null);const e=this.stage?.context;e&&this._techniques.shutdown(e),this._styleRepository=null
|
|
2
|
+
import{create as e}from"../../../../geometry/support/aaBoundingRect.js";import t from"../../../../layers/support/TileInfo.js";import{tileSizeInTileUnits as s,tileSizeInPixels as r}from"./constants.js";import{SymbolFader as i}from"./decluttering/SymbolFader.js";import{writeOpacityToBuffers as o}from"./decluttering/util.js";import{RenderableTile as l}from"../webgl/RenderableTile.js";import n from"../webgl/TileContainer.js";import{simplePipelineState as a}from"../webgl/shaderGraph/utils.js";import{VTLTechniquesRepo as d}from"../webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js";import h from"../../tiling/TileCoverage.js";import c from"../../tiling/TileKey.js";const u=1e-6;function y(e,t){if(e){const s=e.getLayoutProperty("visibility");if(!s||1!==s.getValue()&&(void 0===e.minzoom||e.minzoom<t+u)&&(void 0===e.maxzoom||e.maxzoom>=t-u))return!0}return!1}class m extends n{constructor(e){super(e),this._backgroundTiles=[],this._techniques=new d,this._computeDisplayInfoView(e),this._techniques.startup()}destroy(){super.destroy(),this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,null!=this._symbolFader&&(this._symbolFader.clear(),this._symbolFader=null);const e=this.stage?.context;e&&this._techniques.shutdown(e),this._styleRepository=null,this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(e,t,r,l){if(this._spriteMosaic=e,this._glyphMosaic=t,this._styleRepository=r,this.tilingScheme=l,this._computeDisplayInfoView(l),null==this._symbolFader){const e=(e,t)=>{e.allSymbolsFadingOut=!0,e.lastOpacityUpdate=t,o(e,t,!0),e.decluttered=!0,e.requestRender()};this._symbolFader=new i("vector-tile",this._styleRepository,e,this.children,s)}this._symbolFader.styleRepository=r}setSpriteMosaic(e){this._spriteMosaic?.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){null!=this._symbolFader&&this._symbolFader.deleteStyleLayers(e)}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic}}doRender(e){const{drawPhase:t}=e,s=1===t||64===t;this.visible&&s&&void 0!==this._spriteMosaic&&super.doRender(e)}addChild(e){return super.addChild(e),null!=this._symbolFader?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return null!=this._symbolFader&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:t}=e;64!==t?this._doRender(e):super.renderChildren(e)}removeAllChildren(){for(let e=0;e<this.children.length;e++){const t=this.children[e];null!=this._symbolFader&&this._symbolFader.removeTile(t),t.dispose()}super.removeAllChildren()}getStencilTarget(){return this.children.filter(e=>e.neededForCoverage&&e.hasData())}restartDeclutter(){null!=this._symbolFader&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:t,painter:s,state:r}=e,i=this._styleRepository;if(!i)return;const o=i.layers,l=this._displayInfo.scaleToZoom(r.scale);this.children.forEach(e=>e.disposeLayerData()),super.renderChildren(e),i.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,i.backgroundBucketIds,l)),1===e.drawPhase&&this._fade(l,r);const n=this.children.filter(t=>(1===e.drawPhase&&t.fader.fade()<1&&this.requestRender(),t.visible&&t.hasData()));if(n&&0!==n.length){for(const e of n)e.triangleCount=0;t.setClearDepth(1),t.clear(256),s.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:{write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7681},mask:255}},depth:{write:!1,test:515}}),e.renderPass="translucent";for(let t=0;t<o.length;t++)this._renderStyleLayer(o[t],e,n);t.bindVAO(null),s.setPipelineState(a);for(const e of n)e.debugInfo.display.triangleCount=e.triangleCount}else t.bindVAO(null)}_fade(e,t){null!=this._symbolFader&&(this._symbolFader.update(e,t)||this.requestRender())}_renderStyleLayer(e,t,s){const{displayLevel:r,renderPass:i}=t;if(void 0===e)return;const o=e.getLayoutProperty("visibility");if(o&&1===o.getValue())return;switch(e.type){case 0:return;case 1:case 2:case 4:case 3:if("translucent"!==i)return}if(s=3===e.type?s.filter(e=>e.decluttered):s.filter(e=>e.neededForCoverage),3!==e.type&&(0===s.length||void 0!==e.minzoom&&e.minzoom>=r+u||void 0!==e.maxzoom&&e.maxzoom<r-u))return;const l=e.uid;t.styleLayerUID=l,t.styleLayer=e;const n=this._techniques.getTechnique(e.type);null!=n&&n.render(t,{tiles:s})}_renderBackgroundLayers(e,t,s){const{displayLevel:r,state:i}=e,o=this._styleRepository;let l=!1;for(const h of t){const e=o.getLayerById(h);if(e&&0===e.type&&y(o.getLayerById(h),s)){l=!0;break}}if(!l)return;const n=this.tilingScheme.getTileCoverage(e.state,0,!0,"smallest"),{spans:a,lodInfo:d}=n,{level:m}=d,p=[];let g=0;for(const{row:h,colFrom:u,colTo:y}of a)for(let e=u;e<=y;e++){const t=new c(m,h,d.normalizeCol(e),d.getWorldForColumn(e)),s=this._getOrCreateBackgroundTile(g,t);s.setTransform(i),p.push(s),g++}const f=this._techniques.getTechnique(0);for(const h of t){const t=o.getLayerById(h);0!==t.type||!y(t,s)||void 0!==t.minzoom&&t.minzoom>=r+u||void 0!==t.maxzoom&&t.maxzoom<r-u||(e.styleLayerUID=t.uid,e.styleLayer=t,f.render(e,{tiles:p}))}h.pool.release(n)}_getOrCreateBackgroundTile(t,i){const o=this._backgroundTiles[t];if(o?.key.equals(i))return o;const n=this.tilingScheme.getTileBounds(e(),i),a=this.tilingScheme.getTileResolution(i.level),d=new l(i,a,n[0],n[3],r,r,s,s);return o?(o.destroy(),this._backgroundTiles[t]=d):this._backgroundTiles.push(d),d}_computeDisplayInfoView(e){let s=e.tileInfo.lods[0].scale;const i=Math.max(25,e.tileInfo.lods.length),o=[];for(let t=0;t<=i;t++)o.push(s),s/=2;this._displayInfo=t.create({scales:o,size:r,spatialReference:e.spatialReference,numLODs:i})}}export{m as VectorTileContainer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{set as e,identity as t,translate as i,rotate as
|
|
2
|
+
import{set as e,identity as t,translate as i,rotate as s,multiply as l}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{toRadian as r}from"../../../../core/libs/gl-matrix-2/math/common.js";import"../../tiling/TileInfoView.js";import a from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{tileSizeInPixels as o,tileSizeInTileUnits as d,tileCoordinateScale as c}from"./constants.js";import{declutterSingleTile as h}from"./decluttering/jobsUtil.js";import{RenderableTile as u}from"../webgl/RenderableTile.js";import{TileReshuffleManager as m}from"../webgl/TileReshuffleManager.js";class p{constructor(){this._renderParams={reshuffleManager:new m,context:null,drawPhase:1,state:new g,stationary:!0,pixelRatio:1,displayLevel:-1,requiredLevel:-1,normalizedTileView:{origin:[0,0],worldWrapId:[0,0],unitsToPixels:1},tilingScheme:null,globalOpacity:1,renderPass:"background",styleLayer:null,styleLayerUID:-1,painter:null,glyphMosaic:null,spriteMosaic:null,profiler:null,renderingOptions:null,requestRender:null,allowDelayedRender:!1,deltaTime:-1,timeline:null,time:0,blendMode:null,dataUploadCounter:0,effects:null,inFadeTransition:!1,requireFBO:!1,highlightGradient:null,stencilSymbols:!0,is3D:!0,backgroundColor:null,animationsEnabled:!0},this._backgroundTile=new u(new a(0,0,0,0),1,0,0,o,o,d,d),this._heading=0,this._declutteredForHeading=new WeakMap}dispose(){this._renderParams=null}renderBackground(e,t,i,s,l,n,r,a,o,d){const c=this._backgroundTile;this._updateRenderParameters(e,t,c,i,l,n,r,a,o,d),this._renderParams.stencilSymbols=!1,i.drawBackground(this._renderParams,c,s)}renderContent(e,t,i,s,l,n,r,a,o,d,c,h){this._declutter(i),s.forAll(({sourceLayerInfo:{data:e}})=>this._declutter(e));const u=s.length>0;u&&this._stencilSymbols(e,t,i,s,l,n,r,a,o,d,c,h);let m=1;i.stencilRef=u?m:0,e.setStencilFunction(514,i.stencilRef,255),this._render(e,t,i,l,n,r,a,o,d,c,h),s.forAll(({sourceLod:t,offset:i,sourceLayerInfo:{data:s}})=>{s.stencilRef=++m,this._renderSymbols(e,t,s,l,n,r,a,i,d,c,h)})}_stencilSymbols(e,t,i,s,l,n,r,a,o,d,c,h){let u=1;i.stencilRef=u,e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1),e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setColorMask(!1,!1,!1,!1),e.setStencilOp(7680,7680,7681),e.setStencilWriteMask(255),e.setStencilFunction(519,i.stencilRef,255),this._stencilTileSymbols(e,t,i,l,n,r,a,o,d,c,h),s.forAll(({sourceLod:t,offset:i,sourceLayerInfo:{data:s}})=>{s.stencilRef=++u,e.setStencilFunction(519,s.stencilRef,255),this._stencilTileSymbols(e,t,s,l,n,r,a,i,d,c,h)}),e.setStencilWriteMask(0),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!0),e.setColorMask(!0,!0,!0,!0)}_renderSymbols(e,t,i,s,l,n,r,a,o,d,c){e.setStencilFunction(514,i.stencilRef,255),this._render(e,t,i,s,l,n,r,a,o,d,c,3)}_render(e,t,i,s,l,n,r,a,o,d,c,h){this._updateRenderParameters(e,t,i,s,n,r,a,o,d,c),this._renderParams.stencilSymbols=!1,s.drawTile(this._renderParams,i,l,h)}_stencilTileSymbols(e,t,i,s,l,n,r,a,o,d,c){this._updateRenderParameters(e,t,i,s,n,r,a,o,d,c),this._renderParams.stencilSymbols=!0,i.triangleCount=0,s.drawSymbols(this._renderParams,i,l)}_updateRenderParameters(n,a,o,d,h,u,m,p,g,f){"type"in o&&"vector-tile"===o.type&&!o.stage&&o.attachWithContext(n);const _=a[0]-h.getLevelShift(a[0]),y=this._renderParams;y.context=n,y.painter=d,y.glyphMosaic=d.glyphMosaic,y.spriteMosaic=d.spriteMosaic,y.pixelRatio=g*f,y.displayLevel=_,y.requiredLevel=_;const b=h.getScale(a[0]),[S,w]=h.getOffset(a,u*b),M=c*u*b/p,T=-1-S-m[0]*u*2,R=1+w+(1-m[1])*u*2-2,P=y.state,x=p/f;P.size[0]=x,P.size[1]=x,P.pixelRatio=f,P.rotation=(360-this._heading)%360;const j=2/x;e(P.displayViewMat3,j,0,0,0,-j,0,-1,1,1);const L=M/j,k=[(T+1)/j,(1-R)/j],v=o.width/o.rangeX*o.resolution;P.resolution=v/L,y.normalizedTileView.origin[0]=-k[0],y.normalizedTileView.origin[1]=-k[1];const F=t(P.displayMat3),C=t(P.viewMat3),E=r(this._heading);i(F,F,[x/2,x/2]),s(F,F,E),i(F,F,[-x/2,-x/2]),l(F,P.displayViewMat3,F),i(C,C,[x/2,x/2]),s(C,C,-E),i(C,C,[-x/2,-x/2])}updateHeading(e){this._heading=e}_declutter(e){this._declutteredForHeading.get(e)!==this._heading&&(h(e,(360-this._heading)%360),this._declutteredForHeading.set(e,this._heading))}}class g{constructor(){this.size=[0,0],this.pixelRatio=1,this.rotation=0,this.displayMat3=n(),this.displayViewMat3=n(),this.viewMat3=n(),this.transform=null,this.inverseTransform=null,this.viewMat2d=null,this.id=0,this.extent=null,this.center=[0,0],this.scale=1,this.resolution=0,this.worldScreenWidth=0,this.spatialReference=null,this.viewpoint=null,this.getScreenTransform=null,this.toMap=null,this.toScreen=null,this.clone=null,this.copy=null,this.toJSON=null}}export{p as VectorTileRendererHelper3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import{estimateNumberMemory as t}from"../../../../core/memoryEstimations.js";import{List as e}from"./cpuMapped/FreeList.js";import{isHittest as n}from"./shaderGraph/techniques/featureTechniqueUtils.js";import{PrimitiveType as i,DataType as s}from"../../../webgl/enums.js";function a(t,e){return t<<16|255&e}function r(t){return 255&t}function d(t,e){return e?e.get(t.instanceId)??t.techniqueRef.symbologyPlane:t.techniqueRef.symbologyPlane}class h{constructor(t,e,n,i,s){this.instance=t,this.materialKey=e,this.target=n,this.start=i,this.count=s}get textureKey(){return r(this.materialKey)}get indexEnd(){return this.start+this.count}extend(t){this.count+=t}render(t){
|
|
2
|
+
import"../../../../core/has.js";import{estimateNumberMemory as t}from"../../../../core/memoryEstimations.js";import{List as e}from"./cpuMapped/FreeList.js";import{isHittest as n}from"./shaderGraph/techniques/featureTechniqueUtils.js";import{PrimitiveType as i,DataType as s}from"../../../webgl/enums.js";function a(t,e){return t<<16|255&e}function r(t){return 255&t}function d(t,e){return e?e.get(t.instanceId)??t.techniqueRef.symbologyPlane:t.techniqueRef.symbologyPlane}class h{constructor(t,e,n,i,s){this.instance=t,this.materialKey=e,this.target=n,this.start=i,this.count=s}get textureKey(){return r(this.materialKey)}get indexEnd(){return this.start+this.count}extend(t){this.count+=t}render(t){this.instance.techniqueRef.render(t,this)}getStencilReference(){return this.target.stencilRef}getAttributePrecisionPackFactors(){const t=this.instance.instanceId;return this.target.getMesh(t).getAttributePrecisionPackFactors()}draw(t,e){n(t)?this.drawCompute(t.context,e):this.drawGeometry(t.context,e)}drawCompute(t,e){const n=this.instance.instanceId,a=this.target.getMesh(n).getComputeVAO(t,e),r=this.start*Uint32Array.BYTES_PER_ELEMENT/3;t.bindVAO(a,e.locations),t.drawElements(i.POINTS,this.count/3,s.UNSIGNED_INT,r),t.bindVAO(null)}drawGeometry(t,e){const n=this.instance.instanceId,a=this.target.getMesh(n).getGeometryVAO(t,e),r=this.start*Uint32Array.BYTES_PER_ELEMENT;t.bindVAO(a,e.locations),t.drawElements(i.TRIANGLES,this.count,s.UNSIGNED_INT,r),t.bindVAO(null)}}class o{constructor(){this._length=0,this._minOrderedLength=0,this._materialKeys=new Set}static fromDisplayEntities(t,e,n,i){const s=new o,r=n.getInstanceOrder();for(const d of t.values())for(const t of d.records){const d=n.getInstance(t.instanceId),h=a(d.instanceId,t.textureKey);s.addRecord(d,h,t.indexStart,t.indexCount,t.vertexStart,t.vertexCount,e,i,r)}return s}get length(){return this._length}get minOrderedLength(){return this._minOrderedLength}get minUnorderedLength(){return this._materialKeys.size}get usedMemory(){return this._length?5*this._length*t:0}render(t,e){const{drawPhase:n}=t;for(const i of this.infos()){const s=i.instance.techniqueRef;s.drawPhase&n&&(null==e||s.type===e)&&i.render(t)}}addRecord(t,n,i,s,a,r,o,l,c){let u=i,_=s;if(_||(u=a,_=r),!_)return;if(null==this._head){const i=new h(t,n,o,u,_);return this._head=new e(i),this._tail=this._head,this._length++,void this._minOrderedLength++}if(1===l)return this._insert(t,n,o,u,_,this._tail,null);let g=null,m=this._head;const f=t.instanceId,y=d(t,c);if(2===l&&(2===y||3===y))return this._insert(t,n,o,u,_,this._tail,null);for(;m;){const e=m.data.instance,i=e.instanceId,s=d(e,c),a=g?.data.instance.instanceId;if(y<s||f===a&&f!==i)return this._insert(t,n,o,u,_,g,m);g=m,m=m.next}this._insert(t,n,o,u,_,g,null)}*infos(){if(null!=this._head)for(const t of this._head.values())yield t}_insert(t,n,i,s,a,r,d){if(null==r&&null==d){const r=new h(t,n,i,s,a);return this._head=new e(r),this._tail=this._head,this._length++,void this._minOrderedLength++}return n!==this._tail.data.materialKey&&this._minOrderedLength++,this._materialKeys.add(n),null==r&&null!=d?this._insertAtHead(t,n,i,s,a,d):null!=r&&null==d?this._insertAtEnd(t,n,i,s,a,r):null!=r&&null!=d?this._insertAtMiddle(t,n,i,s,a,r,d):void 0}_insertAtHead(t,n,i,s,a,r){const d=s+a;if(n===r.data.materialKey&&i===r.data.target&&d===r.data.start)r.data.start=s,r.data.count+=a;else{const d=new h(t,n,i,s,a);this._head=new e(d),this._head.next=r,this._length++}}_insertAtEnd(t,n,i,s,a,r){if(r.data.materialKey===n&&r.data.indexEnd===s)r.data.count+=a;else{const d=new h(t,n,i,s,a);this._tail=new e(d),r.next=this._tail,this._length++}}_insertAtMiddle(t,n,i,s,a,r,d){const o=s+a;if(r.data.materialKey===n&&r.data.target===i&&r.data.indexEnd===s)r.data.count+=a,r.data.materialKey===d.data.materialKey&&r.data.target===d.data.target&&r.data.indexEnd===d.data.start&&(r.data.count+=d.data.count,r.next=d.next,this._length--);else if(n===d.data.materialKey&&i===d.data.target&&o===d.data.start)d.data.start=s,d.data.count+=a;else{const o=new h(t,n,i,s,a),l=new e(o);r.next=l,l.next=d,this._length++}}}export{o as DisplayList,h as DisplayListInfo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{RenderingDevice as t}from"./RenderingDevice.js";import{TextureManager as
|
|
2
|
+
import"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{RenderingDevice as t}from"./RenderingDevice.js";import{TextureManager as s}from"./TextureManager.js";import{TextureUploadManager as i}from"./TextureUploadManager.js";import{BlendEffect as r}from"./effects/BlendEffect.js";import{FeatureEffect as n}from"./effects/FeatureEffect.js";import o from"./effects/HighlightEffect.js";import{HittestEffect as h}from"./effects/HittestEffect.js";import{EffectManager as f}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as a}from"./meshing/SimpleMesh.js";import{BitBlitTechnique as l}from"./shaderGraph/techniques/utility/BitBlitTechnique.js";import{WorldExtentClipTechnique as c}from"./shaderGraph/techniques/utility/WorldExtentClipTechnique.js";import{SizedDepthStencilFormat as d}from"../../../webgl/enums.js";import{DisposableFramebufferObject as u}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as p}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as b}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as g}from"../../../webgl/TextureDescriptor.js";class _{constructor(e,d){this.context=e,this._blitTechnique=new l,this._worldExtentClipTechnique=new c,this._lastWidth=null,this._lastHeight=null,this._blendEffect=new r,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new o,hittest:new h,insideEffect:new n("inside"),outsideEffect:new n("outside")},this.textureManager=new s(d),this.textureUploadManager=new i(d),this._effectsManager=new f,this._quadMesh=a.fromVertexStream(e,[0,0,1,0,0,1,1,1]),this._renderingDevice=new t}dispose(){if(this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitTechnique.shutdown(),this._worldExtentClipTechnique.shutdown(),this._quadMesh=e(this._quadMesh),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._renderingDevice.dispose()}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const i=new g(e,t);i.samplingMode=9728,i.wrapMode=33071,s=new u(this.context,i,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,s){const{context:i}=e;this._worldExtentClipTechnique.render(e,{backgroundColor:t,padding:s});const{width:r,height:n}=i.getViewport();if(this.updateFBOs(r,n),this._prevFBO=i.boundFramebuffer,i.bindFramebuffer(this.getFbos().output),i.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:r,a:n}=t;i.setClearColor(n*e/255,n*s/255,n*r/255,n)}else i.setClearColor(0,0,0,0);i.setDepthWriteEnabled(!0),i.setClearDepth(1),i.clear(16640),i.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),this._blitTechnique.render(e,{texture:this.getFbos().output.colorTexture,samplingMode:9728,opacity:1,clipToVisibleRegion:!0}),this._renderingDevice.setPipelineStateNeedsUpdate(!0)}beforeRenderLayer(e,t,s){const{context:i,blendMode:r,effects:n,drawPhase:o,requireFBO:h}=e;if(i.setClearColor(0,0,0,0),h||m(o,r,n,s)){const e=i.boundFramebuffer;this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=i.getViewport(),r=this.acquireFbo(t,s);i.bindFramebuffer(r),i.setColorMask(!0,!0,!0,!0),i.setClearColor(0,0,0,0),i.setDepthWriteEnabled(!0),i.setClearDepth(1),i.clear(16640),i.setDepthWriteEnabled(!1)}i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setStencilTestEnabled(!0),i.setClearStencil(t),i.setStencilWriteMask(255),i.clear(1024)}afterRenderLayer(e,t){const{context:s,blendMode:i,effects:r,requireFBO:n,drawPhase:o}=e;if(n||m(o,i,r,t)){const n=s.boundFramebuffer;if(null==n)return;null!=r&&r.length>0&&1===o&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,r,n)),s.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(1,771,1,771),s.setColorMask(!0,!0,!0,!0);const h=null==i||16===o||2===o||128===o?"normal":i;this._blendEffect.draw(e,n.colorTexture,9728,h,t),this.releaseFbo(n)}}blitTexture(e,t,s,i=1){this._blitTechnique.render(e,{texture:t,samplingMode:s,opacity:i}),this._renderingDevice.setPipelineStateNeedsUpdate(!0)}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const s=new g(e,t);s.samplingMode=9728,s.wrapMode=33071;const i=new b(d.DEPTH24_STENCIL8,e,t);this._stencilBuf=new p(this.context,i),this._fbos={output:new u(this.context,s,this._stencilBuf),effect0:new u(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:i}=e,r=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingTechnique:n,effect:o}of r)i.bindFramebuffer(s),n.render(e,{layerFBO:s,effect:o});this._renderingDevice.setPipelineStateNeedsUpdate(!0)}setShader(e){return this._renderingDevice.setShader(e)}clearShaderCache(){this._renderingDevice.clearShaderCache()}getProgramCache(){return this._renderingDevice.getProgramCache()}setPipelineState(e){return this._renderingDevice.setPipelineState(e)}getPipelineState(){return this._renderingDevice.getPipelineState()}submitDraw(e,t,s){return this._renderingDevice.submitDraw(e,t,s)}submitDrawMesh(e,t,s,i){this._renderingDevice.submitDrawMesh(e,t,s,i)}submitDrawMeshUntyped(e,t,s,i){this._renderingDevice.submitDrawMeshUntyped(e,t,s,i)}updatePipelineState(e){return this._renderingDevice.updatePipelineState(e)}setStencilRef(e,t){return this._renderingDevice.setStencilRef(e,t)}}function m(e,t,s,i){return 4!==e&&2!==e&&16!==e&&128!==e&&(1!==i||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{_ as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import"../../../../core/Logger.js";import{TechniqueProgramCache as e}from"./shaderGraph/techniques/TechniqueProgramCache.js";class t{constructor(){this._currentPipelineStateNeedsUpdate=!1,this._programCache=new e}dispose(){this._programCache.destroy()}clearShaderCache(){this._programCache.destroy(),this._programCache=new e}setShader(e){return this._shaderState={shader:e.shader,uniforms:e.uniforms,textures:e.textures,defines:e.defines,optionalAttributes:e.optionalAttributes,useComputeBuffer:e.useComputeBuffer??!1},this._shaderState}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}getPipelineState(){return this._currentPipelineState}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i}=r;if(null==t)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(1032,s,t,i)}}}setPipelineStateNeedsUpdate(e){this._currentPipelineStateNeedsUpdate=e}getShaderState(){return this._shaderState}getProgramCache(){return this._programCache}submitDraw(e,t,s){let r=s?.stencilRef;if(!this._shaderState)return null;const{shader:i,uniforms:n,textures:a,defines:l,optionalAttributes:o}=this._shaderState,c=e.context,d=t.getAttributePrecisionPackFactors(),p=
|
|
2
|
+
import"../../../../core/has.js";import"../../../../core/Logger.js";import{TechniqueProgramCache as e}from"./shaderGraph/techniques/TechniqueProgramCache.js";class t{constructor(){this._currentPipelineStateNeedsUpdate=!1,this._programCache=new e}dispose(){this._programCache.destroy()}clearShaderCache(){this._programCache.destroy(),this._programCache=new e}setShader(e){return this._shaderState={shader:e.shader,uniforms:e.uniforms,textures:e.textures,defines:e.defines,optionalAttributes:e.optionalAttributes,useComputeBuffer:e.useComputeBuffer??!1},this._shaderState}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}getPipelineState(){return this._currentPipelineState}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i}=r;if(null==t)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(1032,s,t,i)}}}setPipelineStateNeedsUpdate(e){this._currentPipelineStateNeedsUpdate=e}getShaderState(){return this._shaderState}getProgramCache(){return this._programCache}submitDraw(e,t,s){let r=s?.stencilRef;if(!this._shaderState)return null;const{shader:i,uniforms:n,textures:a,defines:l,optionalAttributes:o}=this._shaderState,c=e.context,d=t.getAttributePrecisionPackFactors(),p=this._programCache.getProgram(i,d,n,a??{},l??{},o??{});if(p.setUniforms(n),p.setTextures(a),p.bind(c),this.updatePipelineState(c),null==r){const e=t.getStencilReference();null!=e&&(r=e)}return null!=r&&this.setStencilRef(c,r),t.draw(e,i.locationInfo),p.cleanupTemporaryTextures(),{vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){const i=r?.parts,n=r?.stencilRef,{precisionFactors:a,materialKey:l}=t,{shader:o,uniforms:c,textures:d,defines:p,optionalAttributes:h}=this.setShader(t),u=this._programCache.getProgram(o,a||{},c,d??{},p??{},h??{},l);if(u.setUniforms(c),u.setTextures(d),u.bind(e),this.updatePipelineState(e),this.setStencilRef(e,n),i)for(const S of i)s.bind(e,t.shader.locationInfo,S),s.draw(e);else for(let S=0;S<s.parts.length;S++)s.bind(e,t.shader.locationInfo,S),s.draw(e);s.unbind(e),u.cleanupTemporaryTextures()}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled("none"!==s),e.setBlendEquation(32774),s){case"composite":e.setBlendFunctionSeparate(1,771,1,771);break;case"additive":e.setBlendFunctionSeparate(1,1,1,1);break;case"custom":{const{blendParameters:s,blendEquation:r}=t,{dstAlpha:i,dstRGB:n,srcAlpha:a,srcRGB:l}=s;e.setBlendEquation(r),e.setBlendFunctionSeparate(l,n,a,i);break}case"delete":e.setBlendEquation(32779),e.setBlendFunctionSeparate(1,771,1,771);break;case"none":e.setBlendingEnabled(!1)}}else e.setColorMask(!1,!1,!1,!1);if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{op:s}=t;e.setStencilTestEnabled(!0),e.setStencilOpSeparate(1032,s.fail,s.zFail,s.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}}export{t as RenderingDevice};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"../../../../core/has.js";import{createNormalizedTileView as e}from"./normalizedTileUtils.js";import i from"./WGLContainer.js";import{
|
|
2
|
+
import has from"../../../../core/has.js";import{createNormalizedTileView as e}from"./normalizedTileUtils.js";import i from"./WGLContainer.js";import{TileDebugInfoTechnique as t}from"./shaderGraph/techniques/tile/TileDebugInfoTechnique.js";import{TileStencilTechnique as n}from"./shaderGraph/techniques/tile/TileStencilTechnique.js";const l=(e,i)=>e.key.level-i.key.level!==0?e.key.level-i.key.level:e.key.row-i.key.row!==0?e.key.row-i.key.row:e.key.col-i.key.col;class r extends i{constructor(e){super(),this._tileStencilTechnique=new n,this._tileDebugInfoTechnique=new t,this.tilingScheme=e,this.sortFunction=l}get tilingScheme(){return this._tilingScheme}set tilingScheme(e){this._tilingScheme=e}renderChildren(e){this.setStencilReference(e),super.renderChildren(e);for(const i of this.getStencilTarget())this._tileStencilTechnique.render(e,i,this.getTileStencilOptions(i));if(has("esri-tiles-debug"))for(const i of this.children)this._tileDebugInfoTechnique.render(e,i)}getTileStencilOptions(e){return null}createRenderParams(i){const{state:t}=i,n=super.createRenderParams(i);return n.requiredLevel=this.tilingScheme.getClosestInfoForScale(t.scale).level,n.displayLevel=this.tilingScheme.scaleToZoom(t.scale),n.normalizedTileView=e(t,this.tilingScheme),n.tilingScheme=this.tilingScheme,n}onDetach(){super.onDetach(),this._tileStencilTechnique.shutdown(),this._tileDebugInfoTechnique.shutdown()}getStencilTarget(){return this.children}setStencilReference(e){let i=1;for(const t of this.children)t.stencilRef=i++}}export{r as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{set as
|
|
2
|
+
import{set as t,multiply as e}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{DisplayObject as s}from"../DisplayObject.js";import i from"../../tiling/TileKey.js";class r extends s{constructor(t,e,s,r,o,n,h=o,d=n){super(),this.tileDebugInfoTexture=null,this.debugInfo={display:{length:0,minOrderedLength:0,minUnorderedLength:0,triangleCount:0},memory:{bytesUsed:0,bytesReserved:0}},this._destroyed=!1,this.key=new i(t),this.resolution=e,this.x=s,this.y=r,this.width=o,this.height=n,this.rangeX=h,this.rangeY=d}destroy(){super.destroy(),this.tileDebugInfoTexture&&(this.tileDebugInfoTexture.dispose(),this.tileDebugInfoTexture=null),this._destroyed=!0}get debugSlot(){let t=this;for(;t.parent!==this._stage;){if(!t.parent)return 0;t=t.parent}return this._stage.children.indexOf(t)}setTransform(s){const i=this.resolution/(s.resolution*s.pixelRatio),r=this.transforms.tileMat3,[o,n]=s.toScreenNoRotation([0,0],[this.x,this.y]),h=this.width/this.rangeX*i,d=this.height/this.rangeY*i;t(r,h,0,0,0,d,0,o,n,1),e(this.transforms.displayViewScreenMat3,s.displayViewMat3,r)}get destroyed(){return this._destroyed}}export{r as TiledDisplayObject};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{getWorldWidth as n,getScaleToResolutionFactor as o}from"../../viewpointUtils.js";const r=65536;function t(n,o){const r=c(n),t=n.getLODInfoAt(o.key.level),e=u(n);return[(t.getXForColumn(o.key.col)-r[0])*e,(r[1]-t.getYForRow(o.key.row))*e]}function e([n,o]){return[Math.fround(n),Math.fround(o)]}function i(n,r){const t=c(r),e=u(r),i=n.scale*o(r.spatialReference),a=1/(i*e),d=n.size[0]*i/2,f=n.size[1]*i/2,s=l(n.center[0]-d-t[0],e),p=l(t[1]-n.center[1]-f,e);return{origin:[s.coordinate,p.coordinate],worldWrapId:[s.worldWrapId,p.worldWrapId],unitsToPixels:a}}function c(n){return[n.tileInfo.origin.x,n.tileInfo.origin.y]}function u(o){const t=n(o.spatialReference);return t>0?r/t:1}function l(n,o){const t=r/o,e=n%t;let i=Math.round((n-e)/t),c=e*o;return c<0&&(i-=1,c+=r),c>=r&&(i+=1,c-=r),{coordinate:c,worldWrapId:i}}export{i as createNormalizedTileView,t as getNormalizedTileOrigin,
|
|
2
|
+
import{getWorldWidth as n,getScaleToResolutionFactor as o}from"../../viewpointUtils.js";const r=65536;function t(n,o){const r=c(n),t=n.getLODInfoAt(o.key.level),e=u(n);return[(t.getXForColumn(o.key.col)-r[0])*e,(r[1]-t.getYForRow(o.key.row))*e]}function e([n,o]){return[Math.fround(n),Math.fround(o)]}function i(n,r){const t=c(r),e=u(r),i=n.scale*o(r.spatialReference),a=1/(i*e),d=n.size[0]*i/2,f=n.size[1]*i/2,s=l(n.center[0]-d-t[0],e),p=l(t[1]-n.center[1]-f,e);return{origin:[s.coordinate,p.coordinate],worldWrapId:[s.worldWrapId,p.worldWrapId],unitsToPixels:a}}function c(n){return[n.tileInfo.origin.x,n.tileInfo.origin.y]}function u(o){const t=n(o.spatialReference);return t>0?r/t:1}function l(n,o){const t=r/o,e=n%t;let i=Math.round((n-e)/t),c=e*o;return c<0&&(i-=1,c+=r),c>=r&&(i+=1,c-=r),{coordinate:c,worldWrapId:i}}export{i as createNormalizedTileView,t as getNormalizedTileOrigin,r as normalizedTileWorldSize,e as toFloat32};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{unassignedUniformBlockBindingPoint as r,firstTechniqueUniformBlockBindingPoint as o}from"./types.js";import{Sampler2D as n,Float as s,Int as i,Vec4 as p,Vec2 as a}from"./graph/glsl.js";import{generateGLSL as u}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as c}from"./graph/ShaderGraphContext.js";import{setReachableUids as y}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as d}from"./typed/TypedShaderProgram.js";import{ShaderBuilder as h}from"../../../../webgl/ShaderBuilder.js";function f(e){return new e}function l(e,t,r){const o=e.constructor[t]??[];e.constructor.hasOwnProperty(t)||Object.defineProperty(e.constructor,t,{value:o.slice()}),e.constructor[t].push(r)}function m(e){return e===F||e?.prototype instanceof F}function g(e){switch(e.type){case"float":return 5126;case"vec2":return 35664;case"vec3":return 35665;case"vec4":return 35666;case"int":return 5124;case"ivec2":return 35667;case"ivec3":return 35668;case"ivec4":return 35669;case"uint":return 5125;case"uvec2":return 36294;case"uvec3":return 36295;case"uvec4":return 36296;case"bool":return 35670;case"bvec2":return 35671;case"bvec3":return 35672;case"bvec4":return 35673;case"mat2":return 35674;case"mat3":return 35675;case"mat4":return 35676;case"array":case"array-2d":return g(e.elementType);case"sampler2D":throw new Error("Sampler2D uniforms cannot be stored in a uniform block")}}function _(e,t){const r=g(t);return"array"===t.type||"array-2d"===t.type?{name:e,type:r,count:t.size}:{name:e,type:r}}function b(e,t){return(r,o)=>{l(r,"locations",{typeCtor:t,propertyKey:o,parameterIndex:null,index:e})}}const x=e=>(t,r)=>{l(t,"builtins",{builtin:e,propertyKey:r})},K=e=>(t,r,o)=>{l(t,"inputs",{inputCtor:e,propertyKey:r,parameterIndex:o})},C=e=>(t,r)=>{l(t,"uniforms",{typeCtor:e,propertyKey:r})},v=e=>(t,r)=>{l(t,"textures",{typeCtor:e,propertyKey:r})},w=e=>(t,r)=>{l(t,"options",{typeCtor:e,propertyKey:r})},I=(e,t)=>{l(e,"defines",{propertyKey:t})};function P(e){return(t,r)=>{l(t,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:e})}}const j=(e,t)=>(r,o)=>{r.constructor.builtins.push({builtin:e,propertyKey:o,typeCtor:t})};class ${static{this.builtins=[]}}e([j("gl_VertexID",i)],$.prototype,"glVertexID",void 0);class k{}class M{static{this.builtins=[]}}e([j("gl_FragCoord",p)],M.prototype,"glFragCoord",void 0),e([j("gl_PointCoord",a)],M.prototype,"glPointCoord",void 0);class B{}e([x("gl_FragDepth")],B.prototype,"glFragDepth",void 0);class F{constructor(){this.type="uniform-group",this.bindingPoint=r}get _uniforms(){return this.constructor.uniforms??[]}}function S(e,t){const r=new t,{bindingPoint:o}=r,n=[],s=[];for(const i of r._uniforms??[]){if(m(i.typeCtor))throw new Error("Nested UniformGroup members are not supported in uniform blocks");const t=f(i.typeCtor),o=`u_${e}_${i.propertyKey}`,p=t.type,a={shaderModulePath:[e,i.propertyKey].join("."),propertyName:i.propertyKey,uniformName:o,uniformType:p,uniformHydrated:t};("array"===t.type||"array-2d"===t.type)&&(a.uniformArrayLength=t.size,a.uniformArrayElementType=t.elementType.type),n.push(_(o,t)),s.push(a),r[i.propertyKey]=t}return{uniformGroup:r,binding:{shaderModulePath:e,bindingPoint:o,descriptor:n,members:s}}}function U(e){let t=o;return e.map(e=>{if(e.bindingPoint!==r)return e;const o={...e,bindingPoint:t};return t++,o})}class O{constructor(){this.type="texture-group"}get _textures(){return this.constructor.textures??[]}}class E{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const e=this._shaderModuleClass.inputs.findLast(e=>"vertex"===e.propertyKey&&0===e.parameterIndex);if(!e)throw new Error("Unable to find vertex input parameter");return e}get computeInput(){return this._shaderModuleClass.inputs.findLast(e=>"vertex"===e.propertyKey&&1===e.parameterIndex)}get fragmentInput(){const e=this._shaderModuleClass.inputs.findLast(e=>"fragment"===e.propertyKey);if(!e)throw new Error("Unable to find fragment input parameter");return e}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const e=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?t.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:e}):(e.set(o.propertyKey,o.index),r.add(o.index));return e}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([e,t])=>`${e}.${t}`).join("."),r=this.computeAttributes;this._locationInfo={stringHash:t,locations:e,computeAttributeMap:r}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const t of this.locations)e.set("a_"+t.propertyKey,t.index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set;for(const t of this._options)e.add(t.propertyKey);this._optionPropertyKeys=e}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}get _textures(){return this._shaderModuleClass.textures??[]}getProgram(e,t,r,o){try{const{vertex:n,fragment:s,uniformBlockBindings:i,textureBindings:p}=this._generateShaders(e,t,r,o);return new d(this.type,n,s,this.renamedLocationsMap,i,p,this.transformFeedbackBindings)}catch(n){return new d(this.type,"","",this.renamedLocationsMap,[],[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(e){const t=this._options.find(t=>t.propertyKey===e);if(t)return{type:"option",className:t.typeCtor};const r=this._uniforms.find(t=>t.propertyKey===e);if(!r)throw new Error(`Unable to find uniform class type for property: ${e}`);return{type:"required",className:r.typeCtor}}getDebugTextureClassInfo(e){const t=this._textures.find(t=>t.propertyKey===e);if(!t)throw new Error(`Unable to find texture type for property: ${e}`);return{className:t.typeCtor}}getShaderKey(e,t,r,o,n){const s=Object.keys(e).map(t=>`${t}.${e[t]}`).join("."),i=Object.keys(o).map(e=>`${e}.${o[e]}`).join("."),p=Object.keys(n).map(e=>`${e}.${n[e]}`).join("."),a=Object.keys(t).filter(e=>this.optionPropertyKeys.has(e)&&t[e]).join("."),u=Object.keys(r).filter(e=>r[e]).join(".");return`${this.type}.${s}.${i}.${p}.${a}.${u}`}_generateShaders(e,t,r,o){const n=[],s=[];this._setDefines(r),this._setOptionalUniforms(n,t),this._setRequiredUniforms(n),this._setRequiredTextures(s);const i=this._hydrateVertexInput(o),p=this._injectPackPrecisionFactor(i,e),a=this._hydrateComputeInput(),d=a&&this._injectComputePackPrecisionFactor(a,e),h=this.vertex(p,d),f=this._hydrateFragmentInput(h),l=this.fragment(f),m=new Set;for(const u in l){const e=l[u];y(m,e)}const g=this._getVertexInputBuiltins(),_={};for(const[u,c]of Object.entries(i))_[u]=c;if(null!=a)for(const[u,c]of Object.entries(a))_[u]=c;const b=c.createVertex(_,h,g,n,s,this.transformFeedbackBindings,m);u(b);const x=this._getFragmentInputBuiltins(l);x.set("glPointCoord","gl_PointCoord"),x.set("glFragCoord","gl_FragCoord");const K=c.createFragment(f,l,x,n,s,b,this.transformFeedbackBindings);u(K);const C=new Set([...b.usedUniformBlockShaderModulePaths(),...K.usedUniformBlockShaderModulePaths()]),v=U(n.filter(({shaderModulePath:e})=>C.has(e))),w=this._createShaderBuilder(b,K),I=w.generate("vertex"),P=w.generate("fragment");return this.logShader&&(console.log(I),console.log(P)),{vertex:I,fragment:P,uniformBlockBindings:v,textureBindings:s}}_setDefines(e){for(const t in e)this[t]=e[t]}_setOptionalUniforms(e,t){for(const r of this._options){t[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformBlock(e,r):this[r.propertyKey]=null}}_setRequiredUniforms(e){for(const t of this._uniforms)this[t.propertyKey]=this._hydrateUniformBlock(e,t)}_setRequiredTextures(e){for(const t of this._textures)this[t.propertyKey]=this._hydrateTextureBinding(e,t)}_hydrateUniformBlock(e,t){if(!m(t.typeCtor))throw new Error("Only UniformGroup subclasses can be used as uniform blocks");const{uniformGroup:r,binding:o}=S(t.propertyKey,t.typeCtor);return e.push(o),r}_hydrateTextureBinding(e,t){const r=t.typeCtor;if(r===n){const r=new n,o=`u_${t.propertyKey}`,s=t.propertyKey;return e.push({shaderModulePath:s,textureName:o,textureHydrated:r}),r}const o=new r;for(const n of o._textures){const r=f(n.typeCtor),s=`u_${t.propertyKey}_${n.propertyKey}`,i=[t.propertyKey,n.propertyKey].join(".");e.push({shaderModulePath:i,textureName:s,textureHydrated:r}),o[n.propertyKey]=r}return o}_hydrateVertexInput(e){const t=this.vertexInput.inputCtor,r=t.locations.reduce((t,r)=>!1===e[r.propertyKey]?t:{...t,[r.propertyKey]:f(r.typeCtor)},{});for(const{propertyKey:o,typeCtor:n}of t.builtins){const e=f(n);r[o]=e}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce((e,t)=>({...e,[t.propertyKey]:f(t.typeCtor)}),{})}_injectPackPrecisionFactor(e,t){const r={};for(const o in e){const n=e[o],i=t[o];if(i){if("float"!==n.type&&"vec2"!==n.type&&"vec3"!==n.type&&"vec4"!==n.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${n.type}`);r[o]=n.divide(new s(i))}else r[o]=n}return r}_injectComputePackPrecisionFactor(e,t){const r={},o=new Map;for(const n in this.computeAttributes)for(const e of this.computeAttributes[n]??[])o.set(e,n);for(const n in e){const i=e[n],p=o.get(n);if(!p)continue;const a=t[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);r[n]=i.divide(new s(a))}else r[n]=i}return r}_hydrateFragmentInput(e){const t={};for(const r in e)t[r]=e[r];for(const{propertyKey:r,typeCtor:o}of M.builtins){const e=f(o);t[r]=e}return t}_getVertexInputBuiltins(){const e=this.vertexInput.inputCtor,t=new Map;for(const{builtin:r,propertyKey:o}of e.builtins)t.set(o,r);return t}_getFragmentInputBuiltins(e){const t=e.constructor,r=new Map;for(const o of t.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(e,t){const r=new h;return this._insertDebugInfo(r),e.insertVertexShader(r),t.insertFragmentShader(r),r}_insertDebugInfo(e){e.vertex.code.add("// DEFINES: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this._defines)this[t.propertyKey]?e.vertex.code.add(`// ${t.propertyKey}: true`):e.vertex.code.add(`// ${t.propertyKey}: false`);e.vertex.code.add(""),e.vertex.code.add("// OPTIONS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this._options)this[t.propertyKey]?e.vertex.code.add(`// ${t.propertyKey}: true`):e.vertex.code.add(`// ${t.propertyKey}: false`)}}export{k as ComputeVertexInput,M as FragmentInput,B as FragmentOutput,E as GraphShaderModule,O as TextureGroup,F as UniformGroup,$ as VertexInput,x as builtin,S as createUniformBlockBinding,I as define,K as input,b as location,w as option,v as texture,P as transformFeedback,C as uniform};
|
|
2
|
+
import{__decorate as t}from"tslib";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{Sampler2D as r,Float as o,Int as n,Vec4 as s,Vec2 as i}from"./graph/glsl.js";import{generateGLSL as p}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as a}from"./graph/ShaderGraphContext.js";import{setReachableUids as u}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as y}from"./typed/TypedShaderProgram.js";import{ShaderBuilder as c}from"../../../../webgl/ShaderBuilder.js";function d(t){return new t}function h(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function f(t,e){return(r,o)=>{h(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const l=t=>(e,r)=>{h(e,"builtins",{builtin:t,propertyKey:r})},m=t=>(e,r,o)=>{h(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},g=t=>(e,r)=>{h(e,"uniforms",{typeCtor:t,propertyKey:r})},_=t=>(e,r)=>{h(e,"textures",{typeCtor:t,propertyKey:r})},x=t=>(e,r)=>{h(e,"options",{typeCtor:t,propertyKey:r})},K=(t,e)=>{h(t,"defines",{propertyKey:e})};function C(t){return(e,r)=>{h(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const b=(t,e)=>(r,o)=>{r.constructor.builtins.push({builtin:t,propertyKey:o,typeCtor:e})};class I{static{this.builtins=[]}}t([b("gl_VertexID",n)],I.prototype,"glVertexID",void 0);class v{}class w{static{this.builtins=[]}}t([b("gl_FragCoord",s)],w.prototype,"glFragCoord",void 0),t([b("gl_PointCoord",i)],w.prototype,"glPointCoord",void 0);class P{}t([l("gl_FragDepth")],P.prototype,"glFragDepth",void 0);class ${constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class j{constructor(){this.type="texture-group"}get _textures(){return this.constructor.textures??[]}}class F{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const t=this._shaderModuleClass.inputs.findLast(t=>"vertex"===t.propertyKey&&0===t.parameterIndex);if(!t)throw new Error("Unable to find vertex input parameter");return t}get computeInput(){return this._shaderModuleClass.inputs.findLast(t=>"vertex"===t.propertyKey&&1===t.parameterIndex)}get fragmentInput(){const t=this._shaderModuleClass.inputs.findLast(t=>"fragment"===t.propertyKey);if(!t)throw new Error("Unable to find fragment input parameter");return t}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const t=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?e.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:t}):(t.set(o.propertyKey,o.index),r.add(o.index));return t}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map(([t,e])=>`${t}.${e}`).join("."),r=this.computeAttributes;this._locationInfo={stringHash:e,locations:t,computeAttributeMap:r}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const e of this.locations)t.set("a_"+e.propertyKey,e.index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set;for(const e of this._options)t.add(e.propertyKey);this._optionPropertyKeys=t}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}get _textures(){return this._shaderModuleClass.textures??[]}getProgram(t,e,r,o){try{const{vertex:n,fragment:s,uniformBindings:i,textureBindings:p}=this._generateShaders(t,e,r,o);return new y(this.type,n,s,this.renamedLocationsMap,i,p,this.transformFeedbackBindings)}catch(n){return new y(this.type,"","",this.renamedLocationsMap,[],[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(t){const e=this._options.find(e=>e.propertyKey===t);if(e)return{type:"option",className:e.typeCtor};const r=this._uniforms.find(e=>e.propertyKey===t);if(!r)throw new Error(`Unable to find uniform class type for property: ${t}`);return{type:"required",className:r.typeCtor}}getDebugTextureClassInfo(t){const e=this._textures.find(e=>e.propertyKey===t);if(!e)throw new Error(`Unable to find texture type for property: ${t}`);return{className:e.typeCtor}}getShaderKey(t,e,r,o,n){const s=Object.keys(t).map(e=>`${e}.${t[e]}`).join("."),i=Object.keys(o).map(t=>`${t}.${o[t]}`).join("."),p=Object.keys(n).map(t=>`${t}.${n[t]}`).join("."),a=Object.keys(e).filter(t=>this.optionPropertyKeys.has(t)&&e[t]).join("."),u=Object.keys(r).filter(t=>r[t]).join(".");return`${this.type}.${s}.${i}.${p}.${a}.${u}`}_generateShaders(t,e,r,o){const n=[],s=[];this._setDefines(r),this._setOptionalUniforms(n,e),this._setRequiredUniforms(n),this._setRequiredTextures(s);const i=this._hydrateVertexInput(o),y=this._injectPackPrecisionFactor(i,t),c=this._hydrateComputeInput(),d=c&&this._injectComputePackPrecisionFactor(c,t),h=this.vertex(y,d),f=this._hydrateFragmentInput(h),l=this.fragment(f),m=new Set;for(const p in l){const t=l[p];u(m,t)}const g=this._getVertexInputBuiltins(),_={};for(const[p,a]of Object.entries(i))_[p]=a;if(null!=c)for(const[p,a]of Object.entries(c))_[p]=a;const x=a.createVertex(_,h,g,n,s,this.transformFeedbackBindings,m);p(x);const K=this._getFragmentInputBuiltins(l);K.set("glPointCoord","gl_PointCoord"),K.set("glFragCoord","gl_FragCoord");const C=a.createFragment(f,l,K,n,s,x,this.transformFeedbackBindings);p(C);const b=this._createShaderBuilder(x,C),I=b.generate("vertex"),v=b.generate("fragment");return this.logShader&&(console.log(I),console.log(v)),{vertex:I,fragment:v,uniformBindings:n,textureBindings:s}}_setDefines(t){for(const e in t)this[e]=t[e]}_setOptionalUniforms(t,e){for(const r of this._options){e[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(t,r):this[r.propertyKey]=null}}_setRequiredUniforms(t){for(const e of this._uniforms)this[e.propertyKey]=this._hydrateUniformGroup(t,e)}_setRequiredTextures(t){for(const e of this._textures)this[e.propertyKey]=this._hydrateTextureBinding(t,e)}_hydrateUniformGroup(t,e){const r=new(0,e.typeCtor);for(const o of r._uniforms??[]){const n=d(o.typeCtor),s=`u_${e.propertyKey}_${o.propertyKey}`,i=n.type,p=[e.propertyKey,o.propertyKey].join(".");if("type"in o.typeCtor&&"array"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else if("type"in o.typeCtor&&"array-2d"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformHydrated:n});r[o.propertyKey]=n}return r}_hydrateTextureBinding(t,e){const o=e.typeCtor;if(o===r){const o=new r,n=`u_${e.propertyKey}`,s=e.propertyKey;return t.push({shaderModulePath:s,textureName:n,textureHydrated:o}),o}const n=new o;for(const r of n._textures){const o=d(r.typeCtor),s=`u_${e.propertyKey}_${r.propertyKey}`,i=[e.propertyKey,r.propertyKey].join(".");t.push({shaderModulePath:i,textureName:s,textureHydrated:o}),n[r.propertyKey]=o}return n}_hydrateVertexInput(t){const e=this.vertexInput.inputCtor,r=e.locations.reduce((e,r)=>!1===t[r.propertyKey]?e:{...e,[r.propertyKey]:d(r.typeCtor)},{});for(const{propertyKey:o,typeCtor:n}of e.builtins){const t=d(n);r[o]=t}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce((t,e)=>({...t,[e.propertyKey]:d(e.typeCtor)}),{})}_injectPackPrecisionFactor(t,e){const r={};for(const n in t){const s=t[n],i=e[n];if(i){if("float"!==s.type&&"vec2"!==s.type&&"vec3"!==s.type&&"vec4"!==s.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);r[n]=s.divide(new o(i))}else r[n]=s}return r}_injectComputePackPrecisionFactor(t,e){const r={},n=new Map;for(const o in this.computeAttributes)for(const t of this.computeAttributes[o]??[])n.set(t,o);for(const s in t){const i=t[s],p=n.get(s);if(!p)continue;const a=e[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);r[s]=i.divide(new o(a))}else r[s]=i}return r}_hydrateFragmentInput(t){const e={};for(const r in t)e[r]=t[r];for(const{propertyKey:r,typeCtor:o}of w.builtins){const t=d(o);e[r]=t}return e}_getVertexInputBuiltins(){const t=this.vertexInput.inputCtor,e=new Map;for(const{builtin:r,propertyKey:o}of t.builtins)e.set(o,r);return e}_getFragmentInputBuiltins(t){const e=t.constructor,r=new Map;for(const o of e.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(t,e){const r=new c;return this._insertDebugInfo(r),t.insertVertexShader(r),e.insertFragmentShader(r),r}_insertDebugInfo(t){t.vertex.code.add("// DEFINES: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._defines)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`);t.vertex.code.add(""),t.vertex.code.add("// OPTIONS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._options)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`)}}export{v as ComputeVertexInput,w as FragmentInput,P as FragmentOutput,F as GraphShaderModule,j as TextureGroup,$ as UniformGroup,I as VertexInput,l as builtin,K as define,m as input,f as location,x as option,_ as texture,C as transformFeedback,g as uniform};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{cloneShaderNode as e}from"./ShaderGraphNode.js";class t{constructor(e,t,a,o=[]){this.variableName=e,this.variableInputType=t,this.node=a,this.qualifiers=o,this.type="shader-input",this.isUsed=!1}clone(){return new t(this.variableName,this.variableInputType,e(this.node),[...this.qualifiers])}}class a{constructor(e,t,a,o=[]){this.outVariableName=e,this.outVariableType=t,this.node=a,this.qualifiers=o,this.type="shader-output"}clone(){const t=new a(this.outVariableName,this.outVariableType,e(this.node),[...this.qualifiers]);return t.variableName=this.variableName,t}}class o{static createVertex(e,n,s,d,i,u,p){const c=[];for(const a in e){const o=e[a],r=s.get(a);r?c.push(new t(r,"builtin",o)):c.push(new t("a_"+a,"in",o))}for(const a of d){const e=a.uniformHydrated;c.push(new t(a.uniformName,"uniform",e))}for(const a of i){const e=a.textureHydrated;c.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in n){const e=n[t];if("glPosition"===t)h.push(new a("gl_Position","builtin",e));else if("glPointSize"===t)h.push(new a("gl_PointSize","builtin",e));else{const o=r(e),n=[];o&&n.push(o),h.push(new a("v_"+t,"out",e,n))}}return new o(c,h,u,p)}static createFragment(e,r,n,s,d,i,u){const p=[],c=Array.from(i.rootOutputNodes());for(const a in e){const o=e[a],r=n.get(a);if(r){p.push(new t(r,"builtin",o));continue}const s=c.find(e=>e.node===o);s&&p.push(new t(s.outVariableName,"in",o,s.qualifiers))}for(const a of s){const e=a.uniformHydrated;p.push(new t(a.uniformName,"uniform",e))}for(const a of d){const e=a.textureHydrated;p.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in r){const e=r[t],o=n.get(t);switch(t){case"discard":h.push(new a(null,"discard",e));break;case"fragData0":h.push(new a("fragData0","fragData0",e));break;case"fragData1":h.push(new a("fragData1","fragData1",e));break;case"fragData2":h.push(new a("fragData2","fragData2",e));break;case"fragData3":h.push(new a("fragData3","fragData3",e));break;default:o?h.push(new a(o,"builtin",e)):h.push(new a(t,"out",e))}}return new o(p,h,u)}constructor(e,t,a,o){this.type="shader-graph-context",this.indent=0,this.body="",this.varCount=0,this._arrayReadVersions=new Map,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(const r of e)this._inputShaderTypesByNodeUid.set(r.node.uid,r);this._outputShaderTypes=t,this._transformFeedbackBindings=a,this._transformFeedbackNames=new Set(a.map(e=>"v_"+e.propertyKey)),this._usedInFragmentShader=o}shouldPruneOutputNode(e){return!!this._usedInFragmentShader&&("builtin"!==e.outVariableType&&(!this._transformFeedbackNames.has(e.outVariableName)&&!this._usedInFragmentShader.has(e.node.uid)))}setEmit(e,t){this._nodeEmitMap.set(e.uid,t)}getEmit(e){return this._nodeEmitMap.get(e.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}get arrayReadVersions(){return this._arrayReadVersions}createArrayReadVersions(){const e=[],t=[],a=new Set;this._arrayReadVersions.clear();for(const o of this.rootOutputNodes())this.shouldPruneOutputNode(o)||(t.push(o.node),a.add(o.node.uid));for(let o=0;o<t.length;o++){const r=t[o];"array-read-node"===r.shaderType&&e.push(r);for(const e of r.children)e&&"number"!=typeof e&&"boolean"!=typeof e&&!a.has(e.uid)&&(a.add(e.uid),t.push(e))}for(const o of e){let e=this._arrayReadVersions.get(o.version.uid);e||(e=[],this._arrayReadVersions.set(o.version.uid,e)),e.push(o)}}getInput(e){return this._inputShaderTypesByNodeUid.get(e.uid)}*rootOutputNodes(){for(const e of this._outputShaderTypes)yield e}*nodes(){const e=[];for(const t of this._outputShaderTypes.values())e.push(t.node);for(;e.length;){const t=e.pop();"number"!=typeof t&&"boolean"!=typeof t&&e.push(...t.children.filter(Boolean)),yield t}}*nodesOfTypeOrFunction(){for(const e of this.nodes())"number"!=typeof e&&"boolean"!=typeof e&&(yield e)}createSubgraphContext(){const e=this.clone();return e.body="",e.indent=this.indent+2,e._nodeEmitMap=new Map(this._nodeEmitMap),e}clone(){const e=new o([],this._outputShaderTypes,this._transformFeedbackBindings,this._usedInFragmentShader);return e._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid,e.indent=this.indent,e.body=this.body,e.varCount=this.varCount,e._arrayReadVersions=this._arrayReadVersions,e._nodeEmitMap=this._nodeEmitMap,e}insertVertexShader(e){e.vertex.code.add(""),this._insertInputs(e,"vertex"),e.vertex.code.add(""),e.vertex.code.add("// OUTPUTS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this.rootOutputNodes()){const a="builtin"===t.outVariableType;if(!this.shouldPruneOutputNode(t))if(a)e.vertex.code.add(`// ${t.outVariableType.padEnd(7)} ${t.node.type.padEnd(9)} ${t.outVariableName};`);else if("array"===t.node.type){const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.elementType.type.padEnd(9)} ${t.outVariableName}[${t.node.size}];`)}else{const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.type.padEnd(9)} ${t.outVariableName};`)}}e.vertex.code.add(""),e.vertex.code.add("void main() {"),e.vertex.code.add(" "+this.body.split("\n").join("\n "));for(const t of this.rootOutputNodes())this.shouldPruneOutputNode(t)||e.vertex.code.add(` ${t.outVariableName} = ${t.variableName};`);e.vertex.code.add("}")}insertFragmentShader(e){this._insertInputs(e,"fragment"),e.fragment.code.add(""),e.fragment.code.add("// OUTPUTS: "),e.fragment.code.add("// --------------------------------------------------------- ");let t=0;for(const n of this.rootOutputNodes())"builtin"===n.outVariableType?e.fragment.code.add(`// ${n.outVariableType.padEnd(7)} ${n.node.type.padEnd(9)} ${n.outVariableName};`):"discard"===n.outVariableType||e.outputs.add(n.outVariableName,n.node.type,t++);e.fragment.code.add(""),e.fragment.code.add("void main() {"),e.fragment.code.add(" "+this.body.split("\n").join("\n "));const a=Array.from(this.rootOutputNodes()),o=a.find(e=>"discard"===e.outVariableType),r=a.filter(e=>"discard"!==e.outVariableType);o&&(e.fragment.code.add(` if (${o.variableName}) {`),e.fragment.code.add(" discard;"),e.fragment.code.add(" }"),e.fragment.code.add(" "));for(const n of r)e.fragment.code.add(` ${n.outVariableName} = ${n.variableName};`);e.fragment.code.add("}")}_insertInputs(e,t){e[t].code.add("// INPUTS: "),e[t].code.add("// --------------------------------------------------------- ");for(const a of this.inputs())if(a.isUsed&&"builtin"!==a.variableInputType)if("array"===a.node.type)e[t].code.add(` ${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}];`);else if("array-2d"===a.node.type)e[t].code.add(` ${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}]; // Emulated 2D Array. Not supported by ES3.0`);else{const o=[...a.qualifiers,a.variableInputType].join(" ");e[t].code.add(` ${o.padEnd(10)} ${a.node.type.padEnd(9)} ${a.variableName};`)}}}function r(e){switch(e.type){case"float":case"vec2":case"vec3":case"vec4":case"array":return null;case"int":case"ivec2":case"ivec3":case"ivec4":case"uint":case"uvec2":case"uvec3":case"uvec4":case"bool":case"bvec2":case"bvec3":case"bvec4":return"flat";case"mat2":case"mat3":case"mat4":case"sampler2D":case"array-2d":throw new Error(`InternalError: ${e.type} is not a valid output type`)}}export{o as ShaderGraphContext,t as ShaderInput,a as ShaderOutput};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as i}from"tslib";import{animationDebugFlags as t}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{generateVirtualMachineSource as e}from"../../../animations/instructions.js";import{location as o,uniform as a,texture as s,option as r}from"../../GraphShaderModule.js";import{Vec2 as l,Vec4 as n,Float as p,Sampler2D as m,cond as u,equal as d,negate as c,step as y,sin as v,cos as
|
|
2
|
+
import{__decorate as i}from"tslib";import{animationDebugFlags as t}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{generateVirtualMachineSource as e}from"../../../animations/instructions.js";import{location as o,uniform as a,texture as s,option as r}from"../../GraphShaderModule.js";import{Vec2 as l,Vec4 as n,Float as p,Sampler2D as m,cond as u,equal as d,negate as c,step as y,sin as v,cos as h,Mat3 as f,Vec3 as b,lessThanEqual as S,ifElse as w,texture2D as g,clamp as V,abs as x,block as z}from"../../graph/glsl.js";import{AnimationUniformInfo as T}from"./AnimationUniformInfo.js";import{MarkerConstants as P}from"../markers/markerConstants.js";import{FeatureVertexInput as j,AFeatureShader as _,FeatureFragmentInput as C}from"../shaders/AFeatureShader.js";import{softEdgeRatio as M}from"../shaders/constants.js";import{LocalTileOffset as O}from"../shaders/LocalTileOffset.js";import{MosaicInfo as D}from"../shaders/MosaicInfo.js";import{getBit as F,rgba2float as R}from"../shaders/utils.js";import{VisualVariableColor as A}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as I}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as L}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as k}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as U}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as E}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as B}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as G,getVisualVariableAngle as q}from"../shaders/vvUtils.js";class N extends j{}i([o(3,l)],N.prototype,"offset",void 0),i([o(4,n)],N.prototype,"sizing",void 0),i([o(5,n)],N.prototype,"value1Position2Value2",void 0),i([o(6,n)],N.prototype,"animationPointerAndBaseSizeAndReferenceSize",void 0),i([o(7,l)],N.prototype,"zoomRange",void 0),i([o(8,p)],N.prototype,"lineLength",void 0);class W extends C{}class Z extends _{_vertexPreamble(i,t,e){const{id:o,offset:a,animationPointerAndBaseSizeAndReferenceSize:s,sizing:r}=i,l=s.xy,n=s.z,m=s.w,v=r.xy,h=u([d(F(i.bitset,P.bitset.isMapAligned),new p(1)),this.view.rotation.divide(180).multiply(Math.PI)],[!0,new p(0)]),f=c(h.add(t)),b=this._getEvalParams(i,v,e,f);let S,w;if(i.value1Position2Value2){let t;t=this.hittestRequest?new p(0):H(l,6,b).a.multiply(this.tile.getDisplayZoomFactor(this.tileContainer));const e=i.pos,o=i.value1Position2Value2.yz,a=i.value1Position2Value2.x,s=i.value1Position2Value2.w,r=t.subtract(a).divide(s.subtract(a));w=e.add(o.subtract(e).multiply(r)),S=y(new p(1),r).add(y(new p(0),c(r)))}else w=i.pos,S=new p(0);const g=r.z,V=F(i.bitset,P.bitset.isStroke),x=r.w,z=F(i.bitset,P.bitset.scaleSymbolsProportionally),T=H(l,0,b),j=T.xy,_=T.z,C=T.w,M=F(i.bitset,P.bitset.isSDF),O=G(this,o,new p(m)).divide(new p(m));return{baseSize:n,animationPointer:l,strokeWidth:g,isOutline:V,unscaledDistanceToPx:x,scaleSymbolsProportionally:z,isSDF:M,position:this._getScreenPosition({id:o,pos:w,offset:a,referenceSize:m,translation:j,rotation:_,scale:C,vvScale:O}),evalParams:b,vvScale:O,scale:C,clip:S}}_getScreenPosition(i){const{pos:t,translation:e,rotation:o,scale:a,offset:s,id:r,vvScale:l}=i,n=q(this,r).multiply(Math.PI/180),m=e.x.multiply(4/3),u=e.y.multiply(-1).multiply(4/3),d=v(n),y=h(n),S=y.multiply(m).add(c(d).multiply(u)),w=d.multiply(m).add(y.multiply(u)),g=v(o.subtract(n)),V=h(o.subtract(n)),x=new p(0),z=new p(1),{pixelRatio:T}=this.view,P=new f(z,x,x,x,z,x,S.multiply(T),w.multiply(T),z),j=new f(V,g.multiply(-1),x,g,V,x,0,0,z),_=a.multiply(l).multiply(T).multiply(4/3),C=j.multiply(_),M=this.tile.getViewScreenMat3(this.view,this.tileContainer).multiply(new b(t,1)),O=P.multiply(M).xy,D=C.multiply(new b(s,0)).xy;return O.add(D)}_clip(i,e){let o=super.clip(i,e);const a=S(this._getLocalTimeOrigin(i),new p(0));return t.forceGlobalTimeOrigin||(o=o.add(u([a,()=>new p(2)],[!0,()=>new p(0)]))),o}_getLocalTimeOrigin(i){return this.getLocalTimeOrigin(i)}_toNdc(i){return this.view.displayMat3.multiply(new b(i,1)).xy}_getEvalParams(i,t,e,o){const{globalTime:a,animationTextureSize:s}=this.animationInfo;return{globalTime:a,localTimeOrigin:this._getLocalTimeOrigin(i.id),animationTextureSize:s,animationTexture:this.animationTexture,pixelDimensions:t,lineLength:e,globalRotation:o}}_getColor(i,t){return w(d(t.isSDF,new p(1)),this._getSDFColor(i,t),this._getSpriteColor(i,t))}_getSpriteColor(i,t){return g(this.mosaicTexture,i).multiply(t.color)}_getSDFColor(i,t){const e=g(this.mosaicTexture,i),o=new p(.5).subtract(R(e)).multiply(t.distanceToPx).multiply(M),a=V(new p(.5).subtract(o),new p(0),new p(1)),s=t.color.multiply(a),r=t.outlineSize.multiply(.5),l=x(o).subtract(r),n=V(new p(.5).subtract(l),new p(0),new p(1)),m=t.outlineColor.multiply(n);return new p(1).subtract(m.a).multiply(s).add(m)}}function H(i,t,o){const a=i.add(new l(t,0)),s=g(o.animationTexture,a.add(.5).divide(o.animationTextureSize)).xy;return i=i.add(s),z({animationPointer:i,...o},n,null,i=>{const{out:t}=i;if(!t)throw new Error("out is null");return e({...i,out:t})})}i([a(D)],Z.prototype,"mosaicInfo",void 0),i([a(T)],Z.prototype,"animationInfo",void 0),i([a(O)],Z.prototype,"localTileOffset",void 0),i([s(m)],Z.prototype,"mosaicTexture",void 0),i([r(A)],Z.prototype,"visualVariableColor",void 0),i([r(I)],Z.prototype,"visualVariableOpacity",void 0),i([r(k)],Z.prototype,"visualVariableSizeMinMaxValue",void 0),i([r(U)],Z.prototype,"visualVariableSizeScaleStops",void 0),i([r(E)],Z.prototype,"visualVariableSizeStops",void 0),i([r(B)],Z.prototype,"visualVariableSizeUnitValue",void 0),i([r(L)],Z.prototype,"visualVariableRotation",void 0),i([s(m)],Z.prototype,"animationTexture",void 0);export{W as AAnimatedFragmentInput,Z as AAnimatedShader,N as AAnimatedVertexInput,H as getValue};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t,__param as e}from"tslib";import{input as s}from"../../GraphShaderModule.js";import{Float as i,sin as r,cos as o,Vec3 as l,Vec4 as n,mix as a,ifElse as m,greaterThan as u}from"../../graph/glsl.js";import{PolyVertexInput as p,PolyHittestVertexInput as h,PolyFragmentInput as c,AAnimatedPolyShader as d}from"./AAnimatedPolyShader.js";import{getPatternMatrix as y}from"../shaders/ComplexFillShader.js";import{c256ToRad as f,noHit as g,trueHit as x}from"../shaders/constants.js";import{isRectHittest as b,hittestFill as P,hittestScreenRect as w}from"../shaders/hittestUtils.js";class S extends d{constructor(){super(...arguments),this.type="AnimatedFillShader"}vertex(t,e){const{distanceToPx:s,ndc:m,z:u,color:p,isOutline:h,strokeWidth:c,isSDF:d,scale:g,scaleSymbolsProportionally:x}=this._vertexPoly(t),b=this.tile.getRequiredZoomFactor(this.
|
|
2
|
+
import{__decorate as t,__param as e}from"tslib";import{input as s}from"../../GraphShaderModule.js";import{Float as i,sin as r,cos as o,Vec3 as l,Vec4 as n,mix as a,ifElse as m,greaterThan as u}from"../../graph/glsl.js";import{PolyVertexInput as p,PolyHittestVertexInput as h,PolyFragmentInput as c,AAnimatedPolyShader as d}from"./AAnimatedPolyShader.js";import{getPatternMatrix as y}from"../shaders/ComplexFillShader.js";import{c256ToRad as f,noHit as g,trueHit as x}from"../shaders/constants.js";import{isRectHittest as b,hittestFill as P,hittestScreenRect as w}from"../shaders/hittestUtils.js";class S extends d{constructor(){super(...arguments),this.type="AnimatedFillShader"}vertex(t,e){const{distanceToPx:s,ndc:m,z:u,color:p,isOutline:h,strokeWidth:c,isSDF:d,scale:g,scaleSymbolsProportionally:x}=this._vertexPoly(t),b=this.tile.getRequiredZoomFactor(this.tileContainer),P=t.sizing.xy,w=P.multiply(b),S=t.angle?t.angle.multiply(f):new i(0),j=r(S),v=o(S),F=y(t.id,w,j,v,t.bitset),O=this.localTileOffset.getPatternOffsetAtTileOrigin(P,j,v),R=b.multiply(t.offset.subtract(O)).divide(w),T=new l(t.pos,1),q=F.multiply(T).xy.subtract(R),A=t.tlbr.divide(this.mosaicInfo.size.xyxy);return{glPosition:new n(m,u,1),tlbr:A,uv:q,color:p.multiply(new i(1).subtract(h)),outlineColor:p.multiply(h),distanceToPx:s,strokeWidth:c.multiply(a(new i(1),g,x)),isOutline:h,isSDF:d,...this.maybeRunHittest(t,e,{})}}fragment(t){const e=this._fragmentPoly(t);return this.getFragmentOutput(e,t)}hittest(t,e,s){const{pos0:r,pos1:o,pos2:l}=this.computeHittestTriangle(t,e,null),n=b(this.hittestRequest);return m(n,()=>{const{tlbr:t}=this.hittestRequest;return w(r,o,l,t)},()=>{const s=P(this,t,e);return m(u(s,this.hittestRequest.distance),new i(g),new i(x))})}}t([e(0,s(p)),e(1,s(h))],S.prototype,"vertex",null),t([e(0,s(c))],S.prototype,"fragment",null);export{S as AnimatedFillShader};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t,__param as e}from"tslib";import{location as i,input as s}from"../../GraphShaderModule.js";import{Float as o,Vec2 as l,dot as r,max as a,Vec4 as n,mix as m,length as d,clamp as p,step as u,min as h,ifElse as c,greaterThan as y}from"../../graph/glsl.js";import{PolyHittestVertexInput as f,PolyVertexInput as v,AAnimatedPolyShader as b,PolyFragmentInput as g}from"./AAnimatedPolyShader.js";import{getValue as w}from"./AAnimatedShader.js";import{noHit as x,trueHit as S}from"../shaders/constants.js";import{isRectHittest as P,distPointSegment as D,hittestScreenRect as j}from"../shaders/hittestUtils.js";import{getLineAntialiasing as z,getLineThinFactor as A}from"../shaders/LineShader.js";class R extends v{}t([i(10,o)],R.prototype,"accumulatedDistance",void 0),t([i(11,l)],R.prototype,"normal",void 0),t([i(12,l)],R.prototype,"segmentDirection",void 0);class F extends g{}class T extends b{constructor(){super(...arguments),this.type="AnimatedLineShader"}vertex(t,e){const{animationPointerAndBaseSizeAndReferenceSize:i}=t,s=i.xy,{distanceToPx:d,ndc:p,z:u,color:h,isOutline:c,strokeWidth:y,isSDF:f,baseSize:v,scale:b,scaleSymbolsProportionally:g,evalParams:x}=this._vertexPoly(t),S=t.sizing.xy,P=S.x.multiply(v).divide(S.y),D=this.tile.getDisplayZoomFactor(this.
|
|
2
|
+
import{__decorate as t,__param as e}from"tslib";import{location as i,input as s}from"../../GraphShaderModule.js";import{Float as o,Vec2 as l,dot as r,max as a,Vec4 as n,mix as m,length as d,clamp as p,step as u,min as h,ifElse as c,greaterThan as y}from"../../graph/glsl.js";import{PolyHittestVertexInput as f,PolyVertexInput as v,AAnimatedPolyShader as b,PolyFragmentInput as g}from"./AAnimatedPolyShader.js";import{getValue as w}from"./AAnimatedShader.js";import{noHit as x,trueHit as S}from"../shaders/constants.js";import{isRectHittest as P,distPointSegment as D,hittestScreenRect as j}from"../shaders/hittestUtils.js";import{getLineAntialiasing as z,getLineThinFactor as A}from"../shaders/LineShader.js";class R extends v{}t([i(10,o)],R.prototype,"accumulatedDistance",void 0),t([i(11,l)],R.prototype,"normal",void 0),t([i(12,l)],R.prototype,"segmentDirection",void 0);class F extends g{}class T extends b{constructor(){super(...arguments),this.type="AnimatedLineShader"}vertex(t,e){const{animationPointerAndBaseSizeAndReferenceSize:i}=t,s=i.xy,{distanceToPx:d,ndc:p,z:u,color:h,isOutline:c,strokeWidth:y,isSDF:f,baseSize:v,scale:b,scaleSymbolsProportionally:g,evalParams:x}=this._vertexPoly(t),S=t.sizing.xy,P=S.x.multiply(v).divide(S.y),D=this.tile.getDisplayZoomFactor(this.tileContainer),j=w(s,6,x).a.multiply(D),z=t.accumulatedDistance.subtract(j),{normal:A}=t,R=t.normal.y,F=z.divide(D).add(r(t.segmentDirection,t.offset)).divide(P),T=R.add(1).divide(2),W=new l(F,T),q=t.tlbr.divide(this.mosaicInfo.size.xyxy),O=v.divide(2),k=new o(.5).multiply(this.view.antialiasing),C=a(O.add(k),new o(.45)).add(new o(.1).multiply(k));return{glPosition:new n(p,u,1),tlbr:q,uv:W,color:h.multiply(new o(1).subtract(c)),outlineColor:h.multiply(c),distanceToPx:d,strokeWidth:y.multiply(m(new o(1),b,g)),isOutline:c,isSDF:f,halfWidth:C,normal:A,...this.maybeRunHittest(t,e,C)}}fragment(t){const e=this._fragmentPoly(t),i=z(t,this.view.antialiasing),{halfWidth:s,normal:l}=t,r=A(s),a=d(l).multiply(s),n=p(r.multiply(s.subtract(a)).divide(r.subtract(new o(1))),new o(0),new o(1));return this.getFragmentOutput(e.multiply(n).multiply(i),t)}hittest(t,e,i){const{pos0:s,pos1:l,pos2:r}=this.computeHittestTriangle(t,e,null),a=P(this.hittestRequest),{distance:n,smallSymbolDistance:m,smallSymbolSizeThreshold:d,tlbr:p}=this.hittestRequest,f=u(i,d.multiply(.5)).multiply(n.subtract(m)),v=this.hittestRequest.position,b=h(D(v,s,l),D(v,s,r)).subtract(i).add(f);return c(a,j(s,l,r,p),c(y(b,n),new o(x),new o(S)))}}t([e(0,s(R)),e(1,s(f))],T.prototype,"vertex",null),t([e(0,s(F))],T.prototype,"fragment",null);export{T as AnimatedLineShader};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t,__param as e}from"tslib";import{animationDebugFlags as i}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{location as s,input as o,ComputeVertexInput as r}from"../../GraphShaderModule.js";import{Vec2 as l,Float as n,Vec4 as a,ifElse as d,or as u,Bool as m,mix as p,Mat3 as h,lessThan as c,Vec3 as x,distance as y,greaterThan as w,negate as f}from"../../graph/glsl.js";import{AAnimatedVertexInput as g,AAnimatedShader as v,getValue as S,AAnimatedFragmentInput as b}from"./AAnimatedShader.js";import{MarkerConstants as _}from"../markers/markerConstants.js";import{trueHit as V,noHit as
|
|
2
|
+
import{__decorate as t,__param as e}from"tslib";import{animationDebugFlags as i}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{location as s,input as o,ComputeVertexInput as r}from"../../GraphShaderModule.js";import{Vec2 as l,Float as n,Vec4 as a,ifElse as d,or as u,Bool as m,mix as p,Mat3 as h,lessThan as c,Vec3 as x,distance as y,greaterThan as w,negate as f}from"../../graph/glsl.js";import{AAnimatedVertexInput as g,AAnimatedShader as v,getValue as S,AAnimatedFragmentInput as b}from"./AAnimatedShader.js";import{MarkerConstants as _}from"../markers/markerConstants.js";import{trueHit as V,noHit as C}from"../shaders/constants.js";import{isRectHittest as z,hittestMarkerScreenRect as P,distPointTriangle as N,xyToBarycentric as k,inTriangle as R}from"../shaders/hittestUtils.js";import{getBitBool as D}from"../shaders/utils.js";import{getVisualVariableColor as M,getVisualVariableOpacity as j}from"../shaders/vvUtils.js";class q extends g{}t([s(9,l)],q.prototype,"uv",void 0),t([s(10,n)],q.prototype,"angle",void 0);class F extends r{}t([s(11,l)],F.prototype,"offsetNextVertex1",void 0),t([s(12,l)],F.prototype,"offsetNextVertex2",void 0),t([s(13,l)],F.prototype,"textureUVNextVertex1",void 0),t([s(14,l)],F.prototype,"textureUVNextVertex2",void 0);class T extends b{}function U(t,e,i,s){return e.multiply(t.x).add(i.multiply(t.y)).add(s.multiply(t.z))}class A extends v{constructor(){super(...arguments),this.type="AnimatedMarkerShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],uv:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,e){const i=t.uv.divide(this.mosaicInfo.size),{position:s,animationPointer:o,evalParams:r,isOutline:l,unscaledDistanceToPx:c,vvScale:x,strokeWidth:y,scaleSymbolsProportionally:w,scale:f,isSDF:g,baseSize:v,clip:b}=this._vertexPreamble(t,t.angle,t.lineLength||new n(0)),V=this._toNdc(s);let C=S(o,1,r);C=new a(C.rgb.multiply(C.a),C.a);let z=d(D(t.bitset,_.bitset.colorLocked),C,S(o,2,r));z=new a(z.rgb.multiply(z.a),z.a);let P=S(o,3,r);P=new a(P.rgb.multiply(P.a),P.a);const N=S(o,4,r).a,k=S(o,5,r).a,R=M(this,t.id,C,u(D(t.bitset,_.bitset.colorLocked),new m(l))),q=p(R,z,P),F=j(this,t.id),T=p(F,N,k),U=q.multiply(T),A=this.clip(t.id,t.zoomRange).add(b.multiply(2)),I=c.multiply(x);return{glPosition:new a(V,A,1),uv:i,color:U.multiply(new n(1).subtract(l)),outlineColor:U.multiply(l),distanceToPx:I,strokeWidth:y.multiply(p(new n(1),f,w)),isOutline:l,isSDF:g,...this.maybeRunHittest(t,e,{pos:t.pos,size:v,sizeCorrection:new n(1),isMapAligned:new n(1),vvRotationMat3:new h(1,0,0,0,1,0,0,0,1),placementMat3:new h(1,0,0,0,1,0,0,0,1),outlineSize:new n(1),distanceToPx:I,isSDF:g})}}fragment(t){let e=this._getColor(t.uv,{color:t.color,distanceToPx:t.distanceToPx,isSDF:t.isSDF,outlineColor:t.outlineColor,outlineSize:t.strokeWidth});return i.spotlightAnimatedSymbols&&(e=e.add(new a(0,.3,0,.3))),this.getFragmentOutput(e,t)}hittest(t,e,i){const{pos0:s,pos1:o,pos2:r}=this.computeHittestTriangle(t,e,i),l=z(this.hittestRequest);return d(l,()=>{const{tlbr:t}=this.hittestRequest;return P(s,o,r,t)},()=>d(c(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,e,i),this._hittestMarker(t,e,i)))}_hittestSmallMarker(t,e,i){const{position:s,distance:o,smallSymbolDistance:r}=this.hittestRequest,l=o.subtract(r),a=this.tile.getViewScreenMat3(this.view,this.tileContainer).multiply(new x(i.pos,1)).xy,u=i.size.multiply(.5),m=y(a,s).subtract(u).add(l);return d(w(m,this.hittestRequest.distance),new n(C),new n(V))}_hittestMarker(t,e,i){const s=this._vertexPreamble({...t},t.angle,new n(0)).position,o=this._vertexPreamble({...t,offset:e.offsetNextVertex1},t.angle,new n(0)).position,r=this._vertexPreamble({...t,offset:e.offsetNextVertex2},t.angle,new n(0)).position,l=this.hittestRequest.position,a=this.hittestRequest.distance,u=N(l,s,o,r);return d(w(u,a),new n(C),this._hittestSamples(s,o,r,t,e,i))}_hittestSamples(t,e,i,s,o,r){const{outlineSize:u,isSDF:m,distanceToPx:p}=r,h=this.hittestRequest.position,c=this.hittestRequest.distance,x=k(h.add(new l(f(c),f(c))),t,e,i),y=k(h.add(new l(0,f(c))),t,e,i),g=k(h.add(new l(c,f(c))),t,e,i),v=k(h.add(new l(f(c),0)),t,e,i),S=k(h,t,e,i),b=k(h.add(new l(c,0)),t,e,i),_=k(h.add(new l(f(c),c)),t,e,i),z=k(h.add(new l(0,c)),t,e,i),P=k(h.add(new l(c,c)),t,e,i),N=s.uv.divide(this.mosaicInfo.size),D=o.textureUVNextVertex1.divide(this.mosaicInfo.size),M=o.textureUVNextVertex2.divide(this.mosaicInfo.size),j={color:new a(1,1,1,1),outlineSize:u,outlineColor:new a(1,1,1,1),isSDF:m,distanceToPx:p};let q=new n(0);return q=q.add(R(x).multiply(this._getColor(U(x,N,D,M),j).a)),q=q.add(R(y).multiply(this._getColor(U(y,N,D,M),j).a)),q=q.add(R(g).multiply(this._getColor(U(g,N,D,M),j).a)),q=q.add(R(v).multiply(this._getColor(U(v,N,D,M),j).a)),q=q.add(R(S).multiply(this._getColor(U(S,N,D,M),j).a)),q=q.add(R(b).multiply(this._getColor(U(b,N,D,M),j).a)),q=q.add(R(_).multiply(this._getColor(U(_,N,D,M),j).a)),q=q.add(R(z).multiply(this._getColor(U(z,N,D,M),j).a)),q=q.add(R(P).multiply(this._getColor(U(P,N,D,M),j).a)),d(w(q,new n(.05)),new n(V),new n(C))}}t([e(0,o(q)),e(1,o(F))],A.prototype,"vertex",null),t([e(0,o(T))],A.prototype,"fragment",null);export{T as AnimatedMarkerFragmentInput,A as AnimatedMarkerShader,q as AnimatedMarkerVertexInput};
|