@arcgis/core 5.1.0-next.43 → 5.1.0-next.45
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/applications/Components/featureUtils.d.ts +11 -7
- package/arcade/featureset/actions/Adapted.js +1 -1
- package/arcade/featureset/actions/AttributeFilter.js +1 -1
- package/arcade/featureset/actions/OrderBy.js +1 -1
- package/arcade/featureset/actions/SpatialFilter.js +1 -1
- package/arcade/featureset/actions/Top.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
- package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/OrderbyClause.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{eff198e0c21c9767ffaa.js → 0155e5679ded9de5c327.js} +1 -1
- package/assets/esri/core/workers/chunks/128799741dd3c6fc69b9.js +1 -0
- package/assets/esri/core/workers/chunks/13eb0162d95b4d27389c.js +1 -0
- package/assets/esri/core/workers/chunks/{0836964a65f76da35b5c.js → 1a3f874700f86b750390.js} +23 -23
- package/assets/esri/core/workers/chunks/1a481f3ae3146682eb00.js +1 -0
- package/assets/esri/core/workers/chunks/1cce2f8837ad765acf44.js +1 -0
- package/assets/esri/core/workers/chunks/2379c64b0ca30814a815.js +1 -0
- package/assets/esri/core/workers/chunks/23a9070e9362b8439770.js +1 -0
- package/assets/esri/core/workers/chunks/25e4568a3ff76f48ac5e.js +1 -0
- package/assets/esri/core/workers/chunks/{dbedd246f4b584583f95.js → 288bd32831e94e81653e.js} +1 -1
- package/assets/esri/core/workers/chunks/2b3a8a53cd68f666676b.js +1 -0
- package/assets/esri/core/workers/chunks/{4d16b6ac52e25bd7e6aa.js → 32a51ce8e1a362115c89.js} +1 -1
- package/assets/esri/core/workers/chunks/{392941013107bbd96503.js → 365ad1ffd496ed86637b.js} +1 -1
- package/assets/esri/core/workers/chunks/375eac59c9f88c7572db.js +2 -0
- package/assets/esri/core/workers/chunks/{eab74d830c2eaa9d133b.js → 4869e2f35aaf6b058281.js} +1 -1
- package/assets/esri/core/workers/chunks/{10941b50f5933d168df6.js → 521a671182b0f79e3624.js} +1 -1
- package/assets/esri/core/workers/chunks/{c2f3fc1b34a6782b431f.js → 5351e71ce7839636d06d.js} +1 -1
- package/assets/esri/core/workers/chunks/5b515b5741733bcb4645.js +1 -0
- package/assets/esri/core/workers/chunks/{1669f1bf959c4e3083da.js → 5c0b3c76a7bc971c61dc.js} +1 -1
- package/assets/esri/core/workers/chunks/5c830cce32710d70dfa6.js +1 -0
- package/assets/esri/core/workers/chunks/5e9bd5ed6ecee5b15127.js +1 -0
- package/assets/esri/core/workers/chunks/5f2e246ffcbdedea4de5.js +1 -0
- package/assets/esri/core/workers/chunks/617328964d480d4a3a45.js +1 -0
- package/assets/esri/core/workers/chunks/64da1ad9df9094ef5c12.js +1 -0
- package/assets/esri/core/workers/chunks/650614a9e4871714c42e.js +1 -0
- package/assets/esri/core/workers/chunks/66baacbef23291eab853.js +1 -0
- package/assets/esri/core/workers/chunks/7278cc37e85f0242f19b.js +1 -0
- package/assets/esri/core/workers/chunks/{3c597d8ef898627b8f93.js → 768bbc910be6c65ac107.js} +1 -1
- package/assets/esri/core/workers/chunks/{a1f36240a31057f998da.js → 79dc7045d9a2d43ba8df.js} +1 -1
- package/assets/esri/core/workers/chunks/{f9da5c81535eaffc8b9c.js → 7f07f490c6fcc794c8d9.js} +1 -1
- package/assets/esri/core/workers/chunks/{2b386374330d96387aec.js → 851fc5290497991ba001.js} +1 -1
- package/assets/esri/core/workers/chunks/{7132420980f77b6a871b.js → 8cafdd4addd366795600.js} +1 -1
- package/assets/esri/core/workers/chunks/{30cdb2d1d9f018f1642d.js → 9032c040b214b5af775b.js} +1 -1
- package/assets/esri/core/workers/chunks/{ff8ec6369c8a1bee9bb4.js → 908f171b9c512d738dea.js} +1 -1
- package/assets/esri/core/workers/chunks/{c7799ba861ac5af08e6a.js → 92d4e962284e13ba2fc5.js} +1 -1
- package/assets/esri/core/workers/chunks/970d971551e42f7ae08d.js +1 -0
- package/assets/esri/core/workers/chunks/9802770413ad814dab29.js +1 -0
- package/assets/esri/core/workers/chunks/{6e8cfe69617876ee0dac.js → a69f1879735a031f62e9.js} +1 -1
- package/assets/esri/core/workers/chunks/{af804beb43d4d10c54d9.js → a9f35127c3f5bf42036b.js} +1 -1
- package/assets/esri/core/workers/chunks/b5ced451d331ca1ffb68.js +1 -0
- package/assets/esri/core/workers/chunks/beb53b372d356800f333.js +1 -0
- package/assets/esri/core/workers/chunks/{8f12a559dbf284c21e2f.js → bf4d2f42d31861ea1046.js} +1 -1
- package/assets/esri/core/workers/chunks/c2aa3b1344b42a904234.js +1 -0
- package/assets/esri/core/workers/chunks/{9a9b1250be3e20499d75.js → ca88a364ef911526102e.js} +1 -1
- package/assets/esri/core/workers/chunks/cdeb6aec578a1c07d663.js +1 -0
- package/assets/esri/core/workers/chunks/cf5e4cf9b1aa37eeb6b0.js +1 -0
- package/assets/esri/core/workers/chunks/d0adf059085ddf7151dd.js +1 -0
- package/assets/esri/core/workers/chunks/d2af5342fbe80e2d8c60.js +1 -0
- package/assets/esri/core/workers/chunks/d3d024b3d2bb8fbbf760.js +1 -0
- package/assets/esri/core/workers/chunks/{80bfb5e5d613d2c412bf.js → dbafe96ce37bb82d0584.js} +1 -1
- package/assets/esri/core/workers/chunks/e4e0c5a45cf32973d5d5.js +1 -0
- package/assets/esri/core/workers/chunks/{093aa05fbde548bf9040.js → e5927f9d0e757ec4c22a.js} +1 -1
- package/assets/esri/core/workers/chunks/{b15a02bdcd78a1a51bd6.js → e72ca52d930afb5650af.js} +1 -1
- package/assets/esri/core/workers/chunks/{465cc0e00f03cdb640b2.js → e7402dfd683f82878360.js} +1 -1
- package/assets/esri/core/workers/chunks/{8838ff9668b472af16a1.js → ef0eae13408cbf83a64f.js} +1 -1
- package/assets/esri/core/workers/chunks/f1767b8ba82fdd9bd947.js +1 -0
- package/assets/esri/core/workers/chunks/{f835eea9f617556c7276.js → f6e3954ddbb5993d56df.js} +1 -1
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Grid.scss +5 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_en.json +1 -1
- package/chunks/ComponentShader.glsl.js +11 -11
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/HUDMaterial.glsl.js +28 -36
- package/chunks/ImageMaterial.glsl.js +1 -1
- package/chunks/Jpg.js +1 -1
- package/chunks/Path.glsl.js +7 -7
- package/chunks/Pattern.glsl.js +1 -1
- package/chunks/RibbonLine.glsl.js +2 -2
- package/chunks/ShadowHighlight.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +5 -5
- package/chunks/Water.glsl.js +5 -5
- package/chunks/Zlib.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/chunks/vxlLayer.js +1 -1
- package/config.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/geometry/support/zscale.js +1 -1
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/SceneLayer.d.ts +16 -10
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/ogc/ogcFeatureUtils.js +1 -1
- package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
- package/layers/raster/formats/JpgPlus.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/raster/formats/TiffDecoder.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/save/groupLayerUtils.js +1 -1
- package/layers/save/mapImageLayerUtils.js +1 -1
- package/layers/support/Sublayer.d.ts +6 -0
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/package.json +3 -3
- package/rest/query/operations/pbfFeatureSetUtils.js +1 -1
- package/rest/query/operations/pbfFlatFeatureSet.js +1 -1
- package/rest/query/operations/pbfOptimizedFeatureSet.js +1 -1
- package/support/revision.js +1 -1
- package/third-party-notices.txt +2 -2
- package/views/2d/engine/ManagedCanvas.js +1 -1
- package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
- package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
- package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
- package/views/2d/engine/webgl/GlyphSource.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
- package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/terrain/OverlayRenderTargets.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentDrawParameters.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +2 -2
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutputConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlightOverlay.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
- package/views/3d/webgl-engine/effects/WeatherFader.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/ObjectAndLayerIDRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/RenderContext.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +10 -10
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDynamic.js +1 -1
- package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +1 -1
- package/widgets/Editor.d.ts +2 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/assets/esri/core/workers/chunks/02a0a58ca5916db1db19.js +0 -1
- package/assets/esri/core/workers/chunks/03c8453ae72a4e190252.js +0 -1
- package/assets/esri/core/workers/chunks/04981ae9d7728208ffce.js +0 -1
- package/assets/esri/core/workers/chunks/0e669a04999feb9f98c9.js +0 -1
- package/assets/esri/core/workers/chunks/23af269e88f9ac101ffb.js +0 -1
- package/assets/esri/core/workers/chunks/244dd7a948ca8a7dc6ef.js +0 -1
- package/assets/esri/core/workers/chunks/26cafd20c8d03c274389.js +0 -1
- package/assets/esri/core/workers/chunks/2fa86dacc8a12a6a6c43.js +0 -1
- package/assets/esri/core/workers/chunks/3e26f9af6b8c75bad97a.js +0 -1
- package/assets/esri/core/workers/chunks/42b556d56013350c9d80.js +0 -1
- package/assets/esri/core/workers/chunks/5a6a6e7151085a3cd3dd.js +0 -1
- package/assets/esri/core/workers/chunks/5eb9fdb076488de9cd83.js +0 -1
- package/assets/esri/core/workers/chunks/65865c25487d23dd2e31.js +0 -1
- package/assets/esri/core/workers/chunks/65ea5028eb12457a3aeb.js +0 -1
- package/assets/esri/core/workers/chunks/73a008b48e29eb6f2064.js +0 -2
- package/assets/esri/core/workers/chunks/80a1ccabd4257cc61e0d.js +0 -1
- package/assets/esri/core/workers/chunks/8333561a938bcdf6c2e6.js +0 -1
- package/assets/esri/core/workers/chunks/91718795fc4ca6516ac7.js +0 -1
- package/assets/esri/core/workers/chunks/93846f8b77fc802069a7.js +0 -1
- package/assets/esri/core/workers/chunks/9b80569819cd1c72a9ff.js +0 -1
- package/assets/esri/core/workers/chunks/b056b4c79bcd542dd1d2.js +0 -1
- package/assets/esri/core/workers/chunks/b553264db0f10bb8c5f7.js +0 -1
- package/assets/esri/core/workers/chunks/b6e63d8ce3c9ac9762f4.js +0 -1
- package/assets/esri/core/workers/chunks/c1cae45a159a5373ac00.js +0 -1
- package/assets/esri/core/workers/chunks/c4f64195e44986644993.js +0 -1
- package/assets/esri/core/workers/chunks/ca6012135929b028ea1b.js +0 -1
- package/assets/esri/core/workers/chunks/de79645e559a2d1ffa67.js +0 -1
- package/assets/esri/core/workers/chunks/ea356a5b90ea44b5cbe1.js +0 -1
- package/assets/esri/core/workers/chunks/f0e6a26a3625068b08ab.js +0 -1
- package/assets/esri/core/workers/chunks/f36a234ef35faf8ca04d.js +0 -1
- package/views/2d/engine/vectorTiles/GlyphMosaic.js +0 -2
- package/views/2d/engine/vectorTiles/GlyphSource.js +0 -2
- package/views/2d/engine/vectorTiles/RectangleBinPack.js +0 -2
- /package/assets/esri/core/workers/chunks/{73a008b48e29eb6f2064.js.LICENSE.txt → 375eac59c9f88c7572db.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{sliceEquals as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as r}from"../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{watch as a,sync as o}from"../../../../core/reactiveUtils.js";import{signal as n}from"../../../../core/signal.js";import{property as h,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{copy as u,equals as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as m}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{BindParameters as d}from"./BindParameters.js";import{DepthRange as p}from"./DepthRange.js";import{createQuadVAO as f}from"./glUtil3D.js";import{ShadowCastRenderer as g,shadowCastDisabledElevationThreshold as b,shadowCastDisableElevationMax as v,shadowCastDisableElevationMin as S}from"./ShadowCastRenderer.js";import{ShadowMap as y}from"./ShadowMap.js";import{S as w}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as A}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as F}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as R}from"../shaders/ShadowCastClearTechnique.js";import{TaskPriority as x}from"../../../support/Scheduler.js";import{PixelType as C}from"../../../webgl/enums.js";let H=class extends t{constructor(e,t,i,r,s,n){super({}),this._fbos=e,this._techniques=t,this._stage=i,this._prepareForShadowMapPass=r,this._renderToShadowMap=s,this._requestRender=n,this._primarySet=new j(new F(0),()=>this._requestRenderIfEnabled()),this._contextSet=new j(new F(1),()=>this._requestRenderIfEnabled()),this._passParameters=new m,this._depthRange=p.Zero,this._enabled=!1,this._previewing=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._bindParameters=new d(e.rctx
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{sliceEquals as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as r}from"../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{watch as a,sync as o}from"../../../../core/reactiveUtils.js";import{signal as n}from"../../../../core/signal.js";import{property as h,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{copy as u,equals as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as m}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{BindParameters as d}from"./BindParameters.js";import{DepthRange as p}from"./DepthRange.js";import{createQuadVAO as f}from"./glUtil3D.js";import{ShadowCastRenderer as g,shadowCastDisabledElevationThreshold as b,shadowCastDisableElevationMax as v,shadowCastDisableElevationMin as S}from"./ShadowCastRenderer.js";import{ShadowMap as y}from"./ShadowMap.js";import{S as w}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as A}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as F}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as R}from"../shaders/ShadowCastClearTechnique.js";import{TaskPriority as x}from"../../../support/Scheduler.js";import{PixelType as C}from"../../../webgl/enums.js";let H=class extends t{constructor(e,t,i,r,s,n){super({}),this._fbos=e,this._techniques=t,this._stage=i,this._prepareForShadowMapPass=r,this._renderToShadowMap=s,this._requestRender=n,this._primarySet=new j(new F(0),()=>this._requestRenderIfEnabled()),this._contextSet=new j(new F(1),()=>this._requestRenderIfEnabled()),this._passParameters=new m,this._depthRange=p.Zero,this._enabled=!1,this._previewing=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._bindParameters=new d(e.rctx,new y(e,i.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=f(e.rctx),this._accumulationRenderer=new g(t,e.rctx,this,n);const h=this._stage.view.resourceController.scheduler;this.addHandles([h.registerTask(x.SHADOW_ACCUMULATOR,this),a(()=>this._previewing,e=>{e?this._invalidateAccumulationSets():this._requestRenderIfEnabled()},o),a(()=>this._numActive,()=>this._numActiveChanged(),o),a(()=>this._depthRange,()=>this._invalidateAccumulationSets(),o),a(()=>this.accumulating&&this.canAccumulate,()=>this._precompile(),{sync:!0,once:!0})],this._shadowAccumulatorKey)}destroy(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=s(this._accumulationRenderer),this._bindParameters.shadowMap.dispose(),this._fboHandle=s(this._fboHandle),this._vao=s(this._vao);for(const e of this._accumulationSets())e.destroy();this._contextSet=null,this._primarySet=null,this._bindParameters.destroy()}*_accumulationSets(){yield this._primarySet,yield this._contextSet}get computedSamples(){return[this._primarySet.progress,this._contextSet.progress]}get shadowCastTexture(){return this._fboHandle?.getTexture()}get accumulating(){return this.active&&this._previewing||this._refining}get _refining(){return this.active&&!this._doneAccumulating&&!this._previewing}get active(){return this._enabled&&[...this._accumulationSets()].some(e=>e.active)}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==p.Zero&&this._opacityFromElevation>b}get _doneAccumulating(){return[...this._accumulationSets()].every(e=>e.doneAccumulating)}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get _numActive(){return[...this._accumulationSets()].reduce((e,t)=>e+(t.active?1:0),0)}get _colorFormat(){return 2===this._numActive?2:0}get readyToRun(){return this._refining&&this.canAccumulate&&[...this._accumulationSets()].some(e=>e.running)}_precompile(){for(const e of this._accumulationSets())this._techniques.precompile(A,e.configuration),this._techniques.precompile(R,e.configuration)}runTask(e){this._clearBuffersOnAccumulationStart(),this._prepareForShadowMapPass(this._bindParameters);let t=!1;for(const i of this._accumulationSets())this._runTaskForSet(i,e)&&(t=!0);t&&this._requestRender()}_runTaskForSet(e,t){let i=!1;for(;!t.done&&!e.doneAccumulating;)this._accumulateShadow(e),t.madeProgress(),i=!0;return i}renderAccumulation(e,t,i,r){return this._updateCamera(t),this._bindParameters.contentCamera=i,this._bindParameters.depth=e,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!(!this.accumulating||!this.canAccumulate)&&(this._previewing||r?(this._clearFramebuffer(),this._reset()):this._clearBuffersOnAccumulationStart(),this._accumulateSetsForRenderFrame(r))}_clearBuffersOnAccumulationStart(){if([...this._accumulationSets()].every(e=>0===e.progress))this._clearFramebuffer();else for(const e of this._accumulationSets())0===e.progress&&this._clearFramebufferForSet(this._fboHandle,e)}_accumulateSetsForRenderFrame(e){let t=!1;for(const i of this._accumulationSets())this._accumulateSetForRenderFrame(i,e)&&(t=!0);return t&&this._requestRender(),t}_accumulateSetForRenderFrame(e,t){let i=t?e.sampleCount:Math.min(q,e.sampleCount);i-=e.progress;for(let r=0;r<i;++r)this._accumulateShadow(e);return i>0}precompile(){this._accumulationRenderer.precompile()}render(e){this._accumulationRenderer.render(e)}setParameters(e){void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._primarySet.lightDirections=e.lightDirections),void 0!==e.lightDirectionsContext&&(this._contextSet.lightDirections=e.lightDirectionsContext),!0===e.enabled?this._enable():!1===e.enabled&&this._disable(),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){const i=this._primarySet.progress;return!this.active||!this._fboHandle||i<1||e<0||e>=this._fboHandle.fbo.width||t<0||t>=this._fboHandle.fbo.height?0:(this._fboHandle.fbo.readPixels(e,t,1,1,6408,C.UNSIGNED_BYTE,P),P[0]/i)}_numActiveChanged(){if(!this._enabled||!this._fboHandle)return;const e=2===this._numActive,{width:t,height:i}=this._fboHandle.fbo,r=this._createFBO(t,i);e&&(this._clearFramebuffer(r),this._contextSet.reset()),this._rctx.blitFramebuffer(this._fboHandle.fbo,r.fbo),this._fboHandle.dispose(),this._fboHandle=r,this._requestRender()}_enable(){this._enabled||(this._enabled=!0,this._invalidateAccumulationSets())}_disable(){this._enabled&&(this._fboHandle=s(this._fboHandle),this._enabled=!1,this._requestRender())}_createFBO(e,t){return this._fbos.acquire(e,t,"shadow accumulation",this._colorFormat)}_invalidateAccumulationSets(){for(const e of this._accumulationSets())e.reset();this._requestRenderIfEnabled()}_reset(){for(const e of this._accumulationSets())e.reset()}_clearFramebuffer(e=this._fboHandle){e&&(this._rctx.bindFramebuffer(e.fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(16384))}_clearFramebufferForSet(e,t){if(!e)return;const i=this._techniques.get(R,t.configuration);this._rctx.bindFramebuffer(e.fbo),this._rctx.bindTechnique(i,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(i.primitiveType,0,this._vao.vertexCount("geometry"))}_accumulateShadow(e){this._renderToShadowMap(this._bindParameters,e.lightDirections[e.progress++],this._depthRange);const t=this._techniques.get(A,e.configuration);this._rctx.bindFramebuffer(this._fboHandle?.fbo),this._rctx.bindTechnique(t,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(t.primitiveType,0,this._vao.vertexCount("geometry"))}_updateCamera(e){if(!this._enabled)return;const t=this._bindParameters.camera;e.equals(t)||t.copyFrom(e),this._fboHandle?.fbo.width===e.fullWidth&&this._fboHandle?.fbo.height===e.fullHeight||(this._fboHandle?.release(),this._fboHandle=this._createFBO(e.fullWidth,e.fullHeight)),this._opacityFromElevation=1-r(S,v,e.relativeElevation)}_requestRenderIfEnabled(){this._enabled&&this._requestRender()}get _rctx(){return this._fbos.rctx}updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e)}get test(){}};e([h()],H.prototype,"_refining",null),e([h()],H.prototype,"active",null),e([h()],H.prototype,"canAccumulate",null),e([h()],H.prototype,"_doneAccumulating",null),e([h()],H.prototype,"_opacityFromElevation",null),e([h()],H.prototype,"_numActive",null),e([h()],H.prototype,"_colorFormat",null),e([h()],H.prototype,"readyToRun",null),e([h()],H.prototype,"_depthRange",void 0),e([h()],H.prototype,"_enabled",void 0),e([h()],H.prototype,"_previewing",void 0),e([h()],H.prototype,"_accumulationRenderer",void 0),H=e([c("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],H);const q=6,P=new Uint8Array(4);class j{constructor(e,t){this.configuration=e,this._notifyChange=t,this._cachedLightDirections=[],this._progress=n(0),this._sampleCount=n(0)}get progress(){return this._progress.value}set progress(e){this._progress.value=e}get sampleCount(){return this._sampleCount.value}get doneAccumulating(){return this.progress>=this.sampleCount}get running(){return this.progress>0}get active(){return this.sampleCount>0}get lightDirections(){return this._cachedLightDirections}set lightDirections(e){const t=this._cachedLightDirections,r=Math.min(w,e.length);if(!i(t,0,t.length,e,0,r,l)){t.length=r,this._sampleCount.value=r;for(let i=0;i<r;++i)t[i]=u(t[i]??_(),e[i]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}precompile(e){e.precompile(A,this.configuration),e.precompile(R,this.configuration)}}export{H as ShadowAccumulator};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import has from"../../../../core/has.js";import{clamp as t,lerp as s,acosClamped as e}from"../../../../core/mathUtils.js";import{releaseMaybe as i}from"../../../../core/maybe.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{translate as r,multiply as h,invert as c,lookAt as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as n,create as u}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as l,add as m,scale as d,lerp as _,squaredDistance as g,subtract as f,dot as p,negate as x,normalize as b,copy as w}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as M}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as C,copy as j,negate as y,transformMat4 as v,set as H}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as D}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as O,transformMat4 as Q}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as L}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{CascadeCamera as S}from"./CascadeCamera.js";import{applyTextureResizeModulo as V}from"./textureUtils.js";import{assert as N,logWithBase as T,verify as F,rayRay2D as R}from"./Util.js";import{DepthStencilAttachment as W}from"../../../webgl/enums.js";class z{constructor(){this.camera=new S,this.lightMat=u()}}class A{constructor(){this.maxNumCascadesHighQuality=4,this.maxNumCascadesLowQuality=4,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.splitSchemeLambda=0}}class I{constructor(t,s){this._fbos=t,this._viewingMode=s,this._enabled=!1,this._outputs=new Array,this._textureHeight=0,this._numCascades=1,this.settings=new A,this._projectionView=u(),this._projectionViewInverse=u(),this._modelViewLight=u(),this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=L(),this._cascades=[new z,new z,new z,new z],this._lastOrigin=null,this._maxTextureWidth=Math.min(has("esri-mobile")?4096:16384,t.rctx.parameters.maxTextureSize)}dispose(){this.enabled=!1}disposeOutputs(){this._handle=i(this._handle),this._outputs.forEach(t=>t?.release()),this._outputs.length=0}disposeOutput(t){this._outputs[t]=i(this._outputs[t])}set maxCascades(s){this.settings.maxNumCascadesHighQuality=t(Math.floor(s),1,4)}get maxCascades(){return this.settings.maxNumCascadesHighQuality}set enabled(t){this._enabled=t,t||this.disposeOutputs()}get enabled(){return this._enabled}get ready(){return!!this.getOutput(
|
|
2
|
+
import has from"../../../../core/has.js";import{clamp as t,lerp as s,acosClamped as e}from"../../../../core/mathUtils.js";import{releaseMaybe as i}from"../../../../core/maybe.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{translate as r,multiply as h,invert as c,lookAt as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as n,create as u}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as l,add as m,scale as d,lerp as _,squaredDistance as g,subtract as f,dot as p,negate as x,normalize as b,copy as w}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as M}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as C,copy as j,negate as y,transformMat4 as v,set as H}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as D}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as O,transformMat4 as Q}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as L}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{CascadeCamera as S}from"./CascadeCamera.js";import{applyTextureResizeModulo as V}from"./textureUtils.js";import{assert as N,logWithBase as T,verify as F,rayRay2D as R}from"./Util.js";import{DepthStencilAttachment as W}from"../../../webgl/enums.js";class z{constructor(){this.camera=new S,this.lightMat=u()}}class A{constructor(){this.maxNumCascadesHighQuality=4,this.maxNumCascadesLowQuality=4,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.splitSchemeLambda=0}}class I{constructor(t,s){this._fbos=t,this._viewingMode=s,this._enabled=!1,this._outputs=new Array,this._textureHeight=0,this._numCascades=1,this.settings=new A,this._projectionView=u(),this._projectionViewInverse=u(),this._modelViewLight=u(),this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=L(),this._cascades=[new z,new z,new z,new z],this._lastOrigin=null,this._maxTextureWidth=Math.min(has("esri-mobile")?4096:16384,t.rctx.parameters.maxTextureSize)}dispose(){this.enabled=!1}disposeOutputs(){this._handle=i(this._handle),this._outputs.forEach(t=>t?.release()),this._outputs.length=0}disposeOutput(t){this._outputs[t]=i(this._outputs[t])}set maxCascades(s){this.settings.maxNumCascadesHighQuality=t(Math.floor(s),1,4)}get maxCascades(){return this.settings.maxNumCascadesHighQuality}set enabled(t){this._enabled=t,t||this.disposeOutputs()}get enabled(){return this._enabled}get ready(){return!!this.getOutput(5)||!!this.getOutput(7)}get cascades(){for(let t=0;t<this._numCascades;++t)X[t]=this._cascades[t];return X.length=this._numCascades,X}start(t,s,e,i,a){N(this.enabled);const{near:r,far:h}=xt(e);this._computeCascadeDistances(r,h,i),this._textureHeight=this._computeTextureHeight(t,a,i),this._setupMatrices(t,s);const{viewMatrix:c,projectionMatrix:o}=t;for(let n=0;n<this._numCascades;++n)this._constructCascade(n,o,c,s);this._lastOrigin=null,this.clear()}getShadowMapMatrices(t){if(!this._lastOrigin||!C(t,this._lastOrigin)){this._lastOrigin=this._lastOrigin||D(),j(this._lastOrigin,t);for(let s=0;s<this._numCascades;++s){r(Z,this._cascades[s].lightMat,t);for(let t=0;t<16;++t)$[16*s+t]=Z[t]}}return $}finish(t){N(this.enabled),this._outputs[t]?.release(),this._outputs[t]=this._handle,this._handle?.setName(6===t?"shadow map highlight":"shadow map excluding highlight"),this._handle=null}getOutput(t){return this.enabled?this._outputs[t]?.getTexture(W):null}clear(){this._ensureFbo(),this.bindFramebuffer(),this._fbos.rctx.clear(256)}_computeTextureHeight({pixelRatio:t,fullWidth:s,fullHeight:e},i,a){const r=Math.min(window.devicePixelRatio,i)/t,h=a?this.settings.textureSizeModHighQuality:this.settings.textureSizeModLowQuality;return V(Math.max(s,e)*r*h,this._maxTextureWidth/this._numCascades)}_ensureFbo(){this._handle?.fbo?.width===this._textureWidth&&this._handle?.fbo.height===this._textureHeight||(this._handle?.release(),this._handle=this._fbos.acquire(this._textureWidth,this._textureHeight,"shadow map",12),this._handle.getTexture(W)?.setShadowFiltering(!0))}bindFramebuffer(){this._fbos.rctx.bindFramebuffer(this._handle?.fbo)}_constructCascade(t,s,e,i){const a=this._cascades[t],c=-this._cascadeDistances[t],o=-this._cascadeDistances[t+1],n=(s[10]*c+s[14])/Math.abs(s[11]*c+s[15]),u=(s[10]*o+s[14])/Math.abs(s[11]*o+s[15]);N(n<u);for(let r=0;r<8;++r){O(q,r%4==0||r%4==3?-1:1,r%4==0||r%4==1?-1:1,r<4?n:u,1);const t=E[r];Q(t,q,this._projectionViewInverse),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3]}y(K,E[0]),a.camera.viewMatrix=r(U,this._modelViewLight,K);for(let r=0;r<8;++r)v(E[r],E[r],a.camera.viewMatrix);let l=E[0][2],m=E[0][2];for(let r=1;r<8;++r)l=Math.min(l,E[r][2]),m=Math.max(m,E[r][2]);l-=200,m+=200,a.camera.near=-m,a.camera.far=-l,pt(e,i,l,m,a.camera),h(a.lightMat,a.camera.projectionMatrix,a.camera.viewMatrix);const d=this._textureHeight;a.camera.viewport=[t*d,0,d,d]}_setupMatrices(t,s){h(this._projectionView,t.projectionMatrix,t.viewMatrix),c(this._projectionViewInverse,this._projectionView);const e=1===this._viewingMode?t.eye:H(K,0,0,1);o(this._modelViewLight,[0,0,0],[-s[0],-s[1],-s[2]],e)}_computeCascadeDistances(t,e,i){const a=i?this.settings.maxNumCascadesHighQuality:this.settings.maxNumCascadesLowQuality;this._numCascades=Math.min(1+Math.floor(T(e/t,4)),a);const r=(e-t)/this._numCascades,h=(e/t)**(1/this._numCascades);let c=t,o=t;for(let n=0;n<this._numCascades+1;++n)this._cascadeDistances[n]=s(c,o,this.settings.splitSchemeLambda),c*=h,o+=r}get _textureWidth(){return this._textureHeight*this._numCascades}get numCascades(){return this._numCascades}get cascadeDistances(){return O(this._usedCascadeDistances,this._cascadeDistances[0],this._numCascades>1?this._cascadeDistances[1]:1/0,this._numCascades>2?this._cascadeDistances[2]:1/0,this._numCascades>3?this._cascadeDistances[3]:1/0)}get test(){}}const U=u(),q=L(),E=[];for(let bt=0;bt<8;++bt)E.push(L());const P=M(),k=M(),B=M(),G=M(),J=M(),K=D(),X=[];function Y(){X.length=0}const Z=u(),$=n.concat(n,n,n),tt=M(),st=M(),et=[M(),M(),M(),M()],it=M(),at=M(),rt=M(),ht=M(),ct=M(),ot=M(),nt=M();function ut(t,s,e,i,a,r,h,c){l(tt,0,0);for(let l=0;l<4;++l)m(tt,tt,t[l]);d(tt,tt,.25),l(st,0,0);for(let l=4;l<8;++l)m(st,st,t[l]);d(st,st,.25),_(et[0],t[4],t[5],.5),_(et[1],t[5],t[6],.5),_(et[2],t[6],t[7],.5),_(et[3],t[7],t[4],.5);let o=0,n=g(et[0],tt);for(let l=1;l<4;++l){const t=g(et[l],tt);t<n&&(n=t,o=l)}f(it,et[o],t[o+4]);const u=it[0];let M,C;it[0]=-it[1],it[1]=u,f(at,st,tt),p(at,it)<0&&x(it,it),_(it,it,at,e),b(it,it),M=C=p(f(rt,t[0],tt),it);for(let l=1;l<8;++l){const s=p(f(rt,t[l],tt),it);s<M?M=s:s>C&&(C=s)}w(i,tt),d(rt,it,M-s),m(i,i,rt);let j=-1,y=1,v=0,H=0;for(let l=0;l<8;++l){f(ht,t[l],i),b(ht,ht);const s=it[0]*ht[1]-it[1]*ht[0];s>0?s>j&&(j=s,v=l):s<y&&(y=s,H=l)}F(j>0,"leftArea"),F(y<0,"rightArea"),d(ct,it,M),m(ct,ct,tt),d(ot,it,C),m(ot,ot,tt),nt[0]=-it[1],nt[1]=it[0];const D=R(i,t[H],ot,m(rt,ot,nt),1,a),O=R(i,t[v],ot,rt,1,r),Q=R(i,t[v],ct,m(rt,ct,nt),1,h),L=R(i,t[H],ct,rt,1,c);F(D,"rayRay"),F(O,"rayRay"),F(Q,"rayRay"),F(L,"rayRay")}function lt(t,s){return 3*s+t}const mt=M();function dt(t,s){return l(mt,t[s],t[s+3]),mt}const _t=M(),gt=a();function ft(t,s,e,i,a){f(_t,e,i),d(_t,_t,.5),gt[0]=_t[0],gt[1]=_t[1],gt[2]=0,gt[3]=_t[1],gt[4]=-_t[0],gt[5]=0,gt[6]=_t[0]*_t[0]+_t[1]*_t[1],gt[7]=_t[0]*_t[1]-_t[1]*_t[0],gt[8]=1,gt[lt(0,2)]=-p(dt(gt,0),t),gt[lt(1,2)]=-p(dt(gt,1),t);let r=p(dt(gt,0),e)+gt[lt(0,2)],h=p(dt(gt,1),e)+gt[lt(1,2)],c=p(dt(gt,0),i)+gt[lt(0,2)],o=p(dt(gt,1),i)+gt[lt(1,2)];r=-(r+c)/(h+o),gt[lt(0,0)]+=gt[lt(1,0)]*r,gt[lt(0,1)]+=gt[lt(1,1)]*r,gt[lt(0,2)]+=gt[lt(1,2)]*r,r=1/(p(dt(gt,0),e)+gt[lt(0,2)]),h=1/(p(dt(gt,1),e)+gt[lt(1,2)]),gt[lt(0,0)]*=r,gt[lt(0,1)]*=r,gt[lt(0,2)]*=r,gt[lt(1,0)]*=h,gt[lt(1,1)]*=h,gt[lt(1,2)]*=h,gt[lt(2,0)]=gt[lt(1,0)],gt[lt(2,1)]=gt[lt(1,1)],gt[lt(2,2)]=gt[lt(1,2)],gt[lt(1,2)]+=1,r=p(dt(gt,1),s)+gt[lt(1,2)],h=p(dt(gt,2),s)+gt[lt(2,2)],c=p(dt(gt,1),e)+gt[lt(1,2)],o=p(dt(gt,2),e)+gt[lt(2,2)],r=-.5*(r/h+c/o),gt[lt(1,0)]+=gt[lt(2,0)]*r,gt[lt(1,1)]+=gt[lt(2,1)]*r,gt[lt(1,2)]+=gt[lt(2,2)]*r,r=p(dt(gt,1),s)+gt[lt(1,2)],h=p(dt(gt,2),s)+gt[lt(2,2)],c=-h/r,gt[lt(1,0)]*=c,gt[lt(1,1)]*=c,gt[lt(1,2)]*=c,a[0]=gt[0],a[1]=gt[1],a[2]=0,a[3]=gt[2],a[4]=gt[3],a[5]=gt[4],a[6]=0,a[7]=gt[5],a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=gt[6],a[13]=gt[7],a[14]=0,a[15]=gt[8]}function pt(t,s,i,a,r){const h=1/E[0][3],c=1/E[4][3];N(h<c);let o=h+Math.sqrt(h*c);const n=Math.sin(e(t[2]*s[0]+t[6]*s[1]+t[10]*s[2]));o/=n,ut(E,o,n,P,k,B,G,J),ft(P,k,G,J,r.projectionMatrix),r.projectionMatrix[10]=2/(i-a),r.projectionMatrix[14]=-(i+a)/(i-a)}function xt(t){let{near:s,far:e}=t;return s<2&&(s=2),e<2&&(e=2),s>=e&&(s=2,e=4),{near:s,far:e}}export{I as ShadowMap,Y as cleanupShadowmap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{addMany as r,filterInPlace as t}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{someMap as s,everyMap as i}from"../../../../core/MapUtils.js";import n from"../../../../core/PooledArray.js";import{property as o,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{OverlayTarget as h}from"../../terrain/Intersector.js";import{ChangeSet as c,RenderGeometryUpdate as l}from"./ChangeSet.js";import{IntersectorResult as p}from"./IntersectorResult.js";import{RendererBase as u}from"./RendererBase.js";import{noBudget as g}from"../../../support/Scheduler.js";let m=class extends u{constructor(e){super(e),this._pending=new y,this._changes=new c,this._sortedRenderers=new n,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return s(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOccluders(){return this.renderers&&s(this.renderers,e=>e.hasOnlyOccluders)}get hasOnlyOccluders(){return i(this.renderers,e=>e.hasOnlyOccluders)}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,g,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=s(this.renderers,e=>{const r=e.produces.get(19);return!!r&&r(
|
|
2
|
+
import{__decorate as e}from"tslib";import{addMany as r,filterInPlace as t}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{someMap as s,everyMap as i}from"../../../../core/MapUtils.js";import n from"../../../../core/PooledArray.js";import{property as o,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{OverlayTarget as h}from"../../terrain/Intersector.js";import{ChangeSet as c,RenderGeometryUpdate as l}from"./ChangeSet.js";import{IntersectorResult as p}from"./IntersectorResult.js";import{RendererBase as u}from"./RendererBase.js";import{noBudget as g}from"../../../support/Scheduler.js";let m=class extends u{constructor(e){super(e),this._pending=new y,this._changes=new c,this._sortedRenderers=new n,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return s(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOccluders(){return this.renderers&&s(this.renderers,e=>e.hasOnlyOccluders)}get hasOnlyOccluders(){return i(this.renderers,e=>e.hasOnlyOccluders)}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,g,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=s(this.renderers,e=>{const r=e.produces.get(19);return!!r&&r(10)}),this._hasWater=s(this.renderers,e=>{const r=e.produces.get(20);return!!r&&r(4)})),this.notifyChange("updating"),!0)}rendererAdded(){this._sortedRenderers.clear()}rendererRemoved(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);switch(s&&this.notifyChange("updating"),r){case 0:this._notifyGraphicVisibilityChanged(e);break;case 1:this._notifyGraphicGeometryChanged(e)}}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),1===r&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=new l;this._changes.updates.push(e),e.renderGeometry=this._ensureValidRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case 4:case 2:return this._notifyGraphicGeometryChanged(e);case 1:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersect(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;o&&(n.boundingSphere.center[0]-n.boundingSphere.radius<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),n.boundingSphere.center[0]+n.boundingSphere.radius>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)),i++}return i}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.length=0,this._changes.removes.length=0,r(this._changes.adds,Array.from(this._pending.adds)),r(this._changes.removes,Array.from(this._pending.removes)),t(this._changes.updates,({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible||!e.material.intersectDraped)return;let o=0;s+=e.transformation[12],o=e.transformation[13],f[0]=t[0]-s,f[1]=t[1]-o,e.screenToWorldRatio=this.rendererContext.screenToWorldRatio,e.material.intersectDraped(e,i,f,(t,s,o)=>{_(r,o,n,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)},r)}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(e.boundingSphere.center)),e}get test(){}};e([o({constructOnly:!0})],m.prototype,"drapeSource",void 0),e([o({constructOnly:!0})],m.prototype,"rendererContext",void 0),e([o()],m.prototype,"updating",null),e([o()],m.prototype,"rctx",null),e([o()],m.prototype,"_localOriginFactory",null),e([o({readOnly:!0})],m.prototype,"isEmpty",null),e([o()],m.prototype,"_geometries",void 0),m=e([d("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],m);class y{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function _(e,r,t,s,i,n,o){const d=new h(n,o,r),a=r=>{r.set(5,d,e.distance,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.distance||i.results.ground.distance<=i.results.min.distance)&&a(i.results.min),0!==i.options.store&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.distance||i.results.ground.distance>i.results.max.distance)&&a(i.results.max),2===i.options.store){const e=new p(i.ray);a(e),i.results.all.push(e)}}const f=a();export{m as SortedRenderGeometryRenderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t}from"../../../../../core/arrayUtils.js";import n from"../../../../../core/Error.js";import{someMap as s,getOrCreateMapValue as r}from"../../../../../core/MapUtils.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{isAborted as i,throwIfAborted as o}from"../../../../../core/promiseUtils.js";import{property as l,subclass as c}from"../../../../../core/accessorSupport/decorators.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as d,dot as u,transformMat4 as m}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as _,freeze as p}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{debugFlags as g}from"../../../support/debugFlags.js";import{glLayout as y}from"../../../support/buffer/glUtil.js";import v from"../../../webgl/RenderCamera.js";import{AsyncRenderPlugin as b}from"../../effects/RenderPlugin.js";import{DepthRange as I}from"../DepthRange.js";import{assert as C}from"../Util.js";import{InstanceData as D}from"./InstanceData.js";import{InstanceOctree as R}from"./InstanceOctree.js";import{LevelSelector as E}from"./LevelSelector.js";import{LodLevel as x}from"./LodLevel.js";import{getRenderInstanceDataLayout as S,RenderInstanceData as w}from"./RenderInstanceData.js";import{colorMixModes as L}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as j}from"../../materials/renderers/utils.js";import{DefaultMaterialDrawParameters as U}from"../../shaders/DefaultMaterialTechnique.js";import{defaultHighlightName as T}from"../../../../support/HighlightDefaults.js";import{TaskPriority as O,noBudget as A}from"../../../../support/Scheduler.js";import{bindVertexBufferLayout as M}from"../../../../webgl/Util.js";import{fromLayout as q}from"../../../../webgl/VertexAttributeLocations.js";const B=e=>{const t=e.baseBoundingSphere.radius,n=e.levels.map(e=>e.minScreenSpaceRadius);return new E(t,n)};let F=class extends b{constructor(e,t){super(e),this.type=3,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=new Array,this._highlightRenderInstanceDatas=new Map,this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new v,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.produces=new Map([[2,e=>this._produces(e)],[4,e=>!!this._hasTransparentLevels()&&this._produces(e)]]),this._instanceData=new D({shaderTransformation:e.shaderTransformation},e.symbol.materialParameters),this.addHandles(t.registerTask(O.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=S(this.symbol.materialParameters),this._glInstanceBufferLayout=y(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on("instance-visibility-changed",({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on("instance-highlight-changed",()=>this._requestUpdateCycle(!0))])}get _allRenderInstanceData(){return[this._defaultRenderInstanceData,...this._highlightRenderInstanceDatas.values()]}get _allRenderInstanceDataExceptHighlightShadow(){const e=[this._defaultRenderInstanceData];for(const t of this._highlightRenderInstanceDatas)t[0]!==T&&e.push(t[1]);return e}hasHighlight(e){return this._highlightRenderInstanceDatas.has(e)}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerViewUid(){return this.metadata.layerViewUid}get instanceData(){return this._instanceData}get hasEmitters(){return this._levels.some(e=>e.components.some(e=>e.material.hasEmissions))}get usedMemory(){return this._allRenderInstanceData.reduce((e,t)=>t.reduce((e,t)=>e+t.usedMemory,e),this._levels.reduce((e,t)=>e+t.components.reduce((e,t)=>e+t.usedMemory,0),0))}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach((e,n)=>{const s=this._allRenderInstanceData[0][n].size+this._allRenderInstanceData[1][n].size,r=e.triangleCount;t.push({renderedInstances:s,renderedTriangles:s*r,trianglesPerInstance:r})}),{totalInstances:e,renderedInstances:t.reduce((e,t)=>e+t.renderedInstances,0),renderedTriangles:t.reduce((e,t)=>e+t.renderedTriangles,0),levels:t}}_createRenderInstanceDataArray(){const{rctx:e}=this._context.renderContext;return this.symbol.levels.map(t=>new w(e,this._instanceBufferLayout))}async initializeRenderContext(e,n){this._context=e,this._defaultRenderInstanceData=this._createRenderInstanceDataArray();const s=await Promise.allSettled(this.symbol.levels.map(t=>x.create(e,t,n))),r=s.map(e=>"fulfilled"===e.status?e.value:null).filter(t);if(i(n)||r.length!==s.length){r.forEach(e=>e.destroy()),o(n);for(const e of s)if("rejected"===e.status)throw e.reason}this._levels=r,this._levelSelector=B(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData.forEach(e=>e.destroy()),this._highlightRenderInstanceDatas.forEach(e=>e.forEach(e=>e.destroy()))}_hasTransparentLevels(){return this._levels.some(e=>e.components.some(e=>{const t=e.material.produces.get(4);return t?.(0)}))}hasHighlights(){return s(this._highlightRenderInstanceDatas,e=>e.some(e=>e.size>0))}_produces(e){return(8!==e||this.hasHighlights())&&(4!==e||this.hasHighlight(T))}prepareRender(e){if(!g.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const t=e.bind.contentCamera.equals(this._camera);this._camera.copyFrom(e.bind.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(A),this._needFullCycle=!1)}}acquireTechniques(e){if(!this.baseMaterial.visible||!this.baseMaterial.isVisibleForOutput(e.output))return null;const t=this._getInstanceDatas(e);if(!t)return null;const n=new Array,s=this.levels;return t.forEach(t=>s.forEach(({components:s},r)=>s.forEach(s=>n.push(this._beginComponent(e,t[r],s))))),n}render(e,t){const n=this._getInstanceDatas(e);if(!n||null==t)return;let s=0;const r=this.levels;n.forEach(n=>r.forEach(({components:r},a)=>r.forEach(r=>this._renderComponent(e,t[s++],n[a],r,a)))),e.rctx.unbindBuffer(34962),e.rctx.bindVAO(null)}_getInstanceDatas(e){const{output:t,bind:n}=e,s=8===t,r=4===t,a=5!==t;if(!s&&!r)return a?this._allRenderInstanceData:this._allRenderInstanceDataExceptHighlightShadow;const{_highlightRenderInstanceDatas:i}=this;if(a){if(s){const e=n.highlight?.name;if(!e)return null;const t=i.get(e);return t?[t]:null}const e=i.get(T);return r?e?[e]:null:Array.from(i.values())}return null}intersect(e,t,n,s){if(!this.baseMaterial.visible||null==this._octree)return;const r=f();d(r,s,n);const a=r=>{this._instanceData.getCombinedModelTransform(r,N),e.transform.set(N),m(G,n,e.transform.inverse),m(W,s,e.transform.inverse);const a=this._instanceData.getState(r),i=this._instanceData.getLodLevel(r),o=this._levels.length;4&a&&(C(!!(18&a),"invalid instance state"),C(i>=0&&i<o,"invaid lod level"),this._levels[i].intersect(e,t,G,W,r,this.metadata,o))};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(a):this._octree.forEachAlongRay(n,r,a)}notifyShaderTransformationChanged(){this._invalidateOctree(),this._requestUpdateCycle()}get _octree(){if(null==this._octreeCached){const e=this._instanceData,t=e.view?.state;if(!t)return null;this._octreeCached=new R(e,this.baseBoundingSphere);for(let n=0;n<e.capacity;++n)18&t.get(n)&&this._octreeCached.addInstance(n)}return this._octreeCached}_invalidateOctree(){this._octreeCached=a(this._octreeCached)}queryDepthRange(e){if(null==this._octree)return new I;const t=e.viewForward,n=this._octree.findClosest(t,1,e.frustum),s=this._octree.findClosest(t,-1,e.frustum);if(null==n||null==s)return new I;const r=e.eye,a=this._instanceData.view;a.boundingSphere.getVec(n,z),d(z,z,r);const i=u(z,t)-z[3];a.boundingSphere.getVec(s,z),d(z,z,r);const o=u(z,t)+z[3];return new I(i,o)}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,this._cycleStartIndex=this._instanceIndex,e&&(this._needFullCycle=!0,this._context.requestRender())}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.startUpdateCycle()))}get readyToRun(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:t,_camera:s,_levelSelector:a}=this;this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.beginUpdate()));const i=this._instanceData,o=i.view;let l=i.size;const c=i.capacity;let h=this._instanceIndex;const d=Math.ceil(c/500),{_highlightRenderInstanceDatas:u}=this;for(let m=0;m<l&&!e.done;++m){h===this._cycleStartIndex&&this._startUpdateCycle();const m=o.state.get(h);let f=0;if(!(1&m)){h=h+1===c?0:h+1,l++;continue}const _=o.lodLevel.get(h);if(2&m&&this._defaultRenderInstanceData[_].freeTail(),16&m){const e=i.geHighlightOptionsPrev(h);if(e){const t=u.get(e);if(!t)throw new n("internal:lod-renderer","Internal error in lodRenderer");t[_].freeTail(),t.every(e=>e.isEmpty)&&(t.forEach(e=>e.destroy()),u.delete(e))}}if(32&m)i.freeInstance(h);else if(4&m){let e=0;if(t&&(o.modelOrigin.getVec(h,P),e=a.selectLevel(P,i.getCombinedMedianScaleFactor(h),s)),f=-83&m,e>=0)if(8&m){const t=i.getHighlightName(h);if(t){const s=()=>{const e=this._createRenderInstanceDataArray();return e.forEach(e=>e.beginUpdate()),e},a=r(u,t,s);if(e>=a.length)throw new n("internal:lod-renderer",`LodRenderer internal error - missing lodLevel ${e}`);V(a[e],o,h)}f|=16}else V(this._defaultRenderInstanceData[e],o,h),f|=2;o.state.set(h,f),o.lodLevel.set(h,e)}else f=-83&m,o.state.set(h,f);const p=!!(18&m),g=!!(18&f);null!=this._octreeCached&&(!p&&g?this._octreeCached.addInstance(h):p&&!g?this._octreeCached.removeInstance(h):p&&g&&64&m&&(this._octreeCached.removeInstance(h),this._octreeCached.addInstance(h))),h=h+1===c?0:h+1,h%d===0&&e.madeProgress(),p!==g&&this.metadata.notifyGraphicVisibilityChanged(h),g&&64&m&&this.metadata.notifyGraphicGeometryChanged(h)}this._instanceIndex=h,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.endUpdate())),this._context.requestRender()}_beginComponent(e,t,n){if(0===t.size)return null;const s=n.glMaterials.load(e.rctx,e.bind.slot,e.output);return s?.beginSlot(e.bind)}_renderComponent(e,t,n,s,r){if(!t)return;const{bind:a,rctx:i}=e,o=i.bindTechnique(t,a,s.material.parameters,Y),l=this._glInstanceBufferLayout;o.assertCompatibleVertexAttributeLocations(s.vao,q(l)),i.bindVAO(s.vao),g.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&0===e.output&&(o.setUniform4fv("externalColor",k[Math.min(r,k.length-1)]),o.setUniform1i("symbolColorMixMode",L.replace));const c=n.capacity,h=n.headIndex,d=n.tailIndex,u=n.firstIndex,m=(e,r)=>{M(i,o.locations,n.buffer,e),i.drawArraysInstanced(t.primitiveType,0,s.numVertices,r-e)};s.material.transparent&&null!=u?h>d?(C(u>=d&&u<=h,"invalid firstIndex"),m(u,h),m(d,u)):h<d&&(u<=h?(C(u>=0&&u<=h,"invalid firstIndex"),m(u,h),m(d,c),m(0,u)):(C(u>=d&&u<=c,"invalid firstIndex"),m(u,c),m(0,h),m(d,u))):h>d?m(d,h):h<d&&(m(0,h),m(d,c))}};function V(e,t,n){const s=e.allocateHead();H(t,n,e.view,s)}function H(e,t,n,s){j(e.modelOrigin,t,n.modelOriginHi,n.modelOriginLo,s),n.model.copyFrom(s,e.model,t),n.modelNormal.copyFrom(s,e.modelNormal,t),e.color&&n.color&&n.color.copyFrom(s,e.color,t),e.olidColor&&n.olidColor&&n.olidColor.copyFrom(s,e.olidColor,t),e.featureAttribute&&n.featureAttribute&&n.featureAttribute.copyFrom(s,e.featureAttribute,t)}e([l({constructOnly:!0})],F.prototype,"symbol",void 0),e([l({constructOnly:!0})],F.prototype,"metadata",void 0),e([l({constructOnly:!0})],F.prototype,"shaderTransformation",void 0),e([l()],F.prototype,"_instanceData",void 0),e([l()],F.prototype,"_cycleStartIndex",void 0),e([l({readOnly:!0})],F.prototype,"_enableLevelSelection",null),e([l()],F.prototype,"_updateCyclesWithStaticCamera",void 0),e([l({readOnly:!0})],F.prototype,"readyToRun",null),F=e([c("esri.views.3d.webgl-engine.lib.lodRendering.LodRenderer")],F);const P=f(),z=_(),N=h(),G=f(),W=f(),k=[p(1,0,1,1),p(0,0,1,1),p(0,1,0,1),p(1,1,0,1),p(1,0,0,1)],Y=new U;export{F as LodRenderer};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../../../../../core/arrayUtils.js";import r from"../../../../../core/Error.js";import{someMap as s,getOrCreateMapValue as n}from"../../../../../core/MapUtils.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{isAborted as i,throwIfAborted as o}from"../../../../../core/promiseUtils.js";import{property as l,subclass as c}from"../../../../../core/accessorSupport/decorators.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as d,dot as u,transformMat4 as m}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as _,freeze as p}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{debugFlags as g}from"../../../support/debugFlags.js";import{glLayout as y}from"../../../support/buffer/glUtil.js";import v from"../../../webgl/RenderCamera.js";import{isColor as b}from"../../core/shaderLibrary/ShaderOutput.js";import{AsyncRenderPlugin as I}from"../../effects/RenderPlugin.js";import{DepthRange as C}from"../DepthRange.js";import{assert as D}from"../Util.js";import{InstanceData as R}from"./InstanceData.js";import{InstanceOctree as E}from"./InstanceOctree.js";import{LevelSelector as x}from"./LevelSelector.js";import{LodLevel as S}from"./LodLevel.js";import{getRenderInstanceDataLayout as w,RenderInstanceData as L}from"./RenderInstanceData.js";import{colorMixModes as j}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as U}from"../../materials/renderers/utils.js";import{DefaultMaterialDrawParameters as O}from"../../shaders/DefaultMaterialTechnique.js";import{defaultHighlightName as T}from"../../../../support/HighlightDefaults.js";import{TaskPriority as A,noBudget as M}from"../../../../support/Scheduler.js";import{bindVertexBufferLayout as q}from"../../../../webgl/Util.js";import{fromLayout as B}from"../../../../webgl/VertexAttributeLocations.js";const F=e=>{const t=e.baseBoundingSphere.radius,r=e.levels.map(e=>e.minScreenSpaceRadius);return new x(t,r)};let V=class extends I{constructor(e,t){super(e),this.type=3,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=new Array,this._highlightRenderInstanceDatas=new Map,this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new v,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.produces=new Map([[2,e=>this._produces(e)],[4,e=>!!this._hasTransparentLevels()&&this._produces(e)]]),this._instanceData=new R({shaderTransformation:e.shaderTransformation},e.symbol.materialParameters),this.addHandles(t.registerTask(A.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=w(this.symbol.materialParameters),this._glInstanceBufferLayout=y(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on("instance-visibility-changed",({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on("instance-highlight-changed",()=>this._requestUpdateCycle(!0))])}get _allRenderInstanceData(){return[this._defaultRenderInstanceData,...this._highlightRenderInstanceDatas.values()]}get _allRenderInstanceDataExceptHighlightShadow(){const e=[this._defaultRenderInstanceData];for(const t of this._highlightRenderInstanceDatas)t[0]!==T&&e.push(t[1]);return e}hasHighlight(e){return this._highlightRenderInstanceDatas.has(e)}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerViewUid(){return this.metadata.layerViewUid}get instanceData(){return this._instanceData}get hasEmitters(){return this._levels.some(e=>e.components.some(e=>e.material.hasEmissions))}get usedMemory(){return this._allRenderInstanceData.reduce((e,t)=>t.reduce((e,t)=>e+t.usedMemory,e),this._levels.reduce((e,t)=>e+t.components.reduce((e,t)=>e+t.usedMemory,0),0))}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach((e,r)=>{const s=this._allRenderInstanceData[0][r].size+this._allRenderInstanceData[1][r].size,n=e.triangleCount;t.push({renderedInstances:s,renderedTriangles:s*n,trianglesPerInstance:n})}),{totalInstances:e,renderedInstances:t.reduce((e,t)=>e+t.renderedInstances,0),renderedTriangles:t.reduce((e,t)=>e+t.renderedTriangles,0),levels:t}}_createRenderInstanceDataArray(){const{rctx:e}=this._context.renderContext;return this.symbol.levels.map(t=>new L(e,this._instanceBufferLayout))}async initializeRenderContext(e,r){this._context=e,this._defaultRenderInstanceData=this._createRenderInstanceDataArray();const s=await Promise.allSettled(this.symbol.levels.map(t=>S.create(e,t,r))),n=s.map(e=>"fulfilled"===e.status?e.value:null).filter(t);if(i(r)||n.length!==s.length){n.forEach(e=>e.destroy()),o(r);for(const e of s)if("rejected"===e.status)throw e.reason}this._levels=n,this._levelSelector=F(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData.forEach(e=>e.destroy()),this._highlightRenderInstanceDatas.forEach(e=>e.forEach(e=>e.destroy()))}_hasTransparentLevels(){return this._levels.some(e=>e.components.some(e=>{const t=e.material.produces.get(4);return t?.(0)}))}hasHighlights(){return s(this._highlightRenderInstanceDatas,e=>e.some(e=>e.size>0))}_produces(e){return(10!==e||this.hasHighlights())&&(6!==e||this.hasHighlight(T))}prepareRender(e){if(!g.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const t=e.bind.contentCamera.equals(this._camera);this._camera.copyFrom(e.bind.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(M),this._needFullCycle=!1)}}acquireTechniques(e){if(!this.baseMaterial.visible||!this.baseMaterial.isVisibleForOutput(e.output))return null;const t=this._getInstanceDatas(e);if(!t)return null;const r=new Array,s=this.levels;return t.forEach(t=>s.forEach(({components:s},n)=>s.forEach(s=>r.push(this._beginComponent(e,t[n],s))))),r}render(e,t){const r=this._getInstanceDatas(e);if(!r||null==t)return;let s=0;const n=this.levels;r.forEach(r=>n.forEach(({components:n},a)=>n.forEach(n=>this._renderComponent(e,t[s++],r[a],n,a)))),e.rctx.unbindBuffer(34962),e.rctx.bindVAO(null)}_getInstanceDatas(e){const{output:t,bind:r}=e,s=10===t,n=6===t,a=7!==t;if(!s&&!n)return a?this._allRenderInstanceData:this._allRenderInstanceDataExceptHighlightShadow;const{_highlightRenderInstanceDatas:i}=this;if(a){if(s){const e=r.highlight?.name;if(!e)return null;const t=i.get(e);return t?[t]:null}const e=i.get(T);return n?e?[e]:null:Array.from(i.values())}return null}intersect(e,t,r,s){if(!this.baseMaterial.visible||null==this._octree)return;const n=f();d(n,s,r);const a=n=>{this._instanceData.getCombinedModelTransform(n,G),e.transform.set(G),m(W,r,e.transform.inverse),m(k,s,e.transform.inverse);const a=this._instanceData.getState(n),i=this._instanceData.getLodLevel(n),o=this._levels.length;4&a&&(D(!!(18&a),"invalid instance state"),D(i>=0&&i<o,"invaid lod level"),this._levels[i].intersect(e,t,W,k,n,this.metadata,o))};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(a):this._octree.forEachAlongRay(r,n,a)}notifyShaderTransformationChanged(){this._invalidateOctree(),this._requestUpdateCycle()}get _octree(){if(null==this._octreeCached){const e=this._instanceData,t=e.view?.state;if(!t)return null;this._octreeCached=new E(e,this.baseBoundingSphere);for(let r=0;r<e.capacity;++r)18&t.get(r)&&this._octreeCached.addInstance(r)}return this._octreeCached}_invalidateOctree(){this._octreeCached=a(this._octreeCached)}queryDepthRange(e){if(null==this._octree)return new C;const t=e.viewForward,r=this._octree.findClosest(t,1,e.frustum),s=this._octree.findClosest(t,-1,e.frustum);if(null==r||null==s)return new C;const n=e.eye,a=this._instanceData.view;a.boundingSphere.getVec(r,N),d(N,N,n);const i=u(N,t)-N[3];a.boundingSphere.getVec(s,N),d(N,N,n);const o=u(N,t)+N[3];return new C(i,o)}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,this._cycleStartIndex=this._instanceIndex,e&&(this._needFullCycle=!0,this._context.requestRender())}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.startUpdateCycle()))}get readyToRun(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:t,_camera:s,_levelSelector:a}=this;this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.beginUpdate()));const i=this._instanceData,o=i.view;let l=i.size;const c=i.capacity;let h=this._instanceIndex;const d=Math.ceil(c/500),{_highlightRenderInstanceDatas:u}=this;for(let m=0;m<l&&!e.done;++m){h===this._cycleStartIndex&&this._startUpdateCycle();const m=o.state.get(h);let f=0;if(!(1&m)){h=h+1===c?0:h+1,l++;continue}const _=o.lodLevel.get(h);if(2&m&&this._defaultRenderInstanceData[_].freeTail(),16&m){const e=i.geHighlightOptionsPrev(h);if(e){const t=u.get(e);if(!t)throw new r("internal:lod-renderer","Internal error in lodRenderer");t[_].freeTail(),t.every(e=>e.isEmpty)&&(t.forEach(e=>e.destroy()),u.delete(e))}}if(32&m)i.freeInstance(h);else if(4&m){let e=0;if(t&&(o.modelOrigin.getVec(h,z),e=a.selectLevel(z,i.getCombinedMedianScaleFactor(h),s)),f=-83&m,e>=0)if(8&m){const t=i.getHighlightName(h);if(t){const s=()=>{const e=this._createRenderInstanceDataArray();return e.forEach(e=>e.beginUpdate()),e},a=n(u,t,s);if(e>=a.length)throw new r("internal:lod-renderer",`LodRenderer internal error - missing lodLevel ${e}`);H(a[e],o,h)}f|=16}else H(this._defaultRenderInstanceData[e],o,h),f|=2;o.state.set(h,f),o.lodLevel.set(h,e)}else f=-83&m,o.state.set(h,f);const p=!!(18&m),g=!!(18&f);null!=this._octreeCached&&(!p&&g?this._octreeCached.addInstance(h):p&&!g?this._octreeCached.removeInstance(h):p&&g&&64&m&&(this._octreeCached.removeInstance(h),this._octreeCached.addInstance(h))),h=h+1===c?0:h+1,h%d===0&&e.madeProgress(),p!==g&&this.metadata.notifyGraphicVisibilityChanged(h),g&&64&m&&this.metadata.notifyGraphicGeometryChanged(h)}this._instanceIndex=h,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.endUpdate())),this._context.requestRender()}_beginComponent(e,t,r){if(0===t.size)return null;const s=r.glMaterials.load(e.rctx,e.bind.slot,e.output);return s?.beginSlot(e.bind)}_renderComponent(e,t,r,s,n){if(!t)return;const{bind:a,rctx:i}=e,o=i.bindTechnique(t,a,s.material.parameters,Z),l=this._glInstanceBufferLayout;o.assertCompatibleVertexAttributeLocations(s.vao,B(l)),i.bindVAO(s.vao),g.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&b(e.output)&&(o.setUniform4fv("externalColor",Y[Math.min(n,Y.length-1)]),o.setUniform1i("symbolColorMixMode",j.replace));const c=r.capacity,h=r.headIndex,d=r.tailIndex,u=r.firstIndex,m=(e,n)=>{q(i,o.locations,r.buffer,e),i.drawArraysInstanced(t.primitiveType,0,s.numVertices,n-e)};s.material.transparent&&null!=u?h>d?(D(u>=d&&u<=h,"invalid firstIndex"),m(u,h),m(d,u)):h<d&&(u<=h?(D(u>=0&&u<=h,"invalid firstIndex"),m(u,h),m(d,c),m(0,u)):(D(u>=d&&u<=c,"invalid firstIndex"),m(u,c),m(0,h),m(d,u))):h>d?m(d,h):h<d&&(m(0,h),m(d,c))}};function H(e,t,r){const s=e.allocateHead();P(t,r,e.view,s)}function P(e,t,r,s){U(e.modelOrigin,t,r.modelOriginHi,r.modelOriginLo,s),r.model.copyFrom(s,e.model,t),r.modelNormal.copyFrom(s,e.modelNormal,t),e.color&&r.color&&r.color.copyFrom(s,e.color,t),e.olidColor&&r.olidColor&&r.olidColor.copyFrom(s,e.olidColor,t),e.featureAttribute&&r.featureAttribute&&r.featureAttribute.copyFrom(s,e.featureAttribute,t)}e([l({constructOnly:!0})],V.prototype,"symbol",void 0),e([l({constructOnly:!0})],V.prototype,"metadata",void 0),e([l({constructOnly:!0})],V.prototype,"shaderTransformation",void 0),e([l()],V.prototype,"_instanceData",void 0),e([l()],V.prototype,"_cycleStartIndex",void 0),e([l({readOnly:!0})],V.prototype,"_enableLevelSelection",null),e([l()],V.prototype,"_updateCyclesWithStaticCamera",void 0),e([l({readOnly:!0})],V.prototype,"readyToRun",null),V=e([c("esri.views.3d.webgl-engine.lib.lodRendering.LodRenderer")],V);const z=f(),N=_(),G=h(),W=f(),k=f(),Y=[p(1,0,1,1),p(0,0,1,1),p(0,1,0,1),p(1,1,0,1),p(1,0,0,1)],Z=new O;export{V as LodRenderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as t}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{DefaultBufferWriter as s}from"./DefaultBufferWriter.js";import{PositionUvLayout as o}from"./DefaultLayouts.js";import{TriangleMaterial as a,TriangleMaterialParameters as n}from"./TriangleMaterial.js";import{CheckerBoardTechnique as p}from"../shaders/CheckerBoardTechnique.js";import{CheckerBoardTechniqueConfiguration as h}from"../shaders/CheckerBoardTechniqueConfiguration.js";import{alphaCutoff as c}from"../../../../webscene/support/AlphaCutoff.js";class u extends a{constructor(r){super(r,m),this._configuration=new h,this.produces=new Map([[2,r=>t(r)&&!this.transparent],[4,r=>t(r)&&this.transparent&&this.parameters.writeDepth],[9,r=>t(r)&&this.transparent&&!this.parameters.writeDepth]])}updateConfiguration(r
|
|
2
|
+
import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as t}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{DefaultBufferWriter as s}from"./DefaultBufferWriter.js";import{PositionUvLayout as o}from"./DefaultLayouts.js";import{TriangleMaterial as a,TriangleMaterialParameters as n}from"./TriangleMaterial.js";import{CheckerBoardTechnique as p}from"../shaders/CheckerBoardTechnique.js";import{CheckerBoardTechniqueConfiguration as h}from"../shaders/CheckerBoardTechniqueConfiguration.js";import{alphaCutoff as c}from"../../../../webscene/support/AlphaCutoff.js";class u extends a{constructor(r){super(r,m),this._configuration=new h,this.produces=new Map([[2,r=>t(r)&&!this.transparent],[4,r=>t(r)&&this.transparent&&this.parameters.writeDepth],[9,r=>t(r)&&this.transparent&&!this.parameters.writeDepth]])}updateConfiguration(r){super.updateConfiguration(r),this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.terrainDepthTest=r.terrainDepthTest,this._configuration.cullAboveTerrain=r.cullAboveTerrain}get visible(){return this.parameters.color1[3]>=c||this.parameters.color2[3]>=c}get transparent(){return this.parameters.color1[3]<1||this.parameters.color2[3]<1}createGLMaterial(r){return new f(r)}createBufferWriter(){return new s(o)}}class f extends i{beginSlot(r){return this.getTechnique(p,r)}}class m extends n{constructor(){super(...arguments),this.size=r(1,1),this.color1=e(.75,.75,.75,1),this.color2=e(.5,.5,.5,1),this.writeDepth=!0}}export{u as CheckerBoardMaterial,m as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{ZEROS as
|
|
2
|
+
import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColorOrOLID as e,isDepth as r,is2DGeometryOutput as s,isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import a from"../lib/GLMaterial.js";import{DefaultBufferWriter as o}from"./DefaultBufferWriter.js";import{TriangleMaterial as n}from"./TriangleMaterial.js";import{VisualVariablePassParameters as h}from"./VisualVariablePassParameters.js";import{getLayout as p,ColorMaterialTechnique as u}from"../shaders/ColorMaterialTechnique.js";import{ColorMaterialTechniqueConfiguration as c}from"../shaders/ColorMaterialTechniqueConfiguration.js";import{alphaCutoff as l}from"../../../../webscene/support/AlphaCutoff.js";class m extends n{constructor(t){super(t,g),this._configuration=new c,this.supportsEdges=!0,this.produces=new Map([[2,t=>this._isOpaqueMaterialPass(t)],[3,t=>this._isOpaqueNoSSAODepthPass(t)],[4,t=>e(t)&&this.transparent&&this.parameters.writeDepth],[5,t=>r(t)&&this.transparent&&this.parameters.writeDepth],[9,t=>e(t)&&this.transparent&&!this.parameters.writeDepth],[19,t=>s(t)]])}updateConfiguration(t){super.updateConfiguration(t),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.discardInvisibleFragments=this.transparent&&!this._isOpaquePass(t.output)&&this.parameters.discardInvisibleFragments,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=t.hasOccludees,this._configuration.terrainDepthTest=t.terrainDepthTest&&i(t.output),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.draped=this.parameters.draped,this._configuration.emissionSource=this.hasEmissions?1:0}get visible(){return this.parameters.color[3]>=l}get transparent(){return this.parameters.color[3]<1||this.parameters.forceTransparentMode}get hasEmissions(){return this.parameters.emissiveStrength>0}_isOpaquePass(t){return i(t)||this._isOpaqueMaterialPass(t)||this._isOpaqueNoSSAODepthPass(t)}_isOpaqueMaterialPass(t){return 10===t||e(t)&&!this.transparent}_isOpaqueNoSSAODepthPass(t){return r(t)&&this.parameters.writeDepth&&!this.transparent}createGLMaterial(t){return new f(t)}createBufferWriter(){return new o(p(this.parameters))}}class f extends a{beginSlot(t){return this.getTechnique(u,t)}}class g extends h{constructor(){super(...arguments),this.color=t,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=0,this.draped=!1,this.discardInvisibleFragments=!1,this.emissiveStrength=0,this.useIndexing=!1}}export{m as ColorMaterial,g as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{exactEquals as e,set as
|
|
2
|
+
import{exactEquals as e,set as t,copy as r,normalize as s,subtract as i,length as a,scale as o,dot as n,transformMat3 as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as u,create as c,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{is3DGeometryOutputMRT as m,isShadowLike as p,isColor as d}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as f}from"../lib/GLTextureMaterial.js";import{Material as T}from"../lib/Material.js";import{intersectTriangleGeometry as x}from"../lib/RayIntersections.js";import{getVerticalOffsetObject3D as g}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as v}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as S}from"./internal/MaterialUtil.js";import{getLayout as b,DefaultMaterialPassParameters as M,DefaultMaterialTechnique as O}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as C}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as w}from"../shaders/RealisticTreeTechnique.js";import{alphaCutoff as y}from"../../../../webscene/support/AlphaCutoff.js";class R extends T{constructor(e,t){super(e,P),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>(m(e)||p(e))&&!this.transparent],[4,e=>(m(e)||p(e))&&this.transparent&&this.parameters.writeDepth],[9,e=>(m(e)||p(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=b(this.parameters),this._configuration=new C(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:s}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(s[3])?1:s[3])>=y}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveBaseColor,u)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;const{treeRendering:s,doubleSided:i,doubleSidedType:a}=t;r.hasVertexTangents=!s&&t.hasVertexTangents,r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=s?0:t.normalType,r.transparent=this.transparent,r.writeDepth=t.writeDepth,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.cullAboveTerrain=e.cullAboveTerrain,r.hasModelTransformation=!s&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=s?2:i&&"normal"===a?1:i&&"winding-order"===a?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,d(e.output)?(r.terrainDepthTest=e.terrainDepthTest,r.receiveShadows=t.receiveShadows,r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao):(r.terrainDepthTest=!1,r.receiveShadows=r.receiveAmbientOcclusion=!1),r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.enableOffset=e.enableOffset,r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersect(e,u,c,h,m,p){if(null!=this.parameters.verticalOffset){const e=c.camera;t(N,u[12],u[13],u[14]);let p=null;switch(c.viewingMode){case 1:p=s(B,N);break;case 2:p=r(B,V)}const d=i(z,N,e.eye),f=a(d),T=o(d,d,1/f);let x=null;this.parameters.screenSizePerspective&&(x=n(p,T));const g=S(e,f,this.parameters.verticalOffset,x??0,this.parameters.screenSizePerspective,null);o(p,p,g),l(_,p,c.transform.inverseRotation),h=i(A,h,_),m=i(I,m,_)}x(e,c,h,m,g(c.verticalOffset),p)}createGLMaterial(e){return new D(e)}createBufferWriter(){return new v(this._layout)}get transparent(){return j(this.parameters)}}class D extends f{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const r=this._material.parameters;this.updateTexture(r.textureId);const s=e.camera.viewInverseTransposeMatrix;return t(r.origin,s[3],s[7],s[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(r.treeRendering?w:O,e)}}class P extends M{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function j(e){const{drivenOpacity:t,opacity:r,externalColor:s,layerOpacity:i,texture:a,textureId:o,textureAlphaMode:n,colorMixMode:l}=e,u=s[3];return t||r<1&&"replace"!==l||u<1&&"ignore"!==l||i<1||(null!=a||null!=o)&&1!==n&&2!==n&&"replace"!==l}const A=c(),I=c(),V=h(0,0,1),B=c(),_=c(),N=c(),z=c();export{D as DefaultGLMaterial,R as DefaultMaterial,P as DefaultMaterialParameters,j as isTransparent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as
|
|
2
|
+
import{__decorate as i}from"tslib";import{SliceConfiguration as t}from"../core/shaderLibrary/Slice.glsl.js";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends t{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.hasFloatOit=!0,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}i([e()],r.prototype,"hasHighlightMixTexture",void 0),i([e()],r.prototype,"hasFloatOit",void 0);export{r as DefaultTechniqueConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ONES as l,fromValues as c,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as h,transformMat4 as u,normalize as f,subtract as m,scale as d,transformMat3 as g,scaleAndAdd as b,copy as v,length as x,distance as S,sub as O,dot as z}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y,fromValues as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as P,ONES as C,create as j}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as D}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as A}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as R}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as w}from"../../support/debugFlags.js";import{isColorHighlightOrOLID as M,isColor as F}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as T}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterialBindParameters as U,GLTextureMaterial as _}from"../lib/GLTextureMaterial.js";import{Material as L}from"../lib/Material.js";import{SeparateScreenSizePerspectiveEvaluators as B}from"../lib/screenSizePerspectiveUtils.js";import{assert as E}from"../lib/Util.js";import{writePosition as I,writeNormal as W,writeColor as H,writeBufferVec2 as N,writeBufferFloat as G,writeBufferVec3 as q,writeBufferZeros as X,writeBufferVec4 as Y,writeOlidColor as k}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as J}from"./internal/MaterialUtil.js";import{c as K}from"../../../../chunks/HUDMaterial.glsl.js";import{baseLayout as Q,getInstanceLayout as Z,HUDMaterialTechnique as $}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as ee}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as te}from"../../../../webscene/support/AlphaCutoff.js";class se extends L{constructor(e,t,s=!1){super(e,Pe),this.produces=new Map([[13,e=>M(e)&&!this.parameters.drawAsLabel&&!this._configuration.transparentOccluded],[14,e=>M(e)&&!this.parameters.drawAsLabel&&this._configuration.transparentOccluded],[15,e=>M(e)&&this.parameters.drawAsLabel],[19,e=>this.parameters.draped&&M(e)]]),this._visible=!0,this._configuration=new ee(t,s)}updateConfiguration(e,t){super.updateConfiguration(e,t);const{parameters:s,_configuration:r}=this,i=s.draped;r.hasSlicePlane=this.parameters.hasSlicePlane,r.hasVerticalOffset=!!this.parameters.verticalOffset,r.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,r.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,r.hasPolygonOffset=this.parameters.polygonOffset,r.draped=i,r.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,r.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,r.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,r.hasRotation=this.parameters.hasRotation,r.hasVVSize=!!this.parameters.vvSize,r.hasVVColor=!!this.parameters.vvColor,r.occludedFragmentFade=!i&&!!this.parameters.occludedFragmentOpacity,r.hasFocusAreaStyle=null!=this.parameters.focusAreaStyle,r.depthTestEnabled=this.parameters.depthEnabled,r.hasVertexColor=this.parameters.hasVertexColor,r.hasVertexSize=this.parameters.hasVertexSize,r.hasVertexRotation=this.parameters.hasVertexRotation,r.hasVertexUVi=this.parameters.hasVertexUVi,r.hasVertexCenterOffset=this.parameters.hasVertexCenterOffset,F(e)&&(r.debugDrawLabelBorder=!!w.LABELS_SHOW_BORDER),r.terrainDepthTest=t.terrainDepthTest,r.cullAboveTerrain=t.cullAboveTerrain,r.hasOcclusionTexture=!s.drawAsLabel&&r.transparentOccluded&&0!==t.oitPass}intersect(e,t,r,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:p},point:O,camera:z}=r,{parameters:V}=this;if(!l||!c||p&&V.isLabel||!e.visible||!O||!z)return;const C=e.attributes.get("featureAttribute"),j=null==C?null:P(C.data,xe),{scaleX:D,scaleY:A}=je(j,V,z.pixelRatio),R=e.attributes.get("position"),w=e.attributes.get("size"),M=e.attributes.get("normal"),F=e.attributes.get("rotation"),T=e.attributes.get("centerOffset"),U=this.parameters.size;E(R.size>=3);const _=K(V),L="screen"===this.parameters.centerOffsetUnits;for(let P=0;P<R.data.length/R.size;P++){const e=P*R.size;if(h(le,R.data[e],R.data[e+1],R.data[e+2]),u(le,le,t),u(le,le,z.viewMatrix),T){const e=P*T.size;h(be,T.data[e],T.data[e+1],T.data[e+2])}else h(be,0,0,0);if(!L&&(le[0]+=be[0],le[1]+=be[1],0!==be[2])){const e=be[2];f(be,le),m(le,le,d(be,be,e))}const a=P*M.size;h(ce,M.data[a],M.data[a+1],M.data[a+2]),g(ce,ce,s(de,t));const{normal:n,cosAngle:l}=ae(ce,z,Se),c=Ae(this.parameters,le,l,z,oe);if(b(le,le,n,c),z.applyProjection(le,pe),pe[0]>-1){if(L&&(be[0]||be[1])&&(pe[0]+=be[0]*z.pixelRatio,0!==be[1]&&(pe[1]+=oe.alignmentEvaluator.apply(be[1])*z.pixelRatio),z.unapplyProjection(pe,le)),pe[0]+=this.parameters.screenOffset[0]*z.pixelRatio,pe[1]+=this.parameters.screenOffset[1]*z.pixelRatio,pe[0]=Math.floor(pe[0]),pe[1]=Math.floor(pe[1]),ye[0]=U[0],ye[1]=U[1],null!=w){const e=P*w.size;ye[0]*=w.data[e],ye[1]*=w.data[e+1]}oe.evaluator.applyVec2(ye,ye);const e=Oe*z.pixelRatio;let t=0;if(V.textureIsSignedDistanceField){t=Math.min(V.outlineSize,.5*ye[0])*z.pixelRatio/2}ye[0]*=D,ye[1]*=A;const s=V.rotation+(null!=F?F.data[P*F.size]:0);if(ne(O,pe[0],pe[1],ye,e,t,s,V,_)){const e=r.ray;if(u(ue,le,i(ge,z.viewMatrix)),pe[0]=O[0],pe[1]=O[1],z.unprojectFromRenderScreen(pe,le)){const t=y();v(t,e.direction);const s=1/x(t);d(t,t,s);o(S(e.origin,le)*s,t,-1,ue)}}}}}intersectDraped(e,t,s,r,i){const a=e.attributes.get("position"),n=e.attributes.get("size"),o=e.attributes.get("rotation"),l=this.parameters,c=K(l),p=l.size,h=e.attributes.get("featureAttribute"),u=null==h?null:P(h.data,xe),{scaleX:f,scaleY:m}=je(u,l,e.screenToWorldRatio),d=ze*e.screenToWorldRatio;for(let g=0;g<a.data.length/a.size;g++){const t=g*a.size,h=a.data[t],u=a.data[t+1];if(ye[0]=p[0],ye[1]=p[1],null!=n){const e=g*n.size;ye[0]*=n.data[e],ye[1]*=n.data[e+1]}let b=0;if(l.textureIsSignedDistanceField){b=Math.min(l.outlineSize,.5*ye[0])*e.screenToWorldRatio/2}ye[0]*=f,ye[1]*=m;const v=l.rotation+(null!=o?o.data[g*o.size]:0);ne(s,h,u,ye,d,b,v,l,c)&&r(i.distance,i.normal,-1)}}createBufferWriter(){return new Ce(this.parameters)}applyShaderOffsets(e,t,r,i,a,n,o,l){g(he,r,s(de,i));const c=ae(he,o,Se),p=De(x(t),o),h=Ae(this.parameters,t,c.cosAngle,o,l);b(t,t,c.normal,h+p),b(e,e,he,h+p);const u=n+h;this._applyPolygonOffsetView(t,c,u,o,t),this._applyCenterOffsetView(t,a,t)}applyShaderOffsetsNDC(e,t,s,r,i,a){return this._applyCenterOffsetNDC(e,t,r,i),null!=a&&v(a,i),this._applyPolygonOffsetNDC(i,s,r,i),i}_applyPolygonOffsetView(t,s,r,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return v(a,t);const c=e(Math.abs(s.cosAngle),.01,1),p=1-Math.sqrt(1-c*c)/c/i.viewport[2];return d(a,t,l>0?p:1/p),a}_applyCenterOffsetView(e,t,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&v(s,e),r&&(s[0]+=t[0],s[1]+=t[1],t[2]&&(f(ce,s),O(s,s,d(ce,ce,t[2])))),s}_applyCenterOffsetNDC(e,t,s,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&v(r,e),i||(r[0]+=t[0]/s.fullWidth*2,r[1]+=t[1]/s.fullHeight*2),r}_applyPolygonOffsetNDC(e,t,s,r){const i=this.parameters.shaderPolygonOffset;if(e!==r&&v(r,e),i){const e=s.aboveGround?1:-1,a=e*Math.sign(t);r[2]-=(a||e)*i}return r}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:s}=this.parameters,r=e[3]>=te||t>=te&&s[3]>=te;return this._visible&&r}createGLMaterial(e){return new re(e)}calculateRelativeScreenBounds(e,t,s=D()){return ie(this.parameters,e,t,s),s[2]=s[0]+e[0],s[3]=s[1]+e[1],s}}class re extends _{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique($,e)}}function ie(e,t,s,r){r[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*s,r[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*s}function ae(e,t,s){return u(s.normal,e,t.viewInverseTransposeMatrix),s.cosAngle=z(s.normal,Ve),s}function ne(e,s,r,i,a,l,c,p,h){let u=s-a-i[0]*h[0],f=u+i[0]+2*a,m=r-a-i[1]*h[1],d=m+i[1]+2*a;const g=p.distanceFieldBoundingBox;return p.textureIsSignedDistanceField&&null!=g&&(u+=i[0]*g[0],m+=i[1]*g[1],f-=i[0]*(1-g[2]),d-=i[1]*(1-g[3]),u-=l,f+=l,m-=l,d+=l),n(me,s,r),o(fe,e,me,t(c)),fe[0]>u&&fe[0]<f&&fe[1]>m&&fe[1]<d}const oe=new B,le=y(),ce=y(),pe=j(),he=y(),ue=y(),fe=p(),me=p(),de=r(),ge=a(),be=y(),ve=y(),xe=j(),Se={normal:y(),cosAngle:0},Oe=1,ze=2,ye=c(0,0),Ve=V(0,0,1);class Pe extends U{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1,this.color=C,this.size=l,this.polygonOffset=!1,this.anchorPosition=c(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=C,this.outlineSize=0,this.distanceFieldBoundingBox=j(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasVertexColor=!1,this.hasVertexSize=!1,this.hasVertexRotation=!1,this.hasVertexUVi=!1,this.hasVertexCenterOffset=!1,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.focusAreaStyle=null,this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class Ce{constructor(e){this.baseInstanceLayout=Q,this.layout=Z(e)}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,s,r,i,a){const{position:n,normal:o,color:l,size:c,rotation:p,centerOffset:h,groundDistance:u,featureAttribute:f,uvi:m}=i;I(s.get("position"),e,n,a),W(s.get("normal"),t,o,a);const d=s.get("position").indices.length;if(m){const e=s.get("uvi")?.data;if(e&&e.length>=4){const[t,s,r,i]=e;for(let e=0;e<d;++e){const n=a+e;m.setValues(n,t,s,r,i)}}}if(l&&H(s.get("color"),4,l,a),c&&N(s.get("size"),c,a),p&&G(s.get("rotation"),p,a),h&&(s.get("centerOffset")?q(s.get("centerOffset"),h,a):X(h,a,d)),s.get("groundDistance")?G(s.get("groundDistance"),u,a):X(u,a,d),f&&(s.get("featureAttribute")?Y(s.get("featureAttribute"),f,a):X(f,a,d)),null!=r){const e=s.get("position")?.indices;if(e){const t=e.length,s=i.getField("olidColor",A);k(r,s,t,a)}}return{numVerticesPerItem:1,numItems:d}}writeBaseInstance(e,t){const{uv0:s}=t;N(e.get("uv0"),s,0)}}function je(e,t,s){return null==e||null==t.vvSize?{scaleX:s,scaleY:s}:(R(ve,t,e),{scaleX:ve[0]*s,scaleY:ve[1]*s})}function De(e,t){const s=t.computeRenderPixelSizeAtDist(e)*T;return(t.aboveGround?1:-1)*s}function Ae(e,t,s,r,i){if(!e.verticalOffset?.screenLength){const r=x(t);return i.update(s,r,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),0}const a=x(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=J(r,a,e.verticalOffset,s,n,e.screenSizePerspectiveMinPixelReferenceSize);return i.update(s,a,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),o}export{se as HUDMaterial,Pe as Parameters};
|
|
2
|
+
import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ONES as l,fromValues as c,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as u,transformMat4 as h,normalize as f,subtract as m,scale as d,transformMat3 as g,scaleAndAdd as b,copy as v,length as x,distance as S,sub as O,dot as z}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y,fromValues as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as P,ONES as C,create as j}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as D}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as A}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as R}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as w}from"../../support/debugFlags.js";import{isColorHighlightOrOLID as M,isColor as F,isOIT as T}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as U}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterialBindParameters as _,GLTextureMaterial as L}from"../lib/GLTextureMaterial.js";import{Material as B}from"../lib/Material.js";import{SeparateScreenSizePerspectiveEvaluators as E}from"../lib/screenSizePerspectiveUtils.js";import{assert as I}from"../lib/Util.js";import{writePosition as W,writeNormal as H,writeColor as N,writeBufferVec2 as G,writeBufferFloat as q,writeBufferVec3 as X,writeBufferZeros as Y,writeBufferVec4 as k,writeOlidColor as J}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as K}from"./internal/MaterialUtil.js";import{a as Q}from"../../../../chunks/HUDMaterial.glsl.js";import{baseLayout as Z,getInstanceLayout as $,HUDMaterialTechnique as ee}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as te}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as se}from"../../../../webscene/support/AlphaCutoff.js";class re extends B{constructor(e,t,s=!1){super(e,Ce),this.produces=new Map([[13,e=>M(e)&&!this.parameters.drawAsLabel&&!this._configuration.transparentOccluded],[14,e=>M(e)&&!this.parameters.drawAsLabel&&this._configuration.transparentOccluded],[15,e=>M(e)&&this.parameters.drawAsLabel],[19,e=>this.parameters.draped&&M(e)]]),this._visible=!0,this._configuration=new te(t,s)}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:s}=this,r=t.draped;s.hasSlicePlane=this.parameters.hasSlicePlane,s.hasVerticalOffset=!!this.parameters.verticalOffset,s.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,s.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,s.hasPolygonOffset=this.parameters.polygonOffset,s.draped=r,s.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,s.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,s.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,s.hasRotation=this.parameters.hasRotation,s.hasVVSize=!!this.parameters.vvSize,s.hasVVColor=!!this.parameters.vvColor,s.occludedFragmentFade=!r&&!!this.parameters.occludedFragmentOpacity,s.hasFocusAreaStyle=null!=this.parameters.focusAreaStyle,s.depthTestEnabled=this.parameters.depthEnabled,s.hasVertexColor=this.parameters.hasVertexColor,s.hasVertexSize=this.parameters.hasVertexSize,s.hasVertexRotation=this.parameters.hasVertexRotation,s.hasVertexUVi=this.parameters.hasVertexUVi,s.hasVertexCenterOffset=this.parameters.hasVertexCenterOffset,F(e.output)&&(s.debugDrawLabelBorder=!!w.LABELS_SHOW_BORDER),s.terrainDepthTest=e.terrainDepthTest,s.cullAboveTerrain=e.cullAboveTerrain,s.hasOcclusionTexture=!t.drawAsLabel&&s.transparentOccluded&&T(e.output)}intersect(e,t,r,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:p},point:O,camera:z}=r,{parameters:V}=this;if(!l||!c||p&&V.isLabel||!e.visible||!O||!z)return;const C=e.attributes.get("featureAttribute"),j=null==C?null:P(C.data,Se),{scaleX:D,scaleY:A}=De(j,V,z.pixelRatio),R=e.attributes.get("position"),w=e.attributes.get("size"),M=e.attributes.get("normal"),F=e.attributes.get("rotation"),T=e.attributes.get("centerOffset"),U=this.parameters.size;I(R.size>=3);const _="screen"===this.parameters.centerOffsetUnits;for(let P=0;P<R.data.length/R.size;P++){const e=P*R.size;if(u(ce,R.data[e],R.data[e+1],R.data[e+2]),h(ce,ce,t),h(ce,ce,z.viewMatrix),T){const e=P*T.size;u(ve,T.data[e],T.data[e+1],T.data[e+2])}else u(ve,0,0,0);if(!_&&(ce[0]+=ve[0],ce[1]+=ve[1],0!==ve[2])){const e=ve[2];f(ve,ce),m(ce,ce,d(ve,ve,e))}const a=P*M.size;u(pe,M.data[a],M.data[a+1],M.data[a+2]),g(pe,pe,s(ge,t));const{normal:n,cosAngle:l}=ne(pe,z,Oe),c=Re(this.parameters,ce,l,z,le);if(b(ce,ce,n,c),z.applyProjection(ce,ue),ue[0]>-1){if(_&&(ve[0]||ve[1])&&(ue[0]+=ve[0]*z.pixelRatio,0!==ve[1]&&(ue[1]+=le.alignmentEvaluator.apply(ve[1])*z.pixelRatio),z.unapplyProjection(ue,ce)),ue[0]+=this.parameters.screenOffset[0]*z.pixelRatio,ue[1]+=this.parameters.screenOffset[1]*z.pixelRatio,ue[0]=Math.floor(ue[0]),ue[1]=Math.floor(ue[1]),Ve[0]=U[0],Ve[1]=U[1],null!=w){const e=P*w.size;Ve[0]*=w.data[e],Ve[1]*=w.data[e+1]}le.evaluator.applyVec2(Ve,Ve);const e=ze*z.pixelRatio;let t=0;if(V.textureIsSignedDistanceField){t=Math.min(V.outlineSize,.5*Ve[0])*z.pixelRatio/2}Ve[0]*=D,Ve[1]*=A;const s=V.rotation+(null!=F?F.data[P*F.size]:0),a=Q(V);if(oe(O,ue[0],ue[1],Ve,e,t,s,V,a)){const e=r.ray;if(h(fe,ce,i(be,z.viewMatrix)),ue[0]=O[0],ue[1]=O[1],z.unprojectFromRenderScreen(ue,ce)){const t=y();v(t,e.direction);const s=1/x(t);d(t,t,s);o(S(e.origin,ce)*s,t,-1,fe)}}}}}intersectDraped(e,t,s,r,i){const a=e.attributes.get("position"),n=e.attributes.get("size"),o=e.attributes.get("rotation"),l=this.parameters,c=l.size,p=e.attributes.get("featureAttribute"),u=null==p?null:P(p.data,Se),{scaleX:h,scaleY:f}=De(u,l,e.screenToWorldRatio),m=ye*e.screenToWorldRatio;for(let d=0;d<a.data.length/a.size;d++){const t=d*a.size,p=a.data[t],u=a.data[t+1];if(Ve[0]=c[0],Ve[1]=c[1],null!=n){const e=d*n.size;Ve[0]*=n.data[e],Ve[1]*=n.data[e+1]}let g=0;if(l.textureIsSignedDistanceField){g=Math.min(l.outlineSize,.5*Ve[0])*e.screenToWorldRatio/2}Ve[0]*=h,Ve[1]*=f;const b=l.rotation+(null!=o?o.data[d*o.size]:0),v=Q(l);oe(s,p,u,Ve,m,g,b,l,v)&&r(i.distance,i.normal,-1)}}createBufferWriter(){return new je(this.parameters)}applyShaderOffsets(e,t,r,i,a,n,o,l){g(he,r,s(ge,i));const c=ne(he,o,Oe),p=Ae(x(t),o),u=Re(this.parameters,t,c.cosAngle,o,l);b(t,t,c.normal,u+p),b(e,e,he,u+p);const h=n+u;this._applyPolygonOffsetView(t,c,h,o,t),this._applyCenterOffsetView(t,a,t)}applyShaderOffsetsNDC(e,t,s,r,i,a){return this._applyCenterOffsetNDC(e,t,r,i),null!=a&&v(a,i),this._applyPolygonOffsetNDC(i,s,r,i),i}_applyPolygonOffsetView(t,s,r,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return v(a,t);const c=e(Math.abs(s.cosAngle),.01,1),p=1-Math.sqrt(1-c*c)/c/i.viewport[2];return d(a,t,l>0?p:1/p),a}_applyCenterOffsetView(e,t,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&v(s,e),r&&(s[0]+=t[0],s[1]+=t[1],t[2]&&(f(pe,s),O(s,s,d(pe,pe,t[2])))),s}_applyCenterOffsetNDC(e,t,s,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&v(r,e),i||(r[0]+=t[0]/s.fullWidth*2,r[1]+=t[1]/s.fullHeight*2),r}_applyPolygonOffsetNDC(e,t,s,r){const i=this.parameters.shaderPolygonOffset;if(e!==r&&v(r,e),i){const e=s.aboveGround?1:-1,a=e*Math.sign(t);r[2]-=(a||e)*i}return r}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:s}=this.parameters,r=e[3]>=se||t>=se&&s[3]>=se;return this._visible&&r}createGLMaterial(e){return new ie(e)}calculateRelativeScreenBounds(e,t,s=D()){return ae(this.parameters,e,t,s),s[2]=s[0]+e[0],s[3]=s[1]+e[1],s}}class ie extends L{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(ee,e)}}function ae(e,t,s,r){r[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*s,r[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*s}function ne(e,t,s){return h(s.normal,e,t.viewInverseTransposeMatrix),s.cosAngle=z(s.normal,Pe),s}function oe(e,s,r,i,a,l,c,p,u){let h=s-a-i[0]*u[0],f=h+i[0]+2*a,m=r-a-i[1]*u[1],d=m+i[1]+2*a;const g=p.distanceFieldBoundingBox;return p.textureIsSignedDistanceField&&null!=g&&(h+=i[0]*g[0],m+=i[1]*g[1],f-=i[0]*(1-g[2]),d-=i[1]*(1-g[3]),h-=l,f+=l,m-=l,d+=l),n(de,s,r),o(me,e,de,t(c)),me[0]>h&&me[0]<f&&me[1]>m&&me[1]<d}const le=new E,ce=y(),pe=y(),ue=j(),he=y(),fe=y(),me=p(),de=p(),ge=r(),be=a(),ve=y(),xe=y(),Se=j(),Oe={normal:y(),cosAngle:0},ze=1,ye=2,Ve=c(0,0),Pe=V(0,0,1);class Ce extends _{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1,this.color=C,this.size=l,this.polygonOffset=!1,this.anchorPosition=c(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=C,this.outlineSize=0,this.distanceFieldBoundingBox=j(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.hasVertexColor=!1,this.hasVertexSize=!1,this.hasVertexRotation=!1,this.hasVertexUVi=!1,this.hasVertexCenterOffset=!1,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.focusAreaStyle=null,this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class je{constructor(e){this.baseInstanceLayout=Z,this.layout=$(e)}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,s,r,i,a){const{position:n,normal:o,color:l,size:c,rotation:p,centerOffset:u,groundDistance:h,featureAttribute:f,uvi:m}=i;W(s.get("position"),e,n,a),H(s.get("normal"),t,o,a);const d=s.get("position").indices.length;if(m){const e=s.get("uvi")?.data;if(e&&e.length>=4){const[t,s,r,i]=e;for(let e=0;e<d;++e){const n=a+e;m.setValues(n,t,s,r,i)}}}if(l&&N(s.get("color"),4,l,a),c&&G(s.get("size"),c,a),p&&q(s.get("rotation"),p,a),u&&(s.get("centerOffset")?X(s.get("centerOffset"),u,a):Y(u,a,d)),s.get("groundDistance")?q(s.get("groundDistance"),h,a):Y(h,a,d),f&&(s.get("featureAttribute")?k(s.get("featureAttribute"),f,a):Y(f,a,d)),null!=r){const e=s.get("position")?.indices;if(e){const t=e.length,s=i.getField("olidColor",A);J(r,s,t,a)}}return{numVerticesPerItem:1,numItems:d}}writeBaseInstance(e,t){const{uv0:s}=t;G(e.get("uv0"),s,0)}}function De(e,t,s){return null==e||null==t.vvSize?{scaleX:s,scaleY:s}:(R(xe,t,e),{scaleX:xe[0]*s,scaleY:xe[1]*s})}function Ae(e,t){const s=t.computeRenderPixelSizeAtDist(e)*U;return(t.aboveGround?1:-1)*s}function Re(e,t,s,r,i){if(!e.verticalOffset?.screenLength){const r=x(t);return i.update(s,r,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),0}const a=x(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=K(r,a,e.verticalOffset,s,n,e.screenSizePerspectiveMinPixelReferenceSize);return i.update(s,a,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),o}export{re as HUDMaterial,Ce as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{set as t,squaredDistance as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as
|
|
2
|
+
import{set as t,squaredDistance as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isColor as s}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{Material as a}from"../lib/Material.js";import{writePosition as n,writeBufferFloat as o}from"./internal/bufferWriterUtils.js";import{attributeDrivenInstanceLayout as u,instanceLayout as c,HeatmapDensityPassParameters as l,HeatmapDensityTechnique as m,baseLayout as p}from"../shaders/HeatmapDensityTechnique.js";import{HeatmapDensityTechniqueConfiguration as f}from"../shaders/HeatmapDensityTechniqueConfiguration.js";const h=2;class d extends l{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class b extends a{constructor(t){super(t,d),this.visible=!0,this.produces=new Map([[19,t=>s(t)]]),this._configuration=new f}updateConfiguration(t){super.updateConfiguration(t),this._configuration.isAttributeDriven=this.parameters.isAttributeDriven,this._configuration.usesHalfFloat=this.parameters.usesHalfFloats}createGLMaterial(t){return new g(t)}intersect(){}intersectDraped(r,s,i,a,n){const o=r.attributes.get("position"),{parameters:u}=this,{searchRadius:c}=u,{screenToWorldRatio:l}=r,m=c*l+h*l,p=m*m,f=o.data.length/o.size;for(let h=0;h<f;h++){const r=h*o.size,s=t(v,o.data[r],o.data[r+1]);e(s,i)<p&&a(n.distance,n.normal,-1)}}createBufferWriter(){return new j(this.parameters.isAttributeDriven?u:c)}}class g extends i{beginSlot(t){return this.getTechnique(m,t)}}class j{constructor(t){this.layout=t,this.baseInstanceLayout=p}elementCount(t){return t.get("position").indices.length}elementCountBaseInstance(){return 4}write(t,e,r,s,i,a){n(r.get("position"),t,i.position,a);const u="featureAttribute"in i?i.featureAttribute:null;return u&&o(r.get("featureAttribute"),u,a),null}writeBaseInstance(t,e){const r=e.uv0;r.setValues(0,-1,-1),r.setValues(1,-1,1),r.setValues(2,1,-1),r.setValues(3,1,1)}}const v=r();export{b as HeatmapDensityMaterial,d as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{BufferViewFloat as e}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as t,isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{isUpdatableTexture as s}from"../lib/IManagedTexture.js";import{assert as a}from"../lib/Util.js";import{DefaultBufferWriter as o}from"./DefaultBufferWriter.js";import{TriangleMaterialParameters as n,TriangleMaterial as p}from"./TriangleMaterial.js";import{writeBufferFloat as u,writeAttribute as h}from"./internal/bufferWriterUtils.js";import{getLayout as c,ImageMaterialTechnique as l}from"../shaders/ImageMaterialTechnique.js";import{ImageMaterialTechniqueConfiguration as m}from"../shaders/ImageMaterialTechniqueConfiguration.js";class f extends p{constructor(e){super(e,x),this.supportsEdges=!0,this.transparent=!0,this.visible=!0,this.produces=new Map([[2,e=>t(e)],[4,e=>r(e)&&this.parameters.writeDepth],[9,e=>r(e)&&!this.parameters.writeDepth],[19,e=>r(e)||t(e)]]),this._configuration=new m(e.draped)}updateConfiguration(e
|
|
2
|
+
import{BufferViewFloat as e}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as t,isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{isUpdatableTexture as s}from"../lib/IManagedTexture.js";import{assert as a}from"../lib/Util.js";import{DefaultBufferWriter as o}from"./DefaultBufferWriter.js";import{TriangleMaterialParameters as n,TriangleMaterial as p}from"./TriangleMaterial.js";import{writeBufferFloat as u,writeAttribute as h}from"./internal/bufferWriterUtils.js";import{getLayout as c,ImageMaterialTechnique as l}from"../shaders/ImageMaterialTechnique.js";import{ImageMaterialTechniqueConfiguration as m}from"../shaders/ImageMaterialTechniqueConfiguration.js";class f extends p{constructor(e){super(e,x),this.supportsEdges=!0,this.transparent=!0,this.visible=!0,this.produces=new Map([[2,e=>t(e)],[4,e=>r(e)&&this.parameters.writeDepth],[9,e=>r(e)&&!this.parameters.writeDepth],[19,e=>r(e)||t(e)]]),this._configuration=new m(e.draped)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=e.hasOccludees,this._configuration.terrainDepthTest=e.terrainDepthTest,this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.perspectiveInterpolation=this.parameters.perspectiveInterpolation}createGLMaterial(e){return new d(e)}createBufferWriter(){return new g(c(this.parameters))}}class d extends i{constructor(e){super({...e,...e.material.parameters}),this.parameters=e;const t=this._material.parameters.managedTexture;s(t)&&e.textures.updater.add(t)}dispose(){this.parameters.textures.updater.remove(this._material.parameters.managedTexture)}beginSlot(e){return this.getTechnique(l,e)}}class g extends o{write(t,r,i,s,o,n){for(const p of this.layout.fields.keys()){const s=i.get(p);if(s)if("perspectiveDivide"===p){a(1===s.size);const t=o.getField(p,e);t&&u(s,t,n)}else h(p,s,t,r,o,n)}return null}}class x extends n{constructor(e,t){super(),this.managedTexture=e,this.draped=t,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=0,this.opacity=1,this.perspectiveInterpolation=!1}get texture(){return this.managedTexture.texture}}export{f as ImageMaterial,x as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{Material as s,MaterialParameters as n}from"../lib/Material.js";import{writeBufferVec2 as a,writePosition as o,writeNormal as c,writeBufferVec3 as l,writeBufferFloat as u}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as h,layout as f,baseLayout as p}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as d}from"../shaders/LineCalloutTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class m extends s{constructor(e,t){super(e,$),this.intersectDraped=void 0,this.produces=new Map([[16,e=>r(e)],[17,e=>r(e)]]),this._configuration=new d(t),this._uniqueMaterialIdentifier=S(this.parameters)}passParameters(){return this.parameters}updateConfiguration(e
|
|
2
|
+
import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{Material as s,MaterialParameters as n}from"../lib/Material.js";import{writeBufferVec2 as a,writePosition as o,writeNormal as c,writeBufferVec3 as l,writeBufferFloat as u}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as h,layout as f,baseLayout as p}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as d}from"../shaders/LineCalloutTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class m extends s{constructor(e,t){super(e,$),this.intersectDraped=void 0,this.produces=new Map([[16,e=>r(e)],[17,e=>r(e)]]),this._configuration=new d(t),this._uniqueMaterialIdentifier=S(this.parameters)}passParameters(){return this.parameters}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hudDepth=17===e.slot,this._configuration.hudDepthAlignStart=!!this.parameters.hudDepthAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.terrainDepthTest=e.terrainDepthTest}get visible(){return this.parameters.color[3]>=g||(this.parameters.borderColor?.[3]??0)>=g}intersect(){}createGLMaterial(e){return new O(e)}createBufferWriter(){return new b}validateParameters(e){this._uniqueMaterialIdentifier=S(e)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}}function S({renderOccluded:t,isDecoration:r,horizontalScreenOffset:i,color:s,size:n,shaderPolygonOffset:a,hudDepthAlignStart:o,centerOffsetUnits:c,hasSlicePlane:l,screenSizePerspective:u,verticalOffset:h,borderColor:f}){return e`${t}:${r}:${i}:[${s}]:${n}:${a}:${o}:${c}:${l}:${null!=u}:{${h?.screenLength}:${h?.minWorldLength}:${h?.maxWorldLength}}:[${f}]`}class O extends i{beginSlot(e){return this.getTechnique(h,e)}}class $ extends n{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=t(0,0,0,1),this.size=1,this.shaderPolygonOffset=1e-5,this.hudDepthAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}class b{constructor(){this.layout=f,this.baseInstanceLayout=p}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}writeBaseInstance(e,t){const{uv0:r}=t;a(e.get("uv0"),r,0)}write(e,t,r,i,s,n){return o(r.get("position"),e,s.position,n),c(r.get("normal"),t,s.normal,n),l(r.get("centerOffset"),s.centerOffset,n),u(r.get("groundDistance"),s.groundDistance,n),null}}export{m as LineCalloutMaterial,$ as Parameters,S as uniqueMaterialIdentifier};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{set as e,equals as t,transformMat4 as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{makeFloat16Array as a}from"../../../../geometry/support/float16.js";import{isColor as s,isDepth as o,isColorHighlightOLIDOrDepth as h}from"../core/shaderLibrary/ShaderOutput.js";import n from"../lib/GLMaterial.js";import{Material as c}from"../lib/Material.js";import{VisualVariablePassParameters as p}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as l}from"./internal/bufferWriterUtils.js";import{getLayout as m,LineMarkerTechnique as u}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as d}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as f}from"../../../../webscene/support/AlphaCutoff.js";class g extends c{constructor(e,t){super(e,v),this.produces=new Map([[2,e=>
|
|
2
|
+
import{set as e,equals as t,transformMat4 as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{makeFloat16Array as a}from"../../../../geometry/support/float16.js";import{isColor as s,isDepth as o,isColorHighlightOLIDOrDepth as h}from"../core/shaderLibrary/ShaderOutput.js";import n from"../lib/GLMaterial.js";import{Material as c}from"../lib/Material.js";import{VisualVariablePassParameters as p}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as l}from"./internal/bufferWriterUtils.js";import{getLayout as m,LineMarkerTechnique as u}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as d}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as f}from"../../../../webscene/support/AlphaCutoff.js";class g extends c{constructor(e,t){super(e,v),this.produces=new Map([[2,e=>10===e||s(e)&&8===this.parameters.renderOccluded],[3,e=>o(e)],[11,e=>h(e)&&8===this.parameters.renderOccluded],[12,e=>h(e)&&8===this.parameters.renderOccluded],[4,e=>s(e)&&this.parameters.writeDepth],[9,e=>s(e)&&!this.parameters.writeDepth],[19,e=>s(e)||10===e]]),this.intersectDraped=void 0,this._configuration=new d(t)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.space=19===e.slot?0:this.parameters.worldSpace?2:1,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=0!==this.parameters.cap,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=e.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.terrainDepthTest=e.terrainDepthTest&&s(e.output),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective}get visible(){return this.parameters.color[3]>=f}intersect(){}createBufferWriter(){return new S(m(this.parameters),this.parameters)}createGLMaterial(e){return new _(e)}}class _ extends n{dispose(){super.dispose(),this._markerTextures?.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(u,e)}}class v extends p{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=0,this.anchor=0,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.stipplePattern=null,this.markerTexture=null}}class S{constructor(e,t){this.layout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,s,o,h,n,c){const p=o.get("position").data,m=p.length/3;let u=[1,0,0];const d=o.get("normal");this._parameters.worldSpace&&null!=d&&(u=d.data);let f=1,g=0;this._parameters.vvSize?g=o.get("sizeFeatureAttribute").data[0]:o.has("size")&&(f=o.get("size").data[0]);let _=[1,1,1,1],v=0;this._parameters.vvColor?v=o.get("colorFeatureAttribute").data[0]:o.has("color")&&(_=o.get("color").data);let S=0;this._parameters.vvOpacity&&(S=o.get("opacityFeatureAttribute").data[0]);const P=new Float32Array(n.buffer),T=a(n.buffer),O=new Uint8Array(n.buffer);let V=c*(this.layout.stride/4);const k=P.BYTES_PER_ELEMENT/T.BYTES_PER_ELEMENT,j=4/k,y=(e,t,r,i)=>{P[V++]=e[0],P[V++]=e[1],P[V++]=e[2],l(t,e,T,V*k),V+=j;let a=V*k;if(T[a++]=r[0],T[a++]=r[1],V=Math.ceil(a/k),this._parameters.vvColor)P[V++]=v;else{const e=Math.min(4*i,_.length-4),t=4*V++;O[t]=255*_[e],O[t+1]=255*_[e+1],O[t+2]=255*_[e+2],O[t+3]=255*_[e+3]}this._parameters.vvOpacity&&(P[V++]=S),a=V*k,this._parameters.vvSize?(P[V++]=g,a+=2):T[a++]=f,this._parameters.worldSpace&&(T[a++]=u[0],T[a++]=u[1],T[a++]=u[2]),V=Math.ceil(a/k)},M=(a,s)=>{const o=e(b,p[3*a],p[3*a+1],p[3*a+2]),h=w;let n=a+s;do{e(h,p[3*n],p[3*n+1],p[3*n+2]),n+=s}while(t(o,h)&&n>=0&&n<m);i&&(r(o,o,i),r(h,h,i)),y(o,h,[-1,-1],a),y(o,h,[1,-1],a),y(o,h,[1,1],a),y(o,h,[-1,-1],a),y(o,h,[1,1],a),y(o,h,[-1,1],a)},x=this._parameters.placement;return"begin"!==x&&"begin-end"!==x||M(0,1),"end"!==x&&"begin-end"!==x||M(m-1,-1),null}}const b=i(),w=i();export{g as LineMarkerMaterial,v as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{set as t,normalize as e,subtract as r,cross as s,distance as o,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as l}from"../core/shaderLibrary/ShaderOutput.js";import c from"../lib/GLMaterial.js";import{Material as p,MaterialParameters as u}from"../lib/Material.js";import{MeasurementArrowTechnique as h,layout as f}from"../shaders/MeasurementArrowTechnique.js";import{MeasurementArrowTechniqueConfiguration as m}from"../shaders/MeasurementArrowTechniqueConfiguration.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";class g extends p{constructor(t){super(t,w),this._configuration=new m,this.intersectDraped=void 0,this.produces=new Map([[2,t=>!this._transparent&&l(t)],[9,t=>this._transparent&&l(t)]])}updateConfiguration(t
|
|
2
|
+
import{set as t,normalize as e,subtract as r,cross as s,distance as o,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as l}from"../core/shaderLibrary/ShaderOutput.js";import c from"../lib/GLMaterial.js";import{Material as p,MaterialParameters as u}from"../lib/Material.js";import{MeasurementArrowTechnique as h,layout as f}from"../shaders/MeasurementArrowTechnique.js";import{MeasurementArrowTechniqueConfiguration as m}from"../shaders/MeasurementArrowTechniqueConfiguration.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";class g extends p{constructor(t){super(t,w),this._configuration=new m,this.intersectDraped=void 0,this.produces=new Map([[2,t=>!this._transparent&&l(t)],[9,t=>this._transparent&&l(t)]])}updateConfiguration(t){super.updateConfiguration(t),this._configuration.polygonOffsetEnabled=this.parameters.polygonOffset,this._configuration.transparent=this._transparent}get visible(){const{outlineColor:t,stripeEvenColor:e,stripeOddColor:r}=this.parameters;return t[3]>=d||e[3]>=d||r[3]>=d}intersect(){}createGLMaterial(t){return new C(t)}createBufferWriter(){return new O}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class C extends c{beginSlot(t){return this.getTechnique(h,t)}}class w extends u{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1,this.polygonOffset=!1}}const b=n(),j=n(),v=n(),M=n(),x=n();class O{constructor(){this.layout=f}elementCount(t){return 2*(t.get("position").indices.length/2+1)}write(n,a,l,c,p,u){const{data:h,indices:f}=l.get("position"),m=l.get("normal").data,d=h.length/3;f&&f.length!==2*(d-1)&&console.warn("MeasurementArrowMaterial does not support indices");const g=b,C=j,w=v,O=M,_=x,y=p.position,A=p.normal,E=p.uv0;let L=0;for(let b=0;b<d;++b){const l=3*b;if(t(g,h[l],h[l+1],h[l+2]),b<d-1){const o=3*(b+1);t(C,h[o],h[o+1],h[o+2]),t(_,m[o],m[o+1],m[o+2]),e(_,_),r(w,C,g),e(w,w),s(O,_,w),e(O,O)}const c=o(g,C);n&&a&&(i(g,g,n),i(C,C,n),i(O,O,a));const p=u+2*b,f=p+1;y.setVec(p,g),y.setVec(f,g),A.setVec(p,O),A.setVec(f,O),E.set(p,0,L),E.set(p,1,-1),E.set(f,0,L),E.set(f,1,1),b<d-1&&(L+=c)}const V=p.length;for(let t=0;t<2*d;++t)V.set(u+t,L);return null}}export{g as MeasurementArrowMaterial,w as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{set as i,subtract as s,dot as n,scale as a,add as c,copy as l,length as m,distance as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{distance2 as h,fromPoints as g,closestLineSegmentPoint as d,create as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as b,signedDistance as x,getNormal as y,create as L}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOLID as v}from"../core/shaderLibrary/ShaderOutput.js";import S from"../lib/GLMaterial.js";import{Material as M,MaterialParameters as w}from"../lib/Material.js";import{isTranslationMatrix as C}from"../lib/Util.js";import{DefaultBufferWriter as T}from"./DefaultBufferWriter.js";import{PositionColorLayout as _,PositionLayout as A}from"./DefaultLayouts.js";import{NativeLineTechnique as V}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as N}from"../shaders/NativeLineTechniqueConfiguration.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class U extends M{constructor(e){super(e,P),this._configuration=new N,this.produces=new Map([[2,e=>v(e)]])}updateConfiguration(e
|
|
2
|
+
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{set as i,subtract as s,dot as n,scale as a,add as c,copy as l,length as m,distance as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{distance2 as h,fromPoints as g,closestLineSegmentPoint as d,create as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as b,signedDistance as x,getNormal as y,create as L}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOLID as v}from"../core/shaderLibrary/ShaderOutput.js";import S from"../lib/GLMaterial.js";import{Material as M,MaterialParameters as w}from"../lib/Material.js";import{isTranslationMatrix as C}from"../lib/Util.js";import{DefaultBufferWriter as T}from"./DefaultBufferWriter.js";import{PositionColorLayout as _,PositionLayout as A}from"./DefaultLayouts.js";import{NativeLineTechnique as V}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as N}from"../shaders/NativeLineTechniqueConfiguration.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class U extends M{constructor(e){super(e,P),this._configuration=new N,this.produces=new Map([[2,e=>v(e)]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=e.hasOccludees}get visible(){return this.parameters.color[3]>=R}intersect(t,r,f,p,j,L){const{options:v,camera:S,rayBegin:M,rayEnd:w}=f;if(!v.selectionMode||!t.visible||!S)return;if(!C(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const T=t.attributes.get("position").data,_=H;o(_,f.point);const A=2;i(I[0],_[0]-A,_[1]+A,0),i(I[1],_[0]+A,_[1]+A,0),i(I[2],_[0]+A,_[1]-A,0),i(I[3],_[0]-A,_[1]-A,0);for(let e=0;e<4;e++)if(!S.unprojectFromRenderScreen(I[e],J[e]))return;b(S.eye,J[0],J[1],K),b(S.eye,J[1],J[2],Q),b(S.eye,J[2],J[3],Y),b(S.eye,J[3],J[0],Z);let V=Number.MAX_VALUE,N=0;for(let e=0;e<T.length-5;e+=3){if(q[0]=T[e]+r[12],q[1]=T[e+1]+r[13],q[2]=T[e+2]+r[14],B[0]=T[e+3]+r[12],B[1]=T[e+4]+r[13],B[2]=T[e+5]+r[14],x(K,q)<0&&x(K,B)<0||x(Q,q)<0&&x(Q,B)<0||x(Y,q)<0&&x(Y,B)<0||x(Z,q)<0&&x(Z,B)<0)continue;const t=S.projectToRenderScreen(q,W),o=S.projectToRenderScreen(B,X);if(null==t||null==o)continue;if(t[2]<0&&o[2]>0){s(D,q,B);const e=S.frustum,r=-x(e[4],q)/n(D,y(e[4]));if(a(D,D,r),c(q,q,D),!S.projectToRenderScreen(q,t))continue}else if(t[2]>0&&o[2]<0){s(D,B,q);const e=S.frustum,t=-x(e[4],B)/n(D,y(e[4]));if(a(D,D,t),c(B,B,D),!S.projectToRenderScreen(B,o))continue}else if(t[2]<0&&o[2]<0)continue;t[2]=0,o[2]=0;const i=h(g(t,o,F),_);i<V&&(V=i,l(G,q),l(z,B),N=e/3)}if(V<A*A){let e=Number.MAX_VALUE;if(d(g(G,z,F),g(M,w,k),O)){s(O,O,M);const t=m(O);a(O,O,1/t),e=t/u(M,w)}L(e,O,N)}}intersectDraped(e,r,o,i,s){if(!r.options.selectionMode)return;const n=e.attributes.get("position").data,a=e.attributes.get("size"),c=a?a.data[0]:0,l=o[0],m=o[1],u=((c+1)/2+4)*e.screenToWorldRatio;let f=Number.MAX_VALUE,p=0;for(let h=0;h<n.length-5;h+=3){const e=n[h],r=n[h+1],o=l-e,i=m-r,s=n[h+3]-e,a=n[h+4]-r,c=t((s*o+a*i)/(s*s+a*a),0,1),u=s*c-o,g=a*c-i,d=u*u+g*g;d<f&&(f=d,p=h/3)}f<u*u&&i(s.distance,s.normal,p)}createGLMaterial(e){return new E(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?_:A;return new T(e)}}class E extends S{beginSlot(e){return this.getTechnique(V,e)}}class P extends w{constructor(){super(...arguments),this.color=p,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1}}const q=f(),B=f(),D=f(),O=f(),W=r(),X=r(),G=f(),z=f(),F=j(),k=j(),H=f(),I=[r(),r(),r(),r()],J=[f(),f(),f(),f()],K=L(),Q=L(),Y=L(),Z=L();export{U as NativeLineMaterial,P as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{clamp as
|
|
2
|
+
import{clamp as t}from"../../../../core/mathUtils.js";import{clone as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{isShadowLike as s,is3DGeometryOutputMRT as a,isColor as o}from"../core/shaderLibrary/ShaderOutput.js";import n from"../lib/GLMaterial.js";import{Material as h}from"../lib/Material.js";import{isPathGeometry as p}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as c,intersectAabbInvDir as u}from"../lib/RayIntersections.js";import{DefaultBufferWriter as m}from"./DefaultBufferWriter.js";import{getLayout as l,PathPassParameters as d,PathTechnique as f}from"./PathTechnique.js";import{PathTechniqueConfiguration as b}from"./PathTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class _ extends h{constructor(t,e){super(t,w),this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,t=>(this.parameters.castShadows&&s(t)||a(t))&&!this.transparent],[4,t=>(this.parameters.castShadows&&s(t)||a(t))&&this.transparent]]),this._configuration=new b(e.spherical)}get hasEmissions(){return this.parameters.emissiveStrength>0}updateConfiguration(t){super.updateConfiguration(t),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,o(t.output)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?1:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?2:0,this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.snowCover=t.snowCover>0}isVisibleForOutput(t){return 5!==t&&7!==t&&6!==t||this.parameters.castShadows}get visible(){return this.parameters.opacity>=g}intersect(t,e,i,r,s,a){this._intersect(t,i,r,s,a)}intersectDraped(t,e,i,r){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersect(t,e,this._pp0,this._pp1,r)}_intersect(i,s,a,o,n){const h=i;if(!p(h))return;const m=h.path,l=e(this.parameters.size);if(this.parameters.vvSize){const{offset:e,factor:i,minSize:r,maxSize:s,fallback:a}=this.parameters.vvSize,o=m.sizeAttributeValue;Number.isNaN(o)?(l[0]*=a[0],l[1]*=a[2]):(l[0]*=t(e[0]+o*i[0],r[0],s[0]),l[1]*=t(e[2]+o*i[2],r[2],s[2]))}const d=new c(s.tolerance,!1,s.options.normalRequired),f=Math.max(l[0],l[1]),b=i.boundingInfo;if(null==b)return void v(m,l,a,o,d,n);const g=r(b.bbMin[0]-f,b.bbMin[1]-f,b.bbMin[2]-f,b.bbMax[0]+f,b.bbMax[1]+f,b.bbMax[2]+f),_=[o[0]-a[0],o[1]-a[1],o[2]-a[2]],S=Math.sqrt(_[0]*_[0]+_[1]*_[1]+_[2]*_[2]),w=[S/_[0],S/_[1],S/_[2]];u(g,a,w,s.tolerance)&&v(m,l,a,o,d,n)}createBufferWriter(){return new m(l(this.parameters))}createGLMaterial(t){return new S(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class S extends n{beginSlot(t){return this.getTechnique(f,t)}}function v(t,e,i,r,s,a){t.baked.size&&t.baked.size[0]===e[0]&&t.baked.size[1]===e[1]||t.baked.bake(e),t.baked.intersect(i,r,s,a)}class w extends d{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1}}export{w as Parameters,_ as PathMaterial};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{freeze as t,create as i,ZEROS as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{glLayout as s}from"../../support/buffer/glUtil.js";import{newLayout as l}from"../../support/buffer/InterleavedLayout.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{freeze as t,create as i,ZEROS as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{glLayout as s}from"../../support/buffer/glUtil.js";import{newLayout as l}from"../../support/buffer/InterleavedLayout.js";import{isOITColor as a}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as n}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{ReloadableShader as m}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as c}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as p}from"../effects/geometry/olidUtils.js";import{OITPolygonOffset as u,depthTest as f,blending as h}from"../lib/OrderIndependentTransparency.js";import{stencilBaseAllZerosParams as d,stencilWriteMaskOn as b}from"../lib/StencilUtils.js";import{P as g}from"../../../../chunks/Path.glsl.js";import{advancedMRRFactors as j}from"./pbrUtils.js";import{makePipelineState as S,defaultColorWrite as v,defaultDepthWrite as y,frontFaceCullingParams as P}from"../../../webgl/renderState.js";class T extends n{constructor(){super(...arguments),this.ambient=t(.2,.2,.2),this.diffuse=t(.8,.8,.8),this.opacity=1,this.origin=i(),this.modelTransformation=null,this.mrrFactors=j,this.emissiveStrengthFromSymbol=0,this.emissiveSource=1,this.emissiveBaseColor=o}get emissiveStrength(){return this.emissiveStrengthFromSymbol}}let V=class extends c{constructor(e,r){super(e,r,s(x(r))),this.shader=new m(g,()=>import("./Path.glsl.js"))}initializePipeline(e){const{output:r,transparent:t,hasSlicePlane:i,doubleSidedMode:o,hasOccludees:s}=e,l=!a(r);return S({blending:t?h(r):null,culling:i&&!t&&0!==o?P:null,depthTest:f(r),depthWrite:l?y:null,colorWrite:v,stencilWrite:s?b:null,stencilTest:s?d:null,polygonOffset:l?null:u})}};function x(e){const r=l().vec3f("position").vec4f16("profileVertexAndNormal").vec2i16("profileRight",{glNormalized:!0}).vec2i16("profileUp",{glNormalized:!0});return e.hasVVSize&&r.f32("sizeFeatureAttribute"),e.hasVVColor&&r.f32("colorFeatureAttribute"),e.hasVVOpacity&&r.f32("opacityFeatureAttribute"),p()&&r.vec4u8("olidColor"),r.vec3f16("profileAuxData"),r.freeze()}V=e([r("esri.views.3d.webgl-engine.materials.PathTechnique")],V);export{T as PathPassParameters,V as PathTechnique,x as getLayout};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{IDENTITY as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewVec4f as r,BufferViewUint32 as s,BufferViewMat3f as i,BufferViewVec4u8 as o,BufferViewFloat as n}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as a,isColor as u,isDepth as l,isColorHighlightOrOLID as c}from"../core/shaderLibrary/ShaderOutput.js";import f from"../lib/GLMaterial.js";import{assert as h}from"../lib/Util.js";import{DefaultBufferWriter as p}from"./DefaultBufferWriter.js";import{TriangleMaterial as m}from"./TriangleMaterial.js";import{VisualVariablePassParameters as d}from"./VisualVariablePassParameters.js";import{writeAttributes as g,writeBufferVec4 as x,writeColor as b,writeVVFeatureAttribute as y}from"./internal/bufferWriterUtils.js";import{getLayout as j,getTextureLayout as v}from"../shaders/PatternLayouts.js";import{PatternTechnique as C}from"../shaders/PatternTechnique.js";import{PatternTechniqueConfiguration as w}from"../shaders/PatternTechniqueConfiguration.js";import{alphaCutoff as B}from"../../../../webscene/support/AlphaCutoff.js";class F extends m{constructor(e){super(e,P),this._configuration=new w,this.supportsEdges=!0,this.transparent=!0,this.produces=new Map([[2,e=>a(e)],[4,e=>u(e)],[5,e=>l(e)],[19,e=>this.parameters.draped&&c(e)]])}updateConfiguration(e
|
|
2
|
+
import{IDENTITY as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewVec4f as r,BufferViewUint32 as s,BufferViewMat3f as i,BufferViewVec4u8 as o,BufferViewFloat as n}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as a,isColor as u,isDepth as l,isColorHighlightOrOLID as c}from"../core/shaderLibrary/ShaderOutput.js";import f from"../lib/GLMaterial.js";import{assert as h}from"../lib/Util.js";import{DefaultBufferWriter as p}from"./DefaultBufferWriter.js";import{TriangleMaterial as m}from"./TriangleMaterial.js";import{VisualVariablePassParameters as d}from"./VisualVariablePassParameters.js";import{writeAttributes as g,writeBufferVec4 as x,writeColor as b,writeVVFeatureAttribute as y}from"./internal/bufferWriterUtils.js";import{getLayout as j,getTextureLayout as v}from"../shaders/PatternLayouts.js";import{PatternTechnique as C}from"../shaders/PatternTechnique.js";import{PatternTechniqueConfiguration as w}from"../shaders/PatternTechniqueConfiguration.js";import{alphaCutoff as B}from"../../../../webscene/support/AlphaCutoff.js";class F extends m{constructor(e){super(e,P),this._configuration=new w,this.supportsEdges=!0,this.transparent=!0,this.produces=new Map([[2,e=>a(e)],[4,e=>u(e)],[5,e=>l(e)],[19,e=>this.parameters.draped&&c(e)]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.style=this.parameters.style,this._configuration.draped=this.parameters.draped,this._configuration.terrainDepthTest=e.terrainDepthTest&&u(e.output),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.emissionSource=this.hasEmissions?1:0}get visible(){return this.parameters.color[3]>=B}get hasEmissions(){return this.parameters.emissiveStrength>0}createGLMaterial(e){return new S(e)}createBufferWriter(){return new T(j(this.parameters),v(this.parameters))}}class S extends f{beginSlot(e){return this.getTechnique(C,e)}}class T extends p{constructor(e,t){super(e),this.textureBufferLayout=t}elementCountTextureBuffer(e){return e.get("boundingRect")?.indices.length??0}write(e,t,i,o,n,a,u){const l=g(i,o,this.layout,e,t,n,a);for(const s of this.layout.fields.keys()){const e=i.get(s),t=e?.indices;if(e&&t)switch(s){case"uvMapSpace":{h(4===e.size);const t=n.getField(s,r);t&&x(e,t,a);break}}}const{textureBufferLayout:c}=this;if(null==c)return l;h(null!=u,"Using a texture layout, but the texture range for this instance was not provided");const f=u.from;h(1===u.numElements,"Provided more than one texture buffer element per polygon");const p=n.getField("textureElementIndex",s);h(null!=p,"Missing component index field");const m=i.get("position")?.indices.length??0;for(let r=0;r<m;++r)p.set(a+r,f);return l}writeTextureBuffer(t,r,s,a,u){const{textureBufferLayout:l}=this;if(null==l)return;const c=a.getField("boundingRect",i),f=s.get("boundingRect");c&&f&&(h(9===f.size),_(f,t??e,c,u));const p=a.getField("color",o),m=s.get("color");p&&m&&(h(3===m.size||4===m.size),b(m,m.size,p,u));const d=a.getField("colorFeatureAttribute",n),g=s.get("colorFeatureAttribute");d&&g&&(h(1===g.size),y(g,d,u))}}function _(e,t,r,s){const{data:i,indices:o}=e,n=t,a=r.typedBuffer,u=r.typedBufferStride,l=o.length;s*=u;for(let c=0;c<l;++c){const e=9*o[c],t=i[e],r=i[e+1],l=i[e+2];a[s]=n[0]*t+n[4]*r+n[8]*l+n[12],a[s+1]=n[1]*t+n[5]*r+n[9]*l+n[13],a[s+2]=n[2]*t+n[6]*r+n[10]*l+n[14];for(let o=3;o<9;++o)a[s+o]=i[e+o];s+=u}}class P extends d{constructor(){super(...arguments),this.color=t(1,1,1,1),this.emissiveStrength=0,this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=0,this.hasOccludees=!1,this.style=2,this.draped=!0,this.useIndexing=!0}}export{P as Parameters,F as PatternMaterial};
|