@arcgis/core 6.0.0-next.6 → 6.0.0-next.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arcade/functions/knowledgegraph.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{f09c9d9a554c33a753b4.js → 02253bdffbd580af22d8.js} +1 -1
- package/assets/esri/core/workers/chunks/06ab24a083c3229228dd.js +1 -0
- package/assets/esri/core/workers/chunks/09a63cc1987f8636c5b0.js +1 -0
- package/assets/esri/core/workers/chunks/{8ba32d3a0df4a206ef1c.js → 15cc2c295682f48030f9.js} +1 -1
- package/assets/esri/core/workers/chunks/17b76e0d401c7e396d10.js +1 -0
- package/assets/esri/core/workers/chunks/{c18189710d6198516175.js → 19b9d393046a780e6c3f.js} +1 -1
- package/assets/esri/core/workers/chunks/1b35ec54968fbeec17ce.js +1 -0
- package/assets/esri/core/workers/chunks/1c0c5cb13c2590aae906.js +1 -0
- package/assets/esri/core/workers/chunks/1e0d2715d603f48a7e0b.js +1 -0
- package/assets/esri/core/workers/chunks/{83589144eeeb08f45557.js → 2aeb5cc32284dd3e4d22.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a7fc93cc693fd12b5d8.js → 2b6c74646ff475a6e302.js} +1 -1
- package/assets/esri/core/workers/chunks/2d9a1f23ec6ce90723ac.js +1 -0
- package/assets/esri/core/workers/chunks/340621182db9e8edbec2.js +1 -0
- package/assets/esri/core/workers/chunks/{71f739bb3f7350704af6.js → 384ae10053d35940de73.js} +1 -1
- package/assets/esri/core/workers/chunks/3b3e519f15ed52c83f0c.js +1 -0
- package/assets/esri/core/workers/chunks/{72019baeba520edb6bb0.js → 3b737dae6efed627406e.js} +1 -1
- package/assets/esri/core/workers/chunks/3c0ed15b544df6fb0903.js +1 -0
- package/assets/esri/core/workers/chunks/3ffda5bf0b91700dc308.js +1 -0
- package/assets/esri/core/workers/chunks/{1317ecdfd0cfa683a493.js → 42323093827adffe56d3.js} +1 -1
- package/assets/esri/core/workers/chunks/451d7d456df0f4466563.js +1 -0
- package/assets/esri/core/workers/chunks/4a6b92ecbb1f1c55cc43.js +1 -0
- package/assets/esri/core/workers/chunks/4e544de61f07ca660236.js +1 -0
- package/assets/esri/core/workers/chunks/{67ac6b326bf80fc3d33d.js → 53be85d04cd2da4f391d.js} +1 -1
- package/assets/esri/core/workers/chunks/54778dec1598818d93cb.js +1 -0
- package/assets/esri/core/workers/chunks/{06e7400f5ebe0719b81c.js → 5a5d80c2519aa3ea8878.js} +1 -1
- package/assets/esri/core/workers/chunks/{fb4ff0ac2bc445fec413.js → 5b434e8c98e7119d4a3b.js} +1 -1
- package/assets/esri/core/workers/chunks/606ea251075fe81a1206.js +1 -0
- package/assets/esri/core/workers/chunks/{3ac9dcbb0571a2580236.js → 62c8c9ad09e0166207fd.js} +1 -1
- package/assets/esri/core/workers/chunks/6588725275c75fae0d9c.js +1 -0
- package/assets/esri/core/workers/chunks/{ac4cc49104d26c384e98.js → 658b2642ab6880770e4e.js} +1 -1
- package/assets/esri/core/workers/chunks/68be3fb88ca61f82fb90.js +1 -0
- package/assets/esri/core/workers/chunks/6c9266120d46e8c69dbf.js +1 -0
- package/assets/esri/core/workers/chunks/6ebe73f69ae822053b70.js +1 -0
- package/assets/esri/core/workers/chunks/6ef647b7769d27529f9c.js +1 -0
- package/assets/esri/core/workers/chunks/709e019885822b1f6f3e.js +1 -0
- package/assets/esri/core/workers/chunks/70cc2d79653d66e85b58.js +1 -0
- package/assets/esri/core/workers/chunks/{cbe6c0f32608cb504695.js → 776ae25a34352d3468bc.js} +1 -1
- package/assets/esri/core/workers/chunks/8730e7e6e0296f43f10b.js +1 -0
- package/assets/esri/core/workers/chunks/8bea0d706ede6f84f8aa.js +1 -0
- package/assets/esri/core/workers/chunks/900181f68449d8f82eeb.js +1 -0
- package/assets/esri/core/workers/chunks/939942b00ba380e2957e.js +1 -0
- package/assets/esri/core/workers/chunks/{1ef39aef6b33c530cbe4.js → 966d0832a3c1f03668a0.js} +1 -1
- package/assets/esri/core/workers/chunks/9a28a66807a1e3557018.js +1 -0
- package/assets/esri/core/workers/chunks/{2f9033890c465acff698.js → 9bf48a907f91ea004648.js} +1 -1
- package/assets/esri/core/workers/chunks/9c7fa9d324fa0bf64d9c.js +1 -0
- package/assets/esri/core/workers/chunks/9ce91a909eccc4dfe388.js +1 -0
- package/assets/esri/core/workers/chunks/{1ba1f705b6ce5c8ea702.js → a655ebdb4bf0660615a2.js} +1 -1
- package/assets/esri/core/workers/chunks/ad76f7ab2f3e6d5a5b3c.js +1 -0
- package/assets/esri/core/workers/chunks/af349c7bc8ef41a0e1bd.js +1 -0
- package/assets/esri/core/workers/chunks/{250d3be6d3849d71fed8.js → c29c474c4b1049352d3e.js} +1 -1
- package/assets/esri/core/workers/chunks/c8ba0673d1b87216e619.js +1 -0
- package/assets/esri/core/workers/chunks/{4d3f97a48046021713a6.js → ceb112fe7aef354f8051.js} +1 -1
- package/assets/esri/core/workers/chunks/d6ad4390df576198e45b.js +1 -0
- package/assets/esri/core/workers/chunks/ddf0671976648f621269.js +1 -0
- package/assets/esri/core/workers/chunks/ded8b64a46992c3ae693.js +1 -0
- package/assets/esri/core/workers/chunks/{0b36abcbf03037b4073d.js → e1af43e2a8f2ef1059e3.js} +1 -1
- package/assets/esri/core/workers/chunks/eaf6d587477399a83088.js +1 -0
- package/assets/esri/core/workers/chunks/ecaac39dde7ec4213264.js +1 -0
- package/assets/esri/core/workers/chunks/f122c18af10e56f9ec2b.js +1 -0
- package/assets/esri/core/workers/chunks/f31b424a3667686af10c.js +1 -0
- package/assets/esri/core/workers/chunks/{711cfb84659cb4437679.js → f528ac5c648ca6a98582.js} +1 -1
- package/assets/esri/core/workers/chunks/f92364afaefbac7e8f77.js +1 -0
- package/assets/esri/core/workers/chunks/fb444954be74c1962ced.js +1 -0
- package/assets/esri/core/workers/chunks/fecaf0bc28aeea4d15db.js +1 -0
- package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationSettings.scss +1 -1
- package/assets/esri/themes/base/widgets/_Features.scss +1 -1
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +5 -9
- package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +2 -4
- package/assets/esri/themes/base/widgets/_Tooltip.scss +1 -1
- 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/BatchAttributeForm/t9n/messages.en.json +1 -1
- package/chunks/GlobalIllumination.glsl.js +4 -2
- package/chunks/GlobalIlluminationBlur.glsl.js +3 -5
- package/chunks/GlobalIlluminationUpscale.glsl.js +1 -1
- package/config.js +1 -1
- package/core/colorUtils.js +1 -1
- package/core/has.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/form/elements/inputs/DynamicChoiceInput.d.ts +35 -5
- package/geometry/projectionUtils.js +1 -1
- package/geometry/support/scaleUtils.js +1 -1
- package/kernel.js +1 -1
- package/layers/ParquetLayer.d.ts +3 -2
- package/layers/ParquetLayer.js +1 -1
- package/layers/graphics/data/FeatureStore.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/data/geometryUtils.js +1 -1
- package/layers/graphics/data/projectionSupport.js +1 -1
- package/layers/knowledgeGraph/layerUtils.js +1 -1
- package/layers/knowledgeGraph/nodeMovementUtils.js +1 -1
- package/layers/mixins/ScaleRangeLayer.js +1 -1
- package/layers/mixins/SublayersOwner.js +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/package.json +2 -2
- package/popup/FeaturesModel.d.ts +26 -5
- package/popup/FeaturesModel.js +1 -1
- package/rest/support/printTaskUtils.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/AFeatureTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/types.d.ts +3 -1
- package/views/3d/environment/Environment.d.ts +2 -2
- package/views/3d/environment/Environment.js +1 -1
- package/views/3d/environment/EnvironmentView.js +2 -0
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/support/FeatureTile.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
- package/views/3d/layers/support/SampledGeometryMaxDistanceRatio.js +1 -1
- package/views/3d/support/elevationUpdateUtils.js +1 -1
- package/views/3d/support/popupHitTest.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/WeatherFader.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationColorQuantization.glsl.js +2 -2
- package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/draw/Draw.d.ts +1 -1
- package/views/draw/support/InteractiveHandle.js +1 -1
- package/views/interactive/options/SnappingOptions.d.ts +1 -0
- package/views/interactive/options/TooltipOptions.d.ts +1 -0
- package/views/interactive/options/ViewOptions.d.ts +1 -0
- package/views/interactive/snapping/FeatureSnappingSourceInfo.js +1 -1
- package/views/interactive/support/Units.d.ts +1 -0
- package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
- package/views/interactive/tooltip/components/ElevationModeSelect.js +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +3 -4
- package/views/layers/ViewshedLayerView.d.ts +5 -6
- package/views/support/layerViewUtils.js +1 -1
- package/views/support/projectionUtils.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/DirectionalPad.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor.d.ts +10 -0
- package/widgets/Expand.js +1 -1
- package/widgets/FeatureForm.d.ts +2 -2
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
- package/widgets/Sketch.d.ts +1 -1
- package/widgets/Track/TrackViewModel.d.ts +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
- package/widgets/UtilityNetworkTrace/types.d.ts +2 -2
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
- package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/PluginSettingsControls.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/componentsUtils.js +1 -1
- package/assets/esri/core/workers/chunks/00a600c71ceebe7bfeee.js +0 -1
- package/assets/esri/core/workers/chunks/00d24415bdeb0adae3df.js +0 -1
- package/assets/esri/core/workers/chunks/0193df3f9fb23633da87.js +0 -1
- package/assets/esri/core/workers/chunks/02d4f91652a79d2b637e.js +0 -1
- package/assets/esri/core/workers/chunks/07aa6d36f1006b6ab7ff.js +0 -1
- package/assets/esri/core/workers/chunks/107b025dc5b09465a78f.js +0 -1
- package/assets/esri/core/workers/chunks/1f43e06dcfe56229bb0f.js +0 -1
- package/assets/esri/core/workers/chunks/25d6c674b1c4829f040f.js +0 -1
- package/assets/esri/core/workers/chunks/25e6013e2c095629b236.js +0 -1
- package/assets/esri/core/workers/chunks/2a570ce6b99dac6ee996.js +0 -1
- package/assets/esri/core/workers/chunks/2c90f7a6432cd716db8b.js +0 -1
- package/assets/esri/core/workers/chunks/2e6a2f4d686b71249c0e.js +0 -1
- package/assets/esri/core/workers/chunks/303fde8f3459dde16555.js +0 -1
- package/assets/esri/core/workers/chunks/350540770781b281c39a.js +0 -1
- package/assets/esri/core/workers/chunks/3880d2c7fb14955d7f93.js +0 -1
- package/assets/esri/core/workers/chunks/3b017b718ea2d4ed498f.js +0 -1
- package/assets/esri/core/workers/chunks/43fc42405167a5537039.js +0 -1
- package/assets/esri/core/workers/chunks/4d82db661365daa513a6.js +0 -1
- package/assets/esri/core/workers/chunks/56851011276de0b3e318.js +0 -1
- package/assets/esri/core/workers/chunks/5f3ab77a79c408423fde.js +0 -1
- package/assets/esri/core/workers/chunks/633a9051580c5302d2f7.js +0 -1
- package/assets/esri/core/workers/chunks/6469c0d18d3663e7da4b.js +0 -1
- package/assets/esri/core/workers/chunks/65654e481cce9ae40e54.js +0 -1
- package/assets/esri/core/workers/chunks/669e39c3437d7273f0c7.js +0 -1
- package/assets/esri/core/workers/chunks/798a63653f82c0e842c5.js +0 -1
- package/assets/esri/core/workers/chunks/84fcbf7a1d04f01685d1.js +0 -1
- package/assets/esri/core/workers/chunks/8b54589f173259c1ba55.js +0 -1
- package/assets/esri/core/workers/chunks/8e511079918e2fd9261f.js +0 -1
- package/assets/esri/core/workers/chunks/95b82cbbe355266c65d7.js +0 -1
- package/assets/esri/core/workers/chunks/9673a9efec86040b8c13.js +0 -1
- package/assets/esri/core/workers/chunks/a010d2e4e34eb7bc1fec.js +0 -1
- package/assets/esri/core/workers/chunks/b05a41a60e30935644be.js +0 -1
- package/assets/esri/core/workers/chunks/bff767ec5bb4c0d6b324.js +0 -1
- package/assets/esri/core/workers/chunks/c906f984b2b6e7578c06.js +0 -1
- package/assets/esri/core/workers/chunks/d21257d2e2a37266c0f7.js +0 -1
- package/assets/esri/core/workers/chunks/d270cc9807161033686e.js +0 -1
- package/assets/esri/core/workers/chunks/de02a6a1f4810f99e9bb.js +0 -1
- package/assets/esri/core/workers/chunks/e5943f3a4bbc12c06c4d.js +0 -1
- package/assets/esri/core/workers/chunks/ec9a2425b4a498054a19.js +0 -1
- package/assets/esri/core/workers/chunks/f0a68d2900d24f56afa0.js +0 -1
- package/assets/esri/core/workers/chunks/f0aaa646b17ffdbdcefa.js +0 -1
- package/assets/esri/core/workers/chunks/f46a0d7cf588ba1b4157.js +0 -1
- package/assets/esri/core/workers/chunks/f762f70e7d39634ce797.js +0 -1
- package/assets/esri/core/workers/chunks/fccbb902fe08448f91de.js +0 -1
- package/assets/esri/core/workers/chunks/fd0254c6fc6c03ec11ba.js +0 -1
- package/views/3d/environment/EnvironmentManager.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{MemCachePool as n}from"../../../core/MemCachePool.js";import r from"../../../core/ObjectPool.js";import{watch as i,sync as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{subtract as c,set as l,dot as u}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as d,fromValues as f,create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as m,ZEROS as h}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as g,set as _}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as v}from"../../../geometry/support/buffer/BufferView.js";import{overlayRenderOccludedFlag as y}from"./OverlayRenderer.js";import{PatchRenderData as b}from"./PatchRenderData.js";import{TerrainAttributesCache as x}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as S}from"./terrainUtils.js";import{TileRenderer as C}from"./TileRenderer.js";import{IteratorPreorder as w,fallsWithinLayerView as T,sortTiles as E,compareTiles as D}from"./tileUtils.js";import{getOverlayContentForOutputTerrain as O}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as k}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as A}from"../webgl-engine/lib/Attribute.js";import{IntersectorResultRay as j}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as M,MeshIntersectionOptions as N,intersectTriangles as P}from"../webgl-engine/lib/RayIntersections.js";import{TriangleIntersectionData as F}from"../webgl-engine/lib/TriangleIntersectionData.js";import{terrainId as I,getVerticalOffsetTerrain as L}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as R}from"../webgl-engine/materials/DrawParameters.js";import{hasShadowHighlights as z}from"../webgl-engine/shaders/ReceiveShadowsConfiguration.js";import{T as B}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as V}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as H}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as U}from"../../webgl/enums.js";const W=g();let G=class extends k{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return this._stage.viewingMode===1}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}get renderOccludedFlags(){return this._overlayRenderer.renderOccludedFlags}constructor(e,t,i,a,o){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=i,this._compressionTracker=a,this.type=7,this.isGround=!0,this._passParameters=new B,this._drawParameters=new R,this._renderDataPool=new r(()=>new b),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new w,this._castShadows=!1,this._inViewshed=!1,this._cutFillEnabled=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=[],this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.produces=new Map([[1,()=>this._desiredSlot===1],[7,()=>this._desiredSlot===7],[9,()=>this._produces()&&this.renderOccludedFlags===y]]),this._tileSize=256,this._configuration=new H(t.viewingMode===1),this._tileTextureCache=new n((e,t)=>o.newCache(e,t),`TileTexture`),this.tileGeometryCache=new x(o)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(i(()=>this._overlayRenderer.renderOccludedFlags,()=>this.setNeedsRender(),a))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}set renderingDisabled(e){this._set(`renderingDisabled`,!!e),this.setDirty()}set visible(e){this._set(`visible`,!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange(`renderPatchBorders`))}get layerViewUid(){return I}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,this._tileRenderer!=null&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),!this.reuseTextureFromParent(e)&&this.updateTileTexture(e,32)}reuseTextureFromParent(e){let{parent:t}=e;if(!this._canReuseTextureFromParent(t,e))return!1;let n=m(e.lij[2]&1?.5:0,e.lij[1]&1?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,n)??!1}_canReuseTextureFromParent(e,t){if(!e)return!1;let{layerInfo:n,surface:r}=t;for(let i=0;i<n[1].length;i++){let n=r.layerViewByIndex(i,1);if(T(e,n)!==T(t,n))return!1}return!0}updateTileTexture(e,t){this._tileRenderer!=null&&(this._tileRenderer.updateTileTexture(e,t===32?0:2),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(let t of e.layerInfo[0])t.pendingUpdates&=-9;e.resetPendingUpdate(8);let t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){let t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){let t=Math.max(0,Math.floor((e.level-3)/7)*7);if(this._isGlobal&&t===0)return d;for(;e.parent&&e.level>t;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get(`wireframe`)!==e&&(this._set(`wireframe`,e),this.setNeedsRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new C(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=t(this._tileRenderer)}intersectRay(e,t,n,r){let i=this._rootTiles;if(!i||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==0)return;let a=K,o=q;c(a,r,n),l(o,1/a[0],1/a[1],1/a[2]);let s=e.results.min,d=e.results.max,f=e.results.ground,p=e.options.store===0,m=!!e.results.ground.target,h=L(e.verticalOffset),g=e.tolerance,y,b=p&&s.distance!=null?s.distance:1/0,x=e.options,S=x.normalRequired||!x.backfacesTerrain,C=new N(g,!1,S),w=i=>{let l=i.renderData;if(!l?.vao)return;let m=l.geometry;_(W,m.boundingBox);let w=l.localOrigin;if(h!=null&&(h.localOrigin=w,h.applyToAabb(W)),J[0]=n[0]-w[0],J[1]=n[1]-w[1],J[2]=n[2]-w[2],!M(W,J,o,g,b))return;let T=(e,t,n,r)=>{e.set(this.type,i,t,n,r),b=p&&s.renderDistance!=null?s.renderDistance:1/0},E=(i,o,c)=>{(!S||c!=null)&&o>=0&&(x.backfacesTerrain||u(c,a)<0)&&(x.invisibleTerrain||!x.selectionMode||t==null||t(n,r,o))&&((f.renderDistance==null||o<f.renderDistance)&&T(f,i,o,c),!x.isFiltered&&(x.store===2&&(y==null?(y=new j(e.ray),T(y,i,o,c),e.results.all.push(y)):o<y.renderDistance&&T(y,i,o,c)),(s.renderDistance==null||o<s.renderDistance)&&T(s,i,o,c),x.store!==0&&(d.renderDistance==null||o>d.renderDistance)&&T(d,i,o,c)))},D=Y;c(D,r,w);let{indices:O,indexCount:k}=m,N=m.vertexAttributes,I=N.getField(`position`,v),L=new A(I.typedBuffer,3,N.stride/4),R=k/3;!h&&R>200?(l.intersectionData??=new F(O,R,L),l.intersectionData.intersectRay(J,D,C,E)):P(J,D,0,R,(e,t)=>I.getVec(O[t],e),h,C,E)},T=this._tileIterator;T.reset(i);let E=e.options.invisibleTerrain;for(let e=T.next();e;e=T.next())(e.visible||E&&e.intersectsClippingArea)&&(h!=null||e.intersectsRay(n,a,g,b))&&(!m||!this._useStencilForTile(e))?w(e):T.skipSubtree()}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(let t of this._visiblePatchesByOrigin.values())for(let n of t)n.renderData?.textureReference!=null&&e.queriesForTile(n);e.process(),t.madeProgress()}}get _desiredSlot(){if(!this._produces())return null;switch(this.transparency){case 0:return 1;case 1:case 2:return 7;case 3:case 4:return null}}acquireTechniques(e){let{shadowMap:t,viewshedEnabled:n,cutFillComputationEnabled:r,slot:i,hasEmission:a,useFloatBlend:o}=e.bind,s=!!has(`enable-feature:terrain-shadows`)&&t.enabled;if(s!==this._castShadows&&(this._castShadows=s,this._patchesByOriginDirty=!0),this._inViewshed!==n&&(this._inViewshed=n,this._patchesByOriginDirty=!0),this._cutFillEnabled!==r&&(this._cutFillEnabled=r,this._patchesByOriginDirty=!0),this.transparency===3)return null;if(i===9){if((e.renderOccludedMask&y)===0)return null}else if(i!==this._desiredSlot)return null;let c=this._configuration;switch(c.screenSpaceReflections=c.cloudReflections=c.receiveShadows=c.hasShadowHighlights=c.receiveAmbientOcclusion=c.renderOccluded=c.hasHighlightMixTexture=!1,c.hasEmission=a,c.overlayMode=this._overlayRenderer.mode,c.useFloatBlend=o.value,e.output){case 0:case 1:case 2:{let n=e.bind;c.screenSpaceReflections=n.hasScreenSpaceReflections,c.cloudReflections=n.clouds.data!=null;let r=i===9;return c.receiveShadows=t.ready&&!r,c.hasShadowHighlights=z(c,e.bind),c.renderOccluded=r,c.receiveAmbientOcclusion=!r&&n.ssao!=null,c.receiveGlobalIllumination=!r&&n.globalIlluminationEnabled,this._acquireTechnique(e.output)}case 5:case 7:return this._castShadows?this._acquireTechnique(5):null;case 8:return this._inViewshed?this._acquireTechnique(8):null;case 9:return this._cutFillEnabled?this._acquireTechnique(9):null;case 3:case 4:case 11:return this._acquireTechnique(e.output);case 10:return c.hasHighlightMixTexture=e.bind.highlightMixTexture!=null,this._overlayRenderer.hasHighlights?this._acquireTechnique(10):null}return null}render(e,t){switch(this._updatePatchGroups(),this._passParameters.useStencil=!1,this._passParameters.overlayContent=O(e.output,e.bind),e.output){case 0:case 1:case 2:return this._renderMaterialPass(e,t);case 3:case 4:case 11:return this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);case 10:{let n=e.bind.highlight?.name;n&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(n)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 5:case 7:case 8:case 9:return this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(this._tileRenderer==null)return;let t=this._tileRenderer,n;if(e!=null){let t=e.toUnitRGBA();n=f(t[0]||0,t[1]||0,t[2]||0)}t.setBackground(n),this._allTiles.forAll(e=>t.updateTileTexture(e,0)),this._configuration.tileBlendInput=t.backgroundIsGrid?2:t.backgroundColor==null?0:1,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){let e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(let n of e)E(n,t);e.sort((e,t)=>D(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this.notifyChange(`visibleTiles`),this._patchSortingDirty=!1}}_rebuildPatchGroups(){let e=this._rootTiles;if(e!=null){e[0]?.surface.checkAllTilesWaterproofness(`render-patch-groups`),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(let t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){let t=this._tileIterator;for(t.resetOne(e);!t.done;){let e=t.next(),n=e.renderData;if(!n){this._numTilesCulled++;continue}let r=n.localOrigin;if(this._castShadows||this._inViewshed||this._cutFillEnabled){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let i=this._visiblePatchesByOrigin.get(r);i||(i=[],this._visiblePatchesByOrigin.set(r,i)),i.push(e),t.skipSubtree()}}_useStencilForTile(e){for(let t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,n){let{rctx:r,bind:i}=e;r.bindTechnique(t,i,this._passParameters);let a=this._stencilEnabledLayerExtents.length>0;n.forEach(n=>{this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(i,this._passParameters,this._drawParameters);for(let r=0;r<n.length;r++)this._renderPatch(e,t,n[r],U.TRIANGLES,a,this._passParameters.overlayContent===null)}),r.bindVAO(null)}_renderMaterialPass(e,t){let{rctx:n,bind:r}=e,i=n.bindTechnique(t,r,this._passParameters);this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;let a=r.slot===9;a&&(i.bindTexture(`tex`,n.emptyTexture),i.setUniform3fv(`textureOpacities`,d),i.setUniform4fv(`texOffsetAndScale`,h));let o=this._tileRenderer?.backgroundColor==null?d:this._tileRenderer.backgroundColor;this._configuration.tileBlendInput===1&&i.setUniform3fv(`backgroundColor`,o);let s=this._stencilEnabledLayerExtents.length>0,c=this.wireframe?U.LINES:U.TRIANGLES;this._configuration.textureFadingEnabled&&i.bindTexture(`texNext`,n.emptyTexture);for(let n of this._visiblePatchesByOrigin.values()){this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(let r of n){let n=r.renderData,o=n.textureReference;if(o!=null){if(!a){i.setUniform4fv(`texOffsetAndScale`,o.offsetAndScale),i.bindTexture(`tex`,o.texture.texture);let e=n.textureFadeFactor,t=e<1?n.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(i.setUniform1f(`fadeFactor`,e),i.setUniform4fv(`nextTexOffsetAndScale`,t.offsetAndScale),i.setUniform3fv(`nextTexOpacities`,t.opacities),i.bindTexture(`texNext`,t.texture.texture)):i.setUniform1f(`fadeFactor`,1),n.textureIsFading&&this.setNeedsRender(2),i.setUniform3fv(`textureOpacities`,o.opacities)}this._renderPatch(e,t,r,c,s),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}n.bindVAO(null)}_renderPatch(e,t,n,r,i,a=!1){let o=n.renderData,s=o.vao,c=s?.indexBuffer;if(!s||c==null){S&&console.error(`Rendered tile with no indices: `,n.lij,` : `,o);return}let l=t.program;!a&&!this._overlayRenderer.isEmpty&&this._bindOverlayPatchData(l,o.overlay);let{rctx:u,bind:d}=e;i&&(this._passParameters.useStencil=this._useStencilForTile(n),u.setPipelineState(t.getPipeline(d,this._passParameters)));let f=o.geometry.indexCount;u.bindVAO(s),l.assertCompatibleVertexAttributeLocations(s),u.drawElements(r,f,c.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv(`overlayTexOffset`,t.offsets),e.setUniform4fv(`overlayTexScale`,t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(V,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([o({readOnly:!0})],G.prototype,`visibleTiles`,null),e([o({readOnly:!0})],G.prototype,`_isGlobal`,null),e([o()],G.prototype,`renderOccludedFlags`,null),e([o({value:!1})],G.prototype,`renderingDisabled`,null),e([o({value:!0})],G.prototype,`visible`,null),e([o()],G.prototype,`renderPatchBorders`,null),e([o()],G.prototype,`wireframe`,null),G=e([s(`esri.views.3d.terrain.TerrainRenderer`)],G);const K=p(),q=p(),J=p(),Y=p();export{G as TerrainRenderer};
|
|
2
|
+
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{MemCachePool as n}from"../../../core/MemCachePool.js";import r from"../../../core/ObjectPool.js";import{watch as i,sync as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{subtract as c,set as l,dot as u}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as d,fromValues as f,create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as m,ZEROS as h}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as g,set as _}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as v}from"../../../geometry/support/buffer/BufferView.js";import{overlayRenderOccludedFlag as y}from"./OverlayRenderer.js";import{PatchRenderData as b}from"./PatchRenderData.js";import{TerrainAttributesCache as x}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as S}from"./terrainUtils.js";import{TileRenderer as C}from"./TileRenderer.js";import{IteratorPreorder as w,fallsWithinLayerView as T,sortTiles as E,compareTiles as D}from"./tileUtils.js";import{getOverlayContentForOutputTerrain as O}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as k}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as A}from"../webgl-engine/lib/Attribute.js";import{IntersectorResultRay as j}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as M,MeshIntersectionOptions as N,intersectTriangles as P}from"../webgl-engine/lib/RayIntersections.js";import{TriangleIntersectionData as F}from"../webgl-engine/lib/TriangleIntersectionData.js";import{terrainId as I,getVerticalOffsetTerrain as L}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as R}from"../webgl-engine/materials/DrawParameters.js";import{hasShadowHighlights as z}from"../webgl-engine/shaders/ReceiveShadowsConfiguration.js";import{T as B}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as V}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as H}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as U}from"../../webgl/enums.js";const W=g();let G=class extends k{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return this._stage.viewingMode===1}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}get renderOccludedFlags(){return this._overlayRenderer.renderOccludedFlags}constructor(e,t,i,a,o){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=i,this._compressionTracker=a,this.type=7,this.isGround=!0,this._passParameters=new B,this._drawParameters=new R,this._renderDataPool=new r(()=>new b),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new w,this._castShadows=!1,this._inViewshed=!1,this._cutFillEnabled=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=[],this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.produces=new Map([[1,()=>this._desiredSlot===1],[7,()=>this._desiredSlot===7],[9,()=>this._produces()&&this.renderOccludedFlags===y]]),this._tileSize=256,this._configuration=new H(t.viewingMode===1),this._tileTextureCache=new n((e,t)=>o.newCache(e,t),`TileTexture`),this.tileGeometryCache=new x(o)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(i(()=>this._overlayRenderer.renderOccludedFlags,()=>this.setNeedsRender(),a))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}set renderingDisabled(e){this._set(`renderingDisabled`,!!e),this.setDirty()}set visible(e){this._set(`visible`,!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange(`renderPatchBorders`))}get layerViewUid(){return I}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,this._tileRenderer!=null&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),!this.reuseTextureFromParent(e)&&this.updateTileTexture(e,32)}reuseTextureFromParent(e){let{parent:t}=e;if(!this._canReuseTextureFromParent(t,e))return!1;let n=m(e.lij[2]&1?.5:0,e.lij[1]&1?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,n)??!1}_canReuseTextureFromParent(e,t){if(!e)return!1;let{layerInfo:n,surface:r}=t;for(let i=0;i<n[1].length;i++){let n=r.layerViewByIndex(i,1);if(T(e,n)!==T(t,n))return!1}return!0}updateTileTexture(e,t){this._tileRenderer!=null&&(this._tileRenderer.updateTileTexture(e,t===32?0:2),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(let t of e.layerInfo[0])t.pendingUpdates&=-9;e.resetPendingUpdate(8);let t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){let t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){let t=Math.max(0,Math.floor((e.level-3)/7)*7);if(this._isGlobal&&t===0)return d;for(;e.parent&&e.level>t;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get(`wireframe`)!==e&&(this._set(`wireframe`,e),this.setNeedsRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new C(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=t(this._tileRenderer)}intersectRay(e,t,n,r){let i=this._rootTiles;if(!i||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==0)return;let a=K,o=q;c(a,r,n),l(o,1/a[0],1/a[1],1/a[2]);let s=e.results.min,d=e.results.max,f=e.results.ground,p=e.options.store===0,m=!!e.results.ground.target,h=L(e.verticalOffset),g=e.tolerance,y,b=p&&s.distance!=null?s.distance:1/0,x=e.options,S=x.normalRequired||!x.backfacesTerrain,C=new N(g,!1,S),w=i=>{let l=i.renderData;if(!l?.vao)return;let m=l.geometry;_(W,m.boundingBox);let w=l.localOrigin;if(h!=null&&(h.localOrigin=w,h.applyToAabb(W)),J[0]=n[0]-w[0],J[1]=n[1]-w[1],J[2]=n[2]-w[2],!M(W,J,o,g,b))return;let T=(e,t,n,r)=>{e.set(this.type,i,t,n,r),b=p&&s.renderDistance!=null?s.renderDistance:1/0},E=(i,o,c)=>{(!S||c!=null)&&o>=0&&(x.backfacesTerrain||u(c,a)<0)&&(x.invisibleTerrain||!x.selectionMode||t==null||t(n,r,o))&&((f.renderDistance==null||o<f.renderDistance)&&T(f,i,o,c),!x.isFiltered&&(x.store===2&&(y==null?(y=new j(e.ray),T(y,i,o,c),e.results.all.push(y)):o<y.renderDistance&&T(y,i,o,c)),(s.renderDistance==null||o<s.renderDistance)&&T(s,i,o,c),x.store!==0&&(d.renderDistance==null||o>d.renderDistance)&&T(d,i,o,c)))},D=Y;c(D,r,w);let{indices:O,indexCount:k}=m,N=m.vertexAttributes,I=N.getField(`position`,v),L=new A(I.typedBuffer,3,N.stride/4),R=k/3;!h&&R>200?(l.intersectionData??=new F(O,R,L),l.intersectionData.intersectRay(J,D,C,E)):P(J,D,0,R,(e,t)=>I.getVec(O[t],e),h,C,E)},T=this._tileIterator;T.reset(i);let E=e.options.invisibleTerrain;for(let e=T.next();e;e=T.next())(e.visible||E&&e.intersectsClippingArea)&&(h!=null||e.intersectsRay(n,a,g,b))&&(!m||!this._useStencilForTile(e))?w(e):T.skipSubtree()}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(let t of this._visiblePatchesByOrigin.values())for(let n of t)n.renderData?.textureReference!=null&&e.queriesForTile(n);e.process(),t.madeProgress()}}get _desiredSlot(){if(!this._produces())return null;switch(this.transparency){case 0:return 1;case 1:case 2:return 7;case 3:case 4:return null}}acquireTechniques(e){let{shadowMap:t,viewshedEnabled:n,cutFillComputationEnabled:r,slot:i,hasEmission:a,useFloatBlend:o}=e.bind,s=!!has(`enable-feature:terrain-shadows`)&&t.enabled;if(s!==this._castShadows&&(this._castShadows=s,this._patchesByOriginDirty=!0),this._inViewshed!==n&&(this._inViewshed=n,this._patchesByOriginDirty=!0),this._cutFillEnabled!==r&&(this._cutFillEnabled=r,this._patchesByOriginDirty=!0),this.transparency===3)return null;if(i===9){if((e.renderOccludedMask&y)===0)return null}else if(i!==this._desiredSlot)return null;let c=this._configuration;switch(c.receiveGlobalIllumination=c.screenSpaceReflections=c.cloudReflections=c.receiveShadows=c.hasShadowHighlights=c.receiveAmbientOcclusion=c.renderOccluded=c.hasHighlightMixTexture=!1,c.hasEmission=a,c.overlayMode=this._overlayRenderer.mode,c.useFloatBlend=o.value,e.output){case 0:case 1:case 2:{let n=e.bind;c.screenSpaceReflections=n.hasScreenSpaceReflections,c.cloudReflections=n.clouds.data!=null;let r=i===9;return c.receiveShadows=t.ready&&!r,c.hasShadowHighlights=z(c,e.bind),c.renderOccluded=r,c.receiveAmbientOcclusion=!r&&n.ssao!=null,c.receiveGlobalIllumination=!r&&n.globalIlluminationEnabled,this._acquireTechnique(e.output)}case 5:case 7:return this._castShadows?this._acquireTechnique(5):null;case 8:return this._inViewshed?this._acquireTechnique(8):null;case 9:return this._cutFillEnabled?this._acquireTechnique(9):null;case 3:case 4:case 11:return this._acquireTechnique(e.output);case 10:return c.hasHighlightMixTexture=e.bind.highlightMixTexture!=null,this._overlayRenderer.hasHighlights?this._acquireTechnique(10):null}return null}render(e,t){switch(this._updatePatchGroups(),this._passParameters.useStencil=!1,this._passParameters.overlayContent=O(e.output,e.bind),e.output){case 0:case 1:case 2:return this._renderMaterialPass(e,t);case 3:case 4:case 11:return this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);case 10:{let n=e.bind.highlight?.name;n&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(n)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 5:case 7:case 8:case 9:return this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(this._tileRenderer==null)return;let t=this._tileRenderer,n;if(e!=null){let t=e.toUnitRGBA();n=f(t[0]||0,t[1]||0,t[2]||0)}t.setBackground(n),this._allTiles.forAll(e=>t.updateTileTexture(e,0)),this._configuration.tileBlendInput=t.backgroundIsGrid?2:t.backgroundColor==null?0:1,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){let e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(let n of e)E(n,t);e.sort((e,t)=>D(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this.notifyChange(`visibleTiles`),this._patchSortingDirty=!1}}_rebuildPatchGroups(){let e=this._rootTiles;if(e!=null){e[0]?.surface.checkAllTilesWaterproofness(`render-patch-groups`),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(let t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){let t=this._tileIterator;for(t.resetOne(e);!t.done;){let e=t.next(),n=e.renderData;if(!n){this._numTilesCulled++;continue}let r=n.localOrigin;if(this._castShadows||this._inViewshed||this._cutFillEnabled){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let i=this._visiblePatchesByOrigin.get(r);i||(i=[],this._visiblePatchesByOrigin.set(r,i)),i.push(e),t.skipSubtree()}}_useStencilForTile(e){for(let t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,n){let{rctx:r,bind:i}=e;r.bindTechnique(t,i,this._passParameters);let a=this._stencilEnabledLayerExtents.length>0;n.forEach(n=>{this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(i,this._passParameters,this._drawParameters);for(let r=0;r<n.length;r++)this._renderPatch(e,t,n[r],U.TRIANGLES,a,this._passParameters.overlayContent===null)}),r.bindVAO(null)}_renderMaterialPass(e,t){let{rctx:n,bind:r}=e,i=n.bindTechnique(t,r,this._passParameters);this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;let a=r.slot===9;a&&(i.bindTexture(`tex`,n.emptyTexture),i.setUniform3fv(`textureOpacities`,d),i.setUniform4fv(`texOffsetAndScale`,h));let o=this._tileRenderer?.backgroundColor==null?d:this._tileRenderer.backgroundColor;this._configuration.tileBlendInput===1&&i.setUniform3fv(`backgroundColor`,o);let s=this._stencilEnabledLayerExtents.length>0,c=this.wireframe?U.LINES:U.TRIANGLES;this._configuration.textureFadingEnabled&&i.bindTexture(`texNext`,n.emptyTexture);for(let n of this._visiblePatchesByOrigin.values()){this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(let r of n){let n=r.renderData,o=n.textureReference;if(o!=null){if(!a){i.setUniform4fv(`texOffsetAndScale`,o.offsetAndScale),i.bindTexture(`tex`,o.texture.texture);let e=n.textureFadeFactor,t=e<1?n.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(i.setUniform1f(`fadeFactor`,e),i.setUniform4fv(`nextTexOffsetAndScale`,t.offsetAndScale),i.setUniform3fv(`nextTexOpacities`,t.opacities),i.bindTexture(`texNext`,t.texture.texture)):i.setUniform1f(`fadeFactor`,1),n.textureIsFading&&this.setNeedsRender(2),i.setUniform3fv(`textureOpacities`,o.opacities)}this._renderPatch(e,t,r,c,s),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}n.bindVAO(null)}_renderPatch(e,t,n,r,i,a=!1){let o=n.renderData,s=o.vao,c=s?.indexBuffer;if(!s||c==null){S&&console.error(`Rendered tile with no indices: `,n.lij,` : `,o);return}let l=t.program;!a&&!this._overlayRenderer.isEmpty&&this._bindOverlayPatchData(l,o.overlay);let{rctx:u,bind:d}=e;i&&(this._passParameters.useStencil=this._useStencilForTile(n),u.setPipelineState(t.getPipeline(d,this._passParameters)));let f=o.geometry.indexCount;u.bindVAO(s),l.assertCompatibleVertexAttributeLocations(s),u.drawElements(r,f,c.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv(`overlayTexOffset`,t.offsets),e.setUniform4fv(`overlayTexScale`,t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(V,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([o({readOnly:!0})],G.prototype,`visibleTiles`,null),e([o({readOnly:!0})],G.prototype,`_isGlobal`,null),e([o()],G.prototype,`renderOccludedFlags`,null),e([o({value:!1})],G.prototype,`renderingDisabled`,null),e([o({value:!0})],G.prototype,`visible`,null),e([o()],G.prototype,`renderPatchBorders`,null),e([o()],G.prototype,`wireframe`,null),G=e([s(`esri.views.3d.terrain.TerrainRenderer`)],G);const K=p(),q=p(),J=p(),Y=p();export{G as TerrainRenderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,sync as i}from"../../../../core/reactiveUtils.js";import{signal as a}from"../../../../core/signal.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{cloudPresets as c}from"./clouds/CloudsPresets.js";import{CloudsRenderer as l}from"./clouds/CloudsRenderer.js";import{Precipitation as u}from"./precipitation/Precipitation.js";let d=class extends t{constructor(e){super(e),this._clouds=a(null),this._incarnation=0,this._precipitation=null}initialize(){let e=()=>this._requestRender();this.addHandles([r(()=>this._precipitation,e,i),r(()=>this._clouds.value?.state,e,i),r(()=>this.view.state.mode,e,i),r(()=>this.view.state.stationary&&!!this.context.bind.clouds.data&&this.context.bind.clouds.needsStationaryAnchorUpdate(this.view.state.camera),t=>{t&&e()},i),r(()=>this._updateClouds(),e,i),r(()=>this._updatePrecipitation(),e,i),r(()=>this.weather,e=>this._initWeather(e))])}destroy(){this.removeHandles(),this._clouds.value=n(this._clouds.value),this._precipitation=null,this._precipitationOutgoing=null}get readyToRun(){return!!this._clouds.value?.readyToRun||this.view.state.stationary&&!!this.context.bind.clouds.data&&this.context.bind.clouds.needsStationaryAnchorUpdate(this.view.state.camera)}get usedMemory(){return this._clouds.value?.usedMemory??0}_fadeOutPrecipitation(){this._precipitation&&(this._precipitationOutgoing?.destroy(),this._precipitationOutgoing=this._precipitation,this._precipitationOutgoing.fadeOut(()=>this._precipitationOutgoing=n(this._precipitationOutgoing)),this._precipitation=null,++this._incarnation)}get snowCover(){return this._precipitationOutgoing?.snowCover??this._precipitation?.snowCover??0}
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,sync as i}from"../../../../core/reactiveUtils.js";import{signal as a}from"../../../../core/signal.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{cloudPresets as c}from"./clouds/CloudsPresets.js";import{CloudsRenderer as l}from"./clouds/CloudsRenderer.js";import{Precipitation as u}from"./precipitation/Precipitation.js";let d=class extends t{constructor(e){super(e),this._clouds=a(null),this._incarnation=0,this._precipitation=null}initialize(){let e=()=>this._requestRender();this.addHandles([r(()=>this._precipitation,e,i),r(()=>this._clouds.value?.state,e,i),r(()=>this.view.state.mode,e,i),r(()=>this.view.state.stationary&&!!this.context.bind.clouds.data&&this.context.bind.clouds.needsStationaryAnchorUpdate(this.view.state.camera),t=>{t&&e()},i),r(()=>this._updateClouds(),e,i),r(()=>this._updatePrecipitation(),e,i),r(()=>this.view.environmentView.weatherEnabled?this.view.environment.weather:null,e=>this._initWeather(e))])}destroy(){this.removeHandles(),this._clouds.value=n(this._clouds.value),this._precipitation=null,this._precipitationOutgoing=null}get readyToRun(){return!!this._clouds.value?.readyToRun||this.view.state.stationary&&!!this.context.bind.clouds.data&&this.context.bind.clouds.needsStationaryAnchorUpdate(this.view.state.camera)}get usedMemory(){return this._clouds.value?.usedMemory??0}_fadeOutPrecipitation(){this._precipitation&&(this._precipitationOutgoing?.destroy(),this._precipitationOutgoing=this._precipitation,this._precipitationOutgoing.fadeOut(()=>this._precipitationOutgoing=n(this._precipitationOutgoing)),this._precipitation=null,++this._incarnation)}get snowCover(){return this._precipitationOutgoing?.snowCover??this._precipitation?.snowCover??0}cleanupCubemap(){let e=this._clouds.value;e?.state===0&&e.coverage===0&&!e.readyToRun&&e.destroyCubeMap()}_requestRender(){this.view.stage.renderView.requestRender()}_initWeather(e){!e||!this.context?this._clouds.value=n(this._clouds.value):this._clouds.value||(this._clouds.value=new l({context:this.context,view:this.view,requestRender:()=>this._requestRender()}))}_updateClouds(){let e=this.view.environment.weather;return e==null||this._clouds.value==null||this._clouds.value.applyPreset(c[e.type],f(e)),++this._incarnation}_updatePrecipitation(){let e=this.view.environment.weather;return e.type===this._precipitation?.type||(this._fadeOutPrecipitation(),(e.type===`rainy`||e.type===`snowy`)&&(this._precipitation=new u({view:this.view,type:e.type}),++this._incarnation)),this._incarnation}get test(){}};e([o({constructOnly:!0})],d.prototype,`view`,void 0),e([o({constructOnly:!0})],d.prototype,`context`,void 0),d=e([s(`esri.views.3d.webgl-engine.effects.WeatherFader`)],d);function f(e){switch(e.type){case`rainy`:case`snowy`:case`cloudy`:case`sunny`:return e.cloudCover;case`foggy`:return e.fogStrength}}export{d as WeatherFader};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as n,initial as r}from"../../../../../core/reactiveUtils.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{PBRDefaultConfiguration as a}from"../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{OpaqueEnvironment as o}from"../OpaqueEnvironment.js";import{CloudsCompositionTechnique as s}from"./CloudsCompositionTechnique.js";import{createQuadVAO as c}from"../../lib/glUtil3D.js";import{ColorAttachment0 as l,PrimitiveType as u}from"../../../../webgl/enums.js";import{noParameters as d}from"../../../../webgl/NoParameters.js";let f=class extends o{constructor(){super(...arguments),this._configuration=new a}initialize(){this.addHandles([n(()=>this.view.
|
|
2
|
+
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as n,initial as r}from"../../../../../core/reactiveUtils.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{PBRDefaultConfiguration as a}from"../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{OpaqueEnvironment as o}from"../OpaqueEnvironment.js";import{CloudsCompositionTechnique as s}from"./CloudsCompositionTechnique.js";import{createQuadVAO as c}from"../../lib/glUtil3D.js";import{ColorAttachment0 as l,PrimitiveType as u}from"../../../../webgl/enums.js";import{noParameters as d}from"../../../../webgl/NoParameters.js";let f=class extends o{constructor(){super(...arguments),this._configuration=new a}initialize(){this.addHandles([n(()=>this.view.environmentView.weatherEnabled,e=>e?this._enable():this._disable(),r)])}destroy(){this._vao=t(this._vao)}render(){let e=this.input,t=this.bindParameters.clouds;if(!t.data)return e;let n=this.techniques.getCompiled(s,this._configuration);if(!n)return this.requestRender(1),e;let r=this.renderingContext;this._vao??=c(r);let i=r.bindTechnique(n,this.bindParameters,d);return r.setDrawBuffers([l]),r.bindVAO(this._vao),i.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(u.TRIANGLE_STRIP,0,4),t.isFading&&this.requestRender(2),e}};f=e([i(`esri.views.3d.webgl-engine.effects.clouds.CloudsComposition`)],f);export{f as CloudsComposition};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{smoothstep as t,lerp as n}from"../../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{signal as o}from"../../../../../core/signal.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{add as c,normalize as l,length as u,dot as d,scale as f,lerp as p}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m,fromValues as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as g}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{heightLimit as _}from"../../../environment/weather.js";import{betaRayleigh as v,betaCombined as y}from"../atmosphere/atmosphereUtils.js";import{F as b}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as x}from"./FogTechnique.js";import{BlurEmission as S}from"../glow/BlurEmission.js";import{EmissiveTechniqueConfiguration as C}from"../../shaders/EmissiveTechniqueConfiguration.js";import{floatBlendReductionFactor as w}from"../../shaders/floatBlendScale.glsl.js";import{ColorAttachment1 as T,SizedPixelFormat as E,ColorAttachment0 as D,DepthStencilAttachment as O}from"../../../../webgl/enums.js";const k=.9*_,A=1.1*_;let j=class extends S{constructor(){super(...arguments),this._configuration=new C,this._newParameters=new M,this._oldParameters=new M,this._fadedParameters=new M,this._parameters=this._newParameters,this._passParameters=new b}initialize(){this.addHandles([i(()=>this.view.
|
|
2
|
+
import{__decorate as e}from"tslib";import{smoothstep as t,lerp as n}from"../../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{signal as o}from"../../../../../core/signal.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{add as c,normalize as l,length as u,dot as d,scale as f,lerp as p}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m,fromValues as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as g}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{heightLimit as _}from"../../../environment/weather.js";import{betaRayleigh as v,betaCombined as y}from"../atmosphere/atmosphereUtils.js";import{F as b}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as x}from"./FogTechnique.js";import{BlurEmission as S}from"../glow/BlurEmission.js";import{EmissiveTechniqueConfiguration as C}from"../../shaders/EmissiveTechniqueConfiguration.js";import{floatBlendReductionFactor as w}from"../../shaders/floatBlendScale.glsl.js";import{ColorAttachment1 as T,SizedPixelFormat as E,ColorAttachment0 as D,DepthStencilAttachment as O}from"../../../../webgl/enums.js";const k=.9*_,A=1.1*_;let j=class extends S{constructor(){super(...arguments),this._configuration=new C,this._newParameters=new M,this._oldParameters=new M,this._fadedParameters=new M,this._parameters=this._newParameters,this._passParameters=new b}initialize(){this.addHandles([i(()=>this.view.environmentView.weather!=null,e=>e?this._enable():this._disable(),a),i(()=>this._updateFogParameters(),()=>{},a),i(()=>this._fadeFactor,e=>this._fade(e),a)])}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){let{_newParameters:t,_oldParameters:n}=this;e>=1?(this._parameters=t,this._oldParameters.copy(this._newParameters)):e<=0?this._parameters=n:(this._fadedParameters.lerp(n,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){let{weather:e}=this.view.environmentView,t=e?.type===`foggy`||e?.type===`snowy`||e?.type===`rainy`;this._newParameters.strength.value=e?.scattering??0,this._newParameters.amount.value=+!!t,(e?.type===`foggy`||e?.type===`snowy`)&&(this._newParameters.fogBrightness=z),e?.type===`rainy`&&(this._newParameters.fogBrightness=R),this._fadeFactor>=1&&this._oldParameters.copy(this._newParameters),this.requestRender(2)}get strength(){return this._parameters.strength.value*this._heightFade}get amount(){return this._parameters.amount.value*this._heightFade}get _heightFade(){let e=u(this.bindParameters.camera.eye);return 1-t(k,A,Math.abs(e-this._ellipsoid.radius))}precompile(){this._update(),this._passParameters.amount>0&&(super.precompile(),this.techniques.precompile(x,this._configuration))}get _needsEmissionBlur(){return this._configuration.hasEmissive}render(){let e=this.input,t=this._getTechnique();if(!t)return e;this._passParameters.emission=e.obtainAttachment(T),this._passParameters.inputScale=this._passParameters.emission?.attachment.descriptor.internalFormat===E.RGBA8?w:1;let n=this.renderingContext;this._passParameters.emission&&(this._renderEmissionMipMap(),this._configuration.useFloatBlend?(e.acquireColor(T,8,`emissive`),n.clearBuffer(1,g)):(this._passParameters.color=e.obtainAttachment(D),e.acquireColor(D,5),e.acquireColor(T,8,`emissive`)));let i=e.getAttachment(O);return e.attachDepth(null),n.bindFramebuffer(e.fbo),n.bindTechnique(t,this.bindParameters,this._passParameters),n.screen.draw(),this._passParameters.color=r(this._passParameters.color),this._passParameters.emission=r(this._passParameters.emission),this._passParameters.mipmapTexture=r(this._passParameters.mipmapTexture),e.attachDepth(i),this.fboCache.debugCallback?.(`fog-color`,e.fbo),e}_getTechnique(){return this.renders?this.techniques.get(x,this._configuration):null}get renders(){return this._update(),this._passParameters.amount>0}_update(){let e=this.bindParameters.camera;l(N,e.eye);let t=Math.max(0,d(N,this.bindParameters.lighting.mainLight.direction)),n=this._parameters.fogBrightness;f(this._passParameters.fogColor,I,n),f(P,I,n*.1),p(this._passParameters.fogColor,P,this._passParameters.fogColor,t);let r=u(e.eye);this._passParameters.atmosphereC=r**2-this._atmosphereRadius**2,this._passParameters.amount=this.amount,this._passParameters.strength=this._passParameters.scattering=this.strength,this._configuration.hasEmissive=this.bindParameters.hasEmission,this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value}get test(){return{parameters:this._passParameters}}};j=e([s(`esri.views.3d.webgl-engine.effects.fog.Fog`)],j);class M{constructor(){this.fogBrightness=0,this.strength=o(0),this.amount=o(0)}copy(e){this.fogBrightness=e.fogBrightness,this.strength.value=e.strength.value,this.amount.value=e.amount.value}lerp(e,t,r){this.fogBrightness=n(e.fogBrightness,t.fogBrightness,r),this.strength.value=n(e.strength.value,t.strength.value,r),this.amount.value=n(e.amount.value,t.amount.value,r)}}const N=m(),P=m(),F=h(3e-4,3e-4,3e-4),I=m();c(I,y,v),c(I,I,F),l(I,I);const L=I.reduce((e,t)=>e+t,0)/3,R=.5/L,z=1.5/L;export{j as Fog,M as FogParameters};
|
package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationColorQuantization.glsl.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
2
|
import{glsl as e}from"../../core/shaderModules/glsl.js";function t(t){t.code.add(e`
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
vec4 quantizeGlobalIlluminationColor(vec4 color) {
|
|
4
|
+
vec4 clampedColor = clamp(color, vec4(0.0), vec4(1.0));
|
|
5
5
|
return floor(clampedColor * ${e.float(255)} + 0.5) * ${e.float(1/255)};
|
|
6
6
|
}
|
|
7
7
|
`)}export{t as GlobalIlluminationColorQuantization};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../core/maybe.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{length as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{RenderNodeOutput as s}from"../../webgl.js";import{BlurEmission as c}from"../effects/glow/BlurEmission.js";import{E as l,a as u}from"../../../../chunks/EmissionComposite.glsl.js";import{EmissionCompositeTechnique as d}from"./EmissionCompositeTechnique.js";import{ColorAttachment1 as f,ColorAttachment0 as p}from"../../../webgl/enums.js";let m=class extends c{constructor(){super(...arguments),this.produces=s.COMPOSITE,this.consumes={required:[s.COMPOSITE]},this._configuration=new l,this._passParameters=new u}initialize(){this.addHandles([n(()=>this.bindParameters.emissions!==0,e=>this.produces=e?s.COMPOSITE:`disabled`,r)])}precompile(){this.bindParameters.emissions!==0&&(this._configuration.applyBlur=!this.view.stage.renderView.fog?.renders&&this._hasBlur,super.precompile(),this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value,this.techniques.precompile(d,this._configuration))}get _needsEmissionBlur(){return this._configuration.applyBlur}render(){let e=this.input,n=e.getAttachment(f);if(!n?.attachment)return e;let r=o(this.bindParameters.camera.eye);this._passParameters.atmosphereC=r**2-this._atmosphereRadius**2,this._passParameters.color=e.getAttachment(p)?.attachment,this._passParameters.emission=n,this._passParameters.scattering=this._configuration.applyBlur&&this.view.
|
|
2
|
+
import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../core/maybe.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{length as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{RenderNodeOutput as s}from"../../webgl.js";import{BlurEmission as c}from"../effects/glow/BlurEmission.js";import{E as l,a as u}from"../../../../chunks/EmissionComposite.glsl.js";import{EmissionCompositeTechnique as d}from"./EmissionCompositeTechnique.js";import{ColorAttachment1 as f,ColorAttachment0 as p}from"../../../webgl/enums.js";let m=class extends c{constructor(){super(...arguments),this.produces=s.COMPOSITE,this.consumes={required:[s.COMPOSITE]},this._configuration=new l,this._passParameters=new u}initialize(){this.addHandles([n(()=>this.bindParameters.emissions!==0,e=>this.produces=e?s.COMPOSITE:`disabled`,r)])}precompile(){this.bindParameters.emissions!==0&&(this._configuration.applyBlur=!this.view.stage.renderView.fog?.renders&&this._hasBlur,super.precompile(),this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value,this.techniques.precompile(d,this._configuration))}get _needsEmissionBlur(){return this._configuration.applyBlur}render(){let e=this.input,n=e.getAttachment(f);if(!n?.attachment)return e;let r=o(this.bindParameters.camera.eye);this._passParameters.atmosphereC=r**2-this._atmosphereRadius**2,this._passParameters.color=e.getAttachment(p)?.attachment,this._passParameters.emission=n,this._passParameters.scattering=this._configuration.applyBlur&&this.view.environmentView.weather?this.view.stage.renderView.fog?.strength??this.view.environment.weather.scattering:0,this._configuration.applyBlur&&this._renderEmissionMipMap();let i=this.renderingContext,a=this.techniques.get(d,this._configuration),s=this.acquireOutputFramebuffer();return i.clear(16384),i.bindTechnique(a,this.bindParameters,this._passParameters),i.screen.draw(),this._passParameters.mipmapTexture=t(this._passParameters.mipmapTexture),s.moveAttachments(e),s}};e([i()],m.prototype,`produces`,void 0),e([i()],m.prototype,`consumes`,void 0),m=e([a(`esri.views.3d.webgl-engine.lib.EmissionComposite`)],m);export{m as EmissionComposite};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as n}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as r,abortMaybe as i,destroyMaybe as a,releaseMaybe as o,releaseReferencedMaybe as s}from"../../../../core/maybe.js";import{throwIfAborted as c}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as u,initial as d,sync as f}from"../../../../core/reactiveUtils.js";import{signal as p}from"../../../../core/signal.js";import{property as m,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{equals as g,invert as _,multiply as v,copy as y}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as x}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as ee}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as te,ZEROS as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as ne}from"../../../../geometry/support/Indices.js";import{InternalRenderCategory as C,RenderNodeOutput as w,AllRenderNodeOutputs as T,AllInternalRenderNodeOutputs as E}from"../../webgl.js";import{minNearDistanceInMeters as re}from"../../state/NearFarHeuristic.js";import{debugFlags as ie}from"../../support/debugFlags.js";import{FBOCache as ae}from"../core/FBOCache.js";import{RenderPassManager as oe}from"../core/renderPasses/RenderPassManager.js";import{isColor as se}from"../core/shaderLibrary/ShaderOutput.js";import{RenderNodes as ce}from"../effects/RenderNodes.js";import{RenderPluginManager as le}from"../effects/RenderPluginManager.js";import{WeatherFader as ue}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as de}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as fe}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as pe,renderHighlightBuffer as D}from"../effects/highlight/Highlight.js";import{OITBlend as me}from"../effects/transparency/OITBlend.js";import{AnimationTimer as he}from"./AnimationTimer.js";import{AnimationTimeStep as ge}from"./AnimationTimeStep.js";import{BoundingInfo as _e}from"./BoundingInfo.js";import{Compositor as ve}from"./Compositor.js";import{DepthRange as O}from"./DepthRange.js";import{depthRangeFromScene as k}from"./depthRangeUtils.js";import{MainFramebuffer as ye}from"./MainFramebuffer.js";import{NavigationDepthCache as be}from"./NavigationDepthCache.js";import{blendingColorAlphaClear as A}from"./OrderIndependentTransparency.js";import{RenderContext as j,defaultRenderOccludedMask as M}from"./RenderContext.js";import{RendererBase as N}from"./RendererBase.js";import{setupFeatureDefaults as P}from"./RenderFeature.js";import{RenderPluginInput as xe}from"./RenderPluginInput.js";import{ShadowMap as Se}from"./ShadowMap.js";import Ce from"./SliceHelper.js";import{MergedRenderer as we}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as F}from"../parts/renderUtils.js";import{RendererPerformanceInfo as Te,PerformanceCategory as I}from"../statistics/RendererPerformanceInfo.js";import{PixelType as Ee,ColorAttachment0 as L,ColorAttachment1 as R,ColorAttachment2 as z,DrawBufferNone as De}from"../../../webgl/enums.js";const Oe=has(`disable-feature:async-navigation-3d-depth-readback`);let B=class extends N{constructor(e,t,n,r,i){super({stage:e}),this._techniques=n,this._rctx=r,this._requestRender=i,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new oe,this._isRendering=!1,this._backgroundColor=te(0,0,0,1),this._sliceHelper=new Ce,this._shadowAccumulator=null,this._shadowCastOptions=null,this.sceneDepthRange=p(O.Infinite),this._state=p(2),this._hasAnimations=!1,this._animationTimestep=new ge,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=p(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new xe,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(let t of je)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new ae(r),this._compositor=new ve(r,n),this._renderStateFeatures=p(P(e.view.qualityProfile));let a=new Se(this._fboCache,e.viewingMode);this._renderContext=new j(this._rctx,a,n),this._framebuffer=new ye(this._fboCache,this._bindParameters),this._performanceInfo=new Te(this._rctx),this._blit=new fe(n),this.navigationDepthCache=new be(this._rctx,this._fboCache,n,()=>this._requestRender(0)),this._nodes=new ce(this._renderContext),this._plugins=new le({renderContext:this._renderContext,techniques:n,materials:t,requestRender:i,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new ue({view:e.view,context:this._renderContext}),this.addHandles([l(()=>e.view.state.camera,()=>i(),u),l(()=>ie.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},i()},d),l(()=>e.view.environment.background?.color,e=>{let t=e?e.toUnitRGBA():S;ee(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),i()},u),l(()=>e.view.environmentManager.shadowsAvailable,e=>{this._bindParameters.shadowMap.enabled=e,this._requestRender(1)},u),l(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},f),l(()=>this._bindParameters.clouds.data?.state,()=>i(),f),l(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,i()},d),l(()=>e.view.environment.lighting?.type===`sun`,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},u)])}destroy(){this._gpuTimerHandle=r(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator=null,this._shadowCastOptions=null,this._loadEdgeViewTask=i(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,_e.prune(),we.prune(),ne()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new me(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=P(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,n){this.isFeatureEnabled(e,t)!==n&&(this._renderStateFeatures.mutate(r=>r.set(t,e,n)),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(C.AMBIENT_ILLUMINATION)}get hasGlobalIllumination(){return this.stage.renderView?.globalIllumination?.enabled??!1}get hasGlobalIlluminationHighQuality(){let e=this.stage.renderView?.globalIllumination;return this.hasGlobalIllumination&&e?.hasHighQuality===!0}get hasSMAA(){return this.isFeatureEnabled(0)}get _emissions(){let e=this._plugins.emissions;return this._hasTransparentGeometry?e:+(e===1||e===3)}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=o(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose();let e=this._bindParameters;e.globalIllumination=o(e.globalIllumination),e.reprojection.lastFrameDepth=o(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=o(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||=n(async e=>{let{EdgeView:t}=await import(`./edgeRendering/EdgeView.js`);c(e);let n=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:Me(this.stage.view.resourceController)});return this.addHandles(l(()=>n.updating,()=>this._requestRender(),f)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(n)),this._edgeViewCallbacks.length=0,n}),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView().catch(()=>{}),this._edgeView==null?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&g(this._bindParameters.reprojection.matrix,b)}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):!1}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&&!!(this.plugins.renderOccludedFlags&8)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){let has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...q),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new he(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);let n=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==n&&(this._gpuTimerHandle=n?r(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,n=!1){try{return this._isRendering=!0,this._render(e,t,n)}catch(e){console.error(`Exception during rendering: ${e}:\n${e.stack}`)}finally{this._isRendering=!1}return new F(this._pluginInput.get(w.FINAL),null)}_render(e,t,n){let r=t===0;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r,this._disposeBindBuffers();let{camera:i,contentCamera:a,mode:c,alignPixelEnabled:l}=e;this._state.value=c,this._bindParameters.frameRendererTarget=t,this._bindParameters.output=0,this._bindParameters.emissions=this._emissions,this._bindParameters.alignPixelEnabled=l,this._bindParameters.metersPerRenderUnit=this.stage.view.renderCoordsHelper.unitInMeters,this._bindParameters.decorations=!n,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;let u=!n||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=u?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(C.VIEWSHED),this._bindParameters.laserlinesEnabled=this._nodes.produces(C.LASERLINES),this._bindParameters.shadowAnalysisEnabled=!!this._shadowAccumulator?.active,this._bindParameters.cutFillComputationEnabled=this._nodes.produces(C.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(C.CUTFILL),this._ensureBindParameters(i,a),this._plugins.sortTestsTransparentOrderedSlots(J),this._plugins.prepareRender(),this._hasTransparentGeometry=this._plugins.produces(1,...H),this._renderOverlay(),i.setGLViewport(this._rctx);let d=this._framebuffer,f=d.initialize(i.fullWidth,i.fullHeight,this._backgroundColor),p=this._needsLastFrameColor;p?(f?.retain(p-1),f?.setName(`last frame color`),this._bindParameters.reprojection.lastFrameColor?.release(),this._bindParameters.reprojection.lastFrameColor=f):f?.release(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!n,this._precompilePrepasses(),this.performanceInfo.advance(I.PREPARE);let m=this._computeShadowDepthRange(i);this._pluginInput.set(`normals`,this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(i,a,this._bindParameters.lighting.mainLight.direction,m),this._renderShadowAccumulation(m),d.bind(),this._bindParameters.mainDepth=d.depth.attachment,this._precompileShaders(r),this._bindParameters.output=0,this._renderOpaque(),this._renderPreTransparent(),this._renderTransparent(),this._3dGeometryRendered(),d.update(e=>this._renderNodes(C.CUTFILL_COMPUTATION,e)),this._pluginInput.set(C.FOCUSAREA_MASK,this._renderFocusAreaMask()),d.update(e=>this._renderNodes(C.TRANSPARENT_ENVIRONMENT,e)),d.update(e=>this._renderNodes(C.VIEWSHED,e)),d.update(e=>this._renderNodes(C.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=s(this._bindParameters.depth)),d.update(e=>this._renderNodes(C.FOCUSAREA,e)),this._pluginInput.release(C.FOCUSAREA_MASK),d.update(e=>this._renderNodes(C.CUTFILL,e)),this._pluginInput.release(C.GROUND_DEPTH),d.update(e=>this._renderNodes(C.OCCLUDED,e)),this._pluginInput.set(`highlights`,this._renderHighlightPrepass());let h=t===2?this._renderObjectAndLayerIdColor():null;d.update(e=>this._renderNodes(w.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=o(this._bindParameters.shadowHighlight),d.update(e=>this._renderNodes(C.ANTIALIASING,e));let g=this._hasTransparentGeometry?2:1,_=this._bindParameters.emissions;this._bindParameters.emissions=0,this._hasHUDHighlights&&d.update(e=>this._renderHUD(g,e)),d.update(e=>this._renderNodes(C.HIGHLIGHT,e)),this._hasHUDHighlights||d.update(e=>this._renderHUD(g,e)),this._bindParameters.emissions=_,d.update(e=>this._renderNodes(C.MAGNIFIER,e)),d.update(e=>this._renderNodes(w.FINAL,e)),r&&(this._blit.toFramebuffer(d.color,this._bindParameters),!Oe&&(c===2||c===0)&&this.navigationDepthCache.update(this._bindParameters,d.depth.attachment,this._renderContext.time)),this._bindParameters.reprojection.lastFrameDepth?.release(),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=s(this._bindParameters.depth)),this._releaseFBOs(),d.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd();let v;return r||(v=d.color,v.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new F(v,h)}_precompileShaders(e){++this._plugins.context.techniques.precompiling;let t=this._bindParameters;t.output=0;let n=t.emissions;if(this._precompileOpaqueGeometry(),this._nodes.precompile(C.OPAQUE_ENVIRONMENT,C.GAUSSIAN_SPLAT,C.OPAQUE_OCCLUSION_QUERY,C.VOXEL),this._precompileOpaqueGeometry(),t.output=3,this._plugins.precompile(...U),t.output=0,this._plugins.precompile(...U),this._hasTransparentGeometry){let 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(C.FOCUSAREA_MASK),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,t),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(C.TRANSPARENT_ENVIRONMENT,C.VIEWSHED,C.CUTFILL_COMPUTATION,C.CUTFILL,C.LASERLINES,C.FOCUSAREA,C.OCCLUDED,C.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=n,this._hasHighlights&&(t.highlights.forEach((e,n)=>{t.highlightLevel=n,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(C.HIGHLIGHT)),t.highlightMixTexture=null,this._nodes.precompile(w.COMPOSITE,C.MAGNIFIER),this._nodes.precompile(C.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(){let e=this._nodes.produce(C.FOCUSAREA_MASK,this._pluginInput);return e&&this.performanceInfo.advance(I.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces(C.OBJECT_AND_LAYER_ID_COLOR))return null;let e=this._bindParameters.output;++this._techniques.precompiling;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,C.OBJECT_AND_LAYER_ID_COLOR).acquireDepth(14);return r=this._renderNodes(C.OBJECT_AND_LAYER_ID_COLOR,r),--this._techniques.precompiling,this._bindParameters.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();let t=this.performanceInfo.gpuSamplingEnabled,n=e===0,r=n?this.performanceInfo.elapsedTime:0;if(n||t){let e=0;t?e=this.performanceInfo.totalGPUTimeSampler.last:(this._rctx.gl.finish(),e=this.performanceInfo.elapsedTime);let i=Math.max(r,e);this._animationTimestep.frame(i,n)}}readAccumulatedShadow(e){return this._shadowAccumulator?.readAccumulatedShadow(e[0],e[1])??0}readMainDepth(e,t){let{mainDepth:n,camera:r}=this._bindParameters;if(!n)return;let i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,`linear depth`);this._rctx.bindFramebuffer(i.fbo),r.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(S),this._compositor.blitDepthToLinearDepth(this._bindParameters,n),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),i.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,Ee.UNSIGNED_BYTE,t),i.release()}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){let t=this._needsEdges;if(!t)return;let{width:n,height:r}=this._framebuffer.size,i=this.fboCache.acquire(n,r,`edges`);i.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(S),t.render(this._bindParameters,e),i.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===1?I.OPAQUE_EDGES:I.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(I.OVERLAY)}_renderShadowMap(e,t,n,r){if(!this.shadowsEnabled)return;let i=this._bindParameters.shadowMap;if(i.start(e,n,r,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,i),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);let n=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(C.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=n,i.disposeOutput(6),i.clear(),this._renderShadowCascades(7,i)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=s(this._bindParameters.depth)),this.performanceInfo.advance(C.SHADOWMAP)}_precompileShadowCascades(e){this._bindParameters.shadowMap.cascades.length!==0&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){let n=this._bindParameters.output,r=e!==6;t.bindFramebuffer();for(let n of t.cascades)n.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(n.camera,n.camera),this.renderAllGeometry(e),r&&this._renderShadowNodes(t.renderTarget);t.finish(e),this._bindParameters.output=n}_renderShadowNodes(e){this._renderInternalNodeCategory(C.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(){let e=this._bindParameters;e.depth=o(this._bindParameters.depth);let t=this._pluginInput.get(`normals`);if(t){let n=this._nodes.produce(C.AMBIENT_ILLUMINATION,this._pluginInput);this._pluginInput.set(C.AMBIENT_ILLUMINATION,n),this._releaseGlobalIlluminationBuffers(),e.ssao=this.hasGlobalIllumination?null:n,e.globalIllumination=this.hasGlobalIllumination?n:null,e.globalIlluminationEnabled=e.globalIllumination!=null,n&&this.performanceInfo.advance(this.hasGlobalIlluminationHighQuality?I.AMBIENT_ILLUMINATION_HIGH_QUALITY:I.AMBIENT_ILLUMINATION);let r=this._needsDepth;if(r){let n=t.obtainAttachment(L);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),e.depth=t.obtainDepthTexture(),e.depth?.retain(r-1),t.attachColor(n,L),n?.release(),this.performanceInfo.advance(I.DEPTH)}else t.detachDepth();this.hasAmbientIllumination&&this._pluginInput.release(`normals`)}else this._releaseGlobalIlluminationBuffers(),e.ssao=null,this._pluginInput.set(C.AMBIENT_ILLUMINATION,null),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){let e=this._needsDepth;if(e===0)return;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,`geometry depth`,14);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._renderGaussianSplatPrepassDepth(r),this._bindParameters.depth=r.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),r.release(),this.performanceInfo.advance(I.DEPTH)}_renderGaussianSplatPrepassDepth(e){let t=this._shadowAccumulator;if(!t?.active||!t.requireGeometryDepth)return;let n=this._bindParameters.output;this._bindParameters.output=3,this._renderInternalNodeCategory(C.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=n}_renderGaussianSplatDepthAndNormals(e){let t=this._bindParameters.output;this._bindParameters.output=4,this._renderInternalNodeCategory(C.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=t}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||!!this._shadowAccumulator?.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return O.Zero;let t=k(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.union(this._nodes.queryDepthRange(C.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||(this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<de){this.sceneDepthRange.value=O.Infinite;return}let t=e.clone();t.near=re,t.far=1e10;let n=k(t,this._plugins.plugins,this.stage.layers,1);n.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(n)||(this.sceneDepthRange.value=n)}get _normalsRequired(){return this._nodes.require(`normals`,...T,C.VIEWSHED,C.LASERLINES)+ +!!this.hasAmbientIllumination}_precompilePrepasses(){let e=!!this._normalsRequired;if(e?(this._precompilePlugins(4,W),this._needsDepth&&this._precompilePlugins(3,G)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(C.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator?.active&&(this._nodes.precompile(C.SHADOW_ACCUMULATION),this._precompileAllGeometry(5)),this._shadowAccumulator?.active||e){let t=this._bindParameters.output;this._bindParameters.output=e?4:3,this._nodes.precompile(C.GAUSSIAN_SPLAT_DEPTH),this._bindParameters.output=t}(this.shadowsEnabled||this._shadowAccumulator?.active)&&this._nodes.precompile(C.SHADOWMAP),this.hasAmbientIllumination&&e&&this._nodes.precompile(C.AMBIENT_ILLUMINATION)}_renderNormals(){let e=this._normalsRequired;if(e===0)return;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,`normals`);r.acquireDepth(14),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(S,!0,!0),this._bindParameters.output=4,this._plugins.render(...W),this._renderGaussianSplatDepthAndNormals(r);let i=this._nodes.optional(`normals`,...T,C.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(I.NORMALS),r}_releaseGlobalIlluminationBuffers(){let e=this._bindParameters;this.hasGlobalIllumination&&(e.reprojection.lastFrameColor=s(e.reprojection.lastFrameColor)),e.reprojection.lastFrameDepth=o(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=o(e.reprojection.lastFrameEmission),e.globalIllumination=s(e.globalIllumination),e.globalIlluminationEnabled=!1}_precompileAllGeometry(e){let t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...U),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(let n of t)this._bindParameters.slot=n,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(let n of t)this._renderContext.renderOccludedMask=n,this.precompileSlots(e,...K);this._renderContext.renderOccludedMask=M}renderSlots(e,...t){for(let n of t)this._bindParameters.slot=n,e.forAll(e=>{let 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,...K),this._renderContext.renderOccludedMask=M}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ae[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){let e=this._bindParameters.output;this._bindParameters.output=8,this._precompileAllGeometry(8),this._nodes.precompile(C.SHADOWMAP),this._bindParameters.output=e}precompileCutFillDepth(){this._precompilePlugins(9,Y)}_precompilePlugins(e,t){let n=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=n}renderViewshedShadowMap(e,t){let{camera:n,contentCamera:r}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._renderShadowNodes(t),this._ensureBindParametersCamera(n,r),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=i}renderCutFillDepth(e){let{camera:t,contentCamera:n}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Y),this._ensureBindParametersCamera(t,n),t.setGLViewport(this._rctx),this._bindParameters.output=r}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;let{width:e,height:t}=this._framebuffer.size,n=this.fboCache.acquire(e,t,C.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,n.fbo,256),this._framebuffer.bind(),n}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...G)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...V),this._nodes.precompile(`opaque-color`))}_renderOpaqueGeometry(){this._plugins.render(...V)}_renderTransparentGeometry(){this._plugins.render(...H),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...U)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;let t=this._bindParameters.output,n=this._bindParameters.hudRenderStyle,r=this._bindParameters.emissions;this._bindParameters.emissions=0,this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...q),this._bindParameters.output=2,this._plugins.precompile(...q),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...q)),this._bindParameters.emissions=r,this._bindParameters.output=t,this._bindParameters.hudRenderStyle=n}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;let n=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);let r=!!t.getTexture(R);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,n.getTexture(),r),n.release(),this.performanceInfo.advance(e===0?I.HUD_OCCLUDED:I.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;let{fboCache:e,_rctx:t,_bindParameters:n}=this,{width:r,height:i}=this._framebuffer.size,{highlights:a}=n,o=a.length>pe?3:1,s=e.acquire(r,i,`highlights`,o);s.acquireDepth(14);let c=this._plugins.produces(10,0);return c&&this._framebuffer.color.fbo&&s.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,1024),t.bindFramebuffer(s.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),c||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(s.fbo),D(t,e,r,i,n,()=>this._renderHighlightGeometries()),s.detachDepth(),this.performanceInfo.advance(I.HIGHLIGHTS),s.retain(this._nodes.require(`highlights`,...E)+this._nodes.optional(`highlights`,...E)-1),s}_renderHighlightGeometries(){this._plugins.render(...ke),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e){let t=this._shadowAccumulator;if(!t)return;t.updateDepthRange(e);let n=t.requireGeometryDepth;this._bindParameters.output=0;let r=this._nodes.produce(C.SHADOW_ACCUMULATION,this._pluginInput);t.didAccumulate&&this.performanceInfo.advance(I.ACCUMULATED_SHADOWS),this._pluginInput.set(C.SHADOW_ACCUMULATION,null),r?.release(),n&&(this._bindParameters.depth=s(this._bindParameters.depth))}renderShadowAccumulationShadowMap(e,t,n,r,i){let a=this.stage.view.qualitySettings.maximumPixelRatio;n.start(e,r,i,!0,a),this._renderShadowCascades(5,n),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t)}_precompileTransparentGeometry(){se(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...H),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...H),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...H)}_renderOIT(e,t=2){let n=e===1,{width:r,height:i}=this._framebuffer.size,a=n?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),s=this._bindParameters,c=s.useFloatBlend.value?8:5,l=s.output;s.output=1;let u=n?`oit hud`:`oit`,d=this.fboCache.acquire(r,i,u,c).acquireColor(R,this.hasFloatBlend?7:0,`oit alpha`),f=s.hasEmission&&(e===0||t!==1);f&&d.acquireColor(z,c,`oit emissive`),n||d.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(d.fbo),this._rctx.clearFramebuffer(A),f&&this._rctx.clearBuffer(2,A),a(),d.detachDepth(),s.output=2;let p=this.fboCache.acquire(r,i,n?`oit front hud`:`oit front`);f&&p.acquireColor(R,c,`oit front emissive`),n?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(S,n),a(),p.detachDepth();let m=this._pluginsHas.occludedHudElements&&!n,h=m&&s.emissions!==0?z:R;s.hudOcclusion=o(this._bindParameters.hudOcclusion),s.output=0;let g;return n?(g=this.fboCache.acquire(r,i,`oit composite hud`),this._rctx.bindFramebuffer(g.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(s.emissions!==0&&this._framebuffer.ensureEmissionAttachment(),m&&(this._framebuffer.color.acquireColor(h,0,`hud occlusion`),this._rctx.clearBuffer(h-L,S)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,d,p,s,m,e,this._fboCache.debugCallback),g?.detachDepth(),n||(f&&(this._bindParameters.emissions=3),m&&(s.hudOcclusion=this._framebuffer.color.obtainAttachment(h))),p.release(),d.release(),s.output=l,g}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...V)||this.plugins.produces(5,...V)||this.plugins.produces(3,3)}_renderOpaque(){let e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(C.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));let t=this._framebuffer;t.update(t=>this._renderNodes(w.OPAQUE,t,e)),this.fboCache.debugCallback?.(w.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(C.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(C.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(C.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(C.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(C.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(C.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(C.VOXEL,e)),this.fboCache.debugCallback?.(C.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){let e=this._framebuffer;if(this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(w.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(w.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=o(this._bindParameters.ssao),e.update(e=>this._renderNodes(C.TRANSPARENT_NO_DEPTH,e)),this.fboCache.debugCallback?.(C.TRANSPARENT_NO_DEPTH,e.color.fbo),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){let e=this._rctx.setDrawBuffers([De,R]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(I.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,n=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return n&&this.performanceInfo.advance(e),t;let r=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),this._fboCache.debugCallback?.(e,r.fbo),r}_renderInternalNodeCategory(e,t){if(!t)return;let n=t.name;try{this._renderNodes(e,t)}finally{this._pluginInput.set(e,null),t.setName(n)}}_3dGeometryRendered(){let e=this._bindParameters;this.hasReflections&&(e.depth=s(e.depth),e.reprojection.lastFrameColor=s(e.reprojection.lastFrameColor)),e.shadowMap.disposeOutput(5);let t=this._framebuffer.color.getAttachment(R)?.attachment;if(this.hasGlobalIllumination&&t){let{width:n,height:r}=this._framebuffer.size,i=e.useFloatBlend.value?8:5;e.reprojection.lastFrameEmission=this.fboCache.acquire(n,r,`emissive`,i),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(){this.stage.viewingMode===1&&(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(){let{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){this._ssrEnableTime??=e;let n=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=n>0?Math.min(n,e-this._ssrEnableTime)/n:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination)){this._reprojectionMatrix=b;return}let{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:n}=e,r=!n.equals(t);if(r?(_(Z,t.viewMatrix),_(X,t.projectionMatrix),v(Q,Z,X),v(Q,n.viewMatrix,Q),v(Q,n.projectionMatrix,Q),this._reprojectionMatrix=Q):this._reprojectionMatrix=b,this.hasGlobalIllumination){let{viewMatrix:t}=e;r?(v($,n.viewMatrix,Z),y(t,$)):y(t,b)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,n,r){this._bindParameters.updateLighting(e,t,n,r),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([m({readOnly:!0})],B.prototype,`highResolutionAtmosphere`,null),e([m()],B.prototype,`_edgeView`,void 0),e([m()],B.prototype,`updating`,null),B=e([h(`esri.views.3d.webgl-engine.lib.Renderer`)],B);const V=[0,1,2,3],H=[7,6,4,5],U=[7,6],W=[0,1,2,4,...U],G=[3,5],K=[2,4,8],q=[16,12,14,13],ke=[4,5,2,3,0,1,...U],J=[4,8,5,11],Ae={0:[13],1:[12],2:[13,12],3:[13,12]},Y=[0,1,...U],je=[`normals`,`highlights`],X=x(),Z=x(),Q=x(),$=x();function Me(e){return t=>e.immediate.schedule(t)}export{B as Renderer};
|
|
2
|
+
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as n}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as r,abortMaybe as i,destroyMaybe as a,releaseMaybe as o,releaseReferencedMaybe as s}from"../../../../core/maybe.js";import{throwIfAborted as c}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as u,initial as d,sync as f}from"../../../../core/reactiveUtils.js";import{signal as p}from"../../../../core/signal.js";import{property as m,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{equals as g,invert as _,multiply as v,copy as y}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as x}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as ee}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as te,ZEROS as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as ne}from"../../../../geometry/support/Indices.js";import{InternalRenderCategory as C,RenderNodeOutput as w,AllRenderNodeOutputs as T,AllInternalRenderNodeOutputs as E}from"../../webgl.js";import{minNearDistanceInMeters as re}from"../../state/NearFarHeuristic.js";import{debugFlags as ie}from"../../support/debugFlags.js";import{FBOCache as ae}from"../core/FBOCache.js";import{RenderPassManager as oe}from"../core/renderPasses/RenderPassManager.js";import{isColor as se}from"../core/shaderLibrary/ShaderOutput.js";import{RenderNodes as ce}from"../effects/RenderNodes.js";import{RenderPluginManager as le}from"../effects/RenderPluginManager.js";import{WeatherFader as ue}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as de}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as fe}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as pe,renderHighlightBuffer as D}from"../effects/highlight/Highlight.js";import{OITBlend as me}from"../effects/transparency/OITBlend.js";import{AnimationTimer as he}from"./AnimationTimer.js";import{AnimationTimeStep as ge}from"./AnimationTimeStep.js";import{BoundingInfo as _e}from"./BoundingInfo.js";import{Compositor as ve}from"./Compositor.js";import{DepthRange as O}from"./DepthRange.js";import{depthRangeFromScene as k}from"./depthRangeUtils.js";import{MainFramebuffer as ye}from"./MainFramebuffer.js";import{NavigationDepthCache as be}from"./NavigationDepthCache.js";import{blendingColorAlphaClear as A}from"./OrderIndependentTransparency.js";import{RenderContext as j,defaultRenderOccludedMask as M}from"./RenderContext.js";import{RendererBase as N}from"./RendererBase.js";import{setupFeatureDefaults as P}from"./RenderFeature.js";import{RenderPluginInput as xe}from"./RenderPluginInput.js";import{ShadowMap as Se}from"./ShadowMap.js";import Ce from"./SliceHelper.js";import{MergedRenderer as we}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as F}from"../parts/renderUtils.js";import{RendererPerformanceInfo as Te,PerformanceCategory as I}from"../statistics/RendererPerformanceInfo.js";import{PixelType as Ee,ColorAttachment0 as L,ColorAttachment1 as R,ColorAttachment2 as z,DrawBufferNone as De}from"../../../webgl/enums.js";const Oe=has(`disable-feature:async-navigation-3d-depth-readback`);let B=class extends N{constructor(e,t,n,r,i){super({stage:e}),this._techniques=n,this._rctx=r,this._requestRender=i,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new oe,this._isRendering=!1,this._backgroundColor=te(0,0,0,1),this._sliceHelper=new Ce,this._shadowAccumulator=null,this._shadowCastOptions=null,this.sceneDepthRange=p(O.Infinite),this._state=p(2),this._hasAnimations=!1,this._animationTimestep=new ge,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=p(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new xe,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(let t of je)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new ae(r),this._compositor=new ve(r,n),this._renderStateFeatures=p(P(e.view.qualityProfile));let a=new Se(this._fboCache,e.viewingMode);this._renderContext=new j(this._rctx,a,n),this._framebuffer=new ye(this._fboCache,this._bindParameters),this._performanceInfo=new Te(this._rctx),this._blit=new fe(n),this.navigationDepthCache=new be(this._rctx,this._fboCache,n,()=>this._requestRender(0)),this._nodes=new ce(this._renderContext),this._plugins=new le({renderContext:this._renderContext,techniques:n,materials:t,requestRender:i,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new ue({view:e.view,context:this._renderContext}),this.addHandles([l(()=>e.view.state.camera,()=>i(),u),l(()=>ie.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},i()},d),l(()=>e.view.environment.background?.color,e=>{let t=e?e.toUnitRGBA():S;ee(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),i()},u),l(()=>e.view.environmentView.shadowsAvailable,e=>{this._bindParameters.shadowMap.enabled=e,this._requestRender(1)},u),l(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},f),l(()=>this._bindParameters.clouds.data?.state,()=>i(),f),l(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,i()},d),l(()=>e.view.environment.lighting?.type===`sun`,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},u)])}destroy(){this._gpuTimerHandle=r(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator=null,this._shadowCastOptions=null,this._loadEdgeViewTask=i(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,_e.prune(),we.prune(),ne()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new me(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=P(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,n){this.isFeatureEnabled(e,t)!==n&&(this._renderStateFeatures.mutate(r=>r.set(t,e,n)),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(C.AMBIENT_ILLUMINATION)}get hasGlobalIllumination(){return this.stage.renderView?.globalIllumination?.enabled??!1}get hasGlobalIlluminationHighQuality(){let e=this.stage.renderView?.globalIllumination;return this.hasGlobalIllumination&&e?.hasHighQuality===!0}get hasSMAA(){return this.isFeatureEnabled(0)}get _emissions(){let e=this._plugins.emissions;return this._hasTransparentGeometry?e:+(e===1||e===3)}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=o(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose();let e=this._bindParameters;e.globalIllumination=o(e.globalIllumination),e.reprojection.lastFrameDepth=o(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=o(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||=n(async e=>{let{EdgeView:t}=await import(`./edgeRendering/EdgeView.js`);c(e);let n=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:Me(this.stage.view.resourceController)});return this.addHandles(l(()=>n.updating,()=>this._requestRender(),f)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(n)),this._edgeViewCallbacks.length=0,n}),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView().catch(()=>{}),this._edgeView==null?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&g(this._bindParameters.reprojection.matrix,b)}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):!1}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&&!!(this.plugins.renderOccludedFlags&8)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){let has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...q),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new he(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);let n=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==n&&(this._gpuTimerHandle=n?r(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,n=!1){try{return this._isRendering=!0,this._render(e,t,n)}catch(e){console.error(`Exception during rendering: ${e}:\n${e.stack}`)}finally{this._isRendering=!1}return new F(this._pluginInput.get(w.FINAL),null)}_render(e,t,n){let r=t===0;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r,this._disposeBindBuffers();let{camera:i,contentCamera:a,mode:c,alignPixelEnabled:l}=e;this._state.value=c,this._bindParameters.frameRendererTarget=t,this._bindParameters.output=0,this._bindParameters.emissions=this._emissions,this._bindParameters.alignPixelEnabled=l,this._bindParameters.metersPerRenderUnit=this.stage.view.renderCoordsHelper.unitInMeters,this._bindParameters.decorations=!n,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;let u=!n||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=u?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(C.VIEWSHED),this._bindParameters.laserlinesEnabled=this._nodes.produces(C.LASERLINES),this._bindParameters.shadowAnalysisEnabled=!!this._shadowAccumulator?.active,this._bindParameters.cutFillComputationEnabled=this._nodes.produces(C.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(C.CUTFILL),this._ensureBindParameters(i,a),this._plugins.sortTestsTransparentOrderedSlots(J),this._plugins.prepareRender(),this._hasTransparentGeometry=this._plugins.produces(1,...H),this._renderOverlay(),i.setGLViewport(this._rctx);let d=this._framebuffer,f=d.initialize(i.fullWidth,i.fullHeight,this._backgroundColor),p=this._needsLastFrameColor;p?(f?.retain(p-1),f?.setName(`last frame color`),this._bindParameters.reprojection.lastFrameColor?.release(),this._bindParameters.reprojection.lastFrameColor=f):f?.release(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!n,this._precompilePrepasses(),this.performanceInfo.advance(I.PREPARE);let m=this._computeShadowDepthRange(i);this._pluginInput.set(`normals`,this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(i,a,this._bindParameters.lighting.mainLight.direction,m),this._renderShadowAccumulation(m),d.bind(),this._bindParameters.mainDepth=d.depth.attachment,this._precompileShaders(r),this._bindParameters.output=0,this._renderOpaque(),this._renderPreTransparent(),this._renderTransparent(),this._3dGeometryRendered(),d.update(e=>this._renderNodes(C.CUTFILL_COMPUTATION,e)),this._pluginInput.set(C.FOCUSAREA_MASK,this._renderFocusAreaMask()),d.update(e=>this._renderNodes(C.TRANSPARENT_ENVIRONMENT,e)),d.update(e=>this._renderNodes(C.VIEWSHED,e)),d.update(e=>this._renderNodes(C.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=s(this._bindParameters.depth)),d.update(e=>this._renderNodes(C.FOCUSAREA,e)),this._pluginInput.release(C.FOCUSAREA_MASK),d.update(e=>this._renderNodes(C.CUTFILL,e)),this._pluginInput.release(C.GROUND_DEPTH),d.update(e=>this._renderNodes(C.OCCLUDED,e)),this._pluginInput.set(`highlights`,this._renderHighlightPrepass());let h=t===2?this._renderObjectAndLayerIdColor():null;d.update(e=>this._renderNodes(w.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=o(this._bindParameters.shadowHighlight),d.update(e=>this._renderNodes(C.ANTIALIASING,e));let g=this._hasTransparentGeometry?2:1,_=this._bindParameters.emissions;this._bindParameters.emissions=0,this._hasHUDHighlights&&d.update(e=>this._renderHUD(g,e)),d.update(e=>this._renderNodes(C.HIGHLIGHT,e)),this._hasHUDHighlights||d.update(e=>this._renderHUD(g,e)),this._bindParameters.emissions=_,d.update(e=>this._renderNodes(C.MAGNIFIER,e)),d.update(e=>this._renderNodes(w.FINAL,e)),r&&(this._blit.toFramebuffer(d.color,this._bindParameters),!Oe&&(c===2||c===0)&&this.navigationDepthCache.update(this._bindParameters,d.depth.attachment,this._renderContext.time)),this._bindParameters.reprojection.lastFrameDepth?.release(),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=s(this._bindParameters.depth)),this._releaseFBOs(),d.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd();let v;return r||(v=d.color,v.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new F(v,h)}_precompileShaders(e){++this._plugins.context.techniques.precompiling;let t=this._bindParameters;t.output=0;let n=t.emissions;if(this._precompileOpaqueGeometry(),this._nodes.precompile(C.OPAQUE_ENVIRONMENT,C.GAUSSIAN_SPLAT,C.OPAQUE_OCCLUSION_QUERY,C.VOXEL),this._precompileOpaqueGeometry(),t.output=3,this._plugins.precompile(...U),t.output=0,this._plugins.precompile(...U),this._hasTransparentGeometry){let 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(C.FOCUSAREA_MASK),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,t),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(C.TRANSPARENT_ENVIRONMENT,C.VIEWSHED,C.CUTFILL_COMPUTATION,C.CUTFILL,C.LASERLINES,C.FOCUSAREA,C.OCCLUDED,C.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=n,this._hasHighlights&&(t.highlights.forEach((e,n)=>{t.highlightLevel=n,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(C.HIGHLIGHT)),t.highlightMixTexture=null,this._nodes.precompile(w.COMPOSITE,C.MAGNIFIER),this._nodes.precompile(C.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(){let e=this._nodes.produce(C.FOCUSAREA_MASK,this._pluginInput);return e&&this.performanceInfo.advance(I.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces(C.OBJECT_AND_LAYER_ID_COLOR))return null;let e=this._bindParameters.output;++this._techniques.precompiling;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,C.OBJECT_AND_LAYER_ID_COLOR).acquireDepth(14);return r=this._renderNodes(C.OBJECT_AND_LAYER_ID_COLOR,r),--this._techniques.precompiling,this._bindParameters.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();let t=this.performanceInfo.gpuSamplingEnabled,n=e===0,r=n?this.performanceInfo.elapsedTime:0;if(n||t){let e=0;t?e=this.performanceInfo.totalGPUTimeSampler.last:(this._rctx.gl.finish(),e=this.performanceInfo.elapsedTime);let i=Math.max(r,e);this._animationTimestep.frame(i,n)}}readAccumulatedShadow(e){return this._shadowAccumulator?.readAccumulatedShadow(e[0],e[1])??0}readMainDepth(e,t){let{mainDepth:n,camera:r}=this._bindParameters;if(!n)return;let i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,`linear depth`);this._rctx.bindFramebuffer(i.fbo),r.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(S),this._compositor.blitDepthToLinearDepth(this._bindParameters,n),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),i.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,Ee.UNSIGNED_BYTE,t),i.release()}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){let t=this._needsEdges;if(!t)return;let{width:n,height:r}=this._framebuffer.size,i=this.fboCache.acquire(n,r,`edges`);i.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(S),t.render(this._bindParameters,e),i.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===1?I.OPAQUE_EDGES:I.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(I.OVERLAY)}_renderShadowMap(e,t,n,r){if(!this.shadowsEnabled)return;let i=this._bindParameters.shadowMap;if(i.start(e,n,r,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,i),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);let n=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(C.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=n,i.disposeOutput(6),i.clear(),this._renderShadowCascades(7,i)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=s(this._bindParameters.depth)),this.performanceInfo.advance(C.SHADOWMAP)}_precompileShadowCascades(e){this._bindParameters.shadowMap.cascades.length!==0&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){let n=this._bindParameters.output,r=e!==6;t.bindFramebuffer();for(let n of t.cascades)n.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(n.camera,n.camera),this.renderAllGeometry(e),r&&this._renderShadowNodes(t.renderTarget);t.finish(e),this._bindParameters.output=n}_renderShadowNodes(e){this._renderInternalNodeCategory(C.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(){let e=this._bindParameters;e.depth=o(this._bindParameters.depth);let t=this._pluginInput.get(`normals`);if(t){let n=this._nodes.produce(C.AMBIENT_ILLUMINATION,this._pluginInput);this._pluginInput.set(C.AMBIENT_ILLUMINATION,n),this._releaseGlobalIlluminationBuffers(),e.ssao=this.hasGlobalIllumination?null:n,e.globalIllumination=this.hasGlobalIllumination?n:null,e.globalIlluminationEnabled=e.globalIllumination!=null,n&&this.performanceInfo.advance(this.hasGlobalIlluminationHighQuality?I.AMBIENT_ILLUMINATION_HIGH_QUALITY:I.AMBIENT_ILLUMINATION);let r=this._needsDepth;if(r){let n=t.obtainAttachment(L);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),e.depth=t.obtainDepthTexture(),e.depth?.retain(r-1),t.attachColor(n,L),n?.release(),this.performanceInfo.advance(I.DEPTH)}else t.detachDepth();this.hasAmbientIllumination&&this._pluginInput.release(`normals`)}else this._releaseGlobalIlluminationBuffers(),e.ssao=null,this._pluginInput.set(C.AMBIENT_ILLUMINATION,null),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){let e=this._needsDepth;if(e===0)return;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,`geometry depth`,14);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._renderGaussianSplatPrepassDepth(r),this._bindParameters.depth=r.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),r.release(),this.performanceInfo.advance(I.DEPTH)}_renderGaussianSplatPrepassDepth(e){let t=this._shadowAccumulator;if(!t?.active||!t.requireGeometryDepth)return;let n=this._bindParameters.output;this._bindParameters.output=3,this._renderInternalNodeCategory(C.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=n}_renderGaussianSplatDepthAndNormals(e){let t=this._bindParameters.output;this._bindParameters.output=4,this._renderInternalNodeCategory(C.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=t}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||!!this._shadowAccumulator?.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return O.Zero;let t=k(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.union(this._nodes.queryDepthRange(C.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||(this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<de){this.sceneDepthRange.value=O.Infinite;return}let t=e.clone();t.near=re,t.far=1e10;let n=k(t,this._plugins.plugins,this.stage.layers,1);n.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(n)||(this.sceneDepthRange.value=n)}get _normalsRequired(){return this._nodes.require(`normals`,...T,C.VIEWSHED,C.LASERLINES)+ +!!this.hasAmbientIllumination}_precompilePrepasses(){let e=!!this._normalsRequired;if(e?(this._precompilePlugins(4,W),this._needsDepth&&this._precompilePlugins(3,G)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(C.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator?.active&&(this._nodes.precompile(C.SHADOW_ACCUMULATION),this._precompileAllGeometry(5)),this._shadowAccumulator?.active||e){let t=this._bindParameters.output;this._bindParameters.output=e?4:3,this._nodes.precompile(C.GAUSSIAN_SPLAT_DEPTH),this._bindParameters.output=t}(this.shadowsEnabled||this._shadowAccumulator?.active)&&this._nodes.precompile(C.SHADOWMAP),this.hasAmbientIllumination&&e&&this._nodes.precompile(C.AMBIENT_ILLUMINATION)}_renderNormals(){let e=this._normalsRequired;if(e===0)return;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,`normals`);r.acquireDepth(14),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(S,!0,!0),this._bindParameters.output=4,this._plugins.render(...W),this._renderGaussianSplatDepthAndNormals(r);let i=this._nodes.optional(`normals`,...T,C.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(I.NORMALS),r}_releaseGlobalIlluminationBuffers(){let e=this._bindParameters;this.hasGlobalIllumination&&(e.reprojection.lastFrameColor=s(e.reprojection.lastFrameColor)),e.reprojection.lastFrameDepth=o(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=o(e.reprojection.lastFrameEmission),e.globalIllumination=s(e.globalIllumination),e.globalIlluminationEnabled=!1}_precompileAllGeometry(e){let t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...U),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(let n of t)this._bindParameters.slot=n,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(let n of t)this._renderContext.renderOccludedMask=n,this.precompileSlots(e,...K);this._renderContext.renderOccludedMask=M}renderSlots(e,...t){for(let n of t)this._bindParameters.slot=n,e.forAll(e=>{let 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,...K),this._renderContext.renderOccludedMask=M}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ae[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){let e=this._bindParameters.output;this._bindParameters.output=8,this._precompileAllGeometry(8),this._nodes.precompile(C.SHADOWMAP),this._bindParameters.output=e}precompileCutFillDepth(){this._precompilePlugins(9,Y)}_precompilePlugins(e,t){let n=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=n}renderViewshedShadowMap(e,t){let{camera:n,contentCamera:r}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._renderShadowNodes(t),this._ensureBindParametersCamera(n,r),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=i}renderCutFillDepth(e){let{camera:t,contentCamera:n}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Y),this._ensureBindParametersCamera(t,n),t.setGLViewport(this._rctx),this._bindParameters.output=r}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;let{width:e,height:t}=this._framebuffer.size,n=this.fboCache.acquire(e,t,C.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,n.fbo,256),this._framebuffer.bind(),n}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...G)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...V),this._nodes.precompile(`opaque-color`))}_renderOpaqueGeometry(){this._plugins.render(...V)}_renderTransparentGeometry(){this._plugins.render(...H),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...U)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;let t=this._bindParameters.output,n=this._bindParameters.hudRenderStyle,r=this._bindParameters.emissions;this._bindParameters.emissions=0,this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...q),this._bindParameters.output=2,this._plugins.precompile(...q),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...q)),this._bindParameters.emissions=r,this._bindParameters.output=t,this._bindParameters.hudRenderStyle=n}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;let n=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);let r=!!t.getTexture(R);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,n.getTexture(),r),n.release(),this.performanceInfo.advance(e===0?I.HUD_OCCLUDED:I.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;let{fboCache:e,_rctx:t,_bindParameters:n}=this,{width:r,height:i}=this._framebuffer.size,{highlights:a}=n,o=a.length>pe?3:1,s=e.acquire(r,i,`highlights`,o);s.acquireDepth(14);let c=this._plugins.produces(10,0);return c&&this._framebuffer.color.fbo&&s.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,1024),t.bindFramebuffer(s.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),c||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(s.fbo),D(t,e,r,i,n,()=>this._renderHighlightGeometries()),s.detachDepth(),this.performanceInfo.advance(I.HIGHLIGHTS),s.retain(this._nodes.require(`highlights`,...E)+this._nodes.optional(`highlights`,...E)-1),s}_renderHighlightGeometries(){this._plugins.render(...ke),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e){let t=this._shadowAccumulator;if(!t)return;t.updateDepthRange(e);let n=t.requireGeometryDepth;this._bindParameters.output=0;let r=this._nodes.produce(C.SHADOW_ACCUMULATION,this._pluginInput);t.didAccumulate&&this.performanceInfo.advance(I.ACCUMULATED_SHADOWS),this._pluginInput.set(C.SHADOW_ACCUMULATION,null),r?.release(),n&&(this._bindParameters.depth=s(this._bindParameters.depth))}renderShadowAccumulationShadowMap(e,t,n,r,i){let a=this.stage.view.qualitySettings.maximumPixelRatio;n.start(e,r,i,!0,a),this._renderShadowCascades(5,n),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t)}_precompileTransparentGeometry(){se(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...H),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...H),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...H)}_renderOIT(e,t=2){let n=e===1,{width:r,height:i}=this._framebuffer.size,a=n?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),s=this._bindParameters,c=s.useFloatBlend.value?8:5,l=s.output;s.output=1;let u=n?`oit hud`:`oit`,d=this.fboCache.acquire(r,i,u,c).acquireColor(R,this.hasFloatBlend?7:0,`oit alpha`),f=s.hasEmission&&(e===0||t!==1);f&&d.acquireColor(z,c,`oit emissive`),n||d.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(d.fbo),this._rctx.clearFramebuffer(A),f&&this._rctx.clearBuffer(2,A),a(),d.detachDepth(),s.output=2;let p=this.fboCache.acquire(r,i,n?`oit front hud`:`oit front`);f&&p.acquireColor(R,c,`oit front emissive`),n?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(S,n),a(),p.detachDepth();let m=this._pluginsHas.occludedHudElements&&!n,h=m&&s.emissions!==0?z:R;s.hudOcclusion=o(this._bindParameters.hudOcclusion),s.output=0;let g;return n?(g=this.fboCache.acquire(r,i,`oit composite hud`),this._rctx.bindFramebuffer(g.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(s.emissions!==0&&this._framebuffer.ensureEmissionAttachment(),m&&(this._framebuffer.color.acquireColor(h,0,`hud occlusion`),this._rctx.clearBuffer(h-L,S)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,d,p,s,m,e,this._fboCache.debugCallback),g?.detachDepth(),n||(f&&(this._bindParameters.emissions=3),m&&(s.hudOcclusion=this._framebuffer.color.obtainAttachment(h))),p.release(),d.release(),s.output=l,g}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...V)||this.plugins.produces(5,...V)||this.plugins.produces(3,3)}_renderOpaque(){let e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(C.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));let t=this._framebuffer;t.update(t=>this._renderNodes(w.OPAQUE,t,e)),this.fboCache.debugCallback?.(w.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(C.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(C.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(C.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(C.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(C.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(C.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(C.VOXEL,e)),this.fboCache.debugCallback?.(C.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){let e=this._framebuffer;if(this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(w.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(w.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=o(this._bindParameters.ssao),e.update(e=>this._renderNodes(C.TRANSPARENT_NO_DEPTH,e)),this.fboCache.debugCallback?.(C.TRANSPARENT_NO_DEPTH,e.color.fbo),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){let e=this._rctx.setDrawBuffers([De,R]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(I.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,n=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return n&&this.performanceInfo.advance(e),t;let r=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),this._fboCache.debugCallback?.(e,r.fbo),r}_renderInternalNodeCategory(e,t){if(!t)return;let n=t.name;try{this._renderNodes(e,t)}finally{this._pluginInput.set(e,null),t.setName(n)}}_3dGeometryRendered(){let e=this._bindParameters;this.hasReflections&&(e.depth=s(e.depth),e.reprojection.lastFrameColor=s(e.reprojection.lastFrameColor)),e.shadowMap.disposeOutput(5);let t=this._framebuffer.color.getAttachment(R)?.attachment;if(this.hasGlobalIllumination&&t){let{width:n,height:r}=this._framebuffer.size,i=e.useFloatBlend.value?8:5;e.reprojection.lastFrameEmission=this.fboCache.acquire(n,r,`emissive`,i),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(){this.stage.viewingMode===1&&(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(){let{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){this._ssrEnableTime??=e;let n=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=n>0?Math.min(n,e-this._ssrEnableTime)/n:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination)){this._reprojectionMatrix=b;return}let{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:n}=e,r=!n.equals(t);if(r?(_(Z,t.viewMatrix),_(X,t.projectionMatrix),v(Q,Z,X),v(Q,n.viewMatrix,Q),v(Q,n.projectionMatrix,Q),this._reprojectionMatrix=Q):this._reprojectionMatrix=b,this.hasGlobalIllumination){let{viewMatrix:t}=e;r?(v($,n.viewMatrix,Z),y(t,$)):y(t,b)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,n,r){this._bindParameters.updateLighting(e,t,n,r),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([m({readOnly:!0})],B.prototype,`highResolutionAtmosphere`,null),e([m()],B.prototype,`_edgeView`,void 0),e([m()],B.prototype,`updating`,null),B=e([h(`esri.views.3d.webgl-engine.lib.Renderer`)],B);const V=[0,1,2,3],H=[7,6,4,5],U=[7,6],W=[0,1,2,4,...U],G=[3,5],K=[2,4,8],q=[16,12,14,13],ke=[4,5,2,3,0,1,...U],J=[4,8,5,11],Ae={0:[13],1:[12],2:[13,12],3:[13,12]},Y=[0,1,...U],je=[`normals`,`highlights`],X=x(),Z=x(),Q=x(),$=x();function Me(e){return t=>e.immediate.schedule(t)}export{B as Renderer};
|
package/views/SceneView.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Camera.js";import n from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as i}from"../core/domUtils.js";import a from"../core/Error.js";import{on as o}from"../core/events.js";import{destroyHandle as s,makeHandle as c}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{mapCollectionAsync as ee}from"../core/mapCollectionUtils.js";import{destroyMaybe as u,maybeProperty as te}from"../core/maybe.js";import{throwIfDestroyed as ne,throwIfAborted as d,createAbortError as re}from"../core/promiseUtils.js";import ie from"../core/ReactiveSet.js";import{on as f,watch as p,initial as m,sync as h,whenOnce as ae,syncAndInitial as g}from"../core/reactiveUtils.js";import{setFrameDuration as oe,cleanupScheduling as se}from"../core/scheduling.js";import{createScreenPoint as ce,createScreenPointArray as le}from"../core/screenUtils.js";import{cleanupWhereClauseCache as ue}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as de,getMetersPerUnitForSR as fe}from"../core/units.js";import{property as _,cast as v,subclass as pe}from"../core/accessorSupport/decorators.js";import{ensureType as y,ensureClass as b}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as me}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as he}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as ge}from"../core/accessorSupport/trackingUtils.js";import{create as _e}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as ve}from"../core/libs/rbush/PooledRBush.js";import{initialize as ye}from"../core/workers/workers.js";import x from"../geometry/Extent.js";import be from"../geometry/HeightModelInfo.js";import S from"../geometry/Point.js";import{project as C,canProjectWithoutEngine as xe}from"../geometry/projectionUtils.js";import w from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Se}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as Ce}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as T}from"../geometry/projection/projectPointToVector.js";import{toExtent as we,create as Te}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Ee}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as De}from"../geometry/support/scaleUtils.js";import{wgs84 as Oe,webMercator as ke}from"../geometry/support/spatialReferenceUtils.js";import{makeDehydratedPoint as Ae}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as E,isTiledLayer as D,isVoxelLayer as O,isIntegratedMeshLayer as k,isGaussianSplatLayer as je}from"../layers/support/layerUtils.js";import{TilemapCache as Me}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as Ne}from"../portal/portalDefault.js";import{WebSceneTag as Pe}from"../support/tagSymbols.js";import{BreakpointsOwner as Fe}from"./BreakpointsOwner.js";import{DOMContainer as Ie}from"./DOMContainer.js";import{PopupView as Le}from"./PopupView.js";import A from"./View.js";import Re from"./ViewAnimation.js";import{stringFromViewingMode as j,viewingModeFromString as M}from"./ViewingMode.js";import{GroundView3D as ze}from"./3d/GroundView3D.js";import{layerView3DImporter as N}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as Be}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as Ve}from"./3d/camera/intersectionUtils.js";import P from"./3d/constraints/Constraints.js";import F from"./3d/environment/Environment.js";import{EnvironmentManager as He}from"./3d/environment/EnvironmentManager.js";import Ue from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as We}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Ge}from"./3d/layers/graphics/Labeler.js";import Ke from"./3d/layers/i3s/I3SLodHandling.js";import{Navigation3D as qe}from"./3d/navigation/Navigation3D.js";import{ScreenSizePerspective as Je}from"./3d/state/ScreenSizePerspective.js";import I from"./3d/state/ViewState.js";import{ViewStateManager as Ye,cleanupViewStateManager as Xe}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Ze}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Qe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as $e}from"./3d/state/utils/navigationUtils.js";import et from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as tt}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as L}from"./3d/support/debugFlags.js";import{getElevationAtPoint as nt}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as rt}from"./3d/support/GroundAndIMSurface.js";import{toMap as it,hitTest as at}from"./3d/support/hitTest.js";import{popupHitTest as ot}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as st,getQualityProfileSettings as R}from"./3d/support/QualityProfile.js";import z from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as ct}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as lt}from"./3d/support/ResourceController.js";import ut from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as dt}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as ft}from"./3d/support/ViewSlice.js";import{PointsOfInterest as B}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import V from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as pt,getTiledLayerInfo as mt,checkIfTileInfoSupportedForView as ht}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as gt}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as _t}from"./3d/terrain/TileRenderer.js";import{Stage as vt}from"./3d/webgl-engine/Stage.js";import{olidEnabled as yt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as bt}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{defaultTolerance as H}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as xt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as U}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as St}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import W from"./interactive/options/ViewOptions.js";import Ct from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as wt}from"./support/drapedUtils.js";import{occludeesSupported as Tt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as G,createScreenPointFromSupportedEvent as K}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Et}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as Dt,destroyTextureCompressionWorker as Ot}from"./support/TextureCompressionHelper.js";import kt from"./ui/DefaultUI.js";import At from"./ui/3d/DefaultUI3D.js";import jt from"../webscene/Environment.js";import{clearVNodeCache as Mt}from"../widgets/support/vnodeCache.js";var q;const Nt=Symbol(),J=Symbol();function Pt(e){let t=b(W,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let Y=class extends Fe(Le(Ie(A))){static{q=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new W({snapping:{enabled:!0}}),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=lt(this),this.deconflictor=new We({view:this}),this.attribution3D=new et({view:this}),this.labeler=new Ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new qe({view:this}),this.basemapTerrain=null,this.elevationProvider=new tt({view:this}),this._canvas=null,this.constraints=new P,this._environment=new F,this.environmentManager=new He,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Ct({importAnalysisViewModule:e=>Be(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new ie,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new I({view:this}),this.slice=new ft,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type=`3d`,this.ui=new At,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,ye();let t=()=>this._updatingChanged();this.addHandles(s(ee(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([f(()=>this.map?.allLayers,`after-changes`,t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on(`after-changes`,e=>this._updateUpdatingMonitors(e)),p(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Ue({view:this}),this.stateManager=new Ye({view:this}),this.screenSizePerspective=new Je({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=Dt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ze({view:this}),this.groundAndIMSurface=new rt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>oe(e>0?1e3/Math.ceil(e):0),m),this.addHandles([p(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),h),p(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),h)])}destroy(){this.destroyed||(Ot(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set(`analysisViewManager`,u(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=u(this.sharedSymbolResources),this._set(`labeler`,u(this.labeler)),this._set(`deconflictor`,u(this.deconflictor)),this._resourceController=u(this._resourceController),this._set(`stateManager`,u(this.stateManager)),this._set(`inputManager`,u(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles(`updatingMonitors`),this._set(`environmentManager`,u(this.environmentManager)),this._set(`environment`,u(this.environment)),this.groundView=u(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set(`ui`,null),this._set(`renderCanvas`,null),this._set(`canvas`,null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=y(S,e))}get clippingArea(){if(this.viewingMode===`global`)return null;let e=this.map,t=this._userClippingArea||te(e,`clippingArea`);return!(this._userClippingArea||te(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof x?this.spatialReference&&(t=X(t,this.spatialReference),t==null)?(l.getLogger(this).error(`#clippingArea`,`setting clippingArea with incompatible SpatialReference`),this._clippingArea):(t=t.clone(),t.intersection(this._groundAndLayersExtent)??(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.viewingMode===`global`&&e!=null?l.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===1)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:X(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent,t=this.spatialReference||w.WGS84,n=X(this.clippingArea,t);n!=null&&(e=e==null?n:e.intersection(n));let r=this._get(`dataExtent`);return e!=null&&e.equals(r)?r:e}get _groundAndLayersExtent(){let e=this.spatialReference||w.WGS84,t,n=n=>{let r=X(n,e);r!=null&&(t==null?t=r.clone():t.union(r))},{groundView:r}=this,i=r?.spatialReference,a=r?.fullGroundExtent;i&&a&&n(new x({xmin:a[0],ymin:a[1],zmin:0,xmax:a[2],ymax:a[3],zmax:0,spatialReference:i}));let o=e=>{e.fullExtent!=null&&(e.type!==`graphics`||!e.internal)&&n(e.fullExtent)};if(this.map?.allLayers.forEach(e=>o(e)),t==null)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);let s=this._get(`_groundAndLayersExtent`);return t.equals(s)?s:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;let{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange(`environment`)}castEnvironment(e){return e?e instanceof F?e:e instanceof jt?this.environment?.cloneWithWebsceneEnvironment(e)??F.fromWebsceneEnvironment(e):y(F,e):new F}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return q._layerToLayerview}static{this._layerToLayerview=A._layerToLayerview.concat([[`view.map.ground.layers`,`view.groundView.layerViews`]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&Pe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){let t=R(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new z(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set(`qualityProfile`,e))}get qualityProfile(){return this._get(`qualityProfile`)||st()}_updateSlice(){this.stage!=null&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){let{scale:e,spatialReference:t}=this;return t?he(()=>De(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){let e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;let n=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return n<=0?null:Math.max(0,Math.min(n,r||1/0))}get heightModelInfo(){let e=this.getDefaultHeightModelInfo();if(!e)return null;let t=de(this.spatialReference);if(t&&e.heightUnit!==t)return new be({heightModel:e.heightModel,heightUnit:t,vertCRS:e.vertCRS,associatedSpatialReference:e.associatedSpatialReference});if(!e.associatedSpatialReference){let t=e.clone();return t.associatedSpatialReference=this.spatialReference,t}return e}get alphaCompositingEnabled(){return this._get(`alphaCompositingEnabled`)}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn(`alphaCompositingEnabled cannot be changed after the view has become ready`),this._set(`alphaCompositingEnabled`,e)}get updating(){if(this.destroying||this.destroyed)return!1;if(!this.initialized)return!0;let e=0,t=this.layerViewManager.updating,n=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(!r.isFulfilled())++n;else if(r.updating){if(t=!0,r.suspended||pt(r))return;++n,e+=r.updatingProgress}});let r=.1;for(let t of this._updatingObjects)t?.updating&&(n+=r,e+=.5*r);for(let t of this._updatingObjectsWithProgress)t?.updating&&(++n,e+=t.updatingProgress);let i=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||i||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(n,this._numUpdating),e+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=+!t,this._get(`updatingProgress`)!==e){let n=performance.now();if(e<1){let t=Math.min((n-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set(`updatingProgress`,e),this._lastUpdateTime=t&&e<1?n:0}return L.UPDATING&&console.log(`Updating:`,this._updatingObjectsToDebug.filter(e=>e!=null&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return L.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedViewingMode;if(e!=null)return j(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?j(this.defaultsFromMap.viewingMode):Et(t,1)?`global`:`local`:`global`}set viewingMode(e){this.ready?l.getLogger(this).error(`#viewingMode`,`viewingMode cannot be set once view is ready`):this._overrideIfSome(`viewingMode`,e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new ut(this)}on(e,t,n,r){return this.viewEvents.on(e,t,n,r)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=G(e)?K(this,e):e;return it(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error(`#toScreen()`,`Scene view cannot be used before it is ready`),null;let t=e;return e.z??(t=Ft,t.x=e.x,t.y=e.y,t.z=nt(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),T(t,Z,this.renderSpatialReference),this.state.camera.projectToScreen(Z,Q),ce(Q[0],Q[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;T(e,Z,n);let r=this.state.camera.computeScreenPixelSizeAt(Z);return t&&n!==t?r*fe(n)/fe(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=G(e)?K(this,e):e;return at(this,n,t,this._defaultHitTestOptions)}async popupHitTest(e){return ot(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return this.navigation.zoom(!0)}async zoomOut(){if(this.canZoomOut)return this.navigation.zoom(!1)}async whenAnalysisView(e){if(e.parent==null)throw new a(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});switch(e.parent.type){case`line-of-sight`:case`dimension`:case`viewshed`:return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encode(n,t,this._pixelFormat())}async _takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encodeData(n,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){let t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();let n=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import(`./support/screenshotUtils.js`);return[r(n[0],this._pixelFormat()),r(n[1],this._pixelFormat())]}async _completeSettings(e){let{toRenderSettings:t,screenshotSuperSampleSettings:n}=await import(`./support/screenshotUtils.js`),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,n(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!yt())throw new a(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`);let{encode:t}=await import(`./support/screenshotUtils.js`),n=await this._completeSettings(e);n.olidColor=!0,await this.whenReady();let r=await this.stage.renderView.takeScreenshot(n),i=t(r[0],n,this._pixelFormat()),o=await this._completeSettings(e);return o.format=`png`,[i,t(r[1],o,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new a(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return N.importLayerView(e)}hasLayerViewModule(e){return N.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedViewingMode(){let e=this._isOverridden(`viewingMode`)?this._get(`viewingMode`):this.scene?.initialViewProperties?.viewingMode;return e==null?null:M(e)}getSpatialReferenceSupport(e,t){let n=this._predeterminedViewingMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,n):null,i=n?r(n):[...r(1)??[],...r(2)??[]];return i?.length?{constraints:i}:null}_validateSpatialReferenceForViewingMode(e,t,n){return Et(e,n)?t==null||E(t)?!0:!(D(t)&&mt(t,e,n)==null||O(t)&&n===1):!1}_makeSpatialReferenceConstraints(e,t,n,r){if(t==null)return[{spatialReference:e,viewingMode:n}];let{isWebMercator:i,isWGS84:a,vcsWkid:o,latestVcsWkid:s}=e,c=()=>o==null?i?w.WGS84:w.WebMercator:new w({...i?Oe:ke,vcsWkid:o,latestVcsWkid:s});return E(t)&&(i||a)?!(a&&r!==2)||ht(t.tileInfo,t.fullExtent,e,1)===null?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:[{spatialReference:c(),viewingMode:n}]:!D(t)&&!O(t)&&(i||a)?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:D(t)&&i&&n!==1?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:2}]:[{spatialReference:e,viewingMode:n}]}_validateSpatialReference(e){let t=this.getSpatialReferenceSupport(e)!=null,n=this._predeterminedViewingMode;return t||(n==null?e.isGeographic&&l.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${j(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error(`trackGraphicState`,`GraphicState.graphic must not be null or undefined to start tracking`),null;let t=this.getViewForGraphic(e.graphic),n=null,r=!1,i=t=>{!r&&t!=null&&`processor`in t&&t.processor?.type===`graphics-3d`&&t.processor.graphicsCore&&(n=t.processor.graphicsCore.trackGraphicState(e))};return t==null?this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),c(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error(`maskOccludee`,`GraphicState.graphic must not be null or undefined to mask an occludee`),null;let t=this.getViewForGraphic(e),n=null,r=!1,i=t=>{!r&&t!=null&&Tt(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),c(()=>{r=!0,n!=null&&(n.remove(),n=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>e.type!==`media-3d`).find(t=>t.layer===e.layer):null}graphicChanged(e){this.graphicsView!=null&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await ae(()=>this.graphicsView),this.graphicsView):!e.layer||!this.map?null:!t||!t.waitForLayer||this.map.allLayers.includes(e.layer)?this.whenLayerView(e.layer):new Promise((t,n)=>{let r=this.map.allLayers.on(`change`,i=>{i.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,n))})})}enableFeatureTiles(){let e=Symbol();return this._featureTileTreeClients.add(e),c(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){let n=new AbortController;this._importControllers.set(e,n),this._updatingChanged();try{let r=await It[e]();if(t&&(ne(this),d(n.signal),await t(n.signal)),this.destroyed)throw re();return d(n.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set(`basemapTerrain`,new V({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){let{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set(`basemapTerrain`,null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set(`pointsOfInterest`,new B({view:this})),this.addHandles([this.updatingHandles.add(()=>L.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&L.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=u(this._featureTreeDebugger))},g),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:n,featureTiles:r})=>{if(!r)return;let i=!!e;if(!n&&!i)r.filterExtent=null;else if(!i||!t)r.filterExtent=n;else{let i=e&&t?C(we(e,t),this.spatialReference):null;r.filterExtent=n?n.intersection(i):i}},g),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=u(this._featureTiles)},h)],Nt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has(`FeatureTileTree3D`))return;let e=(await this.updatingHandles.addPromise(this._importModule(`FeatureTileTree3D`)))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(J),this.removeHandles(Nt),this._featureTiles=u(this.featureTiles),this._set(`pointsOfInterest`,u(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){let e=this.spatialReference,t=this.state.isGlobal,n=Ee(t,e);n!==this.renderSpatialReference&&(this._set(`renderCoordsHelper`,ct.create(this.state.viewingMode,n)),t||this.addHandles(p(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&Ce(e,this.groundView.spatialReference,$,t)&&(this.renderCoordsHelper.extent=$)},h),J),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(H/this.renderCoordsHelper.unitInMeters))}else this._set(`renderCoordsHelper`,null)}_exitCoordinateSystem(){this.removeHandles(J),this._set(`renderCoordsHelper`,null)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(p(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),h),`updatingMonitors`),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,n){if(!this.overlay||!this.overlay.hasVisibleItems)return n;let r=e.getContext(`2d`,{willReadFrequently:!0});return r.putImageData(n,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,n.width,n.height)}_initStage(){let e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,n)=>this._renderScreenshotOverlay(e,t,n)}},t=new Qe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,t);let n=i(this.surface);this._stage=new vt({view:this,options:e,container:n}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),o(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new a(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(H/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=u(this.stage),this._set(`stage`,null),this.removeHandles(`stage`),this._set(`canvas`,null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new dt({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has(`GraphicsView3D`)||this.graphics.length===0)return;this.removeHandles(`GraphicsView3D`);let e=(await this.updatingHandles.addPromise(this._importModule(`GraphicsView3D`,e=>ae(()=>this.groundView?.ready,e))))?.default;e&&this._set(`graphicsView`,new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport(`GraphicsView3D`),this.removeHandles(`GraphicsView3D`),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set(`graphicsView`,null))}_disposeFocusAreasView(){this._abortImport(`FocusAreasView`),this.removeHandles(`FocusAreasView`),this.focusAreasView=u(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has(`FocusAreasView`)||e===0)return;this.removeHandles(`FocusAreasView`);let t=(await this.updatingHandles.addPromise(this._importModule(`FocusAreasView`)))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){M(this.viewingMode)===1&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(f(()=>this.graphics,`after-changes`,()=>this._ensureGraphicsView()),`GraphicsView3D`),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),`FocusAreasView`);let e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?me(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();let n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set(`ready`,!1)}get _defaultToMapOptions(){let e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(U);for(let t of this.allLayerViews)(k(t.layer)&&(!has(`enable-feature:im-as-ground`)||t.layer.isUsedAsGroundLayer)||je(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){let e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(U);for(let t of this.allLayerViews)(has(`enable-feature:im-as-ground`)?k(t.layer)&&t.layer.isUsedAsGroundLayer:k(t.layer))&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Mt(),ge(),ue(),St(),Xe(),Ve(),Se(),wt(),Ne(),_t(),xt(),Ze(),$e(),ve(),se(),bt(),gt(),Ke.cleanupI3SLodHandling(),Me.cleanupTilemapCache(),I.cleanupViewstate(),V.cleanupTerrainSurface()}};e([_({nonNullable:!0}),v(Pt)],Y.prototype,`options`,void 0),e([_()],Y.prototype,`_userClippingArea`,void 0),e([_()],Y.prototype,`_resourceController`,void 0),e([_()],Y.prototype,`stage`,null),e([_({readOnly:!0})],Y.prototype,`deconflictor`,void 0),e([_({readOnly:!0})],Y.prototype,`labeler`,void 0),e([_()],Y.prototype,`navigation`,void 0),e([_({type:Re,readOnly:!0})],Y.prototype,`animation`,null),e([_({readOnly:!0})],Y.prototype,`basemapTerrain`,void 0),e([_({readOnly:!0})],Y.prototype,`overlayManager`,null),e([_({readOnly:!0})],Y.prototype,`elevationProvider`,void 0),e([_()],Y.prototype,`camera`,null),e([_({type:t})],Y.prototype,`contentCamera`,null),e([_({readOnly:!0})],Y.prototype,`canvas`,null),e([_({type:S,useTypeForAutocast:!1})],Y.prototype,`center`,null),e([_({type:x})],Y.prototype,`clippingArea`,null),e([_({type:P,nonNullable:!0})],Y.prototype,`constraints`,void 0),e([_({type:x,readOnly:!0})],Y.prototype,`renderDataExtent`,null),e([_({readOnly:!0})],Y.prototype,`tileInfo`,null),e([_({type:x,readOnly:!0})],Y.prototype,`dataExtent`,null),e([_({type:x,readOnly:!0})],Y.prototype,`_groundAndLayersExtent`,null),e([_({type:F})],Y.prototype,`environment`,null),e([v(`environment`)],Y.prototype,`castEnvironment`,null),e([_({readOnly:!0})],Y.prototype,`environmentManager`,void 0),e([_({type:x})],Y.prototype,`extent`,null),e([_({type:r})],Y.prototype,`floors`,void 0),e([_()],Y.prototype,`screenCenter`,null),e([_()],Y.prototype,`frustum`,null),e([_({type:Number,readOnly:!0})],Y.prototype,`fullOpacity`,void 0),e([_({readOnly:!0})],Y.prototype,`graphicsView`,void 0),e([_()],Y.prototype,`analysisViewManager`,void 0),e([_()],Y.prototype,`groundView`,void 0),e([_({readOnly:!0})],Y.prototype,`layerviewCollections`,null),e([_({type:Boolean})],Y.prototype,`initialExtentRequired`,null),e([_()],Y.prototype,`defaultsFromMapSettings`,null),e([_()],Y.prototype,`interacting`,null),e([_()],Y.prototype,`stationary`,null),e([_()],Y.prototype,`navigating`,null),e([_()],Y.prototype,`map`,void 0),e([_()],Y.prototype,`padding`,null),e([_({type:B,readOnly:!0})],Y.prototype,`pointsOfInterest`,void 0),e([_()],Y.prototype,`_featureTiles`,void 0),e([_()],Y.prototype,`featureTiles`,null),e([_()],Y.prototype,`_featureTreeDebugger`,void 0),e([_({constructOnly:!0})],Y.prototype,`deactivatedWebGLExtensions`,void 0),e([_({constructOnly:!0})],Y.prototype,`debugWebGLExtensions`,void 0),e([_({constructOnly:!0})],Y.prototype,`renderCanvas`,void 0),e([_({constructOnly:!0})],Y.prototype,`state`,void 0),e([_()],Y.prototype,`screenSizePerspective`,void 0),e([_({readOnly:!0})],Y.prototype,`inputManager`,void 0),e([_({readOnly:!0})],Y.prototype,`stateManager`,void 0),e([_({type:[`low`,`medium`,`high`]})],Y.prototype,`qualityProfile`,null),e([_({type:z,get(){let e=this._get(`qualitySettings`);if(!e){let t=R(this.qualityProfile);e=new z(t)}return e}})],Y.prototype,`qualitySettings`,void 0),e([_()],Y.prototype,`slice`,void 0),e([_({readOnly:!0})],Y.prototype,`typeSpecificPreconditionsReady`,null),e([_({readOnly:!0})],Y.prototype,`renderCoordsHelper`,void 0),e([_({readOnly:!0})],Y.prototype,`sceneIntersectionHelper`,void 0),e([_({type:Number,readOnly:!0})],Y.prototype,`resolution`,null),e([_({type:Number})],Y.prototype,`scale`,null),e([_({readOnly:!0,type:Number})],Y.prototype,`terrainLevel`,null),e([_()],Y.prototype,`heightModelInfo`,null),e([_({type:w})],Y.prototype,`spatialReference`,void 0),e([_({type:Boolean,value:!1})],Y.prototype,`alphaCompositingEnabled`,null),e([_({constructOnly:!0})],Y.prototype,`preserveDrawingBufferEnabled`,void 0),e([_({type:Boolean})],Y.prototype,`supersampleScreenshotsEnabled`,void 0),e([_({readOnly:!0})],Y.prototype,`type`,void 0),e([_(),v(e=>e instanceof kt?e:b(At,e))],Y.prototype,`ui`,void 0),e([_({type:Boolean,readOnly:!0})],Y.prototype,`updating`,null),e([_()],Y.prototype,`_updatingObjects`,null),e([_()],Y.prototype,`_updatingObjectsWithProgress`,null),e([_()],Y.prototype,`_updatingObjectsToDebug`,null),e([_({type:Number,readOnly:!0})],Y.prototype,`updatingProgress`,void 0),e([_({type:[`global`,`local`]})],Y.prototype,`viewingMode`,null),e([_({type:n})],Y.prototype,`viewpoint`,null),e([_({readOnly:!0})],Y.prototype,`visibleArea`,null),e([_({type:Number})],Y.prototype,`zoom`,null),e([_({readOnly:!0})],Y.prototype,`quality`,null),e([_({readOnly:!0})],Y.prototype,`resolutionScale`,null),e([_()],Y.prototype,`focusAreasView`,void 0),e([_()],Y.prototype,`_defaultToMapOptions`,null),e([_()],Y.prototype,`_defaultHitTestOptions`,null),Y=q=e([pe(`esri.views.SceneView`)],Y);function X(e,t){return e!=null&&xe(e.spatialReference,t)?C(e,t):null}const Z=_e(),Q=le(),$=Te(),Ft=Ae(0,0,0,w.WebMercator),It={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},Lt=Y;export{Lt as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Camera.js";import n from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as i}from"../core/domUtils.js";import a from"../core/Error.js";import{on as o}from"../core/events.js";import{destroyHandle as s,makeHandle as c}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{mapCollectionAsync as ee}from"../core/mapCollectionUtils.js";import{destroyMaybe as u,maybeProperty as te}from"../core/maybe.js";import{throwIfDestroyed as ne,throwIfAborted as d,createAbortError as re}from"../core/promiseUtils.js";import ie from"../core/ReactiveSet.js";import{on as f,watch as p,initial as m,sync as h,whenOnce as ae,syncAndInitial as g}from"../core/reactiveUtils.js";import{setFrameDuration as oe,cleanupScheduling as se}from"../core/scheduling.js";import{createScreenPoint as ce,createScreenPointArray as le}from"../core/screenUtils.js";import{cleanupWhereClauseCache as ue}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as de,getMetersPerUnitForSR as fe}from"../core/units.js";import{property as _,cast as v,subclass as pe}from"../core/accessorSupport/decorators.js";import{ensureType as y,ensureClass as b}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as me}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as he}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as ge}from"../core/accessorSupport/trackingUtils.js";import{create as _e}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as ve}from"../core/libs/rbush/PooledRBush.js";import{initialize as ye}from"../core/workers/workers.js";import x from"../geometry/Extent.js";import be from"../geometry/HeightModelInfo.js";import S from"../geometry/Point.js";import{project as C,canProjectWithoutEngine as xe}from"../geometry/projectionUtils.js";import w from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Se}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as Ce}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as T}from"../geometry/projection/projectPointToVector.js";import{toExtent as we,create as Te}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Ee}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as De}from"../geometry/support/scaleUtils.js";import{wgs84 as Oe,webMercator as ke}from"../geometry/support/spatialReferenceUtils.js";import{makeDehydratedPoint as Ae}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as E,isTiledLayer as D,isVoxelLayer as O,isIntegratedMeshLayer as k,isGaussianSplatLayer as je}from"../layers/support/layerUtils.js";import{TilemapCache as Me}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as Ne}from"../portal/portalDefault.js";import{WebSceneTag as Pe}from"../support/tagSymbols.js";import{BreakpointsOwner as Fe}from"./BreakpointsOwner.js";import{DOMContainer as Ie}from"./DOMContainer.js";import{PopupView as Le}from"./PopupView.js";import A from"./View.js";import Re from"./ViewAnimation.js";import{stringFromViewingMode as j,viewingModeFromString as M}from"./ViewingMode.js";import{GroundView3D as ze}from"./3d/GroundView3D.js";import{layerView3DImporter as N}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as Be}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as Ve}from"./3d/camera/intersectionUtils.js";import P from"./3d/constraints/Constraints.js";import F from"./3d/environment/Environment.js";import{EnvironmentView as He}from"./3d/environment/EnvironmentView.js";import Ue from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as We}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Ge}from"./3d/layers/graphics/Labeler.js";import Ke from"./3d/layers/i3s/I3SLodHandling.js";import{Navigation3D as qe}from"./3d/navigation/Navigation3D.js";import{ScreenSizePerspective as Je}from"./3d/state/ScreenSizePerspective.js";import I from"./3d/state/ViewState.js";import{ViewStateManager as Ye,cleanupViewStateManager as Xe}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Ze}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Qe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as $e}from"./3d/state/utils/navigationUtils.js";import et from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as tt}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as L}from"./3d/support/debugFlags.js";import{getElevationAtPoint as nt}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as rt}from"./3d/support/GroundAndIMSurface.js";import{toMap as it,hitTest as at}from"./3d/support/hitTest.js";import{popupHitTest as ot}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as st,getQualityProfileSettings as R}from"./3d/support/QualityProfile.js";import z from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as ct}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as lt}from"./3d/support/ResourceController.js";import ut from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as dt}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as ft}from"./3d/support/ViewSlice.js";import{PointsOfInterest as B}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import V from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as pt,getTiledLayerInfo as mt,checkIfTileInfoSupportedForView as ht}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as gt}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as _t}from"./3d/terrain/TileRenderer.js";import{Stage as vt}from"./3d/webgl-engine/Stage.js";import{olidEnabled as yt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as bt}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{defaultTolerance as H}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as xt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as U}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as St}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import W from"./interactive/options/ViewOptions.js";import Ct from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as wt}from"./support/drapedUtils.js";import{occludeesSupported as Tt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as G,createScreenPointFromSupportedEvent as K}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Et}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as Dt,destroyTextureCompressionWorker as Ot}from"./support/TextureCompressionHelper.js";import kt from"./ui/DefaultUI.js";import At from"./ui/3d/DefaultUI3D.js";import jt from"../webscene/Environment.js";import{clearVNodeCache as Mt}from"../widgets/support/vnodeCache.js";var q;const Nt=Symbol(),J=Symbol();function Pt(e){let t=b(W,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let Y=class extends Fe(Le(Ie(A))){static{q=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new W({snapping:{enabled:!0}}),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=lt(this),this.deconflictor=new We({view:this}),this.attribution3D=new et({view:this}),this.labeler=new Ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new qe({view:this}),this.basemapTerrain=null,this.elevationProvider=new tt({view:this}),this._canvas=null,this.constraints=new P,this._environment=new F,this.environmentView=new He,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Ct({importAnalysisViewModule:e=>Be(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new ie,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new I({view:this}),this.slice=new ft,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type=`3d`,this.ui=new At,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,ye();let t=()=>this._updatingChanged();this.addHandles(s(ee(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([f(()=>this.map?.allLayers,`after-changes`,t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on(`after-changes`,e=>this._updateUpdatingMonitors(e)),p(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Ue({view:this}),this.stateManager=new Ye({view:this}),this.screenSizePerspective=new Je({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=Dt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ze({view:this}),this.groundAndIMSurface=new rt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>oe(e>0?1e3/Math.ceil(e):0),m),this.addHandles([p(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),h),p(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),h)])}destroy(){this.destroyed||(Ot(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set(`analysisViewManager`,u(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=u(this.sharedSymbolResources),this._set(`labeler`,u(this.labeler)),this._set(`deconflictor`,u(this.deconflictor)),this._resourceController=u(this._resourceController),this._set(`stateManager`,u(this.stateManager)),this._set(`inputManager`,u(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles(`updatingMonitors`),this._set(`environmentView`,u(this.environmentView)),this._set(`environment`,u(this.environment)),this.groundView=u(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set(`ui`,null),this._set(`renderCanvas`,null),this._set(`canvas`,null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=y(S,e))}get clippingArea(){if(this.viewingMode===`global`)return null;let e=this.map,t=this._userClippingArea||te(e,`clippingArea`);return!(this._userClippingArea||te(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof x?this.spatialReference&&(t=X(t,this.spatialReference),t==null)?(l.getLogger(this).error(`#clippingArea`,`setting clippingArea with incompatible SpatialReference`),this._clippingArea):(t=t.clone(),t.intersection(this._groundAndLayersExtent)??(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.viewingMode===`global`&&e!=null?l.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===1)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:X(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent,t=this.spatialReference||w.WGS84,n=X(this.clippingArea,t);n!=null&&(e=e==null?n:e.intersection(n));let r=this._get(`dataExtent`);return e!=null&&e.equals(r)?r:e}get _groundAndLayersExtent(){let e=this.spatialReference||w.WGS84,t,n=n=>{let r=X(n,e);r!=null&&(t==null?t=r.clone():t.union(r))},{groundView:r}=this,i=r?.spatialReference,a=r?.fullGroundExtent;i&&a&&n(new x({xmin:a[0],ymin:a[1],zmin:0,xmax:a[2],ymax:a[3],zmax:0,spatialReference:i}));let o=e=>{e.fullExtent!=null&&(e.type!==`graphics`||!e.internal)&&n(e.fullExtent)};if(this.map?.allLayers.forEach(e=>o(e)),t==null)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);let s=this._get(`_groundAndLayersExtent`);return t.equals(s)?s:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;let{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange(`environment`)}castEnvironment(e){return e?e instanceof F?e:e instanceof jt?this.environment?.cloneWithWebsceneEnvironment(e)??F.fromWebsceneEnvironment(e):y(F,e):new F}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return q._layerToLayerview}static{this._layerToLayerview=A._layerToLayerview.concat([[`view.map.ground.layers`,`view.groundView.layerViews`]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&Pe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){let t=R(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new z(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set(`qualityProfile`,e))}get qualityProfile(){return this._get(`qualityProfile`)||st()}_updateSlice(){this.stage!=null&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){let{scale:e,spatialReference:t}=this;return t?he(()=>De(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){let e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;let n=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return n<=0?null:Math.max(0,Math.min(n,r||1/0))}get heightModelInfo(){let e=this.getDefaultHeightModelInfo();if(!e)return null;let t=de(this.spatialReference);if(t&&e.heightUnit!==t)return new be({heightModel:e.heightModel,heightUnit:t,vertCRS:e.vertCRS,associatedSpatialReference:e.associatedSpatialReference});if(!e.associatedSpatialReference){let t=e.clone();return t.associatedSpatialReference=this.spatialReference,t}return e}get alphaCompositingEnabled(){return this._get(`alphaCompositingEnabled`)}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn(`alphaCompositingEnabled cannot be changed after the view has become ready`),this._set(`alphaCompositingEnabled`,e)}get updating(){if(this.destroying||this.destroyed)return!1;if(!this.initialized)return!0;let e=0,t=this.layerViewManager.updating,n=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(!r.isFulfilled())++n;else if(r.updating){if(t=!0,r.suspended||pt(r))return;++n,e+=r.updatingProgress}});let r=.1;for(let t of this._updatingObjects)t?.updating&&(n+=r,e+=.5*r);for(let t of this._updatingObjectsWithProgress)t?.updating&&(++n,e+=t.updatingProgress);let i=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||i||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(n,this._numUpdating),e+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=+!t,this._get(`updatingProgress`)!==e){let n=performance.now();if(e<1){let t=Math.min((n-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set(`updatingProgress`,e),this._lastUpdateTime=t&&e<1?n:0}return L.UPDATING&&console.log(`Updating:`,this._updatingObjectsToDebug.filter(e=>e!=null&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentView,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return L.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedViewingMode;if(e!=null)return j(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?j(this.defaultsFromMap.viewingMode):Et(t,1)?`global`:`local`:`global`}set viewingMode(e){this.ready?l.getLogger(this).error(`#viewingMode`,`viewingMode cannot be set once view is ready`):this._overrideIfSome(`viewingMode`,e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new ut(this)}on(e,t,n,r){return this.viewEvents.on(e,t,n,r)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=G(e)?K(this,e):e;return it(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error(`#toScreen()`,`Scene view cannot be used before it is ready`),null;let t=e;return e.z??(t=Ft,t.x=e.x,t.y=e.y,t.z=nt(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),T(t,Z,this.renderSpatialReference),this.state.camera.projectToScreen(Z,Q),ce(Q[0],Q[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;T(e,Z,n);let r=this.state.camera.computeScreenPixelSizeAt(Z);return t&&n!==t?r*fe(n)/fe(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=G(e)?K(this,e):e;return at(this,n,t,this._defaultHitTestOptions)}async popupHitTest(e){return ot(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return this.navigation.zoom(!0)}async zoomOut(){if(this.canZoomOut)return this.navigation.zoom(!1)}async whenAnalysisView(e){if(e.parent==null)throw new a(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});switch(e.parent.type){case`line-of-sight`:case`dimension`:case`viewshed`:return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encode(n,t,this._pixelFormat())}async _takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encodeData(n,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){let t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();let n=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import(`./support/screenshotUtils.js`);return[r(n[0],this._pixelFormat()),r(n[1],this._pixelFormat())]}async _completeSettings(e){let{toRenderSettings:t,screenshotSuperSampleSettings:n}=await import(`./support/screenshotUtils.js`),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,n(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!yt())throw new a(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`);let{encode:t}=await import(`./support/screenshotUtils.js`),n=await this._completeSettings(e);n.olidColor=!0,await this.whenReady();let r=await this.stage.renderView.takeScreenshot(n),i=t(r[0],n,this._pixelFormat()),o=await this._completeSettings(e);return o.format=`png`,[i,t(r[1],o,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new a(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return N.importLayerView(e)}hasLayerViewModule(e){return N.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedViewingMode(){let e=this._isOverridden(`viewingMode`)?this._get(`viewingMode`):this.scene?.initialViewProperties?.viewingMode;return e==null?null:M(e)}getSpatialReferenceSupport(e,t){let n=this._predeterminedViewingMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,n):null,i=n?r(n):[...r(1)??[],...r(2)??[]];return i?.length?{constraints:i}:null}_validateSpatialReferenceForViewingMode(e,t,n){return Et(e,n)?t==null||E(t)?!0:!(D(t)&&mt(t,e,n)==null||O(t)&&n===1):!1}_makeSpatialReferenceConstraints(e,t,n,r){if(t==null)return[{spatialReference:e,viewingMode:n}];let{isWebMercator:i,isWGS84:a,vcsWkid:o,latestVcsWkid:s}=e,c=()=>o==null?i?w.WGS84:w.WebMercator:new w({...i?Oe:ke,vcsWkid:o,latestVcsWkid:s});return E(t)&&(i||a)?!(a&&r!==2)||ht(t.tileInfo,t.fullExtent,e,1)===null?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:[{spatialReference:c(),viewingMode:n}]:!D(t)&&!O(t)&&(i||a)?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:D(t)&&i&&n!==1?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:2}]:[{spatialReference:e,viewingMode:n}]}_validateSpatialReference(e){let t=this.getSpatialReferenceSupport(e)!=null,n=this._predeterminedViewingMode;return t||(n==null?e.isGeographic&&l.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${j(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error(`trackGraphicState`,`GraphicState.graphic must not be null or undefined to start tracking`),null;let t=this.getViewForGraphic(e.graphic),n=null,r=!1,i=t=>{!r&&t!=null&&`processor`in t&&t.processor?.type===`graphics-3d`&&t.processor.graphicsCore&&(n=t.processor.graphicsCore.trackGraphicState(e))};return t==null?this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),c(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error(`maskOccludee`,`GraphicState.graphic must not be null or undefined to mask an occludee`),null;let t=this.getViewForGraphic(e),n=null,r=!1,i=t=>{!r&&t!=null&&Tt(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),c(()=>{r=!0,n!=null&&(n.remove(),n=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>e.type!==`media-3d`).find(t=>t.layer===e.layer):null}graphicChanged(e){this.graphicsView!=null&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await ae(()=>this.graphicsView),this.graphicsView):!e.layer||!this.map?null:!t||!t.waitForLayer||this.map.allLayers.includes(e.layer)?this.whenLayerView(e.layer):new Promise((t,n)=>{let r=this.map.allLayers.on(`change`,i=>{i.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,n))})})}enableFeatureTiles(){let e=Symbol();return this._featureTileTreeClients.add(e),c(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){let n=new AbortController;this._importControllers.set(e,n),this._updatingChanged();try{let r=await It[e]();if(t&&(ne(this),d(n.signal),await t(n.signal)),this.destroyed)throw re();return d(n.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set(`basemapTerrain`,new V({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){let{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set(`basemapTerrain`,null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set(`pointsOfInterest`,new B({view:this})),this.addHandles([this.updatingHandles.add(()=>L.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&L.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=u(this._featureTreeDebugger))},g),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:n,featureTiles:r})=>{if(!r)return;let i=!!e;if(!n&&!i)r.filterExtent=null;else if(!i||!t)r.filterExtent=n;else{let i=e&&t?C(we(e,t),this.spatialReference):null;r.filterExtent=n?n.intersection(i):i}},g),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=u(this._featureTiles)},h)],Nt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has(`FeatureTileTree3D`))return;let e=(await this.updatingHandles.addPromise(this._importModule(`FeatureTileTree3D`)))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(J),this.removeHandles(Nt),this._featureTiles=u(this.featureTiles),this._set(`pointsOfInterest`,u(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){let e=this.spatialReference,t=this.state.isGlobal,n=Ee(t,e);n!==this.renderSpatialReference&&(this._set(`renderCoordsHelper`,ct.create(this.state.viewingMode,n)),t||this.addHandles(p(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&Ce(e,this.groundView.spatialReference,$,t)&&(this.renderCoordsHelper.extent=$)},h),J),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(H/this.renderCoordsHelper.unitInMeters))}else this._set(`renderCoordsHelper`,null)}_exitCoordinateSystem(){this.removeHandles(J),this._set(`renderCoordsHelper`,null)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(p(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),h),`updatingMonitors`),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,n){if(!this.overlay||!this.overlay.hasVisibleItems)return n;let r=e.getContext(`2d`,{willReadFrequently:!0});return r.putImageData(n,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,n.width,n.height)}_initStage(){let e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,n)=>this._renderScreenshotOverlay(e,t,n)}},t=new Qe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,t);let n=i(this.surface);this._stage=new vt({view:this,options:e,container:n}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),o(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new a(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(H/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=u(this.stage),this._set(`stage`,null),this.removeHandles(`stage`),this._set(`canvas`,null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new dt({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has(`GraphicsView3D`)||this.graphics.length===0)return;this.removeHandles(`GraphicsView3D`);let e=(await this.updatingHandles.addPromise(this._importModule(`GraphicsView3D`,e=>ae(()=>this.groundView?.ready,e))))?.default;e&&this._set(`graphicsView`,new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport(`GraphicsView3D`),this.removeHandles(`GraphicsView3D`),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set(`graphicsView`,null))}_disposeFocusAreasView(){this._abortImport(`FocusAreasView`),this.removeHandles(`FocusAreasView`),this.focusAreasView=u(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has(`FocusAreasView`)||e===0)return;this.removeHandles(`FocusAreasView`);let t=(await this.updatingHandles.addPromise(this._importModule(`FocusAreasView`)))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){M(this.viewingMode)===1&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(f(()=>this.graphics,`after-changes`,()=>this._ensureGraphicsView()),`GraphicsView3D`),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),`FocusAreasView`);let e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?me(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentView.connectView(this),this.inputManager.connect();let n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentView.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set(`ready`,!1)}get _defaultToMapOptions(){let e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(U);for(let t of this.allLayerViews)(k(t.layer)&&(!has(`enable-feature:im-as-ground`)||t.layer.isUsedAsGroundLayer)||je(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){let e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(U);for(let t of this.allLayerViews)(has(`enable-feature:im-as-ground`)?k(t.layer)&&t.layer.isUsedAsGroundLayer:k(t.layer))&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Mt(),ge(),ue(),St(),Xe(),Ve(),Se(),wt(),Ne(),_t(),xt(),Ze(),$e(),ve(),se(),bt(),gt(),Ke.cleanupI3SLodHandling(),Me.cleanupTilemapCache(),I.cleanupViewstate(),V.cleanupTerrainSurface()}};e([_({nonNullable:!0}),v(Pt)],Y.prototype,`options`,void 0),e([_()],Y.prototype,`_userClippingArea`,void 0),e([_()],Y.prototype,`_resourceController`,void 0),e([_()],Y.prototype,`stage`,null),e([_({readOnly:!0})],Y.prototype,`deconflictor`,void 0),e([_({readOnly:!0})],Y.prototype,`labeler`,void 0),e([_()],Y.prototype,`navigation`,void 0),e([_({type:Re,readOnly:!0})],Y.prototype,`animation`,null),e([_({readOnly:!0})],Y.prototype,`basemapTerrain`,void 0),e([_({readOnly:!0})],Y.prototype,`overlayManager`,null),e([_({readOnly:!0})],Y.prototype,`elevationProvider`,void 0),e([_()],Y.prototype,`camera`,null),e([_({type:t})],Y.prototype,`contentCamera`,null),e([_({readOnly:!0})],Y.prototype,`canvas`,null),e([_({type:S,useTypeForAutocast:!1})],Y.prototype,`center`,null),e([_({type:x})],Y.prototype,`clippingArea`,null),e([_({type:P,nonNullable:!0})],Y.prototype,`constraints`,void 0),e([_({type:x,readOnly:!0})],Y.prototype,`renderDataExtent`,null),e([_({readOnly:!0})],Y.prototype,`tileInfo`,null),e([_({type:x,readOnly:!0})],Y.prototype,`dataExtent`,null),e([_({type:x,readOnly:!0})],Y.prototype,`_groundAndLayersExtent`,null),e([_({type:F})],Y.prototype,`environment`,null),e([v(`environment`)],Y.prototype,`castEnvironment`,null),e([_({readOnly:!0})],Y.prototype,`environmentView`,void 0),e([_({type:x})],Y.prototype,`extent`,null),e([_({type:r})],Y.prototype,`floors`,void 0),e([_()],Y.prototype,`screenCenter`,null),e([_()],Y.prototype,`frustum`,null),e([_({type:Number,readOnly:!0})],Y.prototype,`fullOpacity`,void 0),e([_({readOnly:!0})],Y.prototype,`graphicsView`,void 0),e([_()],Y.prototype,`analysisViewManager`,void 0),e([_()],Y.prototype,`groundView`,void 0),e([_({readOnly:!0})],Y.prototype,`layerviewCollections`,null),e([_({type:Boolean})],Y.prototype,`initialExtentRequired`,null),e([_()],Y.prototype,`defaultsFromMapSettings`,null),e([_()],Y.prototype,`interacting`,null),e([_()],Y.prototype,`stationary`,null),e([_()],Y.prototype,`navigating`,null),e([_()],Y.prototype,`map`,void 0),e([_()],Y.prototype,`padding`,null),e([_({type:B,readOnly:!0})],Y.prototype,`pointsOfInterest`,void 0),e([_()],Y.prototype,`_featureTiles`,void 0),e([_()],Y.prototype,`featureTiles`,null),e([_()],Y.prototype,`_featureTreeDebugger`,void 0),e([_({constructOnly:!0})],Y.prototype,`deactivatedWebGLExtensions`,void 0),e([_({constructOnly:!0})],Y.prototype,`debugWebGLExtensions`,void 0),e([_({constructOnly:!0})],Y.prototype,`renderCanvas`,void 0),e([_({constructOnly:!0})],Y.prototype,`state`,void 0),e([_()],Y.prototype,`screenSizePerspective`,void 0),e([_({readOnly:!0})],Y.prototype,`inputManager`,void 0),e([_({readOnly:!0})],Y.prototype,`stateManager`,void 0),e([_({type:[`low`,`medium`,`high`]})],Y.prototype,`qualityProfile`,null),e([_({type:z,get(){let e=this._get(`qualitySettings`);if(!e){let t=R(this.qualityProfile);e=new z(t)}return e}})],Y.prototype,`qualitySettings`,void 0),e([_()],Y.prototype,`slice`,void 0),e([_({readOnly:!0})],Y.prototype,`typeSpecificPreconditionsReady`,null),e([_({readOnly:!0})],Y.prototype,`renderCoordsHelper`,void 0),e([_({readOnly:!0})],Y.prototype,`sceneIntersectionHelper`,void 0),e([_({type:Number,readOnly:!0})],Y.prototype,`resolution`,null),e([_({type:Number})],Y.prototype,`scale`,null),e([_({readOnly:!0,type:Number})],Y.prototype,`terrainLevel`,null),e([_()],Y.prototype,`heightModelInfo`,null),e([_({type:w})],Y.prototype,`spatialReference`,void 0),e([_({type:Boolean,value:!1})],Y.prototype,`alphaCompositingEnabled`,null),e([_({constructOnly:!0})],Y.prototype,`preserveDrawingBufferEnabled`,void 0),e([_({type:Boolean})],Y.prototype,`supersampleScreenshotsEnabled`,void 0),e([_({readOnly:!0})],Y.prototype,`type`,void 0),e([_(),v(e=>e instanceof kt?e:b(At,e))],Y.prototype,`ui`,void 0),e([_({type:Boolean,readOnly:!0})],Y.prototype,`updating`,null),e([_()],Y.prototype,`_updatingObjects`,null),e([_()],Y.prototype,`_updatingObjectsWithProgress`,null),e([_()],Y.prototype,`_updatingObjectsToDebug`,null),e([_({type:Number,readOnly:!0})],Y.prototype,`updatingProgress`,void 0),e([_({type:[`global`,`local`]})],Y.prototype,`viewingMode`,null),e([_({type:n})],Y.prototype,`viewpoint`,null),e([_({readOnly:!0})],Y.prototype,`visibleArea`,null),e([_({type:Number})],Y.prototype,`zoom`,null),e([_({readOnly:!0})],Y.prototype,`quality`,null),e([_({readOnly:!0})],Y.prototype,`resolutionScale`,null),e([_()],Y.prototype,`focusAreasView`,void 0),e([_()],Y.prototype,`_defaultToMapOptions`,null),e([_()],Y.prototype,`_defaultHitTestOptions`,null),Y=q=e([pe(`esri.views.SceneView`)],Y);function X(e,t){return e!=null&&xe(e.spatialReference,t)?C(e,t):null}const Z=_e(),Q=le(),$=Te(),Ft=Ae(0,0,0,w.WebMercator),It={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},Lt=Y;export{Lt as default};
|
package/views/draw/Draw.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ export type ToolType = "point" | "polygon" | "polyline" | "multipoint" | "rectan
|
|
|
87
87
|
* view.graphics.removeAll();
|
|
88
88
|
*
|
|
89
89
|
* let line = createLine(vertices);
|
|
90
|
-
* let lineLength =
|
|
90
|
+
* let lineLength = geodesicLengthExecute(line, { unit: "miles" });
|
|
91
91
|
* let graphic = createGraphic(line);
|
|
92
92
|
* view.graphics.add(graphic);
|
|
93
93
|
* }
|