@arcgis/core 5.0.0-next.14 → 5.0.0-next.16
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/PopupTemplate.js +1 -1
- package/applications/Components/QuantityFormatter.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{5299ec59c86022ca37e2.js → 080268f78436a2f0d996.js} +1 -1
- package/assets/esri/core/workers/chunks/{a6ee40dfc471d6612f3c.js → 1585298168c200d65c2f.js} +1 -1
- package/assets/esri/core/workers/chunks/{34bb4852ebef0f529c96.js → 1a98e35837c6279fd8ee.js} +1 -1
- package/assets/esri/core/workers/chunks/5608e1eeec887295dc7c.js +1 -0
- package/assets/esri/core/workers/chunks/57262321c51096ef885f.js +1 -0
- package/assets/esri/core/workers/chunks/58d891779f04b6d12fc0.js +1 -0
- package/assets/esri/core/workers/chunks/{7c14f99e6cfff2a8ef4a.js → 5a7bb13ccb9188f90dfd.js} +1 -1
- package/assets/esri/core/workers/chunks/607beb12592f99871bf9.js +1 -0
- package/assets/esri/core/workers/chunks/71d9e9b0a7f8c0edd32d.js +1 -0
- package/assets/esri/core/workers/chunks/{8be16b03caa947ac7631.js → 79326e3ebd5081046f79.js} +1 -1
- package/assets/esri/core/workers/chunks/7c08c0824ad354177787.js +1 -0
- package/assets/esri/core/workers/chunks/{54c49a768147720c3c56.js → 8208dfa8f7fae7e616b9.js} +1 -1
- package/assets/esri/core/workers/chunks/{d7755c4c8d1d3059efca.js → 847f4fc39100fac1df01.js} +1 -1
- package/assets/esri/core/workers/chunks/8b73db0f4d6714396eb0.js +1 -0
- package/assets/esri/core/workers/chunks/{9cdd087c43a601ec331d.js → 9a7f7de06dbc37661ffb.js} +1 -1
- package/assets/esri/core/workers/chunks/{55adbd7481f8dfb1067e.js → a174c9f6bc687349e563.js} +1 -1
- package/assets/esri/core/workers/chunks/{38fa50336983265c73a4.js → bc318b6fef192cee2a72.js} +1 -1
- package/assets/esri/core/workers/chunks/{57806a01f33074b601e7.js → cdb4664fd59860ddeb5a.js} +1 -1
- package/assets/esri/core/workers/chunks/d98203c932a60f9f809d.js +1 -0
- package/assets/esri/core/workers/chunks/{5e08b19e6d7202ea38d7.js → db900e8949cc75e72b18.js} +1 -1
- package/assets/esri/core/workers/chunks/de831a9cb542a09db5c3.js +1 -0
- package/assets/esri/core/workers/chunks/{2166238a7ad63a2d43c7.js → e05ce6f91ca59e34da7c.js} +1 -1
- package/assets/esri/core/workers/chunks/{f28ffda9a95c6568503d.js → e07dda45281439e6582e.js} +1 -1
- package/assets/esri/core/workers/chunks/{d888ae5ac1810a486919.js → ff8752dbcb014ea66806.js} +1 -1
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/config.js +1 -1
- package/copyright.txt +0 -60
- package/core/SetUtils.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/accessorSupport/extensions/serializableProperty/reader.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/interfaces.d.ts +107 -11
- package/intl.js +1 -1
- package/kernel.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/support/NumberFieldFormat.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterFunctionUtils.js +1 -1
- package/package.json +1 -1
- package/popup/content.js +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/renderers/support/numberUtils.js +1 -1
- package/rest/geometryService.js +1 -1
- package/rest/geoprocessor.js +1 -1
- package/rest/imageService.js +1 -1
- package/rest/locator.js +1 -1
- package/rest/query.js +1 -1
- package/smartMapping/labels/bins.js +1 -1
- package/smartMapping/popup/support/clusterUtils.js +1 -1
- package/smartMapping/popup/support/utils.js +1 -1
- package/smartMapping/renderers/support/utils.js +1 -1
- package/support/BasemapStyle.js +1 -1
- package/support/actions/actionUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/svgUtils.js +1 -1
- package/tables/elements.js +1 -1
- package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
- package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +14 -32
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +17 -0
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +10 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js +26 -0
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +5 -0
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +5 -0
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/input/gamepad/GamepadInputDevice.js +1 -1
- package/views/input/gamepad/GamepadSource.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/interactive/tooltip/components/TooltipField.js +1 -1
- package/views/interactive/tooltip/components/ValueByValue.js +1 -1
- package/views/interactive/tooltip/content/Fields.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawCircle.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawMesh.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawRectangle.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentElevation.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentMovePoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentSelectedVertex.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformMesh.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateXY.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateZ.js +1 -1
- package/views/overlay/BoxOverlayItem.js +1 -1
- package/views/overlay/CrosshairOverlayItem.js +1 -1
- package/views/overlay/OutlineOverlayItem.js +1 -1
- package/views/ui/UI.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/Attribution.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Compass.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/DirectionalPad.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflowData.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
- package/widgets/Editor/components/FeatureList.js +1 -1
- package/widgets/Editor/components/FooterActions.js +1 -1
- package/widgets/Editor/components/MergeFeaturesList.js +1 -1
- package/widgets/Editor/components/Notices.js +1 -1
- package/widgets/Editor/components/PanelContent.js +1 -1
- package/widgets/Editor/components/PanelToolbar.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/Editor/components/Prompt.js +1 -1
- package/widgets/Editor/components/Settings.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/components/UploadDetails.js +1 -1
- package/widgets/Editor/components/workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js +1 -1
- package/widgets/Editor/support/errors.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/components/Legend.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
- package/widgets/ElevationProfile/components/Statistics.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureAttachments.js +1 -1
- package/widgets/Feature/FeatureContent.js +1 -1
- package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureFields.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
- package/widgets/Feature/support/FeatureContentMixin.js +1 -1
- package/widgets/Feature/support/FeatureElementInfo.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/AssociationDetails.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter.js +1 -1
- package/widgets/FovOverlay.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/Histogram.js +1 -1
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/Home.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/card/ColorRamp.js +1 -1
- package/widgets/Legend/styles/card/LegendElement.js +1 -1
- package/widgets/Legend/styles/card/SizeRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
- package/widgets/Legend/styles/classic/LegendElement.js +1 -1
- package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
- package/widgets/Legend/styles/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/styles/support/univariateUtils.js +1 -1
- package/widgets/Legend/styles/support/utils.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/support/styleUtils.js +1 -1
- package/widgets/Legend/support/utils.js +1 -1
- package/widgets/Legend.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/Locate/LocateViewModel.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/Alert.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationSettings.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
- package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/ImageMeasurementMixin.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Print/FileLink.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleBar.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/Search/support/layerSearchUtils.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
- package/widgets/ShadowCast/components/DurationConfigurator.js +1 -1
- package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
- package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/MeasuredContentGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Spinner.js +1 -1
- package/widgets/Swipe.js +1 -1
- package/widgets/TableList/ListItemPanel.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/TimeZoneLabel.js +1 -1
- package/widgets/Track.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +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.js +1 -1
- package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
- package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
- package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
- package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
- package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
- package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
- package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/widgets/Weather/LabeledSlider.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ClassedColorSlider.js +1 -1
- package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSlider.js +1 -1
- package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
- package/widgets/smartMapping/HeatmapSlider.js +1 -1
- package/widgets/smartMapping/OpacitySlider.js +1 -1
- package/widgets/smartMapping/SizeSlider.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/Heading.js +1 -1
- package/widgets/support/ItemList.js +1 -1
- package/widgets/support/LabeledSwitch.js +1 -1
- package/widgets/support/MeasurementWidgetContent.js +1 -1
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList/selectionListUtils.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/SketchTooltipControls.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/TimezonePicker.js +1 -1
- package/widgets/support/UnitSelect.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utils/formatPercentAlong.js +1 -1
- package/widgets/support/chartUtilsAm5.js +1 -1
- package/widgets/support/dateUtils.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/widgets/support/widget.js +1 -1
- package/assets/esri/core/workers/chunks/097e5deb51ee7e25e654.js +0 -1
- package/assets/esri/core/workers/chunks/3edffdb0e282ed562ac7.js +0 -1
- package/assets/esri/core/workers/chunks/8fc82fe1fcbcedf35400.js +0 -1
- package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +0 -1
- package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +0 -1
- package/assets/esri/core/workers/chunks/c4dfd897bcab20dee43b.js +0 -1
- package/assets/esri/core/workers/chunks/c68935ed44eb0702a6ba.js +0 -1
- package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +0 -1
- package/assets/esri/core/workers/chunks/fd88e07cba5964f80e9e.js +0 -1
- package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +0 -5
- package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +0 -5
- package/widgets/support/jsxFactory.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import i from"../../../../../core/PooledArray.js";import{isTypedArray as o}from"../../../../../core/typedArrayUtil.js";import{s as n}from"../../../../../chunks/vec32.js";import{clone as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as s}from"../../../../../geometry/support/aaBoundingBox.js";import{compactIndices as a}from"../../../../../geometry/support/Indices.js";import{c}from"../../../../../chunks/vec3.js";import{c as l}from"../../../../../chunks/vec33.js";import{encodeSymbolColor as m}from"../../../layers/support/symbolColorUtils.js";import{computeOffsetObb as h}from"../../../support/orientedBoundingBox.js";import{glLayout as f}from"../../../support/buffer/glUtil.js";import{ComponentData as p}from"./ComponentData.js";import{ComponentObject as g}from"./ComponentObject.js";import{IntersectionGeometry as u}from"./IntersectionGeometry.js";import{Renderable as d}from"./Renderable.js";import{RenderGeometry as b}from"./RenderGeometry.js";import{RenderSubmitSystem as v}from"./RenderSubmitSystem.js";import{createVertexBufferLayout as y}from"./SourceGeometry.js";import{UniformComponentParameters as _}from"./UniformComponentParameters.js";import{ComponentParametersVarying as C,ComponentParametersUniform as M,ComponentMaterial as w}from"./Material/ComponentMaterial.js";import{indexGlLayout as j}from"./Material/ComponentTechnique.js";import{maxElevationOffset as x,maxPackedRGBEmission as O}from"./Material/shader/ComponentData.glsl.js";import{olidEnabled as D}from"../../effects/geometry/olidUtils.js";import{getVisibility as S,updatePickabilityWithCount as R}from"../../lib/ComponentUtils.js";import{VertexArrayObject as A}from"../../lib/VertexArrayObject.js";import{getVerticalOffsetI3S as P}from"../../lib/verticalOffsetUtils.js";import{BufferManager as V}from"../../lib/TextureBackedBuffer/BufferManager.js";import{BufferObject as B}from"../../../../webgl/BufferObject.js";import{PrimitiveType as E}from"../../../../webgl/enums.js";import{VertexBuffer as H}from"../../../../webgl/VertexBuffer.js";const U=()=>e.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class I{constructor(e,t){this._renderManager=e,this._viewingMode=t,this._elevationRangeCacheVerticalOffset=NaN,this._elevationRangeCacheMin=NaN,this._elevationRangeCacheMax=NaN,this._activeHighlightOptions=new Map,this._visible=new i,this._hidden=new i,this._renderSubmit=new v(this),this._renderManager.register(this._renderSubmit),this._componentBufferManager=new V(e.rctx,N())}destroy(){this._componentBufferManager.destroy(),this._componentBufferManager=null,this._visible.forAll(e=>e.destroy()),this._visible.prune(),this._hidden.forAll(e=>e.destroy()),this._hidden.prune(),this._renderSubmit.destroy()}createObject(e){const{geometry:t}=e,i=new p(this._componentBufferManager,a(t.componentOffsets)),o=this._createRenderable(e,i),n=new u(this._viewingMode,t.positionData,i,e.elevationAlignable),r=new g(e.transform,e.obb.clone(),i,o,n);return(r.visible?this._visible:this._hidden).push(r),r}destroyObject(e){const t=e;(t.visible?this._visible:this._hidden).removeUnordered(t),t.destroy(),this._notifyDirty()}setObjectVisibility(e,t){const i=e;t!==i.visible&&(t?(this._hidden.removeUnordered(i),this._visible.push(i)):(this._visible.removeUnordered(i),this._hidden.push(i)),i.visible=t,this._notifyDirty())}preSubmit(e){const t=e.camera.eye;this.visibleObjects.forAll(e=>e.renderable.meta.cameraDepthSquared=n(t,e.obb.center))}getMaterial(e){return e.renderable.material}updateMaterial(e,t){const i=e.renderable.material;t(i),i.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,t){const i=e;i.componentData.visibility.reset(t),i.componentData.markVisibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,t){return e.componentData.visibility.forEachComponent(t)}getComponentCount(e){const t=e,i=t.componentData.visibility.componentCount;return{visible:i,invisible:t.componentData.count-i}}setComponentData(e,t){const i=e,{renderable:o,componentData:n}=i,r=o.material,s=n.materialDataBuffer,a=n.materialDataIndices,c=new _,l=s.textureBuffer,f=l.getVec5Field("colorAndCastShadows"),p=l.getScalarField("elevationOffset"),g=l.getScalarField("emissiveStrength"),u=l.getScalarField("emissiveSourceMode"),d=l.getVec4Field("oidColor"),b=new Uint8Array(4),v=new Uint32Array(b.buffer);let y=0,w=0,j=0,x=0,O=0,A=n.verticalOffsets,P=1/0,V=-1/0,B=!1,E=!1,H=!1,U=0;for(let h=0;h<n.count;h++){t(h,c),y+=+(c.externalColor[3]<1),w+=+(3===c.externalColorMixMode&&1===c.externalColor[3]),x+=+(c.emissiveStrength>0),O+=+(1===c.emissiveSource),E||=1!==c.emissiveStrength,j+=+c.castShadows,m(c.externalColor,c.externalColorMixMode,b),f.setValues(a[h],b[0],b[1],b[2],b[3],+c.castShadows),B||=h>0&&U!==v[0],U=v[0],H||=0!==c.elevationOffset,H&&null==A&&(A=new Array(h).fill(0)),null!=A&&(A[h]=c.elevationOffset),P=Math.min(P,c.elevationOffset),V=Math.max(V,c.elevationOffset),p.set(a[h],c.elevationOffset),g.set(a[h],c.emissiveStrength),u.set(a[h],0===c.emissiveSource?0:255);const e=c.olidColor;null!=e&&d.setArray(a[h],e),c.pickable!==S(n.pickability,h)&&R(n,h,c.pickable)}n.verticalOffsets=H?A:null,i.offsetObb=H?h(i.obb,P,V,this._viewingMode,i.offsetObb??i.obb.clone()):null,B||H||D()||(E||O>0)&&x>0?(r.componentParameters=new C,r.componentParameters.castShadows=k(j,n.count),r.componentParameters.transparent=k(y,n.count),r.componentParameters.opaqueOverride=k(w,n.count),r.componentParameters.emissiveOverride=k(x,n.count),r.componentParameters.emissiveSourceOverride=k(O,n.count),r.componentParameters.texture=l,l.updateTexture()):(r.componentParameters=new M,r.componentParameters.castShadows=c.castShadows?0:2,r.componentParameters.externalColor=c.externalColor,r.componentParameters.externalColorMixMode=c.externalColorMixMode,r.componentParameters.emissiveStrength=c.emissiveStrength,r.componentParameters.emissiveSource=c.emissiveSource),this._elevationRangeCacheVerticalOffset=NaN,this._notifyDirty()}getComponentAabb(e,t,i,o=!1){e.intersectionGeometry.getComponentAabb(t,i);const n=e,r=n.componentData.verticalOffsets;if(o||null==r)return i;const s=r[t];if(2===this._viewingMode||0===s)return i[2]+=s,i[5]+=s,i;const a=P(s);return a.localOrigin=n.transform.position,a.applyToAabb(i)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,i){return e.intersectionGeometry.getComponentPositions(t,i)}expandRangeWithComponentObjectElevationRange(e,t,i,o){Number.isNaN(this._elevationRangeCacheVerticalOffset)||this._elevationRangeCacheVerticalOffset!==t||o.expandElevationRangeValues(this._elevationRangeCacheMin,this._elevationRangeCacheMax);const n=e,r=n.componentData,s=r.count,a=r.verticalOffsets,c=n.intersectionGeometry,l=2===this._viewingMode,m=c.getComponentAabbs(),h=G;let f=1/0,p=-1/0;for(let g=0;g<s;g++){const e=6*g,r=a?.[g]??0;let s=1/0,c=-1/0;if(l)s=m[e+2]+r+t,c=m[e+5]+r+t;else{if(h[0]=m[e],h[1]=m[e+1],h[2]=m[e+2],h[3]=m[e+3],h[4]=m[e+4],h[5]=m[e+5],0!==r){const e=P(r);e.localOrigin=n.transform.position,e.applyToAabb(h)}const s=Math.max(Math.abs(h[3]),Math.abs(h[0])),a=Math.max(Math.abs(h[4]),Math.abs(h[1])),c=t+h[5]+i;o.expandElevationRangeValues(t+h[2],Math.sqrt(s*s+a*a+c*c)-i)}o.expandElevationRangeValues(s,c),f=Math.min(f,s),p=Math.max(p,c)}this._elevationRangeCacheVerticalOffset=t,this._elevationRangeCacheMin=f,this._elevationRangeCacheMax=p}intersect(e,t,i,o,n,r){const s=e,{transform:a,componentData:c,intersectionGeometry:l}=s;return null!=o&&(o.localOrigin=a.position),l.intersect(t,i,o,c.verticalOffsets,a,n,r)}addEdges(e,t,i,o,n){const r=e,{indices:s,positions:a}=r.intersectionGeometry,c=r.componentData.offsets;return t.addComponentObject(r,a,s,c,i,o,n)}async extractEdgeInformation(e,t,i){const o=e,n=o.componentData.visibility;if(n.allInvisible()){const{extractComponentsEdgeLocationsLayout:e}=await import("../../lib/edgeRendering/edgeProcessing.js");return{buffer:e.createBuffer(0),origin:[0,0,0]}}const{indices:s,positions:a}=o.intersectionGeometry,m=o.componentData.offsets,{EdgeInputBufferLayout:h}=await import("../../lib/edgeRendering/bufferLayouts.js"),f=h.createBuffer(a.length/3);l(f.position.typedBuffer,a,f.position.typedBufferStride,3),c(f.position,f.position,o.transform.rotationScale),this._setComponentIndices(f.componentIndex,s,m);const p=f.count,g=this._computeVisibilityIndices(s,n,m,p);return{origin:r(o.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:g,indicesLength:g.length,skipDeduplicate:!0,data:f,writerSettings:{reducedPrecision:!1,variants:0}},i)}}_setComponentIndices(e,t,i){let o=0;for(let n=0;n<i.length-1;n++){const r=i[n],s=i[n+1];for(let i=r;i<s;i++){const n=t?t[i]:i;e.set(n,o)}o++}}_computeVisibilityIndices(e,t,i,n){if(e&&t.allVisible())return e;let r=0;t.forEachComponentRange((e,t)=>(r+=i[t]-i[e],!0));const s=o(e)?2===e?.BYTES_PER_ELEMENT||n<=65536?new Uint16Array(r):new Uint32Array(r):new Array(r);let a=0;return t.forEachComponentRange((t,o)=>{const n=i[t],r=i[o];for(let i=n;i<r;i++)s[a++]=e?e[i]:i;return!0}),s}addComponentHighlight(e,i,o){const n=e.componentData,r=t(n.componentHighlights,o,()=>new Uint32Array(n.count+1));{const e=this._activeHighlightOptions.get(o)??0;this._activeHighlightOptions.set(o,e+1)}0===r[i]++&&(n.markHighlightsDirty(),this._notifyDirty()),r[n.count]++}removeComponentHighlight(e,t,i){const{componentData:o}=e,n=o.componentHighlights.get(i);if(void 0===n)return void U().warn("Removing non-existing highlight.");const r=n[t];if(0===r)return void U().warn("Removing non-existing highlight.");this._removeActiveHighlight(i);const s=n[o.count];if(r>1)return n[t]=r-1,void(n[o.count]=s-1);n[t]=0,1===s?o.componentHighlights.delete(i):n[o.count]=s-1,o.markHighlightsDirty(),this._notifyDirty()}_removeActiveHighlight(e,t=1){const i=this._activeHighlightOptions.get(e);if(void 0===i)U().warn("Removing non-existing highlight.");else{const o=i-t;o<0&&U().warn("Removing non-existing highlight."),o<=0?this._activeHighlightOptions.delete(e):this._activeHighlightOptions.set(e,o)}}clearHighlights(e){const{componentData:t}=e,{componentHighlights:i}=t;if(i.size>0){for(const e of i)this._removeActiveHighlight(e[0],e[1][t.count]);i.clear(),t.markHighlightsDirty(),this._notifyDirty()}}hasHighlight(e){return this._activeHighlightOptions.has(e)}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._visible}_createRenderable(e,t){const i=this._renderManager.rctx,o=e.geometry,n=o.vertices.layoutParameters,r=f(y(n)),s=new H(i,r,o.vertices.data),a=o.indices?B.createIndex(i,35044,o.indices):null,c=new Uint16Array(o.vertices.count);for(let f=0;f<t.count;f++){const e=t.offsets[f],i=t.offsets[f+1],n=t.materialDataIndices[f];if(null!=o.indices)for(let t=e;t<i;t++){c[o.indices[t]]=n}else for(let t=e;t<i;t++)c[t]=n}const l=new H(i,j,c.buffer),m=new w(e.transform,e.toMapSpace,e.obb.radius<L),h=new A(i,new Map([["geometry",s],["componentIndices",l]]),a),p=new b(h,E.TRIANGLES,n,null!=a),g={cameraDepthSquared:.5,gpuMemoryEstimate:s.usedMemory+l.usedMemory+(null!=a?a.usedMemory:0)};return new d(m,p,g)}_notifyDirty(){this._renderManager.notifyDirty()}}function k(e,t){return e===t?0:0===e?2:1}function N(){const e=[{name:"colorAndCastShadows",type:"u8u8u7xu8"},{name:"elevationOffset",type:"packed-f32",maxValue:x},{name:"emissiveStrength",type:"packed-f24",maxValue:O},{name:"emissiveSourceMode",type:"u8"}];return D()&&e.push({name:"oidColor",type:"vec4u8"}),e}const G=s(),L=5e4;export{I as ComponentObjectCollection};
|
|
5
|
+
import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import i from"../../../../../core/PooledArray.js";import{isTypedArray as o}from"../../../../../core/typedArrayUtil.js";import{s as n}from"../../../../../chunks/vec32.js";import{clone as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as s}from"../../../../../geometry/support/aaBoundingBox.js";import{compactIndices as a}from"../../../../../geometry/support/Indices.js";import{c}from"../../../../../chunks/vec3.js";import{c as l}from"../../../../../chunks/vec33.js";import{encodeSymbolColor as m}from"../../../layers/support/symbolColorUtils.js";import{computeOffsetObb as f}from"../../../support/orientedBoundingBox.js";import{glLayout as h}from"../../../support/buffer/glUtil.js";import{ComponentData as p}from"./ComponentData.js";import{ComponentObject as g}from"./ComponentObject.js";import{IntersectionGeometry as u}from"./IntersectionGeometry.js";import{Renderable as d}from"./Renderable.js";import{RenderGeometry as b}from"./RenderGeometry.js";import{RenderSubmitSystem as v}from"./RenderSubmitSystem.js";import{createVertexBufferLayout as y}from"./SourceGeometry.js";import{UniformComponentParameters as _}from"./UniformComponentParameters.js";import{ComponentParametersVarying as C,ComponentParametersUniform as M,ComponentMaterial as w}from"./Material/ComponentMaterial.js";import{indexGlLayout as x}from"./Material/ComponentTechnique.js";import{maxElevationOffset as j,maxPackedRGBEmission as O}from"./Material/shader/ComponentData.glsl.js";import{olidEnabled as S}from"../../effects/geometry/olidUtils.js";import{getVisibility as D,updatePickabilityWithCount as R}from"../../lib/ComponentUtils.js";import{VertexArrayObject as B}from"../../lib/VertexArrayObject.js";import{getVerticalOffsetI3S as A}from"../../lib/verticalOffsetUtils.js";import{BufferManager as P}from"../../lib/TextureBackedBuffer/BufferManager.js";import{BufferObject as V}from"../../../../webgl/BufferObject.js";import{PrimitiveType as E}from"../../../../webgl/enums.js";import{VertexBuffer as H}from"../../../../webgl/VertexBuffer.js";const U=()=>e.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class k{constructor(e,t){this._renderManager=e,this._viewingMode=t,this._elevationRangeCacheVerticalOffset=NaN,this._elevationRangeCacheMin=NaN,this._elevationRangeCacheMax=NaN,this._activeHighlightOptions=new Map,this._visible=new i,this._hidden=new i,this._renderSubmit=new v(this),this._renderManager.register(this._renderSubmit),this._componentBufferManager=new P(e.rctx,N())}destroy(){this._componentBufferManager.destroy(),this._componentBufferManager=null,this._visible.forAll(e=>e.destroy()),this._visible.prune(),this._hidden.forAll(e=>e.destroy()),this._hidden.prune(),this._renderSubmit.destroy()}createObject(e){const{geometry:t}=e,i=new p(this._componentBufferManager,a(t.componentOffsets)),o=this._createRenderable(e,i),n=new u(this._viewingMode,t.positionData,i,e.elevationAlignable),r=new g(e.transform,e.obb.clone(),i,o,n);return(r.visible?this._visible:this._hidden).push(r),r}destroyObject(e){const t=e;(t.visible?this._visible:this._hidden).removeUnordered(t),t.destroy(),this._notifyDirty()}setObjectVisibility(e,t){const i=e;t!==i.visible&&(t?(this._hidden.removeUnordered(i),this._visible.push(i)):(this._visible.removeUnordered(i),this._hidden.push(i)),i.visible=t,this._notifyDirty())}preSubmit(e){const t=e.camera.eye;this.visibleObjects.forAll(e=>e.renderable.meta.cameraDepthSquared=n(t,e.obb.center))}getMaterial(e){return e.renderable.material}updateMaterial(e,t){const i=e.renderable.material;t(i),i.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,t){const i=e;i.componentData.visibility.reset(t),i.componentData.markVisibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,t){return e.componentData.visibility.forEachComponent(t)}getComponentCount(e){const t=e,i=t.componentData.visibility.componentCount;return{visible:i,invisible:t.componentData.count-i}}setComponentData(e,t){const i=e,{renderable:o,componentData:n}=i,r=o.material,s=n.materialDataBuffer,a=n.materialDataIndices,c=new _,l=s.textureBuffer,h=l.getVec5Field("colorAndCastShadows"),p=l.getScalarField("elevationOffset"),g=l.getScalarField("emissiveStrength"),u=l.getScalarField("emissiveSourceMode"),d=l.getVec4Field("oidColor"),b=new Uint8Array(4),v=new Uint32Array(b.buffer);let y=0,w=0,x=0,j=0,O=0,B=n.verticalOffsets,A=1/0,P=-1/0,V=!1,E=!1,H=!1,U=0,k=!1;for(let f=0;f<n.count;f++){t(f,c),y+=+(c.externalColor[3]<1),w+=+(3===c.externalColorMixMode&&1===c.externalColor[3]),j+=+(c.emissiveStrength>0),O+=+(1===c.emissiveSource),E||=1!==c.emissiveStrength,x+=+c.castShadows,m(c.externalColor,c.externalColorMixMode,b),h.setValues(a[f],b[0],b[1],b[2],b[3],+c.castShadows),V||=f>0&&(U!==v[0]||k!==c.castShadows),U=v[0],k=c.castShadows,H||=0!==c.elevationOffset,H&&null==B&&(B=new Array(f).fill(0)),null!=B&&(B[f]=c.elevationOffset),A=Math.min(A,c.elevationOffset),P=Math.max(P,c.elevationOffset),p.set(a[f],c.elevationOffset),g.set(a[f],c.emissiveStrength),u.set(a[f],0===c.emissiveSource?0:255);const e=c.olidColor;null!=e&&d.setArray(a[f],e),c.pickable!==D(n.pickability,f)&&R(n,f,c.pickable)}n.verticalOffsets=H?B:null,i.offsetObb=H?f(i.obb,A,P,this._viewingMode,i.offsetObb??i.obb.clone()):null,V||H||S()||(E||O>0)&&j>0?(r.componentParameters=new C,r.componentParameters.castShadows=I(x,n.count),r.componentParameters.transparent=I(y,n.count),r.componentParameters.opaqueOverride=I(w,n.count),r.componentParameters.emissiveOverride=I(j,n.count),r.componentParameters.emissiveSourceOverride=I(O,n.count),r.textureBackedBufferParameters.textureBackedBuffer=l,l.updateTexture()):(r.componentParameters=new M,r.componentParameters.castShadows=c.castShadows?0:2,r.componentParameters.externalColor=c.externalColor,r.componentParameters.externalColorMixMode=c.externalColorMixMode,r.componentParameters.emissiveStrength=c.emissiveStrength,r.componentParameters.emissiveSource=c.emissiveSource,r.textureBackedBufferParameters.textureBackedBuffer=null),this._elevationRangeCacheVerticalOffset=NaN,this._notifyDirty()}getComponentAabb(e,t,i,o=!1){e.intersectionGeometry.getComponentAabb(t,i);const n=e,r=n.componentData.verticalOffsets;if(o||null==r)return i;const s=r[t];if(2===this._viewingMode||0===s)return i[2]+=s,i[5]+=s,i;const a=A(s);return a.localOrigin=n.transform.position,a.applyToAabb(i)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,i){return e.intersectionGeometry.getComponentPositions(t,i)}expandRangeWithComponentObjectElevationRange(e,t,i,o){Number.isNaN(this._elevationRangeCacheVerticalOffset)||this._elevationRangeCacheVerticalOffset!==t||o.expandElevationRangeValues(this._elevationRangeCacheMin,this._elevationRangeCacheMax);const n=e,r=n.componentData,s=r.count,a=r.verticalOffsets,c=n.intersectionGeometry,l=2===this._viewingMode,m=c.getComponentAabbs(),f=G;let h=1/0,p=-1/0;for(let g=0;g<s;g++){const e=6*g,r=a?.[g]??0;let s=1/0,c=-1/0;if(l)s=m[e+2]+r+t,c=m[e+5]+r+t;else{if(f[0]=m[e],f[1]=m[e+1],f[2]=m[e+2],f[3]=m[e+3],f[4]=m[e+4],f[5]=m[e+5],0!==r){const e=A(r);e.localOrigin=n.transform.position,e.applyToAabb(f)}const s=Math.max(Math.abs(f[3]),Math.abs(f[0])),a=Math.max(Math.abs(f[4]),Math.abs(f[1])),c=t+f[5]+i;o.expandElevationRangeValues(t+f[2],Math.sqrt(s*s+a*a+c*c)-i)}o.expandElevationRangeValues(s,c),h=Math.min(h,s),p=Math.max(p,c)}this._elevationRangeCacheVerticalOffset=t,this._elevationRangeCacheMin=h,this._elevationRangeCacheMax=p}intersect(e,t,i,o,n,r){const s=e,{transform:a,componentData:c,intersectionGeometry:l}=s;return null!=o&&(o.localOrigin=a.position),l.intersect(t,i,o,c.verticalOffsets,a,n,r)}addEdges(e,t,i,o,n){const r=e,{indices:s,positions:a}=r.intersectionGeometry,c=r.componentData.offsets;return t.addComponentObject(r,a,s,c,i,o,n)}async extractEdgeInformation(e,t,i){const o=e,n=o.componentData.visibility;if(n.allInvisible()){const{extractComponentsEdgeLocationsLayout:e}=await import("../../lib/edgeRendering/edgeProcessing.js");return{buffer:e.createBuffer(0),origin:[0,0,0]}}const{indices:s,positions:a}=o.intersectionGeometry,m=o.componentData.offsets,{EdgeInputBufferLayout:f}=await import("../../lib/edgeRendering/bufferLayouts.js"),h=f.createBuffer(a.length/3);l(h.position.typedBuffer,a,h.position.typedBufferStride,3),c(h.position,h.position,o.transform.rotationScale),this._setComponentIndices(h.componentIndex,s,m);const p=h.count,g=this._computeVisibilityIndices(s,n,m,p);return{origin:r(o.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:g,indicesLength:g.length,skipDeduplicate:!0,data:h,writerSettings:{reducedPrecision:!1,variants:0}},i)}}_setComponentIndices(e,t,i){let o=0;for(let n=0;n<i.length-1;n++){const r=i[n],s=i[n+1];for(let i=r;i<s;i++){const n=t?t[i]:i;e.set(n,o)}o++}}_computeVisibilityIndices(e,t,i,n){if(e&&t.allVisible())return e;let r=0;t.forEachComponentRange((e,t)=>(r+=i[t]-i[e],!0));const s=o(e)?2===e?.BYTES_PER_ELEMENT||n<=65536?new Uint16Array(r):new Uint32Array(r):new Array(r);let a=0;return t.forEachComponentRange((t,o)=>{const n=i[t],r=i[o];for(let i=n;i<r;i++)s[a++]=e?e[i]:i;return!0}),s}addComponentHighlight(e,i,o){const n=e.componentData,r=t(n.componentHighlights,o,()=>new Uint32Array(n.count+1));{const e=this._activeHighlightOptions.get(o)??0;this._activeHighlightOptions.set(o,e+1)}0===r[i]++&&(n.markHighlightsDirty(),this._notifyDirty()),r[n.count]++}removeComponentHighlight(e,t,i){const{componentData:o}=e,n=o.componentHighlights.get(i);if(void 0===n)return void U().warn("Removing non-existing highlight.");const r=n[t];if(0===r)return void U().warn("Removing non-existing highlight.");this._removeActiveHighlight(i);const s=n[o.count];if(r>1)return n[t]=r-1,void(n[o.count]=s-1);n[t]=0,1===s?o.componentHighlights.delete(i):n[o.count]=s-1,o.markHighlightsDirty(),this._notifyDirty()}_removeActiveHighlight(e,t=1){const i=this._activeHighlightOptions.get(e);if(void 0===i)U().warn("Removing non-existing highlight.");else{const o=i-t;o<0&&U().warn("Removing non-existing highlight."),o<=0?this._activeHighlightOptions.delete(e):this._activeHighlightOptions.set(e,o)}}clearHighlights(e){const{componentData:t}=e,{componentHighlights:i}=t;if(i.size>0){for(const e of i)this._removeActiveHighlight(e[0],e[1][t.count]);i.clear(),t.markHighlightsDirty(),this._notifyDirty()}}hasHighlight(e){return this._activeHighlightOptions.has(e)}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._visible}_createRenderable(e,t){const i=this._renderManager.rctx,o=e.geometry,n=o.vertices.layoutParameters,r=h(y(n)),s=new H(i,r,o.vertices.data),a=o.indices?V.createIndex(i,35044,o.indices):null,c=new Uint16Array(o.vertices.count);for(let h=0;h<t.count;h++){const e=t.offsets[h],i=t.offsets[h+1],n=t.materialDataIndices[h];if(null!=o.indices)for(let t=e;t<i;t++){c[o.indices[t]]=n}else for(let t=e;t<i;t++)c[t]=n}const l=new H(i,x,c.buffer),m=new w(e.transform,e.toMapSpace,e.obb.radius<L),f=new B(i,new Map([["geometry",s],["componentIndices",l]]),a),p=new b(f,E.TRIANGLES,n,null!=a),g={cameraDepthSquared:.5,gpuMemoryEstimate:s.usedMemory+l.usedMemory+(null!=a?a.usedMemory:0)};return new d(m,p,g)}_notifyDirty(){this._renderManager.notifyDirty()}}function I(e,t){return e===t?0:0===e?2:1}function N(){const e=[{name:"colorAndCastShadows",type:"u8u8u7xu8"},{name:"elevationOffset",type:"packed-f32",maxValue:j},{name:"emissiveStrength",type:"packed-f24",maxValue:O},{name:"emissiveSourceMode",type:"u8"}];return S()&&e.push({name:"oidColor",type:"vec4u8"}),e}const G=s(),L=5e4;export{k as ComponentObjectCollection};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{invert as t,transpose as
|
|
5
|
+
import{__decorate as e}from"tslib";import{invert as t,transpose as r}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as s}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{I as o,q as i}from"../../../../../../chunks/vec32.js";import{freeze as a,ZEROS as l}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as n}from"../../../../../../chunks/vec42.js";import{freeze as h,fromValues as u}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ComponentTechnique as c}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as p}from"./ComponentTechniqueConfiguration.js";import{parameter as d,parameterBlock as m,MaterialBase as v,MaterialParameterBlock as x}from"../../../core/material/MaterialBase.js";import{TextureBackedBufferParameters as g}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{TwoVectorPosition as f}from"../../../core/util/TwoVectorPosition.js";import{advancedMRRFactors as y}from"../../../materials/pbrUtils.js";import{defaultHighlightName as M}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as b}from"../../../../../../webscene/support/AlphaCutoff.js";class T extends v{constructor(e,o,i){super(),this.toMapSpace=o,this.useENUForGlobalOverlayUV=i,this.baseColor=h(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.sphereDepthInterpolate=!1,this.mrrFactors=y,this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.normalTexture=null,this.occlusionTexture=null,this.emissionTexture=null,this.emissiveBaseColor=a(0,0,0),this.emissiveStrength=0,this.commonMaterialParameters=new S,this.componentParameters=new w,this.textureBackedBufferParameters=new g,this.objectOpacity=1,this.textureAlphaCutoff=b,this.alphaDiscardMode=1,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=1,this.hasOccludees=!1;const l=new f(e.position),n=s(e.rotationScale);t(n,n),r(n,n),this.transformNormalGlobalFromModel=n,this.transformWorldFromModelTL=l.low,this.transformWorldFromModelTH=l.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get _hasEmissiveBase(){return null!=this.emissionTexture||!i(this.emissiveBaseColor,l)}get _hasEmissiveStrength(){return 2!==this.componentParameters.emissiveOverride}get hasEmissions(){return this._hasEmissiveStrength&&(this._hasEmissiveBase||2!==this.componentParameters.emissiveSourceOverride)}get texture(){return this.baseColorTexture?.glTexture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.glTexture}get textureEmissive(){return this.emissionTexture?.glTexture}get textureOcclusion(){return this.occlusionTexture?.glTexture}get textureNormal(){return this.normalTexture?.glTexture}acquireTechnique(e,t,r,s){const o=new p(e.context.spherical,e.context.sphericalSR);o.renderOccluded=9===r.slot,o.hasVertexColors=s.hasVertexColors,o.hasNormals=s.hasNormals,o.textureCoordinateType=s.textureCoordinateType,o.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,o.hasOcclusionTexture=null!=this.occlusionTexture,o.hasNormalTexture=null!=this.normalTexture,o.sphereDepthInterpolate=this.sphereDepthInterpolate&&1===e.viewingMode,o.oitPass=0===t.identifier&&null!=r.oitPass?r.oitPass:0,o.terrainDepthTest=0===t.identifier&&r.terrainDepthTest,o.cullAboveTerrain=0===t.identifier&&r.cullAboveTerrain,o.ellipsoidMode=this.ellipsoidMode,o.componentData=this.componentParameters.type,o.textureBackedBufferLayout=this.textureBackedBufferParameters.textureBackedBuffer?.layout.hash??0,o.cullFace=this.commonMaterialParameters.cullFace,o.doubleSidedMode=this.commonMaterialParameters.doubleSided?1:0,o.hasColorTexture=null!=this.baseColorTexture;const i=this._computeWhichMaterialPass();o.blendingEnabled=1===i||2===i,o.alphaDiscardMode=this.alphaDiscardMode,o.integratedMeshMode=this.isIntegratedMesh?D(r)?C(r)?3:2:1:0,o.hasPolygonOffset=this.polygonOffsetEnabled,o.pbrMode=3===o.integratedMeshMode?4:this.usePBR?this.hasParametersFromSource?s.shadeNormals&&this.isIntegratedMesh?0:2:1:0;const a=1===this.componentParameters.emissiveSourceOverride,l=2===this.componentParameters.emissiveSourceOverride,n=null!=this.emissionTexture;if(o.emissionSource=this.hasEmissions?this._hasEmissiveBase&&1===o.pbrMode?l?n?4:2:a?n?5:7:6:a?7:6:0,o.shadeNormals=s.shadeNormals,o.normalType=o.hasNormals?1:2,o.hasSlicePlane=null!=r.slicePlane&&this.commonMaterialParameters.hasSlicePlane,o.receiveAmbientOcclusion=o.hasOccludees=o.receiveShadows=o.screenSpaceReflections=o.cloudReflections=o.hasHighlightMixTexture=!1,1===t.identifier)o.output=4,o.vertexDiscardMode=0;else if(3===t.identifier)o.output=7,o.vertexDiscardMode=0;else if(2===t.identifier)o.output=9,o.vertexDiscardMode=0,o.hasHighlightMixTexture=null!=r.highlightMixTexture;else{switch(o.vertexDiscardMode=2===i?t.transparent?2:1:0,o.output=t.output,t.output){case 0:case 1:o.receiveAmbientOcclusion=s.applySSAO&&null!=r.ssao?.getTexture(),o.hasOccludees=r.hasOccludees,o.receiveShadows=r.shadowMap.ready,o.screenSpaceReflections=null!=r.ssr.lastFrameColor,o.cloudReflections=null!=r.clouds.data?.cubeMap?.colorTexture;break;case 10:o.olidColor=!0}o.snowCover=r.snowCover>0}const h=e.get(c,o);return this._setClean(),h}submit(e,t,r){if(this.objectOpacity<=0)return;const{componentData:s,renderable:o}=r,{geometry:i}=o,a=o.meta.cameraDepthSquared;s.updateHighlights(t.highlights);const{geometryRanges:l,highlightRangesMap:n,shadowmapRanges:h}=s;switch(this._computeWhichMaterialPass()){case 0:e.opaque.submitDraw(this,i,l,a);break;case 1:e.transparent.submitDraw(this,i,l,a);break;case 2:e.opaque.submitDraw(this,i,l,a),e.transparent.submitDraw(this,i,l,a);break;case 3:e.integratedMesh.submitDraw(this,i,l,a),B(t)&&e.occludedGround.submitDraw(this,i,l,a),P(t)&&e.highlightIntegratedMesh.submitDraw(this,i,l,a);break;case 4:e.transparentIntegratedMesh.submitDraw(this,i,l,a)}if(2!==this.componentParameters.castShadows){if(null!=n)for(const t of n)t[0]===M&&e.highlightShadowMap.submitDraw(this,i,t[1],a,t[0]);null!=h&&e.defaultShadowMap.submitDraw(this,i,h,a),e.shadowMap.submitDraw(this,i,l,a)}if(null!=n)for(const u of n)e.highlight.submitDraw(this,i,u[1],a,u[0]);t.viewshedEnabled&&e.viewshedShadowMap.submitDraw(this,i,l,a)}_computeWhichMaterialPass(){if(this.isIntegratedMesh&&this.objectOpacity>=1)return 3;if(this.isIntegratedMesh&&this.objectOpacity<1)return 4;if(this.objectOpacity<1)return 1;if(0===this.componentParameters.opaqueOverride)return 0;if(this.baseColor[3]<1||0===this.alphaDiscardMode||3===this.alphaDiscardMode)return 1;switch(this.componentParameters.transparent){case 2:return 0;case 0:return 1;case 1:return 2}}}e([d({vectorOps:n})],T.prototype,"baseColor",void 0),e([d()],T.prototype,"usePBR",void 0),e([d()],T.prototype,"hasParametersFromSource",void 0),e([d()],T.prototype,"sphereDepthInterpolate",void 0),e([d({vectorOps:o})],T.prototype,"mrrFactors",void 0),e([d({dispose:!0})],T.prototype,"baseColorTexture",void 0),e([d({dispose:!0})],T.prototype,"metallicRoughnessTexture",void 0),e([d({dispose:!0})],T.prototype,"normalTexture",void 0),e([d({dispose:!0})],T.prototype,"occlusionTexture",void 0),e([d({dispose:!0})],T.prototype,"emissionTexture",void 0),e([d({vectorOps:o})],T.prototype,"emissiveBaseColor",void 0),e([d()],T.prototype,"emissiveStrength",void 0),e([m()],T.prototype,"commonMaterialParameters",void 0),e([m()],T.prototype,"componentParameters",void 0),e([m()],T.prototype,"textureBackedBufferParameters",void 0),e([d()],T.prototype,"objectOpacity",void 0),e([d()],T.prototype,"textureAlphaCutoff",void 0),e([d()],T.prototype,"alphaDiscardMode",void 0),e([d()],T.prototype,"isIntegratedMesh",void 0),e([d()],T.prototype,"polygonOffsetEnabled",void 0),e([d()],T.prototype,"ellipsoidMode",void 0),e([d()],T.prototype,"hasOccludees",void 0);class S extends x{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=2,this.hasSlicePlane=!0}}e([d()],S.prototype,"doubleSided",void 0),e([d()],S.prototype,"cullFace",void 0),e([d()],S.prototype,"hasSlicePlane",void 0);class w extends x{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=1,this.emissiveStrength=0,this.emissiveSource=0,this.castShadows=0}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}get visible(){return this.externalColor[3]>0?0:2}get type(){return 0}}e([d({vectorOps:n})],w.prototype,"externalColor",void 0),e([d()],w.prototype,"externalColorMixMode",void 0),e([d()],w.prototype,"emissiveStrength",void 0),e([d()],w.prototype,"emissiveSource",void 0),e([d()],w.prototype,"castShadows",void 0);class O extends x{constructor(){super(...arguments),this.transparent=2,this.opaqueOverride=2,this.emissiveOverride=2,this.emissiveSourceOverride=2,this.castShadows=2}get type(){return 1}}function P(e){return null!=e.overlay?.getTexture(2)}function C(e){return null!=e.overlay?.getTexture(3)}function D(e){return null!=e.overlay?.getTexture(1)}function B(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}e([d()],O.prototype,"transparent",void 0),e([d()],O.prototype,"opaqueOverride",void 0),e([d()],O.prototype,"emissiveOverride",void 0),e([d()],O.prototype,"emissiveSourceOverride",void 0),e([d()],O.prototype,"castShadows",void 0);export{S as CommonMaterialParameters,T as ComponentMaterial,w as ComponentParametersUniform,O as ComponentParametersVarying};
|
package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as
|
|
5
|
+
import{__decorate as e}from"tslib";import{isColorEmissionHighlightOrOID as o}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as t,ShaderTechniqueConfiguration as i}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{MAX_COUNT_TEXTURE_BACKED_BUFFER_LAYOUTS as s}from"../../../lib/TextureBackedBuffer/TextureBackedBufferLayout.js";class r extends i{constructor(e,o){super(),this.spherical=e,this.sphericalSR=o,this.output=0,this.textureCoordinateType=0,this.componentData=0,this.textureBackedBufferLayout=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.oitPass=0,this.ellipsoidMode=1,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasNormals=!1,this.shadeNormals=!0,this.hasSlicePlane=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.olidColor=!1,this.renderOccluded=!1,this.sphereDepthInterpolate=!1,this.discardInvisibleFragments=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&o(this.output)}}e([t({count:11})],r.prototype,"output",void 0),e([t({count:3})],r.prototype,"textureCoordinateType",void 0),e([t({count:2})],r.prototype,"componentData",void 0),e([t({count:s})],r.prototype,"textureBackedBufferLayout",void 0),e([t({count:3})],r.prototype,"cullFace",void 0),e([t({count:3})],r.prototype,"vertexDiscardMode",void 0),e([t({count:3})],r.prototype,"doubleSidedMode",void 0),e([t({count:4})],r.prototype,"alphaDiscardMode",void 0),e([t({count:4})],r.prototype,"integratedMeshMode",void 0),e([t({count:3})],r.prototype,"oitPass",void 0),e([t({count:4})],r.prototype,"ellipsoidMode",void 0),e([t({count:7})],r.prototype,"pbrMode",void 0),e([t({count:3})],r.prototype,"normalType",void 0),e([t({count:8})],r.prototype,"emissionSource",void 0),e([t()],r.prototype,"hasVertexColors",void 0),e([t()],r.prototype,"hasNormals",void 0),e([t()],r.prototype,"shadeNormals",void 0),e([t()],r.prototype,"hasSlicePlane",void 0),e([t()],r.prototype,"hasColorTexture",void 0),e([t()],r.prototype,"hasHighlightMixTexture",void 0),e([t()],r.prototype,"receiveAmbientOcclusion",void 0),e([t()],r.prototype,"receiveShadows",void 0),e([t()],r.prototype,"blendingEnabled",void 0),e([t()],r.prototype,"screenSpaceReflections",void 0),e([t()],r.prototype,"hasPolygonOffset",void 0),e([t()],r.prototype,"hasMetallicRoughnessTexture",void 0),e([t()],r.prototype,"hasOcclusionTexture",void 0),e([t()],r.prototype,"hasNormalTexture",void 0),e([t()],r.prototype,"hasOccludees",void 0),e([t()],r.prototype,"terrainDepthTest",void 0),e([t()],r.prototype,"cullAboveTerrain",void 0),e([t()],r.prototype,"hasNormalTextureTransform",void 0),e([t()],r.prototype,"cloudReflections",void 0),e([t()],r.prototype,"snowCover",void 0),e([t()],r.prototype,"olidColor",void 0),e([t()],r.prototype,"renderOccluded",void 0),e([t()],r.prototype,"sphereDepthInterpolate",void 0);export{r as ComponentTechniqueConfiguration};
|
|
@@ -2,42 +2,24 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{neverReached as o}from"../../../../../../../core/compilerUtils.js";import{packFloatRGBA as e,packFloatRGB as
|
|
6
|
-
float index = componentIndex * stride + typeOffset;
|
|
7
|
-
float texSize = float(textureSize(componentColorTex, 0).x);
|
|
8
|
-
float coordX = mod(index, texSize);
|
|
9
|
-
float coordY = floor(index / texSize);
|
|
10
|
-
return vec2(coordX, coordY) + 0.5;
|
|
11
|
-
}`),t.code.add(l`
|
|
12
|
-
vec4 _readComponentColor() {
|
|
13
|
-
vec2 textureCoordinates = getComponentTextureCoordinates(componentIndex, 0.0);
|
|
14
|
-
return texelFetch(componentColorTex, ivec2(textureCoordinates), 0);
|
|
15
|
-
}
|
|
16
|
-
|
|
5
|
+
import{neverReached as o}from"../../../../../../../core/compilerUtils.js";import{packFloatRGBA as e,packFloatRGB as r}from"../../../../../../../core/floatRGBA.js";import{DecodeSymbolColor as t}from"./DecodeSymbolColor.glsl.js";import{TextureBackedBufferModule as a,itemData as d}from"../../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{Float4DrawUniform as n}from"../../../../core/shaderModules/Float4DrawUniform.js";import{FloatDrawUniform as l}from"../../../../core/shaderModules/FloatDrawUniform.js";import{glsl as i,If as s}from"../../../../core/shaderModules/glsl.js";import{IntegerDrawUniform as c}from"../../../../core/shaderModules/IntegerDrawUniform.js";import{getTextureBackedBufferLayout as u}from"../../../../lib/TextureBackedBuffer/TextureBackedBuffer.js";const f=429496.7296;function v(o,r){e(o/f*.5+.5,r)}const m=1e6;function x(o,e){r(o/m*.5+.5,e)}function C(e,r){switch(r.componentData){case 1:return M(e,r);case 0:return h(e,r);case 2:return;default:o(r.componentData)}}function M(o,e){const{vertex:r,fragment:n}=o,{output:l}=e;if(0===e.textureBackedBufferLayout)return;const c=u(e.textureBackedBufferLayout);if(null==c)throw new Error(`Invalid TextureBackedBufferLayout: ${e.textureBackedBufferLayout}. TextureBackedBuffer shader code generation only possible with valid buffer assigned.`);const f=10===l,v=1===l,m=o=>"emissiveSourceMode"===o||"emissiveStrength"===o?v:"oidColor"!==o||f;o.include(a(c,m,"componentIndex")),o.attributes.add("componentIndex","float"),o.varyings.add("vExternalColorMixMode","mediump float"),o.varyings.add("vExternalColor","vec4"),f&&o.varyings.add("vObjectAndLayerIdColor","vec4"),v&&(o.varyings.add("emissiveStrength","float"),o.varyings.add("emissiveSource","int")),o.include(t),r.code.add(i`
|
|
17
6
|
float readElevationOffset() {
|
|
18
|
-
|
|
19
|
-
vec4 encodedElevation = texelFetch(componentColorTex, ivec2(textureCoordinates), 0);
|
|
20
|
-
return uninterpolatedRGBAToFloat(encodedElevation) * ${l.float(x)};
|
|
7
|
+
return ${d("elevationOffset")};
|
|
21
8
|
}
|
|
22
9
|
|
|
23
10
|
void forwardEmissiveStrength() {
|
|
24
|
-
${
|
|
25
|
-
|
|
26
|
-
emissiveStrength = uninterpolatedRGBToFloat(encodedEmissive.rgb) * ${l.float(u)};
|
|
27
|
-
emissiveSource = encodedEmissive.a == 0.0 ? 0 : 1;`)}
|
|
11
|
+
${s(v,i`emissiveStrength = ${d("emissiveStrength")};
|
|
12
|
+
emissiveSource = ${d("emissiveSourceMode")} == 0.0 ? 0 : 1;`)}
|
|
28
13
|
}
|
|
29
14
|
|
|
30
15
|
void forwardObjectAndLayerIdColor() {
|
|
31
|
-
${
|
|
32
|
-
vObjectAndLayerIdColor = texelFetch(componentColorTex, ivec2(textureCoordinates), 0);`)}
|
|
16
|
+
${s(f,i`vObjectAndLayerIdColor = ${d("oidColor")};`)}
|
|
33
17
|
}
|
|
34
18
|
|
|
35
19
|
vec4 forwardExternalColor(out bool castShadows) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
componentColor.b -= shadowFlag;
|
|
40
|
-
castShadows = shadowFlag >= 1.0;
|
|
20
|
+
vec5 colorAndCastShadow = ${d("colorAndCastShadows")};
|
|
21
|
+
vec4 componentColor = vec4(colorAndCastShadow.x, colorAndCastShadow.y, colorAndCastShadow.z, colorAndCastShadow.w);
|
|
22
|
+
castShadows = colorAndCastShadow.v >= 1.0;
|
|
41
23
|
|
|
42
24
|
int decodedColorMixMode;
|
|
43
25
|
vExternalColor = decodeSymbolColor(componentColor, decodedColorMixMode) * 0.003921568627451; // = 1/255;
|
|
@@ -45,16 +27,16 @@ return vec2(coordX, coordY) + 0.5;
|
|
|
45
27
|
|
|
46
28
|
return vExternalColor;
|
|
47
29
|
}
|
|
48
|
-
`),
|
|
30
|
+
`),n.code.add(i`
|
|
49
31
|
void readExternalColor(out vec4 externalColor, out int externalColorMixMode) {
|
|
50
32
|
externalColor = vExternalColor;
|
|
51
33
|
externalColorMixMode = int(vExternalColorMixMode);
|
|
52
34
|
}
|
|
53
35
|
|
|
54
36
|
void outputObjectAndLayerIdColor() {
|
|
55
|
-
${
|
|
37
|
+
${f?i`fragColor = vObjectAndLayerIdColor;`:""}
|
|
56
38
|
}
|
|
57
|
-
`)}function
|
|
39
|
+
`)}function h(o,e){const{vertex:r,fragment:t}=o;o.varyings.add("vExternalColor","vec4"),t.uniforms.add(new l("emissiveStrength",o=>o.componentParameters.emissiveStrength)),r.uniforms.add(new n("externalColor",o=>o.componentParameters.externalColor)).code.add(i`float readElevationOffset() {
|
|
58
40
|
return 0.0;
|
|
59
41
|
}
|
|
60
42
|
void forwardObjectAndLayerIdColor() {}
|
|
@@ -63,13 +45,13 @@ vec4 forwardExternalColor(out bool castShadows) {
|
|
|
63
45
|
vExternalColor = externalColor;
|
|
64
46
|
castShadows = true;
|
|
65
47
|
return externalColor;
|
|
66
|
-
}`);const
|
|
48
|
+
}`);const a=10===e.output;t.uniforms.add(new c("externalColorMixMode",o=>o.componentParameters.externalColorMixMode)).code.add(i`
|
|
67
49
|
void readExternalColor(out vec4 color, out int colorMixMode) {
|
|
68
50
|
color = vExternalColor;
|
|
69
51
|
colorMixMode = externalColorMixMode;
|
|
70
52
|
}
|
|
71
53
|
|
|
72
54
|
void outputObjectAndLayerIdColor() {
|
|
73
|
-
${
|
|
55
|
+
${s(a,"fragColor = vec4(0, 0, 0, 0);")}
|
|
74
56
|
}
|
|
75
|
-
`)}export{
|
|
57
|
+
`)}export{C as ComponentData,v as encodeElevationOffset,x as encodeEmissiveStrength,f as maxElevationOffset,m as maxPackedRGBEmission};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as e}from"tslib";import{parameter as t,MaterialParameterBlock as o}from"../material/MaterialBase.js";import{glslType as r,decode_u8u8u7xu8 as a,glslDecodeField as d}from"./TextureBackedBufferFields.glsl.js";import{RgbaFloatEncoding as f}from"./util/RgbaFloatEncoding.glsl.js";import{glsl as c}from"../shaderModules/glsl.js";import{Texture2DDrawUniform as l}from"../shaderModules/Texture2DDrawUniform.js";class n extends o{constructor(e=null){super(),this.textureBackedBuffer=e}}function u(e,t=()=>!0,o){return r=>i(r,o,e,t)}function i(e,t,o,n){const{vertex:u}=e;u.constants.add("tbbStride","float",o.numTexels),u.uniforms.add(new l("componentColorTex",e=>e.textureBackedBufferParameters.textureBackedBuffer.texture));const i=o.fields.filter(e=>n(e.name));if(0===i.length)return;const m=[];for(let r=0;r<o.numTexels;++r)m.push(!1);for(const r of i)for(let e=0;e<r.numTexels;++e)m[r.startTexel+e]=!0;u.code.add(c`struct vec5 {
|
|
6
|
+
float x;
|
|
7
|
+
float y;
|
|
8
|
+
float z;
|
|
9
|
+
float w;
|
|
10
|
+
float v;
|
|
11
|
+
};`),u.code.add(c`struct TextureBackedBufferItemData {`);for(const a of i)u.code.add(c`\t${r(a)} ${a.name};`);u.code.add(c`};`),u.include(f),u.include(a),u.code.add(c`TextureBackedBufferItemData fetchTextureBackedBufferItemData(float itemIndex) {
|
|
12
|
+
TextureBackedBufferItemData itemData;
|
|
13
|
+
float index = itemIndex * tbbStride;
|
|
14
|
+
float texSize = float(textureSize(componentColorTex, 0).x);
|
|
15
|
+
float coordX = mod(index, texSize) + 0.5;
|
|
16
|
+
float coordY = floor(index / texSize) + 0.5;`);for(let r=0;r<m.length;++r)!1!==m[r]&&u.code.add(c`\tvec4 texel${c.int(r)} = texelFetch(componentColorTex, ivec2(coordX + ${c.float(r)}, coordY), 0);`);for(const r of i)u.code.add(c`\titemData.${r.name} = ${d(r)};`);u.code.add(c`return itemData;
|
|
17
|
+
}`),u.code.add(c`TextureBackedBufferItemData tbbItemData;`),u.main.add(c`tbbItemData = fetchTextureBackedBufferItemData(${t});`)}function m(e){return c`tbbItemData.${e}`}e([t()],n.prototype,"textureBackedBuffer",void 0);export{u as TextureBackedBufferModule,n as TextureBackedBufferParameters,m as itemData};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{glsl as o}from"../shaderModules/glsl.js";function e(e){e.code.add(o`vec5 decode_u8u8u7xu8(float r, float g, float b, float a) {
|
|
6
|
+
vec4 componentColor = vec4(r, g, b, a) * 255.0;
|
|
7
|
+
float shadowFlag = mod(componentColor.b * 255.0, 2.0);
|
|
8
|
+
componentColor.b -= shadowFlag;
|
|
9
|
+
return vec5(componentColor.r, componentColor.g, componentColor.b, componentColor.a, shadowFlag);
|
|
10
|
+
}`)}function t(e){switch(e.elementCount){case 1:return o`float`;case 2:return o`vec2`;case 3:return o`vec3`;case 4:return o`vec4`;case 5:return o`vec5`;default:throw new Error("unsupported elementCount")}}function n(o){const{declaration:e,glslDecodeArgumentString:t}=o;return`${(0,r[e.type])(t,e)}`}const r={u8:e=>o`${e}`,"packed-f24":(e,t)=>o`uninterpolatedRGBToFloat(vec3(${e})) * ${o.float(t.maxValue)}`,"packed-f32":(e,t)=>o`uninterpolatedRGBAToFloat(vec4(${e})) * ${o.float(t.maxValue)}`,vec4u8:e=>o`vec4(${e})`,u8u8u7xu8:e=>o`decode_u8u8u7xu8(${e})`};export{e as decode_u8u8u7xu8,n as glslDecodeField,t as glslType};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function t(t){const a=3.141592653589793,n=.3183098861837907;t.constants.add("PI","float",a),t.constants.add("LIGHT_NORMALIZATION","float",n),t.constants.add("INV_PI","float",n),t.constants.add("HALF_PI","float",1.570796326794897),t.constants.add("TWO_PI","float",6.28318530717958)}export{t as PiUtils};
|
|
5
|
+
function t(t){const a=3.141592653589793,n=.3183098861837907;t.constants.add("PI","float",a),t.constants.add("LIGHT_NORMALIZATION","float",n),t.constants.add("INV_PI","float",n),t.constants.add("ONE_QUATER_PI","float",.78539816339745),t.constants.add("HALF_PI","float",1.570796326794897),t.constants.add("THREE_QUATER_PI","float",2.35619449019234),t.constants.add("TWO_PI","float",6.28318530717958),t.constants.add("PI_SQUARED","float",9.86960440108936)}export{t as PiUtils};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{PiUtils as a}from"../shading/PiUtils.glsl.js";import{glsl as t}from"../../shaderModules/glsl.js";function l(l){l.include(a),l.code.add(t`float fastSin(float x) {
|
|
6
|
+
const float B = 4.0 / PI;
|
|
7
|
+
const float C = -4.0 / (PI_SQUARED);
|
|
8
|
+
const float P = 0.225;
|
|
9
|
+
float y = B * x + C * x * abs(x);
|
|
10
|
+
return P * (y * abs(y) - y) + y;
|
|
11
|
+
}
|
|
12
|
+
float fastCos(float x) {
|
|
13
|
+
return fastSin(x + HALF_PI);
|
|
14
|
+
}
|
|
15
|
+
float fastAtan2(float y, float x) {
|
|
16
|
+
float r, angle;
|
|
17
|
+
float abs_y = abs(y) + 1e-10;
|
|
18
|
+
if (x < 0.0) {
|
|
19
|
+
r = (x + abs_y) / (abs_y - x);
|
|
20
|
+
angle = THREE_QUATER_PI - ONE_QUATER_PI * r;
|
|
21
|
+
} else {
|
|
22
|
+
r = (x - abs_y) / (x + abs_y);
|
|
23
|
+
angle = ONE_QUATER_PI - ONE_QUATER_PI * r;
|
|
24
|
+
}
|
|
25
|
+
return (y < 0.0) ? -angle : angle;
|
|
26
|
+
}`)}export{l as FastApproximateTrigonometry};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as s,lerp as a}from"../../../../core/mathUtils.js";import{removeMaybe as n,abortMaybe as h,destroyMaybe as o,releaseMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as l}from"../../../../core/promiseUtils.js";import{watch as _,syncAndInitial as u,initial as p,sync as m}from"../../../../core/reactiveUtils.js";import{signal as c}from"../../../../core/signal.js";import{Milliseconds as f}from"../../../../core/time.js";import{property as g}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as b}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as P,invert as C,multiply as w}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as T,create as S}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as E}from"../../../../chunks/vec42.js";import{ZEROS as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as A,ZEROS as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as D}from"../../../../geometry/support/Indices.js";import{RenderCategory as I,InternalRenderCategory as R}from"../../webgl.js";import{innerAtmosphereFadeStart as O}from"../../environment/atmosphereUtils.js";import{minNearDistanceInMeters as v}from"../../state/NearFarHeuristic.js";import{debugFlags as F}from"../../support/debugFlags.js";import{FBOCache as H,defaultWebGLFBO as M}from"../core/FBOCache.js";import{RenderPassManager as q}from"../core/renderPasses/RenderPassManager.js";import{isColorEmission as N,isColorOrColorEmission as G}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as L}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as V}from"../effects/RenderNodes.js";import{RenderPluginManager as U}from"../effects/RenderPluginManager.js";import{Blit as j}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as B,renderHighlightBuffer as k}from"../effects/highlight/Highlight.js";import{OITBlend as z}from"../effects/transparency/OITBlend.js";import{AnimationTimer as Q}from"./AnimationTimer.js";import{AnimationTimeStep as W}from"./AnimationTimeStep.js";import{BoundingInfo as Y}from"./BoundingInfo.js";import{DepthRange as Z}from"./DepthRange.js";import{depthRangeFromScene as J}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as K}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as X}from"./MainFramebuffer.js";import{RenderContext as $,defaultRenderOccludedMask as ee}from"./RenderContext.js";import{RendererBase as te}from"./RendererBase.js";import{setupFeatureDefaults as re}from"./RenderFeature.js";import{RenderPluginInput as ie}from"./RenderPluginInput.js";import{ShadowAccumulator as se}from"./ShadowAccumulator.js";import{ShadowMap as ae}from"./ShadowMap.js";import ne from"./SliceHelper.js";import{MergedRenderer as he}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as oe}from"../parts/renderUtils.js";import{RendererPerformanceInfo as de,PerformanceCategory as le}from"../statistics/RendererPerformanceInfo.js";import{PixelType as _e,ColorAttachment1 as ue,ColorAttachment2 as pe}from"../../../webgl/enums.js";let me=class extends te{constructor(e,t,r,s,a,n){super({stage:e}),this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this.renderPassManager=new q,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new ne,this._blit=null,this._oitblend=null,this.sceneDepthRange=c(Z.Infinite),this._state=c(2),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new W,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=c(0),this._lastFrameTime=f(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new ie,this._releaseNormals=e=>{e.some(({name:e})=>"normals"===e)&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this._fboCache=new H(s),this._renderStateFeatures=c(re(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new X(this.fboCache),this._performanceInfo=new de(this._rctx),this._shadowMap=new ae(this.fboCache,e.viewingMode),this._shadowAccumulator=new se(this.fboCache,r,e,e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t},(t,r,i)=>{const s=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,i,!0,s),this._renderShadowCascades(4,t.shadowMap),t.shadowMap.finish(),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},n),this._renderContext=new $(this._rctx,this._shadowMap,r),this._nodes=new V(this._renderContext),this._plugins=new U({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this.addHandles([_(()=>e.view.state.camera,()=>n(),u),_(()=>F.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},n()},p),_(()=>e.view.environment.background?.color,e=>{const t=e?i(e):y;E(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()},u),_(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=L,u),_(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},m),_(()=>this._bindParameters.clouds.data?.state,()=>n(),m),_(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,n()},p)])}destroy(){this._gpuTimerHandle=n(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=h(this._loadEdgeViewTask),this._edgeView=o(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._plugins.destroy(),this._plugins=null,this._pluginInput=null,this._blit=null,this._oitblend=null,this._compositingHelper=null,this._nodes=null,this._framebuffer=null,this._shadowMap=null,this._renderContext=null,this._performanceInfo=null,Y.prune(),he.prune(),D()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=re(t,e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate(i=>i.set(t,e,r)),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(5))}get _hasHighlights(){return this._plugins.produces(9,2,4,18,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(9,13,14)}get hasSSAO(){return(this.stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(4))&&!this._inGlobeView}get hasSMAA(){return this.stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(0)}get hasEmitters(){return this._plugins.hasEmitters&&this.stage.view.qualitySettings.physicallyBasedRenderingEnabled}get fullResolutionAtmosphere(){return this.stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(3)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=d(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=d(this._bindParameters.depth),this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility)}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");l(e);const r=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:xe(this.stage.view.resourceController)});return this.addHandles(_(()=>r.updating,()=>this._requestRender(),m)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(r)),this._edgeViewCallbacks.length=0,r})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&P(this._bindParameters.ssr.reprojectionMatrix,T)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),e.environment){void 0!==e.environment.weather&&(this._bindParameters.weather=e.environment.weather);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(0,...Ce),has.water=this._plugins.produces(3,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new Q(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?n(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,r,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new oe(this._pluginInput.get(I.FINAL),null)}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:l}=K,_=this.stage.view,u=_.stateManager.camera,p=_.qualitySettings.fadeDuration,m=2===e?r:i,c=s((u.tilt-h)/(o-h),0,1),f=s(((u.position.z??0)-d)/(l-d),0,1),g=a(a(1,m,c),1,f),b=this._bindParameters.hudOccludedFragmentOpacity;if(p<=0||b===g||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=g,void(this._lastFrameTime=t);const P=t-this._lastFrameTime;this._lastFrameTime=t;const C=Math.max(1-r,Math.abs(r-i)),w=Math.min(C*P/p,n);w>=Math.abs(g-b)?this._bindParameters.hudOccludedFragmentOpacity=g:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(g-b)*w,this._requestRender())}_render(e,t,r,i){const s=0===r;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=s,this._disposeBindBuffers();const{camera:a,contentCamera:n,mode:h,alignPixelEnabled:o}=e;this._state.value=h;const d=this._nodes.produces("magnifier-color"),l=this._nodes.produces(I.FINAL),_=this.hasEmitters,u=_?1:0;this._renderContext.time=t,this._renderContext.output=u,this._bindParameters.oitPass=0,this._bindParameters.alignPixelEnabled=o,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null;const p=!i||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=p?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(R.CUTFILL_DEPTH),this._renderOverlay(),a.setGLViewport(this._rctx);const m=this._framebuffer,c=m.initialize(a.fullWidth,a.fullHeight,this._backgroundColor,_);this.hasReflections?(c?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=c):c?.release(),this._ensureBindParametersCamera(a,n),this._updateHUDOccludedFragmentOpacity(h,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const f=this._highQualityTransparency&&this._hasTransparentTerrain,g=this._plugins.produces(0,...be);this._precompilePrepasses(),this.performanceInfo.advance(le.PREPARE);const b=this._computeShadowDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,b),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(b,a,n,!s),this._ensureBindParametersSSR(t),this._precompileShaders(f,g,u),this._renderContext.output=u,m.bind(),this._bindParameters.mainDepth=m.depth.attachment,this._renderOpaque(f),this._renderTransparent(g,f,u),this._shadowMap.disposeMainBuffer(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),this._pluginInput.set(R.CUTFILL_DEPTH,this._renderCutFillDepth()),m.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),m.update(e=>this._renderNodes(R.VIEWSHED,e)),m.update(e=>this._renderNodes(R.LASERLINES,e)),m.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),this._pluginInput.release(R.CUTFILL_DEPTH),m.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass()),this._renderHighlightShadowMap(a,this._bindParameters.lighting.mainLight.direction,b);const P=2===r?this._renderObjectAndLayerIdColor():null;m.update(e=>this._renderNodes(I.COMPOSITE,e)),this._shadowMap.disposeOffscreenBuffers();const C=s&&!l&&!(d&&!i),w=this._pluginInput.get(I.COMPOSITE),T=C?M:this.fboCache.acquire(w.fbo.width,w.fbo.height,R.ANTIALIASING),S=this._nodes.produces(R.ANTIALIASING)?this._renderNodes(R.ANTIALIASING,T):this.blitFBO(w,T,!1);let E;this._pluginInput.set(R.ANTIALIASING,S),this._hasHUDHighlights?(this._renderHUD(1,S,u),E=this._renderNodes(R.HIGHLIGHTS,S)):(E=this._renderNodes(R.HIGHLIGHTS,S),this._renderHUD(1,E,u));const x=this._renderNodes(R.MAGNIFIER,E);return s&&d&&!i&&!l&&this.blitFBO(x),l?(x.attachDepth(m.depth),this.blitFBO(this._renderNodes(I.FINAL,x)),x.detachDepth()):this._pluginInput.set(I.FINAL,x),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),m.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),s||(this._releaseFBOs(),this._disposeOffscreenBuffers()),new oe(this._pluginInput.get(I.FINAL),P)}_precompileShaders(e,t,r){++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._nodes.precompile(R.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=2,this._plugins.precompile(6),this._plugins.precompile(7),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(6),this._plugins.precompile(7),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._nodes.precompile(R.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(12),this._plugins.precompile(15),this._precompileHUD(0),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(R.VIEWSHED,R.CUTFILL_DEPTH,R.CUTFILL_COLOR,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING,R.HIGHLIGHTS);const i=this._bindParameters;i.highlightMixTexture=i.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(1),this._hasHighlights&&(i.highlights.forEach((e,t)=>{i.highlightLevel=t,this._precompileAllGeometry(9)}),i.highlightLevel=null),i.highlightMixTexture=null,this._nodes.precompile(I.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(8),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(le.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(13),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(le.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=0===e;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(y),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,_e.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,6408,_e.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._renderContext.output,i=this._framebufferSize,s=this.fboCache.acquire(i.width,i.height,"edges"),a=()=>t.render(this._bindParameters,e),n=this._bindParameters.geometryDepth;this.renderToTargets(a,s,n??this._framebuffer.depth,y),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,s.getTexture(),N(r)?1:0),s.release(),this.performanceInfo.advance(1===e?le.OPAQUE_EDGES:le.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(),this._bindParameters.overlay&&this.performanceInfo.advance(le.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(6,this._shadowMap),s.copySnapshot(1),this._renderShadowCascades(5,this._shadowMap)):this._renderShadowCascades(4),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(le.SHADOW_MAP)}_renderHighlightShadowMap(e,t,r){if(!this.shadowsEnabled||!this._needsShadowHighlight)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(5,this._shadowMap),s.moveSnapshot(0),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(le.SHADOW_MAP)}_renderCutFillDepth(){return this._nodes.produce(R.CUTFILL_DEPTH,this._pluginInput)}_precompileShadowCascades(e){for(const t of this._shadowMap.cascades)t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.camera),this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){t.bindFbo();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(2)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(R.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(2),d(this._bindParameters.depth),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(le.DEPTH)):(e.detachDepth(),this._bindParameters.depth=d(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=d(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"geometry depth",13);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1280),this.renderAllGeometry(2),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(le.DEPTH)}_renderTerrainDepth(e){if(this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,!e)return void(this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth));const t=this._renderContext.output;this._renderContext.output=2;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth",13);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this._renderTransparentTerrain(),d(this._bindParameters.terrainDepth),this._bindParameters.terrainDepth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderGeometryDepth(e){if(!e)return void(this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth));const t=this._renderContext.output,{width:r,height:i}=this._framebufferSize,s=this.fboCache.acquire(r,i,"geometry depth",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(2),this._renderContext.output=t,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsShadowDepthRange(){return this._shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Z.Zero;const t=J(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Z.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<O)return void(this.sceneDepthRange.value=Z.Infinite);const t=e.clone();t.near=v,t.far=1e10;const r=J(t,this._plugins.plugins,this.stage.layers,1);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(r)||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",I.FINAL,I.COMPOSITE,I.OPAQUE,I.TRANSPARENT,R.VIEWSHED,R.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(3),this._needsDepth&&this._precompileAllGeometry(2),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(5),this._precompileShadowCascades(6),this._precompileShadowCascades(5)):this._precompileShadowCascades(4)),this._shadowAccumulator.active&&this._precompileAllGeometry(4)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",5);r.acquireDepth(13),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(y,!0,!0),this._renderGeometryWithNormals(3);const i=this._nodes.optional("normals",I.FINAL,I.COMPOSITE,I.OPAQUE,I.TRANSPARENT,R.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(le.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return;const t=this._nodes.produce(R.SSAO,this._pluginInput);return this._bindParameters.ssao=t,t&&this.performanceInfo.advance(le.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(6),this._plugins.precompile(7),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentTerrain()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...Pe);this._renderContext.renderOccludedMask=ee}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...Pe),this._renderContext.renderOccludedMask=ee}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(13)}precompileViewshedShadowMap(){this._precompileAllGeometry(7)}precompileCutFill(){const e=8,t=this._renderContext.output;this._renderContext.output=e,this._plugins.precompile(0,1,6),this._renderContext.output=t}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(7),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._renderContext.output=8,this._plugins.render(0,1),this._plugins.render(6),this._ensureBindParametersCamera(t,r),t.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(...ce),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(...fe)}_precompileOpaqueGeometry(){this._plugins.precompile(...ge),this._nodes.precompile("opaque-color")}_renderOpaqueGeometry(){this._plugins.render(...ge)}_renderTransparentGeometry(){this._plugins.render(...be)}get _hasTransparentTerrain(){return this._plugins.produces(0,6)}get _hasTransparentIntegratedMesh(){return this._plugins.produces(this._renderContext.output,7)}_renderTransparentTerrain(){const e=()=>this._plugins.render(6);if(!G(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,y),r}_renderTransparentIntegratedMesh(){const e=()=>this._plugins.render(7);if(!G(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent integrated mesh");return this.renderToTargets(e,r,this._framebuffer.depth,y),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,12)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(12),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(le.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(15),t=this._framebufferSize,r=this.fboCache.acquireDepth(12,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(15)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=9,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&G(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...Ce),this._bindParameters.oitPass=2,this._plugins.precompile(...Ce),this._bindParameters.oitPass=0):this._plugins.precompile(...Ce),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(1,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture(),0),i.release()}else if(this._renderContext.output=r,0===e){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(12,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(12),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(0===e?le.HUD_OCCLUDED:le.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ce)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(5,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,{highlights:s}=r,a=e.acquire(i.width,i.height,"highlights",s.length>B?3:1);a.acquireDepth(13),this._framebuffer.color.fbo&&a.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,a.fbo,1024),t.bindFramebuffer(a.fbo);const{gl:n}=t;return n.clearBufferuiv(n.COLOR,0,[0,0,0,0]),this._renderContext.output=9,t.bindFramebuffer(a.fbo),k(t,e,i,r,()=>this._renderHighlightGeometries()),a.detachDepth(),this.performanceInfo.advance(le.HIGHLIGHTS),a}_renderHighlightGeometries(){this._plugins.render(...we),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t,r,i){this._shadowAccumulator.updateDepthRange(e),this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,t,r,i)&&this.performanceInfo.advance(le.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&G(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...be),this._bindParameters.oitPass=2,this._plugins.precompile(...be),this._bindParameters.oitPass=0):this._plugins.precompile(...be)}_renderOIT(e,t,r=2){const i=1===e,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=1;const d=a?"oit hud color+alpha":"oit color+alpha",l=this.fboCache.acquire(s.width,s.height,d,8),_=1===t;_&&l.acquireColor(ue,8,"oit emissive"),l.acquireColor(_?pe:ue,7),a||l.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(l.fbo),this._rctx.clearFramebuffer([0,0,0,1]),_&&this._rctx.clearBuffer(1,x),n(),l.detachDepth(),h.oitPass=2;const u=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return _&&u.acquireColor(ue,8,"oit emissive front"),a?u.acquireDepth(12):u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(y,!!a),n(),u.detachDepth(),h.oitPass=0,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):this._framebuffer.bind(),this._oitblend??=new z(this._techniques),this._oitblend.blend(this._rctx,l,u,h,_,!i),a?.detachDepth(),u.release(),l.release(),this._renderContext.output=o,a}_renderOpaque(e){const t=this.plugins.produces(0,...ge);if(t){this._plugins.render(0,1);const e=this._framebuffer;e.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),e.update(e=>this._renderNodes(R.OPAQUE_TERRAIN,e)),e.bind(),this._plugins.render(2,3)}const r=this._framebuffer;this._renderTerrainDepth(e),r.update(e=>this._renderNodes(I.OPAQUE,e,t)),this.fboCache.debugCallback?.(I.OPAQUE,r.color.fbo),r.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,r.color.fbo),this._renderEdges(1)}_renderTransparent(e,t,r){const i=this._framebuffer;i.bind(),this._renderPlugins(20,le.VOXEL),this._renderHiddenTransparentEdges(),e&&(this._oitEnabled?this._renderOIT(0,r):this._renderTransparentGeometry()),i.update(t=>this._renderNodes(I.TRANSPARENT,t,e)),this.fboCache.debugCallback?.(I.TRANSPARENT,i.color.fbo),this._renderGeometryDepth(t),this._renderHUDVisibility(),t||this._plugins.render(15),this._renderEdges(0);const s=this._hasTransparentTerrain?this._renderTransparentTerrain():null;s&&(this.performanceInfo.advance(le.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(t?this._renderLineCallouts(0):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,s.getTexture())),this._renderHUD(0,i.color,r))),this._bindParameters.cullAboveTerrain=!1,s&&(i.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),N(r)?1:0),s.release(),t&&(this._renderEdges(1),e&&(this._oitEnabled?this._renderOIT(0,r):this._renderTransparentGeometry(),this.performanceInfo.advance(le.TRANSPARENT)),this._renderEdges(0)));const a=this._hasTransparentIntegratedMesh?this._renderTransparentIntegratedMesh():null;a&&(i.bind(),this._compositingHelper.composite(this._bindParameters,a.getTexture(),N(r)?1:0),a.release()),this._bindParameters.ssao=d(this._bindParameters.ssao),t&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(le.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(8),this.performanceInfo.advance(le.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}blitFBO(e,t=M,r=!0){return this._blit??=new j(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=T:(C(Se,this._bindParameters.camera.viewMatrix),C(Te,this._bindParameters.camera.projectionMatrix),w(Ee,Se,Te),w(Ee,this._renderContext.lastFrameCamera.viewMatrix,Ee),w(Ee,this._renderContext.lastFrameCamera.projectionMatrix,Ee),this._reprojectionMatrix=Ee);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=T,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}};e([g({readOnly:!0})],me.prototype,"fullResolutionAtmosphere",null),e([g()],me.prototype,"_edgeView",void 0),e([g()],me.prototype,"updating",null),me=e([b("esri.views.3d.webgl-engine.lib.Renderer")],me);const ce=[0,1,2,4],fe=[3,5],ge=[0,1,2,3],be=[4,5],Pe=[2,4,8],Ce=[16,13,14],we=[4,5,2,3,6,0,1],Te=S(),Se=S(),Ee=S();function xe(e){return t=>e.immediate.schedule(t)}export{me as Renderer};
|
|
5
|
+
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as s,lerp as a}from"../../../../core/mathUtils.js";import{removeMaybe as n,abortMaybe as h,destroyMaybe as o,releaseMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as l}from"../../../../core/promiseUtils.js";import{watch as _,syncAndInitial as u,initial as p,sync as m}from"../../../../core/reactiveUtils.js";import{signal as c}from"../../../../core/signal.js";import{Milliseconds as f}from"../../../../core/time.js";import{property as g}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as b}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as P,invert as C,multiply as w}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as T,create as S}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as E}from"../../../../chunks/vec42.js";import{ZEROS as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as A,ZEROS as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as D}from"../../../../geometry/support/Indices.js";import{RenderCategory as I,InternalRenderCategory as R}from"../../webgl.js";import{innerAtmosphereFadeStart as O}from"../../environment/atmosphereUtils.js";import{minNearDistanceInMeters as v}from"../../state/NearFarHeuristic.js";import{debugFlags as F}from"../../support/debugFlags.js";import{FBOCache as H,defaultWebGLFBO as M}from"../core/FBOCache.js";import{RenderPassManager as q}from"../core/renderPasses/RenderPassManager.js";import{isColorEmission as N,isColorOrColorEmission as G}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as L}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as V}from"../effects/RenderNodes.js";import{RenderPluginManager as U}from"../effects/RenderPluginManager.js";import{Blit as j}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as B,renderHighlightBuffer as k}from"../effects/highlight/Highlight.js";import{OITBlend as z}from"../effects/transparency/OITBlend.js";import{AnimationTimer as Q}from"./AnimationTimer.js";import{AnimationTimeStep as W}from"./AnimationTimeStep.js";import{BoundingInfo as Y}from"./BoundingInfo.js";import{DepthRange as Z}from"./DepthRange.js";import{depthRangeFromScene as J}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as K}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as X}from"./MainFramebuffer.js";import{RenderContext as $,defaultRenderOccludedMask as ee}from"./RenderContext.js";import{RendererBase as te}from"./RendererBase.js";import{setupFeatureDefaults as re}from"./RenderFeature.js";import{RenderPluginInput as ie}from"./RenderPluginInput.js";import{ShadowAccumulator as se}from"./ShadowAccumulator.js";import{ShadowMap as ae}from"./ShadowMap.js";import ne from"./SliceHelper.js";import{MergedRenderer as he}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as oe}from"../parts/renderUtils.js";import{RendererPerformanceInfo as de,PerformanceCategory as le}from"../statistics/RendererPerformanceInfo.js";import{PixelType as _e,ColorAttachment1 as ue,ColorAttachment2 as pe}from"../../../webgl/enums.js";let me=class extends te{constructor(e,t,r,s,a,n){super({stage:e}),this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this.renderPassManager=new q,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new ne,this._blit=null,this._oitblend=null,this.sceneDepthRange=c(Z.Infinite),this._state=c(2),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new W,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=c(0),this._lastFrameTime=f(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new ie,this._releaseNormals=e=>{e.some(({name:e})=>"normals"===e)&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this._fboCache=new H(s),this._renderStateFeatures=c(re(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new X(this.fboCache),this._performanceInfo=new de(this._rctx),this._shadowMap=new ae(this.fboCache,e.viewingMode),this._shadowAccumulator=new se(this.fboCache,r,e,e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t},(t,r,i)=>{const s=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,i,!0,s),this._renderShadowCascades(4,t.shadowMap),t.shadowMap.finish(),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},n),this._renderContext=new $(this._rctx,this._shadowMap,r),this._nodes=new V(this._renderContext),this._plugins=new U({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this.addHandles([_(()=>e.view.state.camera,()=>n(),u),_(()=>F.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},n()},p),_(()=>e.view.environment.background?.color,e=>{const t=e?i(e):y;E(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()},u),_(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=L,u),_(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},m),_(()=>this._bindParameters.clouds.data?.state,()=>n(),m),_(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,n()},p)])}destroy(){this._gpuTimerHandle=n(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=h(this._loadEdgeViewTask),this._edgeView=o(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._plugins.destroy(),this._plugins=null,this._pluginInput=null,this._blit=null,this._oitblend=null,this._compositingHelper=null,this._nodes=null,this._framebuffer=null,this._shadowMap=null,this._renderContext=null,this._performanceInfo=null,Y.prune(),he.prune(),D()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=re(t,e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate(i=>i.set(t,e,r)),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(5))}get _hasHighlights(){return this._plugins.produces(9,2,4,18,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(9,13,14)}get hasSSAO(){return(this.stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(4))&&!this._inGlobeView}get hasSMAA(){return this.stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(0)}get hasEmitters(){return this._plugins.hasEmitters&&this.stage.view.qualitySettings.physicallyBasedRenderingEnabled}get fullResolutionAtmosphere(){return this.stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(3)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=d(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=d(this._bindParameters.depth),this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility)}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");l(e);const r=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:xe(this.stage.view.resourceController)});return this.addHandles(_(()=>r.updating,()=>this._requestRender(),m)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(r)),this._edgeViewCallbacks.length=0,r})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&P(this._bindParameters.ssr.reprojectionMatrix,T)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),e.environment){void 0!==e.environment.weather&&(this._bindParameters.weather=e.environment.weather);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(0,...Ce),has.water=this._plugins.produces(3,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new Q(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?n(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,r,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new oe(this._pluginInput.get(I.FINAL),null)}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:l}=K,_=this.stage.view,u=_.stateManager.camera,p=_.qualitySettings.fadeDuration,m=2===e?r:i,c=s((u.tilt-h)/(o-h),0,1),f=s(((u.position.z??0)-d)/(l-d),0,1),g=a(a(1,m,c),1,f),b=this._bindParameters.hudOccludedFragmentOpacity;if(p<=0||b===g||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=g,void(this._lastFrameTime=t);const P=t-this._lastFrameTime;this._lastFrameTime=t;const C=Math.max(1-r,Math.abs(r-i)),w=Math.min(C*P/p,n);w>=Math.abs(g-b)?this._bindParameters.hudOccludedFragmentOpacity=g:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(g-b)*w,this._requestRender())}_render(e,t,r,i){const s=0===r;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=s,this._disposeBindBuffers();const{camera:a,contentCamera:n,mode:h,alignPixelEnabled:o}=e;this._state.value=h;const d=this._nodes.produces("magnifier-color"),l=this._nodes.produces(I.FINAL),_=this.hasEmitters,u=_?1:0;this._renderContext.time=t,this._renderContext.output=u,this._bindParameters.oitPass=0,this._bindParameters.alignPixelEnabled=o,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null;const p=!i||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=p?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(R.CUTFILL_DEPTH),this._renderOverlay(),a.setGLViewport(this._rctx);const m=this._framebuffer,c=m.initialize(a.fullWidth,a.fullHeight,this._backgroundColor,_);this.hasReflections?(c?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=c):c?.release(),this._ensureBindParametersCamera(a,n),this._updateHUDOccludedFragmentOpacity(h,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const f=this._highQualityTransparency&&this._hasTransparentTerrain,g=this._plugins.produces(0,...be);this._precompilePrepasses(),this.performanceInfo.advance(le.PREPARE);const b=this._computeShadowDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,b),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(b,a,n,!s),this._ensureBindParametersSSR(t),this._precompileShaders(f,g,u),this._renderContext.output=u,m.bind(),this._bindParameters.mainDepth=m.depth.attachment,this._renderOpaque(f),this._renderTransparent(g,f,u),this._shadowMap.disposeMainBuffer(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),this._pluginInput.set(R.CUTFILL_DEPTH,this._renderCutFillDepth()),m.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),m.update(e=>this._renderNodes(R.VIEWSHED,e)),m.update(e=>this._renderNodes(R.LASERLINES,e)),m.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),this._pluginInput.release(R.CUTFILL_DEPTH),m.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass()),this._renderHighlightShadowMap(a,this._bindParameters.lighting.mainLight.direction,b);const P=2===r?this._renderObjectAndLayerIdColor():null;m.update(e=>this._renderNodes(I.COMPOSITE,e)),this._shadowMap.disposeOffscreenBuffers();const C=s&&!l&&!(d&&!i),w=this._pluginInput.get(I.COMPOSITE),T=C?M:this.fboCache.acquire(w.fbo.width,w.fbo.height,R.ANTIALIASING),S=this._nodes.produces(R.ANTIALIASING)?this._renderNodes(R.ANTIALIASING,T):this.blitFBO(w,T,!1);let E;this._pluginInput.set(R.ANTIALIASING,S),this._hasHUDHighlights?(this._renderHUD(1,S,u),E=this._renderNodes(R.HIGHLIGHTS,S)):(E=this._renderNodes(R.HIGHLIGHTS,S),this._renderHUD(1,E,u));const x=this._renderNodes(R.MAGNIFIER,E);return s&&d&&!i&&!l&&this.blitFBO(x),l?(x.attachDepth(m.depth),this.blitFBO(this._renderNodes(I.FINAL,x)),x.detachDepth()):this._pluginInput.set(I.FINAL,x),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),m.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),s||(this._releaseFBOs(),this._disposeOffscreenBuffers()),new oe(this._pluginInput.get(I.FINAL),P)}_precompileShaders(e,t,r){++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._nodes.precompile(R.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=2,this._plugins.precompile(6),this._plugins.precompile(7),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(6),this._plugins.precompile(7),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._nodes.precompile(R.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(12),this._plugins.precompile(15),this._precompileHUD(0),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(R.VIEWSHED,R.CUTFILL_DEPTH,R.CUTFILL_COLOR,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING,R.HIGHLIGHTS);const i=this._bindParameters;i.highlightMixTexture=i.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(1),this._hasHighlights&&(i.highlights.forEach((e,t)=>{i.highlightLevel=t,this._precompileAllGeometry(9)}),i.highlightLevel=null),i.highlightMixTexture=null,this._nodes.precompile(I.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(8),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(le.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(13),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(le.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=0===e;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(y),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,_e.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,6408,_e.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._renderContext.output,i=this._framebufferSize,s=this.fboCache.acquire(i.width,i.height,"edges"),a=()=>t.render(this._bindParameters,e),n=this._bindParameters.geometryDepth;this.renderToTargets(a,s,n??this._framebuffer.depth,y),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,s.getTexture(),N(r)?1:0),s.release(),this.performanceInfo.advance(1===e?le.OPAQUE_EDGES:le.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(),this._bindParameters.overlay&&this.performanceInfo.advance(le.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(6,this._shadowMap),s.copySnapshot(1),this._renderShadowCascades(5,this._shadowMap)):this._renderShadowCascades(4),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(le.SHADOW_MAP)}_renderHighlightShadowMap(e,t,r){if(!this.shadowsEnabled||!this._needsShadowHighlight)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(5,this._shadowMap),s.moveSnapshot(0),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(le.SHADOW_MAP)}_renderCutFillDepth(){return this._nodes.produce(R.CUTFILL_DEPTH,this._pluginInput)}_precompileShadowCascades(e){for(const t of this._shadowMap.cascades)t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.camera),this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){t.bindFbo();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(2)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(R.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(2),d(this._bindParameters.depth),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(le.DEPTH)):(e.detachDepth(),this._bindParameters.depth=d(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=d(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"geometry depth",13);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1280),this.renderAllGeometry(2),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(le.DEPTH)}_renderTerrainDepth(e){if(this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,!e)return void(this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth));const t=this._renderContext.output;this._renderContext.output=2;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth",13);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this._renderTransparentTerrain(),d(this._bindParameters.terrainDepth),this._bindParameters.terrainDepth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderGeometryDepth(e){if(!e)return void(this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth));const t=this._renderContext.output,{width:r,height:i}=this._framebufferSize,s=this.fboCache.acquire(r,i,"geometry depth",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(2),this._renderContext.output=t,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsShadowDepthRange(){return this._shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Z.Zero;const t=J(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Z.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<O)return void(this.sceneDepthRange.value=Z.Infinite);const t=e.clone();t.near=v,t.far=1e10;const r=J(t,this._plugins.plugins,this.stage.layers,1);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(r)||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",I.FINAL,I.COMPOSITE,I.OPAQUE,I.TRANSPARENT,R.VIEWSHED,R.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(3),this._needsDepth&&this._precompileAllGeometry(2),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(5),this._precompileShadowCascades(6),this._precompileShadowCascades(5)):this._precompileShadowCascades(4)),this._shadowAccumulator.active&&this._precompileAllGeometry(4)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",5);r.acquireDepth(13),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(y,!0,!0),this._renderGeometryWithNormals(3);const i=this._nodes.optional("normals",I.FINAL,I.COMPOSITE,I.OPAQUE,I.TRANSPARENT,R.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(le.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return;const t=this._nodes.produce(R.SSAO,this._pluginInput);return this._bindParameters.ssao=t,t&&this.performanceInfo.advance(le.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(6),this._plugins.precompile(7),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentTerrain()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...Pe);this._renderContext.renderOccludedMask=ee}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...Pe),this._renderContext.renderOccludedMask=ee}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(13)}precompileViewshedShadowMap(){this._precompileAllGeometry(7)}precompileCutFill(){const e=8,t=this._renderContext.output;this._renderContext.output=e,this._plugins.precompile(0,1,6),this._renderContext.output=t}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(7),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._renderContext.output=8,this._plugins.render(0,1),this._plugins.render(6),this._ensureBindParametersCamera(t,r),t.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(...ce),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(...fe)}_precompileOpaqueGeometry(){this._plugins.precompile(...ge),this._nodes.precompile("opaque-color")}_renderOpaqueGeometry(){this._plugins.render(...ge)}_renderTransparentGeometry(){this._plugins.render(...be)}get _hasTransparentTerrain(){return this._plugins.produces(0,6)}get _hasTransparentIntegratedMesh(){return this._plugins.produces(this._renderContext.output,7)}_renderTransparentTerrain(){const e=()=>this._plugins.render(6);if(!G(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,y),r}_renderTransparentIntegratedMesh(){const e=()=>this._plugins.render(7);if(!G(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent integrated mesh");return this.renderToTargets(e,r,this._framebuffer.depth,y),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,12)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(12),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(le.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(15),t=this._framebufferSize,r=this.fboCache.acquireDepth(12,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(15)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=9,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&G(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...Ce),this._bindParameters.oitPass=2,this._plugins.precompile(...Ce),this._bindParameters.oitPass=0):this._plugins.precompile(...Ce),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(1,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture(),0),i.release()}else if(this._renderContext.output=r,0===e){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(12,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(12),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(0===e?le.HUD_OCCLUDED:le.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ce)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(5,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,{highlights:s}=r,a=e.acquire(i.width,i.height,"highlights",s.length>B?3:1);a.acquireDepth(13);const n=this._plugins.produces(9,0);return n&&this._framebuffer.color.fbo&&a.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,a.fbo,1024),t.bindFramebuffer(a.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),n||t.clear(1024),this._renderContext.output=9,t.bindFramebuffer(a.fbo),k(t,e,i,r,()=>this._renderHighlightGeometries()),a.detachDepth(),this.performanceInfo.advance(le.HIGHLIGHTS),a}_renderHighlightGeometries(){this._plugins.render(...we),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t,r,i){this._shadowAccumulator.updateDepthRange(e),this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,t,r,i)&&this.performanceInfo.advance(le.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&G(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...be),this._bindParameters.oitPass=2,this._plugins.precompile(...be),this._bindParameters.oitPass=0):this._plugins.precompile(...be)}_renderOIT(e,t,r=2){const i=1===e,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=1;const d=a?"oit hud color+alpha":"oit color+alpha",l=this.fboCache.acquire(s.width,s.height,d,8),_=1===t;_&&l.acquireColor(ue,8,"oit emissive"),l.acquireColor(_?pe:ue,7),a||l.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(l.fbo),this._rctx.clearFramebuffer([0,0,0,1]),_&&this._rctx.clearBuffer(1,x),n(),l.detachDepth(),h.oitPass=2;const u=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return _&&u.acquireColor(ue,8,"oit emissive front"),a?u.acquireDepth(12):u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(y,!!a),n(),u.detachDepth(),h.oitPass=0,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):this._framebuffer.bind(),this._oitblend??=new z(this._techniques),this._oitblend.blend(this._rctx,l,u,h,_,!i),a?.detachDepth(),u.release(),l.release(),this._renderContext.output=o,a}_renderOpaque(e){const t=this.plugins.produces(0,...ge);if(t){this._plugins.render(0,1);const e=this._framebuffer;e.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),e.update(e=>this._renderNodes(R.OPAQUE_TERRAIN,e)),e.bind(),this._plugins.render(2,3)}const r=this._framebuffer;this._renderTerrainDepth(e),r.update(e=>this._renderNodes(I.OPAQUE,e,t)),this.fboCache.debugCallback?.(I.OPAQUE,r.color.fbo),r.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,r.color.fbo),this._renderEdges(1)}_renderTransparent(e,t,r){const i=this._framebuffer;i.bind(),this._renderPlugins(20,le.VOXEL),this._renderHiddenTransparentEdges(),e&&(this._oitEnabled?this._renderOIT(0,r):this._renderTransparentGeometry()),i.update(t=>this._renderNodes(I.TRANSPARENT,t,e)),this.fboCache.debugCallback?.(I.TRANSPARENT,i.color.fbo),this._renderGeometryDepth(t),this._renderHUDVisibility(),t||this._plugins.render(15),this._renderEdges(0);const s=this._hasTransparentTerrain?this._renderTransparentTerrain():null;s&&(this.performanceInfo.advance(le.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(t?this._renderLineCallouts(0):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,s.getTexture())),this._renderHUD(0,i.color,r))),this._bindParameters.cullAboveTerrain=!1,s&&(i.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),N(r)?1:0),s.release(),t&&(this._renderEdges(1),e&&(this._oitEnabled?this._renderOIT(0,r):this._renderTransparentGeometry(),this.performanceInfo.advance(le.TRANSPARENT)),this._renderEdges(0)));const a=this._hasTransparentIntegratedMesh?this._renderTransparentIntegratedMesh():null;a&&(i.bind(),this._compositingHelper.composite(this._bindParameters,a.getTexture(),N(r)?1:0),a.release()),this._bindParameters.ssao=d(this._bindParameters.ssao),t&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(le.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(8),this.performanceInfo.advance(le.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}blitFBO(e,t=M,r=!0){return this._blit??=new j(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=T:(C(Se,this._bindParameters.camera.viewMatrix),C(Te,this._bindParameters.camera.projectionMatrix),w(Ee,Se,Te),w(Ee,this._renderContext.lastFrameCamera.viewMatrix,Ee),w(Ee,this._renderContext.lastFrameCamera.projectionMatrix,Ee),this._reprojectionMatrix=Ee);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=T,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}};e([g({readOnly:!0})],me.prototype,"fullResolutionAtmosphere",null),e([g()],me.prototype,"_edgeView",void 0),e([g()],me.prototype,"updating",null),me=e([b("esri.views.3d.webgl-engine.lib.Renderer")],me);const ce=[0,1,2,4],fe=[3,5],ge=[0,1,2,3],be=[4,5],Pe=[2,4,8],Ce=[16,13,14],we=[4,5,2,3,6,0,1],Te=S(),Se=S(),Ee=S();function xe(e){return t=>e.immediate.schedule(t)}export{me as Renderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{maxIndexCount as t,ManagedTextureBackedBuffer as e}from"./ManagedTextureBackedBuffer.js";
|
|
5
|
+
import{maxIndexCount as t,ManagedTextureBackedBuffer as e}from"./ManagedTextureBackedBuffer.js";class s{constructor(t,e){this._rctx=t,this._layoutDeclaration=e,this._bufferList=[]}garbageCollect(){const{_bufferList:t}=this;this._bufferList=t.filter(t=>0!==t.activeCount||(t.dispose(),!1))}destroy(){const{_bufferList:t}=this;t.forEach(t=>t.dispose()),this._bufferList=[]}getBuffer(s){const{_bufferList:r}=this;for(const t of r)if(t.availableCount>=s)return t;if(s>t)return null;const f=new e(this._rctx,this._layoutDeclaration);return r.push(f),f}updateTextures(){const t=this._bufferList;for(const e of t)e.textureBuffer.updateTexture()}}export{s as BufferManager};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{SimpleIndexManager as e}from"./SimpleIndexManager.js";import{
|
|
5
|
+
import{SimpleIndexManager as e}from"./SimpleIndexManager.js";import{TextureBackedBuffer as t}from"./TextureBackedBuffer.js";const r=65536;class i{constructor(i,n){this.textureBuffer=new t(i,n),this._indexManager=new e(r)}dispose(){this.textureBuffer.dispose(),this.textureBuffer=void 0}get availableCount(){return this._indexManager.availableCount}get activeCount(){return this._indexManager.activeCount}acquireIndex(){const e=this._indexManager.acquire();return this.textureBuffer.resizeToFit(e),e}acquireIndices(e){const t=new Uint16Array(e);let r=0;for(let i=0;i<e;++i){const e=this._indexManager.acquire();t[i]=e,r=Math.max(r,e)}return this.textureBuffer.resizeToFit(r),t}releaseIndex(e){this._indexManager.release(e)}}export{i as ManagedTextureBackedBuffer,r as maxIndexCount};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{typeToCreationInfoMap as t}from"./TextureBackedBufferFields.js";import{hashTextureBackedBufferLayout as e,LayoutField as r,TextureBackedBufferLayout as i}from"./TextureBackedBufferLayout.js";import{Texture as s}from"../../../../webgl/Texture.js";import{TextureDescriptor as n}from"../../../../webgl/TextureDescriptor.js";class u{constructor(t,e){this._rctx=t,this._fields=[],this._nameToFieldMap=new Map,this._textureData=new Uint8Array(new ArrayBuffer),this._textureWidth=1,this._textureHeight=1,this._dirty=!0,this._generateLayout(e);const r=new n(this._textureWidth,this._textureHeight);r.samplingMode=9728,r.wrapMode=33071,this._texture=new s(this._rctx,r)}get layout(){return this._layout}dispose(){this._texture.dispose(),this._texture=void 0,this._textureData=void 0}get test(){return{data:this._textureData,fields:this._fields}}getScalarField(t){const e=this._nameToFieldMap.get(t);return 1===e?.elementCount?e:null}getVec4Field(t){const e=this._nameToFieldMap.get(t);return 4===e?.elementCount?e:null}getVec5Field(t){const e=this._nameToFieldMap.get(t);return 5===e?.elementCount?e:null}resizeToFit(t){const e=t+1;e>this._textureData.length/this._layout.byteStride&&this._resize(e)}updateTexture(){if(!this._dirty)return;const t=this._texture.descriptor.width,e=this._texture.descriptor.height;t===this._textureWidth&&e===this._textureHeight||this._texture.resize(this._textureWidth,this._textureHeight),this._texture.setData(this._textureData),this._dirty=!1}get texture(){return this._texture}_resize(t){const{_fields:e,_layout:r}=this,i=r.byteStride;if(0===t){const t=new ArrayBuffer;this._textureData=new Uint8Array(t);for(const r of e)r.updateBuffer(t);return void(this._dirty=!0)}const s=Math.ceil(Math.sqrt(t)),n=Math.ceil(t/s),u=s*i,a=Math.ceil(u/4),o=new ArrayBuffer(u*n);for(const _ of e)_.updateBuffer(o);const h=new Uint8Array(o);h.set(this._textureData),this._textureData=h,this._textureWidth=a,this._textureHeight=n,this._dirty=!0}_generateLayout(t){const e=h(t),r=this._textureData.buffer;this._fields=e.fields.map(t=>{const e=t.createField(()=>this._dirty=!0);return e.updateBuffer(r),this._nameToFieldMap.set(e.name,e),e}),this._layout=e}}const a=new Map;function o(t){return a.get(t)}function h(s){const n=e(s);let u=a.get(n);if(null!=u)return u;let o=0;const h=[];for(let e=0;e<s.length;++e){const r=s[e],{type:i}=r,n=t.get(i);null!=n&&(h.push({declaration:r,byteOffset:o,creationInfo:n}),o+=n.byteSize)}o=_(o);const l=o,d=h.map(({declaration:t,byteOffset:e,creationInfo:i})=>new r(t,e,l,i));return u=new i(n,d,l),a.set(n,u),u}function _(t){return t+3&-4}export{u as TextureBackedBuffer,o as getTextureBackedBufferLayout};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{packFloatRGBA as e,packFloatRGB as t}from"../../../../../core/floatRGBA.js";import{BufferViewVec4u8 as s,BufferViewVec3u8 as r,BufferViewUint8 as i}from"../../../../../geometry/support/buffer/BufferView.js";import{elementTypeSize as f}from"../../../../../geometry/support/buffer/types.js";class u{constructor(e,t,s,r){this.name=e,this.byteOffset=t,this.byteStride=s,this.makeDirty=r}}class n extends u{constructor(e,t,s,r){super(e,t,s,r),this.elementCount=1}}class o extends n{constructor(e,t,s,r,i){super(e,s,r,i),this._bufferViewConstructor=t}updateBuffer(e){const{byteOffset:t,byteStride:s,_bufferViewConstructor:r}=this;this._bufferView=new r(e,t,s),this.makeDirty()}set(e,t){this._bufferView.set(e,t),this.makeDirty()}}class a extends n{constructor(e,t,s,r,i){super(e,t,s,r),this._maxValue=i}updateBuffer(e){const{byteOffset:t,byteStride:s}=this;this._bufferView=new r(e,t,s),this.makeDirty()}set(e,s){const{_bufferView:r,_maxValue:i,makeDirty:f}=this;t(s/i*.5+.5,p),r.setValues(e,p[0],p[1],p[2]),f()}}class c extends n{constructor(e,t,s,r,i){super(e,t,s,r),this._maxValue=i}updateBuffer(e){const{byteOffset:t,byteStride:r}=this;this._bufferView=new s(e,t,r),this.makeDirty()}set(t,s){const{_bufferView:r,_maxValue:i,makeDirty:f}=this;e(s/i*.5+.5,k),r.setValues(t,k[0],k[1],k[2],k[3]),f()}}class h extends u{constructor(e,t,s,r){super(e,t,s,r),this.elementCount=3}}class b extends h{constructor(e,t,s,r,i){super(e,s,r,i),this._bufferViewConstructor=t}updateBuffer(e){const{byteOffset:t,byteStride:s,_bufferViewConstructor:r}=this;this._bufferView=new r(e,t,s),this.makeDirty()}setValues(e,t,s,r){this._bufferView.set(e,0,t),this._bufferView.set(e,1,s),this._bufferView.set(e,2,r),this.makeDirty()}setElement(e,t,s){this._bufferView.set(e,t,s),this.makeDirty()}setVec(e,t){this._bufferView.setVec(e,t),this.makeDirty()}setArray(e,t){this._bufferView.set(e,0,t[0]),this._bufferView.set(e,1,t[1]),this._bufferView.set(e,2,t[2]),this.makeDirty()}}class V extends u{constructor(e,t,s,r){super(e,t,s,r),this.elementCount=4}}class w extends V{constructor(e,t,s,r,i){super(e,s,r,i),this._bufferViewConstructor=t}updateBuffer(e){const{byteOffset:t,byteStride:s,_bufferViewConstructor:r}=this;this._bufferView=new r(e,t,s),this.makeDirty()}setValues(e,t,s,r,i){this._bufferView.set(e,0,t),this._bufferView.set(e,1,s),this._bufferView.set(e,2,r),this._bufferView.set(e,3,i),this.makeDirty()}setElement(e,t,s){this._bufferView.set(e,t,s),this.makeDirty()}getElement(e,t){return this._bufferView.get(e,t)}setVec(e,t){this._bufferView.setVec(e,t),this.makeDirty()}setArray(e,t){this._bufferView.set(e,0,t[0]),this._bufferView.set(e,1,t[1]),this._bufferView.set(e,2,t[2]),this._bufferView.set(e,3,t[3]),this.makeDirty()}}class m extends u{constructor(e,t,s,r){super(e,t,s,r),this.elementCount=5}}class y extends m{constructor(e,t,s,r,i){super(e,s,r,i),this._bufferViewConstructor=t}updateBuffer(e){const{byteOffset:t,byteStride:s,_bufferViewConstructor:r}=this;this._bufferView=new r(e,t,s),this.makeDirty()}setValues(e,t,s,r,i,f){const u=254&r|f;this._bufferView.set(e,0,t),this._bufferView.set(e,1,s),this._bufferView.set(e,2,u),this._bufferView.set(e,3,i),this.makeDirty()}}const _={u8:{elementCount:1,byteSize:l(i),createField:(e,t,s,r)=>new o(e.name,i,t,s,r)},"packed-f24":{elementCount:1,byteSize:l(r),createField:(e,t,s,r)=>new a(e.name,t,s,r,e.maxValue)},"packed-f32":{elementCount:1,byteSize:l(s),createField:(e,t,s,r)=>new c(e.name,t,s,r,e.maxValue)},vec4u8:{elementCount:4,byteSize:l(s),createField:(e,t,r,i)=>new w(e.name,s,t,r,i)},u8u8u7xu8:{elementCount:5,byteSize:l(s),createField:(e,t,r,i)=>new y(e.name,s,t,r,i)}};function l(e){return f(e.ElementType)*e.ElementCount}const d=new Map;Object.entries(_).forEach(([e,t])=>{d.set(e,t)});const p=new Uint8Array(3),k=new Uint8Array(4);export{o as DefaultScalarField,b as DefaultVec3Field,w as DefaultVec4Field,u as Field,a as PackedF24Field,c as PackedF32Field,n as ScalarField,y as U8U8U7XU8Field,V as Vec4Field,m as Vec5Field,d as typeToCreationInfoMap};
|