@arcgis/core 5.2.0-next.120 → 5.2.0-next.122
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/Ground.js +1 -1
- package/arcade/containerUtils.js +1 -1
- package/arcade/functions/feature.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/arcgisGlobal.d.ts +9 -0
- package/assets/components/assets/icon/addCellAbove16.json +1 -0
- package/assets/components/assets/icon/addCellAbove24.json +1 -0
- package/assets/components/assets/icon/addCellAbove32.json +1 -0
- package/assets/components/assets/icon/addCellBelow16.json +1 -0
- package/assets/components/assets/icon/addCellBelow24.json +1 -0
- package/assets/components/assets/icon/addCellBelow32.json +1 -0
- package/assets/components/assets/icon/linkedChart16.json +1 -0
- package/assets/components/assets/icon/linkedChart24.json +1 -0
- package/assets/components/assets/icon/linkedChart32.json +1 -0
- package/assets/components/assets/icon/polygonFromFeature16.json +1 -0
- package/assets/components/assets/icon/polygonFromFeature24.json +1 -0
- package/assets/components/assets/icon/polygonFromFeature32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0148cb611bf7c8c5fe8a.js +1 -0
- package/assets/esri/core/workers/chunks/025da54eef112d7e8f66.js +1 -0
- package/assets/esri/core/workers/chunks/033debcbf6b3683dc4fe.js +2 -0
- package/assets/esri/core/workers/chunks/064445e6f9512817ac87.js +2 -0
- package/assets/esri/core/workers/chunks/{304462b049116f59accc.js → 09676cfa99b90fe0cc63.js} +1 -1
- package/assets/esri/core/workers/chunks/0aadee0437fa061e4ff5.js +1 -0
- package/assets/esri/core/workers/chunks/{deb5b1d772ca407654d4.js → 0acc754907395e83bbc6.js} +1 -1
- package/assets/esri/core/workers/chunks/1302bf9718747cd9fdd9.js +1 -0
- package/assets/esri/core/workers/chunks/{956432c9d45940983bc2.js → 1b42d163ef22e3565bb7.js} +1 -1
- package/assets/esri/core/workers/chunks/1b551ef3d84d9c1e93f9.js +1 -0
- package/assets/esri/core/workers/chunks/1c38ce72160d5a4e4b3d.js +1 -0
- package/assets/esri/core/workers/chunks/1c3b087fbf2d102376fc.js +1 -0
- package/assets/esri/core/workers/chunks/{e18b8646c7378213b618.js → 1e46703cb566c25458ad.js} +1 -1
- package/assets/esri/core/workers/chunks/1f135269aea3931e11b2.js +1 -0
- package/assets/esri/core/workers/chunks/{ea9e770efc85594e4dd2.js → 216d8cb86548e92a8196.js} +1 -1
- package/assets/esri/core/workers/chunks/23279303cd7698314c56.js +1 -0
- package/assets/esri/core/workers/chunks/{4bf2cc4d092601ff2b86.js → 24673aac70d6c949b6fa.js} +1 -1
- package/assets/esri/core/workers/chunks/24cf91aeab53a897e951.js +1 -0
- package/assets/esri/core/workers/chunks/26bc509a031788bfa678.js +1 -0
- package/assets/esri/core/workers/chunks/{d629708bf23da24ee523.js → 298f234f11a10c5120a2.js} +1 -1
- package/assets/esri/core/workers/chunks/29ae19206bbeb480be0f.js +1 -0
- package/assets/esri/core/workers/chunks/2ae6deade655fdbc28de.js +1 -0
- package/assets/esri/core/workers/chunks/{37cf4ca2083cd3b6002e.js → 2c7bb5c9751524687002.js} +1 -1
- package/assets/esri/core/workers/chunks/2c8957f9c7610805208c.js +1 -0
- package/assets/esri/core/workers/chunks/{dc1944a7601b518a9c48.js → 2ca49fb4590cc34a02bd.js} +1 -1
- package/assets/esri/core/workers/chunks/2d592c935571de80a2e2.js +1 -0
- package/assets/esri/core/workers/chunks/{a917a1df8270860dc514.js → 2f52ad525744b8793d49.js} +1 -1
- package/assets/esri/core/workers/chunks/{f890359d972cce54459e.js → 2f829321bfbd3bacd64f.js} +1 -1
- package/assets/esri/core/workers/chunks/{6efc5873747b9cd44fb9.js → 323451ef52d0c2805f1d.js} +1 -1
- package/assets/esri/core/workers/chunks/{7232fc11b23777b6be94.js → 369012c032ea6882607c.js} +1 -1
- package/assets/esri/core/workers/chunks/37ae52c71bf9c70fbb92.js +1 -0
- package/assets/esri/core/workers/chunks/38890ac5917942374ab8.js +1 -0
- package/assets/esri/core/workers/chunks/3e33d953e41b281a120b.js +1 -0
- package/assets/esri/core/workers/chunks/3e52351e06d85bf9bedd.js +1 -0
- package/assets/esri/core/workers/chunks/{9f760dc4492a03e0504c.js → 45d87af48a21644590c2.js} +1 -1
- package/assets/esri/core/workers/chunks/462fd57af8ed7921d6ba.js +1 -0
- package/assets/esri/core/workers/chunks/463d69f596d1d34ef275.js +2 -0
- package/assets/esri/core/workers/chunks/475906b079f4f1ddacf2.js +1 -0
- package/assets/esri/core/workers/chunks/48a2f68e06a2e90b77d0.js +1 -0
- package/assets/esri/core/workers/chunks/49affbed22e201f7c32b.js +1 -0
- package/assets/esri/core/workers/chunks/{b6ca73c1384f07b30b74.js → 4bb8432d99a39733368f.js} +1 -1
- package/assets/esri/core/workers/chunks/{cb983f65995e57fff7a1.js → 4f58e0322707f63f5bf2.js} +1 -1
- package/assets/esri/core/workers/chunks/{8f0ecf4d06ec7b67d4ed.js → 52744dfd430cd0c0edfb.js} +1 -1
- package/assets/esri/core/workers/chunks/58a17fb3c0dd07c63d57.js +2 -0
- package/assets/esri/core/workers/chunks/5993db944b9e7825e0bc.js +1 -0
- package/assets/esri/core/workers/chunks/{b0058619e0363002ad86.js → 59cd139712d919e6a738.js} +1 -1
- package/assets/esri/core/workers/chunks/59d5247ac4075b024244.js +1 -0
- package/assets/esri/core/workers/chunks/5b9f3c4f65412c66316f.js +1 -0
- package/assets/esri/core/workers/chunks/{be3421ffb5b391bca02e.js → 5d35e0c2665f5e625ee9.js} +1 -1
- package/assets/esri/core/workers/chunks/5e70bfb9d6235a87b87a.js +1 -0
- package/assets/esri/core/workers/chunks/6006bd8a5ed945fa2776.js +1 -0
- package/assets/esri/core/workers/chunks/618927cfcb93dd1d92fd.js +1 -0
- package/assets/esri/core/workers/chunks/6709d24867d275b33d24.js +1 -0
- package/assets/esri/core/workers/chunks/68e24fa3f564c2a5c9fd.js +1 -0
- package/assets/esri/core/workers/chunks/{6ab7bb3834841834f839.js → 724ea2e2843e6dac0a90.js} +1 -1
- package/assets/esri/core/workers/chunks/7441d121f00ce747c08e.js +1 -0
- package/assets/esri/core/workers/chunks/{090c9c2dbf92f2cac0b8.js → 770ca70d363184e39d60.js} +1 -1
- package/assets/esri/core/workers/chunks/781fa83e8063b8f685dc.js +1 -0
- package/assets/esri/core/workers/chunks/78c1b75b1a8937eaa3cd.js +1 -0
- package/assets/esri/core/workers/chunks/793b072519ded0dc6f34.js +1 -0
- package/assets/esri/core/workers/chunks/7994fce5f36963aadc51.js +1 -0
- package/assets/esri/core/workers/chunks/7adee504107cb9ad8563.js +1 -0
- package/assets/esri/core/workers/chunks/7efc45858ebd3fd3302e.js +1 -0
- package/assets/esri/core/workers/chunks/7ff536284942c5284a16.js +1 -0
- package/assets/esri/core/workers/chunks/813dd84933b407c8fe86.js +1 -0
- package/assets/esri/core/workers/chunks/83c7c4218bc6ba2f16ee.js +1 -0
- package/assets/esri/core/workers/chunks/8daeac785af725c3ebdf.js +1 -0
- package/assets/esri/core/workers/chunks/{3ab25279aaa30f035038.js → 8daed13400d9e63e65ae.js} +1 -1
- package/assets/esri/core/workers/chunks/9020bd7a0e488d55ef14.js +1 -0
- package/assets/esri/core/workers/chunks/92f35b2c3c5f13778308.js +1 -0
- package/assets/esri/core/workers/chunks/97cd4145c016cf379120.js +1 -0
- package/assets/esri/core/workers/chunks/{cf7c06702babd6fa88b4.js → 9af36ee6a0df224859bc.js} +1 -1
- package/assets/esri/core/workers/chunks/{452d069ba7ad6759b558.js → 9c46c7f00d42f5c02b26.js} +1 -1
- package/assets/esri/core/workers/chunks/{32fc7d1db4b311f6b880.js → 9e5b30b907102bc0c201.js} +1 -1
- package/assets/esri/core/workers/chunks/a3ab53b534e2872131be.js +1 -0
- package/assets/esri/core/workers/chunks/{f18ee2eaa96d103627a6.js → aa6b2cc8f6f5627891c1.js} +1 -1
- package/assets/esri/core/workers/chunks/ac7af417ebf7721d7400.js +1 -0
- package/assets/esri/core/workers/chunks/aed479c14d93955f4798.js +1 -0
- package/assets/esri/core/workers/chunks/{60c61f34733063730386.js → b013b70e40dfb6ce013e.js} +1 -1
- package/assets/esri/core/workers/chunks/b22de8bf4a4a739bc36d.js +1 -0
- package/assets/esri/core/workers/chunks/b39cd78d2d97bef9909e.js +1 -0
- package/assets/esri/core/workers/chunks/b5f50955c1eee55b67d1.js +1 -0
- package/assets/esri/core/workers/chunks/b688e6463a651779a016.js +1 -0
- package/assets/esri/core/workers/chunks/bb5ed2a796a45c41b0b4.js +1 -0
- package/assets/esri/core/workers/chunks/bdf012e591a8476db467.js +1 -0
- package/assets/esri/core/workers/chunks/{daf7b647bd960d8bad56.js → be52c319a0a81ce1ba36.js} +1 -1
- package/assets/esri/core/workers/chunks/{066b7f6866d602f963e0.js → c3008b20cb5fd38bd900.js} +1 -1
- package/assets/esri/core/workers/chunks/{22e85819e23202a8ba90.js → c39ebd8d469f1e8bb61e.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f2ac03efaa4a4898ba2.js → c3b96d1d43afccd23e45.js} +2 -2
- package/assets/esri/core/workers/chunks/{89edaa1ffa566908ebca.js → ca5a4f62b09cc8579dc0.js} +1 -1
- package/assets/esri/core/workers/chunks/ce08e3369641da0d7a27.js +2 -0
- package/assets/esri/core/workers/chunks/ce1ccf9ec90b786591e5.js +1 -0
- package/assets/esri/core/workers/chunks/cf0bed7ae27021fd7b05.js +1 -0
- package/assets/esri/core/workers/chunks/cf6f671823fa6c2a9a5e.js +1 -0
- package/assets/esri/core/workers/chunks/d25210574168ead2f813.js +1 -0
- package/assets/esri/core/workers/chunks/d3378c479052d566317c.js +1 -0
- package/assets/esri/core/workers/chunks/{1742dbc6a827cfda471b.js → d3d48401462ef3bf0ad9.js} +1 -1
- package/assets/esri/core/workers/chunks/d3ef23923424ad8c5048.js +1 -0
- package/assets/esri/core/workers/chunks/{46388b86d1b10e6121bd.js → d507d7d7a7282fc38e8d.js} +1 -1
- package/assets/esri/core/workers/chunks/dc0816f064be576a2fa6.js +1 -0
- package/assets/esri/core/workers/chunks/{862e1acd80c4e43831dc.js → dc923e50958b68a50014.js} +1 -1
- package/assets/esri/core/workers/chunks/dd4ecf81250cc001d040.js +1 -0
- package/assets/esri/core/workers/chunks/e10fe4c77b8dc4492092.js +1 -0
- package/assets/esri/core/workers/chunks/e4e1db4e9e5f13167401.js +1 -0
- package/assets/esri/core/workers/chunks/e5ee64e2fb5bfcb716d8.js +1 -0
- package/assets/esri/core/workers/chunks/{e755075ac2e02e881fad.js → e6637f9176566382ed3e.js} +1 -1
- package/assets/esri/core/workers/chunks/e6dc68c4bd8eddb168d1.js +1 -0
- package/assets/esri/core/workers/chunks/eb780f2dafa14f776166.js +1 -0
- package/assets/esri/core/workers/chunks/{723478607badcde5706b.js → eb7f45736c852725b0bb.js} +150 -118
- package/assets/esri/core/workers/chunks/ed31ec586b754241474d.js +1 -0
- package/assets/esri/core/workers/chunks/f38d11be766043413659.js +1 -0
- package/assets/esri/core/workers/chunks/{98a5327fd96d9542b39f.js → f90cad9f007a11154c0d.js} +1 -1
- package/assets/esri/libs/pdfjs/pdf.worker.mjs +63075 -0
- package/assets/esri/libs/pdfjs/wasm/jbig2.wasm +0 -0
- package/assets/esri/libs/pdfjs/wasm/openjpeg.wasm +0 -0
- package/assets/esri/libs/pdfjs/wasm/qcms_bg.wasm +0 -0
- package/assets/esri/libs/pdfjs/wasm/quickjs-eval.wasm +0 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.en.json +1 -1
- package/basemaps/BasemapCollection.d.ts +148 -0
- package/basemaps/BasemapCollection.js +2 -0
- package/basemaps/BasemapsSource.d.ts +39 -0
- package/basemaps/BasemapsSource.js +2 -0
- package/basemaps/LocalBasemapsSource.d.ts +55 -0
- package/basemaps/LocalBasemapsSource.js +2 -0
- package/basemaps/PortalBasemapsSource.d.ts +98 -0
- package/basemaps/PortalBasemapsSource.js +2 -0
- package/basemaps/support/BasemapItem.d.ts +74 -0
- package/basemaps/support/BasemapItem.js +2 -0
- package/basemaps/support/basemapCompatibilityUtils.js +2 -0
- package/basemaps/types.d.ts +42 -0
- package/chunks/CheckerBoard.glsl.js +1 -1
- package/chunks/CloudsComposition.glsl.js +2 -2
- package/chunks/ColorMaterial.glsl.js +1 -1
- package/chunks/Component.glsl.js +11 -11
- package/chunks/DeepSky.glsl.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +4 -4
- package/chunks/EdgeShader.glsl.js +1 -1
- package/chunks/FocusArea.glsl.js +1 -1
- package/chunks/GaussianSplat.glsl.js +9 -9
- package/chunks/GlobalIllumination.glsl.js +42 -13
- package/chunks/GlobalIlluminationBlur.glsl.js +1 -1
- package/chunks/HUDMaterial.glsl.js +1 -1
- package/chunks/ImageMaterial.glsl.js +1 -1
- package/chunks/LineCallout.glsl.js +1 -1
- package/chunks/LineMarker.glsl.js +97 -89
- package/chunks/NativeLine.glsl.js +1 -1
- package/chunks/Path.glsl.js +8 -7
- package/chunks/Pattern.glsl.js +1 -1
- package/chunks/PointRenderer.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +4 -4
- package/chunks/RibbonLine.glsl.js +58 -56
- package/chunks/ShadowCastAccumulate.glsl.js +3 -3
- package/chunks/ShadowHighlight.glsl.js +4 -4
- package/chunks/ShadowHighlightBuffer.glsl.js +3 -3
- package/chunks/Terrain.glsl.js +12 -14
- package/chunks/Viewshed.glsl.js +1 -1
- package/chunks/Water.glsl.js +3 -3
- package/chunks/languageUtils.js +1 -1
- package/config.js +1 -1
- package/core/Accessor.d.ts +10 -0
- package/core/arrayUtils.js +1 -1
- package/core/workers/registry.js +1 -1
- package/geometry/support/geometryUtils.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/geometry/support/meshUtils/elevation.js +1 -1
- package/kernel.js +1 -1
- package/layers/CSVLayer.js +1 -1
- package/layers/GeoJSONLayer.d.ts +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/GeospatialPDFLayer.d.ts +40 -0
- package/layers/GeospatialPDFLayer.js +2 -0
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/OGCFeatureLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFFrame.js +2 -0
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +5 -0
- package/layers/geospatialPDF/GeospatialPDFParserUtils.js +2 -0
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +2 -0
- package/layers/geospatialPDF/LGIDictMapFrame.js +2 -0
- package/layers/geospatialPDF/Projection.js +2 -0
- package/layers/geospatialPDF/ViewportMeasureFrame.js +2 -0
- package/layers/geospatialPDF/renderExtentUtils.js +2 -0
- package/layers/geospatialPDF/sharedUtils.js +2 -0
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/raster/datasets/GeospatialPDFRaster.js +2 -0
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/LabelClass.d.ts +13 -4
- package/layers/support/LabelClass.js +1 -1
- package/layers/support/commonProperties.js +1 -1
- package/layers/support/layersLoader.js +1 -1
- package/layers/types.d.ts +1 -1
- package/legend/ActiveLayerInfo.d.ts +130 -0
- package/legend/ActiveLayerInfo.js +2 -0
- package/legend/LegendContent.d.ts +118 -0
- package/legend/LegendContent.js +2 -0
- package/legend/support/clusterUtils.js +2 -0
- package/legend/support/colorRampUtils.js +2 -0
- package/legend/support/heatmapRampUtils.js +2 -0
- package/legend/support/relationshipRampUtils.js +2 -0
- package/legend/support/sizeRampUtils.js +2 -0
- package/legend/support/utils.js +2 -0
- package/legend/types.d.ts +403 -0
- package/libs/i3s/I3SModule.js +1 -1
- package/package.json +7 -7
- package/portal/PortalItem.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/support/revision.js +1 -1
- package/support/userTypeGuards/isBasemapsSource.js +2 -0
- package/symbols/cim/CIMOperators.js +1 -1
- package/symbols/cim/callouts/effects/BackgroundCallout.js +2 -0
- package/symbols/cim/callouts/effects/BalloonCallout.js +2 -0
- package/symbols/cim/callouts/effects/PointSymbolCallout.js +2 -0
- package/symbols/cim/callouts/effects/SimpleLineCallout.js +2 -0
- package/symbols/cim/callouts/effects/calloutUtils.js +2 -0
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/symbols/support/typeUtils.js +1 -1
- package/views/2d/LabelManager.js +1 -1
- package/views/2d/engine/AFeatureContainer.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
- package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
- package/views/2d/engine/webgl/FeatureTile.js +1 -1
- package/views/2d/engine/webgl/GlyphWorker.js +1 -1
- package/views/2d/engine/webgl/TileCpuState.js +1 -1
- package/views/2d/engine/webgl/TileGpuState.js +1 -1
- package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
- package/views/2d/engine/webgl/collisions/LabelStore.js +2 -0
- package/views/2d/engine/webgl/cpuMapped/CpuBuffer.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/CpuMeshData.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/GpuMeshState.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
- package/views/2d/engine/webgl/mesh/MultiTileMeshData.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/CalloutMeshWriterCoordinator.js +2 -0
- package/views/2d/engine/webgl/mesh/factories/FeatureMeshFactory.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js +2 -0
- package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueInstance.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TestDisplayObject.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/ComputedMarkerParams.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/CalloutMeshWriterPolicy.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterVertexPack.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/dataViewUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/util/AnnotationMatcher.js +1 -1
- package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
- package/views/2d/engine/webgl/util/IntervalMatcher.js +1 -1
- package/views/2d/engine/webgl/util/LabelMatcher.js +1 -1
- package/views/2d/engine/webgl/util/MapMatcher.js +1 -1
- package/views/2d/engine/webgl/util/Matcher.js +1 -1
- package/views/2d/engine/webgl/util/MatcherContext.js +1 -1
- package/views/2d/input/MapViewInputManager.js +1 -1
- package/views/2d/input/handlers/KeyPan.js +1 -1
- package/views/2d/input/handlers/KeyRotate.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/GeospatialPDFLayerView2D.js +2 -0
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/RenderState.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/2d/layers/features/support/GraphicsReader.js +1 -1
- package/views/2d/layers/graphics/AGraphicContainer.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/2d/layers/support/annodime/MatcherGeometryOverride.js +1 -1
- package/views/2d/layers/support/annodime/PrivateMatcherGeometryOverrideEffect.js +1 -1
- package/views/2d/layers/support/annodime/annotationGraphic.js +1 -1
- package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
- package/views/2d/layers/support/annodime/debugUtils.js +1 -1
- package/views/2d/layers/support/annodime/virtualFields.js +1 -1
- package/views/2d/types.d.ts +2 -0
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
- package/views/3d/input/handlers/ground/GroundDoubleClickMove.js +2 -0
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/GeospatialPDFLayerView3D.js +2 -0
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/LayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerWorker.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/Intersector.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/support/GroundAndIMSurface.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
- package/views/3d/types.d.ts +2 -0
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +1 -3
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/forwardLinearDepthToReadShadow.glsl.js +4 -0
- package/views/3d/webgl-engine/core/shaderLibrary/{ForwardLinearDepthToWriteShadowMap.glsl.js → forwardLinearDepthToWriteShadow.glsl.js} +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +8 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +3 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/readFragmentShadow.glsl.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js +24 -0
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusArea.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastAccumulate.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/materials/DrawParameters.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/{AnimatedLine.glsl.js → animatedAlpha.glsl.js} +11 -17
- package/views/SceneView.d.ts +31 -0
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View.d.ts +35 -0
- package/views/View.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileQuerySourceUtils.js +1 -1
- package/views/interactive/options/ViewOptions.d.ts +98 -0
- package/views/interactive/options/ViewOptions.js +2 -0
- package/views/interactive/support/Units.d.ts +10 -2
- package/views/interactive/support/Units.js +1 -1
- package/views/layers/FeatureLikeLayerView.d.ts +27 -5
- package/views/layers/GraphicsLayerView.d.ts +25 -2
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/selection/types.d.ts +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/types.d.ts +9 -3
- package/widgets/BasemapGallery/BasemapGalleryViewModel.d.ts +3 -0
- package/widgets/BasemapGallery/support/BasemapGalleryItem.d.ts +3 -0
- package/widgets/BasemapGallery/support/LocalBasemapsSource.d.ts +2 -0
- package/widgets/BasemapGallery/support/PortalBasemapsSource.d.ts +2 -0
- package/widgets/BasemapGallery/types.d.ts +6 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +2 -0
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +2 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor.d.ts +2 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineGround.js +1 -1
- package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.d.ts +1 -0
- package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/Legend/LegendViewModel.d.ts +1 -0
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/styles/card/CardView.d.ts +1 -0
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.d.ts +1 -0
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.d.ts +2 -0
- package/widgets/Legend.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +8 -2
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar/VisibleElements.d.ts +8 -1
- package/widgets/support/SelectionToolbar/VisibleElements.js +1 -1
- package/widgets/support/SelectionToolbar.d.ts +7 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/assets/esri/core/workers/chunks/01ca17092545d72be7b6.js +0 -1
- package/assets/esri/core/workers/chunks/03918a862455191a8910.js +0 -1
- package/assets/esri/core/workers/chunks/0b727d7bf3e36e146725.js +0 -1
- package/assets/esri/core/workers/chunks/0bd067a5c0bac96caeb5.js +0 -1
- package/assets/esri/core/workers/chunks/0ff13f7a18b0123d253e.js +0 -1
- package/assets/esri/core/workers/chunks/114bc14c49176f64a2c5.js +0 -1
- package/assets/esri/core/workers/chunks/1630913399384030d0b9.js +0 -1
- package/assets/esri/core/workers/chunks/173417fe995e9bfc49d8.js +0 -1
- package/assets/esri/core/workers/chunks/1a39335aa2dce6d564d9.js +0 -1
- package/assets/esri/core/workers/chunks/25bb07d3c32b16a08813.js +0 -1
- package/assets/esri/core/workers/chunks/25cc6d7178a52f2f46b7.js +0 -1
- package/assets/esri/core/workers/chunks/2cf571d968118b6bdde0.js +0 -1
- package/assets/esri/core/workers/chunks/2e999b05ce179dd9fa08.js +0 -1
- package/assets/esri/core/workers/chunks/354912041363502c6a89.js +0 -1
- package/assets/esri/core/workers/chunks/36792b8a85e88044cb49.js +0 -1
- package/assets/esri/core/workers/chunks/3acc1299c1382c3b034d.js +0 -1
- package/assets/esri/core/workers/chunks/430802108b63194b7ddd.js +0 -2
- package/assets/esri/core/workers/chunks/43436c7ccc6baefc885d.js +0 -1
- package/assets/esri/core/workers/chunks/4396ef5ab3eb9e9a7df2.js +0 -1
- package/assets/esri/core/workers/chunks/445b0ca1b70730c9a2e6.js +0 -1
- package/assets/esri/core/workers/chunks/48d3da636be15581fd7d.js +0 -1
- package/assets/esri/core/workers/chunks/49e8ff5ed079a9e3be4b.js +0 -1
- package/assets/esri/core/workers/chunks/4efe5827a5c61db3b19d.js +0 -2
- package/assets/esri/core/workers/chunks/501df20cdd09384f6ee2.js +0 -1
- package/assets/esri/core/workers/chunks/50ae209237f104735a30.js +0 -1
- package/assets/esri/core/workers/chunks/54f9062526c2002b7fd7.js +0 -1
- package/assets/esri/core/workers/chunks/56b7ac280bf0be938c14.js +0 -1
- package/assets/esri/core/workers/chunks/5938d5f6e37f49867d5a.js +0 -1
- package/assets/esri/core/workers/chunks/61bcbafd676804ce3e1d.js +0 -1
- package/assets/esri/core/workers/chunks/63f7141c71f29dbe8270.js +0 -1
- package/assets/esri/core/workers/chunks/70347d25968975126fa7.js +0 -1
- package/assets/esri/core/workers/chunks/726ca458b98bb4334431.js +0 -1
- package/assets/esri/core/workers/chunks/75410a4de76e67ed5da4.js +0 -1
- package/assets/esri/core/workers/chunks/85780f4fa4b5509f864e.js +0 -1
- package/assets/esri/core/workers/chunks/862754d2d659528fe884.js +0 -1
- package/assets/esri/core/workers/chunks/8628c027198982baed7c.js +0 -1
- package/assets/esri/core/workers/chunks/8675ab3c4dec2f13b9c6.js +0 -1
- package/assets/esri/core/workers/chunks/8c521caf050a486b6548.js +0 -1
- package/assets/esri/core/workers/chunks/8ce14dd209462f88b163.js +0 -1
- package/assets/esri/core/workers/chunks/917dec9c004218c58950.js +0 -1
- package/assets/esri/core/workers/chunks/91f451b98e0f696043df.js +0 -1
- package/assets/esri/core/workers/chunks/9d92e6f0beed9a8580fa.js +0 -1
- package/assets/esri/core/workers/chunks/a42505b978d54d36d3b6.js +0 -1
- package/assets/esri/core/workers/chunks/a6d4132a16c51323a38a.js +0 -1
- package/assets/esri/core/workers/chunks/a86a4e550a92f770d6d5.js +0 -1
- package/assets/esri/core/workers/chunks/add834f867900a7091d2.js +0 -1
- package/assets/esri/core/workers/chunks/b45ebb1b64ee7314375e.js +0 -1
- package/assets/esri/core/workers/chunks/b56c5883a5468b18b122.js +0 -1
- package/assets/esri/core/workers/chunks/b5a102cf9f4377fb9842.js +0 -1
- package/assets/esri/core/workers/chunks/b6409d89914030d5854a.js +0 -1
- package/assets/esri/core/workers/chunks/baa8bce361a2677533ec.js +0 -1
- package/assets/esri/core/workers/chunks/c118b88a7c4359e68d9b.js +0 -1
- package/assets/esri/core/workers/chunks/c5e288d57bacb8451e2d.js +0 -2
- package/assets/esri/core/workers/chunks/ce3fb992f6c6ae7378a3.js +0 -1
- package/assets/esri/core/workers/chunks/ceda1e08c9ff26248db0.js +0 -1
- package/assets/esri/core/workers/chunks/cf1106eda10f3cccb1bd.js +0 -1
- package/assets/esri/core/workers/chunks/cfd8317ecd2e63af7c40.js +0 -1
- package/assets/esri/core/workers/chunks/d5e3f8e5b8d2576d3cb3.js +0 -2
- package/assets/esri/core/workers/chunks/d6130cd8a20d24dd9d3c.js +0 -1
- package/assets/esri/core/workers/chunks/da5b3421a984cb94fd58.js +0 -1
- package/assets/esri/core/workers/chunks/da6583e8d88441a1c02a.js +0 -1
- package/assets/esri/core/workers/chunks/ddb5d29a8998d0a76fd4.js +0 -1
- package/assets/esri/core/workers/chunks/de8a3a0796bd115426c0.js +0 -1
- package/assets/esri/core/workers/chunks/e52f30dfb7c82491a7f2.js +0 -1
- package/assets/esri/core/workers/chunks/e707534a700a2de687ca.js +0 -1
- package/assets/esri/core/workers/chunks/e88eee4c2fc4229c2a8b.js +0 -1
- package/assets/esri/core/workers/chunks/f465fb26541372fdc908.js +0 -2
- package/assets/esri/core/workers/chunks/f5423006fb07db7dd6ee.js +0 -1
- package/assets/esri/core/workers/chunks/f75e57d3e02f9828b049.js +0 -1
- package/assets/esri/core/workers/chunks/f774e5b94710ccee1af0.js +0 -1
- package/assets/esri/core/workers/chunks/fdad31bbe8aee68a6eaf.js +0 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToReadShadowMap.glsl.js +0 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +0 -18
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +0 -4
- /package/assets/esri/core/workers/chunks/{430802108b63194b7ddd.js.LICENSE.txt → 033debcbf6b3683dc4fe.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{4efe5827a5c61db3b19d.js.LICENSE.txt → 064445e6f9512817ac87.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{c5e288d57bacb8451e2d.js.LICENSE.txt → 463d69f596d1d34ef275.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{d5e3f8e5b8d2576d3cb3.js.LICENSE.txt → 58a17fb3c0dd07c63d57.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{7f2ac03efaa4a4898ba2.js.LICENSE.txt → c3b96d1d43afccd23e45.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{f465fb26541372fdc908.js.LICENSE.txt → ce08e3369641da0d7a27.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{__decorate as a}from"tslib";import{ForwardLinearDepthConfiguration as o}from"../ForwardLinearDepth.glsl.js";import{forwardLinearDepthToReadShadow as e}from"../forwardLinearDepthToReadShadow.glsl.js";import{calculateUVZShadowPass as t,calculateUVZShadowDraw as d,ReadShadowMapOrigin as r}from"./calculateUVZShadow.glsl.js";import{FloatBindUniform as i}from"../../shaderModules/FloatBindUniform.js";import{glsl as s,If as h}from"../../shaderModules/glsl.js";import{Texture2DBindUniform as l}from"../../shaderModules/Texture2DBindUniform.js";import{Texture2DShadowBindUniform as n}from"../../shaderModules/Texture2DShadowBindUniform.js";import{parameter as w}from"../../shaderTechnique/ShaderTechniqueConfiguration.js";class c extends r{}class u extends r{}class f extends o{constructor(){super(...arguments),this.hasShadowHighlights=!1,this.receiveShadows=!0}}function g(a,o){o.receiveShadows&&a.fragment.include(t),p(a,o)}function m(a,o){o.receiveShadows&&a.fragment.include(d),p(a,o)}function p(a,o){a.include(e,o);const{hasShadowHighlights:t,receiveShadows:d,spherical:r}=o;d&&(S(a.fragment,t),a.fragment.code.add(s`float readShadowMap(const in vec3 _worldPos, float _linearDepth) {
|
|
3
|
+
vec3 uvzShadow = calculateUVZShadow(_worldPos, _linearDepth, textureSize(shadowMap, 0));
|
|
4
|
+
return readShadowMaps(uvzShadow);
|
|
5
|
+
}
|
|
6
|
+
float readShadowMap(const in vec3 _worldPos ) { return readShadowMap(_worldPos, linearDepth); }`)),a.fragment.uniforms.add(new i("lightingGlobalFactor",({lighting:a})=>a.globalFactor)).code.add(s`
|
|
7
|
+
float getShadow(float additionalAmbientScale, float shadow) {
|
|
8
|
+
float ambient = ${h(r,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
|
|
9
|
+
return max(ambient, shadow);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
float readShadow(float additionalAmbientScale, vec3 vpos) {
|
|
13
|
+
return getShadow(additionalAmbientScale, ${h(d,"readShadowMap(vpos)","0.0")});
|
|
14
|
+
}
|
|
15
|
+
`)}function S(a,o){o&&a.uniforms.add(new l("shadowHighlight",({shadowHighlight:a})=>a?.getTexture())),a.uniforms.add(new n("shadowMap",({shadowMap:a})=>a.getOutput(5)??a.getOutput(7))).code.add(s`
|
|
16
|
+
float readShadowMaps(const in vec3 uvzShadow) {
|
|
17
|
+
if (uvzShadow.z < 0.0) {
|
|
18
|
+
return 0.0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
float shadow1 = texture(shadowMap, uvzShadow);
|
|
22
|
+
${h(o,"float shadow2 = texelFetch(shadowHighlight, ivec2(gl_FragCoord.xy), 0).r;\n return shadow1 > shadow2 ? shadow1 : shadow2;","return shadow1;")}
|
|
23
|
+
}
|
|
24
|
+
`)}a([w()],f.prototype,"hasShadowHighlights",void 0),a([w()],f.prototype,"receiveShadows",void 0);export{f as ReadShadowMapConfiguration,c as ReadShadowMapDrawParameters,u as ReadShadowMapPassParameters,m as readShadowDraw,S as readShadowMaps,g as readShadowPass};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{ReadShadowMapPassParameters as e}from"../shading/
|
|
2
|
+
import{ReadShadowMapPassParameters as e}from"../shading/readShadow.glsl.js";import{BackgroundGrid as t}from"./BackgroundGrid.glsl.js";import{If as o,glsl as r}from"../../shaderModules/glsl.js";import{Uniform as c}from"../../../../../webgl/Uniform.js";class n extends e{constructor(){super(...arguments),this.overlayOpacity=1}}function s(e,c){const{vertex:n,fragment:s,varyings:u}=e;u.add("vtc","vec2"),n.uniforms.add(new i("texOffsetAndScale")),s.uniforms.add(new l("tex")),s.uniforms.add(new d("textureOpacities"));const{textureFadingEnabled:x,renderOccluded:f,tileBlendInput:v}=c,p=x&&!f;p&&(n.uniforms.add(new i("nextTexOffsetAndScale")),u.add("nvtc","vec2"),s.uniforms.add(new l("texNext")),s.uniforms.add(new d("nextTexOpacities")),s.uniforms.add(new a("fadeFactor")));const m=2===v;m&&s.include(t);const g=1===v;g&&s.uniforms.add(new d("backgroundColor")),n.code.add(r`
|
|
3
3
|
void forwardTextureCoordinatesWithTransform(in vec2 uv) {
|
|
4
4
|
vtc = texOffsetAndScale.xy + uv * texOffsetAndScale.zw;
|
|
5
5
|
${o(p,"nvtc = nextTexOffsetAndScale.xy + uv * nextTexOffsetAndScale.zw;")}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{fromValues as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{earth as t}from"../../../../../../geometry/support/Ellipsoid.js";import{cloudsHeight as a}from"../../../../environment/weather.js";import{EvaluateAmbientLighting as r}from"../shading/EvaluateAmbientLighting.glsl.js";import{mainLightDirection as e,mainLightIntensity as i}from"../shading/MainLighting.glsl.js";import{LookupCloudsFromTextureArray as c}from"./LookupCloudsFromTextureArray.glsl.js";import{BooleanBindUniform as n}from"../../shaderModules/BooleanBindUniform.js";import{Float3BindUniform as d}from"../../shaderModules/Float3BindUniform.js";import{FloatBindUniform as l}from"../../shaderModules/FloatBindUniform.js";import{glsl as s}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as u}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DArrayBindUniform as m}from"../../shaderModules/Texture2DArrayBindUniform.js";function h(t){const
|
|
2
|
+
import{fromValues as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{earth as t}from"../../../../../../geometry/support/Ellipsoid.js";import{cloudsHeight as a}from"../../../../environment/weather.js";import{EvaluateAmbientLighting as r}from"../shading/EvaluateAmbientLighting.glsl.js";import{mainLightDirection as e,mainLightIntensity as i}from"../shading/MainLighting.glsl.js";import{LookupCloudsFromTextureArray as c}from"./LookupCloudsFromTextureArray.glsl.js";import{BooleanBindUniform as n}from"../../shaderModules/BooleanBindUniform.js";import{Float3BindUniform as d}from"../../shaderModules/Float3BindUniform.js";import{FloatBindUniform as l}from"../../shaderModules/FloatBindUniform.js";import{glsl as s}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as u}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DArrayBindUniform as m}from"../../shaderModules/Texture2DArrayBindUniform.js";function h(t,a){const h=t.fragment;h.constants.add("radiusCloudsSquared","float",C).code.add(s`vec3 intersectWithCloudLayer(vec3 dir, vec3 cameraPosition, vec3 spherePos) {
|
|
3
3
|
float B = 2.0 * dot(cameraPosition, dir);
|
|
4
4
|
float C = dot(cameraPosition, cameraPosition) - radiusCloudsSquared;
|
|
5
5
|
float det = B * B - 4.0 * C;
|
|
6
6
|
float pointIntDist = max(0.0, 0.5 *(-B + sqrt(det)));
|
|
7
7
|
return (cameraPosition + dir * pointIntDist) - spherePos;
|
|
8
|
-
}`),
|
|
8
|
+
}`),h.uniforms.add(new l("radiusCurvatureCorrection",({clouds:o})=>o.parallax.radiusCurvatureCorrection)).code.add(s`vec3 correctForPlanetCurvature(vec3 dir) {
|
|
9
9
|
dir.z = dir.z * (1.0 - radiusCurvatureCorrection) + radiusCurvatureCorrection;
|
|
10
10
|
return dir;
|
|
11
|
-
}`),
|
|
11
|
+
}`),h.code.add(s`vec3 rotateDirectionToAnchorPoint(mat4 rotMat, vec3 inVec) {
|
|
12
12
|
return (rotMat * vec4(inVec, 0.0)).xyz;
|
|
13
|
-
}`),
|
|
13
|
+
}`),h.include(r,a),h.constants.add("RIM_COLOR","vec3",o(.28,.175,.035)),h.constants.add("sunsetTransitionFactor","float",.3),h.constants.add("rimScattering","float",140),h.constants.add("backlightFactor","float",.2),h.constants.add("backlightScattering","float",10),h.constants.add("backlightTransition","float",.3),h.uniforms.add(e,i).code.add(s`vec3 calculateCloudColor(vec3 cameraPosition, vec3 worldSpaceRay, vec4 clouds) {
|
|
14
14
|
float upDotLight = dot(cameraPosition, mainLightDirection);
|
|
15
15
|
float dirDotLight = max(dot(worldSpaceRay, mainLightDirection), 0.0);
|
|
16
16
|
float sunsetTransition = clamp(pow(max(upDotLight, 0.0), sunsetTransitionFactor), 0.0, 1.0);
|
|
@@ -22,12 +22,12 @@ float rimLightIntensity = 0.5 + 0.5 * pow(max(upDotLight, 0.0), 0.35);
|
|
|
22
22
|
vec3 directSunScattering = RIM_COLOR * rimLightIntensity * (pow(dirDotLight, rimScattering)) * scatteringMod;
|
|
23
23
|
float additionalLight = backlightFactor * pow(dirDotLight, backlightScattering) * (1. - pow(sunsetTransition, backlightTransition)) ;
|
|
24
24
|
return vec3(baseCloudColor * (1.0 + additionalLight) + directSunScattering);
|
|
25
|
-
}`),t.include(c),
|
|
25
|
+
}`),t.include(c),h.uniforms.add(new n("readChannelsRG",o=>0===o.clouds.readChannels),new m("cubeMap",o=>o.clouds.data?.cubeMap?.colorTexture)).code.add(s`vec4 sampleCloud(vec3 rayDir, bool readOtherChannel) {
|
|
26
26
|
vec4 s = lookupCloudsFromTextureArray(cubeMap, rayDir);
|
|
27
27
|
bool readRG = readChannelsRG ^^ readOtherChannel;
|
|
28
28
|
s = readRG ? vec4(vec3(s.r), s.g) : vec4(vec3(s.b), s.a);
|
|
29
29
|
return length(s) == 0.0 ? vec4(s.rgb, 1.0) : s;
|
|
30
|
-
}`),
|
|
30
|
+
}`),h.uniforms.add(new d("anchorPoint",o=>o.clouds.parallax.anchorPoint),new d("anchorPointNew",o=>o.clouds.parallaxNew.anchorPoint),new u("rotationClouds",o=>o.clouds.parallax.transform),new u("rotationCloudsNew",o=>o.clouds.parallaxNew.transform),new l("cloudsOpacity",o=>o.clouds.opacity),new l("fadeFactor",o=>o.clouds.fadeFactor),new n("crossFade",o=>3===o.clouds.fadeState)).code.add(s`vec4 renderClouds(vec3 worldRay, vec3 cameraPosition) {
|
|
31
31
|
vec3 intersectionPoint = intersectWithCloudLayer(worldRay, cameraPosition, anchorPoint);
|
|
32
32
|
vec3 worldRayRotated = rotateDirectionToAnchorPoint(rotationClouds, normalize(intersectionPoint));
|
|
33
33
|
vec3 worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{translate as r}from"../../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as e}from"../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as o,create as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projMatrix as s}from"./cameraUniforms.js";import{Float3BindUniform as n}from"../../shaderModules/Float3BindUniform.js";import{Float3DrawUniform as t}from"../../shaderModules/Float3DrawUniform.js";import{FloatBindUniform as m}from"../../shaderModules/FloatBindUniform.js";import{Matrix4BindUniform as c}from"../../shaderModules/Matrix4BindUniform.js";import{Matrix4DrawUniform as f}from"../../shaderModules/Matrix4DrawUniform.js";function d(r,i){i.instancedDoublePrecision?r.constants.add("cameraPosition","vec3",o):r.uniforms.add(new t("cameraPosition",(r,i)=>e(p,i.
|
|
2
|
+
import{translate as r}from"../../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as e}from"../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as o,create as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projMatrix as s}from"./cameraUniforms.js";import{Float3BindUniform as n}from"../../shaderModules/Float3BindUniform.js";import{Float3DrawUniform as t}from"../../shaderModules/Float3DrawUniform.js";import{FloatBindUniform as m}from"../../shaderModules/FloatBindUniform.js";import{Matrix4BindUniform as c}from"../../shaderModules/Matrix4BindUniform.js";import{Matrix4DrawUniform as f}from"../../shaderModules/Matrix4DrawUniform.js";function d(r,i){i.instancedDoublePrecision?r.constants.add("cameraPosition","vec3",o):r.uniforms.add(new t("cameraPosition",({origin:r},{camera:i})=>e(p,i.viewInverseTransposeMatrix[3]-r[0],i.viewInverseTransposeMatrix[7]-r[1],i.viewInverseTransposeMatrix[11]-r[2])))}function l(i,o){if(!o.instancedDoublePrecision)return void i.uniforms.add(s,new f("view",(i,e)=>r(v,e.camera.viewMatrix,i.origin)),new t("localOrigin",r=>r.origin));const a=({camera:r})=>e(p,r.viewInverseTransposeMatrix[3],r.viewInverseTransposeMatrix[7],r.viewInverseTransposeMatrix[11]);i.uniforms.add(s,new c("view",i=>r(v,i.camera.viewMatrix,a(i))),new n("localOrigin",r=>a(r)))}const v=i(),p=a();function w(r){r.uniforms.add(new m("pixelRatio",r=>r.camera.pixelRatio/r.overlayStretch))}export{d as addCameraPosition,w as addPixelRatio,l as addProjViewLocalOrigin};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{set 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{Float2BindUniform as i}from"../../shaderModules/Float2BindUniform.js";import{Float4BindUniform as a}from"../../shaderModules/Float4BindUniform.js";import{FloatBindUniform as o}from"../../shaderModules/FloatBindUniform.js";import{Matrix4BindUniform as t}from"../../shaderModules/Matrix4BindUniform.js";const n=new t("view",({camera:e})=>e.viewMatrix),m=new t("inverseViewMatrix",({camera:e})=>e.inverseViewMatrix),s=new t("proj",({camera:e})=>e.projectionMatrix),l=new t("inverseProjectionMatrix",({camera:e})=>e.inverseProjectionMatrix),c=new t("viewNormal",({camera:e})=>e.viewInverseTransposeMatrix),w=new i("nearFar",({camera:e})=>e.nearFar),f=new a("viewport",({camera:e})=>e.fullViewport),p=new o("pixelRatio",({camera:e})=>e.pixelRatio),d=new i("inverseScreenSize",({camera:r})=>e(v,1/r.fullWidth,1/r.fullHeight)),v=r();export{l as
|
|
2
|
+
import{set 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{Float2BindUniform as i}from"../../shaderModules/Float2BindUniform.js";import{Float4BindUniform as a}from"../../shaderModules/Float4BindUniform.js";import{FloatBindUniform as o}from"../../shaderModules/FloatBindUniform.js";import{Matrix4BindUniform as t}from"../../shaderModules/Matrix4BindUniform.js";const n=new t("view",({camera:e})=>e.viewMatrix),m=new t("inverseViewMatrix",({camera:e})=>e.inverseViewMatrix),s=new t("proj",({camera:e})=>e.projectionMatrix),l=new t("inverseProjectionMatrix",({camera:e})=>e.inverseProjectionMatrix),c=new t("viewNormal",({camera:e})=>e.viewInverseTransposeMatrix),w=new i("nearFar",({camera:e})=>e.nearFar),f=new a("viewport",({camera:e})=>e.fullViewport),p=new o("pixelRatio",({camera:e})=>e.pixelRatio),d=new i("inverseScreenSize",({camera:r})=>e(v,1/r.fullWidth,1/r.fullHeight)),v=r();export{l as inverseProjectionMatrix,d as inverseScreenSize,m as inverseViewMatrix,w as nearFar,p as pixelRatio,s as projMatrix,n as viewMatrix,c as viewNormal,f as viewport};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as i,initial as
|
|
2
|
+
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as i,initial as r}from"../../../../../core/reactiveUtils.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{PBRDefaultConfiguration as o}from"../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{OpaqueEnvironment as n}from"../OpaqueEnvironment.js";import{CloudsCompositionTechnique as a}from"./CloudsCompositionTechnique.js";import{createQuadVAO as m}from"../../lib/glUtil3D.js";import{ColorAttachment0 as d,PrimitiveType as h}from"../../../../webgl/enums.js";import{noParameters as l}from"../../../../webgl/NoParameters.js";let c=class extends n{constructor(){super(...arguments),this._configuration=new o}initialize(){this.addHandles([i(()=>null!=this.view.environment.weather&&this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),r)])}destroy(){this._vao=t(this._vao)}render(){const e=this.input,t=this.bindParameters.clouds;if(!t.data)return e;const i=this.techniques.getCompiled(a,this._configuration);if(!i)return this.requestRender(1),e;const r=this.renderingContext;this._vao??=m(r);const s=r.bindTechnique(i,this.bindParameters,l);return r.setDrawBuffers([d]),r.bindVAO(this._vao),s.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(h.TRIANGLE_STRIP,0,4),t.isFading&&this.requestRender(2),e}};c=e([s("esri.views.3d.webgl-engine.effects.clouds.CloudsComposition")],c);export{c as CloudsComposition};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{watch as s}from"../../../../../core/reactiveUtils.js";import{property as t,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{watch as s}from"../../../../../core/reactiveUtils.js";import{property as t,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{InternalRenderCategory as i}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{F as a}from"../../../../../chunks/FocusArea.glsl.js";import{FocusAreaTechnique as n}from"./FocusAreaTechnique.js";import{EmissiveTechniqueConfiguration as c}from"../../shaders/EmissiveTechniqueConfiguration.js";import{ColorAttachment1 as m,SizedPixelFormat as h}from"../../../../webgl/enums.js";let u=class extends o{constructor(e){super({...e,view:e.focusAreasView.view}),this.consumes={required:[i.FOCUSAREA,i.FOCUSAREA_MASK]},this.produces=i.FOCUSAREA,this._fadeDirection=0,this._configuration=new c,this._passParameters=new a}fadeOut(e){this.removeAllHandles(),this._startTime=null,this._fadeDirection=1,this.addHandles(s(()=>this._passParameters.fadeFactor.value,s=>{0===s&&(this.removeAllHandles(),e())})),this.requestRender(2)}precompile(){this._configuration.hasEmissive=0!==this.bindParameters.emissions,this.techniques.precompile(n,this._configuration)}render(e){const s=this.bindParameters;this._startTime??=this.view.stage?.renderer.renderContext.time;const t=this.view.qualitySettings.fadeDuration,r=t>0?Math.min(t,this.view.stage?.renderer.renderContext.time-this._startTime)/t:1,o=this.renderingContext,a=this.techniques.get(n,this._configuration),c=this.input,u=e.find(({name:e})=>e===i.FOCUSAREA_MASK),d="bright"===this.focusAreasView.style;this._passParameters.color=this._passParameters.emission=o.emptyTexture,this._passParameters.focusArea=u.getTexture(),this._passParameters.effect=f[this.focusAreasView.style],this._passParameters.fadeFactor.value=0===this._fadeDirection?r:1-r;const p=s.camera,l=p.fullViewport[2],_=p.fullViewport[3],A=d?this.fboCache.acquire(l,_,this.produces):c;if(d){if(this._passParameters.color=c.getTexture(),this._configuration.hasEmissive){this._passParameters.emission=c.getTexture(m);const e=this._passParameters.emission?.descriptor.internalFormat===h.RGBA16F?8:5;A.acquireColor(m,e,"emissive")}A.moveAttachments(c),o.bindFramebuffer(A.fbo),o.setClearColor(0,0,0,0),o.clear(16384)}else o.bindFramebuffer(A.fbo);return o.bindTechnique(a,s,this._passParameters),o.screen.draw(),r<1&&this.requestRender(2),A}};e([t()],u.prototype,"consumes",void 0),e([t()],u.prototype,"produces",void 0),e([t({constructOnly:!0})],u.prototype,"focusAreasView",void 0),u=e([r("esri.views.3d.webgl-engine.effects.focusArea.FocusArea")],u);const f={bright:0,dark:1};export{u as FocusArea,f as styleToEffect};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import"../../core/shaderLibrary/util/CameraSpace.glsl.js";import"../../core/shaderLibrary/util/cameraUniforms.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4BindUniform.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./GlobalIlluminationColorQuantization.glsl.js";import"../../shaders/floatBlendScale.glsl.js";import"../../../../webgl/enums.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlobalIlluminationPassParameters,c as build,e as defaultColorBleedWeight,d as defaultRayMarchMaxReach,f as defaultRayMarchMaxReachEmissionWeight,b as defaultRayMarchMaxSteps,g as defaultRayMarchMinReach,h as defaultRayMarchMinReachEmissionWeight,i as defaultRayMarchWorldReach}from"../../../../../chunks/GlobalIllumination.glsl.js";
|
|
2
|
+
import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import"../../core/shaderLibrary/util/CameraSpace.glsl.js";import"../../core/shaderLibrary/util/cameraUniforms.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4BindUniform.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./GlobalIlluminationColorQuantization.glsl.js";import"../../shaders/floatBlendScale.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/enums.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlobalIlluminationPassParameters,c as build,e as defaultColorBleedWeight,d as defaultRayMarchMaxReach,f as defaultRayMarchMaxReachEmissionWeight,b as defaultRayMarchMaxSteps,g as defaultRayMarchMinReach,h as defaultRayMarchMinReachEmissionWeight,i as defaultRayMarchWorldReach}from"../../../../../chunks/GlobalIllumination.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as
|
|
2
|
+
import{__decorate as t}from"tslib";import{releaseMaybe as e}from"../../../../../core/maybe.js";import{watch as s,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators.js";import{set as i}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_W as l,ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as u}from"../../../webgl.js";import{AmbientIllumination as n}from"../AmbientIllumination.js";import{G as m}from"../../../../../chunks/GlobalIllumination.glsl.js";import{G as h}from"../../../../../chunks/GlobalIlluminationBlur.glsl.js";import{GlobalIlluminationBlurTechnique as c}from"./GlobalIlluminationBlurTechnique.js";import{GlobalIlluminationTechnique as p}from"./GlobalIlluminationTechnique.js";import{GlobalIlluminationTechniqueConfiguration as _}from"./GlobalIlluminationTechniqueConfiguration.js";import{G as d}from"../../../../../chunks/GlobalIlluminationUpscale.glsl.js";import{GlobalIlluminationUpscaleTechnique as f}from"./GlobalIlluminationUpscaleTechnique.js";import{DepthStencilAttachment as b,ColorAttachment1 as g}from"../../../../webgl/enums.js";const w=1,P=256,I=100;let T=class extends n{constructor(t){super(t),this._passParameters=new m,this._drawParameters=new h,this._drawParametersUpscale=new d,this._lowQualityResolutionScale=.35,this._configuration=new _,this._lastOutput=null,this._isGlobalIlluminationUpdate=!1,this._resetBuffer=!1}initialize(){this.addHandles(s(()=>this._mode,t=>{0===t?this._disable():this._enable()},r))}destroy(){this._lastOutput=e(this._lastOutput)}_disable(){super._disable(),this._resetAccumulation(),this._passParameters.temporalSampleFrame=0}get hasHighQuality(){return 2===this._mode}resetAccumulation(){this._isGlobalIlluminationUpdate||!(this._passParameters.accumulatedFrames>I)&&this._configuration.hasEmission||this._resetAccumulation()}_resetAccumulation(){this._passParameters.accumulatedFrames=0,this._lastOutput=e(this._lastOutput)}precompile(){this.techniques.getCompiled(f)}render(t){if(this._passParameters.accumulatedFrames>=P)return this._lastOutput?.retain(),this._lastOutput;const e=t.find(({name:t})=>"normals"===t),s=e?.getTexture(),r=e?.getTexture(b),a=this._mode;if(!s||!r)return this._emptyOutput;if(0===a)return this._resetBuffer=!1,this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this._requestRender(),this._emptyOutput;const l=this.bindParameters;this._configuration.hasEmission=!!l.reprojection.lastFrameEmission;const o=this.techniques.getCompiled(p,this._configuration),n=this.techniques.getCompiled(c),m=1===a,h=m?this._lowQualityResolutionScale:1,_=m?this.techniques.getCompiled(f):null;if(!o||!n||m&&!_)return this._requestRender(),this._emptyOutput;const d=this.renderingContext,{camera:I}=l;this._passParameters.normalTexture=s,this._passParameters.depthTexture=r,this._passParameters.projScale=1/I.computeScreenPixelSizeAtDist(1),this._passParameters.scaleGlobalIllumination=h;const{fullWidth:T,fullHeight:q}=I,x=Math.max(1,Math.floor(T*h)),O=Math.max(1,Math.floor(q*h)),C=this.fboCache.acquire(x,O,"global illumination input").acquireColor(g,2);d.bindFramebuffer(C.fbo),d.setViewport(0,0,x,O),d.bindTechnique(o,l,this._passParameters,this._drawParameters),d.screen.draw();const j=Math.max(1,Math.round(x/w)),F=Math.max(1,Math.round(O/w)),G=this.fboCache.acquire(j,F,"global illumination blur horizontal");d.bindFramebuffer(G.fbo);const M=C.obtainAttachment(g);this._drawParameters.texture=C.getTexture(),this._drawParameters.weightTexture=M.attachment,i(this._drawParameters.blurSize,0,w/O),d.bindTechnique(n,l,this._passParameters,this._drawParameters),d.setViewport(0,0,j,F),d.screen.draw(),C.release();const U=m?"global illumination blur vertical":u.AMBIENT_ILLUMINATION,A=this.fboCache.acquire(j,F,U);d.bindFramebuffer(A.fbo),d.setViewport(0,0,j,F),d.setClearColor(1,1,1,0),d.clear(16384),this._drawParameters.texture=G.getTexture(),this._drawParameters.weightTexture=M.attachment,i(this._drawParameters.blurSize,w/j,0),d.bindTechnique(n,l,this._passParameters,this._drawParameters),d.setViewport(0,0,j,F),d.screen.draw(),G.release(),A.attachColor(M,g),M.release();let B=A;return _&&(B=this.fboCache.acquire(T,q,u.AMBIENT_ILLUMINATION).acquireColor(g,2),d.bindFramebuffer(B.fbo),d.setViewport(0,0,T,q),d.setClearColor(1,1,1,0),d.clear(16384),this._drawParametersUpscale.colorTexture=A.getTexture(),this._drawParametersUpscale.weightTexture=A.getTexture(g),d.bindTechnique(_,l,this._passParameters,this._drawParametersUpscale),d.screen.draw(),A.release()),d.setViewport4fv(I.fullViewport),this._passParameters.temporalSampleFrame=(this._passParameters.temporalSampleFrame+1)%64,++this._passParameters.accumulatedFrames,this._storeOutput(B),this._passParameters.accumulatedFrames<P&&this._requestRender(),B}_requestRender(){this._isGlobalIlluminationUpdate=!0,this.requestRender(1),this._isGlobalIlluminationUpdate=!1}_storeOutput(t){this._lastOutput!==t&&(this._lastOutput=e(this._lastOutput),this._lastOutput=t,this._lastOutput.retain())}get _emptyOutput(){const t=this.renderingContext,{fullWidth:e,fullHeight:s}=this.bindParameters.camera,r=this.fboCache.acquire(e,s,u.AMBIENT_ILLUMINATION).acquireColor(g,2);return t.bindFramebuffer(r.fbo),t.setViewport(0,0,e,s),t.clearBuffer(0,l),t.clearBuffer(1,o),r}get _canRender(){const{reprojection:t,hasEmission:e,globalIllumination:s}=this.bindParameters;return!(!t.lastFrameColor||e&&!t.lastFrameEmission||!t.lastFrameDepth||!s||this._resetBuffer)}get _mode(){return this._useGlobalIllumination?this.view.stage.renderer.isFeatureEnabled(10)?2:1:0}get test(){const t=this;return{passParameters:this._passParameters,configuration:this._configuration,get mode(){return t._mode}}}};T=t([a("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],T);export{T as GlobalIllumination,w as blurSizePixels,P as maxFrames};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/libs/gl-matrix-2/math/vec3.js";import"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../core/shaderLibrary/NormalFromDepth.glsl.js";import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import"../../core/shaderLibrary/
|
|
2
|
+
import"../../../../../core/libs/gl-matrix-2/math/vec3.js";import"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../core/shaderLibrary/NormalFromDepth.glsl.js";import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import"../../core/shaderLibrary/util/blendEmission.glsl.js";import"../../core/shaderModules/Float3BindUniform.js";import"../../core/shaderModules/Float4PassUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DShadowBindUniform.js";import"../../core/shaderModules/Texture2DUintPassUniform.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/ShadowHighlight.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import"../../core/
|
|
2
|
+
import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DShadowBindUniform.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/ShadowHighlightBuffer.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{fromValues as i}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ReadShadowMapPassParameters as t}from"../../core/shaderLibrary/shading/readShadow.glsl.js";import{ReloadableShader as o}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{S as h}from"../../../../../chunks/ShadowHighlight.glsl.js";import{PrimitiveType as a}from"../../../../webgl/enums.js";import{makePipelineState as l,defaultColorWrite as c,unpremultipliedAlphaToPremultipliedAlpha as d}from"../../../../webgl/renderState.js";class n extends t{constructor(){super(...arguments),this.shadowColor=i(1,0,1,1),this.shadowOpacity=.2,this.occludedShadowOpacity=.1,this.opacityElevation=1,this.dayNightTerminator=1}}let m=class extends s{constructor(){super(...arguments),this.shader=new o(h,()=>import("./ShadowHighlight.glsl.js")),this.ignoreUnused=!0,this.primitiveType=a.TRIANGLE_STRIP}initializePipeline(){return l({blending:d,colorWrite:c,depthTest:null,depthWrite:null})}};m=e([r("esri.views.3d.webgl-engine.effects.highlight.ShadowHighlightTechnique")],m);export{n as ShadowHighlightPassParameters,m as ShadowHighlightTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{sliceEquals as t}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as s,sync as r}from"../../../../../core/reactiveUtils.js";import{signal as a}from"../../../../../core/signal.js";import{property as o,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{copy as u,equals as h}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{InternalRenderCategory as l}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{ReadShadowMapPassParameters as d}from"../../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{volumeToVao as _}from"../focusArea/focusAreaMaskUtils.js";import{S as p}from"../../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as f}from"./ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as g}from"./ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as b}from"./ShadowCastClearTechnique.js";import{ShadowCastMaskTechnique as v}from"./ShadowCastMaskTechnique.js";import{BindParameters as y}from"../../lib/BindParameters.js";import{DepthRange as S}from"../../lib/DepthRange.js";import{createQuadVAO as w}from"../../lib/glUtil3D.js";import{ShadowMap as A}from"../../lib/ShadowMap.js";import{V as C}from"../../../../../chunks/VolumeMask.glsl.js";import{PrimitiveType as x,DepthStencilAttachment as R,PixelType as V}from"../../../../webgl/enums.js";import{DisposableFramebufferObject as F}from"../../../../webgl/FramebufferObject.js";import{noParameters as P}from"../../../../webgl/NoParameters.js";let H=class extends m{constructor(e){super(e),this.consumes={required:[]},this.produces=l.SHADOW_ACCUMULATION,this._fullyRecompute=!1,this._analysisVolumeGeometry=null,this._primarySet=new D(new g(0),()=>this._requestRenderIfEnabled()),this._contextSet=new D(new g(1),()=>this._requestRenderIfEnabled()),this._passParameters=new d,this._maskParameters=new C,this._volumeVao=null,this._volumeVertexCount=0,this._depthRange=S.Zero,this._didAccumulate=!1,this._enabled=!1,this._previewing=!1,this.accumulationRenderer=null,this._shadowAccumulatorKey=Symbol("shadowAccumulator");const{view:t}=e,i=t.stage.renderer.fboCache;this._accumulationBindParameters=new y(new A(i,t.stage.viewingMode)),this._accumulationBindParameters.shadowMap.enabled=!0,this._vao=w(i.rctx),this._tmpReadFbo=new F(i.rctx),this.addHandles([s(()=>this._previewing,e=>{e?this._invalidateAccumulationSets():this._requestRenderIfEnabled()},r),s(()=>this._numActive,()=>this._numActiveChanged(),r)],this._shadowAccumulatorKey)}destroy(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this.accumulationRenderer=null,this._fboHandle=i(this._fboHandle),this._vao=i(this._vao),this._volumeVao=i(this._volumeVao),this._tmpReadFbo=i(this._tmpReadFbo),this._accumulationBindParameters.destroy();for(const e of this._accumulationSets())e.destroy();this._contextSet=null,this._primarySet=null}*_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||this._fullyRecompute)}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._accumulationBindParameters.depth&&this._depthRange!==S.Zero&&null!=this.accumulationRenderer&&this.accumulationRenderer.isAboveElevationThreshold}get _doneAccumulating(){return this._accumulationSets().every(e=>e.doneAccumulating)}get _numActive(){return this._accumulationSets().reduce((e,t)=>e+(t.active?1:0),0)}get _colorFormat(){return 2===this._numActive?2:0}get _analysisVolume(){return this._analysisVolumeGeometry}set _analysisVolume(e){if(this._analysisVolumeGeometry===e)return;this._invalidateAccumulationSets(),this._analysisVolumeGeometry=e,this._volumeVao=i(this._volumeVao),this._volumeVertexCount=0;const t=null!=e;for(const i of this._accumulationSets())i.configuration.useMask=t;if(!t)return;const s=e.geometryVolume,{vao:r,vertexCount:a}=_(this._rctx,s);this._volumeVao=r,this._volumeVertexCount=a}get requireGeometryDepth(){return this.accumulating||null!=this._volumeVao}precompile(){if(this.active&&(this._fullyRecompute=0!==this.bindParameters.frameRendererTarget,this.accumulating)){for(const e of this._accumulationSets())this.techniques.precompile(f,e.configuration),this.techniques.precompile(b,e.configuration);this.techniques.precompile(v)}}get didAccumulate(){return this._didAccumulate}render(){this._updateCamera(),this._didAccumulate=this._renderAccumulation(),this._updateMask();const e=this._fboHandle;return e?.retain(),e}_renderAccumulation(){if(!this.active)return!1;if(this._accumulationBindParameters.contentCamera=this.bindParameters.contentCamera,this._accumulationBindParameters.depth=this.bindParameters.depth,this._passParameters.origin=this._accumulationBindParameters.camera.center,!this.canAccumulate)return this._accumulationBindParameters.depth=null,!1;if(this._renderAreaMask(),!this.accumulating)return this._accumulationBindParameters.depth=null,!1;(this._previewing||this._fullyRecompute)&&this._reset(),this._clearBuffersOnAccumulationStart(this._accumulationBindParameters);const e=this._accumulateSetsForRenderFrame(this._previewing&&!this._fullyRecompute,this._accumulationBindParameters);return this._accumulationBindParameters.depth=null,e}_renderAreaMask(){const e=this.techniques.getCompiled(v),t=this._volumeVao,i=this._volumeVertexCount,s=this._fboHandle,r=this._analysisVolume;if(s?.detachDepth(),!e||!t||i<1||!s||!r)return;s.acquireDepth(14);const a=this._rctx,o=this._accumulationBindParameters,n=o.depth,u=this._tmpReadFbo;u.attachDepthStencil(n?.attachment),a.blitFramebuffer(u,s.fbo,256),u.detachDepthStencilTexture(),a.bindFramebuffer(s.fbo),a.setClearStencil(0),a.clear(1024),a.setViewport(0,0,o.camera.width,o.camera.height);const h=a.bindTechnique(e,o,P);this._maskParameters.origin=r.origin,h.bindDraw(o,P,this._maskParameters),a.bindVAO(t),a.drawArrays(x.TRIANGLES,0,i)}_clearBuffersOnAccumulationStart(e){if(this._accumulationSets().every(e=>0===e.progress))this._clearFramebuffer();else for(const t of this._accumulationSets())0===t.progress&&this._clearFramebufferForSet(this._fboHandle,t,e)}_accumulateSetsForRenderFrame(e,t){let i=!1;for(const s of this._accumulationSets())this._accumulateSet(s,e,t),i=!0;return i&&this.requestRender(1),i}_accumulateSet(e,t,i){const s=t?Math.min(q,e.sampleCount)-e.progress:e.sampleCount-e.progress;for(let r=0;r<s;++r)this._accumulateShadow(e,i)}_updateMask(){this.accumulationRenderer?.setStencilMask(this._fboHandle?.getAttachment(R))}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(),void 0!==e.analysisVolume&&(this._analysisVolume=e.analysisVolume),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,V.UNSIGNED_BYTE,j),j[0]/i)}_updateCamera(){if(!this.active)return;const e=this.bindParameters.camera,t=this._accumulationBindParameters.camera;e.equals(t)||t.copyFrom(e),this._isAccumulationValid(e)||(this._fboHandle?.release(),this._fboHandle=this._createFBO(e.fullWidth,e.fullHeight),this._reset()),this.accumulationRenderer?.setOpacityFromElevation(e.relativeElevation)}_numActiveChanged(){if(!this._enabled||!this._fboHandle)return;const e=2===this._numActive,{width:t,height:i}=this._fboHandle.fbo,s=this._createFBO(t,i);e&&(this._clearFramebuffer(s),this._contextSet.reset()),this._rctx.blitFramebuffer(this._fboHandle.fbo,s.fbo),this._fboHandle.dispose(),this._fboHandle=s,this.requestRender(1)}_enable(){this._enabled||(this._enabled=!0,this._invalidateAccumulationSets())}_disable(){this._enabled&&(this._fboHandle=i(this._fboHandle),this._enabled=!1,this.requestRender(1))}_createFBO(e,t){return this.fboCache.acquire(e,t,this.produces,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,i){if(!e)return;const s=this.techniques.get(b,t.configuration);this._rctx.bindFramebuffer(e.fbo),this._rctx.bindTechnique(s,i,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(s.primitiveType,0,this._vao.vertexCount("geometry"))}_accumulateShadow(e,t){this.view.stage.renderer.renderShadowAccumulationShadowMap(t.camera,t.contentCamera,this._accumulationBindParameters.shadowMap,e.lightDirections[e.progress++],this._depthRange);const i=this.techniques.get(f,e.configuration);this._rctx.bindFramebuffer(this._fboHandle?.fbo),this._rctx.bindTechnique(i,t,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(i.primitiveType,0,this._vao.vertexCount("geometry"))}_isAccumulationValid(e){return this._fboHandle?.fbo.width===e.fullWidth&&this._fboHandle?.fbo.height===e.fullHeight}_requestRenderIfEnabled(){this._enabled&&this.requestRender(1)}get _rctx(){return this.renderingContext}updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e,this._invalidateAccumulationSets())}get test(){}};e([o()],H.prototype,"consumes",void 0),e([o()],H.prototype,"produces",void 0),e([o()],H.prototype,"_refining",null),e([o()],H.prototype,"active",null),e([o()],H.prototype,"_doneAccumulating",null),e([o()],H.prototype,"_numActive",null),e([o()],H.prototype,"_colorFormat",null),e([o()],H.prototype,"_depthRange",void 0),e([o()],H.prototype,"_enabled",void 0),e([o()],H.prototype,"_previewing",void 0),e([o()],H.prototype,"accumulationRenderer",void 0),H=e([n("esri.views.3d.webgl-engine.effects.shadowAccumulation.ShadowAccumulator")],H);const q=6,j=new Uint8Array(4);class D{constructor(e,t){this.configuration=e,this._notifyChange=t,this._cachedLightDirections=[],this._progress=a(0),this._sampleCount=a(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 i=this._cachedLightDirections,s=Math.min(p,e.length);if(!t(i,0,i.length,e,0,s,h)){i.length=s,this._sampleCount.value=s;for(let t=0;t<s;++t)i[t]=u(i[t]??c(),e[t]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}}export{H as ShadowAccumulator};
|
|
2
|
+
import{__decorate as e}from"tslib";import{sliceEquals as t}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as s,sync as r}from"../../../../../core/reactiveUtils.js";import{signal as a}from"../../../../../core/signal.js";import{property as o,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{copy as u,equals as h}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{InternalRenderCategory as l}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{ReadShadowMapPassParameters as d}from"../../core/shaderLibrary/shading/readShadow.glsl.js";import{volumeToVao as _}from"../focusArea/focusAreaMaskUtils.js";import{S as p}from"../../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as f}from"./ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as g}from"./ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as b}from"./ShadowCastClearTechnique.js";import{ShadowCastMaskTechnique as v}from"./ShadowCastMaskTechnique.js";import{BindParameters as y}from"../../lib/BindParameters.js";import{DepthRange as S}from"../../lib/DepthRange.js";import{createQuadVAO as w}from"../../lib/glUtil3D.js";import{ShadowMap as A}from"../../lib/ShadowMap.js";import{V as C}from"../../../../../chunks/VolumeMask.glsl.js";import{PrimitiveType as x,DepthStencilAttachment as R,PixelType as V}from"../../../../webgl/enums.js";import{DisposableFramebufferObject as F}from"../../../../webgl/FramebufferObject.js";import{noParameters as P}from"../../../../webgl/NoParameters.js";let H=class extends m{constructor(e){super(e),this.consumes={required:[]},this.produces=l.SHADOW_ACCUMULATION,this._fullyRecompute=!1,this._analysisVolumeGeometry=null,this._primarySet=new D(new g(0),()=>this._requestRenderIfEnabled()),this._contextSet=new D(new g(1),()=>this._requestRenderIfEnabled()),this._passParameters=new d,this._maskParameters=new C,this._volumeVao=null,this._volumeVertexCount=0,this._depthRange=S.Zero,this._didAccumulate=!1,this._enabled=!1,this._previewing=!1,this.accumulationRenderer=null,this._shadowAccumulatorKey=Symbol("shadowAccumulator");const{view:t}=e,i=t.stage.renderer.fboCache;this._accumulationBindParameters=new y(new A(i,t.stage.viewingMode)),this._accumulationBindParameters.shadowMap.enabled=!0,this._vao=w(i.rctx),this._tmpReadFbo=new F(i.rctx),this.addHandles([s(()=>this._previewing,e=>{e?this._invalidateAccumulationSets():this._requestRenderIfEnabled()},r),s(()=>this._numActive,()=>this._numActiveChanged(),r)],this._shadowAccumulatorKey)}destroy(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this.accumulationRenderer=null,this._fboHandle=i(this._fboHandle),this._vao=i(this._vao),this._volumeVao=i(this._volumeVao),this._tmpReadFbo=i(this._tmpReadFbo),this._accumulationBindParameters.destroy();for(const e of this._accumulationSets())e.destroy();this._contextSet=null,this._primarySet=null}*_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||this._fullyRecompute)}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._accumulationBindParameters.depth&&this._depthRange!==S.Zero&&null!=this.accumulationRenderer&&this.accumulationRenderer.isAboveElevationThreshold}get _doneAccumulating(){return this._accumulationSets().every(e=>e.doneAccumulating)}get _numActive(){return this._accumulationSets().reduce((e,t)=>e+ +t.active,0)}get _colorFormat(){return 2===this._numActive?2:0}get _analysisVolume(){return this._analysisVolumeGeometry}set _analysisVolume(e){if(this._analysisVolumeGeometry===e)return;this._invalidateAccumulationSets(),this._analysisVolumeGeometry=e,this._volumeVao=i(this._volumeVao),this._volumeVertexCount=0;const t=null!=e;for(const i of this._accumulationSets())i.configuration.useMask=t;if(!t)return;const s=e.geometryVolume,{vao:r,vertexCount:a}=_(this._rctx,s);this._volumeVao=r,this._volumeVertexCount=a}get requireGeometryDepth(){return this.accumulating||null!=this._volumeVao}precompile(){if(this.active&&(this._fullyRecompute=0!==this.bindParameters.frameRendererTarget,this.accumulating)){for(const e of this._accumulationSets())this.techniques.precompile(f,e.configuration),this.techniques.precompile(b,e.configuration);this.techniques.precompile(v)}}get didAccumulate(){return this._didAccumulate}render(){this._updateCamera(),this._didAccumulate=this._renderAccumulation(),this._updateMask();const e=this._fboHandle;return e?.retain(),e}_renderAccumulation(){if(!this.active)return!1;if(this._accumulationBindParameters.contentCamera=this.bindParameters.contentCamera,this._accumulationBindParameters.depth=this.bindParameters.depth,this._passParameters.origin=this._accumulationBindParameters.camera.center,!this.canAccumulate)return this._accumulationBindParameters.depth=null,!1;if(this._renderAreaMask(),!this.accumulating)return this._accumulationBindParameters.depth=null,!1;(this._previewing||this._fullyRecompute)&&this._reset(),this._clearBuffersOnAccumulationStart(this._accumulationBindParameters);const e=this._accumulateSetsForRenderFrame(this._previewing&&!this._fullyRecompute,this._accumulationBindParameters);return this._accumulationBindParameters.depth=null,e}_renderAreaMask(){const e=this.techniques.getCompiled(v),t=this._volumeVao,i=this._volumeVertexCount,s=this._fboHandle,r=this._analysisVolume;if(s?.detachDepth(),!e||!t||i<1||!s||!r)return;s.acquireDepth(14);const a=this._rctx,o=this._accumulationBindParameters,n=o.depth,u=this._tmpReadFbo;u.attachDepthStencil(n?.attachment),a.blitFramebuffer(u,s.fbo,256),u.detachDepthStencilTexture(),a.bindFramebuffer(s.fbo),a.setClearStencil(0),a.clear(1024),a.setViewport(0,0,o.camera.width,o.camera.height);const h=a.bindTechnique(e,o,P);this._maskParameters.origin=r.origin,h.bindDraw(o,P,this._maskParameters),a.bindVAO(t),a.drawArrays(x.TRIANGLES,0,i)}_clearBuffersOnAccumulationStart(e){if(this._accumulationSets().every(e=>0===e.progress))this._clearFramebuffer();else for(const t of this._accumulationSets())0===t.progress&&this._clearFramebufferForSet(this._fboHandle,t,e)}_accumulateSetsForRenderFrame(e,t){let i=!1;for(const s of this._accumulationSets())this._accumulateSet(s,e,t),i=!0;return i&&this.requestRender(1),i}_accumulateSet(e,t,i){const s=t?Math.min(q,e.sampleCount)-e.progress:e.sampleCount-e.progress;for(let r=0;r<s;++r)this._accumulateShadow(e,i)}_updateMask(){this.accumulationRenderer?.setStencilMask(this._fboHandle?.getAttachment(R))}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(),void 0!==e.analysisVolume&&(this._analysisVolume=e.analysisVolume),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,V.UNSIGNED_BYTE,j),j[0]/i)}_updateCamera(){if(!this.active)return;const e=this.bindParameters.camera,t=this._accumulationBindParameters.camera;e.equals(t)||t.copyFrom(e),this._isAccumulationValid(e)||(this._fboHandle?.release(),this._fboHandle=this._createFBO(e.fullWidth,e.fullHeight),this._reset()),this.accumulationRenderer?.setOpacityFromElevation(e.relativeElevation)}_numActiveChanged(){if(!this._enabled||!this._fboHandle)return;const e=2===this._numActive,{width:t,height:i}=this._fboHandle.fbo,s=this._createFBO(t,i);e&&(this._clearFramebuffer(s),this._contextSet.reset()),this._rctx.blitFramebuffer(this._fboHandle.fbo,s.fbo),this._fboHandle.dispose(),this._fboHandle=s,this.requestRender(1)}_enable(){this._enabled||(this._enabled=!0,this._invalidateAccumulationSets())}_disable(){this._enabled&&(this._fboHandle=i(this._fboHandle),this._enabled=!1,this.requestRender(1))}_createFBO(e,t){return this.fboCache.acquire(e,t,this.produces,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,i){if(!e)return;const s=this.techniques.get(b,t.configuration);this._rctx.bindFramebuffer(e.fbo),this._rctx.bindTechnique(s,i,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(s.primitiveType,0,this._vao.vertexCount("geometry"))}_accumulateShadow(e,t){this.view.stage.renderer.renderShadowAccumulationShadowMap(t.camera,t.contentCamera,this._accumulationBindParameters.shadowMap,e.lightDirections[e.progress++],this._depthRange);const i=this.techniques.get(f,e.configuration);this._rctx.bindFramebuffer(this._fboHandle?.fbo),this._rctx.bindTechnique(i,t,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(i.primitiveType,0,this._vao.vertexCount("geometry"))}_isAccumulationValid(e){return this._fboHandle?.fbo.width===e.fullWidth&&this._fboHandle?.fbo.height===e.fullHeight}_requestRenderIfEnabled(){this._enabled&&this.requestRender(1)}get _rctx(){return this.renderingContext}updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e,this._invalidateAccumulationSets())}get test(){}};e([o()],H.prototype,"consumes",void 0),e([o()],H.prototype,"produces",void 0),e([o()],H.prototype,"_refining",null),e([o()],H.prototype,"active",null),e([o()],H.prototype,"_doneAccumulating",null),e([o()],H.prototype,"_numActive",null),e([o()],H.prototype,"_colorFormat",null),e([o()],H.prototype,"_depthRange",void 0),e([o()],H.prototype,"_enabled",void 0),e([o()],H.prototype,"_previewing",void 0),e([o()],H.prototype,"accumulationRenderer",void 0),H=e([n("esri.views.3d.webgl-engine.effects.shadowAccumulation.ShadowAccumulator")],H);const q=6,j=new Uint8Array(4);class D{constructor(e,t){this.configuration=e,this._notifyChange=t,this._cachedLightDirections=[],this._progress=a(0),this._sampleCount=a(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 i=this._cachedLightDirections,s=Math.min(p,e.length);if(!t(i,0,i.length,e,0,s,h)){i.length=s,this._sampleCount.value=s;for(let t=0;t<s;++t)i[t]=u(i[t]??c(),e[t]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}}export{H as ShadowAccumulator};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import"../../core/shaderLibrary/shading/
|
|
2
|
+
import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import"../../core/shaderLibrary/shading/readShadow.glsl.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../../../webgl/ShaderBuilder.js";export{S as ShadowCastMaxSamples,b as build}from"../../../../../chunks/ShadowCastAccumulate.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{VisualVariablesParameters as
|
|
2
|
+
import{VisualVariablesParameters as i}from"../../layers/support/FastSymbolUpdates.js";import{isColor as t}from"../core/shaderLibrary/ShaderOutput.js";import{computeAttachmentOriginLines as s}from"./geometryDataUtils.js";import{Material as e}from"./Material.js";import{hasShadowHighlights as r}from"../shaders/ReceiveShadowsConfiguration.js";class o extends i{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.shadingEnabled=!1,this.isDecoration=!1,this.worldSized=!1}}class a extends e{constructor(){super(...arguments),this.primitiveVertexCount=1}updateConfiguration(i){super.updateConfiguration(i),this._configuration.pbrMode=this.parameters.shadingEnabled?2:0,this._configuration.draped=18===i.slot,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.worldSized=this._configuration.draped&&this.parameters.worldSized,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasOccludees=i.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,t(i.output)&&this.parameters.shadingEnabled?(this._configuration.receiveShadows=i.shadowMap.enabled,this._configuration.hasShadowHighlights=r(this._configuration,i),this._configuration.receiveAmbientOcclusion=null!=i.ssao,this._configuration.receiveGlobalIllumination=i.globalIlluminationEnabled):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=this._configuration.receiveGlobalIllumination=!1}computeAttachmentOrigin(i,t,e){return s(i,t,e,this._isClosed(e))}_isClosed(i){return(this.parameters.isClosed??!1)&&i>2}}export{a as LineMaterial,o as LineMaterialParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as u,sync as _}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as f,invert as g,multiply as b,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as A,create as w}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as I}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as E,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as T}from"../../../../geometry/support/Indices.js";import{InternalRenderCategory as S,RenderNodeOutput as D,AllRenderNodeOutputs as R,AllInternalRenderNodeOutputs as N}from"../../webgl.js";import{minNearDistanceInMeters as O}from"../../state/NearFarHeuristic.js";import{debugFlags as H}from"../../support/debugFlags.js";import{FBOCache as F}from"../core/FBOCache.js";import{RenderPassManager as x}from"../core/renderPasses/RenderPassManager.js";import{isColor as y}from"../core/shaderLibrary/ShaderOutput.js";import{RenderNodes as G}from"../effects/RenderNodes.js";import{RenderPluginManager as M}from"../effects/RenderPluginManager.js";import{WeatherFader as v}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as L}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as q,renderHighlightBuffer as j}from"../effects/highlight/Highlight.js";import{OITBlend as B}from"../effects/transparency/OITBlend.js";import{AnimationTimer as V}from"./AnimationTimer.js";import{AnimationTimeStep as k}from"./AnimationTimeStep.js";import{BoundingInfo as W}from"./BoundingInfo.js";import{Compositor as Q}from"./Compositor.js";import{DepthRange as z}from"./DepthRange.js";import{depthRangeFromScene as Y}from"./depthRangeUtils.js";import{MainFramebuffer as K}from"./MainFramebuffer.js";import{NavigationDepthCache as J}from"./NavigationDepthCache.js";import{blendingColorAlphaClear as X}from"./OrderIndependentTransparency.js";import{RenderContext as $,defaultRenderOccludedMask as Z}from"./RenderContext.js";import{RendererBase as ee}from"./RendererBase.js";import{setupFeatureDefaults as te}from"./RenderFeature.js";import{RenderPluginInput as se}from"./RenderPluginInput.js";import{ShadowMap as ie}from"./ShadowMap.js";import re from"./SliceHelper.js";import{MergedRenderer as ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ne}from"../parts/renderUtils.js";import{RendererPerformanceInfo as he,PerformanceCategory as oe}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as de,PixelType as le,ColorAttachment0 as ue,ColorAttachment2 as _e,DrawBufferNone as me}from"../../../webgl/enums.js";const pe=has("disable-feature:async-navigation-3d-depth-readback");let ce=class extends ee{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new x,this._isRendering=!1,this._backgroundColor=E(0,0,0,1),this._sliceHelper=new re,this._shadowAccumulator=null,this._shadowCastOptions=null,this.sceneDepthRange=m(z.Infinite),this._state=m(2),this._hasAnimations=!1,this._animationTimestep=new k,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new se,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of De)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new F(i),this._compositor=new Q(i,s),this._renderStateFeatures=m(te(e.view.qualityProfile));const a=new ie(this._fboCache,e.viewingMode);this._renderContext=new $(this._rctx,a,s),this._framebuffer=new K(this._fboCache,this._bindParameters),this._performanceInfo=new he(this._rctx),this._blit=new U(s),this.navigationDepthCache=new J(this._rctx,this._fboCache,s,()=>this._requestRender(0)),this._nodes=new G(this._renderContext),this._plugins=new M({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new v({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>H.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},u),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;I(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.environmentManager.shadowsAvailable,e=>{this._bindParameters.shadowMap.enabled=e,this._requestRender(1)},l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},_),d(()=>this._bindParameters.clouds.data?.state,()=>r(),_),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},u),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator=null,this._shadowCastOptions=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.navigationDepthCache.destroy(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,W.prune(),ae.prune(),T()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new B(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=te(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this.isFeatureEnabled(e,t)!==s&&(this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender())}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this._nodes.produces(S.AMBIENT_ILLUMINATION)}get hasGlobalIllumination(){return this.stage.renderView?.globalIllumination?.enabled??!1}get hasGlobalIlluminationHighQuality(){const e=this.stage.renderView?.globalIllumination;return this.hasGlobalIllumination&&!0===e?.hasHighQuality}get hasSMAA(){return this.isFeatureEnabled(0)}get _emissions(){const e=this._plugins.emissions;return this._hasTransparentGeometry?e:1===e||3===e?1:0}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}setShadowAccumulator(e){this._shadowAccumulator=e,this._shadowCastOptions&&e.setParameters(this._shadowCastOptions)}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose();const e=this._bindParameters;e.globalIllumination=n(e.globalIllumination),e.reprojection.lastFrameDepth=n(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=n(e.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await(import("./edgeRendering/EdgeView.js"));o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Fe(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),_)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView().catch(()=>{}),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&f(this._bindParameters.reprojection.matrix,A)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&(this._shadowCastOptions={...this._shadowCastOptions,...e.shadowCast},this._shadowAccumulator?.setParameters(e.shadowCast))}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}addRenderer(e){this._plugins.add(e)}removeRenderer(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...Ie),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new V(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,s=!1){try{return this._isRendering=!0,this._render(e,t,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new ne(this._pluginInput.get(D.FINAL),null)}_render(e,t,s){const i=0===t;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:r,contentCamera:a,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.frameRendererTarget=t,this._bindParameters.output=0,this._bindParameters.emissions=this._emissions,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(S.VIEWSHED),this._bindParameters.laserlinesEnabled=this._nodes.produces(S.LASERLINES),this._bindParameters.shadowAnalysisEnabled=!!this._shadowAccumulator?.active,this._bindParameters.cutFillComputationEnabled=this._nodes.produces(S.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(S.CUTFILL),this._ensureBindParameters(r,a),this._plugins.sortTestsTransparentOrderedSlots(Ce),this._plugins.prepareRender(),this._hasTransparentGeometry=this._plugins.produces(1,...ge),this._renderOverlay(),r.setGLViewport(this._rctx);const u=this._framebuffer,_=u.initialize(r.fullWidth,r.fullHeight,this._backgroundColor),m=this._needsLastFrameColor;m?(_?.retain(m-1),_?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor?.release(),this._bindParameters.reprojection.lastFrameColor=_):_?.release(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!s,this._precompilePrepasses(),this.performanceInfo.advance(oe.PREPARE);const p=this._computeShadowDepthRange(r);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(r,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p),u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._precompileShaders(i),this._bindParameters.output=0,this._renderOpaque(),this._renderPreTransparent(),this._renderTransparent(),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor)),this._bindParameters.shadowMap.disposeOutput(5),u.update(e=>this._renderNodes(S.CUTFILL_COMPUTATION,e)),this._pluginInput.set(S.FOCUSAREA_MASK,this._renderFocusAreaMask()),u.update(e=>this._renderNodes(S.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(S.VIEWSHED,e)),u.update(e=>this._renderNodes(S.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),u.update(e=>this._renderNodes(S.FOCUSAREA,e)),this._pluginInput.release(S.FOCUSAREA_MASK),u.update(e=>this._renderNodes(S.CUTFILL,e)),this._pluginInput.release(S.GROUND_DEPTH),u.update(e=>this._renderNodes(S.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===t?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(D.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),u.update(e=>this._renderNodes(S.ANTIALIASING,e));const f=this._hasTransparentGeometry?2:1,g=this._bindParameters.emissions;let b;return this._bindParameters.emissions=0,this._hasHUDHighlights&&u.update(e=>this._renderHUD(f,e)),u.update(e=>this._renderNodes(S.HIGHLIGHT,e)),this._hasHUDHighlights||u.update(e=>this._renderHUD(f,e)),this._bindParameters.emissions=g,u.update(e=>this._renderNodes(S.MAGNIFIER,e)),u.update(e=>this._renderNodes(D.FINAL,e)),i&&(this._blit.toFramebuffer(u.color,this._bindParameters),pe||2!==o&&0!==o||this.navigationDepthCache.update(this._bindParameters,u.depth.attachment,this._renderContext.time)),this._bindParameters.reprojection.lastFrameDepth?.release(),this._bindParameters.reprojection.lastFrameEmission?.release(),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth,0!==this._emissions&&(this._bindParameters.reprojection.lastFrameEmission=u.color.obtainAttachment(de))),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),u.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(b=u.color,b.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new ne(b,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling;const t=this._bindParameters;t.output=0;const s=t.emissions;if(this._precompileOpaqueGeometry(),this._nodes.precompile(S.OPAQUE_ENVIRONMENT,S.GAUSSIAN_SPLAT,S.OPAQUE_OCCLUSION_QUERY,S.VOXEL),this._precompileOpaqueGeometry(),t.output=3,this._plugins.precompile(...be),t.output=0,this._plugins.precompile(...be),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(t,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(t,!1,1),this._precompileTransparentGeometry(),t.hasTransparentEmission&&(t.emissions=3)}this._nodes.precompile(S.FOCUSAREA_MASK),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,t),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(S.TRANSPARENT_ENVIRONMENT,S.VIEWSHED,S.CUTFILL_COMPUTATION,S.CUTFILL,S.LASERLINES,S.FOCUSAREA,S.OCCLUDED,S.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=s,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(S.HIGHLIGHT)),t.highlightMixTexture=null,this._nodes.precompile(D.COMPOSITE,S.MAGNIFIER),this._nodes.precompile(S.TRANSPARENT_NO_DEPTH),this._plugins.precompile(8),t.hasOpaqueEmission&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaMask(){const e=this._nodes.produce(S.FOCUSAREA_MASK,this._pluginInput);return e&&this.performanceInfo.advance(oe.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces(S.OBJECT_AND_LAYER_ID_COLOR))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,S.OBJECT_AND_LAYER_ID_COLOR).acquireDepth(14);return i=this._renderNodes(S.OBJECT_AND_LAYER_ID_COLOR,i),--this._techniques.precompiling,this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e,i=s?this.performanceInfo.elapsedTime:0;if(s||t){let e=0;t?e=this.performanceInfo.totalGPUTimeSampler.last:(this._rctx.gl.finish(),e=this.performanceInfo.elapsedTime);const r=Math.max(i,e);this._animationTimestep.frame(r,s)}}readAccumulatedShadow(e){return this._shadowAccumulator?.readAccumulatedShadow(e[0],e[1])??0}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(C),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,le.UNSIGNED_BYTE,t),r.release()}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?oe.OPAQUE_EDGES:oe.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(oe.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(S.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(S.SHADOWMAP)}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output,i=6!==e;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e),i&&this._renderShadowNodes(t.renderTarget);t.finish(e),this._bindParameters.output=s}_renderShadowNodes(e){this._renderInternalNodeCategory(S.SHADOWMAP,e)}get _needsLastFrameColor(){return+this.hasReflections+ +this.hasGlobalIllumination}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._testsNeedsDepth+ +this._needsShadowHighlight}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){const e=this._bindParameters;e.depth=n(this._bindParameters.depth);const t=this._pluginInput.get("normals");if(t){const s=this._nodes.produce(S.AMBIENT_ILLUMINATION,this._pluginInput);this._pluginInput.set(S.AMBIENT_ILLUMINATION,s),this._releaseGlobalIlluminationBuffers(),e.ssao=this.hasGlobalIllumination?null:s,e.globalIllumination=this.hasGlobalIllumination?s:null,e.globalIlluminationEnabled=null!=e.globalIllumination,s&&this.performanceInfo.advance(this.hasGlobalIlluminationHighQuality?oe.AMBIENT_ILLUMINATION_HIGH_QUALITY:oe.AMBIENT_ILLUMINATION);const i=this._needsDepth;if(i){const s=t.obtainAttachment(ue);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),e.depth=t.obtainDepthTexture(),e.depth?.retain(i-1),t.attachColor(s,ue),s?.release(),this.performanceInfo.advance(oe.DEPTH)}else t.detachDepth();this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._releaseGlobalIlluminationBuffers(),e.ssao=null,this._pluginInput.set(S.AMBIENT_ILLUMINATION,null),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._renderGaussianSplatPrepassDepth(i),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(oe.DEPTH)}_renderGaussianSplatPrepassDepth(e){const t=this._shadowAccumulator;if(!t?.active||!t.requireGeometryDepth)return;const s=this._bindParameters.output;this._bindParameters.output=3,this._renderInternalNodeCategory(S.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=s}_renderGaussianSplatDepthAndNormals(e){const t=this._bindParameters.output;this._bindParameters.output=4,this._renderInternalNodeCategory(S.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=t}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||!!this._shadowAccumulator?.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return z.Zero;const t=Y(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.union(this._nodes.queryDepthRange(S.SHADOWMAP,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=z.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<L)return void(this.sceneDepthRange.value=z.Infinite);const t=e.clone();t.near=O,t.far=1e10;const s=Y(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...R,S.VIEWSHED,S.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){const e=!!this._normalsRequired;if(e?(this._precompilePlugins(4,Pe),this._needsDepth&&this._precompilePlugins(3,Ae)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(S.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator?.active&&(this._nodes.precompile(S.SHADOW_ACCUMULATION),this._precompileAllGeometry(5)),this._shadowAccumulator?.active||e){const t=this._bindParameters.output;this._bindParameters.output=e?4:3,this._nodes.precompile(S.GAUSSIAN_SPLAT_DEPTH),this._bindParameters.output=t}(this.shadowsEnabled||this._shadowAccumulator?.active)&&this._nodes.precompile(S.SHADOWMAP),this.hasAmbientIllumination&&e&&this._nodes.precompile(S.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals");i.acquireDepth(14),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...Pe),this._renderGaussianSplatDepthAndNormals(i);const r=this._nodes.optional("normals",...R,S.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(oe.NORMALS),i}_releaseGlobalIlluminationBuffers(){const e=this._bindParameters;this.hasGlobalIllumination&&(e.reprojection.lastFrameColor=h(e.reprojection.lastFrameColor)),e.reprojection.lastFrameDepth=n(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=n(e.reprojection.lastFrameEmission),e.globalIllumination=h(e.globalIllumination),e.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...be),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...we);this._renderContext.renderOccludedMask=Z}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...we),this._renderContext.renderOccludedMask=Z}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Te[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){const e=this._bindParameters.output;this._bindParameters.output=8,this._precompileAllGeometry(8),this._nodes.precompile(S.SHADOWMAP),this._bindParameters.output=e}precompileCutFillDepth(){this._precompilePlugins(9,Se)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e,t){const{camera:s,contentCamera:i}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._renderShadowNodes(t),this._ensureBindParametersCamera(s,i),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=r}renderCutFillDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Se),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,S.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Ae)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...fe),this._nodes.precompile("opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...fe)}_renderTransparentGeometry(){this._plugins.render(...ge),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...be)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle,i=this._bindParameters.emissions;this._bindParameters.emissions=0,this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...Ie),this._bindParameters.output=2,this._plugins.precompile(...Ie),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...Ie)),this._bindParameters.emissions=i,this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(de);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?oe.HUD_OCCLUDED:oe.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>q?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(14);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),j(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(oe.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...N)+this._nodes.optional("highlights",...N)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ee),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e){const t=this._shadowAccumulator;if(!t)return;t.updateDepthRange(e);const s=t.requireGeometryDepth;this._bindParameters.output=0;const i=this._nodes.produce(S.SHADOW_ACCUMULATION,this._pluginInput);t.didAccumulate&&this.performanceInfo.advance(oe.ACCUMULATED_SHADOWS),this._pluginInput.set(S.SHADOW_ACCUMULATION,null),i?.release(),s&&(this._bindParameters.depth=h(this._bindParameters.depth))}renderShadowAccumulationShadowMap(e,t,s,i,r){const a=this.stage.view.qualitySettings.maximumPixelRatio;this._bindParameters.renderingShadowAnalysisMap=!0;try{s.start(e,i,r,!0,a),this._renderShadowCascades(5,s),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t)}finally{this._bindParameters.renderingShadowAnalysisMap=!1}}_precompileTransparentGeometry(){y(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...ge),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...ge),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...ge)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",u=this.fboCache.acquire(i,r,l,o).acquireColor(de,this.hasFloatBlend?7:0,"oit alpha"),_=h.hasEmission&&(0===e||1!==t);_&&u.acquireColor(_e,o,"oit emissive"),s||u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(X),_&&this._rctx.clearBuffer(2,X),a(),u.detachDepth(),h.output=2;const m=this.fboCache.acquire(i,r,s?"oit front hud":"oit front");_&&m.acquireColor(de,o,"oit front emissive"),s?m.acquireDepth(this._hudDepthFormat):m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer(C,s),a(),m.detachDepth();const p=this._pluginsHas.occludedHudElements&&!s,c=p&&0!==h.emissions?_e:de;let f;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(f=this.fboCache.acquire(i,r,"oit composite hud"),this._rctx.bindFramebuffer(f.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(0!==h.emissions&&this._framebuffer.ensureEmissionAttachment(),p&&(this._framebuffer.color.acquireColor(c,0,"hud occlusion"),this._rctx.clearBuffer(c-ue,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,u,m,h,p,e,this._fboCache.debugCallback),f?.detachDepth(),s||(_&&(this._bindParameters.emissions=3),p&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(c))),m.release(),u.release(),h.output=d,f}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...fe)||this.plugins.produces(5,...fe)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(S.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(D.OPAQUE,t,e)),this.fboCache.debugCallback?.(D.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(S.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(S.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(S.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(S.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(S.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(S.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(S.VOXEL,e)),this.fboCache.debugCallback?.(S.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;if(this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(D.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(D.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),e.update(e=>this._renderNodes(S.TRANSPARENT_NO_DEPTH,e)),this.fboCache.debugCallback?.(S.TRANSPARENT_NO_DEPTH,e.color.fbo),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){const e=this._rctx.setDrawBuffers([me,de]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),this._fboCache.debugCallback?.(e,i.fbo),i}_renderInternalNodeCategory(e,t){if(!t)return;const s=t.name;try{this._renderNodes(e,t)}finally{this._pluginInput.set(e,null),t.setName(s)}}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration,this.stage.view.state.stationary),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){const{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=A);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(g(Ne,t.viewMatrix),g(Re,t.projectionMatrix),b(Oe,Ne,Re),b(Oe,s.viewMatrix,Oe),b(Oe,s.projectionMatrix,Oe),this._reprojectionMatrix=Oe):this._reprojectionMatrix=A,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(b(He,s.viewMatrix,Ne),P(t,He)):P(t,A)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p({readOnly:!0})],ce.prototype,"highResolutionAtmosphere",null),e([p()],ce.prototype,"_edgeView",void 0),e([p()],ce.prototype,"updating",null),ce=e([c("esri.views.3d.webgl-engine.lib.Renderer")],ce);const fe=[0,1,2,3],ge=[7,6,4,5],be=[7,6],Pe=[0,1,2,4,...be],Ae=[3,5],we=[2,4,8],Ie=[16,12,14,13],Ee=[4,5,2,3,0,1,...be],Ce=[4,8,5,11],Te={0:[13],1:[12],2:[13,12],3:[13,12]},Se=[0,1,...be],De=["normals","highlights"],Re=w(),Ne=w(),Oe=w(),He=w();function Fe(e){return t=>e.immediate.schedule(t)}export{ce as Renderer};
|
|
2
|
+
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as u,sync as _}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as f,invert as g,multiply as b,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as A,create as w}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as I}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as E,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as T}from"../../../../geometry/support/Indices.js";import{InternalRenderCategory as S,RenderNodeOutput as D,AllRenderNodeOutputs as R,AllInternalRenderNodeOutputs as N}from"../../webgl.js";import{minNearDistanceInMeters as O}from"../../state/NearFarHeuristic.js";import{debugFlags as H}from"../../support/debugFlags.js";import{FBOCache as F}from"../core/FBOCache.js";import{RenderPassManager as x}from"../core/renderPasses/RenderPassManager.js";import{isColor as y}from"../core/shaderLibrary/ShaderOutput.js";import{RenderNodes as G}from"../effects/RenderNodes.js";import{RenderPluginManager as M}from"../effects/RenderPluginManager.js";import{WeatherFader as v}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as L}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as q,renderHighlightBuffer as j}from"../effects/highlight/Highlight.js";import{OITBlend as B}from"../effects/transparency/OITBlend.js";import{AnimationTimer as V}from"./AnimationTimer.js";import{AnimationTimeStep as k}from"./AnimationTimeStep.js";import{BoundingInfo as W}from"./BoundingInfo.js";import{Compositor as Q}from"./Compositor.js";import{DepthRange as z}from"./DepthRange.js";import{depthRangeFromScene as Y}from"./depthRangeUtils.js";import{MainFramebuffer as K}from"./MainFramebuffer.js";import{NavigationDepthCache as J}from"./NavigationDepthCache.js";import{blendingColorAlphaClear as X}from"./OrderIndependentTransparency.js";import{RenderContext as $,defaultRenderOccludedMask as Z}from"./RenderContext.js";import{RendererBase as ee}from"./RendererBase.js";import{setupFeatureDefaults as te}from"./RenderFeature.js";import{RenderPluginInput as se}from"./RenderPluginInput.js";import{ShadowMap as ie}from"./ShadowMap.js";import re from"./SliceHelper.js";import{MergedRenderer as ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ne}from"../parts/renderUtils.js";import{RendererPerformanceInfo as he,PerformanceCategory as oe}from"../statistics/RendererPerformanceInfo.js";import{PixelType as de,ColorAttachment0 as le,ColorAttachment1 as ue,ColorAttachment2 as _e,DrawBufferNone as me}from"../../../webgl/enums.js";const pe=has("disable-feature:async-navigation-3d-depth-readback");let ce=class extends ee{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new x,this._isRendering=!1,this._backgroundColor=E(0,0,0,1),this._sliceHelper=new re,this._shadowAccumulator=null,this._shadowCastOptions=null,this.sceneDepthRange=m(z.Infinite),this._state=m(2),this._hasAnimations=!1,this._animationTimestep=new k,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new se,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of De)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new F(i),this._compositor=new Q(i,s),this._renderStateFeatures=m(te(e.view.qualityProfile));const a=new ie(this._fboCache,e.viewingMode);this._renderContext=new $(this._rctx,a,s),this._framebuffer=new K(this._fboCache,this._bindParameters),this._performanceInfo=new he(this._rctx),this._blit=new U(s),this.navigationDepthCache=new J(this._rctx,this._fboCache,s,()=>this._requestRender(0)),this._nodes=new G(this._renderContext),this._plugins=new M({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new v({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>H.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},u),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;I(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.environmentManager.shadowsAvailable,e=>{this._bindParameters.shadowMap.enabled=e,this._requestRender(1)},l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},_),d(()=>this._bindParameters.clouds.data?.state,()=>r(),_),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},u),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator=null,this._shadowCastOptions=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.navigationDepthCache.destroy(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,W.prune(),ae.prune(),T()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new B(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=te(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this.isFeatureEnabled(e,t)!==s&&(this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender())}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this._nodes.produces(S.AMBIENT_ILLUMINATION)}get hasGlobalIllumination(){return this.stage.renderView?.globalIllumination?.enabled??!1}get hasGlobalIlluminationHighQuality(){const e=this.stage.renderView?.globalIllumination;return this.hasGlobalIllumination&&!0===e?.hasHighQuality}get hasSMAA(){return this.isFeatureEnabled(0)}get _emissions(){const e=this._plugins.emissions;return this._hasTransparentGeometry?e:1===e||3===e?1:0}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}setShadowAccumulator(e){this._shadowAccumulator=e,this._shadowCastOptions&&e.setParameters(this._shadowCastOptions)}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose();const e=this._bindParameters;e.globalIllumination=n(e.globalIllumination),e.reprojection.lastFrameDepth=n(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=n(e.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await(import("./edgeRendering/EdgeView.js"));o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Fe(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),_)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView().catch(()=>{}),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&f(this._bindParameters.reprojection.matrix,A)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&(this._shadowCastOptions={...this._shadowCastOptions,...e.shadowCast},this._shadowAccumulator?.setParameters(e.shadowCast))}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}addRenderer(e){this._plugins.add(e)}removeRenderer(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...Ie),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new V(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,s=!1){try{return this._isRendering=!0,this._render(e,t,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new ne(this._pluginInput.get(D.FINAL),null)}_render(e,t,s){const i=0===t;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:r,contentCamera:a,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.frameRendererTarget=t,this._bindParameters.output=0,this._bindParameters.emissions=this._emissions,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(S.VIEWSHED),this._bindParameters.laserlinesEnabled=this._nodes.produces(S.LASERLINES),this._bindParameters.shadowAnalysisEnabled=!!this._shadowAccumulator?.active,this._bindParameters.cutFillComputationEnabled=this._nodes.produces(S.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(S.CUTFILL),this._ensureBindParameters(r,a),this._plugins.sortTestsTransparentOrderedSlots(Ce),this._plugins.prepareRender(),this._hasTransparentGeometry=this._plugins.produces(1,...ge),this._renderOverlay(),r.setGLViewport(this._rctx);const u=this._framebuffer,_=u.initialize(r.fullWidth,r.fullHeight,this._backgroundColor),m=this._needsLastFrameColor;m?(_?.retain(m-1),_?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor?.release(),this._bindParameters.reprojection.lastFrameColor=_):_?.release(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!s,this._precompilePrepasses(),this.performanceInfo.advance(oe.PREPARE);const p=this._computeShadowDepthRange(r);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(r,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p),u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._precompileShaders(i),this._bindParameters.output=0,this._renderOpaque(),this._renderPreTransparent(),this._renderTransparent(),this._3dGeometryRendered(),u.update(e=>this._renderNodes(S.CUTFILL_COMPUTATION,e)),this._pluginInput.set(S.FOCUSAREA_MASK,this._renderFocusAreaMask()),u.update(e=>this._renderNodes(S.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(S.VIEWSHED,e)),u.update(e=>this._renderNodes(S.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),u.update(e=>this._renderNodes(S.FOCUSAREA,e)),this._pluginInput.release(S.FOCUSAREA_MASK),u.update(e=>this._renderNodes(S.CUTFILL,e)),this._pluginInput.release(S.GROUND_DEPTH),u.update(e=>this._renderNodes(S.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===t?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(D.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),u.update(e=>this._renderNodes(S.ANTIALIASING,e));const f=this._hasTransparentGeometry?2:1,g=this._bindParameters.emissions;let b;return this._bindParameters.emissions=0,this._hasHUDHighlights&&u.update(e=>this._renderHUD(f,e)),u.update(e=>this._renderNodes(S.HIGHLIGHT,e)),this._hasHUDHighlights||u.update(e=>this._renderHUD(f,e)),this._bindParameters.emissions=g,u.update(e=>this._renderNodes(S.MAGNIFIER,e)),u.update(e=>this._renderNodes(D.FINAL,e)),i&&(this._blit.toFramebuffer(u.color,this._bindParameters),pe||2!==o&&0!==o||this.navigationDepthCache.update(this._bindParameters,u.depth.attachment,this._renderContext.time)),this._bindParameters.reprojection.lastFrameDepth?.release(),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),u.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(b=u.color,b.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new ne(b,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling;const t=this._bindParameters;t.output=0;const s=t.emissions;if(this._precompileOpaqueGeometry(),this._nodes.precompile(S.OPAQUE_ENVIRONMENT,S.GAUSSIAN_SPLAT,S.OPAQUE_OCCLUSION_QUERY,S.VOXEL),this._precompileOpaqueGeometry(),t.output=3,this._plugins.precompile(...be),t.output=0,this._plugins.precompile(...be),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(t,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(t,!1,1),this._precompileTransparentGeometry(),t.hasTransparentEmission&&(t.emissions=3)}this._nodes.precompile(S.FOCUSAREA_MASK),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,t),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(S.TRANSPARENT_ENVIRONMENT,S.VIEWSHED,S.CUTFILL_COMPUTATION,S.CUTFILL,S.LASERLINES,S.FOCUSAREA,S.OCCLUDED,S.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=s,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(S.HIGHLIGHT)),t.highlightMixTexture=null,this._nodes.precompile(D.COMPOSITE,S.MAGNIFIER),this._nodes.precompile(S.TRANSPARENT_NO_DEPTH),this._plugins.precompile(8),t.hasOpaqueEmission&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaMask(){const e=this._nodes.produce(S.FOCUSAREA_MASK,this._pluginInput);return e&&this.performanceInfo.advance(oe.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces(S.OBJECT_AND_LAYER_ID_COLOR))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,S.OBJECT_AND_LAYER_ID_COLOR).acquireDepth(14);return i=this._renderNodes(S.OBJECT_AND_LAYER_ID_COLOR,i),--this._techniques.precompiling,this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e,i=s?this.performanceInfo.elapsedTime:0;if(s||t){let e=0;t?e=this.performanceInfo.totalGPUTimeSampler.last:(this._rctx.gl.finish(),e=this.performanceInfo.elapsedTime);const r=Math.max(i,e);this._animationTimestep.frame(r,s)}}readAccumulatedShadow(e){return this._shadowAccumulator?.readAccumulatedShadow(e[0],e[1])??0}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(C),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,de.UNSIGNED_BYTE,t),r.release()}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?oe.OPAQUE_EDGES:oe.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(oe.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(S.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(S.SHADOWMAP)}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output,i=6!==e;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e),i&&this._renderShadowNodes(t.renderTarget);t.finish(e),this._bindParameters.output=s}_renderShadowNodes(e){this._renderInternalNodeCategory(S.SHADOWMAP,e)}get _needsLastFrameColor(){return+this.hasReflections+ +this.hasGlobalIllumination}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._testsNeedsDepth+ +this._needsShadowHighlight}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){const e=this._bindParameters;e.depth=n(this._bindParameters.depth);const t=this._pluginInput.get("normals");if(t){const s=this._nodes.produce(S.AMBIENT_ILLUMINATION,this._pluginInput);this._pluginInput.set(S.AMBIENT_ILLUMINATION,s),this._releaseGlobalIlluminationBuffers(),e.ssao=this.hasGlobalIllumination?null:s,e.globalIllumination=this.hasGlobalIllumination?s:null,e.globalIlluminationEnabled=null!=e.globalIllumination,s&&this.performanceInfo.advance(this.hasGlobalIlluminationHighQuality?oe.AMBIENT_ILLUMINATION_HIGH_QUALITY:oe.AMBIENT_ILLUMINATION);const i=this._needsDepth;if(i){const s=t.obtainAttachment(le);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),e.depth=t.obtainDepthTexture(),e.depth?.retain(i-1),t.attachColor(s,le),s?.release(),this.performanceInfo.advance(oe.DEPTH)}else t.detachDepth();this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._releaseGlobalIlluminationBuffers(),e.ssao=null,this._pluginInput.set(S.AMBIENT_ILLUMINATION,null),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._renderGaussianSplatPrepassDepth(i),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(oe.DEPTH)}_renderGaussianSplatPrepassDepth(e){const t=this._shadowAccumulator;if(!t?.active||!t.requireGeometryDepth)return;const s=this._bindParameters.output;this._bindParameters.output=3,this._renderInternalNodeCategory(S.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=s}_renderGaussianSplatDepthAndNormals(e){const t=this._bindParameters.output;this._bindParameters.output=4,this._renderInternalNodeCategory(S.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=t}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||!!this._shadowAccumulator?.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return z.Zero;const t=Y(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.union(this._nodes.queryDepthRange(S.SHADOWMAP,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=z.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<L)return void(this.sceneDepthRange.value=z.Infinite);const t=e.clone();t.near=O,t.far=1e10;const s=Y(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...R,S.VIEWSHED,S.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){const e=!!this._normalsRequired;if(e?(this._precompilePlugins(4,Pe),this._needsDepth&&this._precompilePlugins(3,Ae)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(S.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator?.active&&(this._nodes.precompile(S.SHADOW_ACCUMULATION),this._precompileAllGeometry(5)),this._shadowAccumulator?.active||e){const t=this._bindParameters.output;this._bindParameters.output=e?4:3,this._nodes.precompile(S.GAUSSIAN_SPLAT_DEPTH),this._bindParameters.output=t}(this.shadowsEnabled||this._shadowAccumulator?.active)&&this._nodes.precompile(S.SHADOWMAP),this.hasAmbientIllumination&&e&&this._nodes.precompile(S.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals");i.acquireDepth(14),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...Pe),this._renderGaussianSplatDepthAndNormals(i);const r=this._nodes.optional("normals",...R,S.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(oe.NORMALS),i}_releaseGlobalIlluminationBuffers(){const e=this._bindParameters;this.hasGlobalIllumination&&(e.reprojection.lastFrameColor=h(e.reprojection.lastFrameColor)),e.reprojection.lastFrameDepth=n(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=n(e.reprojection.lastFrameEmission),e.globalIllumination=h(e.globalIllumination),e.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...be),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...we);this._renderContext.renderOccludedMask=Z}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...we),this._renderContext.renderOccludedMask=Z}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Te[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){const e=this._bindParameters.output;this._bindParameters.output=8,this._precompileAllGeometry(8),this._nodes.precompile(S.SHADOWMAP),this._bindParameters.output=e}precompileCutFillDepth(){this._precompilePlugins(9,Se)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e,t){const{camera:s,contentCamera:i}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._renderShadowNodes(t),this._ensureBindParametersCamera(s,i),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=r}renderCutFillDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Se),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,S.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Ae)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...fe),this._nodes.precompile("opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...fe)}_renderTransparentGeometry(){this._plugins.render(...ge),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...be)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle,i=this._bindParameters.emissions;this._bindParameters.emissions=0,this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...Ie),this._bindParameters.output=2,this._plugins.precompile(...Ie),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...Ie)),this._bindParameters.emissions=i,this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(ue);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?oe.HUD_OCCLUDED:oe.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>q?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(14);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),j(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(oe.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...N)+this._nodes.optional("highlights",...N)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ee),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e){const t=this._shadowAccumulator;if(!t)return;t.updateDepthRange(e);const s=t.requireGeometryDepth;this._bindParameters.output=0;const i=this._nodes.produce(S.SHADOW_ACCUMULATION,this._pluginInput);t.didAccumulate&&this.performanceInfo.advance(oe.ACCUMULATED_SHADOWS),this._pluginInput.set(S.SHADOW_ACCUMULATION,null),i?.release(),s&&(this._bindParameters.depth=h(this._bindParameters.depth))}renderShadowAccumulationShadowMap(e,t,s,i,r){const a=this.stage.view.qualitySettings.maximumPixelRatio;this._bindParameters.renderingShadowAnalysisMap=!0;try{s.start(e,i,r,!0,a),this._renderShadowCascades(5,s),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t)}finally{this._bindParameters.renderingShadowAnalysisMap=!1}}_precompileTransparentGeometry(){y(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...ge),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...ge),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...ge)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",u=this.fboCache.acquire(i,r,l,o).acquireColor(ue,this.hasFloatBlend?7:0,"oit alpha"),_=h.hasEmission&&(0===e||1!==t);_&&u.acquireColor(_e,o,"oit emissive"),s||u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(X),_&&this._rctx.clearBuffer(2,X),a(),u.detachDepth(),h.output=2;const m=this.fboCache.acquire(i,r,s?"oit front hud":"oit front");_&&m.acquireColor(ue,o,"oit front emissive"),s?m.acquireDepth(this._hudDepthFormat):m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer(C,s),a(),m.detachDepth();const p=this._pluginsHas.occludedHudElements&&!s,c=p&&0!==h.emissions?_e:ue;let f;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(f=this.fboCache.acquire(i,r,"oit composite hud"),this._rctx.bindFramebuffer(f.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(0!==h.emissions&&this._framebuffer.ensureEmissionAttachment(),p&&(this._framebuffer.color.acquireColor(c,0,"hud occlusion"),this._rctx.clearBuffer(c-le,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,u,m,h,p,e,this._fboCache.debugCallback),f?.detachDepth(),s||(_&&(this._bindParameters.emissions=3),p&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(c))),m.release(),u.release(),h.output=d,f}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...fe)||this.plugins.produces(5,...fe)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(S.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(D.OPAQUE,t,e)),this.fboCache.debugCallback?.(D.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(S.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(S.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(S.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(S.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(S.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(S.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(S.VOXEL,e)),this.fboCache.debugCallback?.(S.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;if(this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(D.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(D.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),e.update(e=>this._renderNodes(S.TRANSPARENT_NO_DEPTH,e)),this.fboCache.debugCallback?.(S.TRANSPARENT_NO_DEPTH,e.color.fbo),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){const e=this._rctx.setDrawBuffers([me,ue]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),this._fboCache.debugCallback?.(e,i.fbo),i}_renderInternalNodeCategory(e,t){if(!t)return;const s=t.name;try{this._renderNodes(e,t)}finally{this._pluginInput.set(e,null),t.setName(s)}}_3dGeometryRendered(){const e=this._bindParameters;this.hasReflections&&(e.depth=h(e.depth),e.reprojection.lastFrameColor=h(e.reprojection.lastFrameColor)),e.shadowMap.disposeOutput(5);const t=this._framebuffer.color.getAttachment(ue)?.attachment;if(this.hasGlobalIllumination&&t){const{width:s,height:i}=this._framebuffer.size,r=e.useFloatBlend.value?8:5;e.reprojection.lastFrameEmission=this.fboCache.acquire(s,i,"emissive",r),this._blit.blitTexture(t,e,e.reprojection.lastFrameEmission.fbo)}}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration,this.stage.view.state.stationary),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){const{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=A);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(g(Ne,t.viewMatrix),g(Re,t.projectionMatrix),b(Oe,Ne,Re),b(Oe,s.viewMatrix,Oe),b(Oe,s.projectionMatrix,Oe),this._reprojectionMatrix=Oe):this._reprojectionMatrix=A,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(b(He,s.viewMatrix,Ne),P(t,He)):P(t,A)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p({readOnly:!0})],ce.prototype,"highResolutionAtmosphere",null),e([p()],ce.prototype,"_edgeView",void 0),e([p()],ce.prototype,"updating",null),ce=e([c("esri.views.3d.webgl-engine.lib.Renderer")],ce);const fe=[0,1,2,3],ge=[7,6,4,5],be=[7,6],Pe=[0,1,2,4,...be],Ae=[3,5],we=[2,4,8],Ie=[16,12,14,13],Ee=[4,5,2,3,0,1,...be],Ce=[4,8,5,11],Te={0:[13],1:[12],2:[13,12],3:[13,12]},Se=[0,1,...be],De=["normals","highlights"],Re=w(),Ne=w(),Oe=w(),He=w();function Fe(e){return t=>e.immediate.schedule(t)}export{ce as Renderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/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 l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as m,add as u,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 D}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as O}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as H,transformMat4 as Q}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as L}from"../../webgl.js";import{CascadeCamera as V}from"./CascadeCamera.js";import{applyTextureResizeModulo as T}from"./textureUtils.js";import{assert as N,logWithBase as F,verify as R,rayRay2D as z}from"./Util.js";import{DepthStencilAttachment as A}from"../../../webgl/enums.js";class W{constructor(){this.camera=new V,this.lightMat=l()}}class E{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._height=0,this._numCascades=1,this.settings=new E,this._projectionView=l(),this._projectionViewInverse=l(),this._modelViewLight=l(),this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=S(),this._cascades=[new W,new W,new W,new W],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 renderTarget(){return this._handle}get cascades(){for(let t=0;t<this._numCascades;++t)Y[t]=this._cascades[t];return Y.length=this._numCascades,Y}start(t,s,e,i,a){N(this.enabled);const{near:r,far:h}=bt(e);this._computeCascadeDistances(r,h,i),this._height=this._computeTextureHeight(t,a,i),this._setupMatrices(t,s);for(let c=0;c<this._numCascades;++c)this._constructCascade(c,t,s);this._lastOrigin=null,this.clear()}getShadowMapMatrices(t){if(!this._lastOrigin||!C(t,this._lastOrigin)){this._lastOrigin
|
|
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 l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as m,add as u,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 D}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as O}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as H,transformMat4 as Q}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as L}from"../../webgl.js";import{CascadeCamera as V}from"./CascadeCamera.js";import{applyTextureResizeModulo as T}from"./textureUtils.js";import{assert as N,logWithBase as F,verify as R,rayRay2D as z}from"./Util.js";import{DepthStencilAttachment as A}from"../../../webgl/enums.js";class W{constructor(){this.camera=new V,this.lightMat=l()}}class E{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._height=0,this._numCascades=1,this.settings=new E,this._projectionView=l(),this._projectionViewInverse=l(),this._modelViewLight=l(),this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=S(),this._cascades=[new W,new W,new W,new W],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 renderTarget(){return this._handle}get cascades(){for(let t=0;t<this._numCascades;++t)Y[t]=this._cascades[t];return Y.length=this._numCascades,Y}start(t,s,e,i,a){N(this.enabled);const{near:r,far:h}=bt(e);this._computeCascadeDistances(r,h,i),this._height=this._computeTextureHeight(t,a,i),this._setupMatrices(t,s);for(let c=0;c<this._numCascades;++c)this._constructCascade(c,t,s);this._lastOrigin=null,this.clear()}getShadowMapMatrices(t){if(!this._lastOrigin||!C(t,this._lastOrigin)){this._lastOrigin??=O(),j(this._lastOrigin,t);for(let s=0;s<this._numCascades;++s){r($,this._cascades[s].lightMat,t);for(let t=0;t<16;++t)tt[16*s+t]=$[t]}}return tt}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(A):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 T(Math.max(s,e)*r*h,this._maxTextureWidth/this._numCascades)}_ensureFbo(){this._handle?.fbo?.width===this._width&&this._handle?.fbo.height===this._height||(this._handle?.release(),this._handle=this._fbos.acquire(this._width,this._height,L.SHADOWMAP,13),this._handle.getTexture(A)?.setShadowFiltering(!0))}bindFramebuffer(){this._fbos.rctx.bindFramebuffer(this._handle?.fbo)}_constructCascade(t,s,e){const{viewMatrix:i,projectionMatrix:a,relativeElevation:c}=s,o=this._cascades[t],n=-this._cascadeDistances[t],l=-this._cascadeDistances[t+1],m=(a[10]*n+a[14])/Math.abs(a[11]*n+a[15]),u=(a[10]*l+a[14])/Math.abs(a[11]*l+a[15]);N(m<u);for(let r=0;r<8;++r){H(q,r%4==0||r%4==3?-1:1,r%4==0||r%4==1?-1:1,r<4?m:u,1);const t=P[r];Q(t,q,this._projectionViewInverse),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3]}y(X,P[0]),o.camera.viewMatrix=r(U,this._modelViewLight,X);for(let r=0;r<8;++r)v(P[r],P[r],o.camera.viewMatrix);let d=P[0][2],_=P[0][2];for(let r=1;r<8;++r)d=Math.min(d,P[r][2]),_=Math.max(_,P[r][2]);d-=200,_+=200,o.camera.near=-_,o.camera.far=-d,o.camera.relativeElevation=c,xt(i,e,d,_,o.camera),h(o.lightMat,o.camera.projectionMatrix,o.camera.viewMatrix);const g=this._height;o.camera.viewport=[t*g,0,g,g]}_setupMatrices(t,s){h(this._projectionView,t.projectionMatrix,t.viewMatrix),c(this._projectionViewInverse,this._projectionView);const e=1===this._viewingMode?t.eye:D(X,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(F(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 _width(){return this._height*this._numCascades}get numCascades(){return this._numCascades}get cascadeDistances(){return H(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=l(),q=S(),P=[];for(let wt=0;wt<8;++wt)P.push(S());const k=M(),B=M(),G=M(),J=M(),K=M(),X=O(),Y=[];function Z(){Y.length=0}const $=l(),tt=n.concat(n,n,n),st=M(),et=M(),it=[M(),M(),M(),M()],at=M(),rt=M(),ht=M(),ct=M(),ot=M(),nt=M(),lt=M();function mt(t,s,e,i,a,r,h,c){m(st,0,0);for(let m=0;m<4;++m)u(st,st,t[m]);d(st,st,.25),m(et,0,0);for(let m=4;m<8;++m)u(et,et,t[m]);d(et,et,.25),_(it[0],t[4],t[5],.5),_(it[1],t[5],t[6],.5),_(it[2],t[6],t[7],.5),_(it[3],t[7],t[4],.5);let o=0,n=g(it[0],st);for(let m=1;m<4;++m){const t=g(it[m],st);t<n&&(n=t,o=m)}f(at,it[o],t[o+4]);const l=at[0];let M,C;at[0]=-at[1],at[1]=l,f(rt,et,st),p(rt,at)<0&&x(at,at),_(at,at,rt,e),b(at,at),M=C=p(f(ht,t[0],st),at);for(let m=1;m<8;++m){const s=p(f(ht,t[m],st),at);s<M?M=s:s>C&&(C=s)}w(i,st),d(ht,at,M-s),u(i,i,ht);let j=-1,y=1,v=0,D=0;for(let m=0;m<8;++m){f(ct,t[m],i),b(ct,ct);const s=at[0]*ct[1]-at[1]*ct[0];s>0?s>j&&(j=s,v=m):s<y&&(y=s,D=m)}R(j>0,"leftArea"),R(y<0,"rightArea"),d(ot,at,M),u(ot,ot,st),d(nt,at,C),u(nt,nt,st),lt[0]=-at[1],lt[1]=at[0];const O=z(i,t[D],nt,u(ht,nt,lt),1,a),H=z(i,t[v],nt,ht,1,r),Q=z(i,t[v],ot,u(ht,ot,lt),1,h),S=z(i,t[D],ot,ht,1,c);R(O,"rayRay"),R(H,"rayRay"),R(Q,"rayRay"),R(S,"rayRay")}function ut(t,s){return 3*s+t}const dt=M();function _t(t,s){return m(dt,t[s],t[s+3]),dt}const gt=M(),ft=a();function pt(t,s,e,i,a){f(gt,e,i),d(gt,gt,.5),ft[0]=gt[0],ft[1]=gt[1],ft[2]=0,ft[3]=gt[1],ft[4]=-gt[0],ft[5]=0,ft[6]=gt[0]*gt[0]+gt[1]*gt[1],ft[7]=gt[0]*gt[1]-gt[1]*gt[0],ft[8]=1,ft[ut(0,2)]=-p(_t(ft,0),t),ft[ut(1,2)]=-p(_t(ft,1),t);let r=p(_t(ft,0),e)+ft[ut(0,2)],h=p(_t(ft,1),e)+ft[ut(1,2)],c=p(_t(ft,0),i)+ft[ut(0,2)],o=p(_t(ft,1),i)+ft[ut(1,2)];r=-(r+c)/(h+o),ft[ut(0,0)]+=ft[ut(1,0)]*r,ft[ut(0,1)]+=ft[ut(1,1)]*r,ft[ut(0,2)]+=ft[ut(1,2)]*r,r=1/(p(_t(ft,0),e)+ft[ut(0,2)]),h=1/(p(_t(ft,1),e)+ft[ut(1,2)]),ft[ut(0,0)]*=r,ft[ut(0,1)]*=r,ft[ut(0,2)]*=r,ft[ut(1,0)]*=h,ft[ut(1,1)]*=h,ft[ut(1,2)]*=h,ft[ut(2,0)]=ft[ut(1,0)],ft[ut(2,1)]=ft[ut(1,1)],ft[ut(2,2)]=ft[ut(1,2)],ft[ut(1,2)]+=1,r=p(_t(ft,1),s)+ft[ut(1,2)],h=p(_t(ft,2),s)+ft[ut(2,2)],c=p(_t(ft,1),e)+ft[ut(1,2)],o=p(_t(ft,2),e)+ft[ut(2,2)],r=-.5*(r/h+c/o),ft[ut(1,0)]+=ft[ut(2,0)]*r,ft[ut(1,1)]+=ft[ut(2,1)]*r,ft[ut(1,2)]+=ft[ut(2,2)]*r,r=p(_t(ft,1),s)+ft[ut(1,2)],h=p(_t(ft,2),s)+ft[ut(2,2)],c=-h/r,ft[ut(1,0)]*=c,ft[ut(1,1)]*=c,ft[ut(1,2)]*=c,a[0]=ft[0],a[1]=ft[1],a[2]=0,a[3]=ft[2],a[4]=ft[3],a[5]=ft[4],a[6]=0,a[7]=ft[5],a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=ft[6],a[13]=ft[7],a[14]=0,a[15]=ft[8]}function xt(t,s,i,a,r){const h=1/P[0][3],c=1/P[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,mt(P,o,n,k,B,G,J,K),pt(k,B,J,K,r.projectionMatrix),r.projectionMatrix[10]=2/(i-a),r.projectionMatrix[14]=-(i+a)/(i-a)}function bt(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,Z as cleanupShadowmap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{getScale as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{diameter as t}from"../../../../geometry/support/aaBoundingBox.js";import{isGaussianSplatLayer as n}from"../../../../layers/support/layerUtils.js";import{isGaussianSplatIntersectorResult as
|
|
2
|
+
import has from"../../../../core/has.js";import{getScale as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{diameter as t}from"../../../../geometry/support/aaBoundingBox.js";import{isGaussianSplatLayer as n,is3DTilesLayer as i}from"../../../../layers/support/layerUtils.js";import{isGaussianSplatIntersectorResult as l,isPclIntersectorResult as a,isVoxelIntersectorResult as u,isI3sIntersectorResult as o,is3DTilesIntersectorResult as s}from"../../layers/i3s/Intersector.js";import{isOverlayIntersectorResult as c,isTerrainIntersectorResult as g}from"../../terrain/Intersector.js";import{isHUDIntersectorResult as f}from"./HUDIntersectorResult.js";import{isObjectIntersectorResult as p}from"./ObjectIntersectorResult.js";import{isLodIntersectorResult as d}from"./lodRendering/Intersector.js";function m(r,e){return p(r)||f(r)?B(r.target?.object,e):g(r)?e.map?.ground:j(r.target)?B(r.target,e):null}function y(r,e){const t=h(r,e);return"graphic"===t?.type?t.graphic:null}function h(r,e,t={}){if(null==r)return null;if(p(r)||f(r))return V(r.target?.object,e,t);if(l(r))return I(L(r.target,e));if(a(r)){const e=r.target.createGraphic();return{type:"graphic",graphic:e,layer:e.layer}}if(u(r)){const e=r.target.createVoxelGraphic();return{type:"graphic",graphic:e,layer:e.layer}}if(c(r)||d(r))return V(r.target,e,t);if(o(r)){if(has("enable-feature:im-as-ground")){const t=L(r.target,e);return t.isUsedAsGroundLayer?null:I(t)}return w(r.target,e,t)}if(has("enable-feature:im-as-ground")&&s(r)){const t=L(r.target,e);if(!t.isUsedAsGroundLayer)return I(t)}return null}function j(r){return null!=r&&"layerViewUid"in r}function V(r,e,t){if(null==r?.graphicUid)return null;const n=B(r,e);if(null==n)return null;if(n===e.graphics)return null==e.graphicsView||"number"!=typeof r.graphicUid?null:e.graphicsView.getHit(r.graphicUid,t);const i=e.allLayerViews.find(r=>r.layer===n);return!i||i.suspended||null==r.graphicUid?null:"getHit"in i?i.getHit(r.graphicUid,t):null}function w(r,e,t){const n=B(r,e);if(null==n)return null;const i=e.allLayerViews.find(r=>r.layer===n);if(!i||i.suspended||!("getGraphicFromIntersectorTarget"in i))return null;const l=t.defer;return b(i.getGraphicFromIntersectorTarget(r,{defer:l?r=>l(async()=>b(await r())):void 0}))}function U(r,e){const t=B(r,e);if(null==t)return null;const n=e.allLayerViews.find(r=>r.layer===t);return n&&!n.suspended&&"getAABBFromIntersectorTarget"in n?n.getAABBFromIntersectorTarget(r):null}function b(r){return null!=r?{type:"graphic",graphic:r,layer:r.layer}:null}function I(r){return n(r)||i(r)||"integrated-mesh"===r?.type?{type:"layer",layer:r}:null}function L(r,e){const t=B(r,e);return null!=t&&"type"in t?t:null}function B(r,e){return null==r?.layerViewUid?null:null!=e.graphicsView&&r.layerViewUid===e.graphicsView.uid?e.graphics:e.allLayerViews.find(e=>e.uid===r.layerViewUid)?.layer}function x(e,n){if(p(e)||f(e))return e.target.object.boundingVolumeWorldSpace.sphere.radius;if(d(e)){r(G,e.transformation);const t=Math.max(G[0],G[1],G[2]);return e.target.baseBoundingSphere.radius*t}if(o(e)){const r=U(e.target,n);return r?.5*t(r):null}return null}function A(r){return!p(r)&&!f(r)&&(d(r)?r.target.numLodLevels>1:!!o(r))}const G=e();export{x as getIntersectedFeatureBSRadius,A as hasLod,y as toGraphic,h as toHit,m as toOwner};
|