@arcgis/core 5.0.0-next.70 → 5.0.0-next.71
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/analysis/Dimension/types.d.ts +5 -1
- package/analysis/DistanceMeasurementAnalysis.d.ts +22 -3
- package/analysis/ElevationProfile/types.d.ts +10 -2
- package/analysis/ShadowCast/DiscreteOptions.d.ts +4 -0
- package/analysis/ShadowCast/MinDurationOptions.d.ts +7 -0
- package/analysis/ShadowCast/TotalDurationOptions.d.ts +4 -0
- package/analysis/ShadowCastAnalysis.d.ts +51 -8
- package/analysis/Slice/types.d.ts +5 -1
- package/analysis/VolumeMeasurement/types.d.ts +5 -1
- package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
- package/analysis/types.d.ts +39 -7
- package/applications/Components/QuantityFormatter.js +1 -1
- package/applications/Components/imageryUtils.d.ts +2 -2
- package/applications/Components/testUtils.d.ts +2 -0
- package/applications/KnowledgeStudio/dataModelVisualization.d.ts +1 -0
- package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +59 -13
- package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +1 -1
- package/applications/PortalApp/layerUtils.d.ts +1 -0
- package/applications/Urban/LineImagePattern3D.d.ts +2 -0
- package/applications/Urban/imagePatternUtils.d.ts +4 -0
- package/arcade.d.ts +20 -11
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/1b284a6f32effe28aafc.js +1 -0
- package/assets/esri/core/workers/chunks/1bd5b421152fb0f46aa5.js +37 -0
- package/assets/esri/core/workers/chunks/{2e2c47f8a80ee9234350.js → 1d8fc0239c907ff5d1e8.js} +1 -1
- package/assets/esri/core/workers/chunks/{244006d4b0547d574401.js → 25abbe1663e18e677dc2.js} +143 -140
- package/assets/esri/core/workers/chunks/{c448540065690cac0744.js → 6087d5dc40bb62ec48c8.js} +1 -1
- package/assets/esri/core/workers/chunks/{866477acdf03b8a40bc9.js → bd1d159dce4094694c93.js} +1 -1
- package/assets/esri/core/workers/chunks/{401ce5cb98fa14c1a725.js → d8a7004c399d539aed09.js} +1 -1
- package/assets/esri/core/workers/chunks/{8d6641d0f7c93f83c414.js → db9c7182847e8f96ffe3.js} +1 -1
- package/assets/esri/core/workers/chunks/{6c9dac4a869742cc2718.js → e246b256347a281c13fd.js} +1 -1
- package/assets/esri/core/workers/chunks/{a10c6dd3bb8b3602de68.js → ee175fd4ec706f7878c0.js} +1 -1
- package/assets/esri/core/workers/chunks/f65b27fc0bc2f242aac7.js +1 -0
- package/assets/esri/core/workers/chunks/{5dd5be91038df8902dc4.js → f7dfbf24859f4ac2421b.js} +1 -1
- package/config.js +1 -1
- package/core/Version.d.ts +11 -2
- package/core/accessorSupport/types.d.ts +35 -5
- package/core/quantityFormatUtils.js +1 -1
- package/core/sql/types.d.ts +226 -31
- package/core/types.d.ts +24 -4
- package/editing/sharedTemplates/types.d.ts +1 -0
- package/editing/types.d.ts +2 -0
- package/effects/types.d.ts +1 -0
- package/form/ExpressionInfo.d.ts +1 -1
- package/form/FormTemplate.d.ts +4 -4
- package/form/elements/GroupElement.d.ts +1 -1
- package/form/elements/RelationshipElement.d.ts +3 -3
- package/form/elements/inputs/attachments/AttachmentInput.d.ts +2 -1
- package/form/elements/inputs/attachments/AudioInput.d.ts +1 -0
- package/form/elements/inputs/attachments/DocumentInput.d.ts +1 -0
- package/form/elements/inputs/attachments/ImageInput.d.ts +1 -0
- package/form/elements/inputs/attachments/Input.d.ts +5 -1
- package/form/elements/inputs/attachments/SignatureInput.d.ts +1 -0
- package/form/elements/inputs/attachments/VideoInput.d.ts +1 -0
- package/form/elements/inputs/attachments/types.d.ts +12 -3
- package/form/elements/inputs.d.ts +2 -2
- package/form/types.d.ts +3 -0
- package/geometry/geometryEngineTypes.d.ts +49 -9
- package/geometry/operators/types.d.ts +29 -4
- package/geometry/support/MeshVertexAttributes.d.ts +21 -2
- package/geometry/support/meshUtils/types.d.ts +126 -18
- package/geometry/types.d.ts +37 -6
- package/ground/NavigationConstraint.d.ts +3 -0
- package/identity/IdentityManagerBase.d.ts +153 -27
- package/interfaces.d.ts +27 -27
- package/intl/date.d.ts +5 -0
- package/intl/locale.d.ts +1 -0
- package/intl/messages.d.ts +12 -2
- package/intl/number.d.ts +5 -0
- package/intl/substitute.d.ts +28 -5
- package/intl/t9n.d.ts +13 -2
- package/kernel.js +1 -1
- package/layers/GaussianSplatLayer.d.ts +87 -6
- package/layers/ImageryTileLayer.d.ts +8 -8
- package/layers/LinkChartLayer.d.ts +1 -1
- package/layers/buildingSublayers/utils.d.ts +1 -0
- package/layers/effects/types.d.ts +12 -2
- package/layers/graphics/editingSupport.d.ts +202 -38
- package/layers/graphics/sources/ParquetSource.d.ts +23 -4
- package/layers/knowledgeGraph/IdTypePair.d.ts +15 -3
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.d.ts +61 -9
- package/layers/knowledgeGraph/LayoutMode.d.ts +1 -0
- package/layers/knowledgeGraph/dataModelVisualizationUtils.d.ts +6 -0
- package/layers/media/types.d.ts +25 -4
- package/layers/mixins/ArcGISImageService.d.ts +8 -9
- package/layers/mixins/ArcGISMapService.d.ts +5 -1
- package/layers/mixins/EditBusLayer.d.ts +3 -5
- package/layers/mixins/ImageryTileMixin.d.ts +2 -4
- package/layers/mixins/RasterJobHandlerMixin.js +1 -1
- package/layers/mixins/ScaleRange.d.ts +11 -2
- package/layers/mixins/properties/ILayerWithGetFeatureTitle.d.ts +11 -2
- package/layers/mixins/properties/ILayerWithGetField.d.ts +6 -1
- package/layers/ogc/ogcFeatureUtils.d.ts +2 -0
- package/layers/ogc/types.d.ts +55 -10
- package/layers/ogc/wcsUtils.d.ts +1 -0
- package/layers/ogc/wfsUtils.d.ts +8 -17
- package/layers/orientedImagery/core/ElevationSourceDefinitions.d.ts +6 -1
- package/layers/orientedImagery/transformations/types.d.ts +117 -21
- package/layers/orientedImagery/types.d.ts +37 -6
- package/layers/pointCloudFilters/typeUtils.d.ts +1 -0
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/raster/datasets/pixelReader.d.ts +2 -0
- package/layers/raster/datasets/types.d.ts +1 -0
- package/layers/raster/datasets/wcsCapabilitiesParser.d.ts +86 -17
- package/layers/raster/datasets/wcsCoverageParser.d.ts +601 -115
- package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
- package/layers/raster/formats/JpgPlus.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/raster/formats/Raw.js +1 -1
- package/layers/raster/formats/TiffDecoder.js +1 -1
- package/layers/raster/functions/changeDetectionUtils.d.ts +1 -0
- package/layers/raster/functions/creators/createAppearenceFunctions.d.ts +82 -15
- package/layers/raster/functions/creators/createBandIndexFunctions.d.ts +380 -70
- package/layers/raster/functions/creators/createChangeFunctions.d.ts +11 -2
- package/layers/raster/functions/creators/createConversionFunctions.d.ts +18 -3
- package/layers/raster/functions/creators/createDataManagementFunctions.d.ts +179 -35
- package/layers/raster/functions/creators/createLocalFunctions.d.ts +47 -9
- package/layers/raster/functions/creators/createMultiRasterAnalysisFunctions.d.ts +47 -9
- package/layers/raster/functions/creators/createStatisticsFunctions.d.ts +42 -8
- package/layers/raster/functions/creators/createSurfaceFunctions.d.ts +72 -11
- package/layers/raster/functions/focalStatUtils.d.ts +1 -0
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/layers/raster/functions/types.d.ts +29 -5
- package/layers/raster/types.d.ts +498 -6
- package/layers/support/BuildingFilterBlock.d.ts +19 -3
- package/layers/support/BuildingFilterMode.d.ts +1 -0
- package/layers/support/BuildingFilterModeSolid.d.ts +7 -1
- package/layers/support/BuildingFilterModeWireFrame.d.ts +17 -3
- package/layers/support/BuildingFilterModeXRay.d.ts +7 -1
- package/layers/support/CodedValue.d.ts +16 -3
- package/layers/support/ControlPoint.d.ts +17 -3
- package/layers/support/EditFieldsInfo.d.ts +21 -4
- package/layers/support/EditingCapabilities.d.ts +36 -7
- package/layers/support/ElevationTileData.d.ts +25 -5
- package/layers/support/FieldFormat.d.ts +1 -0
- package/layers/support/GeoreferenceBase.d.ts +1 -0
- package/layers/support/KMLMapImage.d.ts +13 -2
- package/layers/support/LabelExpressionInfo.d.ts +9 -1
- package/layers/support/MosaicRule.d.ts +41 -1
- package/layers/support/ParquetGeometryEncodingLocation.d.ts +13 -2
- package/layers/support/ParquetGeometryEncodingWkb.d.ts +7 -0
- package/layers/support/PixelBlock.d.ts +9 -4
- package/layers/support/PurgeOptions.d.ts +15 -2
- package/layers/support/RasterInfo.d.ts +1 -2
- package/layers/support/RasterJobHandler.js +1 -1
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/SpriteSource.d.ts +28 -6
- package/layers/support/rasterFunctionConstants.d.ts +39 -0
- package/layers/support/types.d.ts +420 -225
- package/layers/types.d.ts +771 -196
- package/layers/video/types.d.ts +72 -14
- package/layers/voxel/VoxelColorStop.d.ts +17 -3
- package/layers/voxel/VoxelFormat.d.ts +15 -2
- package/layers/voxel/VoxelIsosurface.d.ts +17 -2
- package/layers/voxel/VoxelOpacityStop.d.ts +8 -1
- package/layers/voxel/VoxelRangeFilter.d.ts +12 -2
- package/layers/voxel/VoxelUniqueValue.d.ts +19 -3
- package/layers/wms/types.d.ts +104 -19
- package/layers/wmts/types.d.ts +1 -0
- package/linkChart/ChronologicalLayoutSettings.d.ts +1 -1
- package/linkChart/OrganicLayoutSettings.d.ts +1 -1
- package/linkChart/types.d.ts +2 -0
- package/networks/UtilityNetworkTraceAnalysis.d.ts +61 -10
- package/networks/support/jsonTypes.d.ts +373 -71
- package/networks/support/typeUtils.d.ts +10 -0
- package/networks/support/utils.d.ts +30 -6
- package/package.json +1 -1
- package/popup/content/types.d.ts +1 -0
- package/popup/types.d.ts +33 -5
- package/portal/jsonTypes.d.ts +231 -39
- package/portal/support/resourceUtils.d.ts +49 -9
- package/portal/types.d.ts +98 -14
- package/renderers/FlowRenderer.js +1 -1
- package/renderers/RasterStretchRenderer.d.ts +1 -1
- package/renderers/support/AuthoringInfoClassBreakInfo.d.ts +4 -0
- package/renderers/support/AuthoringInfoFieldInfo.d.ts +15 -2
- package/renderers/support/DotDensityLegendOptions.d.ts +4 -0
- package/renderers/support/HeatmapLegendOptions.d.ts +8 -0
- package/renderers/support/OthersCategory.d.ts +6 -0
- package/renderers/support/RendererLegendOptions.d.ts +14 -2
- package/renderers/support/pointCloud/ColorClassBreakInfo.d.ts +13 -1
- package/renderers/support/pointCloud/ColorModulation.d.ts +6 -0
- package/renderers/support/pointCloud/ColorUniqueValueInfo.d.ts +19 -3
- package/renderers/support/pointCloud/PointSizeAlgorithm.d.ts +1 -0
- package/renderers/support/pointCloud/PointSizeFixedSizeAlgorithm.d.ts +14 -2
- package/renderers/support/pointCloud/PointSizeSplatAlgorithm.d.ts +9 -1
- package/renderers/support/pointCloud/types.d.ts +7 -1
- package/renderers/support/raster/types.d.ts +22 -2
- package/renderers/support/types.d.ts +29 -2
- package/renderers/types.d.ts +47 -4
- package/renderers/visualVariables/support/SizeVariableLegendOptions.d.ts +4 -0
- package/renderers/visualVariables/support/VisualVariableLegendOptions.d.ts +9 -1
- package/request/types.d.ts +152 -24
- package/rest/featureService/types.d.ts +423 -77
- package/rest/geometryService/types.d.ts +23 -1
- package/rest/imageService.d.ts +5 -5
- package/rest/knowledgeGraph/DataModel.d.ts +2 -2
- package/rest/knowledgeGraph/GraphAnyValue.d.ts +1 -0
- package/rest/knowledgeGraph/GraphDataModelSingletonOperationResult.d.ts +12 -2
- package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.d.ts +1 -1
- package/rest/knowledgeGraph/GraphDeletePropertyResult.d.ts +1 -1
- package/rest/knowledgeGraph/GraphQuery.d.ts +1 -1
- package/rest/knowledgeGraph/GraphSearch.d.ts +3 -3
- package/rest/knowledgeGraph/GraphSearchStreaming.d.ts +3 -3
- package/rest/knowledgeGraph/SearchIndex.d.ts +1 -1
- package/rest/knowledgeGraph/toolService/findPaths/CIMFilteredFindPathsPathFilter.d.ts +3 -3
- package/rest/knowledgeGraph/toolService/findPaths/CIMFilteredFindPathsResultJSON.d.ts +151 -29
- package/rest/knowledgeGraph/toolService/findPaths/CIMKGTraversalDirection.d.ts +1 -1
- package/rest/knowledgeGraph/wasmInterface/KnowledgeWasmInterface.d.ts +1 -0
- package/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.d.ts +9 -0
- package/rest/knowledgeGraphService.d.ts +4 -4
- package/rest/lastMileDelivery/types.d.ts +5 -0
- package/rest/layerSources/DynamicDataLayer.d.ts +12 -0
- package/rest/layerSources/DynamicMapLayer.d.ts +14 -2
- package/rest/layerSources/JoinTableDataSource.d.ts +21 -2
- package/rest/layerSources/QueryTableDataSource.d.ts +32 -5
- package/rest/layerSources/RasterDataSource.d.ts +17 -3
- package/rest/layerSources/TableDataSource.d.ts +22 -4
- package/rest/networks/circuits/support/ExportCircuitsParameters.d.ts +8 -1
- package/rest/networks/circuits/support/QueryCircuitsParameters.d.ts +18 -3
- package/rest/networks/support/QueryNamedTraceConfigurationsParameters.d.ts +22 -4
- package/rest/query/support/AttachmentInfo.d.ts +1 -1
- package/rest/support/AddressToLocationsParameters.d.ts +39 -3
- package/rest/support/AddressesToLocationsParameters.d.ts +14 -0
- package/rest/support/BaseImageMeasureResultValue.d.ts +21 -4
- package/rest/support/DirectionsString.d.ts +16 -3
- package/rest/support/ImageMeasureResultAngleValue.d.ts +12 -2
- package/rest/support/ImageMeasureResultAreaValue.d.ts +12 -2
- package/rest/support/ImageMeasureResultLengthValue.d.ts +12 -2
- package/rest/support/LocateSetting.d.ts +12 -2
- package/rest/support/LocateSettingBase.d.ts +14 -2
- package/rest/support/LocateSettingSource.d.ts +12 -2
- package/rest/support/LocateSettings.d.ts +22 -4
- package/rest/support/LocateSettingsOverrides.d.ts +42 -8
- package/rest/support/LocationToAddressParameters.d.ts +7 -0
- package/rest/support/NetworkAttribute.d.ts +11 -2
- package/rest/support/NetworkServiceDescription.d.ts +20 -4
- package/rest/support/QuantizationParameters.d.ts +9 -0
- package/rest/support/SuggestLocationsParameters.d.ts +10 -0
- package/rest/support/SuggestionCandidate.d.ts +14 -2
- package/rest/support/types.d.ts +53 -3
- package/rest/types.d.ts +50 -5
- package/rest/versionManagement/gdbVersion/support/AlterVersionParameters.d.ts +22 -4
- package/rest/versionManagement/gdbVersion/support/PostResult.d.ts +6 -1
- package/rest/versionManagement/gdbVersion/support/ReconcileParameters.d.ts +10 -1
- package/rest/versionManagement/gdbVersion/support/ReconcileResult.d.ts +8 -1
- package/rest/versionManagement/support/CreateVersionParameters.d.ts +13 -2
- package/rest/versionManagement/support/GetVersionInfosParameters.d.ts +8 -1
- package/smartMapping/heuristics/types.d.ts +50 -6
- package/smartMapping/popup/types.d.ts +29 -5
- package/smartMapping/raster/renderers/types.d.ts +12 -1
- package/smartMapping/raster/support/adapters/types.d.ts +1 -0
- package/smartMapping/renderers/color.d.ts +9 -3
- package/smartMapping/renderers/dotDensity.d.ts +3 -1
- package/smartMapping/renderers/heatmap.d.ts +3 -1
- package/smartMapping/renderers/location.d.ts +3 -1
- package/smartMapping/renderers/opacity.d.ts +3 -1
- package/smartMapping/renderers/pieChart.d.ts +3 -1
- package/smartMapping/renderers/predominance.d.ts +3 -1
- package/smartMapping/renderers/relationship.d.ts +3 -1
- package/smartMapping/renderers/size.d.ts +23 -7
- package/smartMapping/renderers/support/rendererUtils.d.ts +3 -1
- package/smartMapping/renderers/type.d.ts +3 -1
- package/smartMapping/renderers/univariateColorSize.d.ts +3 -1
- package/smartMapping/statistics/types.d.ts +16 -4
- package/smartMapping/symbology/type.d.ts +5 -1
- package/smartMapping/symbology/types.d.ts +1303 -241
- package/smartMapping/types.d.ts +5 -0
- package/statistics/types.d.ts +13 -2
- package/support/revision.js +1 -1
- package/symbols/callouts/LineCallout3DBorder.d.ts +4 -0
- package/symbols/cim/types.d.ts +764 -111
- package/symbols/patterns/LinePattern3D.d.ts +1 -0
- package/symbols/patterns/Pattern3D.d.ts +1 -0
- package/symbols/support/IconSymbol3DLayerResource.d.ts +7 -0
- package/symbols/support/ObjectSymbol3DLayerResource.d.ts +7 -0
- package/symbols/support/OccludedVisibility.d.ts +3 -0
- package/symbols/support/Symbol3DAnchorPosition2D.d.ts +4 -0
- package/symbols/support/Symbol3DAnchorPosition3D.d.ts +5 -0
- package/symbols/support/Symbol3DFillMaterial.d.ts +4 -0
- package/symbols/support/Symbol3DHalo.d.ts +10 -0
- package/symbols/support/Symbol3DIconOutline.d.ts +10 -0
- package/symbols/support/Symbol3DMaterial.d.ts +6 -0
- package/symbols/support/Symbol3DOutline.d.ts +21 -2
- package/symbols/support/Symbol3DTextBackground.d.ts +12 -2
- package/symbols/support/symbolUtils.d.ts +5 -1
- package/symbols/support/types.d.ts +4 -0
- package/symbols/types.d.ts +67 -7
- package/tables/AttributeTableTemplate.d.ts +2 -2
- package/tables/elements/AttributeTableAttachmentElement.d.ts +1 -1
- package/tables/elements/AttributeTableElement.d.ts +2 -2
- package/tables/elements/AttributeTableFieldElement.d.ts +1 -1
- package/tables/elements/AttributeTableGroupElement.d.ts +1 -1
- package/tables/elements/AttributeTableRelationshipElement.d.ts +1 -1
- package/tables/support/FieldOrder.d.ts +16 -3
- package/tables/support/tablesUtils.d.ts +1 -0
- package/time/types.d.ts +4 -0
- package/versionManagement/VersionManagementService.d.ts +3 -6
- package/versionManagement/VersionManager.d.ts +126 -23
- package/versionManagement/VersioningState.d.ts +1 -1
- package/versionManagement/support/jsonTypes.d.ts +152 -30
- package/versionManagement/support/type.d.ts +2 -0
- package/versionManagement/versionAdapters/types.d.ts +25 -5
- package/views/2d/MapViewConstraints.d.ts +37 -5
- package/views/2d/analysis/AnalysisView2D.d.ts +5 -1
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +28 -4
- package/views/2d/analysis/DistanceMeasurementAnalysisView2D.d.ts +28 -4
- package/views/2d/analysis/types.d.ts +5 -1
- package/views/2d/engine/flow/BrushFlow.js +1 -1
- package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
- package/views/2d/engine/flow/FlowStrategy.js +1 -1
- package/views/2d/engine/flow/FlowView2D.js +1 -1
- package/views/2d/engine/flow/ProcessingTimeEstimate.js +5 -0
- package/views/2d/engine/flow/animatedValues.js +5 -0
- package/views/2d/engine/flow/dataUtils.js +1 -1
- package/views/2d/engine/flow/flowPathsIO.js +5 -0
- package/views/2d/engine/flow/styles/AFlowResources.js +5 -0
- package/views/2d/engine/flow/styles/Imagery.js +1 -1
- package/views/2d/engine/flow/styles/Particles.js +1 -1
- package/views/2d/engine/flow/styles/Stack.js +1 -1
- package/views/2d/engine/flow/styles/Streamlines.js +1 -1
- package/views/2d/engine/flow/utils.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/support/MediaLayerInteractionOptions.d.ts +1 -0
- package/views/2d/layers/types.d.ts +1 -0
- package/views/2d/types.d.ts +93 -6
- package/views/3d/analysis/AnalysisView3D.d.ts +5 -1
- package/views/3d/analysis/DirectLineMeasurement/types.d.ts +24 -4
- package/views/3d/analysis/LineOfSight/types.d.ts +1 -0
- package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +19 -3
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/types.d.ts +5 -1
- package/views/3d/analysis/types.d.ts +25 -3
- package/views/3d/constraints/AltitudeConstraint.d.ts +5 -0
- package/views/3d/constraints/ClipDistanceConstraint.d.ts +13 -2
- package/views/3d/constraints/Constraints.d.ts +26 -4
- package/views/3d/constraints/TiltConstraint.d.ts +5 -0
- package/views/3d/environment/SceneViewEnvironment.d.ts +9 -0
- package/views/3d/environment/types.d.ts +3 -0
- package/views/3d/layers/ImageryLayerView3D.js +1 -1
- package/views/3d/layers/support/MediaLayerInteractionOptions.d.ts +15 -2
- package/views/3d/layers/support/MediaLayerInteractionReshapeOptions.d.ts +3 -0
- package/views/3d/types.d.ts +52 -0
- package/views/3d/webgl/ManagedColorAttachment.d.ts +2 -0
- package/views/3d/webgl/ManagedDepthAttachment.d.ts +2 -0
- package/views/3d/webgl/ManagedFBO.d.ts +4 -0
- package/views/3d/webgl/ManagedFBOAttachment.d.ts +1 -0
- package/views/3d/webgl/ManagedFBOResource.d.ts +5 -0
- package/views/3d/webgl/types.d.ts +32 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +20 -22
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js +9 -5
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +8 -6
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +9 -8
- package/views/MapViewOrSceneView.d.ts +1 -0
- package/views/SceneView.d.ts +59 -0
- package/views/SceneView.js +1 -1
- package/views/View.d.ts +2 -2
- package/views/View2D.d.ts +37 -0
- package/views/View2D.js +1 -1
- package/views/Viewport2DMixin.d.ts +9 -6
- package/views/analysis/AnalysisView.d.ts +2 -0
- package/views/analysis/AreaMeasurement/types.d.ts +18 -3
- package/views/analysis/DistanceMeasurement/types.d.ts +13 -2
- package/views/analysis/types.d.ts +7 -1
- package/views/animation/easing.js +1 -1
- package/views/animation/types.d.ts +3 -4
- package/views/draw/CursorUpdateEvent.d.ts +24 -4
- package/views/draw/DrawAction.d.ts +4 -6
- package/views/draw/DrawCompleteEvent.d.ts +18 -3
- package/views/draw/VertexAddEvent.d.ts +19 -3
- package/views/draw/VertexRemoveEvent.d.ts +19 -3
- package/views/draw/types.d.ts +4 -0
- package/views/input/types.d.ts +371 -57
- package/views/interactive/sketch/SketchTooltipVisibleElements.d.ts +19 -1
- package/views/interactive/sketch/Units.d.ts +5 -0
- package/views/interactive/tooltip/types.d.ts +2 -0
- package/views/layers/HighlightLayerViewMixin.d.ts +59 -1
- package/views/layers/HighlightLayerViewMixin.js +1 -1
- package/views/layers/ImageryLayerViewMixin.d.ts +60 -2
- package/views/layers/ImageryTileLayerViewMixin.d.ts +2 -0
- package/views/layers/LayerView.d.ts +6 -0
- package/views/layers/MediaLayerViewMixin.d.ts +8 -1
- package/views/layers/types.d.ts +3 -0
- package/views/navigation/types.d.ts +6 -1
- package/views/support/AttributionItem.d.ts +10 -2
- package/views/types.d.ts +306 -53
- package/views/ui/types.d.ts +42 -6
- package/webdoc/Widgets.d.ts +26 -5
- package/webdoc/geotriggersInfo/support/typeUtils.d.ts +3 -0
- package/webdoc/support/SlideThumbnail.d.ts +4 -0
- package/webdoc/support/types.d.ts +11 -2
- package/webdoc/support/webdocSaveUtils.d.ts +6 -0
- package/webdoc/widgets/FloorFilter.d.ts +25 -4
- package/webmap/Version.d.ts +1 -0
- package/webscene/Version.d.ts +1 -0
- package/webscene/support/Description.d.ts +3 -0
- package/webscene/support/SlideEnvironment.d.ts +6 -0
- package/webscene/support/SlideGround.d.ts +7 -1
- package/webscene/support/SlideVisibleLayer.d.ts +5 -0
- package/webscene/support/Title.d.ts +3 -0
- package/widgets/Attachments/types.d.ts +32 -6
- package/widgets/BasemapGallery/types.d.ts +3 -0
- package/widgets/BasemapLayerList/BasemapLayerListVisibleElements.d.ts +14 -0
- package/widgets/BasemapLayerList/types.d.ts +1 -0
- package/widgets/BatchAttributeForm/VisibleElements.d.ts +7 -1
- package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.d.ts +2 -0
- package/widgets/BatchAttributeForm/inputs/TextElementInput.d.ts +14 -2
- package/widgets/BatchAttributeForm/inputs/types.d.ts +2 -0
- package/widgets/BatchAttributeForm/types.d.ts +75 -14
- package/widgets/BatchAttributeForm.d.ts +2 -2
- package/widgets/Bookmarks/BookmarksVisibleElements.d.ts +30 -9
- package/widgets/Bookmarks/types.d.ts +32 -10
- package/widgets/CatalogLayerList/CatalogLayerListVisibleElements.d.ts +11 -0
- package/widgets/CatalogLayerList/types.d.ts +1 -0
- package/widgets/Daylight/VisibleElements.d.ts +11 -1
- package/widgets/Daylight/types.d.ts +8 -2
- package/widgets/DirectionalPad/VisibleElements.d.ts +6 -0
- package/widgets/DirectionalPad/types.d.ts +13 -2
- package/widgets/Directions/DirectionsVisibleElements.d.ts +8 -0
- package/widgets/Editor/CreateFeaturesWorkflowData.d.ts +3 -3
- package/widgets/Editor/EditorViewModel.d.ts +2 -3
- package/widgets/Editor/Edits.d.ts +1 -2
- package/widgets/Editor/SplitFeatureWorkflow.d.ts +2 -2
- package/widgets/Editor/VisibleElements.d.ts +46 -13
- package/widgets/Editor/support/EditorEditingCapabilities.d.ts +46 -9
- package/widgets/Editor/types.d.ts +149 -24
- package/widgets/ElevationProfile/ElevationProfileVisibleElements.d.ts +13 -1
- package/widgets/ElevationProfile/types.d.ts +87 -14
- package/widgets/Expand.d.ts +2 -2
- package/widgets/Feature/types.d.ts +105 -18
- package/widgets/FeatureForm/GroupInput.d.ts +1 -1
- package/widgets/FeatureForm/RelationshipInput.d.ts +1 -1
- package/widgets/FeatureForm/TextElementInput.d.ts +3 -5
- package/widgets/FeatureForm/UtilityNetworkAssociationInput.d.ts +1 -1
- package/widgets/FeatureForm/VisibleElements.d.ts +7 -1
- package/widgets/FeatureForm/types.d.ts +3 -0
- package/widgets/FeatureForm.d.ts +1 -1
- package/widgets/FeatureTable/ColumnMenuVisibleElements.d.ts +4 -0
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +14 -4
- package/widgets/FeatureTable/Grid/Column.d.ts +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.d.ts +2 -0
- package/widgets/FeatureTable/Grid/types.d.ts +137 -24
- package/widgets/FeatureTable/TableMenuVisibleElements.d.ts +10 -0
- package/widgets/FeatureTable/VisibleElements.d.ts +16 -2
- package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +1 -1
- package/widgets/FeatureTable/support/types.d.ts +155 -27
- package/widgets/FeatureTable.d.ts +3 -3
- package/widgets/FeatureTemplates/VisibleElements.d.ts +4 -0
- package/widgets/FeatureTemplates/types.d.ts +17 -2
- package/widgets/Features/FeaturesVisibleElements.d.ts +12 -0
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/Histogram/types.d.ts +14 -2
- package/widgets/HistogramRangeSlider/types.d.ts +1 -0
- package/widgets/LayerList/LayerListVisibleElements.d.ts +10 -0
- package/widgets/LayerList/types.d.ts +8 -0
- package/widgets/Legend/styles/card/CardView.d.ts +13 -2
- package/widgets/Legend/styles/classic/ClassicView.d.ts +11 -2
- package/widgets/Measurement/types.d.ts +3 -0
- package/widgets/OrientedImageryViewer/types.d.ts +15 -3
- package/widgets/Popup/PopupVisibleElements.d.ts +11 -0
- package/widgets/Popup/types.d.ts +64 -7
- package/widgets/Print/FileLink.d.ts +36 -6
- package/widgets/Print/types.d.ts +77 -13
- package/widgets/ScaleRangeSlider/types.d.ts +4 -0
- package/widgets/ScaleRangeSlider.d.ts +5 -1
- package/widgets/ShadowCast/ShadowCastVisibleElements.d.ts +15 -1
- package/widgets/ShadowCast/types.d.ts +8 -2
- package/widgets/Sketch/CreateToolVisibilityMap.d.ts +19 -4
- package/widgets/Sketch/SelectionToolVisibilityMap.d.ts +4 -0
- package/widgets/Sketch/VisibleElements.d.ts +38 -6
- package/widgets/Sketch/types.d.ts +364 -60
- package/widgets/Slider/types.d.ts +249 -46
- package/widgets/Swipe/types.d.ts +6 -0
- package/widgets/TableList/TableListVisibleElements.d.ts +11 -0
- package/widgets/TableList/types.d.ts +5 -0
- package/widgets/TimeSlider/types.d.ts +45 -7
- package/widgets/Track/types.d.ts +4 -1
- package/widgets/UtilityNetworkAssociations/VisibleElements.d.ts +23 -4
- package/widgets/UtilityNetworkAssociations/VisibleElementsSettingsPane.d.ts +7 -0
- package/widgets/UtilityNetworkTrace/types.d.ts +26 -5
- package/widgets/ValuePicker/ValuePickerBaseComponent.d.ts +2 -0
- package/widgets/ValuePicker/ValuePickerSliderVisibleElements.d.ts +7 -1
- package/widgets/ValuePicker/ValuePickerVisibleElements.d.ts +9 -1
- package/widgets/ValuePicker/types.d.ts +8 -0
- package/widgets/Weather/VisibleElements.d.ts +6 -1
- package/widgets/Weather/types.d.ts +1 -0
- package/widgets/smartMapping/types.d.ts +63 -6
- package/widgets/support/GridControls/VisibleElements.d.ts +11 -0
- package/widgets/support/GridControls/types.d.ts +1 -0
- package/widgets/support/SnappingControls/VisibleElements.d.ts +26 -4
- package/widgets/support/forms/types.d.ts +2 -0
- package/widgets/support/types.d.ts +19 -3
- package/widgets/types.d.ts +549 -89
- package/assets/esri/core/workers/chunks/329b10897c6965948b84.js +0 -1
- package/assets/esri/core/workers/chunks/35593a9790818b689455.js +0 -1
- package/assets/esri/core/workers/chunks/98d68b145226e7527c84.js +0 -33
- package/views/2d/engine/flow/FlowDisplayData.js +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2206],{2495:(e,t,r)=>{r.d(t,{$U:()=>Ce,fs:()=>Ee,ty:()=>Ae});var i=r(38954),o=r(51850),n=r(49255),a=r(25634),s=r(11725),l=r(70328),c=r(620);class d{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const u=(0,l.vt)(),h=(0,o.vt)();function m(e,t,r,o,n,a,s){if(null==e)return;const c=function(e,t){return(0,i.h)(t,1/e[0],1/e[1],1/e[2])}(r,h);if((0,l.Ne)(u,e.bbMin),(0,l.vI)(u,e.bbMax),null!=n&&n.applyToAabb(u),function(e,t,r,i){return function(e,t,r,i){const o=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let a=Math.min(o,n),s=Math.max(o,n);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(u,t,c,o)){const{primitiveIndices:i,position:l}=e,c=i?i.length:l.indices.length/3;if(c>M){const i=e.getChildren();if(void 0!==i){for(const e of i)m(e,t,r,o,n,a,s);return}}!function(e,t,r,i,o,n,a,s,l,c,d){const u=e[0],h=e[1],m=e[2],f=t[0],v=t[1],g=t[2],{normalRequired:_}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*o[r];let c=n[i],w=n[i+1],b=n[i+2];const y=a*o[r+1];let M=n[y],C=n[y+1],S=n[y+2];const E=a*o[r+2];let A=n[E],I=n[E+1],R=n[E+2];null!=l&&([c,w,b]=l.applyToVertex(c,w,b,e),[M,C,S]=l.applyToVertex(M,C,S,e),[A,I,R]=l.applyToVertex(A,I,R,e));const O=M-c,F=C-w,P=S-b,D=A-c,H=I-w,N=R-b,z=v*N-H*g,L=g*D-N*f,B=f*H-D*v,V=O*z+F*L+P*B;if(Math.abs(V)<=T)continue;const U=u-c,G=h-w,j=m-b,W=U*z+G*L+j*B;if(V>0){if(W<0||W>V)continue}else if(W>0||W<V)continue;const k=G*P-F*j,$=j*O-P*U,Z=U*F-O*G,q=f*k+v*$+g*Z;if(V>0){if(q<0||W+q>V)continue}else if(q>0||W+q<V)continue;const Y=(D*k+H*$+N*Z)/V;Y>=0&&d(Y,t,_?x(O,F,P,D,H,N,p):null)}}(t,r,0,c,l.indices,l.data,l.stride,i,n,a,s)}}const p=(0,o.vt)();function f(e,t,r,i,o,n,a,s){const l=e[0],c=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,f=n*t,v=o[f],g=o[f+1],_=o[f+2],w=n*r,b=n*i,y=o[w]-v,M=o[w+1]-g,C=o[w+2]-_,S=o[b]-v,E=o[b+1]-g,A=o[b+2]-_,I=h*A-E*m,R=m*S-A*u,O=u*E-S*h,F=y*I+M*R+C*O;if(Math.abs(F)<=T)continue;const P=l-v,D=c-g,H=d-_,N=P*I+D*R+H*O;if(F>0){if(N<0||N>F)continue}else if(N>0||N<F)continue;const z=D*C-M*H,L=H*y-C*P,B=P*M-y*D,V=u*z+h*L+m*B;if(F>0){if(V<0||N+V>F)continue}else if(V>0||N+V<F)continue;const U=(S*z+E*L+A*B)/F;U>=0&&s(U,e,a?x(y,M,C,S,E,A,p):null)}}const v=(0,o.vt)(),g=(0,o.vt)(),_=(0,o.vt)();function x(e,t,r,o,n,a,s){return(0,i.h)(b,e,t,r),(0,i.h)(y,o,n,a),(0,i.f)(s,b,y),(0,i.n)(s,s),s}function w(e){return(0,i.a)(b,e[1],e[0]),(0,i.a)(y,e[2],e[0]),(0,i.f)(p,b,y),(0,i.n)(p,p),p}const b=(0,o.vt)(),y=(0,o.vt)(),M=1e3,T=1e-7,C=(0,o.vt)(),S=[(0,o.vt)(),(0,o.vt)(),(0,o.vt)()];var E=r(16396),A=r(13030),I=r(59907);class R{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,o,n){return(0,I.vJ)(r,i,this.layout,e,t,o,n)}intersect(e,t,r,o,n,a,s){const l=this.layout.createView(e).getField("position",A.xs);if(null==l)return;const c=(0,i.a)(O,a,n),d=l.count/3,u=o.options.normalRequired;f(n,c,0,d,l.typedBuffer,l.typedBufferStride,u,(e,t,r)=>s(e,r,t))}}const O=(0,o.vt)();var F=r(43616),P=r(31635),D=r(91429),H=r(91829),N=r(4431),z=r(1843),L=r(72824),B=r(13840),V=r(42958),U=r(16943),G=r(33524);const j={mask:255},W={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},k={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var $=r(4576),Z=r(44208);r(53966),r(34275),r(94656),r(63907),(0,Z.A)("esri-tests-disable-gpu-memory-measurements");var q=r(69622),Y=r(65529),X=r(77690),K=r(29242),J=r(58083),Q=r(9093),ee=r(32728);class te{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",A.Eq),this.color=e.getField("instanceColor",A.XP),this.olidColor=e.getField("instanceOlidColor",A.XP),this.state=e.getField("state",A.SL),this.lodLevel=e.getField("lodLevel",A.SL)}}let re=class extends q.A{constructor(e,t){super(e),this.events=new Y.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return oe(ie.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=ce,this._buffer=this._layout.createBuffer(this._capacity),this._view=new te(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,c.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,c.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=ne,o=ae;t.localTransform.getMat(e,se),t.globalTransform.getMat(e,le);const n=(0,J.lw)(le,le,se);(0,i.h)(r,n[12],n[13],n[14]),t.modelOrigin.setVec(e,r),(0,X.z0)(o,n),t.model.setMat(e,o);const a=(0,ee.wp)(ne,n);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,X.B8)(o,o),(0,X.mg)(o,o),t.modelNormal.setMat(e,o),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,ae),r.modelOrigin.getVec(e,ne),t[0]=ae[0],t[1]=ae[1],t[2]=ae[2],t[3]=0,t[4]=ae[3],t[5]=ae[4],t[6]=ae[5],t[7]=0,t[8]=ae[6],t[9]=ae[7],t[10]=ae[8],t[11]=0,t[12]=ne[0],t[13]=ne[1],t[14]=ne[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ne,this,e),t*=Math.max(ne[0],ne[1],ne[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ne,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(ne[0],ne[1],ne[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(ce,Math.floor(this._capacity*$.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new te(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,P.Cg)([(0,D.MZ)({constructOnly:!0})],re.prototype,"shaderTransformation",void 0),(0,P.Cg)([(0,D.MZ)()],re.prototype,"_size",void 0),(0,P.Cg)([(0,D.MZ)({readOnly:!0})],re.prototype,"size",null),re=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],re);const ie=(0,z.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function oe(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,U.E)()&&e.vec4u8("instanceOlidColor"),e}const ne=(0,o.vt)(),ae=(0,K.vt)(),se=(0,Q.vt)(),le=(0,Q.vt)(),ce=64,de=(0,z.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var ue=r(74810),he=r(28491),me=r(90644),pe=r(49788);class fe extends L.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=ue.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=o.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,o.CN)(.2,.2,.2),this.diffuse=(0,o.CN)(.8,.8,.8),this.externalColor=(0,H.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,o.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=pe.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}L.gy;let ve=class extends V.w{constructor(e,t){let i=(0,N.U)(xe(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,N.U)(function(e){return oe(de.clone(),e)}(t)))),super(e,t,i),this.shader=new B.r(he.D,()=>r.e(5141).then(r.bind(r,5141)))}_makePipeline(e,t){const{oitPass:r,output:i,hasEmission:o,transparent:a,cullFace:s,customDepthTest:l,hasOccludees:c}=e;return(0,me.Ey)({blending:(0,n._o)(i)&&a?(0,G.Yf)(r):null,culling:_e(e)?(0,me.Xt)(s):null,depthTest:(0,G.mt)(r,ge(l)),depthWrite:(0,G.z5)(e),drawBuffers:(0,V.L)(i,(0,G.Sv)(r,o)),colorWrite:me.kn,stencilWrite:c?j:null,stencilTest:c?t?k:W:null,polygonOffset:(0,G.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function ge(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function _e(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function xe(e){const t=(0,z.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,U.E)()&&t.vec4u8("olidColor"),t}ve=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],ve);var we=r(51976),be=r(99550);class ye extends be.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,P.Cg)([(0,we.W)({count:4})],ye.prototype,"alphaDiscardMode",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"doubleSidedMode",void 0),(0,P.Cg)([(0,we.W)({count:7})],ye.prototype,"pbrMode",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"cullFace",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"normalType",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"customDepthTest",void 0),(0,P.Cg)([(0,we.W)({count:8})],ye.prototype,"emissionSource",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVertexColors",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasSymbolColors",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVerticalOffset",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasColorTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasMetallicRoughnessTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasOcclusionTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasNormalTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasScreenSizePerspective",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVertexTangents",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasOccludees",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instanced",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instancedDoublePrecision",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasModelTransformation",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"offsetBackfaces",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVVSize",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVVColor",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"receiveShadows",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"receiveAmbientOcclusion",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"textureAlphaPremultiplied",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instancedFeatureAttribute",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instancedColor",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"writeDepth",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"transparent",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"enableOffset",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"terrainDepthTest",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"cullAboveTerrain",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"snowCover",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasColorTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasEmissionTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasNormalTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasOcclusionTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Me=r(57323);let Te=class extends ve{constructor(){super(...arguments),this.shader=new B.r(Me.R,()=>r.e(2314).then(r.bind(r,39933)))}};Te=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],Te);class Ce extends s.i{constructor(e,t){super(e,Ee),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>((0,n.iq)(e)||(0,n.yT)(e))&&!this.transparent],[4,e=>((0,n.iq)(e)||(0,n.yT)(e))&&this.transparent&&this.parameters.writeDepth],[9,e=>((0,n.iq)(e)||(0,n.yT)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=xe(this.parameters),this._configuration=new ye(t.spherical)}isVisibleForOutput(e){return 3!==e&&5!==e&&4!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=pe.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.m)(this.parameters.emissiveBaseColor,o.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:o,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=r.hasNormalTexture,i.hasColorTexture=r.hasColorTexture,i.hasMetallicRoughnessTexture=r.hasMetallicRoughnessTexture,i.hasOcclusionTexture=r.hasOcclusionTexture,i.hasVertexTangents=!o&&r.hasVertexTangents,i.instanced=r.instanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.hasVVColor=!!r.vvColor,i.hasVVSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=o?0:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??0,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?0:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!o&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=o?2:a&&"normal"===s?1:a&&"winding-order"===s?2:0,i.instancedFeatureAttribute=r.instancedFeatureAttribute,i.instancedColor=r.instancedColor,(0,n._o)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?2:1:0,i.emissionSource=r.emissionSource,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.enableOffset,i.snowCover=t.snowCover>0,i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,o,n,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.h)(De,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case 1:a=(0,i.n)(Fe,De);break;case 2:a=(0,i.d)(Fe,Oe)}const s=(0,i.e)(He,De,e.eye),l=(0,i.b)(s),c=(0,i.j)(s,s,1/l);let d=null;this.parameters.screenSizePerspective&&(d=(0,i.g)(a,c));const u=(0,F.kE)(e,l,this.parameters.verticalOffset,d??0,this.parameters.screenSizePerspective,null);(0,i.j)(a,a,u),(0,i.t)(Pe,a,r.transform.inverseRotation),o=(0,i.e)(Ie,o,Pe),n=(0,i.e)(Re,n,Pe)}!function(e,t,r,o,n,a){if(!e.visible)return;const s=(0,i.a)(C,o,r),l=(e,t,r)=>a(e,r,t),{tolerance:u}=t,h=new d(u,!1,t.options.normalRequired);if(e.boundingInfo)(0,c.vA)(0===e.type),m(e.boundingInfo,r,s,u,n,h,l);else{const t=e.positionAttribute,o=t.indices;!function(e,t,r,o,n,a,s,l,c,d){const u=t,h=S,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),x=m>=p?m>=f?0:2:p>=f?1:2,b=x,y=u[b]<0?2:1,M=(x+y)%3,T=(x+(3-y))%3,C=u[M]/u[b],E=u[T]/u[b],A=1/u[b],I=v,R=g,O=_,{normalRequired:F}=c;for(let t=r;t<o;++t){const r=3*t,o=s*n[r];(0,i.h)(h[0],a[o+0],a[o+1],a[o+2]);const c=s*n[r+1];(0,i.h)(h[1],a[c+0],a[c+1],a[c+2]);const u=s*n[r+2];(0,i.h)(h[2],a[u+0],a[u+1],a[u+2]),l&&((0,i.d)(h[0],l.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.d)(h[1],l.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.d)(h[2],l.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(I,h[0],e),(0,i.a)(R,h[1],e),(0,i.a)(O,h[2],e);const m=I[M]-C*I[b],p=I[T]-E*I[b],f=R[M]-C*R[b],v=R[T]-E*R[b],g=O[M]-C*O[b],_=O[T]-E*O[b],x=g*v-_*f,y=m*_-p*g,S=f*p-v*m;if((x<0||y<0||S<0)&&(x>0||y>0||S>0))continue;const P=x+y+S;if(0===P)continue;const D=x*(A*I[b])+y*(A*R[b])+S*(A*O[b]);if(D*Math.sign(P)<0)continue;const H=D/P;H>=0&&d(H,t,F?w(h):null)}}(r,s,0,o.length/3,o,t.data,t.stride,n,h,l)}}(e,r,o,n,(0,E.ou)(r.verticalOffset),a)}createGLMaterial(e){return new Se(e)}createBufferWriter(){return new R(this._layout)}get transparent(){return Ae(this.parameters)}}class Se extends a.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.h)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?Te:ve,e)}}class Ee extends fe{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function Ae(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:o,texture:n,textureId:a,textureAlphaMode:s,colorMixMode:l}=e,c=i[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||o<1||(null!=n||null!=a)&&1!==s&&2!==s&&"replace"!==l}const Ie=(0,o.vt)(),Re=(0,o.vt)(),Oe=(0,o.fA)(0,0,1),Fe=(0,o.vt)(),Pe=(0,o.vt)(),De=(0,o.vt)(),He=(0,o.vt)()},6867:(e,t,r)=>{r.d(t,{i:()=>d});var i=r(58083),o=r(9093),n=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351);class d{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,n.j)(h,this.ray.direction,this.distance),(0,n.b)(h))}withinDistance(e){return!!u(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!u(this)&&((0,n.j)(h,this.ray.direction,this.distance),(0,n.i)(e,this.ray.origin,h),!0)}getTransformedNormal(e){return(0,n.d)(m,this.normal),m[3]=0,(0,s.t)(m,m,this.transformation),(0,n.d)(e,m),(0,n.n)(e,e)}constructor(e){this.intersector=4,this.normal=(0,a.vt)(),this.transformation=(0,o.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,d){this.intersector=e,this.distance=r,(0,n.d)(this.normal,s??a.Cb),(0,i.C)(this.transformation,l??o.zK),this.target=t,this.drapedLayerOrder=c,this.renderPriority=d}copy(e){(0,c.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,n.d)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function u(e){return null!=e?.distance}const h=(0,a.vt)(),m=(0,l.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>n});var i=r(33094),o=r(31821);function n(e,t){t.snowCover&&(e.uniforms.add(new i.U("snowCover",e=>e.snowCover)).code.add(o.H`float getSnow(vec3 normal, vec3 groundNormal) {
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2206],{2495:(e,t,r)=>{r.d(t,{$U:()=>Ce,fs:()=>Ee,ty:()=>Ae});var i=r(38954),n=r(51850),o=r(49255),a=r(25634),s=r(11725),l=r(70328),c=r(620);class d{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const u=(0,l.vt)(),h=(0,n.vt)();function m(e,t,r,n,o,a,s){if(null==e)return;const c=function(e,t){return(0,i.h)(t,1/e[0],1/e[1],1/e[2])}(r,h);if((0,l.Ne)(u,e.bbMin),(0,l.vI)(u,e.bbMax),null!=o&&o.applyToAabb(u),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(u,t,c,n)){const{primitiveIndices:i,position:l}=e,c=i?i.length:l.indices.length/3;if(c>M){const i=e.getChildren();if(void 0!==i){for(const e of i)m(e,t,r,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,l,c,d){const u=e[0],h=e[1],m=e[2],f=t[0],v=t[1],g=t[2],{normalRequired:_}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let c=o[i],w=o[i+1],b=o[i+2];const y=a*n[r+1];let M=o[y],C=o[y+1],S=o[y+2];const E=a*n[r+2];let A=o[E],I=o[E+1],R=o[E+2];null!=l&&([c,w,b]=l.applyToVertex(c,w,b,e),[M,C,S]=l.applyToVertex(M,C,S,e),[A,I,R]=l.applyToVertex(A,I,R,e));const O=M-c,F=C-w,P=S-b,D=A-c,H=I-w,N=R-b,z=v*N-H*g,L=g*D-N*f,B=f*H-D*v,V=O*z+F*L+P*B;if(Math.abs(V)<=T)continue;const U=u-c,G=h-w,j=m-b,W=U*z+G*L+j*B;if(V>0){if(W<0||W>V)continue}else if(W>0||W<V)continue;const k=G*P-F*j,$=j*O-P*U,Z=U*F-O*G,q=f*k+v*$+g*Z;if(V>0){if(q<0||W+q>V)continue}else if(q>0||W+q<V)continue;const Y=(D*k+H*$+N*Z)/V;Y>=0&&d(Y,t,_?x(O,F,P,D,H,N,p):null)}}(t,r,0,c,l.indices,l.data,l.stride,i,o,a,s)}}const p=(0,n.vt)();function f(e,t,r,i,n,o,a,s){const l=e[0],c=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,f=o*t,v=n[f],g=n[f+1],_=n[f+2],w=o*r,b=o*i,y=n[w]-v,M=n[w+1]-g,C=n[w+2]-_,S=n[b]-v,E=n[b+1]-g,A=n[b+2]-_,I=h*A-E*m,R=m*S-A*u,O=u*E-S*h,F=y*I+M*R+C*O;if(Math.abs(F)<=T)continue;const P=l-v,D=c-g,H=d-_,N=P*I+D*R+H*O;if(F>0){if(N<0||N>F)continue}else if(N>0||N<F)continue;const z=D*C-M*H,L=H*y-C*P,B=P*M-y*D,V=u*z+h*L+m*B;if(F>0){if(V<0||N+V>F)continue}else if(V>0||N+V<F)continue;const U=(S*z+E*L+A*B)/F;U>=0&&s(U,e,a?x(y,M,C,S,E,A,p):null)}}const v=(0,n.vt)(),g=(0,n.vt)(),_=(0,n.vt)();function x(e,t,r,n,o,a,s){return(0,i.h)(b,e,t,r),(0,i.h)(y,n,o,a),(0,i.f)(s,b,y),(0,i.n)(s,s),s}function w(e){return(0,i.a)(b,e[1],e[0]),(0,i.a)(y,e[2],e[0]),(0,i.f)(p,b,y),(0,i.n)(p,p),p}const b=(0,n.vt)(),y=(0,n.vt)(),M=1e3,T=1e-7,C=(0,n.vt)(),S=[(0,n.vt)(),(0,n.vt)(),(0,n.vt)()];var E=r(16396),A=r(13030),I=r(59907);class R{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,n,o){return(0,I.vJ)(r,i,this.layout,e,t,n,o)}intersect(e,t,r,n,o,a,s){const l=this.layout.createView(e).getField("position",A.xs);if(null==l)return;const c=(0,i.a)(O,a,o),d=l.count/3,u=n.options.normalRequired;f(o,c,0,d,l.typedBuffer,l.typedBufferStride,u,(e,t,r)=>s(e,r,t))}}const O=(0,n.vt)();var F=r(43616),P=r(31635),D=r(91429),H=r(91829),N=r(4431),z=r(1843),L=r(72824),B=r(13840),V=r(42958),U=r(16943),G=r(33524);const j={mask:255},W={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},k={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var $=r(4576),Z=r(44208);r(53966),r(34275),r(94656),r(63907),(0,Z.A)("esri-tests-disable-gpu-memory-measurements");var q=r(69622),Y=r(65529),X=r(77690),K=r(29242),J=r(58083),Q=r(9093),ee=r(32728);class te{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",A.Eq),this.color=e.getField("instanceColor",A.XP),this.olidColor=e.getField("instanceOlidColor",A.XP),this.state=e.getField("state",A.SL),this.lodLevel=e.getField("lodLevel",A.SL)}}let re=class extends q.A{constructor(e,t){super(e),this.events=new Y.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return ne(ie.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=ce,this._buffer=this._layout.createBuffer(this._capacity),this._view=new te(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,c.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,c.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=oe,n=ae;t.localTransform.getMat(e,se),t.globalTransform.getMat(e,le);const o=(0,J.lw)(le,le,se);(0,i.h)(r,o[12],o[13],o[14]),t.modelOrigin.setVec(e,r),(0,X.z0)(n,o),t.model.setMat(e,n);const a=(0,ee.wp)(oe,o);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,X.B8)(n,n),(0,X.mg)(n,n),t.modelNormal.setMat(e,n),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,ae),r.modelOrigin.getVec(e,oe),t[0]=ae[0],t[1]=ae[1],t[2]=ae[2],t[3]=0,t[4]=ae[3],t[5]=ae[4],t[6]=ae[5],t[7]=0,t[8]=ae[6],t[9]=ae[7],t[10]=ae[8],t[11]=0,t[12]=oe[0],t[13]=oe[1],t[14]=oe[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(oe,this,e),t*=Math.max(oe[0],oe[1],oe[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(oe,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(oe[0],oe[1],oe[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(ce,Math.floor(this._capacity*$.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new te(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,P.Cg)([(0,D.MZ)({constructOnly:!0})],re.prototype,"shaderTransformation",void 0),(0,P.Cg)([(0,D.MZ)()],re.prototype,"_size",void 0),(0,P.Cg)([(0,D.MZ)({readOnly:!0})],re.prototype,"size",null),re=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],re);const ie=(0,z.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function ne(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,U.E)()&&e.vec4u8("instanceOlidColor"),e}const oe=(0,n.vt)(),ae=(0,K.vt)(),se=(0,Q.vt)(),le=(0,Q.vt)(),ce=64,de=(0,z.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var ue=r(74810),he=r(28491),me=r(90644),pe=r(49788);class fe extends L.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=ue.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=n.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,n.CN)(.2,.2,.2),this.diffuse=(0,n.CN)(.8,.8,.8),this.externalColor=(0,H.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,n.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=pe.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}L.gy;let ve=class extends V.w{constructor(e,t){let i=(0,N.U)(xe(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,N.U)(function(e){return ne(de.clone(),e)}(t)))),super(e,t,i),this.shader=new B.r(he.D,()=>r.e(5141).then(r.bind(r,5141)))}_makePipeline(e,t){const{oitPass:r,output:i,hasEmission:n,transparent:a,cullFace:s,customDepthTest:l,hasOccludees:c}=e;return(0,me.Ey)({blending:(0,o._o)(i)&&a?(0,G.Yf)(r):null,culling:_e(e)?(0,me.Xt)(s):null,depthTest:(0,G.mt)(r,ge(l)),depthWrite:(0,G.z5)(e),drawBuffers:(0,V.L)(i,(0,G.Sv)(r,n)),colorWrite:me.kn,stencilWrite:c?j:null,stencilTest:c?t?k:W:null,polygonOffset:(0,G.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function ge(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function _e(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function xe(e){const t=(0,z.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,U.E)()&&t.vec4u8("olidColor"),t}ve=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],ve);var we=r(51976),be=r(99550);class ye extends be.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,P.Cg)([(0,we.W)({count:4})],ye.prototype,"alphaDiscardMode",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"doubleSidedMode",void 0),(0,P.Cg)([(0,we.W)({count:7})],ye.prototype,"pbrMode",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"cullFace",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"normalType",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"customDepthTest",void 0),(0,P.Cg)([(0,we.W)({count:8})],ye.prototype,"emissionSource",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVertexColors",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasSymbolColors",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVerticalOffset",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasColorTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasMetallicRoughnessTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasOcclusionTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasNormalTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasScreenSizePerspective",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVertexTangents",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasOccludees",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instanced",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instancedDoublePrecision",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasModelTransformation",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"offsetBackfaces",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVVSize",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVVColor",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"receiveShadows",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"receiveAmbientOcclusion",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"textureAlphaPremultiplied",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instancedFeatureAttribute",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instancedColor",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"writeDepth",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"transparent",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"enableOffset",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"terrainDepthTest",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"cullAboveTerrain",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"snowCover",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasColorTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasEmissionTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasNormalTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasOcclusionTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Me=r(57323);let Te=class extends ve{constructor(){super(...arguments),this.shader=new B.r(Me.R,()=>r.e(2314).then(r.bind(r,39933)))}};Te=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],Te);class Ce extends s.i{constructor(e,t){super(e,Ee),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>((0,o.iq)(e)||(0,o.yT)(e))&&!this.transparent],[4,e=>((0,o.iq)(e)||(0,o.yT)(e))&&this.transparent&&this.parameters.writeDepth],[9,e=>((0,o.iq)(e)||(0,o.yT)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=xe(this.parameters),this._configuration=new ye(t.spherical)}isVisibleForOutput(e){return 3!==e&&5!==e&&4!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=pe.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.m)(this.parameters.emissiveBaseColor,n.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:n,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=r.hasNormalTexture,i.hasColorTexture=r.hasColorTexture,i.hasMetallicRoughnessTexture=r.hasMetallicRoughnessTexture,i.hasOcclusionTexture=r.hasOcclusionTexture,i.hasVertexTangents=!n&&r.hasVertexTangents,i.instanced=r.instanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.hasVVColor=!!r.vvColor,i.hasVVSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=n?0:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??0,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?0:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!n&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=n?2:a&&"normal"===s?1:a&&"winding-order"===s?2:0,i.instancedFeatureAttribute=r.instancedFeatureAttribute,i.instancedColor=r.instancedColor,(0,o._o)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?2:1:0,i.emissionSource=r.emissionSource,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.enableOffset,i.snowCover=t.snowCover>0,i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,n,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.h)(De,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case 1:a=(0,i.n)(Fe,De);break;case 2:a=(0,i.d)(Fe,Oe)}const s=(0,i.e)(He,De,e.eye),l=(0,i.b)(s),c=(0,i.j)(s,s,1/l);let d=null;this.parameters.screenSizePerspective&&(d=(0,i.g)(a,c));const u=(0,F.kE)(e,l,this.parameters.verticalOffset,d??0,this.parameters.screenSizePerspective,null);(0,i.j)(a,a,u),(0,i.t)(Pe,a,r.transform.inverseRotation),n=(0,i.e)(Ie,n,Pe),o=(0,i.e)(Re,o,Pe)}!function(e,t,r,n,o,a){if(!e.visible)return;const s=(0,i.a)(C,n,r),l=(e,t,r)=>a(e,r,t),{tolerance:u}=t,h=new d(u,!1,t.options.normalRequired);if(e.boundingInfo)(0,c.vA)(0===e.type),m(e.boundingInfo,r,s,u,o,h,l);else{const t=e.positionAttribute,n=t.indices;!function(e,t,r,n,o,a,s,l,c,d){const u=t,h=S,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),x=m>=p?m>=f?0:2:p>=f?1:2,b=x,y=u[b]<0?2:1,M=(x+y)%3,T=(x+(3-y))%3,C=u[M]/u[b],E=u[T]/u[b],A=1/u[b],I=v,R=g,O=_,{normalRequired:F}=c;for(let t=r;t<n;++t){const r=3*t,n=s*o[r];(0,i.h)(h[0],a[n+0],a[n+1],a[n+2]);const c=s*o[r+1];(0,i.h)(h[1],a[c+0],a[c+1],a[c+2]);const u=s*o[r+2];(0,i.h)(h[2],a[u+0],a[u+1],a[u+2]),l&&((0,i.d)(h[0],l.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.d)(h[1],l.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.d)(h[2],l.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(I,h[0],e),(0,i.a)(R,h[1],e),(0,i.a)(O,h[2],e);const m=I[M]-C*I[b],p=I[T]-E*I[b],f=R[M]-C*R[b],v=R[T]-E*R[b],g=O[M]-C*O[b],_=O[T]-E*O[b],x=g*v-_*f,y=m*_-p*g,S=f*p-v*m;if((x<0||y<0||S<0)&&(x>0||y>0||S>0))continue;const P=x+y+S;if(0===P)continue;const D=x*(A*I[b])+y*(A*R[b])+S*(A*O[b]);if(D*Math.sign(P)<0)continue;const H=D/P;H>=0&&d(H,t,F?w(h):null)}}(r,s,0,n.length/3,n,t.data,t.stride,o,h,l)}}(e,r,n,o,(0,E.ou)(r.verticalOffset),a)}createGLMaterial(e){return new Se(e)}createBufferWriter(){return new R(this._layout)}get transparent(){return Ae(this.parameters)}}class Se extends a.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.h)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?Te:ve,e)}}class Ee extends fe{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function Ae(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:n,texture:o,textureId:a,textureAlphaMode:s,colorMixMode:l}=e,c=i[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||n<1||(null!=o||null!=a)&&1!==s&&2!==s&&"replace"!==l}const Ie=(0,n.vt)(),Re=(0,n.vt)(),Oe=(0,n.fA)(0,0,1),Fe=(0,n.vt)(),Pe=(0,n.vt)(),De=(0,n.vt)(),He=(0,n.vt)()},6867:(e,t,r)=>{r.d(t,{i:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351);class d{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,o.j)(h,this.ray.direction,this.distance),(0,o.b)(h))}withinDistance(e){return!!u(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!u(this)&&((0,o.j)(h,this.ray.direction,this.distance),(0,o.i)(e,this.ray.origin,h),!0)}getTransformedNormal(e){return(0,o.d)(m,this.normal),m[3]=0,(0,s.t)(m,m,this.transformation),(0,o.d)(e,m),(0,o.n)(e,e)}constructor(e){this.intersector=4,this.normal=(0,a.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,d){this.intersector=e,this.distance=r,(0,o.d)(this.normal,s??a.Cb),(0,i.C)(this.transformation,l??n.zK),this.target=t,this.drapedLayerOrder=c,this.renderPriority=d}copy(e){(0,c.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,o.d)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function u(e){return null!=e?.distance}const h=(0,a.vt)(),m=(0,l.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>o});var i=r(33094),n=r(31821);function o(e,t){t.snowCover&&(e.uniforms.add(new i.U("snowCover",e=>e.snowCover)).code.add(n.H`float getSnow(vec3 normal, vec3 groundNormal) {
|
|
2
2
|
return smoothstep(0.5, 0.55, dot(normal, groundNormal)) * snowCover;
|
|
3
3
|
}
|
|
4
4
|
float getRealisticTreeSnow(vec3 faceNormal, vec3 shadingNormal, vec3 groundNormal) {
|
|
@@ -6,16 +6,16 @@ float snow = min(1.0, smoothstep(0.5, 0.55, dot(faceNormal, groundNormal)) +
|
|
|
6
6
|
smoothstep(0.5, 0.55, dot(-faceNormal, groundNormal)) +
|
|
7
7
|
smoothstep(0.0, 0.1, dot(shadingNormal, groundNormal)));
|
|
8
8
|
return snow * snowCover;
|
|
9
|
-
}`),e.code.add(
|
|
9
|
+
}`),e.code.add(n.H`vec3 applySnowToMRR(vec3 mrr, float snow) {
|
|
10
10
|
return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
|
|
11
|
-
}`))}},11725:(e,t,r)=>{r.d(t,{i:()=>l});var i=r(24326),o=r(49255),n=r(99550),a=r(43616),s=r(65786);class l{constructor(e,t){this.id=(0,i.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,a.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,a.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get hasEmissions(){return!1}getConfiguration(e,t,r=new n.E){return r.output=e,r.hasEmission=t.hasEmission&&(0,o._o)(e),r.hasHighlightMixTexture=8===e&&null!=t.highlightMixTexture,r}}s.Y},11868:(e,t,r)=>{r.d(t,{Wz:()=>n,oe:()=>o});var i=r(34275);function o(e,t=!1){return e<=i.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function n(e){return(Array.isArray(e)?e.length:e.byteLength/8)<=i.y9?Array.from(e):new Float32Array(e)}},12791:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},13840:(e,t,r)=>{r.d(t,{r:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},14113:(e,t,r)=>{r.d(t,{N5:()=>s});var i=r(49186),o=(r(44208),r(53966));const n=()=>o.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new m,this.outputs=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,n=o.uniforms.generateSource(),a=o.code.generateSource(),s=o.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?g:v,d=o.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${d.join("\n")}\n${n.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${u.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let o=0;o<i;++o)r[o](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let n=0;n<i;++n)r[n](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,o,n)=>{for(let a=0;a<i;++a)r[a](e,n,t,o)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else n().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new c(this),this.code=new d(this),this.constants=new f(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?n().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):n().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class f{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=f._numberToFloatStr(r);break;case"int":i=f._numberToIntStr(r);break;case"uint":i=f._numberToUintStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])}, ${f._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])}, ${f._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])}, ${f._numberToUintStr(r[2])}, ${f._numberToUintStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>f._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const v="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",g="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,o)=>i.setUniform4fv(e,t(o),r))}}},14527:(e,t,r)=>{r.d(t,{n:()=>vt});var i=r(31821),o=r(12791),n=r(31635),a=r(34727),s=r(97768),l=r(36708),c=r(78659),d=r(91429),u=r(37585),h=r(69540);let m=class extends h.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"row",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"column",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"rows",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"columns",void 0),m=(0,n.Cg)([(0,d.$K)("esri.CameraLayout")],m);const p=m;var f=r(69052),v=r(25482),g=r(56507),_=r(86738),x=r(43937),w=r(36005);let b=class extends((0,h.OU)(v.o)){constructor(...e){super(...e),this.position=new _.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new p}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const o={position:e};return null!=t&&(o.heading=t),null!=r&&(o.tilt=r),null!=i&&(o.fov=i),o}return e}writePosition(e,t,r,i){const o=e.clone();o.x=(0,g.GB)(e.x||0),o.y=(0,g.GB)(e.y||0),o.z=e.hasZ?(0,g.GB)(e.z||0):e.z,t[r]=o.write({},i)}readPosition(e,t){const r=new _.A;return r.read(e,t),r.x=(0,g.GB)(r.x||0),r.y=(0,g.GB)(r.y||0),r.z=r.hasZ?(0,g.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,n.Cg)([(0,d.MZ)({type:_.A,json:{write:{isRequired:!0}}})],b.prototype,"position",void 0),(0,n.Cg)([(0,x.K)("position")],b.prototype,"writePosition",null),(0,n.Cg)([(0,w.w)("position")],b.prototype,"readPosition",null),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>f.ie.normalize((0,g.GB)(e)))],b.prototype,"heading",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e),-180,180))],b.prototype,"tilt",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e,55),1,170))],b.prototype,"fov",void 0),(0,n.Cg)([(0,d.MZ)({type:p,nonNullable:!0,json:{read:!1,write:!1}})],b.prototype,"layout",void 0),b=(0,n.Cg)([(0,d.$K)("esri.Camera")],b);var y=r(9093),M=r(38954),T=r(51850),C=r(16930),S=(r(48353),r(9762),r(65806)),E=r(27993),A=r(73941),I=(r(19419),r(71351)),R=r(69622),O=r(53966),F=r(90629),P=r(58083),D=r(48163),H=r(87317),N=r(91829),z=r(82919),L=r(44280);const B=(0,T.vt)(),V=(0,T.vt)();var U;let G=U=class extends R.A{constructor(e){super(e),this._ray=(0,I.vt)(),this._viewport=(0,N.fA)(0,0,1,1),this._padding=(0,N.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,D.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,y.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,y.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,y.vt)(),this._frustumDirty=!0,this._frustum=(0,z.vt)(),this._fullViewport=(0,N.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,T.vt)(),this._up=(0,T.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,M.e)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,P.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,H.s)((0,N.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,H.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,H.s)((0,N.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,H.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,H.a)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,H.f)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,P.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,P.B8)((0,y.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,y.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,M.B)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,P.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,P.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,o=r/this.rows,n=i/this.columns,a=-i/2+this.column*n,s=a+n,l=-r/2+this.row*o,c=l+o,d=(0,P.$h)((0,y.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,P.aI)(u,d)?u:d}copyFrom(e){(0,M.d)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,H.f)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,H.f)(this._padding,e.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,P.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,z.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,P.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,H.f)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new U).copyFrom(this)}equals(e){return(0,M.m)(this.eye,e.eye)&&(0,M.m)(this.center,e.center)&&(0,M.m)(this.up,e.up)&&(0,H.a)(this._viewport,e.viewport)&&(0,H.a)(this._padding,e.padding)&&(0,u.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,H.g)(e.screenPadding,this.screenPadding)>=t||(0,H.g)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,M.a)(k,e.eye,e.center),(0,M.a)($,this.eye,this.center);const r=(0,M.g)(k,$),i=(0,M.H)(k),o=(0,M.H)($),n=5e-4;return r*r>=(1-1e-10)*i*o&&(0,M.G)(e.eye,this.eye)<Math.max(i,o)*n*n}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,L.gr)(this.viewForward,(0,M.e)(k,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,F.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==j&&(0,M.d)(j,e),j[3]=1,(0,H.t)(j,j,this.projectionMatrix);const r=Math.abs(j[3]);(0,M.j)(j,j,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*j[1]),t[2]=.5*(j[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;j[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],j[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],j[2]=(2*e[2]-1)*e[3],j[3]=e[3],null!=this.inverseProjectionMatrix&&((0,H.t)(j,j,this.inverseProjectionMatrix),t[0]=j[0],t[1]=j[1],t[2]=j[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,Z),this.renderToScreen(Z,t),t}projectToRenderScreen(e,t){if(j[0]=e[0],j[1]=e[1],j[2]=e[2],j[3]=1,(0,H.t)(j,j,this.viewProjectionMatrix),0===j[3])return null;const r=j;(0,M.j)(r,r,1/Math.abs(j[3]));const i=this.fullViewport,o=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),n=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=o,t.y=n):(t[0]=o,t[1]=n,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Z),t)}unprojectFromRenderScreen(e,t){if((0,P.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,P.B8)(W,W))return null;const r=this.fullViewport;return j[0]=2*(e[0]-r[0])/r[2]-1,j[1]=2*(e[1]-r[1])/r[3]-1,j[2]=2*e[2]-1,j[3]=1,(0,H.t)(j,j,W),0===j[3]?null:(t[0]=j[0]/j[3],t[1]=j[1]/j[3],t[2]=j[2]/j[3],t)}constrainWindowSize(e,t,r,i){const o=e*this.pixelRatio,n=t*this.pixelRatio,a=Math.max(o-r/2,0),s=Math.max(this.fullHeight-n-i/2,0),l=-Math.min(o-r/2,0),c=-Math.min(this.fullHeight-n-i/2,0),d=r-l- -Math.min(this.fullWidth-o-r/2,0),u=i-c- -Math.min(n-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:o,fovY:n}=this,s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,B),(0,M.e)(V,r,t);const i=(0,M.b)(V);return 0===i?0:(0,a.XM)((0,M.g)(V,B)/i)}(t,r,i));return e.frustumCoverage(s,o,n)}_computeUpGlobal(){(0,M.e)(k,this.center,this.eye);const e=(0,M.b)(this.center);e<1?(0,M.m)(this._up,T.Cb)&&((0,M.d)(this._up,T.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,M.g)(k,this.center))>.9999*(0,M.b)(k)*e||((0,M.f)($,k,this.center),(0,M.f)($,$,k),(0,M.n)($,$),(0,M.m)(this._up,$)||((0,M.d)(this._up,$),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,M.C)(k,this.eye,this.center),Math.abs(k[2])<=.9999&&((0,M.j)(k,k,k[2]),(0,M.h)(k,-k[0],-k[1],1-k[2]),(0,M.n)(k,k),(0,M.m)(this._up,k)||((0,M.d)(this._up,k),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,M.m)(e,t)||((0,M.d)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):O.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,z.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,P.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,n.Cg)([(0,d.MZ)()],G.prototype,"_viewport",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_padding",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_fov",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_nearFar",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_viewDirty",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_viewMatrix",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_pixelRatio",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"pixelRatio",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"row",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"column",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_rows",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"rows",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_columns",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"columns",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"eye",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"center",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_center",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"up",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_up",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"viewMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"viewForward",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"viewUp",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"viewRight",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"nearFar",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"near",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"far",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"viewport",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"screenViewport",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"screenPadding",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"x",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"y",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"width",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"height",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"fullWidth",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"fullHeight",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"_aspect",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"padding",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"projectionMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"inverseProjectionMatrix",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"fov",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"fovX",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"fovY",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"viewInverseTransposeMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"_projectionMatrixInternal",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"relativeElevation",void 0),G=U=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl.RenderCamera")],G);const j=(0,N.vt)(),W=(0,y.vt)(),k=(0,T.vt)(),$=(0,T.vt)(),Z=(0,F.r_)();r(49718),r(6867),r(16396),(0,T.vt)(),(0,T.vt)(),(0,T.vt)();var q=r(5443),Y=r(39829),X=r(95108);function K(e,t,r,i){const o=function(e,t){const r=0===t||2===t?0:1,i=e[t],o=0===t||1===t?1:-1,n=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===o?0:1;if(t[r]>i&&a[r]>i)return 1===o?1:0;const s=(a[n]-t[n])/(a[r]-t[r]),l=t[n]+s*(i-t[r]);return e[r]=i,e[n]=l,(t[r]<i?1:-1)*o>0?2:3}}(r,i);if(e.length=0,t.length){1===o(Q,t[0],t[0])&&J(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(o(Q,t[r],i)){case 1:J(e,i);break;case 3:J(e,(0,D.o8)(Q));break;case 2:J(e,(0,D.o8)(Q)),J(e,i)}}}}function J(e,t){0!==e.length&&(0,u.aI)(e.at(-1),t)||e.push(t)}const Q=(0,D.vt)();var ee=r(11964),te=r(27921);const re=(0,T.vt)(),ie=(0,T.vt)();function oe(){return{direction:(0,T.vt)(),up:(0,T.vt)()}}function ne(e,t,r,i,o){let n=(0,M.n)(re,e),s=(0,M.g)(n,i);const l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,M.g)(t,i)),s<.99?((0,M.d)(n,t),l&&(0,M.j)(n,n,-1)):n=null);let c=0;if(n){(0,M.j)(ie,i,(0,M.g)(i,n)),(0,M.e)(n,n,ie);const e=(0,M.g)(n,o)/((0,M.b)(n)*(0,M.b)(o));(0,M.f)(ie,n,o),c=((0,M.g)(ie,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,M.g)(i,e)/(0,M.b)(e)));return r?(r.heading=c,r.tilt=d,r):{heading:c,tilt:d}}function ae(e,t,r,i){(0,M.e)(se,r,t),(0,te.T7)(i,(0,ee.LV)(t,se),e)||e===r||(0,M.d)(e,r)}const se=(0,T.vt)(),le=(0,T.fA)(0,1,0),ce=(0,T.fA)(0,0,1),de=(0,y.vt)(),ue=(0,T.vt)(),he=(0,T.vt)();function me(e,t,r,i=oe()){const{direction:o,up:n}=i;return(0,P.N9)(de,-(0,a.kU)(t)),(0,P.eL)(de,de,(0,a.kU)(r)),(0,M.p)(o,ce,de),(0,M.j)(o,o,-1),(0,M.p)(n,le,de),i}function pe(e,t,r,i,o){const n=t.lines[11].direction,a=(o-r.getAltitude(i))/n[2];(0,M.c)(e,i,n,a)}const fe=(0,T.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return ne(t,r,i,ce,le)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const o=me(0,r,i),n=(0,T.vt)();return(0,M.j)(n,o.direction,-t),(0,M.i)(n,n,e),{up:o.up,eye:n,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:me,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,o=i.getAltitude(t),n=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,I.LV)(t.origin,t.direction),o,fe)||pe(fe,r,i,t.endpoint,o),ae(fe,a,fe,l),s.push((0,D.fA)(fe[0],fe[1]))}return function(e,t,r){const i=e.map(e=>((0,M.h)(fe,e[0],e[1],0),t.fromRenderCoords(fe,fe,r),[fe[0],fe[1]]));return i.length<=2?new Y.A({spatialReference:r}):(i.push(i[0].slice()),(0,X.$3)(i)||i.reverse(),new Y.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return K(r,e,t,0),K(i,r,t,1),K(r,i,t,2),K(i,r,t,3),i}(s,i.extent),i,n)},toExtent:function(e,t,r,i,o){const n=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,S.g)(t,ue,n),(0,S.g)(t,he,n),ue[0]-=r/2,he[0]+=r/2,ue[1]-=i/2,he[1]+=i/2,(0,E.F)(ue,n,ue,a),(0,E.F)(he,n,he,a),o?(o.xmin=ue[0],o.ymin=ue[1],o.xmax=he[0],o.ymax=he[1],o.spatialReference=a):o=new q.A(ue[0],ue[1],he[0],he[1],a),o}},Symbol.toStringTag,{value:"Module"}));var ve=r(34304),ge=r(17136),_e=r(94008),xe=r(28735);class we{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,z.vt)(),this._points=(0,z.Qy)(),this.lines=new Array(12),this._origin=(0,T.vt)(),this._direction=(0,T.vt)(),this._boundingSphere=new _e.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,T.vt)(),endpoint:null}}update(e){(0,z.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,M.d)(this._origin,e.eye),(0,M.d)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,M.d)(this._points[t],e[t]);(0,z.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,z.m7)(this.frustum,e)}intersectsRay(e){return(0,z.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,z.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,z.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;be(this.lines[t],e[t],e[r]),be(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),be(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){const{origin:e}=this,t=Me;(0,M.n)(t,this.direction);const r=ye;(0,M.a)(r,this.points[4],e);const i=.5*(0,M.g)(r,r)/(0,M.g)(t,r),o=this._boundingSphere,n=(0,M.c)(Te,e,t,i);o.center=n,o.radius=i}static{this.planePointIndices=z.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function be(e,t,r){e.origin=t,e.endpoint=r,(0,M.C)(e.direction,t,r)}const ye=(0,T.vt)(),Me=(0,T.vt)(),Te=(0,T.vt)();r(86211);const Ce=(0,T.fA)(5802e-9,13558e-9,331e-7),Se=(0,T.fA)(65e-8*3,5643e-9,255e-9);(0,T.fA)(Ce[0]+Se[0],Ce[1]+Se[1],Ce[2]+Se[2]);class Ee{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Ee(0,0)}static{this.Infinite=new Ee}}(0,T.vt)(),(0,T.vt)(),new _e.iy,(0,I.vt)();var Ae=r(32728);const Ie=(0,T.fA)(0,0,1),Re=(0,M.n)((0,T.vt)(),(0,T.fA)(1,1,1)),Oe=(0,y.vt)(),Fe=(0,T.vt)(),Pe=(0,T.vt)();function De(e,t,r,i=oe()){(0,M.f)(Fe,e,Ie),0===(0,M.g)(Fe,Fe)&&(0,M.f)(Fe,e,Re),(0,P.$0)(Oe,-(0,a.kU)(t),e),(0,P.e$)(Oe,Oe,-(0,a.kU)(r),Fe);const{up:o,direction:n}=i;return(0,M.f)(o,Fe,e),(0,M.n)(o,o),(0,M.p)(o,o,Oe),(0,M.n)(n,e),(0,M.q)(n,n),(0,M.p)(n,n,Oe),i}function He(e){const t=e[1];e[1]=-e[2],e[2]=t}function Ne(e,t){const r=De(t,e.heading,e.tilt);return e.up=r.up,e}function ze(e,t){const r=[],i=[],o=(0,ve.FD)();for(let n=0;n<e.length;n++){const a=e[n],s=n===e.length-1?e[0]:e[n+1],l=(0,ee.Cr)(a,s,ke),c=(0,te.vE)(t,l.origin,l.vector,0,je);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,n,s]=0===c?[1,r,i]:[-1,i,r],l=(0,te.Qj)(t),d=(0,M.c)((0,T.vt)(),je,l,e*o),u=(0,M.c)((0,T.vt)(),je,l,e*-o);n.push(a),n.push(d),s.push(u)}}}const n=[];return r.length&&n.push(r),i.length&&n.push(i),n}const Le={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},Be=(0,T.fA)(1,0,0),Ve=(0,T.fA)(0,1,0),Ue=(0,T.vt)(),Ge=(0,T.vt)(),je=(0,T.vt)(),We=new _e.iy,ke=(0,ee.vt)(),$e=(0,N.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const o=Fe,n=Pe;return(0,M.n)(o,e),(0,M.f)(Pe,o,Ie),0===(0,M.g)(Pe,Pe)&&(0,M.f)(Pe,o,Re),(0,M.f)(n,Pe,o),ne(t,r,i,o,n)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const o={eye:(0,T.vt)(),up:null,tilt:i,heading:r},n=Fe;n[0]=e[0],n[1]=e[2],n[2]=-e[1];const s=t,l=(0,a.kU)(r),c=(0,a.kU)(i),d=Math.sin(l),u=Math.cos(l),h=Math.sin(c),m=Math.cos(c),p=(0,M.b)(n);let f;if(Math.abs(c)<1e-8)f=s+p;else{const e=p/h,t=(0,a.YN)(s/e),r=Math.PI-c-t;f=e*Math.sin(r)}const v=m*s,g=s*s*(h*h),_=u*u*g,x=f-v,w=x*x,b=_*(_+w-n[1]*n[1]);if(b<0)return(0,M.j)(o.eye,n,f/p),o.tilt=0,Ne(o,e);const y=Math.sqrt(b),C=n[1]*x,S=_+w;let E;if(E=u>0?-y+C:y+C,Math.abs(S)<1e-8)return p<1e-8?(o.eye[0]=0,o.eye[1]=0,o.eye[2]=s):(0,M.j)(o.eye,n,f/p),o.tilt=0,He(o.eye),Ne(o,e);o.eye[1]=E/S;const A=d*d*g,I=h*s,R=u*I*o.eye[1],O=o.eye[1]*o.eye[1],F=1-O,P=Math.sqrt(F),D=_*O+A-2*R*P*x+F*w;return Math.abs(D)<1e-8?((0,M.j)(o.eye,n,f/p),o.tilt=0,He(o.eye),Ne(o,e)):(o.eye[0]=(F*(f*n[0]-v*n[0])-I*P*(n[0]*o.eye[1]*u+n[2]*d))/D,o.eye[2]=(F*(f*n[2]-v*n[2])-I*P*(n[2]*o.eye[1]*u-n[0]*d))/D,(0,M.j)(o.eye,o.eye,f),He(o.eye),Ne(o,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),o=(0,M.b)(t);return(0,a.YN)(r/(o/Math.sin(i)))+i},headingTiltToDirectionUp:De,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,M.b)(t),o=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),n=(0,a.YN)(r/(o/Math.sin(e)));return(0,a.KJ)(e-n)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),o=new we(r);i.near=2,o.update(i);const n=r.getAltitude(t),s=e.spatialReference,l=r.referenceEllipsoid.radius,c=i.eye,d=1+(0,M.B)(c,t)/(l+n),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:m,minSamples:p,maxSamples:f}=Le,v=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return We.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(We,t)}(e),g=(0,a.qE)((u-h)/(m-h),0,1),_=Math.round((0,a.Cc)(p,f,g)),x=i.aboveGround,w=o.planes[5],b=[],y=(0,te.O_)(T.uY,Be,(0,te.vt)()),C=(0,te.O_)(T.uY,Ve,(0,te.vt)());(0,H.c)($e,0,0,0,0);const S=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-v:0,i=1===e&&x||3===e&&!x?v:1,s=o.lines[e],l=o.lines[3===e?0:e+1];for(let o=0;o<_;o++){const d=o/_,u=0===o?0:(0,a.Cc)(t,i,1===e?1-(1-d)**2:3===e?d**2:d),h=(0,M.l)(Ge,s.origin,l.origin,u),m=(0,Ae.nu)(s.direction,l.direction,u,Ue);r.intersectManifoldClosestSilhouette((0,I.LV)(h,m),n,je),ae(je,c,je,w),b.push((0,T.o8)(je)),0!==b.length&&S((0,M.G)(b.at(-1),je));const p=((0,te.Tj)(y,je)?1:0)|((0,te.Tj)(C,je)?2:0);$e[p]=1}}b.length>2&&(0,M.G)(b[0],b.at(-1));const E=function(e,t,r){const i=2*(0,ve.FD)();return e.map(e=>{const o=[];let n=!1;for(const a of e)t.fromRenderCoords(a,je,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(o.push([null,je[1]]),o.push([null,je[1]]),n=!0):o.push([je[0],je[1]]);if(n)for(let e=0;e<o.length;e++){const t=o[e];if(null!=t[0])continue;const r=o[e+1],i=o.at(0===e?-1:e-1);t[0]=i[0],e++;const n=o.at(e===o.length-1?0:e+1);r[0]=n[0]}return o.push(o[0]),(0,X.$3)(o)||o.reverse(),o})}((0,H.d)($e)>1?function(e,t){const r=[];for(const i of e)r.push(...ze(i,t));return r}(ze(b,y),C):[b],r,s);return new Y.A({rings:E,spatialReference:s})},toExtent:function(e,t,r,i,o){let n,s,l,c;const d=t.latitude,u=(0,A.tO)(e.spatialReference).radius,h=t.longitude,m=function(e,t,r){const i=t/r,o=(0,a.kU)(e),n=Math.sin(i/2),s=Math.cos(o),l=2*(0,a.YN)(Math.sqrt(n*n/(s*s)));return(0,a.KJ)(l)}(d,r,u)/2;n=h-m,s=h+m;const p=(0,a.kU)(d),v=(1+Math.sin(p))/(1-Math.sin(p)),g=(v+1)*Math.tan(i/u/2),_=g*g;function x(e){const t=Math.PI/2;return(e=f.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(l=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*v+_))),c=l+i/u,l=x(l),c=x(c),c<l){const e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=ge.Y_.monotonic(n,s),s-n>180){const e=(s-n-180)/2;n+=e,s-=e}const w=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:C.A.WGS84;return o?(o.xmin=n,o.ymin=l,o.xmax=s,o.ymax=c,o.spatialReference=w):o=new q.A(n,l,s,c,w),e.spatialReference&&e.spatialReference.isWebMercator&&(0,xe.Gh)(o,!1,o),o}},Symbol.toStringTag,{value:"Module"}));const Ze="ssao";(0,T.vt)();var qe=r(49186),Ye=r(10107),Xe=r(64108);let Ke=class extends R.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new qe.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,n.Cg)([(0,Ye.MZ)({constructOnly:!0})],Ke.prototype,"view",void 0),(0,n.Cg)([(0,Ye.MZ)({constructOnly:!0})],Ke.prototype,"consumes",void 0),(0,n.Cg)([(0,Ye.MZ)()],Ke.prototype,"produces",void 0),(0,n.Cg)([(0,Ye.MZ)({readOnly:!0})],Ke.prototype,"techniques",null),Ke=(0,n.Cg)([(0,Xe.$)("esri.views.3d.webgl.RenderNode")],Ke);var Je=r(13840),Qe=r(42958),et=r(95774),tt=r(90644);let rt=class extends Qe.w{constructor(){super(...arguments),this.shader=new Je.r(et.S,()=>r.e(9384).then(r.bind(r,59384)))}initializePipeline(){return(0,tt.Ey)({colorWrite:tt.kn})}};rt=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],rt);var it=r(65786);class ot extends it.Y{constructor(){super(...arguments),this.projScale=1}}class nt extends ot{constructor(){super(...arguments),this.intensity=1}}class at extends it.Y{}class st extends at{constructor(){super(...arguments),this.blurSize=(0,D.vt)()}}var lt=r(15581);let ct=class extends Qe.w{constructor(){super(...arguments),this.shader=new Je.r(lt.S,()=>r.e(191).then(r.bind(r,90191)))}initializePipeline(){return(0,tt.Ey)({colorWrite:tt.kn})}};ct=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],ct);var dt=r(63907),ut=r(76284),ht=r(67171);const mt=2;let pt=class extends Ke{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=Ze,this.isEnabled=()=>!1,this._enableTime=(0,c.l5)(0),this._passParameters=new nt,this._drawParameters=new st}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new ht.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new ut.A(this.renderingContext,t,e),this.techniques.precompile(ct),this.techniques.precompile(rt),this.addHandles((0,l.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(dt.nI);if(!r||!i)return;const o=this.techniques.get(ct),n=this.techniques.get(rt);if(!o.compiled||!n.compiled)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,d=this.bindParameters,h=d.camera,m=h.relativeElevation,p=(0,a.qE)((5e5-m)/2e5,0,1),f=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,v=f*p;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/h.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*ft/(0,lt.g)(h)**6*v;const g=h.fullViewport[2],_=h.fullViewport[3],x=this.fboCache.acquire(g,_,"ssao input",2);s.bindFramebuffer(x.fbo),s.setViewport(0,0,g,_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.screen.draw();const w=Math.round(g/mt),b=Math.round(_/mt),y=this.fboCache.acquire(w,b,"ssao blur",0);s.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,0,mt/_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),x.release();const M=this.fboCache.acquire(w,b,Ze,0);return s.bindFramebuffer(M.fbo),s.setViewport(0,0,g,_),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=y.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,mt/g,0),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),s.setViewport4fv(h.fullViewport),y.release(),f<1&&this.requestRender(2),M}};(0,n.Cg)([(0,d.MZ)()],pt.prototype,"consumes",void 0),(0,n.Cg)([(0,d.MZ)()],pt.prototype,"produces",void 0),(0,n.Cg)([(0,d.MZ)({constructOnly:!0})],pt.prototype,"isEnabled",void 0),pt=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],pt);const ft=.5;function vt(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new o.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/mt),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
|
|
11
|
+
}`))}},11725:(e,t,r)=>{r.d(t,{i:()=>l});var i=r(24326),n=r(49255),o=r(99550),a=r(43616),s=r(65786);class l{constructor(e,t){this.id=(0,i.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,a.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,a.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get hasEmissions(){return!1}getConfiguration(e,t,r=new o.E){return r.output=e,r.hasEmission=t.hasEmission&&(0,n._o)(e),r.hasHighlightMixTexture=8===e&&null!=t.highlightMixTexture,r}}s.Y},11868:(e,t,r)=>{r.d(t,{Wz:()=>o,oe:()=>n});var i=r(34275);function n(e,t=!1){return e<=i.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function o(e){return(Array.isArray(e)?e.length:e.byteLength/8)<=i.y9?Array.from(e):new Float32Array(e)}},12791:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},13840:(e,t,r)=>{r.d(t,{r:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},14113:(e,t,r)=>{r.d(t,{N5:()=>s});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new m,this.outputs=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),a=n.code.generateSource(),s=n.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?g:v,d=n.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${d.join("\n")}\n${o.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${u.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,t,n)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let a=0;a<i;++a)r[a](e,o,t,n)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else o().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new c(this),this.code=new d(this),this.constants=new f(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):o().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class f{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=f._numberToFloatStr(r);break;case"int":i=f._numberToIntStr(r);break;case"uint":i=f._numberToUintStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])}, ${f._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])}, ${f._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])}, ${f._numberToUintStr(r[2])}, ${f._numberToUintStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>f._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const v="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",g="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,n)=>i.setUniform4fv(e,t(n),r))}}},14527:(e,t,r)=>{r.d(t,{n:()=>vt});var i=r(31821),n=r(12791),o=r(31635),a=r(34727),s=r(97768),l=r(36708),c=r(78659),d=r(91429),u=r(37585),h=r(69540);let m=class extends h.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"rows",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"columns",void 0),m=(0,o.Cg)([(0,d.$K)("esri.CameraLayout")],m);const p=m;var f=r(69052),v=r(25482),g=r(56507),_=r(86738),x=r(43937),w=r(36005);let b=class extends((0,h.OU)(v.o)){constructor(...e){super(...e),this.position=new _.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new p}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,g.GB)(e.x||0),n.y=(0,g.GB)(e.y||0),n.z=e.hasZ?(0,g.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new _.A;return r.read(e,t),r.x=(0,g.GB)(r.x||0),r.y=(0,g.GB)(r.y||0),r.z=r.hasZ?(0,g.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,o.Cg)([(0,d.MZ)({type:_.A,json:{write:{isRequired:!0}}})],b.prototype,"position",void 0),(0,o.Cg)([(0,x.K)("position")],b.prototype,"writePosition",null),(0,o.Cg)([(0,w.w)("position")],b.prototype,"readPosition",null),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>f.ie.normalize((0,g.GB)(e)))],b.prototype,"heading",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e),-180,180))],b.prototype,"tilt",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e,55),1,170))],b.prototype,"fov",void 0),(0,o.Cg)([(0,d.MZ)({type:p,nonNullable:!0,json:{read:!1,write:!1}})],b.prototype,"layout",void 0),b=(0,o.Cg)([(0,d.$K)("esri.Camera")],b);var y=r(9093),M=r(38954),T=r(51850),C=r(16930),S=(r(48353),r(9762),r(65806)),E=r(27993),A=r(73941),I=(r(19419),r(71351)),R=r(69622),O=r(53966),F=r(90629),P=r(58083),D=r(48163),H=r(87317),N=r(91829),z=r(82919),L=r(44280);const B=(0,T.vt)(),V=(0,T.vt)();var U;let G=U=class extends R.A{constructor(e){super(e),this._ray=(0,I.vt)(),this._viewport=(0,N.fA)(0,0,1,1),this._padding=(0,N.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,D.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,y.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,y.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,y.vt)(),this._frustumDirty=!0,this._frustum=(0,z.vt)(),this._fullViewport=(0,N.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,T.vt)(),this._up=(0,T.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,M.e)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,P.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,H.s)((0,N.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,H.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,H.s)((0,N.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,H.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,H.a)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,H.f)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,P.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,P.B8)((0,y.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,y.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,M.B)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,P.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,P.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,a=-i/2+this.column*o,s=a+o,l=-r/2+this.row*n,c=l+n,d=(0,P.$h)((0,y.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,P.aI)(u,d)?u:d}copyFrom(e){(0,M.d)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,H.f)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,H.f)(this._padding,e.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,P.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,z.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,P.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,H.f)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new U).copyFrom(this)}equals(e){return(0,M.m)(this.eye,e.eye)&&(0,M.m)(this.center,e.center)&&(0,M.m)(this.up,e.up)&&(0,H.a)(this._viewport,e.viewport)&&(0,H.a)(this._padding,e.padding)&&(0,u.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,H.g)(e.screenPadding,this.screenPadding)>=t||(0,H.g)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,M.a)(k,e.eye,e.center),(0,M.a)($,this.eye,this.center);const r=(0,M.g)(k,$),i=(0,M.H)(k),n=(0,M.H)($),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,M.G)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,L.gr)(this.viewForward,(0,M.e)(k,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,F.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==j&&(0,M.d)(j,e),j[3]=1,(0,H.t)(j,j,this.projectionMatrix);const r=Math.abs(j[3]);(0,M.j)(j,j,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*j[1]),t[2]=.5*(j[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;j[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],j[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],j[2]=(2*e[2]-1)*e[3],j[3]=e[3],null!=this.inverseProjectionMatrix&&((0,H.t)(j,j,this.inverseProjectionMatrix),t[0]=j[0],t[1]=j[1],t[2]=j[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,Z),this.renderToScreen(Z,t),t}projectToRenderScreen(e,t){if(j[0]=e[0],j[1]=e[1],j[2]=e[2],j[3]=1,(0,H.t)(j,j,this.viewProjectionMatrix),0===j[3])return null;const r=j;(0,M.j)(r,r,1/Math.abs(j[3]));const i=this.fullViewport,n=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Z),t)}unprojectFromRenderScreen(e,t){if((0,P.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,P.B8)(W,W))return null;const r=this.fullViewport;return j[0]=2*(e[0]-r[0])/r[2]-1,j[1]=2*(e[1]-r[1])/r[3]-1,j[2]=2*e[2]-1,j[3]=1,(0,H.t)(j,j,W),0===j[3]?null:(t[0]=j[0]/j[3],t[1]=j[1]/j[3],t[2]=j[2]/j[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,a=Math.max(n-r/2,0),s=Math.max(this.fullHeight-o-i/2,0),l=-Math.min(n-r/2,0),c=-Math.min(this.fullHeight-o-i/2,0),d=r-l- -Math.min(this.fullWidth-n-r/2,0),u=i-c- -Math.min(o-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:n,fovY:o}=this,s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,B),(0,M.e)(V,r,t);const i=(0,M.b)(V);return 0===i?0:(0,a.XM)((0,M.g)(V,B)/i)}(t,r,i));return e.frustumCoverage(s,n,o)}_computeUpGlobal(){(0,M.e)(k,this.center,this.eye);const e=(0,M.b)(this.center);e<1?(0,M.m)(this._up,T.Cb)&&((0,M.d)(this._up,T.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,M.g)(k,this.center))>.9999*(0,M.b)(k)*e||((0,M.f)($,k,this.center),(0,M.f)($,$,k),(0,M.n)($,$),(0,M.m)(this._up,$)||((0,M.d)(this._up,$),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,M.C)(k,this.eye,this.center),Math.abs(k[2])<=.9999&&((0,M.j)(k,k,k[2]),(0,M.h)(k,-k[0],-k[1],1-k[2]),(0,M.n)(k,k),(0,M.m)(this._up,k)||((0,M.d)(this._up,k),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,M.m)(e,t)||((0,M.d)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):O.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,z.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,P.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,o.Cg)([(0,d.MZ)()],G.prototype,"_viewport",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_padding",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_fov",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_nearFar",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_viewDirty",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_viewMatrix",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_pixelRatio",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"pixelRatio",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_rows",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"rows",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_columns",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"columns",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"eye",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"center",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_center",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"up",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_up",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"viewMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"viewForward",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"viewUp",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"viewRight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"nearFar",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"near",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"far",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"viewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"screenViewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"screenPadding",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"x",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"y",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"width",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"height",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"fullWidth",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"fullHeight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"_aspect",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"padding",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"projectionMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"inverseProjectionMatrix",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"fov",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"fovX",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"fovY",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"viewInverseTransposeMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"_projectionMatrixInternal",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"relativeElevation",void 0),G=U=(0,o.Cg)([(0,d.$K)("esri.views.3d.webgl.RenderCamera")],G);const j=(0,N.vt)(),W=(0,y.vt)(),k=(0,T.vt)(),$=(0,T.vt)(),Z=(0,F.r_)();r(49718),r(6867),r(16396),(0,T.vt)(),(0,T.vt)(),(0,T.vt)();var q=r(5443),Y=r(39829),X=r(95108);function K(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===n?0:1;if(t[r]>i&&a[r]>i)return 1===n?1:0;const s=(a[o]-t[o])/(a[r]-t[r]),l=t[o]+s*(i-t[r]);return e[r]=i,e[o]=l,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(Q,t[0],t[0])&&J(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(Q,t[r],i)){case 1:J(e,i);break;case 3:J(e,(0,D.o8)(Q));break;case 2:J(e,(0,D.o8)(Q)),J(e,i)}}}}function J(e,t){0!==e.length&&(0,u.aI)(e.at(-1),t)||e.push(t)}const Q=(0,D.vt)();var ee=r(11964),te=r(27921);const re=(0,T.vt)(),ie=(0,T.vt)();function ne(){return{direction:(0,T.vt)(),up:(0,T.vt)()}}function oe(e,t,r,i,n){let o=(0,M.n)(re,e),s=(0,M.g)(o,i);const l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,M.g)(t,i)),s<.99?((0,M.d)(o,t),l&&(0,M.j)(o,o,-1)):o=null);let c=0;if(o){(0,M.j)(ie,i,(0,M.g)(i,o)),(0,M.e)(o,o,ie);const e=(0,M.g)(o,n)/((0,M.b)(o)*(0,M.b)(n));(0,M.f)(ie,o,n),c=((0,M.g)(ie,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,M.g)(i,e)/(0,M.b)(e)));return r?(r.heading=c,r.tilt=d,r):{heading:c,tilt:d}}function ae(e,t,r,i){(0,M.e)(se,r,t),(0,te.T7)(i,(0,ee.LV)(t,se),e)||e===r||(0,M.d)(e,r)}const se=(0,T.vt)(),le=(0,T.fA)(0,1,0),ce=(0,T.fA)(0,0,1),de=(0,y.vt)(),ue=(0,T.vt)(),he=(0,T.vt)();function me(e,t,r,i=ne()){const{direction:n,up:o}=i;return(0,P.N9)(de,-(0,a.kU)(t)),(0,P.eL)(de,de,(0,a.kU)(r)),(0,M.p)(n,ce,de),(0,M.j)(n,n,-1),(0,M.p)(o,le,de),i}function pe(e,t,r,i,n){const o=t.lines[11].direction,a=(n-r.getAltitude(i))/o[2];(0,M.c)(e,i,o,a)}const fe=(0,T.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return oe(t,r,i,ce,le)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=me(0,r,i),o=(0,T.vt)();return(0,M.j)(o,n.direction,-t),(0,M.i)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:me,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,I.LV)(t.origin,t.direction),n,fe)||pe(fe,r,i,t.endpoint,n),ae(fe,a,fe,l),s.push((0,D.fA)(fe[0],fe[1]))}return function(e,t,r){const i=e.map(e=>((0,M.h)(fe,e[0],e[1],0),t.fromRenderCoords(fe,fe,r),[fe[0],fe[1]]));return i.length<=2?new Y.A({spatialReference:r}):(i.push(i[0].slice()),(0,X.$3)(i)||i.reverse(),new Y.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return K(r,e,t,0),K(i,r,t,1),K(r,i,t,2),K(i,r,t,3),i}(s,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,S.g)(t,ue,o),(0,S.g)(t,he,o),ue[0]-=r/2,he[0]+=r/2,ue[1]-=i/2,he[1]+=i/2,(0,E.F)(ue,o,ue,a),(0,E.F)(he,o,he,a),n?(n.xmin=ue[0],n.ymin=ue[1],n.xmax=he[0],n.ymax=he[1],n.spatialReference=a):n=new q.A(ue[0],ue[1],he[0],he[1],a),n}},Symbol.toStringTag,{value:"Module"}));var ve=r(34304),ge=r(17136),_e=r(94008),xe=r(28735);class we{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,z.vt)(),this._points=(0,z.Qy)(),this.lines=new Array(12),this._origin=(0,T.vt)(),this._direction=(0,T.vt)(),this._boundingSphere=new _e.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,T.vt)(),endpoint:null}}update(e){(0,z.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,M.d)(this._origin,e.eye),(0,M.d)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,M.d)(this._points[t],e[t]);(0,z.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,z.m7)(this.frustum,e)}intersectsRay(e){return(0,z.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,z.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,z.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;be(this.lines[t],e[t],e[r]),be(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),be(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){const{origin:e}=this,t=Me;(0,M.n)(t,this.direction);const r=ye;(0,M.a)(r,this.points[4],e);const i=.5*(0,M.g)(r,r)/(0,M.g)(t,r),n=this._boundingSphere,o=(0,M.c)(Te,e,t,i);n.center=o,n.radius=i}static{this.planePointIndices=z.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function be(e,t,r){e.origin=t,e.endpoint=r,(0,M.C)(e.direction,t,r)}const ye=(0,T.vt)(),Me=(0,T.vt)(),Te=(0,T.vt)();r(86211);const Ce=(0,T.fA)(5802e-9,13558e-9,331e-7),Se=(0,T.fA)(65e-8*3,5643e-9,255e-9);(0,T.fA)(Ce[0]+Se[0],Ce[1]+Se[1],Ce[2]+Se[2]);class Ee{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Ee(0,0)}static{this.Infinite=new Ee}}(0,T.vt)(),(0,T.vt)(),new _e.iy,(0,I.vt)();var Ae=r(32728);const Ie=(0,T.fA)(0,0,1),Re=(0,M.n)((0,T.vt)(),(0,T.fA)(1,1,1)),Oe=(0,y.vt)(),Fe=(0,T.vt)(),Pe=(0,T.vt)();function De(e,t,r,i=ne()){(0,M.f)(Fe,e,Ie),0===(0,M.g)(Fe,Fe)&&(0,M.f)(Fe,e,Re),(0,P.$0)(Oe,-(0,a.kU)(t),e),(0,P.e$)(Oe,Oe,-(0,a.kU)(r),Fe);const{up:n,direction:o}=i;return(0,M.f)(n,Fe,e),(0,M.n)(n,n),(0,M.p)(n,n,Oe),(0,M.n)(o,e),(0,M.q)(o,o),(0,M.p)(o,o,Oe),i}function He(e){const t=e[1];e[1]=-e[2],e[2]=t}function Ne(e,t){const r=De(t,e.heading,e.tilt);return e.up=r.up,e}function ze(e,t){const r=[],i=[],n=(0,ve.FD)();for(let o=0;o<e.length;o++){const a=e[o],s=o===e.length-1?e[0]:e[o+1],l=(0,ee.Cr)(a,s,ke),c=(0,te.vE)(t,l.origin,l.vector,0,je);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,o,s]=0===c?[1,r,i]:[-1,i,r],l=(0,te.Qj)(t),d=(0,M.c)((0,T.vt)(),je,l,e*n),u=(0,M.c)((0,T.vt)(),je,l,e*-n);o.push(a),o.push(d),s.push(u)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Le={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},Be=(0,T.fA)(1,0,0),Ve=(0,T.fA)(0,1,0),Ue=(0,T.vt)(),Ge=(0,T.vt)(),je=(0,T.vt)(),We=new _e.iy,ke=(0,ee.vt)(),$e=(0,N.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=Fe,o=Pe;return(0,M.n)(n,e),(0,M.f)(Pe,n,Ie),0===(0,M.g)(Pe,Pe)&&(0,M.f)(Pe,n,Re),(0,M.f)(o,Pe,n),oe(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,T.vt)(),up:null,tilt:i,heading:r},o=Fe;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const s=t,l=(0,a.kU)(r),c=(0,a.kU)(i),d=Math.sin(l),u=Math.cos(l),h=Math.sin(c),m=Math.cos(c),p=(0,M.b)(o);let f;if(Math.abs(c)<1e-8)f=s+p;else{const e=p/h,t=(0,a.YN)(s/e),r=Math.PI-c-t;f=e*Math.sin(r)}const v=m*s,g=s*s*(h*h),_=u*u*g,x=f-v,w=x*x,b=_*(_+w-o[1]*o[1]);if(b<0)return(0,M.j)(n.eye,o,f/p),n.tilt=0,Ne(n,e);const y=Math.sqrt(b),C=o[1]*x,S=_+w;let E;if(E=u>0?-y+C:y+C,Math.abs(S)<1e-8)return p<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=s):(0,M.j)(n.eye,o,f/p),n.tilt=0,He(n.eye),Ne(n,e);n.eye[1]=E/S;const A=d*d*g,I=h*s,R=u*I*n.eye[1],O=n.eye[1]*n.eye[1],F=1-O,P=Math.sqrt(F),D=_*O+A-2*R*P*x+F*w;return Math.abs(D)<1e-8?((0,M.j)(n.eye,o,f/p),n.tilt=0,He(n.eye),Ne(n,e)):(n.eye[0]=(F*(f*o[0]-v*o[0])-I*P*(o[0]*n.eye[1]*u+o[2]*d))/D,n.eye[2]=(F*(f*o[2]-v*o[2])-I*P*(o[2]*n.eye[1]*u-o[0]*d))/D,(0,M.j)(n.eye,n.eye,f),He(n.eye),Ne(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),n=(0,M.b)(t);return(0,a.YN)(r/(n/Math.sin(i)))+i},headingTiltToDirectionUp:De,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,M.b)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,a.YN)(r/(n/Math.sin(e)));return(0,a.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new we(r);i.near=2,n.update(i);const o=r.getAltitude(t),s=e.spatialReference,l=r.referenceEllipsoid.radius,c=i.eye,d=1+(0,M.B)(c,t)/(l+o),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:m,minSamples:p,maxSamples:f}=Le,v=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return We.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(We,t)}(e),g=(0,a.qE)((u-h)/(m-h),0,1),_=Math.round((0,a.Cc)(p,f,g)),x=i.aboveGround,w=n.planes[5],b=[],y=(0,te.O_)(T.uY,Be,(0,te.vt)()),C=(0,te.O_)(T.uY,Ve,(0,te.vt)());(0,H.c)($e,0,0,0,0);const S=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-v:0,i=1===e&&x||3===e&&!x?v:1,s=n.lines[e],l=n.lines[3===e?0:e+1];for(let n=0;n<_;n++){const d=n/_,u=0===n?0:(0,a.Cc)(t,i,1===e?1-(1-d)**2:3===e?d**2:d),h=(0,M.l)(Ge,s.origin,l.origin,u),m=(0,Ae.nu)(s.direction,l.direction,u,Ue);r.intersectManifoldClosestSilhouette((0,I.LV)(h,m),o,je),ae(je,c,je,w),b.push((0,T.o8)(je)),0!==b.length&&S((0,M.G)(b.at(-1),je));const p=((0,te.Tj)(y,je)?1:0)|((0,te.Tj)(C,je)?2:0);$e[p]=1}}b.length>2&&(0,M.G)(b[0],b.at(-1));const E=function(e,t,r){const i=2*(0,ve.FD)();return e.map(e=>{const n=[];let o=!1;for(const a of e)t.fromRenderCoords(a,je,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(n.push([null,je[1]]),n.push([null,je[1]]),o=!0):n.push([je[0],je[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,X.$3)(n)||n.reverse(),n})}((0,H.d)($e)>1?function(e,t){const r=[];for(const i of e)r.push(...ze(i,t));return r}(ze(b,y),C):[b],r,s);return new Y.A({rings:E,spatialReference:s})},toExtent:function(e,t,r,i,n){let o,s,l,c;const d=t.latitude,u=(0,A.tO)(e.spatialReference).radius,h=t.longitude,m=function(e,t,r){const i=t/r,n=(0,a.kU)(e),o=Math.sin(i/2),s=Math.cos(n),l=2*(0,a.YN)(Math.sqrt(o*o/(s*s)));return(0,a.KJ)(l)}(d,r,u)/2;o=h-m,s=h+m;const p=(0,a.kU)(d),v=(1+Math.sin(p))/(1-Math.sin(p)),g=(v+1)*Math.tan(i/u/2),_=g*g;function x(e){const t=Math.PI/2;return(e=f.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(l=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*v+_))),c=l+i/u,l=x(l),c=x(c),c<l){const e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=ge.Y_.monotonic(o,s),s-o>180){const e=(s-o-180)/2;o+=e,s-=e}const w=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:C.A.WGS84;return n?(n.xmin=o,n.ymin=l,n.xmax=s,n.ymax=c,n.spatialReference=w):n=new q.A(o,l,s,c,w),e.spatialReference&&e.spatialReference.isWebMercator&&(0,xe.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Ze="ssao";(0,T.vt)();var qe=r(49186),Ye=r(10107),Xe=r(64108);let Ke=class extends R.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new qe.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,o.Cg)([(0,Ye.MZ)({constructOnly:!0})],Ke.prototype,"view",void 0),(0,o.Cg)([(0,Ye.MZ)({constructOnly:!0})],Ke.prototype,"consumes",void 0),(0,o.Cg)([(0,Ye.MZ)()],Ke.prototype,"produces",void 0),(0,o.Cg)([(0,Ye.MZ)({readOnly:!0})],Ke.prototype,"techniques",null),Ke=(0,o.Cg)([(0,Xe.$)("esri.views.3d.webgl.RenderNode")],Ke);var Je=r(13840),Qe=r(42958),et=r(95774),tt=r(90644);let rt=class extends Qe.w{constructor(){super(...arguments),this.shader=new Je.r(et.S,()=>r.e(9384).then(r.bind(r,59384)))}initializePipeline(){return(0,tt.Ey)({colorWrite:tt.kn})}};rt=(0,o.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],rt);var it=r(65786);class nt extends it.Y{constructor(){super(...arguments),this.projScale=1}}class ot extends nt{constructor(){super(...arguments),this.intensity=1}}class at extends it.Y{}class st extends at{constructor(){super(...arguments),this.blurSize=(0,D.vt)()}}var lt=r(15581);let ct=class extends Qe.w{constructor(){super(...arguments),this.shader=new Je.r(lt.S,()=>r.e(191).then(r.bind(r,90191)))}initializePipeline(){return(0,tt.Ey)({colorWrite:tt.kn})}};ct=(0,o.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],ct);var dt=r(63907),ut=r(76284),ht=r(67171);const mt=2;let pt=class extends Ke{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=Ze,this.isEnabled=()=>!1,this._enableTime=(0,c.l5)(0),this._passParameters=new ot,this._drawParameters=new st}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new ht.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new ut.A(this.renderingContext,t,e),this.techniques.precompile(ct),this.techniques.precompile(rt),this.addHandles((0,l.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(dt.nI);if(!r||!i)return;const n=this.techniques.get(ct),o=this.techniques.get(rt);if(!n.compiled||!o.compiled)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,d=this.bindParameters,h=d.camera,m=h.relativeElevation,p=(0,a.qE)((5e5-m)/2e5,0,1),f=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,v=f*p;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/h.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*ft/(0,lt.g)(h)**6*v;const g=h.fullViewport[2],_=h.fullViewport[3],x=this.fboCache.acquire(g,_,"ssao input",2);s.bindFramebuffer(x.fbo),s.setViewport(0,0,g,_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.screen.draw();const w=Math.round(g/mt),b=Math.round(_/mt),y=this.fboCache.acquire(w,b,"ssao blur",0);s.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,0,mt/_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),x.release();const M=this.fboCache.acquire(w,b,Ze,0);return s.bindFramebuffer(M.fbo),s.setViewport(0,0,g,_),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=y.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,mt/g,0),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),s.setViewport4fv(h.fullViewport),y.release(),f<1&&this.requestRender(2),M}};(0,o.Cg)([(0,d.MZ)()],pt.prototype,"consumes",void 0),(0,o.Cg)([(0,d.MZ)()],pt.prototype,"produces",void 0),(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],pt.prototype,"isEnabled",void 0),pt=(0,o.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],pt);const ft=.5;function vt(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/mt),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
|
|
12
12
|
vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
|
|
13
13
|
return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
|
|
14
14
|
}
|
|
15
15
|
float evaluateAmbientOcclusion() {
|
|
16
16
|
return 1.0 - evaluateAmbientOcclusionInverse();
|
|
17
17
|
}`)):e.code.add(i.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
|
|
18
|
-
float evaluateAmbientOcclusion() { return 0.0; }`)}},15581:(e,t,r)=>{r.d(t,{S:()=>x,b:()=>v,g:()=>g});var i=r(37585),
|
|
18
|
+
float evaluateAmbientOcclusion() { return 0.0; }`)}},15581:(e,t,r)=>{r.d(t,{S:()=>x,b:()=>v,g:()=>g});var i=r(37585),n=r(48163),o=r(82048),a=r(52540),s=r(34845),l=r(77108),c=r(47286),d=r(33094),u=r(20304),h=r(31821),m=r(63761),p=r(14113);const f=16;function v(){const e=new p.N5,t=e.fragment;return e.include(o.c),e.include(s.Ir),t.include(a.E),t.uniforms.add(new d.U("radius",e=>g(e.camera))).code.add(h.H`vec3 sphere[16] = vec3[16](
|
|
19
19
|
vec3(0.186937, 0.0, 0.0),
|
|
20
20
|
vec3(0.700542, 0.0, 0.0),
|
|
21
21
|
vec3(-0.864858, -0.481795, -0.111713),
|
|
@@ -97,7 +97,7 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
97
97
|
A = (pow(A, 0.2) + 1.2 * A * A * A * A) / 2.2;
|
|
98
98
|
|
|
99
99
|
fragOcclusion = A;
|
|
100
|
-
`),e}function g(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const _=(0,
|
|
100
|
+
`),e}function g(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const _=(0,n.vt)(),x=Object.freeze(Object.defineProperty({__proto__:null,build:v,getRadius:g},Symbol.toStringTag,{value:"Module"}))},15976:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",2,(r,i,n)=>r.bindTexture(e,t(i,n)))}}},16396:(e,t,r)=>{r.d(t,{ou:()=>l}),r(77690),r(29242),r(58083),r(9093);var i=r(38954),n=r(51850),o=r(94008),a=r(57005);const s=new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,n.vt)(),this._tmpSphere=new o.iy}applyToVertex(e,t,r){const n=this.objectTransform.transform,o=(0,i.h)(c,e,t,r),a=(0,i.p)(o,o,n),s=this.offset/(0,i.b)(a);(0,i.c)(a,a,a,s);const l=this.objectTransform.inverse;return(0,i.p)(this.tmpVertex,a,l),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,i.b)(e);(0,i.c)(e,e,e,r);const n=this.offset/(0,i.b)(t);(0,i.c)(t,t,t,n)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=e.center,r=(0,i.b)(t),n=this.offset/r;return(0,i.c)(this._tmpSphere.center,t,t,n),this._tmpSphere.radius=e.radius+e.radius*this.offset/r,this._tmpSphere}};function l(e){return null!=e?(s.offset=e,s):null}new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,n.vt)(),this._tmpMbs=new o.iy,this._tmpObb=new a.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,i.b)(e)}applyToVertex(e,t,r){const n=(0,i.h)(c,e,t,r),o=(0,i.h)(d,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,i.b)(o);return(0,i.c)(this._tmpVertex,n,o,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],n=e[2]+t,o=e[3],a=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),d=Math.abs(n),u=Math.abs(o),h=Math.abs(a),m=Math.abs(s),p=.5*(1+Math.sign(r*o))*Math.min(l,u),f=.5*(1+Math.sign(i*a))*Math.min(c,h),v=.5*(1+Math.sign(n*s))*Math.min(d,m),g=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,m),w=Math.sqrt(p*p+f*f+v*v),b=Math.sign(l+r),y=Math.sign(c+i),M=Math.sign(d+n),T=Math.sign(u+o),C=Math.sign(h+a),S=Math.sign(m+s),E=this._totalOffset;if(w<E)return e[0]-=(1-b)*E,e[1]-=(1-y)*E,e[2]-=(1-M)*E,e[3]+=T*E,e[4]+=C*E,e[5]+=S*E,e;const A=E/Math.sqrt(g*g+_*_+x*x),I=E/w,R=I-A,O=-R;return e[0]+=r*(b*O+I),e[1]+=i*(y*O+I),e[2]+=n*(M*O+I),e[3]+=o*(T*R+A),e[4]+=a*(C*R+A),e[5]+=s*(S*R+A),e}applyToMbs(e){const t=e.center,r=(0,i.b)(t),n=this._totalOffset/r;return(0,i.c)(this._tmpMbs.center,t,t,n),this._tmpMbs.radius=e.radius+e.radius*this._totalOffset/r,this._tmpMbs}applyToObb(e){return(0,a.gm)(e,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,n.vt)()}applyToVertex(e,t,r){const n=(0,i.h)(c,e,t,r),o=(0,i.i)(d,n,this.localOrigin),a=this.offset/(0,i.b)(o);return(0,i.c)(this.tmpVertex,n,o,a),this.tmpVertex}applyToAabb(e){const t=u,r=h,i=m;for(let n=0;n<3;++n)t[n]=e[0+n]+this.localOrigin[n],r[n]=e[3+n]+this.localOrigin[n],i[n]=t[n];const n=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=n[t],e[t+3]=n[t];const o=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let n=0;n<3;++n)i[n]=e&1<<n?r[n]:t[n];o(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0===(a&e)){for(let n=0;n<3;++n)i[n]=a&1<<n?0:e&1<<n?t[n]:r[n];o(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const c=(0,n.vt)(),d=(0,n.vt)(),u=(0,n.vt)(),h=(0,n.vt)(),m=(0,n.vt)()},16943:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(44208);function n(){return!!(0,i.A)("enable-feature:objectAndLayerId-rendering")}},20304:(e,t,r)=>{r.d(t,{m:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",1,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},20693:(e,t,r)=>{r.d(t,{yu:()=>m,Nz:()=>_,NB:()=>p,S7:()=>g});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(23205),l=r(40710),c=r(33094),d=r(58029),u=r(74333);class h extends u.n{constructor(e,t,r){super(e,"mat4",2,(i,n,o)=>i.setUniformMatrix4fv(e,t(n,o),r))}}function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.uY):e.uniforms.add(new l.W("cameraPosition",(e,t)=>(0,o.h)(v,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2])))}function p(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new d.F("proj",e=>e.camera.projectionMatrix),new h("view",(e,t)=>(0,i.Tl)(f,t.camera.viewMatrix,e.origin)),new l.W("localOrigin",e=>e.origin));const r=({camera:e})=>(0,o.h)(v,e.viewInverseTransposeMatrix[3],e.viewInverseTransposeMatrix[7],e.viewInverseTransposeMatrix[11]);e.uniforms.add(new d.F("proj",e=>e.camera.projectionMatrix),new d.F("view",e=>(0,i.Tl)(f,e.camera.viewMatrix,r(e))),new s.d("localOrigin",e=>r(e)))}const f=(0,n.vt)(),v=(0,a.vt)();function g(e){e.uniforms.add(new d.F("viewNormal",e=>e.camera.viewInverseTransposeMatrix))}function _(e){e.uniforms.add(new c.U("pixelRatio",e=>e.camera.pixelRatio/e.overlayStretch))}},22393:(e,t,r)=>{r.d(t,{c:()=>a});var i=r(31821);function n(e){e.code.add(i.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) {
|
|
101
101
|
return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
|
|
102
102
|
}`),e.code.add(i.H`float integratedRadiance(float cosTheta2, float roughness) {
|
|
103
103
|
return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
|
|
@@ -107,7 +107,7 @@ float intRadTheta = integratedRadiance(cosTheta2, roughness);
|
|
|
107
107
|
float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;
|
|
108
108
|
float sky = 2.0 - ground;
|
|
109
109
|
return (ground * ambientGround + sky * ambientSky) * 0.5;
|
|
110
|
-
}`)}var
|
|
110
|
+
}`)}var o=r(89786);function a(e,t){e.include(o.p),1!==t.pbrMode&&2!==t.pbrMode&&5!==t.pbrMode&&6!==t.pbrMode||(e.code.add(i.H`float normalDistribution(float NdotH, float roughness)
|
|
111
111
|
{
|
|
112
112
|
float a = NdotH * roughness;
|
|
113
113
|
float b = roughness / (1.0 - NdotH * NdotH + a * a);
|
|
@@ -119,7 +119,7 @@ vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {
|
|
|
119
119
|
vec4 r = roughness * c0 + c1;
|
|
120
120
|
float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;
|
|
121
121
|
return c2 * a004 + r.zw;
|
|
122
|
-
}`)),1!==t.pbrMode&&2!==t.pbrMode||(e.include(
|
|
122
|
+
}`)),1!==t.pbrMode&&2!==t.pbrMode||(e.include(n),e.code.add(i.H`struct PBRShadingInfo
|
|
123
123
|
{
|
|
124
124
|
float NdotV;
|
|
125
125
|
float LdotH;
|
|
@@ -147,30 +147,37 @@ vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV);
|
|
|
147
147
|
vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;
|
|
148
148
|
vec3 specularComponent = specularColor * indirectSpecular;
|
|
149
149
|
return (diffuseComponent + specularComponent);
|
|
150
|
-
}`))}},
|
|
150
|
+
}`))}},22911:(e,t,r)=>{r.d(t,{NL:()=>p});var i=r(49255),n=r(99208),o=r(65261),a=r(40710),s=r(33079),l=r(28421),c=r(20304),d=r(31821),u=r(15976),h=r(63761);r(25634);const m=1;function p(e,t){if(!(0,i._o)(t.output))return;e.fragment.include(o.C);const{emissionSource:r,hasEmissiveTextureTransform:p,bindType:f}=t,v=3===r||4===r||5===r;v&&(e.include(n.r,t),e.fragment.uniforms.add(1===f?new h.N("texEmission",e=>e.textureEmissive):new u.o("texEmission",e=>e.textureEmissive)));const g=2===r||v;g&&e.fragment.uniforms.add(1===f?new s.t("emissiveBaseColor",e=>e.emissiveBaseColor):new a.W("emissiveBaseColor",e=>e.emissiveBaseColor));const _=0!==r;_&&7!==r&&6!==r&&4!==r&&5!==r&&e.fragment.uniforms.add(1===f?new c.m("emissiveStrength",e=>e.emissiveStrength):new l.J("emissiveStrength",e=>e.emissiveStrength));const x=7===r,w=5===r,b=1===r||6===r||x;e.fragment.code.add(d.H`
|
|
151
|
+
vec4 getEmissions(vec3 symbolColor) {
|
|
152
|
+
vec4 emissions = ${g?w?"emissiveSource == 0 ? vec4(emissiveBaseColor, 1.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(emissiveBaseColor, 1.0)":b?x?"emissiveSource == 0 ? vec4(0.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(linearizeGamma(symbolColor), 1.0)":"vec4(0.0)"};
|
|
153
|
+
${(0,d.If)(v,`${(0,d.If)(w,`if(emissiveSource == 0) {\n vec4 emissiveFromTex = textureLookup(texEmission, ${p?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);\n }`,`vec4 emissiveFromTex = textureLookup(texEmission, ${p?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);`)}\n emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}
|
|
154
|
+
${(0,d.If)(_,`emissions.rgb *= emissiveStrength * ${d.H.float(m)};`)}
|
|
155
|
+
return emissions;
|
|
156
|
+
}
|
|
157
|
+
`)}},23205:(e,t,r)=>{r.d(t,{d:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",0,(i,n)=>i.setUniform3fv(e,t(n),r))}}},24321:(e,t,r)=>{r.d(t,{v:()=>o});var i=r(43519),n=r(31821);function o(e,t){t.instancedColor?(e.attributes.add("instanceColor","vec4"),e.vertex.include(i.WD),e.vertex.include(i.Y1),e.vertex.include(i.ML),e.vertex.code.add(n.H`
|
|
151
158
|
MaskedColor applyInstanceColor(MaskedColor color) {
|
|
152
159
|
return multiplyMaskedColors( color, createMaskedFromUInt8NaNColor(${"instanceColor"}));
|
|
153
160
|
}
|
|
154
|
-
`)):e.vertex.code.add(
|
|
161
|
+
`)):e.vertex.code.add(n.H`MaskedColor applyInstanceColor(MaskedColor color) {
|
|
155
162
|
return color;
|
|
156
|
-
}`)}},25634:(e,t,r)=>{r.d(t,{m8:()=>s,NV:()=>c});var i=r(97768),
|
|
163
|
+
}`)}},25634:(e,t,r)=>{r.d(t,{m8:()=>s,NV:()=>c});var i=r(97768),n=r(74887);class o{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return 2}}var a=r(65786);class s extends o{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),this._acquire(e.normalTextureId,e=>this._textureNormal=e),this._acquire(e.emissiveTextureId,e=>this._textureEmissive=e),this._acquire(e.occlusionTextureId,e=>this._textureOcclusion=e),this._acquire(e.metallicRoughnessTextureId,e=>this._textureMetallicRoughness=e)}dispose(){super.dispose(),this._texture=(0,i.Gz)(this._texture),this._textureNormal=(0,i.Gz)(this._textureNormal),this._textureEmissive=(0,i.Gz)(this._textureEmissive),this._textureOcclusion=(0,i.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new c(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,n.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,i.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class l extends a.Y{constructor(e=null){super(),this.textureEmissive=e}}class c extends l{constructor(e,t,r,i,n,o,a){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=n,this.scale=o,this.normalTextureTransformMatrix=a}}},26425:(e,t,r)=>{r.d(t,{u:()=>o});var i=r(33094),n=r(31821);function o({code:e,uniforms:t},r){t.add(new i.U("dpDummy",()=>1)),e.add(n.H`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
|
|
157
164
|
vec3 hiD = hiA + hiB;
|
|
158
165
|
vec3 loD = loA + loB;
|
|
159
166
|
return dpDummy * hiD + loD;
|
|
160
|
-
}`)}},26857:(e,t,r)=>{r.d(t,{b:()=>s});var i=r(31635),
|
|
167
|
+
}`)}},26857:(e,t,r)=>{r.d(t,{b:()=>s});var i=r(31635),n=r(69622),o=r(91429);let a=class extends n.A{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.OCCLUSION_QUERY_DEBUG_PIXEL=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,i.Cg)([(0,o.MZ)()],a.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LABELS_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TEXT_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"SHOW_POI",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OCCLUSION_QUERY_DEBUG_PIXEL",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LINE_WIREFRAMES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),a=(0,i.Cg)([(0,o.$K)("esri.views.3d.support.debugFlags")],a);const s=new a},27950:(e,t,r)=>{r.d(t,{N:()=>o});var i=r(63365),n=r(31821);function o(e){e.include(i.a),e.code.add(n.H`
|
|
161
168
|
vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
|
|
162
169
|
// workaround for artifacts in macOS using Intel Iris Pro
|
|
163
170
|
// see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
|
|
164
171
|
vec3 internalMixed = internalColor * textureColor;
|
|
165
172
|
vec3 allMixed = internalMixed * externalColor;
|
|
166
173
|
|
|
167
|
-
if (mode == ${
|
|
174
|
+
if (mode == ${n.H.int(1)}) {
|
|
168
175
|
return allMixed;
|
|
169
176
|
}
|
|
170
|
-
if (mode == ${
|
|
177
|
+
if (mode == ${n.H.int(2)}) {
|
|
171
178
|
return internalMixed;
|
|
172
179
|
}
|
|
173
|
-
if (mode == ${
|
|
180
|
+
if (mode == ${n.H.int(3)}) {
|
|
174
181
|
return externalColor;
|
|
175
182
|
}
|
|
176
183
|
|
|
@@ -187,17 +194,17 @@ return dpDummy * hiD + loD;
|
|
|
187
194
|
float internalMixed = internalOpacity * textureOpacity;
|
|
188
195
|
float allMixed = internalMixed * externalOpacity;
|
|
189
196
|
|
|
190
|
-
if (mode == ${
|
|
197
|
+
if (mode == ${n.H.int(2)}) {
|
|
191
198
|
return internalMixed;
|
|
192
199
|
}
|
|
193
|
-
if (mode == ${
|
|
200
|
+
if (mode == ${n.H.int(3)}) {
|
|
194
201
|
return externalOpacity;
|
|
195
202
|
}
|
|
196
203
|
|
|
197
204
|
// multiply or tint (or something invalid)
|
|
198
205
|
return allMixed;
|
|
199
206
|
}
|
|
200
|
-
`)}},27993:(e,t,r)=>{r.d(t,{F:()=>s});var i=r(91218),
|
|
207
|
+
`)}},27993:(e,t,r)=>{r.d(t,{F:()=>s});var i=r(91218),n=r(16930),o=r(9762),a=r(65806);function s(e,t,r,n){return!(null==t||null==n||e.length<2)&&((0,i.canProjectWithoutEngine)(t,n)?(0,o.projectBuffer)(e,t,0,r,n,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,a.g)(l,r,n)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:n.A.WGS84,type:"point"}},28421:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",2,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},28491:(e,t,r)=>{r.d(t,{D:()=>G,b:()=>U});var i=r(32680),n=r(49255),o=r(68317),a=r(76597),s=r(24321),l=r(72722),c=r(43519),d=r(96336),u=r(71955),h=r(53466),m=r(92700),p=r(72824),f=r(35640),v=r(40261),g=r(77695),_=r(14527),x=r(89390),w=r(98619),b=r(62602),y=r(22393),M=r(59469),T=r(32482),C=r(96598),S=r(51406),E=r(42398),A=r(58614),I=r(27950),R=r(20693),O=r(33079),F=r(71988),P=r(20304),D=r(31821),H=r(63761),N=r(10906),z=r(43616),L=r(51255),B=r(14113),V=r(49788);function U(e){const t=new B.N5,{attributes:r,vertex:U,fragment:G,varyings:j}=t,{output:W,normalType:k,offsetBackfaces:$,spherical:Z,snowCover:q,pbrMode:Y,textureAlphaPremultiplied:X,instancedDoublePrecision:K,hasVertexColors:J,hasVertexTangents:Q,hasColorTexture:ee,hasNormalTexture:te,hasNormalTextureTransform:re,hasColorTextureTransform:ie}=e;if((0,R.NB)(U,e),r.add("position","vec3"),j.add("vpos","vec3",{invariant:!0}),t.include(E.A,e),t.include(l.B,e),t.include(f.Ge,e),t.include(S.q2,e),!(0,n._o)(W))return t.include(v.E,e),t;t.include(S.Sx,e),t.include(S.MU,e),t.include(S.O1,e),t.include(S.QM,e),(0,R.yu)(U,e),t.include(d.Y,e),t.include(a.d);const ne=0===k||1===k;return ne&&$&&t.include(i.M),t.include(g.J,e),t.include(p.Mh,e),t.include(s.v,e),j.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(u.K,e),t.include(m.c,e),U.uniforms.add(new F.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),j.add("vcolorExt","vec4"),t.include(C.Z,e),U.include(c.WD),U.include(c.oF),t.include(K?T.G:T.Bz,e),U.main.add(D.H`
|
|
201
208
|
forwardNormalizedVertexColor();
|
|
202
209
|
|
|
203
210
|
MaskedColor maskedColor =
|
|
@@ -209,11 +216,11 @@ return dpDummy * hiD + loD;
|
|
|
209
216
|
vpos = getVertexInLocalOriginSpace();
|
|
210
217
|
vPositionLocal = vpos - view[3].xyz;
|
|
211
218
|
vpos = subtractOrigin(vpos);
|
|
212
|
-
${(0,D.If)(
|
|
219
|
+
${(0,D.If)(ne,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
|
|
213
220
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
214
221
|
${(0,D.If)(Q,"vTangent = dpTransformVertexTangent(tangent);")}
|
|
215
222
|
gl_Position = transformPosition(proj, view, vpos);
|
|
216
|
-
${(0,D.If)(
|
|
223
|
+
${(0,D.If)(ne&&$,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
|
|
217
224
|
|
|
218
225
|
forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
|
|
219
226
|
forwardTextureCoordinates();
|
|
@@ -227,7 +234,7 @@ return dpDummy * hiD + loD;
|
|
|
227
234
|
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
228
235
|
}
|
|
229
236
|
forwardLinearDepthToReadShadowMap();
|
|
230
|
-
`),G.include(x.kA,e),G.include(_.n,e),t.include(A.S,e),G.include(
|
|
237
|
+
`),G.include(x.kA,e),G.include(_.n,e),t.include(A.S,e),G.include(o.HQ,e),t.include(L.D,e),(0,R.yu)(G,e),G.uniforms.add(U.uniforms.get("localOrigin"),new O.t("ambient",e=>e.ambient),new O.t("diffuse",e=>e.diffuse),new P.m("opacity",e=>e.opacity),new P.m("layerOpacity",e=>e.layerOpacity)),ee&&G.uniforms.add(new H.N("tex",e=>e.texture)),t.include(M._,e),G.include(y.c,e),G.include(I.N),t.include(b.r,e),G.include(N.b,e),(0,x.a8)(G),(0,x.eU)(G),(0,w.O4)(G),G.main.add(D.H`
|
|
231
238
|
discardBySlice(vpos);
|
|
232
239
|
discardByTerrainDepth();
|
|
233
240
|
${ee?D.H`
|
|
@@ -266,9 +273,9 @@ return dpDummy * hiD + loD;
|
|
|
266
273
|
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, additionalAmbientIrradiance);`:D.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
|
|
267
274
|
vec4 finalColor = vec4(shadedColor, opacity_);
|
|
268
275
|
outputColorHighlightOLID(finalColor, vpos, albedo ${(0,D.If)(q,", snow")});
|
|
269
|
-
`),t}const G=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(15142),
|
|
270
|
-
void forwardLinearDepthToReadShadowMap() { ${(0,
|
|
271
|
-
`)}var s=r(14314),l=r(35818),c=r(74333);class d extends c.n{constructor(e,t,r,i){super(e,"mat4",2,(r,o,
|
|
276
|
+
`),t}const G=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(15142),n=r(38954),o=r(51850),a=r(620);class s{get center(){return(0,o.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,o.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,o.fA)(this._data[7],this._data[8],this._data[9])}constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,a.vA)(e.length>=1),(0,a.vA)(3===r.size||4===r.size);const{data:i,size:s,indices:c}=r;(0,a.vA)(c.length%this._numIndexPerPrimitive===0),(0,a.vA)(c.length>=e.length*this._numIndexPerPrimitive);const d=e.length;let u=s*c[this._numIndexPerPrimitive*e[0]];l.clear(),l.push(u);const h=(0,o.fA)(i[u],i[u+1],i[u+2]),m=(0,o.o8)(h);for(let t=0;t<d;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){u=s*c[r+e],l.push(u);let t=i[u];h[0]=Math.min(t,h[0]),m[0]=Math.max(t,m[0]),t=i[u+1],h[1]=Math.min(t,h[1]),m[1]=Math.max(t,m[1]),t=i[u+2],h[2]=Math.min(t,h[2]),m[2]=Math.max(t,m[2])}}for(let e=0;e<3;++e)this._data[4+e]=h[e],this._data[7+e]=m[e];const p=(0,n.l)((0,o.vt)(),this.bbMin,this.bbMax,.5);let f=.5*Math.max(Math.max(m[0]-h[0],m[1]-h[1]),m[2]-h[2]),v=f*f;for(let e=0;e<l.length;++e){u=l.at(e);const t=i[u]-p[0],r=i[u+1]-p[1],n=i[u+2]-p[2],o=t*t+r*r+n*n;if(o<=v)continue;const a=Math.sqrt(o),s=.5*(a-f);f+=s,v=f*f;const c=s/a;p[0]+=t*c,p[1]+=r*c,p[2]+=n*c}this._data[3]=f;for(let e=0;e<3;++e)this._data[0+e]=p[e];l.clear()}getChildren(){if(this._children||(0,n.s)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,n.l)((0,o.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:a,size:l,indices:c}=this.position;for(let n=0;n<t;++n){let t=0;const o=this._numIndexPerPrimitive*this.primitiveIndices[n];let s=l*c[o],d=a[s],u=a[s+1],h=a[s+2];for(let e=1;e<this._numIndexPerPrimitive;++e){s=l*c[o+e];const t=a[s],r=a[s+1],i=a[s+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[n]=t,++i[t]}let d=0;for(let e=0;e<8;++e)i[e]>0&&++d;if(d<2)return;const u=new Array(8);for(let e=0;e<8;++e)u[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];u[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==u[e]&&this._children.push(new s(u[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){l.prune()}}const l=new i.A({deallocator:null})},31217:(e,t,r)=>{r.d(t,{D:()=>n});var i=r(11254);async function n(e,t){return(await(0,i.A)(e,{responseType:"image",...t})).data}},31821:(e,t,r)=>{r.d(t,{H:()=>i,If:()=>n});const i=(e,...t)=>{let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r};function n(e,t,r=""){return e?t:r}i.int=e=>Math.round(e).toString(),i.float=e=>e.toPrecision(8)},32482:(e,t,r)=>{r.d(t,{Bz:()=>w,G:()=>x}),r(51850);var i=r(46686),n=r(49255),o=r(31821);function a(e,t){const r=(0,n._o)(t.output)&&t.receiveShadows;r&&(0,i.o)(e,!0),e.vertex.code.add(o.H`
|
|
277
|
+
void forwardLinearDepthToReadShadowMap() { ${(0,o.If)(r,"forwardLinearDepth(gl_Position.w);")} }
|
|
278
|
+
`)}var s=r(14314),l=r(35818),c=r(74333);class d extends c.n{constructor(e,t,r,i){super(e,"mat4",2,(r,n,o,a)=>r.setUniformMatrices4fv(e,t(n,o,a),i),r)}}class u extends c.n{constructor(e,t,r,i){super(e,"mat4",1,(r,n,o)=>r.setUniformMatrices4fv(e,t(n,o),i),r)}}var h=r(65786);function m(e){e.fragment.uniforms.add(new u("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),f(e)}function p(e){e.fragment.uniforms.add(new d("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),f(e)}function f(e){const{fragment:t}=e;t.uniforms.add(new s.I("cascadeDistances",e=>e.shadowMap.cascadeDistances),new l.W("numCascades",e=>e.shadowMap.numCascades)),t.code.add(o.H`const vec3 invalidShadowmapUVZ = vec3(0.0, 0.0, -1.0);
|
|
272
279
|
vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
|
|
273
280
|
vec4 lv = mat * vec4(_vpos, 1.0);
|
|
274
281
|
lv.xy /= lv.w;
|
|
@@ -290,30 +297,30 @@ return invalidShadowmapUVZ;
|
|
|
290
297
|
}
|
|
291
298
|
vec2 uvShadow = cascadeCoordinates(i, shadowMapSize, lvpos);
|
|
292
299
|
return vec3(uvShadow, lvpos.z);
|
|
293
|
-
}`)}function v(e){e.fragment.code.add(
|
|
300
|
+
}`)}function v(e){e.fragment.code.add(o.H`float readShadowMapUVZ(vec3 uvzShadow, sampler2DShadow _shadowMap) {
|
|
294
301
|
return texture(_shadowMap, uvzShadow);
|
|
295
|
-
}`)}h.Y;var g=r(33094);class _ extends c.n{constructor(e,t){super(e,"sampler2DShadow",0,(r,i)=>r.bindTexture(e,t(i)))}}function x(e,t){t.receiveShadows&&e.include(m),b(e,t)}function w(e,t){t.receiveShadows&&e.include(p),b(e,t)}function b(e,t){e.fragment.uniforms.add(new g.U("lightingGlobalFactor",e=>e.lighting.globalFactor));const{receiveShadows:r,spherical:i}=t;e.include(a,t),r&&y(e),e.fragment.code.add(
|
|
302
|
+
}`)}h.Y;var g=r(33094);class _ extends c.n{constructor(e,t){super(e,"sampler2DShadow",0,(r,i)=>r.bindTexture(e,t(i)))}}function x(e,t){t.receiveShadows&&e.include(m),b(e,t)}function w(e,t){t.receiveShadows&&e.include(p),b(e,t)}function b(e,t){e.fragment.uniforms.add(new g.U("lightingGlobalFactor",e=>e.lighting.globalFactor));const{receiveShadows:r,spherical:i}=t;e.include(a,t),r&&y(e),e.fragment.code.add(o.H`
|
|
296
303
|
float readShadow(float additionalAmbientScale, vec3 vpos) {
|
|
297
|
-
return ${r?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,
|
|
304
|
+
return ${r?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,o.If)(i,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
|
|
298
305
|
}
|
|
299
|
-
`)}function y(e){e.include(v),e.fragment.uniforms.add(new _("shadowMap",({shadowMap:e})=>e.depthTexture)).code.add(
|
|
306
|
+
`)}function y(e){e.include(v),e.fragment.uniforms.add(new _("shadowMap",({shadowMap:e})=>e.depthTexture)).code.add(o.H`float readShadowMap(const in vec3 _worldPos, float _linearDepth) {
|
|
300
307
|
vec3 uvzShadow = calculateUVZShadow(_worldPos, _linearDepth, textureSize(shadowMap,0));
|
|
301
308
|
if (uvzShadow.z < 0.0) {
|
|
302
309
|
return 0.0;
|
|
303
310
|
}
|
|
304
311
|
return readShadowMapUVZ(uvzShadow, shadowMap);
|
|
305
|
-
}`)}h.Y},32680:(e,t,r)=>{r.d(t,{M:()=>
|
|
312
|
+
}`)}h.Y},32680:(e,t,r)=>{r.d(t,{M:()=>n});var i=r(31821);function n(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
|
|
306
313
|
vec3 camToVert = posWorld - camPosWorld;
|
|
307
314
|
bool isBackface = dot(camToVert, normalWorld) > 0.0;
|
|
308
315
|
if (isBackface) {
|
|
309
316
|
posClip.z += 0.0000003 * posClip.w;
|
|
310
317
|
}
|
|
311
318
|
return posClip;
|
|
312
|
-
}`)}},32976:(e,t,r)=>{r.d(t,{o:()=>
|
|
319
|
+
}`)}},32976:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"bool",0,(r,i)=>r.setUniform1b(e,t(i)))}}},33079:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",1,(i,n,o)=>i.setUniform3fv(e,t(n,o),r))}}},33094:(e,t,r)=>{r.d(t,{U:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",0,(i,n)=>i.setUniform1f(e,t(n),r))}}},33120:(e,t,r)=>{r.d(t,{i$:()=>a,xJ:()=>o}),r(46686),r(33752);var i=r(77108),n=r(31821);function o(e){e.vertex.uniforms.add(new i.E("nearFar",e=>e.camera.nearFar))}function a(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
313
320
|
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
|
|
314
|
-
}`)}},33524:(e,t,r)=>{r.d(t,{Sv:()=>u,Yf:()=>a,mE:()=>d,mt:()=>l,z5:()=>s});var i=r(63907),
|
|
321
|
+
}`)}},33524:(e,t,r)=>{r.d(t,{Sv:()=>u,Yf:()=>a,mE:()=>d,mt:()=>l,z5:()=>s});var i=r(63907),n=r(90644);const o=(0,n.p3)(1,0,1,771);function a(e,t=!1){switch(e){case 0:return t?n.RC:n.T8;case 1:return o;case 2:case 3:return null}}function s(e){if(e.draped)return null;switch(e.oitPass){case 0:case 2:return e.writeDepth?n.Uy:null;case 1:case 3:return null}}function l(e,t=513){return{func:0===e||2===e?t:515}}const c={factor:-1,units:-2};function d({oitPass:e,enableOffset:t}){return t&&1===e?c:null}function u(e,t){return 1===e?t?{buffers:[i.r6,i.yI,i.Fq]}:{buffers:[i.r6,i.yI]}:t?{buffers:[i.r6,i.yI]}:null}},33752:(e,t,r)=>{r.d(t,{EM:()=>s,dO:()=>a});var i=r(29242),n=r(51850),o=(r(26425),r(40710),r(33079),r(31821),r(98353),r(35644),r(58029),r(65786));class a extends o.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,n.vt)(),this.transformWorldFromViewTL=(0,n.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)()}}class s extends o.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,n.vt)(),this.transformWorldFromModelTL=(0,n.vt)()}}},34845:(e,t,r)=>{r.d(t,{Ir:()=>d});var i=r(37585),n=r(48163),o=r(87317),a=r(91829),s=r(77108),l=r(14314),c=r(31821);function d(e){e.fragment.uniforms.add(new l.I("projInfo",e=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,o.c)(u,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,o.c)(u,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(e.camera))),e.fragment.uniforms.add(new s.E("zScale",e=>0===e.camera.projectionMatrix[11]?(0,i.hZ)(h,0,1):(0,i.hZ)(h,1,0))),e.fragment.code.add(c.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
|
|
315
322
|
return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
|
|
316
|
-
}`)}const u=(0,a.vt)(),h=(0,
|
|
323
|
+
}`)}const u=(0,a.vt)(),h=(0,n.vt)()},35640:(e,t,r)=>{r.d(t,{Ge:()=>c,VQ:()=>u});var i=r(87317),n=r(91829),o=r(52587),a=r(20693),s=r(71988),l=r(31821);function c(e,t){const r=e.vertex;t.hasVerticalOffset?(u(r),t.hasScreenSizePerspective&&(e.include(o.Y6),(0,o.OH)(r),(0,a.yu)(e.vertex,t)),r.code.add(l.H`
|
|
317
324
|
vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
|
|
318
325
|
float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
|
|
319
326
|
${t.spherical?l.H`vec3 worldNormal = normalize(worldPos + localOrigin);`:l.H`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
|
|
@@ -329,12 +336,12 @@ return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale
|
|
|
329
336
|
vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
|
|
330
337
|
return worldPos + calculateVerticalOffset(worldPos, localOrigin);
|
|
331
338
|
}
|
|
332
|
-
`)):r.code.add(l.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const d=(0,
|
|
339
|
+
`)):r.code.add(l.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const d=(0,n.vt)();function u(e){e.uniforms.add(new s.E("verticalOffset",(e,t)=>{const{minWorldLength:r,maxWorldLength:n,screenLength:o}=e.verticalOffset,a=Math.tan(.5*t.camera.fovY)/(.5*t.camera.fullViewport[3]),s=t.camera.pixelRatio||1;return(0,i.c)(d,o*s,a,r,n)}))}},35644:(e,t,r)=>{r.d(t,{k:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat3",1,(i,n,o)=>i.setUniformMatrix3fv(e,t(n,o),r))}}},35818:(e,t,r)=>{r.d(t,{W:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"int",0,(r,i)=>r.setUniform1i(e,t(i)))}}},36782:(e,t,r)=>{r.d(t,{g:()=>n});var i=r(31821);function n(e,t){if(9!==t.output)return e.vertex.code.add(i.H`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(i.H`void outputObjectAndLayerIdColor() {}`);const r=t.instanced;e.varyings.add("objectAndLayerIdColorVarying","vec4");const n=r?"instanceOlidColor":"olidColor";e.attributes.add(n,"vec4"),e.vertex.code.add(i.H`
|
|
333
340
|
void forwardObjectAndLayerIdColor() {
|
|
334
|
-
objectAndLayerIdColorVarying = ${
|
|
341
|
+
objectAndLayerIdColorVarying = ${n} * 0.003921568627451;
|
|
335
342
|
}`),e.fragment.code.add(i.H`void outputObjectAndLayerIdColor() {
|
|
336
343
|
fragColor = objectAndLayerIdColorVarying;
|
|
337
|
-
}`)}},38969:(e,t,r)=>{r.d(t,{i:()=>
|
|
344
|
+
}`)}},38969:(e,t,r)=>{r.d(t,{i:()=>n});var i=r(37955);function n(e,t){return new Promise((r,n)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",n)))})}},40261:(e,t,r)=>{r.d(t,{E:()=>g});var i=r(33120),n=r(68317),o=r(76597),a=r(96336),s=r(36782),l=r(53466),c=r(72824),d=r(31821);function u(e,t){switch(t.output){case 3:case 4:case 5:case 6:e.fragment.code.add(d.H`float _calculateFragDepth(const in float depth) {
|
|
338
345
|
const float SLOPE_SCALE = 2.0;
|
|
339
346
|
const float BIAS = 20.0 * .000015259;
|
|
340
347
|
float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
|
|
@@ -345,14 +352,14 @@ float fragDepth = _calculateFragDepth(_linearDepth);
|
|
|
345
352
|
gl_FragDepth = fragDepth;
|
|
346
353
|
}`);break;case 7:e.fragment.code.add(d.H`void outputDepth(float _linearDepth){
|
|
347
354
|
gl_FragDepth = _linearDepth;
|
|
348
|
-
}`)}}var h=r(42593),m=r(42398),p=r(58614),f=r(20693),v=r(63761);function g(e,t){const{vertex:r,fragment:g,varyings:_}=e,{hasColorTexture:x,alphaDiscardMode:w}=t,b=x&&1!==w,{output:y,normalType:M,hasColorTextureTransform:T}=t;switch(y){case 1:(0,f.NB)(r,t),e.include(
|
|
355
|
+
}`)}}var h=r(42593),m=r(42398),p=r(58614),f=r(20693),v=r(63761);function g(e,t){const{vertex:r,fragment:g,varyings:_}=e,{hasColorTexture:x,alphaDiscardMode:w}=t,b=x&&1!==w,{output:y,normalType:M,hasColorTextureTransform:T}=t;switch(y){case 1:(0,f.NB)(r,t),e.include(o.d),g.include(n.HQ,t),e.include(l.U,t),b&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(d.H`vpos = getVertexInLocalOriginSpace();
|
|
349
356
|
vpos = subtractOrigin(vpos);
|
|
350
357
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
351
358
|
gl_Position = transformPosition(proj, view, vpos);
|
|
352
359
|
forwardTextureCoordinates();`),e.include(p.S,t),g.main.add(d.H`
|
|
353
360
|
discardBySlice(vpos);
|
|
354
361
|
${(0,d.If)(b,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
|
|
355
|
-
discardOrAdjustAlpha(texColor);`)}`);break;case 3:case 4:case 5:case 6:case 9:(0,f.NB)(r,t),e.include(
|
|
362
|
+
discardOrAdjustAlpha(texColor);`)}`);break;case 3:case 4:case 5:case 6:case 9:(0,f.NB)(r,t),e.include(o.d),e.include(l.U,t),e.include(m.A,t),e.include(u,t),g.include(n.HQ,t),e.include(s.g,t),(0,i.xJ)(e),_.add("depth","float",{invariant:!0}),b&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(d.H`vpos = getVertexInLocalOriginSpace();
|
|
356
363
|
vpos = subtractOrigin(vpos);
|
|
357
364
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
358
365
|
gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
|
|
@@ -361,13 +368,13 @@ forwardObjectAndLayerIdColor();`),e.include(p.S,t),g.main.add(d.H`
|
|
|
361
368
|
discardBySlice(vpos);
|
|
362
369
|
${(0,d.If)(b,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
|
|
363
370
|
discardOrAdjustAlpha(texColor);`)}
|
|
364
|
-
${9===y?d.H`outputObjectAndLayerIdColor();`:d.H`outputDepth(depth);`}`);break;case 2:{(0,f.NB)(r,t),e.include(
|
|
371
|
+
${9===y?d.H`outputObjectAndLayerIdColor();`:d.H`outputDepth(depth);`}`);break;case 2:{(0,f.NB)(r,t),e.include(o.d),e.include(a.Y,t),e.include(c.Mh,t),e.include(l.U,t),e.include(m.A,t),b&&g.uniforms.add(new v.N("tex",e=>e.texture)),2===M&&_.add("vPositionView","vec3",{invariant:!0});const i=0===M||1===M;r.main.add(d.H`
|
|
365
372
|
vpos = getVertexInLocalOriginSpace();
|
|
366
373
|
${i?d.H`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:d.H`vPositionView = (view * vec4(vpos, 1.0)).xyz;`}
|
|
367
374
|
vpos = subtractOrigin(vpos);
|
|
368
375
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
369
376
|
gl_Position = transformPosition(proj, view, vpos);
|
|
370
|
-
forwardTextureCoordinates();`),g.include(
|
|
377
|
+
forwardTextureCoordinates();`),g.include(n.HQ,t),e.include(p.S,t),g.main.add(d.H`
|
|
371
378
|
discardBySlice(vpos);
|
|
372
379
|
${(0,d.If)(b,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
|
|
373
380
|
discardOrAdjustAlpha(texColor);`)}
|
|
@@ -376,15 +383,15 @@ forwardObjectAndLayerIdColor();`),e.include(p.S,t),g.main.add(d.H`
|
|
|
376
383
|
if (gl_FrontFacing == false){
|
|
377
384
|
normal = -normal;
|
|
378
385
|
}`}
|
|
379
|
-
fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case 8:(0,f.NB)(r,t),e.include(
|
|
386
|
+
fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case 8:(0,f.NB)(r,t),e.include(o.d),e.include(l.U,t),e.include(m.A,t),b&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(d.H`vpos = getVertexInLocalOriginSpace();
|
|
380
387
|
vpos = subtractOrigin(vpos);
|
|
381
388
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
382
389
|
gl_Position = transformPosition(proj, view, vpos);
|
|
383
|
-
forwardTextureCoordinates();`),g.include(
|
|
390
|
+
forwardTextureCoordinates();`),g.include(n.HQ,t),e.include(p.S,t),e.include(h.Q,t),g.main.add(d.H`
|
|
384
391
|
discardBySlice(vpos);
|
|
385
392
|
${(0,d.If)(b,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
|
|
386
393
|
discardOrAdjustAlpha(texColor);`)}
|
|
387
|
-
calculateOcclusionAndOutputHighlight();`)}}},40710:(e,t,r)=>{r.d(t,{W:()=>
|
|
394
|
+
calculateOcclusionAndOutputHighlight();`)}}},40710:(e,t,r)=>{r.d(t,{W:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",2,(i,n,o,a)=>i.setUniform3fv(e,t(n,o,a),r))}}},42293:(e,t,r)=>{r.d(t,{MW:()=>o,wH:()=>n}),r(94656);var i=r(63907);function n(e){switch(e){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function o(e){switch(e){case 6406:case 6409:case 6403:case 36244:case i.H0.R8:case i.H0.R8I:case i.H0.R8UI:case i.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case i.H0.RGBA4:case i.H0.R16F:case i.H0.R16I:case i.H0.R16UI:case i.H0.RG8:case i.H0.RG8I:case i.H0.RG8UI:case i.H0.RG8_SNORM:case i.H0.RGB565:case i.H0.RGB5_A1:case i.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case i.H0.RGB8:case i.H0.RGB8I:case i.H0.RGB8UI:case i.H0.RGB8_SNORM:case i.H0.SRGB8:case i.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case i.H0.RGBA8:case i.H0.R32F:case i.H0.R11F_G11F_B10F:case i.H0.RG16F:case i.H0.R32I:case i.H0.R32UI:case i.H0.RG16I:case i.H0.RG16UI:case i.H0.RGBA8I:case i.H0.RGBA8UI:case i.H0.RGBA8_SNORM:case i.H0.SRGB8_ALPHA8:case i.H0.RGB9_E5:case i.H0.RGB10_A2UI:case i.H0.RGB10_A2:case i.SB.DEPTH_COMPONENT32F:case i.iE.DEPTH24_STENCIL8:return 4;case i.iE.DEPTH32F_STENCIL8:return 5;case i.H0.RGB16F:case i.H0.RGB16I:case i.H0.RGB16UI:return 6;case i.H0.RG32F:case i.H0.RG32I:case i.H0.RG32UI:case i.H0.RGBA16F:case i.H0.RGBA16I:case i.H0.RGBA16UI:return 8;case i.H0.RGB32F:case i.H0.RGB32I:case i.H0.RGB32UI:return 12;case i.H0.RGBA32F:case i.H0.RGBA32I:case i.H0.RGBA32UI:return 16;case i.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.CQ.COMPRESSED_R11_EAC:case i.CQ.COMPRESSED_SIGNED_R11_EAC:case i.CQ.COMPRESSED_RGB8_ETC2:case i.CQ.COMPRESSED_SRGB8_ETC2:case i.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.CQ.COMPRESSED_RG11_EAC:case i.CQ.COMPRESSED_SIGNED_RG11_EAC:case i.CQ.COMPRESSED_RGBA8_ETC2_EAC:case i.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}new Set([i.pe.BYTE,i.pe.SHORT,i.pe.INT,i.pe.UNSIGNED_BYTE,i.pe.UNSIGNED_SHORT,i.pe.UNSIGNED_INT])},42398:(e,t,r)=>{r.d(t,{A:()=>h});var i=r(43519),n=r(33079),o=r(71988),a=r(74333);class s extends a.n{constructor(e,t,r,i){super(e,"vec4",1,(t,n,o)=>t.setUniform4fv(e,r(n,o),i),t)}}class l extends a.n{constructor(e,t,r,i){super(e,"float",1,(t,n,o)=>t.setUniform1fv(e,r(n,o),i),t)}}var c=r(31821),d=r(35644);r(78662).Gd;const u=8;function h(e,t){const{vertex:r,attributes:a}=e;t.hasVVInstancing&&(t.hasVVSize||t.hasVVColor)&&a.add("instanceFeatureAttribute","vec4"),t.hasVVSize?(r.uniforms.add(new n.t("vvSizeMinSize",e=>e.vvSize.minSize)),r.uniforms.add(new n.t("vvSizeMaxSize",e=>e.vvSize.maxSize)),r.uniforms.add(new n.t("vvSizeOffset",e=>e.vvSize.offset)),r.uniforms.add(new n.t("vvSizeFactor",e=>e.vvSize.factor)),r.uniforms.add(new n.t("vvSizeFallback",e=>e.vvSize.fallback)),r.uniforms.add(new d.k("vvSymbolRotationMatrix",e=>e.vvSymbolRotationMatrix)),r.uniforms.add(new n.t("vvSymbolAnchor",e=>e.vvSymbolAnchor)),r.code.add(c.H`vec3 vvScale(vec4 _featureAttribute) {
|
|
388
395
|
if (isnan(_featureAttribute.x)) {
|
|
389
396
|
return vvSizeFallback;
|
|
390
397
|
}
|
|
@@ -408,7 +415,7 @@ return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position +
|
|
|
408
415
|
return vvTransformPosition(position, instanceFeatureAttribute);
|
|
409
416
|
}`:""}
|
|
410
417
|
`)):r.code.add(c.H`vec4 localPosition() { return vec4(position, 1.0); }
|
|
411
|
-
vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),e.vertex.include(i.WD),t.hasVVColor?(r.constants.add("vvColorNumber","int",u),r.uniforms.add(new l("vvColorValues",u,e=>e.vvColor.values),new s("vvColorColors",u,e=>e.vvColor.colors),new
|
|
418
|
+
vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),e.vertex.include(i.WD),t.hasVVColor?(r.constants.add("vvColorNumber","int",u),r.uniforms.add(new l("vvColorValues",u,e=>e.vvColor.values),new s("vvColorColors",u,e=>e.vvColor.colors),new o.E("vvColorFallback",e=>e.vvColor.fallback,{supportsNaN:!0})),t.hasVVInstancing&&(e.vertex.include(i.ML),e.vertex.include(i.oF)),r.code.add(c.H`
|
|
412
419
|
vec4 interpolateVVColor(float value) {
|
|
413
420
|
if (isnan(value)) {
|
|
414
421
|
return vvColorFallback;
|
|
@@ -453,7 +460,7 @@ return vec4(1.0);
|
|
|
453
460
|
}
|
|
454
461
|
MaskedColor applyVVColor(MaskedColor color) {
|
|
455
462
|
return color;
|
|
456
|
-
}`)}},42593:(e,t,r)=>{r.d(t,{Q:()=>d});var i=r(31821);function
|
|
463
|
+
}`)}},42593:(e,t,r)=>{r.d(t,{Q:()=>d});var i=r(31821);function n(e){const{fragment:t}=e;t.code.add(i.H`uint readChannelBits(uint channel, int highlightLevel) {
|
|
457
464
|
int llc = (highlightLevel & 3) << 1;
|
|
458
465
|
return (channel >> llc) & 3u;
|
|
459
466
|
}
|
|
@@ -463,7 +470,7 @@ return texel[lic];
|
|
|
463
470
|
}
|
|
464
471
|
uint readLevelBits(uvec2 texel, int highlightLevel) {
|
|
465
472
|
return readChannelBits(readChannel(texel, highlightLevel), highlightLevel);
|
|
466
|
-
}`)}var
|
|
473
|
+
}`)}var o=r(74333);class a extends o.n{constructor(e,t){super(e,"ivec2",0,(r,i)=>r.setUniform2iv(e,t(i)))}}var s=r(35818),l=r(12791);class c extends o.n{constructor(e,t){super(e,"usampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}function d(e,t){const{fragment:r}=e,{output:o,draped:d,hasHighlightMixTexture:u}=t;8===o?(r.uniforms.add(new s.W("highlightLevel",e=>e.highlightLevel??0),new a("highlightMixOrigin",e=>e.highlightMixOrigin)),e.outputs.add("fragHighlight","uvec2",0),e.include(n),u?r.uniforms.add(new c("highlightMixTexture",e=>e.highlightMixTexture)).code.add(i.H`uvec2 getAccumulatedHighlight() {
|
|
467
474
|
return texelFetch(highlightMixTexture, ivec2(gl_FragCoord.xy) - highlightMixOrigin, 0).rg;
|
|
468
475
|
}
|
|
469
476
|
void outputHighlight(bool occluded) {
|
|
@@ -493,14 +500,14 @@ float sceneDepth = texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x;
|
|
|
493
500
|
return gl_FragCoord.z > sceneDepth + 5e-7;
|
|
494
501
|
}`),r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {
|
|
495
502
|
outputHighlight(isHighlightOccluded());
|
|
496
|
-
}`)):r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {}`)}},42958:(e,t,r)=>{r.d(t,{w:()=>v,L:()=>g});var i=r(31635),
|
|
503
|
+
}`)):r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {}`)}},42958:(e,t,r)=>{r.d(t,{w:()=>v,L:()=>g});var i=r(31635),n=r(69622),o=r(53966),a=r(97768),s=r(91429),l=r(49255),c=r(63907),d=r(85079),u=r(74038);new u._("position",3,c.pe.FLOAT,0,12);const h=[new u._("position",2,c.pe.FLOAT,0,8)];(0,d.Xk)(h),new u._("position",2,c.pe.FLOAT,0,12),new u._("uv0",2,c.pe.HALF_FLOAT,8,12),new u._("position",2,c.pe.FLOAT,0,16),new u._("uv0",2,c.pe.FLOAT,8,16),r(44208);var m=r(94656);class p{constructor(e,t,r){this._context=e,this.locations=r,this._textures=new Map,this.source=(0,m.en)()?t:null,t.attributeNames.forEach(e=>{r.has(e)||console.error(`Missing VertexAttributeLocation for ${e} used in shader`)}),this._glProgram=e.programCache.acquire(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t,r){this._glProgram.setUniform1f(e,t,r)}setUniform2fv(e,t,r){this._glProgram.setUniform2fv(e,t,r)}setUniform3fv(e,t,r){this._glProgram.setUniform3fv(e,t,r)}setUniform4fv(e,t,r){this._glProgram.setUniform4fv(e,t,r)}setUniformMatrix3fv(e,t,r){this._glProgram.setUniformMatrix3fv(e,t,!1,r)}setUniformMatrix4fv(e,t,r){this._glProgram.setUniformMatrix4fv(e,t,!1,r)}setUniformMatrices4fv(e,t,r){this._glProgram.setUniformMatrices4fv(e,t,!1,r)}setUniform1fv(e,t,r){this._glProgram.setUniform1fv(e,t,r)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e,t){let r=e.locations;if(t){const e=new Map(r);t.forEach((t,i)=>e.set(i,r.size+t)),r=e}r.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${r}, ${this.locations}`),this.locations.forEach((e,t)=>{r.get(t)!==e&&console.error(`VertexAttributeLocations are incompatible: Program has ${t} at position ${e}, VAO has it at position ${r.get(t)}.`)})}stop(){this._textures.clear()}bindTexture(e,t){if(!t?.glName){const r=`Texture sampler ${e} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;(0,m.en)()&&console.error(r),t=this._context.emptyTexture}const r=this._ensureTextureUnit(e,t);this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit)}_ensureTextureUnit(e,t){let r=this._textures.get(e);return null==r?(r={texture:t,unit:this._textures.size},this._textures.set(e,r)):r.texture=t,r}}var f=r(90644);let v=class extends n.A{constructor(e,t,r){super({}),this._context=e,this._configuration=t,this.primitiveType=c.WR.TRIANGLES,this.key=t.key,this.locations=(0,d.Xk)(r??h),this._pipeline=this.initializePipeline(t),this.reload=async r=>{if(r&&await this.shader.reload(),!this.key.equals(t.key))return void o.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);(0,a.WD)(this._program);const i=this.shader.get().build(t);i.debugName=this.declaredClass,this._program=new p(e.rctx,i,this.locations),this._pipeline=this.initializePipeline(t)}}initialize(){const e=this.shader.get().build(this._configuration);e.debugName=this.declaredClass,this._program=new p(this._context.rctx,e,this.locations)}destroy(){this._program=(0,a.WD)(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t){return this._pipeline}initializePipeline(e){return(0,f.Ey)({blending:f.RC,colorWrite:f.kn})}};function g(e,t){return(0,l.g1)(e)?{buffers:[c.$0]}:t??null}v=(0,i.Cg)([(0,s.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],v)},43519:(e,t,r)=>{r.d(t,{ML:()=>a,WD:()=>n,Y1:()=>o,oF:()=>s});var i=r(31821);function n(e){e.code.add(i.H`struct MaskedColor {
|
|
497
504
|
vec4 color;
|
|
498
505
|
bvec4 mask;
|
|
499
|
-
};`)}function
|
|
506
|
+
};`)}function o(e){e.include(n),e.code.add(i.H`
|
|
500
507
|
MaskedColor createMaskedFromUInt8NaNColor(vec4 color) {
|
|
501
508
|
return MaskedColor(color * ${i.H.float(1/254)}, equal(color, vec4(255)));
|
|
502
509
|
}
|
|
503
|
-
`)}function a(e){e.include(
|
|
510
|
+
`)}function a(e){e.include(n),e.code.add(i.H`vec4 maskedColorSelectOrOne(MaskedColor color) {
|
|
504
511
|
return vec4(
|
|
505
512
|
color.mask.r ? 1.0 : color.color.r,
|
|
506
513
|
color.mask.g ? 1.0 : color.color.g,
|
|
@@ -512,33 +519,34 @@ MaskedColor multiplyMaskedColors(MaskedColor color1, MaskedColor color2) {
|
|
|
512
519
|
vec4 masked1 = maskedColorSelectOrOne(color1);
|
|
513
520
|
vec4 masked2 = maskedColorSelectOrOne(color2);
|
|
514
521
|
return MaskedColor(masked1 * masked2, bvec4(ivec4(color1.mask) & ivec4(color2.mask)));
|
|
515
|
-
}`)}function s(e){e.include(
|
|
522
|
+
}`)}function s(e){e.include(n),e.code.add(i.H`MaskedColor createMaskedFromNaNColor(vec4 color) {
|
|
516
523
|
return MaskedColor(color, isnan(color));
|
|
517
|
-
}`)}},43616:(e,t,r)=>{r.d(t,{MB:()=>l,Um:()=>c,kE:()=>a});var i=r(4576),
|
|
524
|
+
}`)}},43616:(e,t,r)=>{r.d(t,{MB:()=>l,Um:()=>c,kE:()=>a});var i=r(4576),n=r(34727),o=r(77194);function a(e,t,r,i,o,a){let s=r.screenLength*e.pixelRatio;null!=o&&(d.update(i,t,o,a),s=d.apply(s));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.qE)(l*t,r.minWorldLength,r.maxWorldLength)}const s=(0,i.VO)();function l(e,t){let r=!1;for(const i in t){const n=t[i];void 0!==n&&(Array.isArray(n)?Array.isArray(e[i])&&s(n,e[i])||(e[i]=n.slice(),r=!0):e[i]!==n&&(r=!0,e[i]=n))}return r}const c={multiply:1,ignore:2,replace:3,tint:4},d=new o.PS},46140:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(49186);let n=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[n,o]=t.split("."),a=/^\s*\d+\s*$/;if(!n?.match||!a.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!o?.match||!a.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(n,10),l=parseInt(o,10);return new e(s,l,r)}}},46686:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(31821);function n(e,t){t&&e.varyings.add("linearDepth","float",{invariant:!0}),e.vertex.code.add(i.H`
|
|
518
525
|
void forwardLinearDepth(float _linearDepth) { ${(0,i.If)(t,"linearDepth = _linearDepth;")} }
|
|
519
|
-
`)}},46859:(e,t,r)=>{r.d(t,{h:()=>B});var i=r(49186),o=r(65529),n=r(97768),a=r(74887),s=r(34275),l=r(24326),c=r(84952),d=r(38969),u=r(31217),h=r(95117),m=r(2741);let p;var f=r(63907),v=r(76284),g=r(42293);let _=null,x=null;async function w(){return null==x&&(p??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,m.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),x=p,_=await x),x}function b(e,t){if(null==_)return e.byteLength;const r=new _.BasisFile(new Uint8Array(e)),i=T(r)?M(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function y(e,t){if(null==_)return e.byteLength;const r=new _.KTX2File(new Uint8Array(e)),i=C(r)?M(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function M(e,t,r,i,o){const n=(0,g.MW)(t?f.CQ.COMPRESSED_RGBA8_ETC2_EAC:f.CQ.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function T(e){return e.getNumImages()>=1&&!e.isUASTC()}function C(e){return e.getFaces()>=1&&e.isETC1S()}function S(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[1,f.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,f.CQ.COMPRESSED_RGB8_ETC2]:c?i?[3,f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=o,t.height=n,new v.A(e,t,{type:"compressed",levels:m})}var E=r(53966);const A=()=>E.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function I(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const R=I("DXT1"),O=I("DXT3"),F=I("DXT5");function P(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return A().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return A().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case R:o=8,n=f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case O:o=16,n=f.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case F:o=16,n=f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return A().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(A().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const p=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e.buffer,m,h),p.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:n,width:c,height:d}}function D(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function H(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const o=Math.max(e,t),n=e*t;if(o<=i&&n<=r)return[e,t];const a=Math.min(Math.sqrt(r/n),i/o);return[D(Math.round(e*a),i),D(Math.round(t*a),i)]}(e,t);return e.width===r&&e.height===i?e:N(e,r,i)}function N(e,t,r){if(e instanceof ImageData)return N(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const o=document.createElement("canvas");return o.width=t,o.height=r,o.getContext("2d").drawImage(e,0,0,o.width,o.height),o}var z=r(620),L=r(67171);class B{constructor(e,t){this._data=e,this.id=(0,l.c)(),this.events=new o.bk,this._parameters={...U,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,c.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,d.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,c.DB)(e.src)||(0,c.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new L.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return"image/ktx2"===t.encoding?y(e,!!t.mipmap):"image/x.basis"===t.encoding?b(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?V(e):t,o=t.pixelFormat??6408,n=(0,g.wH)(o);return(t.mipmap?4/3:1)*r*i*n||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const t=this._data;return null==t?(this._texture=new v.A(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,s.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):(0,s.iu)(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return null==this._texture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=function(e,t,r){const i=P(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?9987:9729,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new v.A(e,t,o)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.KTX2File(new Uint8Array(r));if(!C(i))return null;i.startTranscoding();const o=S(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.BasisFile(new Uint8Array(r));if(!T(i))return null;i.startTranscoding();const o=S(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){(0,z.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return 6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._texture=new v.A(e,r,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await(0,u.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,h.y)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((o,s)=>{const l=()=>{t.removeEventListener("loadeddata",c),t.removeEventListener("error",d),(0,n.xt)(u)},c=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),o(this._loadFromImage(e,t)))},d=e=>{l(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",c),t.addEventListener("error",d);const u=(0,a.u7)(r,()=>d((0,a.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=H(r,e.parameters));const i=V(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.width=i.width,o.height=i.height,o.compress=this._parameters.compressionOptions,this._texture=new v.A(e,o,r),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._texture=(0,n.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function V(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const U={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},47286:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,o,n)=>i.setUniform2fv(e,t(o,n),r))}}},49255:(e,t,r)=>{function i(e){return 3===(t=e)||4===t||5===t||6===e||7===e;var t}function o(e){return function(e){return a(e)||s(e)}(e)||2===e}function n(e){return 0===e}function a(e){return n(e)||function(e){return 8===e||9===e}(e)}function s(e){return 1===e}function l(e){return s(e)||i(e)}r.d(t,{Lc:()=>a,_o:()=>n,g1:()=>l,iq:()=>o,yT:()=>i})},49718:(e,t,r)=>{r(51850),r(6867).i},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51255:(e,t,r)=>{r.d(t,{D:()=>c});var i=r(49255),o=r(63201),n=r(42593),a=r(63365),s=r(31821),l=r(49788);function c(e,t){e.include(n.Q,t),e.include(o.NL,t),e.fragment.include(a.a);const{output:r,oitPass:c,hasEmission:d,discardInvisibleFragments:u,oitPremultipliedAlpha:h,snowCover:m}=t,p=9===r,f=(0,i._o)(r)&&1===c,v=(0,i._o)(r)&&1!==c;let g=0;(v||f)&&e.outputs.add("fragColor","vec4",g++),d&&e.outputs.add("fragEmission","vec4",g++),f&&e.outputs.add("fragAlpha","float",g++),e.fragment.code.add(s.H`
|
|
526
|
+
`)}},46859:(e,t,r)=>{r.d(t,{h:()=>B});var i=r(49186),n=r(65529),o=r(97768),a=r(74887),s=r(34275),l=r(24326),c=r(84952),d=r(38969),u=r(31217),h=r(95117),m=r(2741);let p;var f=r(63907),v=r(76284),g=r(42293);let _=null,x=null;async function w(){return null==x&&(p??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,m.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),x=p,_=await x),x}function b(e,t){if(null==_)return e.byteLength;const r=new _.BasisFile(new Uint8Array(e)),i=T(r)?M(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function y(e,t){if(null==_)return e.byteLength;const r=new _.KTX2File(new Uint8Array(e)),i=C(r)?M(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function M(e,t,r,i,n){const o=(0,g.MW)(t?f.CQ.COMPRESSED_RGBA8_ETC2_EAC:f.CQ.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function T(e){return e.getNumImages()>=1&&!e.isUASTC()}function C(e){return e.getFaces()>=1&&e.isETC1S()}function S(e,t,r,i,n,o,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[1,f.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,f.CQ.COMPRESSED_RGB8_ETC2]:c?i?[3,f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=n,t.height=o,new v.A(e,t,{type:"compressed",levels:m})}var E=r(53966);const A=()=>E.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function I(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const R=I("DXT1"),O=I("DXT3"),F=I("DXT5");function P(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return A().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return A().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case R:n=8,o=f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case O:n=16,o=f.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case F:n=16,o=f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return A().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(A().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const p=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*n,u=new Uint8Array(e.buffer,m,h),p.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:o,width:c,height:d}}function D(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function H(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const n=Math.max(e,t),o=e*t;if(n<=i&&o<=r)return[e,t];const a=Math.min(Math.sqrt(r/o),i/n);return[D(Math.round(e*a),i),D(Math.round(t*a),i)]}(e,t);return e.width===r&&e.height===i?e:N(e,r,i)}function N(e,t,r){if(e instanceof ImageData)return N(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const n=document.createElement("canvas");return n.width=t,n.height=r,n.getContext("2d").drawImage(e,0,0,n.width,n.height),n}var z=r(620),L=r(67171);class B{constructor(e,t){this._data=e,this.id=(0,l.c)(),this.events=new n.bk,this._parameters={...U,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,c.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,d.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,c.DB)(e.src)||(0,c.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new L.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return"image/ktx2"===t.encoding?y(e,!!t.mipmap):"image/x.basis"===t.encoding?b(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?V(e):t,n=t.pixelFormat??6408,o=(0,g.wH)(n);return(t.mipmap?4/3:1)*r*i*o||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const t=this._data;return null==t?(this._texture=new v.A(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,s.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):(0,s.iu)(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return null==this._texture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=function(e,t,r){const i=P(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:a,height:s}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=a,t.height=s,new v.A(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.KTX2File(new Uint8Array(r));if(!C(i))return null;i.startTranscoding();const n=S(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.BasisFile(new Uint8Array(r));if(!T(i))return null;i.startTranscoding();const n=S(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){(0,z.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return 6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._texture=new v.A(e,r,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await(0,u.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,h.y)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((n,s)=>{const l=()=>{t.removeEventListener("loadeddata",c),t.removeEventListener("error",d),(0,o.xt)(u)},c=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),n(this._loadFromImage(e,t)))},d=e=>{l(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",c),t.addEventListener("error",d);const u=(0,a.u7)(r,()=>d((0,a.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=H(r,e.parameters));const i=V(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.width=i.width,n.height=i.height,n.compress=this._parameters.compressionOptions,this._texture=new v.A(e,n,r),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._texture=(0,o.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function V(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const U={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},47286:(e,t,r)=>{r.d(t,{G:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,n,o)=>i.setUniform2fv(e,t(n,o),r))}}},49255:(e,t,r)=>{function i(e){return 3===(t=e)||4===t||5===t||6===e||7===e;var t}function n(e){return function(e){return a(e)||s(e)}(e)||2===e}function o(e){return 0===e}function a(e){return o(e)||function(e){return 8===e||9===e}(e)}function s(e){return 1===e}function l(e){return s(e)||i(e)}r.d(t,{Lc:()=>a,_o:()=>o,g1:()=>l,iq:()=>n,yT:()=>i})},49718:(e,t,r)=>{r(51850),r(6867).i},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51255:(e,t,r)=>{r.d(t,{D:()=>c});var i=r(49255),n=r(22911),o=r(42593),a=r(63365),s=r(31821),l=r(49788);function c(e,t){e.include(o.Q,t),e.include(n.NL,t),e.fragment.include(a.a);const{output:r,oitPass:c,hasEmission:d,discardInvisibleFragments:u,oitPremultipliedAlpha:h,snowCover:m}=t,p=9===r,f=(0,i._o)(r)&&1===c,v=(0,i._o)(r)&&2===c,g=(0,i._o)(r)&&1!==c;let _=0;(g||f)&&e.outputs.add("fragColor","vec4",_++),d&&e.outputs.add("fragEmission","vec4",_++),f&&e.outputs.add("fragAlpha","float",_++),e.fragment.code.add(s.H`
|
|
520
527
|
void outputColorHighlightOLID(vec4 finalColor, const in vec3 vWorldPosition, vec3 emissiveSymbolColor ${(0,s.If)(m,", float snow")}) {
|
|
521
528
|
${(0,s.If)(p,"finalColor.a = 1.0;")}
|
|
522
529
|
${(0,s.If)(u,`if (finalColor.a < ${s.H.float(l.Q)}) { discard; }`)}
|
|
523
530
|
finalColor = applySlice(finalColor, vWorldPosition);
|
|
524
531
|
|
|
525
532
|
${(0,s.If)(f,`${(0,s.If)(h,"fragColor = finalColor;","fragColor = premultiplyAlpha(finalColor);")}\n fragAlpha = finalColor.a;`)}
|
|
526
|
-
${(0,s.If)(v,"
|
|
533
|
+
${(0,s.If)(v&&h&&u,"finalColor.rgb /= finalColor.a;")}
|
|
534
|
+
${(0,s.If)(g,"fragColor = finalColor;")}
|
|
527
535
|
${(0,s.If)(d,`fragEmission = ${(0,s.If)(m,"mix(finalColor.a * getEmissions(emissiveSymbolColor), vec4(0.0), snow);","finalColor.a * getEmissions(emissiveSymbolColor);")}`)}
|
|
528
536
|
calculateOcclusionAndOutputHighlight();
|
|
529
537
|
${(0,s.If)(p,"outputObjectAndLayerIdColor();")}
|
|
530
538
|
}
|
|
531
|
-
`)}},51406:(e,t,r)=>{r.d(t,{MU:()=>l,O1:()=>c,QM:()=>d,Sx:()=>s,q2:()=>a});var i=r(29242),
|
|
539
|
+
`)}},51406:(e,t,r)=>{r.d(t,{MU:()=>l,O1:()=>c,QM:()=>d,Sx:()=>s,q2:()=>a});var i=r(29242),n=r(31821),o=r(35644);function a(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new o.k("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix??i.zK)).code.add(n.H`void forwardColorUV(){
|
|
532
540
|
colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
533
|
-
}`)):e.vertex.code.add(
|
|
541
|
+
}`)):e.vertex.code.add(n.H`void forwardColorUV(){}`)}function s(e,t){t.hasNormalTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("normalUV","vec2"),e.vertex.uniforms.add(new o.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK)).code.add(n.H`void forwardNormalUV(){
|
|
534
542
|
normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
535
|
-
}`)):e.vertex.code.add(
|
|
543
|
+
}`)):e.vertex.code.add(n.H`void forwardNormalUV(){}`)}function l(e,t){t.hasEmissionTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("emissiveUV","vec2"),e.vertex.uniforms.add(new o.k("emissiveTextureTransformMatrix",e=>e.emissiveTextureTransformMatrix??i.zK)).code.add(n.H`void forwardEmissiveUV(){
|
|
536
544
|
emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
537
|
-
}`)):e.vertex.code.add(
|
|
545
|
+
}`)):e.vertex.code.add(n.H`void forwardEmissiveUV(){}`)}function c(e,t){t.hasOcclusionTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("occlusionUV","vec2"),e.vertex.uniforms.add(new o.k("occlusionTextureTransformMatrix",e=>e.occlusionTextureTransformMatrix??i.zK)).code.add(n.H`void forwardOcclusionUV(){
|
|
538
546
|
occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
539
|
-
}`)):e.vertex.code.add(
|
|
547
|
+
}`)):e.vertex.code.add(n.H`void forwardOcclusionUV(){}`)}function d(e,t){t.hasMetallicRoughnessTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.uniforms.add(new o.k("metallicRoughnessTextureTransformMatrix",e=>e.metallicRoughnessTextureTransformMatrix??i.zK)).code.add(n.H`void forwardMetallicRoughnessUV(){
|
|
540
548
|
metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
541
|
-
}`)):e.vertex.code.add(
|
|
549
|
+
}`)):e.vertex.code.add(n.H`void forwardMetallicRoughnessUV(){}`)}},51976:(e,t,r)=>{r.d(t,{K:()=>s,W:()=>l});var i=r(49186),n=r(4576);class o{constructor(e){this._bits=[...e]}equals(e){return(0,n.aI)(this._bits,e.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}var a=r(65786);class s extends a.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map(()=>0)??[],this._parameterNames??=[]}get key(){return this._key??=new o(this._parameterBits),this._key}decode(e=this.key){const t=this._parameterBits;this._parameterBits=[...e.bits];const r=this._parameterNames.map(e=>` ${e}: ${this[e]}`).join("\n");return this._parameterBits=t,r}}function l(e={}){return(t,r)=>{t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t._parameterNames.push(r);const n=e.count||2,o=Math.ceil(Math.log2(n)),a=t._parameterBits;let s=0;for(;a[s]+o>16;)s++,s>=a.length&&a.push(0);const l=a[s],c=(1<<o)-1<<l;a[s]+=o,e.count?Object.defineProperty(t,r,{get(){return(this._parameterBits[s]&c)>>l},set(t){const n=this._parameterBits[s];if((n&c)>>l!==t){if(this._key=null,this._parameterBits[s]=n&~c|+t<<l&c,"number"!=typeof t)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must be a number, got ${typeof t}`);if(null==e.count)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must provide a count option`)}}}):Object.defineProperty(t,r,{get(){return!!((this._parameterBits[s]&c)>>l)},set(e){const t=this._parameterBits[s];if(!!((t&c)>>l)!==e&&(this._key=null,this._parameterBits[s]=t&~c|+e<<l,"boolean"!=typeof e))throw new i.A("internal:invalid-shader-configurationx",`Configuration value for ${r} must be boolean, got ${typeof e}`)}})}}},52540:(e,t,r)=>{r.d(t,{E:()=>s});var i=r(37585),n=r(48163),o=r(77108),a=r(31821);function s(e){e.uniforms.add(new o.E("zProjectionMap",e=>function(e){const t=e.projectionMatrix;return(0,i.hZ)(l,t[14],t[10])}(e.camera))),e.code.add(a.H`float linearizeDepth(float depth) {
|
|
542
550
|
float depthNdc = depth * 2.0 - 1.0;
|
|
543
551
|
float c1 = zProjectionMap[0];
|
|
544
552
|
float c2 = zProjectionMap[1];
|
|
@@ -554,7 +562,7 @@ ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0)));
|
|
|
554
562
|
return texelFetch(depthTexture, iuv, 0).r;
|
|
555
563
|
}`),e.code.add(a.H`float linearDepthFromTexture(sampler2D depthTexture, vec2 uv) {
|
|
556
564
|
return linearizeDepth(depthFromTexture(depthTexture, uv));
|
|
557
|
-
}`)}const l=(0,
|
|
565
|
+
}`)}const l=(0,n.vt)()},52587:(e,t,r)=>{r.d(t,{OH:()=>c,Y6:()=>s,pM:()=>l});var i=r(38954),n=r(51850),o=r(33079),a=r(31821);function s(e){e.vertex.code.add(a.H`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
|
|
558
566
|
return absCosAngle * absCosAngle * absCosAngle;
|
|
559
567
|
}`),e.vertex.code.add(a.H`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) {
|
|
560
568
|
return vec3(
|
|
@@ -573,10 +581,10 @@ screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
|
|
|
573
581
|
return size * clamp(mix(factor.x, 1.0, factor.y), factor.z, 1.0);
|
|
574
582
|
}`),e.vertex.code.add(a.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
|
|
575
583
|
return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
|
|
576
|
-
}`)}function l(e){e.uniforms.add(new
|
|
584
|
+
}`)}function l(e){e.uniforms.add(new o.t("screenSizePerspective",e=>d(e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize)))}function c(e){e.uniforms.add(new o.t("screenSizePerspectiveAlignment",e=>d(e.screenSizePerspectiveAlignment||e.screenSizePerspective,e.screenSizePerspectiveAlignment?null:e.screenSizePerspectiveMinPixelReferenceSize)))}function d(e,t){const r=null!=t&&null!=e?Math.min(e.minPixelSize/t,1):0;return e?(0,i.h)(u,e.divisor,e.offset,r):(0,i.h)(u,0,0,0)}const u=(0,n.vt)()},53466:(e,t,r)=>{r.d(t,{U:()=>n});var i=r(31821);function n(e,t){switch(t.textureCoordinateType){case 1:return e.attributes.add("uv0","vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(i.H`void forwardTextureCoordinates() { vuv0 = uv0; }`);case 2:return e.attributes.add("uv0","vec2"),e.attributes.add("uvRegion","vec4"),e.varyings.add("vuv0","vec2"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(i.H`void forwardTextureCoordinates() {
|
|
577
585
|
vuv0 = uv0;
|
|
578
586
|
vuvRegion = uvRegion;
|
|
579
|
-
}`);default:t.textureCoordinateType;case 0:return void e.vertex.code.add(i.H`void forwardTextureCoordinates() {}`);case 3:return}}},57323:(e,t,r)=>{r.d(t,{R:()=>L,b:()=>z});var i=r(32680),
|
|
587
|
+
}`);default:t.textureCoordinateType;case 0:return void e.vertex.code.add(i.H`void forwardTextureCoordinates() {}`);case 3:return}}},57323:(e,t,r)=>{r.d(t,{R:()=>L,b:()=>z});var i=r(32680),n=r(49255),o=r(68317),a=r(76597),s=r(24321),l=r(72722),c=r(43519),d=r(96336),u=r(71955),h=r(53466),m=r(92700),p=r(35640),f=r(40261),v=r(14527),g=r(89390),_=r(98619),x=r(22393),w=r(59469),b=r(32482),y=r(96598),M=r(42398),T=r(58614),C=r(27950),S=r(20693),E=r(33079),A=r(71988),I=r(20304),R=r(31821),O=r(63761),F=r(10906),P=r(43616),D=r(51255),H=r(14113),N=r(49788);function z(e){const t=new H.N5,{attributes:r,vertex:z,fragment:L,varyings:B}=t,{output:V,offsetBackfaces:U,pbrMode:G,snowCover:j,spherical:W}=e,k=1===G||2===G;if((0,S.NB)(z,e),r.add("position","vec3"),B.add("vpos","vec3",{invariant:!0}),t.include(M.A,e),t.include(l.B,e),t.include(p.Ge,e),t.include(y.Z,e),!(0,n._o)(V))return t.include(f.E,e),t;(0,S.yu)(t.vertex,e),t.include(d.Y,e),t.include(a.d),U&&t.include(i.M),B.add("vNormalWorld","vec3"),B.add("localvpos","vec3",{invariant:!0}),t.include(h.U,e),t.include(u.K,e),t.include(s.v,e),t.include(m.c,e),z.include(c.WD),z.include(c.oF),z.uniforms.add(new A.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),B.add("vcolorExt","vec4"),t.include(e.instancedDoublePrecision?b.G:b.Bz,e),z.main.add(R.H`
|
|
580
588
|
forwardNormalizedVertexColor();
|
|
581
589
|
|
|
582
590
|
MaskedColor maskedColorExt =
|
|
@@ -599,7 +607,7 @@ vuvRegion = uvRegion;
|
|
|
599
607
|
forwardLinearDepthToReadShadowMap();
|
|
600
608
|
gl_Position = alphaCut ? vec4(1e38, 1e38, 1e38, 1.0) :
|
|
601
609
|
${(0,R.If)(U,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
|
|
602
|
-
`);const{hasColorTexture:$,hasColorTextureTransform:Z}=e;return L.include(g.kA,e),L.include(v.n,e),t.include(T.S,e),L.include(
|
|
610
|
+
`);const{hasColorTexture:$,hasColorTextureTransform:Z}=e;return L.include(g.kA,e),L.include(v.n,e),t.include(T.S,e),L.include(o.HQ,e),t.include(D.D,e),(0,S.yu)(L,e),(0,_.Gc)(L),(0,g.a8)(L),(0,g.eU)(L),L.uniforms.add(z.uniforms.get("localOrigin"),z.uniforms.get("view"),new E.t("ambient",e=>e.ambient),new E.t("diffuse",e=>e.diffuse),new I.m("opacity",e=>e.opacity),new I.m("layerOpacity",e=>e.layerOpacity)),$&&L.uniforms.add(new O.N("tex",e=>e.texture)),t.include(w._,e),L.include(x.c,e),L.include(C.N),L.include(F.b,e),(0,_.O4)(L),L.main.add(R.H`
|
|
603
611
|
discardBySlice(vpos);
|
|
604
612
|
discardByTerrainDepth();
|
|
605
613
|
vec4 texColor = ${$?`texture(tex, ${Z?"colorUV":"vuv0"})`:" vec4(1.0)"};
|
|
@@ -634,16 +642,16 @@ vuvRegion = uvRegion;
|
|
|
634
642
|
${(0,R.If)(j,"mrr = applySnowToMRR(mrr, snow);")}
|
|
635
643
|
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, groundNormal, mrr, additionalAmbientIrradiance);`:R.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
|
|
636
644
|
vec4 finalColor = vec4(shadedColor, opacity_);
|
|
637
|
-
outputColorHighlightOLID(finalColor, vpos, albedo ${(0,R.If)(j,", 1.0")});`),t}const L=Object.freeze(Object.defineProperty({__proto__:null,build:z},Symbol.toStringTag,{value:"Module"}))},57917:(e,t,r)=>{r.d(t,{S:()=>
|
|
645
|
+
outputColorHighlightOLID(finalColor, vpos, albedo ${(0,R.If)(j,", 1.0")});`),t}const L=Object.freeze(Object.defineProperty({__proto__:null,build:z},Symbol.toStringTag,{value:"Module"}))},57917:(e,t,r)=>{r.d(t,{S:()=>o});var i=r(34275),n=r(20498);function o(e){if(e.length<i.y9)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,i.LW)(e)?(0,n.pX)().from(e):(0,i.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}},58029:(e,t,r)=>{r.d(t,{F:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat4",0,(i,n)=>i.setUniformMatrix4fv(e,t(n),r))}}},58614:(e,t,r)=>{r.d(t,{S:()=>a}),r(28421);var i=r(20304),n=r(31821),o=r(49788);function a(e,t){!function(e,t,r){const i=e.fragment,a=t.alphaDiscardMode,s=0===a;2!==a&&3!==a||i.uniforms.add(r),i.code.add(n.H`
|
|
638
646
|
void discardOrAdjustAlpha(inout vec4 color) {
|
|
639
|
-
${1===a?"color.a = 1.0;":`if (color.a < ${s?
|
|
647
|
+
${1===a?"color.a = 1.0;":`if (color.a < ${s?n.H.float(o.Q):"textureAlphaCutoff"}) {\n discard;\n } ${(0,n.If)(2===a,"else { color.a = 1.0; }")}`}
|
|
640
648
|
}
|
|
641
|
-
`)}(e,t,new i.m("textureAlphaCutoff",e=>e.textureAlphaCutoff))}},59469:(e,t,r)=>{r.d(t,{_:()=>c});var i=r(99208),
|
|
649
|
+
`)}(e,t,new i.m("textureAlphaCutoff",e=>e.textureAlphaCutoff))}},59469:(e,t,r)=>{r.d(t,{_:()=>c});var i=r(99208),n=r(40710),o=r(33079),a=r(31821),s=r(15976),l=r(63761);function c(e,t){const r=t.pbrMode,c=e.fragment;if(2!==r&&0!==r&&1!==r)return void c.code.add(a.H`void applyPBRFactors() {}`);if(0===r)return void c.code.add(a.H`void applyPBRFactors() {}
|
|
642
650
|
float getBakedOcclusion() { return 1.0; }`);if(2===r)return void c.code.add(a.H`vec3 mrr = vec3(0.0, 0.6, 0.2);
|
|
643
651
|
float occlusion = 1.0;
|
|
644
652
|
void applyPBRFactors() {}
|
|
645
653
|
float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:d,hasMetallicRoughnessTextureTransform:u,hasOcclusionTexture:h,hasOcclusionTextureTransform:m,bindType:p}=t;(d||h)&&e.include(i.r,t),c.code.add(a.H`vec3 mrr;
|
|
646
|
-
float occlusion;`),d&&c.uniforms.add(1===p?new l.N("texMetallicRoughness",e=>e.textureMetallicRoughness):new s.o("texMetallicRoughness",e=>e.textureMetallicRoughness)),h&&c.uniforms.add(1===p?new l.N("texOcclusion",e=>e.textureOcclusion):new s.o("texOcclusion",e=>e.textureOcclusion)),c.uniforms.add(1===p?new
|
|
654
|
+
float occlusion;`),d&&c.uniforms.add(1===p?new l.N("texMetallicRoughness",e=>e.textureMetallicRoughness):new s.o("texMetallicRoughness",e=>e.textureMetallicRoughness)),h&&c.uniforms.add(1===p?new l.N("texOcclusion",e=>e.textureOcclusion):new s.o("texOcclusion",e=>e.textureOcclusion)),c.uniforms.add(1===p?new o.t("mrrFactors",e=>e.mrrFactors):new n.W("mrrFactors",e=>e.mrrFactors)),c.code.add(a.H`
|
|
647
655
|
${(0,a.If)(d,a.H`void applyMetallicRoughness(vec2 uv) {
|
|
648
656
|
vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb;
|
|
649
657
|
mrr[0] *= metallicRoughness.b;
|
|
@@ -663,7 +671,7 @@ float occlusion;`),d&&c.uniforms.add(1===p?new l.N("texMetallicRoughness",e=>e.t
|
|
|
663
671
|
${(0,a.If)(d,`applyMetallicRoughness(${u?"metallicRoughnessUV":"vuv0"});`)}
|
|
664
672
|
${(0,a.If)(h,`applyOcclusion(${m?"occlusionUV":"vuv0"});`)}
|
|
665
673
|
}
|
|
666
|
-
`)}(r(74810),r(65786)).Y},59907:(e,t,r)=>{r.d(t,{Hk:()=>h,Pq:()=>u,Ue:()=>l,Ut:()=>d,p1:()=>m,tb:()=>p,uO:()=>s,vJ:()=>v,vx:()=>f}),r(38954);var i=r(51850),
|
|
674
|
+
`)}(r(74810),r(65786)).Y},59907:(e,t,r)=>{r.d(t,{Hk:()=>h,Pq:()=>u,Ue:()=>l,Ut:()=>d,p1:()=>m,tb:()=>p,uO:()=>s,vJ:()=>v,vx:()=>f}),r(38954);var i=r(51850),n=r(58083),o=r(13030),a=r(620);function s(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e)a[r]=n[o[e]],r+=s;else for(let e=0;e<l;++e){const t=n[o[e]];for(let e=0;e<i;e++)a[r]=t,r+=s}}function l(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length;r*=a;for(let e=0;e<s;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=a}}function c(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=3*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}}function d(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}}function u(e,t,r){const i=e.typedBuffer,n=e.typedBufferStride;t*=n;for(let e=0;e<r;++e)i[t]=0,i[t+1]=0,i[t+2]=0,i[t+3]=0,t+=n}function h(e,t,r,i,o=1){if(!t)return void c(e,r,i,o);const{data:a,indices:s}=e,l=r.typedBuffer,d=r.typedBufferStride,u=s.length,h=t[0],m=t[1],p=t[2],f=t[4],v=t[5],g=t[6],_=t[8],x=t[9],w=t[10],b=t[12],y=t[13],M=t[14];i*=d;let T=0,C=0,S=0;const E=(0,n.tZ)(t)?e=>{T=a[e]+b,C=a[e+1]+y,S=a[e+2]+M}:e=>{const t=a[e],r=a[e+1],i=a[e+2];T=h*t+f*r+_*i+b,C=m*t+v*r+x*i+y,S=p*t+g*r+w*i+M};if(1===o)for(let e=0;e<u;++e)E(3*s[e]),l[i]=T,l[i+1]=C,l[i+2]=S,i+=d;else for(let e=0;e<u;++e){E(3*s[e]);for(let e=0;e<o;++e)l[i]=T,l[i+1]=C,l[i+2]=S,i+=d}}function m(e,t,r,i,o=1){if(!t)return void c(e,r,i,o);const{data:a,indices:s}=e,l=t,d=r.typedBuffer,u=r.typedBufferStride,h=s.length,m=l[0],p=l[1],f=l[2],v=l[4],g=l[5],_=l[6],x=l[8],w=l[9],b=l[10],y=!(0,n.ut)(l),M=1e-6,T=1-M;i*=u;let C=0,S=0,E=0;const A=(0,n.tZ)(l)?e=>{C=a[e],S=a[e+1],E=a[e+2]}:e=>{const t=a[e],r=a[e+1],i=a[e+2];C=m*t+v*r+x*i,S=p*t+g*r+w*i,E=f*t+_*r+b*i};if(1===o)if(y)for(let e=0;e<h;++e){A(3*s[e]);const t=C*C+S*S+E*E;if(t<T&&t>M){const e=1/Math.sqrt(t);d[i]=C*e,d[i+1]=S*e,d[i+2]=E*e}else d[i]=C,d[i+1]=S,d[i+2]=E;i+=u}else for(let e=0;e<h;++e)A(3*s[e]),d[i]=C,d[i+1]=S,d[i+2]=E,i+=u;else for(let e=0;e<h;++e){if(A(3*s[e]),y){const e=C*C+S*S+E*E;if(e<T&&e>M){const t=1/Math.sqrt(e);C*=t,S*=t,E*=t}}for(let e=0;e<o;++e)d[i]=C,d[i+1]=S,d[i+2]=E,i+=u}}function p(e,t,r,i,n=1){const{data:o,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t===o.length&&4===t){s[i]=o[0],s[i+1]=o[1],s[i+2]=o[2],s[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[i/=4];i+=t;const d=c*n;for(let r=1;r<d;++r)e[i]=a,i+=t;return}if(1!==n)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}}}function f(e,t,r,i,n=1){const o=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===n)for(let t=0;t<r;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<n;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a}function v(e,t,r,i,n,a,s){let l={numItems:0,numVerticesPerItem:0};for(const c of r.fields.keys()){const r=e.get(c),d=r?.indices;if(r&&d)"position"===c&&(l={numItems:1,numVerticesPerItem:d.length}),g(c,r,i,n,a,s);else if("olidColor"===c&&null!=t){const r=e.get("position")?.indices;if(r){const e=r.length;f(t,a.getField(c,o.XP),e,s)}}}return l}function g(e,t,r,i,s,u){switch(e){case"position":{(0,a.vA)(3===t.size);const i=s.getField(e,o.xs);(0,a.vA)(!!i,`No buffer view for ${e}`),h(t,r,i,u);break}case"normal":{(0,a.vA)(3===t.size);const r=s.getField(e,o.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),m(t,i,r,u);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,a.vA)(2===t.size);const r=s.getField(e,o.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,u);break}case"uv0":{(0,a.vA)(2===t.size);const r=s.getField(e,o.ZD)??s.getField(e,o.gH);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,u);break}case"uvi":{(0,a.vA)(2===t.size);const r=s.getField(e,o.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,u);break}case"color":case"symbolColor":{const r=s.getField(e,o.XP);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(3===t.size||4===t.size),p(t,t.size,r,u);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const r=s.getField(e,o.Y$)??s.getField(e,o.Y$);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(1===t.size),function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length,l=i[0];r*=a;for(let e=0;e<s;++e)o[r]=l,r+=a}(t,r,u);break}case"tangent":{(0,a.vA)(4===t.size);const i=s.getField(e,o.Eq);(0,a.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,o=1){if(!t)return void d(e,r,i,o);const{data:a,indices:s}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,h=s.length,m=l[0],p=l[1],f=l[2],v=l[4],g=l[5],_=l[6],x=l[8],w=l[9],b=l[10],y=!(0,n.ut)(l),M=1e-6,T=1-M;if(i*=u,1===o)for(let e=0;e<h;++e){const t=4*s[e],r=a[t],n=a[t+1],o=a[t+2],l=a[t+3];let d=m*r+v*n+x*o,h=p*r+g*n+w*o,C=f*r+_*n+b*o;if(y){const e=d*d+h*h+C*C;if(e<T&&e>M){const t=1/Math.sqrt(e);d*=t,h*=t,C*=t}}c[i]=d,c[i+1]=h,c[i+2]=C,c[i+3]=l,i+=u}else for(let e=0;e<h;++e){const t=4*s[e],r=a[t],n=a[t+1],l=a[t+2],d=a[t+3];let h=m*r+v*n+x*l,C=p*r+g*n+w*l,S=f*r+_*n+b*l;if(y){const e=h*h+C*C+S*S;if(e<T&&e>M){const t=1/Math.sqrt(e);h*=t,C*=t,S*=t}}for(let e=0;e<o;++e)c[i]=h,c[i+1]=C,c[i+2]=S,c[i+3]=d,i+=u}}(t,r,i,u);break}case"profileVertexAndNormal":{(0,a.vA)(4===t.size);const r=s.getField(e,o.jz)??s.getField(e,o.Eq);(0,a.vA)(!!r,`No buffer view for ${e}`),d(t,r,u);break}case"profileAuxData":{(0,a.vA)(3===t.size);const r=s.getField(e,o.EC)??s.getField(e,o.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),c(t,r,u);break}}}(0,i.vt)()},62602:(e,t,r)=>{r.d(t,{r:()=>n});var i=r(31821);function n(e,t){const r=e.fragment;switch(r.code.add(i.H`struct ShadingNormalParameters {
|
|
667
675
|
vec3 normalView;
|
|
668
676
|
vec3 viewDirection;
|
|
669
677
|
} shadingParams;`),t.doubleSidedMode){case 0:r.code.add(i.H`vec3 shadingNormal(ShadingNormalParameters params) {
|
|
@@ -672,25 +680,7 @@ return normalize(params.normalView);
|
|
|
672
680
|
return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView);
|
|
673
681
|
}`);break;case 2:r.code.add(i.H`vec3 shadingNormal(ShadingNormalParameters params) {
|
|
674
682
|
return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView);
|
|
675
|
-
}`);break;default:t.doubleSidedMode;case 3:}}},
|
|
676
|
-
const float GAMMA = ${a.H.float(n.Tf)};
|
|
677
|
-
const float INV_GAMMA = ${a.H.float(1/n.Tf)};
|
|
678
|
-
|
|
679
|
-
vec4 delinearizeGamma(vec4 color) {
|
|
680
|
-
return vec4(pow(color.rgb, vec3(INV_GAMMA)), color.a);
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
vec3 linearizeGamma(vec3 color) {
|
|
684
|
-
return pow(color, vec3(GAMMA));
|
|
685
|
-
}
|
|
686
|
-
`)}var l=r(40710),c=r(33079),d=r(28421),u=r(20304),h=r(15976),m=r(63761);r(25634);const p=1;function f(e,t){if(!(0,i._o)(t.output))return;e.fragment.include(s);const{emissionSource:r,hasEmissiveTextureTransform:n,bindType:f}=t,v=3===r||4===r||5===r;v&&(e.include(o.r,t),e.fragment.uniforms.add(1===f?new m.N("texEmission",e=>e.textureEmissive):new h.o("texEmission",e=>e.textureEmissive)));const g=2===r||v;g&&e.fragment.uniforms.add(1===f?new c.t("emissiveBaseColor",e=>e.emissiveBaseColor):new l.W("emissiveBaseColor",e=>e.emissiveBaseColor));const _=0!==r;_&&7!==r&&6!==r&&4!==r&&5!==r&&e.fragment.uniforms.add(1===f?new u.m("emissiveStrength",e=>e.emissiveStrength):new d.J("emissiveStrength",e=>e.emissiveStrength));const x=7===r,w=5===r,b=1===r||6===r||x;e.fragment.code.add(a.H`
|
|
687
|
-
vec4 getEmissions(vec3 symbolColor) {
|
|
688
|
-
vec4 emissions = ${g?w?"emissiveSource == 0 ? vec4(emissiveBaseColor, 1.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(emissiveBaseColor, 1.0)":b?x?"emissiveSource == 0 ? vec4(0.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(linearizeGamma(symbolColor), 1.0)":"vec4(0.0)"};
|
|
689
|
-
${(0,a.If)(v,`${(0,a.If)(w,`if(emissiveSource == 0) {\n vec4 emissiveFromTex = textureLookup(texEmission, ${n?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);\n }`,`vec4 emissiveFromTex = textureLookup(texEmission, ${n?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);`)}\n emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}
|
|
690
|
-
${(0,a.If)(_,`emissions.rgb *= emissiveStrength * ${a.H.float(p)};`)}
|
|
691
|
-
return emissions;
|
|
692
|
-
}
|
|
693
|
-
`)}},63365:(e,t,r)=>{r.d(t,{a:()=>o});var i=r(31821);function o(e){e.code.add(i.H`vec4 premultiplyAlpha(vec4 v) {
|
|
683
|
+
}`);break;default:t.doubleSidedMode;case 3:}}},63365:(e,t,r)=>{r.d(t,{a:()=>n});var i=r(31821);function n(e){e.code.add(i.H`vec4 premultiplyAlpha(vec4 v) {
|
|
694
684
|
return vec4(v.rgb * v.a, v.a);
|
|
695
685
|
}
|
|
696
686
|
vec3 rgb2hsv(vec3 c) {
|
|
@@ -708,7 +698,22 @@ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
|
|
708
698
|
}
|
|
709
699
|
float rgb2v(vec3 c) {
|
|
710
700
|
return max(c.x, max(c.y, c.z));
|
|
711
|
-
}`)}},63761:(e,t,r)=>{r.d(t,{N:()=>
|
|
701
|
+
}`)}},63761:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",1,(r,i,n)=>r.bindTexture(e,t(i,n)))}}},65261:(e,t,r)=>{r.d(t,{C:()=>o});var i=r(40876),n=r(31821);function o(e){e.code.add(n.H`
|
|
702
|
+
const float GAMMA = ${n.H.float(i.Tf)};
|
|
703
|
+
const float INV_GAMMA = ${n.H.float(1/i.Tf)};
|
|
704
|
+
|
|
705
|
+
vec3 delinearizeGamma(vec3 color) {
|
|
706
|
+
return pow(color, vec3(INV_GAMMA));
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
vec4 delinearizeGamma(vec4 color) {
|
|
710
|
+
return vec4(delinearizeGamma(color.rgb), color.a);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
vec3 linearizeGamma(vec3 color) {
|
|
714
|
+
return pow(color, vec3(GAMMA));
|
|
715
|
+
}
|
|
716
|
+
`)}},65786:(e,t,r)=>{r.d(t,{Y:()=>i});const i=class{};new i},65806:(e,t,r)=>{r.d(t,{g:()=>a});var i=r(51850),n=r(91218),o=r(9762);function a(e,t,r,i){if((0,n.canProjectWithoutEngine)(e.spatialReference,r))return s[0]=e.x,s[1]=e.y,s[2]=e.z??0,(0,o.projectBuffer)(s,e.spatialReference,0,t,r,0);const a=(0,n.tryProject)(e,r,i);return!!a&&(t[0]=a.x,t[1]=a.y,t[2]=a.z??0,!0)}const s=(0,i.vt)()},67171:(e,t,r)=>{r.d(t,{R:()=>o,e:()=>a});var i=r(63907),n=r(42293);class o{constructor(e=0,t=e){this.width=e,this.height=t,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=i.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function a(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,n.MW)(e.internalFormat))*(34067===e.target?6:1))}},68259:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",2,(i,n,o,a)=>i.setUniform2fv(e,t(n,o,a),r))}}},68317:(e,t,r)=>{r.d(t,{rA:()=>g,Hz:()=>f,HQ:()=>v});var i=r(31635),n=r(44208),o=r(58083),a=r(9093),s=r(38954),l=r(51850),c=r(51976);class d extends c.K{constructor(){super(...arguments),this.output=0,this.hasEmission=!1}}(0,i.Cg)([(0,c.W)({count:10})],d.prototype,"output",void 0),(0,i.Cg)([(0,c.W)()],d.prototype,"hasEmission",void 0);class u extends d{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}var h=r(40710),m=(r(33079),r(31821)),p=r(65786);class f extends u{constructor(){super(...arguments),this.hasSlicePlane=!1,this.hasSliceTranslatedView=!1}}function v(e,t){!function(e,t,...r){e.constants.add("groundSliceOpacity","float",(0,n.A)("enable-feature:oit-ground")?.25:.2),x(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (rejectBySlice(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(m.H`void discardBySlice(vec3 pos) { }
|
|
712
717
|
vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}(e,t,new h.W("slicePlaneOrigin",(e,r)=>M(t,e,r)),new h.W("slicePlaneBasis1",(e,r)=>T(t,e,r,r.slicePlane?.basis1)),new h.W("slicePlaneBasis2",(e,r)=>T(t,e,r,r.slicePlane?.basis2)))}function g(e,t){x(e,t,new h.W("slicePlaneOrigin",(e,r)=>M(t,e,r)),new h.W("slicePlaneBasis1",(e,r)=>T(t,e,r,r.slicePlane?.basis1)),new h.W("slicePlaneBasis2",(e,r)=>T(t,e,r,r.slicePlane?.basis2)))}(0,i.Cg)([(0,c.W)()],f.prototype,"hasSlicePlane",void 0),p.Y;const _=m.H`struct SliceFactors {
|
|
713
718
|
float front;
|
|
714
719
|
float side0;
|
|
@@ -744,49 +749,49 @@ return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
|
|
|
744
749
|
}
|
|
745
750
|
bool rejectBySlice(vec3 pos) {
|
|
746
751
|
return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
|
|
747
|
-
}`;function x(e,t,...r){t.hasSlicePlane?(e.uniforms.add(...r),e.code.add(_)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}function w(e,t,r){return e.instancedDoublePrecision?(0,s.h)(C,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function b(e,t){return null!=e?(0,s.e)(S,t.origin,e):t.origin}function y(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,
|
|
752
|
+
}`;function x(e,t,...r){t.hasSlicePlane?(e.uniforms.add(...r),e.code.add(_)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}function w(e,t,r){return e.instancedDoublePrecision?(0,s.h)(C,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function b(e,t){return null!=e?(0,s.e)(S,t.origin,e):t.origin}function y(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,o.Tl)(A,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function M(e,t,r){if(null==r.slicePlane)return l.uY;const i=w(e,t,r),n=b(i,r.slicePlane),o=y(e,i,r);return null!=o?(0,s.p)(S,n,o):n}function T(e,t,r,i){if(null==i||null==r.slicePlane)return l.uY;const n=w(e,t,r),o=b(n,r.slicePlane),a=y(e,n,r);return null!=a?((0,s.i)(E,i,o),(0,s.p)(S,o,a),(0,s.p)(E,E,a),(0,s.e)(E,E,S)):i}const C=(0,l.vt)(),S=(0,l.vt)(),E=(0,l.vt)(),A=(0,a.vt)()},71955:(e,t,r)=>{r.d(t,{K:()=>l});var i=r(43519),n=r(31821),o=r(74333);class a extends o.n{constructor(e,t){super(e,"int",1,(r,i,n)=>r.setUniform1i(e,t(i,n)))}}var s=r(43616);function l(e,t){e.varyings.add("colorMixMode","int"),e.varyings.add("opacityMixMode","int"),e.vertex.uniforms.add(new a("symbolColorMixMode",e=>s.Um[e.colorMixMode])),t.hasSymbolColors?(e.vertex.include(i.WD),e.vertex.include(i.Y1),e.vertex.include(i.ML),e.attributes.add("symbolColor","vec4"),e.vertex.code.add(n.H`
|
|
748
753
|
MaskedColor applySymbolColor(MaskedColor color) {
|
|
749
754
|
return multiplyMaskedColors(color, createMaskedFromUInt8NaNColor(${"symbolColor"}));
|
|
750
755
|
}
|
|
751
|
-
`)):e.vertex.code.add(
|
|
756
|
+
`)):e.vertex.code.add(n.H`MaskedColor applySymbolColor(MaskedColor color) {
|
|
752
757
|
return color;
|
|
753
|
-
}`),e.vertex.code.add(
|
|
758
|
+
}`),e.vertex.code.add(n.H`
|
|
754
759
|
void forwardColorMixMode(bvec4 mask) {
|
|
755
|
-
colorMixMode = mask.r ? ${
|
|
756
|
-
opacityMixMode = mask.a ? ${
|
|
760
|
+
colorMixMode = mask.r ? ${n.H.int(s.Um.ignore)} : symbolColorMixMode;
|
|
761
|
+
opacityMixMode = mask.a ? ${n.H.int(s.Um.ignore)} : symbolColorMixMode;
|
|
757
762
|
}
|
|
758
|
-
`)}},71988:(e,t,r)=>{r.d(t,{E:()=>
|
|
763
|
+
`)}},71988:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",1,(i,n,o)=>i.setUniform4fv(e,t(n,o),r))}}},72722:(e,t,r)=>{r.d(t,{B:()=>x});var i=r(77690),n=r(29242),o=r(9093),a=r(38954),s=r(51850),l=r(26425),c=r(20693),d=r(23205),u=r(31821),h=r(35644),m=r(74333);class p extends m.n{constructor(e,t,r){super(e,"mat4",1,(i,n,o)=>i.setUniformMatrix4fv(e,t(n,o),r))}}function f(e,t){const r=e.length;for(let i=0;i<r;++i)g[0]=e[i],t[i]=g[0];return t}function v(e,t){const r=e.length;for(let i=0;i<r;++i)g[0]=e[i],g[1]=e[i]-g[0],t[i]=g[1];return t}const g=new Float32Array(2);r(65786).Y;const _=(0,n.vt)();function x(e,t){const{hasModelTransformation:r,instancedDoublePrecision:n,instanced:s,output:m,hasVertexTangents:g}=t;r&&(e.vertex.uniforms.add(new p("model",e=>e.modelTransformation??o.zK)),e.vertex.uniforms.add(new h.k("normalLocalOriginFromModel",e=>((0,i.Ge)(_,e.modelTransformation??o.zK),_)))),s&&n&&(e.attributes.add("instanceModelOriginHi","vec3"),e.attributes.add("instanceModelOriginLo","vec3"),e.attributes.add("instanceModel","mat3"),e.attributes.add("instanceModelNormal","mat3"));const x=e.vertex;n&&(x.include(l.u,t),x.uniforms.add(new d.d("viewOriginHi",e=>f((0,a.h)(w,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),w)),new d.d("viewOriginLo",e=>v((0,a.h)(w,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),w)))),x.code.add(u.H`
|
|
759
764
|
vec3 getVertexInLocalOriginSpace() {
|
|
760
|
-
return ${r?
|
|
765
|
+
return ${r?n?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":n?"instanceModel * localPosition().xyz":"localPosition().xyz"};
|
|
761
766
|
}
|
|
762
767
|
|
|
763
768
|
vec3 subtractOrigin(vec3 _pos) {
|
|
764
|
-
${
|
|
769
|
+
${n?u.H`
|
|
765
770
|
// Issue: (should be resolved now with invariant position) https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280
|
|
766
771
|
vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -instanceModelOriginHi, -instanceModelOriginLo);
|
|
767
772
|
return _pos - originDelta;`:"return vpos;"}
|
|
768
773
|
}
|
|
769
774
|
`),x.code.add(u.H`
|
|
770
775
|
vec3 dpNormal(vec4 _normal) {
|
|
771
|
-
return normalize(${r?
|
|
776
|
+
return normalize(${r?n?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":n?"instanceModelNormal * _normal.xyz":"_normal.xyz"});
|
|
772
777
|
}
|
|
773
778
|
`),2===m&&((0,c.S7)(x),x.code.add(u.H`
|
|
774
779
|
vec3 dpNormalView(vec4 _normal) {
|
|
775
|
-
return normalize((viewNormal * ${r?
|
|
780
|
+
return normalize((viewNormal * ${r?n?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":n?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz);
|
|
776
781
|
}
|
|
777
782
|
`)),g&&x.code.add(u.H`
|
|
778
783
|
vec4 dpTransformVertexTangent(vec4 _tangent) {
|
|
779
|
-
${r?
|
|
780
|
-
}`)}const w=(0,s.vt)()},72824:(e,t,r)=>{r.d(t,{Mh:()=>d,Zo:()=>u,gy:()=>h});var i=r(29242),
|
|
784
|
+
${r?n?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":n?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
|
|
785
|
+
}`)}const w=(0,s.vt)()},72824:(e,t,r)=>{r.d(t,{Mh:()=>d,Zo:()=>u,gy:()=>h});var i=r(29242),n=r(91829),o=r(96336),a=r(33752),s=r(31821),l=r(98353),c=r(35644);function d(e,t){switch(t.normalType){case 0:case 1:e.include(o.Y,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new l.h("transformNormalGlobalFromModel",e=>e.transformNormalGlobalFromModel),new c.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal)).code.add(s.H`void forwardNormal() {
|
|
781
786
|
vNormalWorld = transformNormalGlobalFromModel * normalModel();
|
|
782
787
|
vNormalView = transformNormalViewFromGlobal * vNormalWorld;
|
|
783
|
-
}`);break;case 2:e.vertex.code.add(s.H`void forwardNormal() {}`);break;default:t.normalType;case 3:}}class u extends a.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,i.vt)()}}class h extends a.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,i.vt)(),this.toMapSpace=(0,o.vt)()}}},74333:(e,t,r)=>{r.d(t,{n:()=>i});class i{constructor(e,t,r,i,o=null){if(this.name=e,this.type=t,this.arraySize=o,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>n,SY:()=>l,mb:()=>a});var i=r(38954),o=r(51850);function n({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:n,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.m)(s,o.uY))&&null==l&&(null==n||1===n)&&(null==r||1===r)}const a=(0,o.CN)(1,1,.5),s=(0,o.CN)(0,.6,.2),l=(0,o.CN)(0,1,.2)},76284:(e,t,r)=>{r.d(t,{A:()=>T});var i=r(49186),o=r(44208),n=r(53966),a=r(97768),s=r(93637),l=r(74887),c=r(94656),d=r(63907),u=r(67171);const h=()=>n.A.getLogger("esri/views/webgl/textureUtils");function m(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&h().error("Negative dimension parameters are not allowed!");const{internalFormat:o}=e;if(o&&(p(o)||f(o))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:o}=e;o&&h().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&h().error("Depth textures cannot sample mipmaps"):(9728!==i&&h().error("Depth textures without filtering must use NEAREST filtering"),r&&h().error("Depth textures without filtering cannot use compare function"))}}function p(e){return(0,s.a4)(d.SB,e)}function f(e){return(0,s.a4)(d.iE,e)}function v(e){return null!=e&&"type"in e&&"compressed"===e.type}function g(e){return null!=e&&!v(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function x(e,t,r,i=1){let o=Math.max(t,r);return 32879===e&&(o=Math.max(o,i)),Math.floor(Math.log2(o))+1}function w(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case d.ld.FLOAT:switch(e.pixelFormat){case 6408:return d.H0.RGBA32F;case 6407:return d.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case d.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return d.H0.RGBA8;case 6407:return d.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?d.iE.DEPTH24_STENCIL8:6402===t?d.SB.DEPTH_COMPONENT24:t,e.internalFormat}class b extends u.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case d.H0.R16F:case d.H0.R32F:case d.H0.R8_SNORM:case d.H0.R8:this.pixelFormat=6403;break;case d.H0.R8I:case d.H0.R8UI:case d.H0.R16I:case d.H0.R16UI:case d.H0.R32I:case d.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new b(e,t)}}const y=!!(0,o.A)("esri-tests-disable-gpu-memory-measurements"),M=()=>n.A.getLogger("esri/views/webgl/Texture");class T{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=b.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return y?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(d.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!v(e)&&this._descriptor.internalFormat&&(0,s.a4)(d.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!v(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(e,t,r,o,n,a,s=0){a||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=w(l);const{context:c,pixelFormat:d,dataType:u,target:h,isImmutable:m}=l;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const p=c.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||t+o>l.width||r+n>l.height)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:f}=c;s&&(o&&n||M().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),f.pixelStorei(f.UNPACK_SKIP_ROWS,s)),g(a)?f.texSubImage2D(h,e,t,r,o,n,d,u,a):v(a)?f.compressedTexSubImage2D(h,e,t,r,o,n,l.internalFormat,a.levels[e]):f.texSubImage2D(h,e,t,r,o,n,d,u,a),s&&f.pixelStorei(f.UNPACK_SKIP_ROWS,0),c.bindTexture(p,T.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,o,n,a,s,l){l||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update an uninitialized texture!");const c=this._descriptor;c.internalFormat=w(c);const{context:d,pixelFormat:u,dataType:h,isImmutable:m,target:p}=c;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");_(p)||M().warn("Attempting to set 3D texture data on a non-3D texture");const f=d.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||o<0||t+n>c.width||r+a>c.height||o+s>c.depth)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:g}=d;if(v(l))l=l.levels[e],g.compressedTexSubImage3D(p,e,t,r,o,n,a,s,c.internalFormat,l);else{const i=l;g.texSubImage3D(p,e,t,r,o,n,a,s,u,h,i)}d.bindTexture(f,T.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,m(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const t=this._descriptor.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,T.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,m(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),m(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,a.DC)(this._compressionAbortController)}_setData(e,t){const r=this._descriptor,o=r.context?.gl;if(!o)return;(0,c.Y2)(o),this.hasWebGLTextureObject||(this._glName=o.createTexture(),r.context.instanceCounter.increment(d.vt.Texture,this)),m(r);const n=r.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,c.Y2)(o);const a=t??r.target,l=_(a);if(g(e))this._setDataFromTexImageSource(e,a);else{const{width:t,height:n,depth:u}=r;if(null==t||null==n)throw new i.A("texture:missing-size","Width and height must be specified!");if(l&&null==u)throw new i.A("texture:missing-depth","Depth must be specified!");if(r.internalFormat=w(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,r.internalFormat,r.hasMipmap,t,n,u),v(e)){if(!function(e){return null!=e&&(0,s.a4)(d.CQ,e)}(r.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,a)}else this._texImage(a,0,r.internalFormat,t,n,u,e),(0,c.Y2)(o),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(o),r.context.bindTexture(n,T.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=w(i);const o=_(t),{width:n,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=n),i.height||(i.height=a),o&&i.depth,o&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,n,a,s),this._texImage(t,0,i.internalFormat,n,a,s,e),(0,c.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,c.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:o,height:n,depth:a}=i,s=e.levels,l=x(r,o,n,a),c=Math.min(l,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,c),this._forEachMipmapLevel((e,i,o,n)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,o,n,a)},c)}_texStorage(e,t,r,o,n,a){const{gl:s}=this._descriptor.context;if(!function(e){return d.XN.includes(e)}(t)&&!p(t)&&!f(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?x(e,o,n,a):1;if(_(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,o,n,a)}else s.texStorage2D(e,l,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=_(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,o,n,a,u,h,r)}else l.texSubImage2D(e,t,0,0,o,n,u,h,r)}}else{const d=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,o,n,a,0,u,h,d)}else l.texImage2D(e,t,r,o,n,0,u,h,d)}}_compressedTexImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=_(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,o,n,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,o,n,r,s)}else if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,o,n,a,0,s)}else l.compressedTexImage2D(e,t,r,o,n,0,s)}async _compressOnWorker(e){const{width:t,height:r,context:i,flipped:o,preMultiplyAlpha:n,hasMipmap:a}=this._descriptor,s=this._descriptor.compress?.compressionTracker,c=this._descriptor.compress?.compressionCallback,{compressedTextureETC:d,compressedTextureS3TC:u}=i.capabilities;if(!T.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!d&&!u)return;this.abortCompression();const h=new AbortController;let m;this._compressionAbortController=h,s?.increment();try{e instanceof Uint8Array?m=e.buffer:(m=await createImageBitmap(e,{imageOrientation:o?"flipY":"none"}),(0,l.Te)(h));const i={data:m,width:t,height:r,needsFlip:e instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:n,hasMipmap:a,hasETC:!!d,hasS3TC:!!u},s=await T.compressionWorkerHandle.invoke(i,h.signal,1);if((0,l.Te)(h),s.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=s.internalFormat,this._setData(s.compressedTexture),c?.(e-this.usedMemory)}}catch(e){(0,l.zf)(e)||M().error("Texture compression failed!")}finally{s?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),m instanceof ImageBitmap&&m.close()}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:a,target:s}=this._descriptor;const l=32879===s;if(null==r||null==o||l&&null==n)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),a&&(1!==r||1!==o||l&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),l&&(n=Math.max(1,n>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,c.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},76597:(e,t,r)=>{r.d(t,{d:()=>n});var i=r(33120),o=r(31821);function n(e){(0,i.i$)(e),e.vertex.code.add(o.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
|
|
788
|
+
}`);break;case 2:e.vertex.code.add(s.H`void forwardNormal() {}`);break;default:t.normalType;case 3:}}class u extends a.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,i.vt)()}}class h extends a.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,i.vt)(),this.toMapSpace=(0,n.vt)()}}},74333:(e,t,r)=>{r.d(t,{n:()=>i});class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>o,SY:()=>l,mb:()=>a});var i=r(38954),n=r(51850);function o({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.m)(s,n.uY))&&null==l&&(null==o||1===o)&&(null==r||1===r)}const a=(0,n.CN)(1,1,.5),s=(0,n.CN)(0,.6,.2),l=(0,n.CN)(0,1,.2)},76284:(e,t,r)=>{r.d(t,{A:()=>T});var i=r(49186),n=r(44208),o=r(53966),a=r(97768),s=r(93637),l=r(74887),c=r(94656),d=r(63907),u=r(67171);const h=()=>o.A.getLogger("esri/views/webgl/textureUtils");function m(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&h().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=e;if(n&&(p(n)||f(n))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:n}=e;n&&h().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&h().error("Depth textures cannot sample mipmaps"):(9728!==i&&h().error("Depth textures without filtering must use NEAREST filtering"),r&&h().error("Depth textures without filtering cannot use compare function"))}}function p(e){return(0,s.a4)(d.SB,e)}function f(e){return(0,s.a4)(d.iE,e)}function v(e){return null!=e&&"type"in e&&"compressed"===e.type}function g(e){return null!=e&&!v(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function x(e,t,r,i=1){let n=Math.max(t,r);return 32879===e&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function w(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case d.ld.FLOAT:switch(e.pixelFormat){case 6408:return d.H0.RGBA32F;case 6407:return d.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case d.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return d.H0.RGBA8;case 6407:return d.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?d.iE.DEPTH24_STENCIL8:6402===t?d.SB.DEPTH_COMPONENT24:t,e.internalFormat}class b extends u.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case d.H0.R16F:case d.H0.R32F:case d.H0.R8_SNORM:case d.H0.R8:this.pixelFormat=6403;break;case d.H0.R8I:case d.H0.R8UI:case d.H0.R16I:case d.H0.R16UI:case d.H0.R32I:case d.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new b(e,t)}}const y=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),M=()=>o.A.getLogger("esri/views/webgl/Texture");class T{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=b.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return y?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(d.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!v(e)&&this._descriptor.internalFormat&&(0,s.a4)(d.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!v(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(e,t,r,n,o,a,s=0){a||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=w(l);const{context:c,pixelFormat:d,dataType:u,target:h,isImmutable:m}=l;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const p=c.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||t+n>l.width||r+o>l.height)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:f}=c;s&&(n&&o||M().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),f.pixelStorei(f.UNPACK_SKIP_ROWS,s)),g(a)?f.texSubImage2D(h,e,t,r,n,o,d,u,a):v(a)?f.compressedTexSubImage2D(h,e,t,r,n,o,l.internalFormat,a.levels[e]):f.texSubImage2D(h,e,t,r,n,o,d,u,a),s&&f.pixelStorei(f.UNPACK_SKIP_ROWS,0),c.bindTexture(p,T.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,n,o,a,s,l){l||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update an uninitialized texture!");const c=this._descriptor;c.internalFormat=w(c);const{context:d,pixelFormat:u,dataType:h,isImmutable:m,target:p}=c;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");_(p)||M().warn("Attempting to set 3D texture data on a non-3D texture");const f=d.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||n<0||t+o>c.width||r+a>c.height||n+s>c.depth)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:g}=d;if(v(l))l=l.levels[e],g.compressedTexSubImage3D(p,e,t,r,n,o,a,s,c.internalFormat,l);else{const i=l;g.texSubImage3D(p,e,t,r,n,o,a,s,u,h,i)}d.bindTexture(f,T.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,m(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const t=this._descriptor.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,T.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,m(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),m(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,a.DC)(this._compressionAbortController)}_setData(e,t){const r=this._descriptor,n=r.context?.gl;if(!n)return;(0,c.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),r.context.instanceCounter.increment(d.vt.Texture,this)),m(r);const o=r.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,c.Y2)(n);const a=t??r.target,l=_(a);if(g(e))this._setDataFromTexImageSource(e,a);else{const{width:t,height:o,depth:u}=r;if(null==t||null==o)throw new i.A("texture:missing-size","Width and height must be specified!");if(l&&null==u)throw new i.A("texture:missing-depth","Depth must be specified!");if(r.internalFormat=w(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,r.internalFormat,r.hasMipmap,t,o,u),v(e)){if(!function(e){return null!=e&&(0,s.a4)(d.CQ,e)}(r.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,a)}else this._texImage(a,0,r.internalFormat,t,o,u,e),(0,c.Y2)(n),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(n),r.context.bindTexture(o,T.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=w(i);const n=_(t),{width:o,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=a),n&&i.depth,n&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,a,s),this._texImage(t,0,i.internalFormat,o,a,s,e),(0,c.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,c.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:a}=i,s=e.levels,l=x(r,n,o,a),c=Math.min(l,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,c),this._forEachMipmapLevel((e,i,n,o)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,n,o,a)},c)}_texStorage(e,t,r,n,o,a){const{gl:s}=this._descriptor.context;if(!function(e){return d.XN.includes(e)}(t)&&!p(t)&&!f(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?x(e,n,o,a):1;if(_(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,n,o,a)}else s.texStorage2D(e,l,t,n,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,o,a,s){const l=this._descriptor.context.gl,c=_(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,n,o,a,u,h,r)}else l.texSubImage2D(e,t,0,0,n,o,u,h,r)}}else{const d=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,n,o,a,0,u,h,d)}else l.texImage2D(e,t,r,n,o,0,u,h,d)}}_compressedTexImage(e,t,r,n,o,a,s){const l=this._descriptor.context.gl,c=_(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,n,o,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,n,o,r,s)}else if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,n,o,a,0,s)}else l.compressedTexImage2D(e,t,r,n,o,0,s)}async _compressOnWorker(e){const{width:t,height:r,context:i,flipped:n,preMultiplyAlpha:o,hasMipmap:a}=this._descriptor,s=this._descriptor.compress?.compressionTracker,c=this._descriptor.compress?.compressionCallback,{compressedTextureETC:d,compressedTextureS3TC:u}=i.capabilities;if(!T.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!d&&!u)return;this.abortCompression();const h=new AbortController;let m;this._compressionAbortController=h,s?.increment();try{e instanceof Uint8Array?m=e.buffer:(m=await createImageBitmap(e,{imageOrientation:n?"flipY":"none"}),(0,l.Te)(h));const i={data:m,width:t,height:r,needsFlip:e instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:o,hasMipmap:a,hasETC:!!d,hasS3TC:!!u},s=await T.compressionWorkerHandle.invoke(i,h.signal,1);if((0,l.Te)(h),s.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=s.internalFormat,this._setData(s.compressedTexture),c?.(e-this.usedMemory)}}catch(e){(0,l.zf)(e)||M().error("Texture compression failed!")}finally{s?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),m instanceof ImageBitmap&&m.close()}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:o,hasMipmap:a,target:s}=this._descriptor;const l=32879===s;if(null==r||null==n||l&&null==o)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,n,o),a&&(1!==r||1!==n||l&&1!==o)&&!(i>=t);++i)r=Math.max(1,r>>1),n=Math.max(1,n>>1),l&&(o=Math.max(1,o>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,c.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},76597:(e,t,r)=>{r.d(t,{d:()=>o});var i=r(33120),n=r(31821);function o(e){(0,i.i$)(e),e.vertex.code.add(n.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
|
|
784
789
|
vec4 eye = view * vec4(pos, 1.0);
|
|
785
790
|
depth = calculateLinearDepth(nearFar,eye.z);
|
|
786
791
|
return proj * eye;
|
|
787
|
-
}`),e.vertex.code.add(
|
|
792
|
+
}`),e.vertex.code.add(n.H`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
|
|
788
793
|
return proj * (view * vec4(pos, 1.0));
|
|
789
|
-
}`)}},77108:(e,t,r)=>{r.d(t,{E:()=>
|
|
794
|
+
}`)}},77108:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",0,(i,n)=>i.setUniform2fv(e,t(n),r))}}},77194:(e,t,r)=>{r.d(t,{PS:()=>n,fc:()=>o}),r(44208);var i=r(34727);class n{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(e,t,r,i){r?(this._scale=Math.min(r.divisor/(t-r.offset),1),this._angleFactor=function(e){return Math.abs(e)**3}(e),this._minScale=null!=i?Math.min(r.minPixelSize/i,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(e){const{_scale:t,_angleFactor:r,_minScale:n}=this;return e*(0,i.qE)((0,i.Cc)(t,1,r),n,1)}applyVec2(e,t){e[0]=this.apply(t[0]),e[1]=this.apply(t[1])}}class o{constructor(){this.evaluator=new n,this.alignmentEvaluator=new n}update(e,t,r,i,n,o){this.evaluator.update(e,t,r,i),this.alignmentEvaluator.update(e,t,n??r,(n?o:null)??i)}}},77695:(e,t,r)=>{r.d(t,{J:()=>h});var i=r(29242),n=r(48163),o=r(99208),a=r(68259),s=r(47286),l=r(31821),c=r(35644),d=r(15976),u=r(63761);function h(e,t){return function(e,t){const r=e.fragment,{hasVertexTangents:h,doubleSidedMode:m,hasNormalTexture:p,textureCoordinateType:f,bindType:v,hasNormalTextureTransform:g}=t;h?(e.attributes.add("tangent","vec4"),e.varyings.add("vTangent","vec4"),2===m?r.code.add(l.H`mat3 computeTangentSpace(vec3 normal) {
|
|
790
795
|
float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
|
|
791
796
|
vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
|
|
792
797
|
vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
|
|
@@ -807,18 +812,18 @@ T = T - normal * dot(normal, T);
|
|
|
807
812
|
T *= inversesqrt(max(dot(T,T), 1.e-10));
|
|
808
813
|
vec3 B = sign(det) * cross(normal, T);
|
|
809
814
|
return mat3(T, B, normal);
|
|
810
|
-
}`),p&&0!==f&&(e.include(
|
|
815
|
+
}`),p&&0!==f&&(e.include(o.r,t),r.uniforms.add(1===v?new u.N("normalTexture",e=>e.textureNormal):new d.o("normalTexture",e=>e.textureNormal)),g&&(r.uniforms.add(1===v?new s.G("scale",e=>e.scale??n.Un):new a.t("scale",e=>e.scale??n.Un)),r.uniforms.add(new c.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK))),r.code.add(l.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
|
|
811
816
|
vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),g&&r.code.add(l.H`mat3 normalRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0,
|
|
812
817
|
normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
|
|
813
818
|
0.0, 0.0, 0.0 );
|
|
814
819
|
rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(l.H`return tangentSpace * rawNormal;
|
|
815
|
-
}`))}(e,t)}},78662:(e,t,r)=>{r.d(t,{Gd:()=>l,VC:()=>c});var i=r(34727),
|
|
820
|
+
}`))}(e,t)}},78662:(e,t,r)=>{r.d(t,{Gd:()=>l,VC:()=>c});var i=r(34727),n=(r(77690),r(29242),r(58083),r(9093)),o=r(38954),a=r(51850),s=(r(87317),r(91829),r(31756),r(26857),r(16943),r(65786));class l extends s.Y{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}function c(e,t,r){if(!t.vvSize)return(0,o.h)(e,1,1,1),e;if(Number.isNaN(r[0]))return(0,o.d)(e,t.vvSize.fallback);for(let n=0;n<3;++n){const o=t.vvSize.offset[n]+r[0]*t.vvSize.factor[n];e[n]=(0,i.qE)(o,t.vvSize.minSize[n],t.vvSize.maxSize[n])}return e}(0,n.vt)(),(0,a.vt)(),(0,n.vt)()},78754:(e,t,r)=>{r.d(t,{F:()=>o});var i=r(24326),n=r(97146);class o{constructor(e){this.id=(0,i.c)(),this._attributes=new Map;for(const[t,r]of e)this._attributes.set(t,{...r,indices:(0,n.Dg)(r.indices)})}get attributes(){return this._attributes}}},82048:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(31821);function n(e,t=!0){e.attributes.add("position","vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(i.H`
|
|
816
821
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
817
822
|
${t?i.H`uv = position * 0.5 + vec2(0.5);`:""}
|
|
818
|
-
`)}},87170:(e,t,r)=>{r.d(t,{V:()=>T});var i=r(9093),
|
|
823
|
+
`)}},87170:(e,t,r)=>{r.d(t,{V:()=>T});var i=r(9093),n=r(38954),o=r(97146),a=r(57917),s=r(29920),l=r(78754),c=r(51850),d=r(4341),u=r(11964);function h(e,t,r){return(0,n.e)(m,t,e),(0,n.e)(p,r,e),.5*(0,n.b)((0,n.f)(m,m,p))}r(32114),new d.I(u.vt),new d.I(()=>function(e){return e?{p0:(0,c.o8)(e.p0),p1:(0,c.o8)(e.p1),p2:(0,c.o8)(e.p2)}:{p0:(0,c.vt)(),p1:(0,c.vt)(),p2:(0,c.vt)()}}());const m=(0,c.vt)(),p=(0,c.vt)(),f=(0,c.vt)(),v=(0,c.vt)(),g=(0,c.vt)(),_=(0,c.vt)();var x=r(24326);class w{constructor(){this.uid=(0,x.c)()}}class b extends w{constructor(e){super(),this.highlightName=e,this.channel=0}}var y=r(620),M=r(94656);class T extends l.F{constructor(e,t,r=null,i=0,n=null,o=-1,a){super(t),this.material=e,this.mapPositions=r,this.type=i,this.olidColor=n,this.edgeIndicesLength=o,this.baseGeometry=a,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null;const s=this.positionAttribute;null!=s&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=s.indices.length)}instantiate(e={}){const t=new T(e.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,a.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,M.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,n.p)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:o}=e;(0,n.h)(t,0,0,0),(0,n.h)(_,0,0,0);let a=0,s=0;for(let e=0;e<o.length-2;e+=3){const l=o[e]*r,c=o[e+1]*r,d=o[e+2]*r;(0,n.h)(f,i[l],i[l+1],i[l+2]),(0,n.h)(v,i[c],i[c+1],i[c+2]),(0,n.h)(g,i[d],i[d+1],i[d+2]);const u=h(f,v,g);u?((0,n.i)(f,f,v),(0,n.i)(f,f,g),(0,n.j)(f,f,1/3*u),(0,n.i)(t,t,f),a+=u):((0,n.i)(_,_,f),(0,n.i)(_,_,v),(0,n.i)(_,_,g),s+=3)}return!(0===s&&0===a||(0!==a?((0,n.j)(t,t,1/a),0):0===s||((0,n.j)(t,_,1/s),0)))}(this.positionAttribute,e)}_computeAttachmentOriginLines(e){const t=this.positionAttribute;return function(e,t,r){if(!e)return!1;(0,n.h)(r,0,0,0),(0,n.h)(_,0,0,0);let i=0,o=0;const{size:a,data:s,indices:l}=e,c=l.length-1,d=c+(t?2:0);for(let e=0;e<d;e+=2){const t=e<c?e+1:0,d=l[e<c?e:c]*a,u=l[t]*a;f[0]=s[d],f[1]=s[d+1],f[2]=s[d+2],v[0]=s[u],v[1]=s[u+1],v[2]=s[u+2],(0,n.j)(f,(0,n.i)(f,f,v),.5);const h=(0,n.F)(f,v);h>0?((0,n.i)(r,r,(0,n.j)(f,f,h)),i+=h):0===i&&((0,n.i)(_,_,f),o++)}return 0!==i?((0,n.j)(r,r,1/i),!0):0!==o&&((0,n.j)(r,_,1/o),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:o}=e;(0,n.h)(t,0,0,0);let a=-1,s=0;for(let e=0;e<o.length;e++){const n=o[e]*r;a!==n&&(t[0]+=i[n],t[1]+=i[n+1],t[2]+=i[n+2],s++),a=n}return s>1&&(0,n.j)(t,t,1/s),s>0}(this.positionAttribute,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.positionAttribute;if(!e||0===e.indices.length)return null;const t=0===this.type?3:1;(0,y.vA)(e.indices.length%t===0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,o.tM)(e.indices.length/t);return new s.j(r,t,e)}get transformation(){return this._transformation??i.zK}set transformation(e){this._transformation=e&&e!==i.zK?(0,i.o8)(e):null}get highlights(){return this._highlights||C}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new b(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const C=new Set},89390:(e,t,r)=>{r.d(t,{kA:()=>C,a8:()=>M,eU:()=>T});var i=r(38954),n=r(51850),o=r(87317),a=r(91829),s=r(23205),l=r(14314),c=r(31821);function d(e,t){const r=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===r?(e.uniforms.add(new s.d("lightingAmbientSH0",({lighting:e})=>(0,i.h)(u,e.sh.r[0],e.sh.g[0],e.sh.b[0]))),e.code.add(c.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
819
824
|
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
|
|
820
825
|
return ambientLight * (1.0 - ambientOcclusion);
|
|
821
|
-
}`)):1===r?(e.uniforms.add(new
|
|
826
|
+
}`)):1===r?(e.uniforms.add(new l.I("lightingAmbientSH_R",({lighting:e})=>(0,o.c)(h,e.sh.r[0],e.sh.r[1],e.sh.r[2],e.sh.r[3])),new l.I("lightingAmbientSH_G",({lighting:e})=>(0,o.c)(h,e.sh.g[0],e.sh.g[1],e.sh.g[2],e.sh.g[3])),new l.I("lightingAmbientSH_B",({lighting:e})=>(0,o.c)(h,e.sh.b[0],e.sh.b[1],e.sh.b[2],e.sh.b[3]))),e.code.add(c.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
822
827
|
vec4 sh0 = vec4(
|
|
823
828
|
0.282095,
|
|
824
829
|
0.488603 * normal.x,
|
|
@@ -831,7 +836,7 @@ dot(lightingAmbientSH_G, sh0),
|
|
|
831
836
|
dot(lightingAmbientSH_B, sh0)
|
|
832
837
|
);
|
|
833
838
|
return ambientLight * (1.0 - ambientOcclusion);
|
|
834
|
-
}`)):2===r&&(e.uniforms.add(new
|
|
839
|
+
}`)):2===r&&(e.uniforms.add(new s.d("lightingAmbientSH0",({lighting:e})=>(0,i.h)(u,e.sh.r[0],e.sh.g[0],e.sh.b[0])),new l.I("lightingAmbientSH_R1",({lighting:e})=>(0,o.c)(h,e.sh.r[1],e.sh.r[2],e.sh.r[3],e.sh.r[4])),new l.I("lightingAmbientSH_G1",({lighting:e})=>(0,o.c)(h,e.sh.g[1],e.sh.g[2],e.sh.g[3],e.sh.g[4])),new l.I("lightingAmbientSH_B1",({lighting:e})=>(0,o.c)(h,e.sh.b[1],e.sh.b[2],e.sh.b[3],e.sh.b[4])),new l.I("lightingAmbientSH_R2",({lighting:e})=>(0,o.c)(h,e.sh.r[5],e.sh.r[6],e.sh.r[7],e.sh.r[8])),new l.I("lightingAmbientSH_G2",({lighting:e})=>(0,o.c)(h,e.sh.g[5],e.sh.g[6],e.sh.g[7],e.sh.g[8])),new l.I("lightingAmbientSH_B2",({lighting:e})=>(0,o.c)(h,e.sh.b[5],e.sh.b[6],e.sh.b[7],e.sh.b[8]))),e.code.add(c.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
835
840
|
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
|
|
836
841
|
vec4 sh1 = vec4(
|
|
837
842
|
0.488603 * normal.x,
|
|
@@ -856,19 +861,19 @@ dot(lightingAmbientSH_G2, sh2),
|
|
|
856
861
|
dot(lightingAmbientSH_B2, sh2)
|
|
857
862
|
);
|
|
858
863
|
return ambientLight * (1.0 - ambientOcclusion);
|
|
859
|
-
}`),1!==t.pbrMode&&2!==t.pbrMode||e.code.add(
|
|
864
|
+
}`),1!==t.pbrMode&&2!==t.pbrMode||e.code.add(c.H`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
|
|
860
865
|
vec3 calculateAmbientRadiance(float ambientOcclusion)
|
|
861
866
|
{
|
|
862
867
|
vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
|
|
863
868
|
return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
|
|
864
|
-
}`))}const
|
|
869
|
+
}`))}const u=(0,n.vt)(),h=(0,a.vt)();var m=r(14527),p=r(65261),f=r(98619),v=r(22393),g=r(89786),_=r(32976),x=r(33094);r(34727),(0,n.vt)();const w=.4;function b(e){e.code.add(c.H`float mapChannel(float x, vec2 p) {
|
|
865
870
|
return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
|
|
866
|
-
}`),e.code.add(
|
|
871
|
+
}`),e.code.add(c.H`vec3 blackLevelSoftCompression(vec3 color, float averageAmbientRadiance) {
|
|
867
872
|
vec2 p = vec2(0.02, 0.0075) * averageAmbientRadiance;
|
|
868
873
|
return vec3(mapChannel(color.x, p), mapChannel(color.y, p), mapChannel(color.z, p));
|
|
869
|
-
}`)}function y(e){e.code.add(
|
|
874
|
+
}`)}function y(e){e.code.add(c.H`vec3 tonemapACES(vec3 x) {
|
|
870
875
|
return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
|
|
871
|
-
}`),e.code.add(
|
|
876
|
+
}`),e.code.add(c.H`vec3 tonemapKhronosNeutral(vec3 color, float exposure) {
|
|
872
877
|
const float startCompression = 0.76;
|
|
873
878
|
const float desaturation = 0.15;
|
|
874
879
|
color *= exposure;
|
|
@@ -884,31 +889,29 @@ float newPeak = 1.0 - d * d / ( peak + d - startCompression );
|
|
|
884
889
|
color *= newPeak / peak;
|
|
885
890
|
float g = 1.0 - 1.0 / ( desaturation * ( peak - newPeak ) + 1.0 );
|
|
886
891
|
return mix( color, vec3( newPeak ), g );
|
|
887
|
-
}`)}function M(e){e.constants.add("ambientBoostFactor","float",w)}function T(e){e.uniforms.add(new x.U("lightingGlobalFactor",e=>e.lighting.globalFactor))}function C(e,t){const{pbrMode:r,spherical:
|
|
888
|
-
const float
|
|
889
|
-
|
|
890
|
-
${(0,d.If)(0!==r,"const float GROUND_REFLECTANCE = 0.2;")}
|
|
891
|
-
`),M(e),T(e),(0,f.Gc)(e),e.code.add(d.H`
|
|
892
|
+
}`)}function M(e){e.constants.add("ambientBoostFactor","float",w)}function T(e){e.uniforms.add(new x.U("lightingGlobalFactor",e=>e.lighting.globalFactor))}function C(e,t){const{pbrMode:r,spherical:i,hasColorTexture:n}=t;e.include(m.n,t),0!==r&&e.include(v.c,t),e.include(d,t),e.include(g.p),e.include(y,t),e.include(p.C);const o=!(2===r&&!n);switch(o&&e.include(b),e.code.add(c.H`
|
|
893
|
+
${(0,c.If)(0!==r,"const float GROUND_REFLECTANCE = 0.2;")}
|
|
894
|
+
`),M(e),T(e),(0,f.Gc)(e),e.code.add(c.H`
|
|
892
895
|
float additionalDirectedAmbientLight(float lightAlignment) {
|
|
893
896
|
return smoothstep(0.0, 1.0, clamp(lightAlignment * 2.5, 0.0, 1.0));
|
|
894
897
|
}
|
|
895
898
|
|
|
896
899
|
float additionalDirectedAmbientLight(vec3 vPosWorld) {
|
|
897
|
-
float lightAlignment = dot(${
|
|
900
|
+
float lightAlignment = dot(${i?c.H`normalize(vPosWorld)`:c.H`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
|
|
898
901
|
return smoothstep(0.0, 1.0, clamp(lightAlignment * 2.5, 0.0, 1.0));
|
|
899
902
|
}
|
|
900
|
-
`),(0,f.O4)(e),e.code.add(
|
|
903
|
+
`),(0,f.O4)(e),e.code.add(c.H`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
|
|
901
904
|
float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
|
|
902
905
|
return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
|
|
903
|
-
}`),r){case 0:case 4:case 3:e.include(f.Vt),e.code.add(
|
|
906
|
+
}`),r){case 0:case 4:case 3:e.include(f.Vt),e.code.add(c.H`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight) {
|
|
904
907
|
vec3 mainLighting = applyShading(normalWorld, shadow);
|
|
905
908
|
vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
|
|
906
|
-
vec3 albedoLinear =
|
|
909
|
+
vec3 albedoLinear = linearizeGamma(albedo);
|
|
907
910
|
vec3 totalLight = mainLighting + ambientLighting + additionalLight;
|
|
908
911
|
totalLight = min(totalLight, vec3(PI));
|
|
909
912
|
vec3 outColor = vec3((albedoLinear / PI) * totalLight);
|
|
910
|
-
return
|
|
911
|
-
}`);break;case 1:case 2:e.code.add(
|
|
913
|
+
return delinearizeGamma(outColor);
|
|
914
|
+
}`);break;case 1:case 2:e.code.add(c.H`const float fillLightIntensity = 0.25;
|
|
912
915
|
const float horizonLightDiffusion = 0.4;
|
|
913
916
|
const float additionalAmbientIrradianceFactor = 0.02;
|
|
914
917
|
vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight,
|
|
@@ -920,12 +923,12 @@ inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0);
|
|
|
920
923
|
inputs.NdotNG = clamp(dot(normal, groundNormal), -1.0, 1.0);
|
|
921
924
|
vec3 reflectedView = normalize(reflect(viewDirection, normal));
|
|
922
925
|
inputs.RdotNG = clamp(dot(reflectedView, groundNormal), -1.0, 1.0);
|
|
923
|
-
inputs.albedoLinear =
|
|
926
|
+
inputs.albedoLinear = linearizeGamma(albedo);
|
|
924
927
|
inputs.ssao = ssao;
|
|
925
928
|
inputs.metalness = mrr[0];
|
|
926
|
-
inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),e.code.add(
|
|
929
|
+
inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),e.code.add(c.H`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
|
|
927
930
|
inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
|
|
928
|
-
inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?e.uniforms.add(new _.o("hasFillLights",e=>e.enableFillLights)):e.constants.add("hasFillLights","bool",!1),e.code.add(
|
|
931
|
+
inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?e.uniforms.add(new _.o("hasFillLights",e=>e.enableFillLights)):e.constants.add("hasFillLights","bool",!1),e.code.add(c.H`vec3 ambientDir = vec3(5.0 * groundNormal[1] - groundNormal[0] * groundNormal[2], - 5.0 * groundNormal[0] - groundNormal[2] * groundNormal[1], groundNormal[1] * groundNormal[1] + groundNormal[0] * groundNormal[0]);
|
|
929
932
|
ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
|
|
930
933
|
inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
|
|
931
934
|
float NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);
|
|
@@ -933,7 +936,7 @@ vec3 mainLightIrradianceComponent = NdotL * (1.0 - shadow) * mainLightIntensity;
|
|
|
933
936
|
vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
|
|
934
937
|
vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
|
|
935
938
|
inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
|
|
936
|
-
inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),e.uniforms.add(new x.U("lightingSpecularStrength",e=>e.lighting.mainLight.specularStrength),new x.U("lightingEnvironmentStrength",e=>e.lighting.mainLight.environmentStrength)).code.add(
|
|
939
|
+
inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),e.uniforms.add(new x.U("lightingSpecularStrength",e=>e.lighting.mainLight.specularStrength),new x.U("lightingEnvironmentStrength",e=>e.lighting.mainLight.environmentStrength)).code.add(c.H`vec3 horizonRingDir = inputs.RdotNG * groundNormal - reflectedView;
|
|
937
940
|
vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
|
|
938
941
|
inputs.NdotH_Horizon = dot(normal, horizonRingH);
|
|
939
942
|
float NdotH = clamp(dot(normal, h), 0.0, 1.0);
|
|
@@ -943,14 +946,14 @@ vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbi
|
|
|
943
946
|
float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotNG + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0));
|
|
944
947
|
inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
|
|
945
948
|
inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
|
|
946
|
-
inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE);`),e.code.add(
|
|
949
|
+
inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE);`),e.code.add(c.H`
|
|
947
950
|
vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
|
|
948
951
|
vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
|
|
949
952
|
vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent;
|
|
950
|
-
${
|
|
951
|
-
return outColor;
|
|
953
|
+
${o?c.H`vec3 outColor = blackLevelSoftCompression(outColorLinear, inputs.averageAmbientRadiance);`:c.H`vec3 outColor = max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance);`}
|
|
954
|
+
return delinearizeGamma(outColor);
|
|
952
955
|
}
|
|
953
|
-
`);break;case 5:case 6:(0,f.Gc)(e),(0,f.O4)(e),e.code.add(
|
|
956
|
+
`);break;case 5:case 6:(0,f.Gc)(e),(0,f.O4)(e),e.code.add(c.H`const float roughnessTerrain = 0.5;
|
|
954
957
|
const float specularityTerrain = 0.5;
|
|
955
958
|
const vec3 fresnelReflectionTerrain = vec3(0.04);
|
|
956
959
|
vec3 evaluatePBRSimplifiedLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) {
|
|
@@ -960,7 +963,7 @@ float NdotL = clamp(dot(n, mainLightDirection), 0.001, 1.0);
|
|
|
960
963
|
float NdotV = clamp(abs(dot(n, viewDirection)), 0.001, 1.0);
|
|
961
964
|
float NdotH = clamp(dot(n, h), 0.0, 1.0);
|
|
962
965
|
float NdotNG = clamp(dot(n, nup), -1.0, 1.0);
|
|
963
|
-
vec3 albedoLinear =
|
|
966
|
+
vec3 albedoLinear = linearizeGamma(c);
|
|
964
967
|
float lightness = 0.3 * albedoLinear[0] + 0.5 * albedoLinear[1] + 0.2 * albedoLinear[2];
|
|
965
968
|
vec3 f0 = (0.85 * lightness + 0.15) * fresnelReflectionTerrain;
|
|
966
969
|
vec3 f90 = vec3(clamp(dot(f0, vec3(50.0 * 0.33)), 0.0, 1.0));
|
|
@@ -974,12 +977,12 @@ vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, NdotV);
|
|
|
974
977
|
vec3 specularColor = f0 * dfg.x + f90 * dfg.y;
|
|
975
978
|
vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent;
|
|
976
979
|
vec3 outColorLinear = outDiffColor + specularComponent;
|
|
977
|
-
vec3 outColor =
|
|
980
|
+
vec3 outColor = delinearizeGamma(outColorLinear);
|
|
978
981
|
return outColor;
|
|
979
|
-
}`)}}(0,n.vt)()},89786:(e,t,r)=>{function i(e){const t=.3183098861837907;e.constants.add("PI","float",3.141592653589793),e.constants.add("LIGHT_NORMALIZATION","float",t),e.constants.add("INV_PI","float",t),e.constants.add("ONE_QUATER_PI","float",.78539816339745),e.constants.add("HALF_PI","float",1.570796326794897),e.constants.add("THREE_QUATER_PI","float",2.35619449019234),e.constants.add("TWO_PI","float",6.28318530717958),e.constants.add("PI_SQUARED","float",9.86960440108936)}r.d(t,{p:()=>i})},90644:(e,t,r)=>{function i(e,t,r=32774,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function
|
|
982
|
+
}`)}}(0,n.vt)()},89786:(e,t,r)=>{function i(e){const t=.3183098861837907;e.constants.add("PI","float",3.141592653589793),e.constants.add("LIGHT_NORMALIZATION","float",t),e.constants.add("INV_PI","float",t),e.constants.add("ONE_QUATER_PI","float",.78539816339745),e.constants.add("HALF_PI","float",1.570796326794897),e.constants.add("THREE_QUATER_PI","float",2.35619449019234),e.constants.add("TWO_PI","float",6.28318530717958),e.constants.add("PI_SQUARED","float",9.86960440108936)}r.d(t,{p:()=>i})},90644:(e,t,r)=>{function i(e,t,r=32774,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function n(e,t,r,i,n=32774,o=32774,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}r.d(t,{Ey:()=>b,RC:()=>o,T8:()=>a,Uy:()=>d,Xt:()=>c,kn:()=>u,p3:()=>n}),i(0,771),i(1,0),i(1,1);const o=i(1,771),a=n(770,1,771,771),s=(n(0,0,768,1),{face:1029,mode:2305}),l={face:1028,mode:2305},c=e=>2===e?s:1===e?l:null,d={zNear:0,zFar:1},u={r:!0,g:!0,b:!0,a:!0};function h(e){return T.intern(e)}function m(e){return S.intern(e)}function p(e){return A.intern(e)}function f(e){return R.intern(e)}function v(e){return F.intern(e)}function g(e){return D.intern(e)}function _(e){return N.intern(e)}function x(e){return L.intern(e)}function w(e){return V.intern(e)}function b(e){return G.intern(e)}class y{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function M(e){return"["+e.join(",")+"]"}const T=new y(C,e=>({__tag:"Blending",...e}));function C(e){return e?M([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const S=new y(E,e=>({__tag:"Culling",...e}));function E(e){return e?M([e.face,e.mode]):null}const A=new y(I,e=>({__tag:"PolygonOffset",...e}));function I(e){return e?M([e.factor,e.units]):null}const R=new y(O,e=>({__tag:"DepthTest",...e}));function O(e){return e?M([e.func]):null}const F=new y(P,e=>({__tag:"StencilTest",...e}));function P(e){return e?M([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const D=new y(H,e=>({__tag:"DepthWrite",...e}));function H(e){return e?M([e.zNear,e.zFar]):null}const N=new y(z,e=>({__tag:"ColorWrite",...e}));function z(e){return e?M([e.r,e.g,e.b,e.a]):null}const L=new y(B,e=>({__tag:"StencilWrite",...e}));function B(e){return e?M([e.mask]):null}const V=new y(U,e=>({__tag:"DrawBuffers",...e}));function U(e){return e?M(e.buffers):null}const G=new y(function(e){return e?M([C(e.blending),E(e.culling),I(e.polygonOffset),O(e.depthTest),P(e.stencilTest),H(e.depthWrite),z(e.colorWrite),B(e.stencilWrite),U(e.drawBuffers)]):null},e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:p(e.polygonOffset),depthTest:f(e.depthTest),stencilTest:v(e.stencilTest),depthWrite:g(e.depthWrite),colorWrite:_(e.colorWrite),stencilWrite:x(e.stencilWrite),drawBuffers:w(e.drawBuffers)}))},92700:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(31821);function n(e,t){t.hasVertexColors?(e.attributes.add("color","vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.H`
|
|
980
983
|
void forwardNormalizedVertexColor() { vColor = color * ${i.H.float(1/255)}; }
|
|
981
984
|
`)):e.vertex.code.add(i.H`void forwardVertexColor() {}
|
|
982
|
-
void forwardNormalizedVertexColor() {}`)}},94656:(e,t,r)=>{r.d(t,{Y2:()=>c,en:()=>l});var i=r(49186),
|
|
985
|
+
void forwardNormalizedVertexColor() {}`)}},94656:(e,t,r)=>{r.d(t,{Y2:()=>c,en:()=>l});var i=r(49186),n=r(44208),o=r(53966);const a=()=>o.A.getLogger("esri.views.webgl.checkWebGLError"),s=!!(0,n.A)("enable-feature:webgl-debug");function l(){return s}function c(e,t=l()){if(t){const t=function(e){switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e);if(t){const e=(new Error).stack;a().error(new i.A("webgl-error","WebGL error occurred",{message:t,stack:e}))}}}},95774:(e,t,r)=>{r.d(t,{S:()=>m,b:()=>h});var i=r(82048),n=r(52540),o=r(68259),a=r(20304),s=r(31821),l=r(15976),c=r(63761),d=r(14113);const u=4;function h(){const e=new d.N5,t=e.fragment;e.include(i.c);const r=(u+1)/2,h=1/(2*r*r);return t.include(n.E),t.uniforms.add(new c.N("depthMap",e=>e.depthTexture),new l.o("tex",e=>e.colorTexture),new o.t("blurSize",e=>e.blurSize),new a.m("projScale",(e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),t.code.add(s.H`
|
|
983
986
|
void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
|
|
984
987
|
float c = texture(tex, uv).r;
|
|
985
988
|
float d = linearDepthFromTexture(depthMap, uv);
|
|
@@ -1002,7 +1005,7 @@ void forwardNormalizedVertexColor() {}`)}},94656:(e,t,r)=>{r.d(t,{Y2:()=>c,en:()
|
|
|
1002
1005
|
vec2 uvOffset = uv + rf * blurSize;
|
|
1003
1006
|
blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
|
|
1004
1007
|
}
|
|
1005
|
-
fragBlur = b / w_total;`),e}const m=Object.freeze(Object.defineProperty({__proto__:null,build:h},Symbol.toStringTag,{value:"Module"}))},96336:(e,t,r)=>{r.d(t,{Y:()=>
|
|
1008
|
+
fragBlur = b / w_total;`),e}const m=Object.freeze(Object.defineProperty({__proto__:null,build:h},Symbol.toStringTag,{value:"Module"}))},96336:(e,t,r)=>{r.d(t,{Y:()=>n});var i=r(31821);function n(e,t){switch(e.fragment.code.add(i.H`vec3 screenDerivativeNormal(vec3 positionView) {
|
|
1006
1009
|
return normalize(cross(dFdx(positionView), dFdy(positionView)));
|
|
1007
1010
|
}`),t.normalType){case 1:e.attributes.add("normalCompressed","vec2"),e.vertex.code.add(i.H`vec3 decompressNormal(vec2 normal) {
|
|
1008
1011
|
float z = 1.0 - abs(normal.x) - abs(normal.y);
|
|
@@ -1012,23 +1015,23 @@ vec3 normalModel() {
|
|
|
1012
1015
|
return decompressNormal(normalCompressed);
|
|
1013
1016
|
}`);break;case 0:e.attributes.add("normal","vec3"),e.vertex.code.add(i.H`vec3 normalModel() {
|
|
1014
1017
|
return normal;
|
|
1015
|
-
}`);break;default:t.normalType;case 2:case 3:}}},96598:(e,t,r)=>{r.d(t,{Z:()=>a});var i=r(52540),
|
|
1018
|
+
}`);break;default:t.normalType;case 2:case 3:}}},96598:(e,t,r)=>{r.d(t,{Z:()=>a});var i=r(52540),n=r(31821),o=r(12791);function a(e,{occlusionPass:t,terrainDepthTest:r,cullAboveTerrain:a}){const{vertex:s,fragment:l,varyings:c}=e;if(!r)return s.code.add("void forwardViewPosDepth(vec3 pos) {}"),void l.code.add(`${t?"bool":"void"} discardByTerrainDepth() { ${(0,n.If)(t,"return false;")}}`);c.add("viewPosDepth","float",{invariant:!0}),s.code.add("void forwardViewPosDepth(vec3 pos) {\n viewPosDepth = pos.z;\n }"),l.include(i.E),l.uniforms.add(new o.x("terrainDepthTexture",e=>e.terrainDepth?.attachment)).code.add(n.H`
|
|
1016
1019
|
${t?"bool":"void"} discardByTerrainDepth() {
|
|
1017
1020
|
float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r;
|
|
1018
1021
|
float linearDepth = linearizeDepth(depth);
|
|
1019
1022
|
${t?"return viewPosDepth < linearDepth && depth < 1.0;":`if(viewPosDepth ${a?">":"<="} linearDepth) discard;`}
|
|
1020
|
-
}`)}},98353:(e,t,r)=>{r.d(t,{h:()=>
|
|
1023
|
+
}`)}},98353:(e,t,r)=>{r.d(t,{h:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat3",2,(i,n,o)=>i.setUniformMatrix3fv(e,t(n,o),r))}}},98619:(e,t,r)=>{r.d(t,{Gc:()=>o,O4:()=>a,Vt:()=>s});var i=r(23205),n=r(31821);function o(e){e.uniforms.add(new i.d("mainLightDirection",e=>e.lighting.mainLight.direction))}function a(e){e.uniforms.add(new i.d("mainLightIntensity",e=>e.lighting.mainLight.intensity))}function s(e){o(e),a(e),e.code.add(n.H`vec3 applyShading(vec3 shadingNormal, float shadow) {
|
|
1021
1024
|
float dotVal = clamp(dot(shadingNormal, mainLightDirection), 0.0, 1.0);
|
|
1022
1025
|
return mainLightIntensity * ((1.0 - shadow) * dotVal);
|
|
1023
|
-
}`)}},99208:(e,t,r)=>{r.d(t,{r:()=>a});var i=r(53466),
|
|
1026
|
+
}`)}},99208:(e,t,r)=>{r.d(t,{r:()=>a});var i=r(53466),n=r(31821);function o(e){e.fragment.code.add(n.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
|
|
1024
1027
|
vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
|
|
1025
1028
|
vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
|
|
1026
1029
|
float maxdUV = 0.125;
|
|
1027
1030
|
vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
|
|
1028
1031
|
vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
|
|
1029
1032
|
return textureGrad(tex, uvAtlas, dUVdx, dUVdy);
|
|
1030
|
-
}`)}function a(e,t){const{textureCoordinateType:r}=t;if(0===r||3===r)return;e.include(i.U,t);const a=2===r;a&&e.include(
|
|
1033
|
+
}`)}function a(e,t){const{textureCoordinateType:r}=t;if(0===r||3===r)return;e.include(i.U,t);const a=2===r;a&&e.include(o),e.fragment.code.add(n.H`
|
|
1031
1034
|
vec4 textureLookup(sampler2D tex, vec2 uv) {
|
|
1032
1035
|
return ${a?"textureAtlasLookup(tex, uv, vuvRegion)":"texture(tex, uv)"};
|
|
1033
1036
|
}
|
|
1034
|
-
`)}},99550:(e,t,r)=>{r.d(t,{E:()=>a});var i=r(31635),
|
|
1037
|
+
`)}},99550:(e,t,r)=>{r.d(t,{E:()=>a});var i=r(31635),n=r(68317),o=r(51976);class a extends n.Hz{constructor(){super(...arguments),this.oitPass=0,this.hasHighlightMixTexture=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,i.Cg)([(0,o.W)({count:3})],a.prototype,"oitPass",void 0),(0,i.Cg)([(0,o.W)()],a.prototype,"hasHighlightMixTexture",void 0)}}]);
|