@arcgis/core 6.0.0-next.44 → 6.0.0-next.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Basemap.d.ts +2 -1
- package/Camera.d.ts +2 -1
- package/Graphic.d.ts +2 -1
- package/Ground.d.ts +2 -1
- package/Map.d.ts +2 -1
- package/PopupTemplate.d.ts +2 -1
- package/WebDocument2D.d.ts +2 -1
- package/WebScene.d.ts +2 -1
- package/analysis/Analysis.d.ts +2 -1
- package/analysis/DimensionSimpleStyle.d.ts +2 -1
- package/analysis/LengthDimension.d.ts +2 -1
- package/analysis/LineOfSightAnalysisObserver.d.ts +2 -1
- package/analysis/LineOfSightAnalysisTarget.d.ts +2 -1
- package/analysis/SlicePlane.d.ts +2 -1
- package/analysis/Viewshed.d.ts +2 -1
- package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +2 -1
- package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.d.ts +2 -1
- package/analysis/VolumeMeasurement/VolumeMeasurementInputUnits.d.ts +2 -1
- package/arcgisGlobal.d.ts +0 -3
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{d64054cd6865d3a1af78.js → 0ac38ca04285cd5ef1a0.js} +3 -3
- package/assets/esri/core/workers/chunks/{c420ab79d85e5dbddb0b.js → 3e67d50a2b2f8f837831.js} +1 -1
- package/assets/esri/core/workers/chunks/{0caaa03659f4f4e8df03.js → b3c0c9c91bcdbbb8e719.js} +1 -1
- package/basemapGallery/PortalBasemapsSource.d.ts +2 -1
- package/basemapGallery/support/BasemapItem.d.ts +2 -1
- package/chunks/AtmosphereCompositing.glsl.js +24 -6
- package/chunks/ChapmanAtmosphere.glsl.js +32 -25
- package/chunks/EmissionComposite.glsl.js +1 -1
- package/{portal/schemas → chunks}/definitions.js +1 -1
- package/chunks/webScene.js +2 -0
- package/config.js +1 -1
- package/core/Clonable.d.ts +2 -1
- package/core/Evented.d.ts +2 -1
- package/core/Identifiable.d.ts +2 -1
- package/core/JSONSupport.d.ts +2 -1
- package/core/Loadable.d.ts +2 -1
- package/core/MultiOriginJSONSupport.d.ts +2 -1
- package/core/Promise.d.ts +2 -1
- package/core/ReadOnlyMultiOriginJSONSupport.d.ts +2 -1
- package/editing/sharedTemplates/SharedTemplate.d.ts +2 -1
- package/effects/FocusArea.d.ts +2 -1
- package/effects/FocusAreaOutline.d.ts +2 -1
- package/effects/FocusAreas.d.ts +2 -1
- package/form/FormTemplate.d.ts +2 -1
- package/form/elements/UtilityNetworkAssociationsElement.d.ts +2 -1
- package/form/elements/inputs/attachments/Input.d.ts +2 -1
- package/geometry/Mesh.d.ts +2 -1
- package/geometry/operators/support/GeographicTransformation.d.ts +2 -1
- package/geometry/operators/support/GeographicTransformationStep.d.ts +2 -1
- package/geometry/support/MeshComponent.d.ts +2 -1
- package/geometry/support/MeshGeoreferencedVertexSpace.d.ts +2 -1
- package/geometry/support/MeshLocalVertexSpace.d.ts +2 -1
- package/geometry/support/MeshMaterial.d.ts +2 -1
- package/geometry/support/MeshTexture.d.ts +2 -1
- package/geometry/support/MeshTextureTransform.d.ts +2 -1
- package/geometry/support/MeshTransform.d.ts +2 -1
- package/geometry/support/MeshVertexAttributes.d.ts +2 -1
- package/interfaces.d.ts +0 -82
- package/kernel.js +1 -1
- package/layerList/Item.d.ts +2 -1
- package/layerList/ItemPanel.d.ts +2 -1
- package/layerList/TableItem.d.ts +2 -1
- package/layerList/TableItemPanel.d.ts +2 -1
- package/layers/AnnotationFeatureLayer.d.ts +2 -1
- package/layers/BaseDynamicLayer.d.ts +2 -1
- package/layers/BaseElevationLayer.d.ts +2 -1
- package/layers/BaseTileLayer.d.ts +2 -1
- package/layers/BingMapsLayer.d.ts +2 -1
- package/layers/BuildingSceneLayer.d.ts +2 -1
- package/layers/CSVLayer.d.ts +2 -1
- package/layers/CatalogLayer.d.ts +2 -1
- package/layers/DimensionFeatureLayer.d.ts +2 -1
- package/layers/DimensionLayer.d.ts +2 -1
- package/layers/ElevationLayer.d.ts +2 -1
- package/layers/FeatureLayer.d.ts +2 -1
- package/layers/GaussianSplatLayer.d.ts +2 -1
- package/layers/GeoJSONLayer.d.ts +2 -1
- package/layers/GeoRSSLayer.d.ts +2 -1
- package/layers/GeospatialPDFLayer.d.ts +2 -1
- package/layers/GraphicsLayer.d.ts +2 -1
- package/layers/GroupLayer.d.ts +2 -1
- package/layers/ImageryLayer.d.ts +2 -1
- package/layers/ImageryTileLayer.d.ts +2 -1
- package/layers/IntegratedMesh3DTilesLayer.d.ts +2 -1
- package/layers/IntegratedMeshLayer.d.ts +2 -1
- package/layers/KMLLayer.d.ts +2 -1
- package/layers/KnowledgeGraphLayer.d.ts +2 -1
- package/layers/Layer.d.ts +2 -1
- package/layers/LineOfSightLayer.d.ts +2 -1
- package/layers/LinkChartLayer.d.ts +2 -1
- package/layers/MapImageLayer.d.ts +2 -1
- package/layers/MapNotesLayer.d.ts +2 -1
- package/layers/MediaLayer.d.ts +2 -1
- package/layers/OGCFeatureLayer.d.ts +2 -1
- package/layers/ParquetLayer.d.ts +2 -1
- package/layers/PointCloudLayer.d.ts +2 -1
- package/layers/RouteLayer.d.ts +2 -1
- package/layers/SceneLayer.d.ts +2 -1
- package/layers/SketchLayer.d.ts +2 -1
- package/layers/StreamLayer.d.ts +2 -1
- package/layers/SubtypeGroupLayer.d.ts +2 -1
- package/layers/TileLayer.d.ts +2 -1
- package/layers/UnknownLayer.d.ts +2 -1
- package/layers/UnsupportedLayer.d.ts +2 -1
- package/layers/VectorTileLayer.d.ts +2 -1
- package/layers/VideoLayer.d.ts +2 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/ViewshedLayer.d.ts +2 -1
- package/layers/VoxelLayer.d.ts +2 -1
- package/layers/WCSLayer.d.ts +2 -1
- package/layers/WFSLayer.d.ts +3 -2
- package/layers/WMSLayer.d.ts +2 -1
- package/layers/WMTSLayer.d.ts +2 -1
- package/layers/WebTileLayer.d.ts +2 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.d.ts +2 -1
- package/layers/buildingSublayers/BuildingSublayer.d.ts +2 -1
- package/layers/catalog/CatalogDynamicGroupLayer.d.ts +2 -1
- package/layers/catalog/CatalogFootprintLayer.d.ts +2 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +2 -1
- package/layers/mixins/APIKeyMixin.d.ts +2 -1
- package/layers/mixins/ArcGISCachedService.d.ts +2 -1
- package/layers/mixins/ArcGISImageService.d.ts +2 -1
- package/layers/mixins/ArcGISMapService.d.ts +2 -1
- package/layers/mixins/BlendLayer.d.ts +2 -1
- package/layers/mixins/CustomParametersMixin.d.ts +2 -1
- package/layers/mixins/DataSeriesLayer.d.ts +2 -1
- package/layers/mixins/DisplayFilteredLayer.d.ts +2 -1
- package/layers/mixins/EditBusLayer.d.ts +2 -1
- package/layers/mixins/FeatureEffectLayer.d.ts +2 -1
- package/layers/mixins/FeatureLayerBase.d.ts +2 -1
- package/layers/mixins/FeatureReductionLayer.d.ts +2 -1
- package/layers/mixins/OperationalLayer.d.ts +2 -1
- package/layers/mixins/OrderedLayer.d.ts +2 -1
- package/layers/mixins/PortalLayer.d.ts +2 -1
- package/layers/mixins/PublishableLayer.d.ts +2 -1
- package/layers/mixins/RasterPresetRendererMixin.d.ts +2 -1
- package/layers/mixins/RefreshableLayer.d.ts +2 -1
- package/layers/mixins/ReloadableLayer.d.ts +2 -1
- package/layers/mixins/ScaleRangeLayer.d.ts +2 -1
- package/layers/mixins/SceneService.d.ts +2 -1
- package/layers/mixins/SublayersOwner.d.ts +2 -1
- package/layers/mixins/TemporalLayer.d.ts +2 -1
- package/layers/mixins/TiledImagery.d.ts +2 -1
- package/layers/mixins/TrackableLayer.d.ts +2 -1
- package/layers/orientedImagery/core/ElevationSourceDefinitions.d.ts +2 -1
- package/layers/support/AnnotationFeatureSublayer.d.ts +2 -1
- package/layers/support/BuildingFilterMode.d.ts +2 -1
- package/layers/support/BuildingSummaryStatistics.d.ts +2 -1
- package/layers/support/ControlPointsGeoreference.d.ts +2 -1
- package/layers/support/DisplayFilter.d.ts +2 -1
- package/layers/support/DisplayFilterInfo.d.ts +2 -1
- package/layers/support/EditFieldsInfo.d.ts +2 -1
- package/layers/support/ExpressionInfo.d.ts +2 -1
- package/layers/support/FeatureReductionBinning.d.ts +2 -1
- package/layers/support/FeatureReductionCluster.d.ts +2 -1
- package/layers/support/FeatureTemplate.d.ts +2 -1
- package/layers/support/FeatureType.d.ts +2 -1
- package/layers/support/FieldConfiguration.d.ts +2 -1
- package/layers/support/FieldFormat.d.ts +2 -1
- package/layers/support/GeometryEncodingLocation.d.ts +2 -1
- package/layers/support/GeometryEncodingWkb.d.ts +2 -1
- package/layers/support/GeometryFieldsInfo.d.ts +2 -1
- package/layers/support/KMLSublayer.d.ts +2 -1
- package/layers/support/LocalMediaElementSource.d.ts +2 -1
- package/layers/support/MediaElementBase.d.ts +2 -1
- package/layers/support/ParquetFilesData.d.ts +2 -1
- package/layers/support/ParquetPortalItemData.d.ts +2 -1
- package/layers/support/PlaybackInfo.d.ts +2 -1
- package/layers/support/PortalItemData.d.ts +2 -1
- package/layers/support/Relationship.d.ts +2 -1
- package/layers/support/SceneModifications.d.ts +2 -1
- package/layers/support/Sublayer.d.ts +2 -1
- package/layers/support/Subtype.d.ts +2 -1
- package/layers/support/SubtypeSublayer.d.ts +2 -1
- package/layers/support/SymbolLayerDrawing.d.ts +2 -1
- package/layers/support/TelemetryData.d.ts +2 -1
- package/layers/support/TelemetryDisplay.d.ts +2 -1
- package/layers/support/TimeInfo.d.ts +2 -1
- package/layers/support/TimeSeriesCalculationMethod.d.ts +2 -1
- package/layers/support/TimeSeriesFieldTimeMapping.d.ts +2 -1
- package/layers/support/TimeSeriesInfo.d.ts +2 -1
- package/layers/support/TrackInfo.d.ts +2 -1
- package/layers/support/TrackPartInfo.d.ts +2 -1
- package/layers/support/VideoTimeExtent.d.ts +2 -1
- package/layers/support/WMSSublayer.d.ts +2 -1
- package/layers/support/schemaValidator.js +1 -1
- package/layers/voxel/VoxelColorStop.d.ts +2 -1
- package/layers/voxel/VoxelDynamicSection.d.ts +2 -1
- package/layers/voxel/VoxelIsosurface.d.ts +2 -1
- package/layers/voxel/VoxelOpacityStop.d.ts +2 -1
- package/layers/voxel/VoxelRangeFilter.d.ts +2 -1
- package/layers/voxel/VoxelSlice.d.ts +2 -1
- package/layers/voxel/VoxelTransferFunctionStyle.d.ts +2 -1
- package/layers/voxel/VoxelUniqueValue.d.ts +2 -1
- package/linkChart/ChronologicalLayoutSettings.d.ts +2 -1
- package/linkChart/LayoutSettings.d.ts +2 -1
- package/linkChart/LinkChartProperties.d.ts +2 -1
- package/linkChart/NonspatialDataDisplay.d.ts +2 -1
- package/linkChart/OrganicLayoutSettings.d.ts +2 -1
- package/linkChart/RootedLayoutSettings.d.ts +2 -1
- package/networks/Network.d.ts +2 -1
- package/networks/support/Circuit.d.ts +2 -1
- package/networks/support/CircuitSection.d.ts +2 -1
- package/networks/support/NamedTraceConfiguration.d.ts +2 -1
- package/networks/support/Subcircuit.d.ts +2 -1
- package/networks/support/TraceConfiguration.d.ts +2 -1
- package/networks/support/UNTraceConfiguration.d.ts +2 -1
- package/package.json +5 -5
- package/parcelFabric/ParcelFabric.d.ts +2 -1
- package/popup/FeatureModel.d.ts +2 -1
- package/popup/FeaturesModel.d.ts +2 -1
- package/popup/FieldInfo.d.ts +2 -1
- package/popup/content/AttachmentsContent.d.ts +2 -1
- package/popup/content/RelationshipContent.d.ts +2 -1
- package/popup/content/UtilityNetworkAssociationsContent.d.ts +2 -1
- package/popup/support/AttachmentsOrderByInfo.d.ts +2 -1
- package/popup/support/FieldInfoFormat.d.ts +2 -1
- package/popup/support/UtilityNetworkAssociationType.d.ts +2 -1
- package/portal/Portal.d.ts +2 -1
- package/portal/PortalItem.d.ts +2 -1
- package/renderers/ClassBreaksRenderer.d.ts +2 -1
- package/renderers/DictionaryRenderer.d.ts +2 -1
- package/renderers/DotDensityRenderer.d.ts +2 -1
- package/renderers/FlowRenderer.d.ts +8 -6
- package/renderers/PieChartRenderer.d.ts +2 -1
- package/renderers/SimpleRenderer.d.ts +2 -1
- package/renderers/UniqueValueRenderer.d.ts +2 -1
- package/renderers/VectorFieldRenderer.d.ts +2 -1
- package/renderers/mixins/VisualVariablesMixin.d.ts +2 -1
- package/renderers/support/HeatmapLegendOptions.d.ts +2 -1
- package/renderers/support/OthersCategory.d.ts +2 -1
- package/renderers/support/RasterPresetRenderer.d.ts +2 -1
- package/renderers/support/RendererLegendOptions.d.ts +2 -1
- package/renderers/support/UniqueValue.d.ts +2 -1
- package/renderers/support/UniqueValueClass.d.ts +2 -1
- package/renderers/support/UniqueValueGroup.d.ts +2 -1
- package/renderers/visualVariables/support/VisualVariableLegendOptions.d.ts +2 -1
- package/rest/featureService/FeatureService.d.ts +2 -1
- package/rest/layerSources/DynamicDataLayer.d.ts +2 -1
- package/rest/layerSources/DynamicWorkspaceLayer.d.ts +2 -1
- package/rest/networks/support/TraceLocation.d.ts +2 -1
- package/rest/print.js +1 -1
- package/rest/support/AttributeBinsFeatureSet.d.ts +2 -1
- package/rest/support/AttributeBinsGrouping.d.ts +2 -1
- package/rest/support/AttributeBinsQuery.d.ts +2 -1
- package/rest/support/AutoIntervalBinParameters.d.ts +2 -1
- package/rest/support/BinParametersBase.d.ts +2 -1
- package/rest/support/CameraInfo.d.ts +2 -1
- package/rest/support/CameraInfoMixin.d.ts +2 -1
- package/rest/support/ClosestFacilityParameters.d.ts +2 -1
- package/rest/support/DataLayer.d.ts +2 -1
- package/rest/support/DateBinTimeInterval.d.ts +2 -1
- package/rest/support/DirectionLine.d.ts +2 -1
- package/rest/support/DirectionPoint.d.ts +2 -1
- package/rest/support/FindImagesParameters.d.ts +2 -1
- package/rest/support/FixedIntervalBinParameters.d.ts +2 -1
- package/rest/support/ImageBoundaryParameters.d.ts +2 -1
- package/rest/support/ImageGPSInfoParameters.d.ts +2 -1
- package/rest/support/ImageInspectionInfo.d.ts +2 -1
- package/rest/support/ImageToMapMultirayParameters.d.ts +2 -1
- package/rest/support/ImageToMapParameters.d.ts +2 -1
- package/rest/support/ImageUrlParameters.d.ts +2 -1
- package/rest/support/ImageVolumeParameters.d.ts +2 -1
- package/rest/support/LastMileDeliveryParameters.d.ts +2 -1
- package/rest/support/LocateSettingBase.d.ts +2 -1
- package/rest/support/LocateSettingSource.d.ts +2 -1
- package/rest/support/LocateSettings.d.ts +2 -1
- package/rest/support/LocateSettingsOverrides.d.ts +2 -1
- package/rest/support/MapToImageParameters.d.ts +2 -1
- package/rest/support/NetworkUrl.d.ts +2 -1
- package/rest/support/NormalizationBinParametersMixin.d.ts +2 -1
- package/rest/support/OutDistance.d.ts +2 -1
- package/rest/support/PointBarrier.d.ts +2 -1
- package/rest/support/PolygonBarrier.d.ts +2 -1
- package/rest/support/PolylineBarrier.d.ts +2 -1
- package/rest/support/RouteInfo.d.ts +2 -1
- package/rest/support/RouteParameters.d.ts +2 -1
- package/rest/support/ServiceAreaParameters.d.ts +2 -1
- package/rest/support/Stop.d.ts +2 -1
- package/rest/support/TravelMode.d.ts +2 -1
- package/support/LayersMixin.d.ts +2 -1
- package/support/TablesMixin.d.ts +2 -1
- package/support/actions/ActionBase.d.ts +2 -1
- package/symbols/LineStyleMarker3D.d.ts +2 -1
- package/symbols/patterns/LinePattern3D.d.ts +2 -1
- package/symbols/patterns/Pattern3D.d.ts +2 -1
- package/symbols/support/ElevationInfo.d.ts +2 -1
- package/symbols/support/OccludedVisibility.d.ts +2 -1
- package/symbols/support/Symbol3DEmissive.d.ts +2 -1
- package/symbols/support/Symbol3DMaterial.d.ts +2 -1
- package/symbols/support/Symbol3DTextBackground.d.ts +2 -1
- package/tables/elements/AttributeTableAttachmentElement.d.ts +2 -1
- package/tables/elements/AttributeTableFieldElement.d.ts +2 -1
- package/tables/elements/AttributeTableGroupElement.d.ts +2 -1
- package/tables/elements/AttributeTableRelationshipElement.d.ts +2 -1
- package/tables/support/FieldOrder.d.ts +2 -1
- package/time/TimeInterval.d.ts +2 -1
- package/versionManagement/VersionManagementService.d.ts +2 -1
- package/versionManagement/VersioningState.d.ts +2 -1
- package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/3d/environment/SunLighting.d.ts +2 -1
- package/views/3d/environment/VirtualLighting.d.ts +2 -1
- package/views/3d/layers/ImageryLayerView3D.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +3 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +14 -13
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanApproximation.glsl.js +14 -4
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphereTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphereConfiguration.js +2 -0
- package/views/3d/webgl-engine/effects/clouds/CloudsParameters.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsPresets.js +1 -1
- package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +2 -2
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
- package/views/3d/webgl-engine/lib/EmissionFader.js +2 -0
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/IndexLayout.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/AtmosphereCompositing.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/floatBlendScale.glsl.js +1 -1
- package/views/BreakpointsOwner.d.ts +2 -1
- package/views/DOMContainer.d.ts +2 -1
- package/views/PopupView.d.ts +2 -1
- package/views/SceneView.d.ts +2 -1
- package/views/Theme.d.ts +2 -1
- package/views/VideoView.d.ts +2 -1
- package/views/View.d.ts +2 -1
- package/views/View2D.d.ts +2 -1
- package/views/Viewport2DMixin.d.ts +2 -1
- package/views/analysis/AnalysisView.d.ts +2 -1
- package/views/draw/DrawAction.d.ts +2 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/options/SnappingOptions.d.ts +2 -1
- package/views/layers/FeatureLikeLayerView.d.ts +0 -32
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/GraphicsLayerView.d.ts +0 -32
- package/views/layers/GraphicsLayerView.js +1 -1
- package/views/layers/ImageryLayerView.d.ts +1 -62
- package/views/layers/LayerView.d.ts +2 -1
- package/views/layers/LayerView.js +1 -1
- package/views/layers/PointCloudLayerView.d.ts +2 -1
- package/views/ui/UI.d.ts +1 -12
- package/views/webgl/Program.js +2 -2
- package/webdoc/GeotriggersInfo.d.ts +2 -1
- package/webdoc/IPSInfo.d.ts +2 -1
- package/webdoc/geotriggersInfo/DeviceLocationFeed.d.ts +2 -1
- package/webdoc/geotriggersInfo/ExpressionInfo.d.ts +2 -1
- package/webdoc/geotriggersInfo/FeatureFenceParameters.d.ts +2 -1
- package/webdoc/geotriggersInfo/FeatureFilter.d.ts +2 -1
- package/webdoc/geotriggersInfo/FeatureLayerSource.d.ts +2 -1
- package/webdoc/geotriggersInfo/Geotrigger.d.ts +2 -1
- package/webdoc/geotriggersInfo/GeotriggerNotificationOptions.d.ts +2 -1
- package/webdoc/ips/AppleIPSProperties.d.ts +2 -1
- package/webdoc/ips/Configuration.d.ts +2 -1
- package/webdoc/ips/GNSSProperties.d.ts +2 -1
- package/webdoc/ips/PathSnappingProperties.d.ts +2 -1
- package/webdoc/ips/PositioningService.d.ts +2 -1
- package/webdoc/ips/SmoothingProperties.d.ts +2 -1
- package/webdoc/support/SlideThumbnail.d.ts +2 -1
- package/webmap/Bookmark.d.ts +2 -1
- package/webmap/InitialViewProperties.d.ts +2 -1
- package/webscene/Glow.d.ts +2 -1
- package/webscene/InitialViewProperties.d.ts +2 -1
- package/webscene/Presentation.d.ts +2 -1
- package/webscene/Slide.d.ts +2 -1
- package/webscene/SlideLegendInfo.d.ts +2 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/webscene/support/Description.d.ts +2 -1
- package/webscene/support/FeatureReference.d.ts +2 -1
- package/webscene/support/FeatureReferenceId.d.ts +2 -1
- package/webscene/support/LayerReference.d.ts +2 -1
- package/webscene/support/SlideElements.d.ts +2 -1
- package/webscene/support/SlideEnvironment.d.ts +2 -1
- package/webscene/support/SlideGround.d.ts +2 -1
- package/webscene/support/SlidePopupInfo.d.ts +2 -1
- package/webscene/support/SlideVisibleLayer.d.ts +2 -1
- package/webscene/support/Title.d.ts +2 -1
- package/webscene/support/schemaValidator.js +1 -1
- package/webscene/version.js +1 -1
- package/widgets/BasemapGallery/support/BasemapGalleryItem.d.ts +2 -1
- package/widgets/BasemapGallery/support/PortalBasemapsSource.d.ts +2 -1
- package/widgets/BasemapLayerList.d.ts +2 -1
- package/widgets/Bookmarks/BookmarksViewModel.d.ts +2 -1
- package/widgets/Bookmarks.d.ts +2 -1
- package/widgets/CatalogLayerList.d.ts +2 -1
- package/widgets/Compass/CompassViewModel.d.ts +2 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +2 -1
- package/widgets/Directions/DirectionsViewModel.d.ts +2 -1
- package/widgets/Feature/FeatureViewModel.d.ts +2 -1
- package/widgets/FeatureForm/FeatureFormViewModel.d.ts +2 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationInput.d.ts +2 -1
- package/widgets/FeatureTable/support/ColumnTemplate.d.ts +2 -1
- package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +2 -1
- package/widgets/FeatureTable/support/EditableColumnTemplateMixin.d.ts +2 -1
- package/widgets/FeatureTable/support/FieldColumnTemplate.d.ts +2 -1
- package/widgets/FeatureTable/support/TableTemplate.d.ts +2 -1
- package/widgets/FeatureTemplates/TemplateItemGroup.d.ts +2 -1
- package/widgets/Features/FeaturesViewModel.d.ts +2 -1
- package/widgets/FloorFilter/FloorFilterViewModel.d.ts +2 -1
- package/widgets/Home/HomeViewModel.d.ts +2 -1
- package/widgets/LayerList/ListItem.d.ts +2 -1
- package/widgets/LayerList/ListItemPanel.d.ts +2 -1
- package/widgets/LayerList.d.ts +2 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.d.ts +2 -1
- package/widgets/Print/PrintViewModel.d.ts +2 -1
- package/widgets/Search/SearchSource.d.ts +2 -1
- package/widgets/Search/SearchViewModel.d.ts +2 -1
- package/widgets/TableList/ListItem.d.ts +2 -1
- package/widgets/TableList/ListItemPanel.d.ts +2 -1
- package/widgets/TableList.d.ts +2 -1
- package/widgets/Widget.d.ts +2 -1
- package/widgets/support/GeolocationPositioning.d.ts +2 -1
- package/widgets/support/GoTo.d.ts +2 -1
- package/widgets/types.d.ts +0 -21
- package/assets/esri/widgets/Attribution/t9n/messages.ar.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.bg.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.bs.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.ca.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.cs.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.da.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.de.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.el.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.en.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.es.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.et.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.fi.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.fr.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.he.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.hr.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.hu.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.id.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.it.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.ja.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.ko.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.lt.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.lv.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.nl.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.no.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.pl.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.pt-BR.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.pt-PT.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.ro.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.ru.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.sk.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.sl.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.sr.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.sv.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.th.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.tr.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.uk.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.vi.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.zh-CN.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.zh-HK.json +0 -1
- package/assets/esri/widgets/Attribution/t9n/messages.zh-TW.json +0 -1
- package/chunks/CloudsComposition.glsl.js +0 -3
- package/popup/content.d.ts +0 -192
- package/popup/content.js +0 -2
- package/portal/schemas/buildingSceneLayerItem.js +0 -2
- package/portal/schemas/gaussianSplatLayerItem.js +0 -2
- package/portal/schemas/integratedMesh3DTilesLayerItem.js +0 -2
- package/portal/schemas/integratedMeshLayerItem.js +0 -2
- package/portal/schemas/pointCloudLayerItem.js +0 -2
- package/portal/schemas/sceneLayerItem.js +0 -2
- package/portal/schemas/webScene.js +0 -2
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.glsl.js +0 -2
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +0 -2
- package/views/3d/webgl-engine/effects/clouds/CloudsCompositionTechnique.js +0 -2
- package/widgets/Attribution/AttributionViewModel.d.ts +0 -41
- package/widgets/Attribution/AttributionViewModel.js +0 -2
- package/widgets/Attribution.d.ts +0 -105
- package/widgets/Attribution.js +0 -2
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{earth as t}from"../../../../../../geometry/support/Ellipsoid.js";import{cloudsHeight as n}from"../../../../environment/weather.js";import{EvaluateAmbientLighting as r}from"../shading/EvaluateAmbientLighting.glsl.js";import{mainLightDirection as
|
|
2
|
+
import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{earth as t}from"../../../../../../geometry/support/Ellipsoid.js";import{cloudsHeight as n}from"../../../../environment/weather.js";import{EvaluateAmbientLighting as r}from"../shading/EvaluateAmbientLighting.glsl.js";import{Gamma as i}from"../shading/Gamma.glsl.js";import{mainLightDirection as a,mainLightIntensity as o}from"../shading/lightingUniforms.js";import{PiUtils as s}from"../shading/PiUtils.glsl.js";import{LookupCloudsFromTextureArray as c}from"./LookupCloudsFromTextureArray.glsl.js";import{BooleanBindUniform as l}from"../../shaderModules/BooleanBindUniform.js";import{Float3BindUniform as u}from"../../shaderModules/Float3BindUniform.js";import{FloatBindUniform as d}from"../../shaderModules/FloatBindUniform.js";import{glsl as f}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as p}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DArrayBindUniform as m}from"../../shaderModules/Texture2DArrayBindUniform.js";function h(t){let n=t.fragment;n.constants.add(`radiusCloudsSquared`,`float`,g).code.add(f`vec3 intersectWithCloudLayer(vec3 dir, vec3 cameraPosition, vec3 spherePos) {
|
|
3
3
|
float B = 2.0 * dot(cameraPosition, dir);
|
|
4
4
|
float C = dot(cameraPosition, cameraPosition) - radiusCloudsSquared;
|
|
5
5
|
float det = B * B - 4.0 * C;
|
|
6
6
|
float pointIntDist = max(0.0, 0.5 *(-B + sqrt(det)));
|
|
7
7
|
return (cameraPosition + dir * pointIntDist) - spherePos;
|
|
8
|
-
}`),n.uniforms.add(new
|
|
8
|
+
}`),n.uniforms.add(new d(`radiusCurvatureCorrection`,({clouds:e})=>e.parallax.radiusCurvatureCorrection)).code.add(f`vec3 correctForPlanetCurvature(vec3 dir) {
|
|
9
9
|
dir.z = dir.z * (1.0 - radiusCurvatureCorrection) + radiusCurvatureCorrection;
|
|
10
10
|
return dir;
|
|
11
|
-
}`),n.code.add(
|
|
11
|
+
}`),n.code.add(f`vec3 rotateDirectionToAnchorPoint(mat4 rotMat, vec3 inVec) {
|
|
12
12
|
return (rotMat * vec4(inVec, 0.0)).xyz;
|
|
13
|
-
}`),n.include(r),n.constants.add(`
|
|
13
|
+
}`),n.include(r),n.include(s),n.include(i),n.constants.add(`rimColor`,`vec3`,e(.28,.175,.035)),n.constants.add(`sunsetTransitionFactor`,`float`,.3),n.constants.add(`rimScattering`,`float`,140),n.constants.add(`backlightFactor`,`float`,.2),n.constants.add(`backlightScattering`,`float`,10),n.constants.add(`backlightTransition`,`float`,.3),n.uniforms.add(a,o).code.add(f`vec3 calculateCloudColor(vec3 cameraPosition, vec3 worldSpaceRay, vec4 clouds, out vec3 emission) {
|
|
14
14
|
float upDotLight = dot(cameraPosition, mainLightDirection);
|
|
15
15
|
float dirDotLight = max(dot(worldSpaceRay, mainLightDirection), 0.0);
|
|
16
16
|
float sunsetTransition = clamp(pow(max(upDotLight, 0.0), sunsetTransitionFactor), 0.0, 1.0);
|
|
@@ -19,31 +19,32 @@ vec3 combinedLight = clamp((mainLightIntensity + ambientLight )/PI, vec3(0.0), v
|
|
|
19
19
|
vec3 baseCloudColor = pow(combinedLight * pow(clouds.xyz, vec3(GAMMA)), vec3(INV_GAMMA));
|
|
20
20
|
float scatteringMod = max(clouds.a < 0.5 ? clouds.a / 0.5 : - clouds.a / 0.5 + 2.0, 0.0);
|
|
21
21
|
float rimLightIntensity = 0.5 + 0.5 * pow(max(upDotLight, 0.0), 0.35);
|
|
22
|
-
|
|
22
|
+
emission = rimColor * rimLightIntensity * (pow(dirDotLight, rimScattering)) * scatteringMod;
|
|
23
23
|
float additionalLight = backlightFactor * pow(dirDotLight, backlightScattering) * (1. - pow(sunsetTransition, backlightTransition)) ;
|
|
24
|
-
return
|
|
25
|
-
}`),t.include(
|
|
24
|
+
return baseCloudColor * (1.0 + additionalLight);
|
|
25
|
+
}`),t.include(c),n.uniforms.add(new l(`readChannelsRG`,e=>e.clouds.readChannels===0),new m(`cubeMap`,e=>e.clouds.data?.cubeMap?.colorTexture)).code.add(f`vec4 sampleCloud(vec3 rayDir, bool readOtherChannel) {
|
|
26
26
|
vec4 s = lookupCloudsFromTextureArray(cubeMap, rayDir);
|
|
27
27
|
bool readRG = readChannelsRG ^^ readOtherChannel;
|
|
28
28
|
s = readRG ? vec4(vec3(s.r), s.g) : vec4(vec3(s.b), s.a);
|
|
29
29
|
return length(s) == 0.0 ? vec4(s.rgb, 1.0) : s;
|
|
30
|
-
}`),n.uniforms.add(new
|
|
30
|
+
}`),n.uniforms.add(_,new u(`anchorPoint`,e=>e.clouds.parallax.anchorPoint),new u(`anchorPointNew`,e=>e.clouds.parallaxNew.anchorPoint),new p(`rotationClouds`,e=>e.clouds.parallax.transform),new p(`rotationCloudsNew`,e=>e.clouds.parallaxNew.transform),new d(`fadeFactor`,e=>e.clouds.fadeFactor),new l(`crossFade`,e=>e.clouds.fadeState===3)).code.add(f`vec4 renderClouds(vec3 worldRay, vec3 cameraPosition, out vec3 emission) {
|
|
31
31
|
vec3 intersectionPoint = intersectWithCloudLayer(worldRay, cameraPosition, anchorPoint);
|
|
32
32
|
vec3 worldRayRotated = rotateDirectionToAnchorPoint(rotationClouds, normalize(intersectionPoint));
|
|
33
33
|
vec3 worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated);
|
|
34
34
|
vec4 cloudData = sampleCloud(worldRayRotatedCorrected, crossFade);
|
|
35
35
|
vec3 cameraPositionN = normalize(cameraPosition);
|
|
36
|
-
vec4 cloudColor = vec4(calculateCloudColor(cameraPositionN, worldRay, cloudData), cloudData.a);
|
|
36
|
+
vec4 cloudColor = vec4(calculateCloudColor(cameraPositionN, worldRay, cloudData, emission), cloudData.a);
|
|
37
37
|
if(crossFade) {
|
|
38
38
|
intersectionPoint = intersectWithCloudLayer(worldRay, cameraPosition, anchorPointNew);
|
|
39
39
|
worldRayRotated = rotateDirectionToAnchorPoint(rotationCloudsNew, normalize(intersectionPoint));
|
|
40
40
|
worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated);
|
|
41
41
|
cloudData = sampleCloud(worldRayRotatedCorrected, false);
|
|
42
|
-
|
|
42
|
+
vec3 emissionNew = vec3(0.0);
|
|
43
|
+
vec4 cloudColorNew = vec4(calculateCloudColor(cameraPositionN, worldRay, cloudData, emissionNew), cloudData.a);
|
|
43
44
|
cloudColor = mix(cloudColor, cloudColorNew, fadeFactor);
|
|
45
|
+
emission = mix(emission, emissionNew, fadeFactor);
|
|
44
46
|
}
|
|
45
47
|
float totalTransmittance = length(cloudColor.rgb) == 0.0 ?
|
|
46
|
-
1.0 :
|
|
47
|
-
clamp(cloudColor.a * cloudsOpacity + (1.0 - cloudsOpacity), 0.0 , 1.0);
|
|
48
|
+
1.0 : clamp(cloudColor.a * cloudsOpacity + (1.0 - cloudsOpacity), 0.0 , 1.0);
|
|
48
49
|
return vec4(cloudColor.rgb, totalTransmittance);
|
|
49
|
-
}`)}const
|
|
50
|
+
}`)}const g=(t.radius+n)**2,_=new d(`cloudsOpacity`,e=>e.clouds.opacity);export{h as CloudsParallaxShading,_ as cloudsOpacity};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{clamp as e}from"../../../../../core/mathUtils.js";import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{squaredLength as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{earth as
|
|
2
|
+
import{clamp as e}from"../../../../../core/mathUtils.js";import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{squaredLength as n,lerp as r}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{earth as a}from"../../../../../geometry/support/Ellipsoid.js";import{cameraPosition as o}from"../../core/shaderLibrary/util/cameraUniforms.js";import{Float2PassUniform as s}from"../../core/shaderModules/Float2PassUniform.js";import{FloatsPassUniform as c}from"../../core/shaderModules/FloatsPassUniform.js";import{glsl as l}from"../../core/shaderModules/glsl.js";import{betaRayleigh as u,betaCombined as d}from"./atmosphereUtils.js";import{maxEmissiveStrength as f}from"../../shaders/floatBlendScale.glsl.js";import{SphereIntersect as p}from"../../shaders/SphereIntersect.glsl.js";import{NoParameters as m}from"../../../../webgl/NoParameters.js";class h extends m{constructor(){super(...arguments),this.radii=t()}}function g(e){e.code.add(l`float chapmanApproximation(float thickness, float height, float cosZenith) {
|
|
3
3
|
float c = sqrt(thickness + height);
|
|
4
4
|
float cExpH = c * exp(-height);
|
|
5
5
|
if (cosZenith >= 0.0) {
|
|
@@ -9,9 +9,19 @@ float x0 = sqrt(1.0 - cosZenith * cosZenith) * (thickness + height);
|
|
|
9
9
|
float c0 = sqrt(x0);
|
|
10
10
|
return 2.0 * c0 * exp(thickness - x0) - cExpH / (1.0 - c * cosZenith);
|
|
11
11
|
}
|
|
12
|
-
}`),e.constants.add(`scaleHeight`,`float`,
|
|
12
|
+
}`),e.constants.add(`scaleHeight`,`float`,a.scaleHeight*a.atmosphereHeight).code.add(l`float getOpticalDepth(vec3 position, vec3 dir, float h) {
|
|
13
13
|
return scaleHeight * chapmanApproximation(radii[0] / scaleHeight, h, dot(normalize(position), dir));
|
|
14
|
-
}`),e.
|
|
14
|
+
}`),e.constants.add(`maxEmissiveStrength`,`float`,f).constants.add(`betaMix`,`vec3`,r(b,d,u,.5)).uniforms.add(o,new s(`radii`,e=>e.radii)).code.add(l`float getGlow(float dist, float radius, float intensity) {
|
|
15
|
+
return pow(radius / max(dist, 1e-6), intensity);
|
|
16
|
+
}
|
|
17
|
+
vec3 getSun(vec3 rayDir, vec3 lightDir){
|
|
18
|
+
float scaleFract = (length(cameraPosition) - radii[0]) / scaleHeight;
|
|
19
|
+
float sunOpticalDepth = getOpticalDepth(cameraPosition, rayDir, max(scaleFract, 0.0));
|
|
20
|
+
vec3 sunTransmittance = exp(-betaMix * max(0.0, sunOpticalDepth));
|
|
21
|
+
float mu = clamp(dot(rayDir, lightDir), 0.0, 1.0);
|
|
22
|
+
float sunDisc = smoothstep(0.0, 128.0, clamp(getGlow(1.0 - mu, 3e-5, 3.0), 0.0, 128.0));
|
|
23
|
+
return min(32.0 * sunTransmittance * sunDisc, vec3(maxEmissiveStrength));
|
|
24
|
+
}`),e.include(p),e.constants.add(`planetRadiusReduction`,`float`,v).uniforms.add(new c(`heightParameters`,5,(e,t)=>_(t,e)),o).code.add(l`vec4 planetIntersect(vec3 rayDir) {
|
|
15
25
|
float rayPlanetDistanceReduced = heightParameters[4];
|
|
16
26
|
vec2 rayPlanetIntersect = sphereIntersect(cameraPosition, rayDir, rayPlanetDistanceReduced);
|
|
17
27
|
vec2 rayAtmosphereIntersect = sphereIntersect(cameraPosition, rayDir, heightParameters[1]);
|
|
@@ -30,4 +40,4 @@ start = rayPlanetIntersect.y;
|
|
|
30
40
|
}
|
|
31
41
|
float end = hitsPlanet ? rayPlanetIntersect.x : rayAtmosphereIntersect.y;
|
|
32
42
|
return vec4(0.0, hitsPlanet ? 1.0 : 0.0, start, end);
|
|
33
|
-
}`)}function
|
|
43
|
+
}`)}function _({camera:t},{radii:r}){let i=n(t.eye),o=Math.sqrt(i);return y[0]=o,y[1]=i-r[1]**2,y[2]=e((o-r[0])/a.atmosphereHeight,0,1),y[3]=i-r[0]**2,y[4]=i-(r[0]-v)**2,y}const v=2e4,y=[],b=i();export{g as ChapmanApproximation,h as ChapmanApproximationPassParameters,_ as getHeightParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import"../../core/shaderLibrary/bindUniforms.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderLibrary/shading/lightingUniforms.js";import"../../core/shaderLibrary/util/cameraUniforms.js";import"../../core/
|
|
2
|
+
import"../../core/shaderLibrary/bindUniforms.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderLibrary/shading/lightingUniforms.js";import"../../core/shaderLibrary/util/cameraUniforms.js";import"../../core/shaderLibrary/util/CloudsParallaxShading.glsl.js";import"../../core/shaderModules/BooleanPassUniform.js";import"../../core/shaderModules/Float3PassUniform.js";import"../../core/shaderModules/Float4PassUniform.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/FloatsPassUniform.js";import"../../core/shaderModules/glsl.js";import"./ChapmanApproximation.glsl.js";import"./ChapmanRaymarching.glsl.js";import"../../shaders/ditherNoise.glsl.js";import"../../shaders/floatBlendScale.glsl.js";import"../../shaders/ScreenSpacePassAtmosphere.glsl.js";import"../../shaders/SphereIntersect.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/ChapmanAtmosphere.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{lerp as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as n}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as i,initial as a}from"../../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as
|
|
2
|
+
import{__decorate as e}from"tslib";import has from"../../../../../core/has.js";import{lerp as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as n}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as i,initial as a}from"../../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{copy as s,set as c}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{set as l,length as u}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as d}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{earth as f}from"../../../../../geometry/support/Ellipsoid.js";import{OpaqueEnvironment as p}from"../OpaqueEnvironment.js";import{computeInnerAltitudeFade as m,innerAtmosphereDepth as h}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as g,ChapmanAtmosphereTechnique as _}from"./ChapmanAtmosphereTechnique.js";import{RealisticAtmosphereConfiguration as v}from"./RealisticAtmosphereConfiguration.js";import{createQuadVAO as y}from"../../lib/glUtil3D.js";import{applyTextureResizeModulo as b}from"../../lib/textureUtils.js";import{A as x}from"../../../../../chunks/AtmosphereCompositing.glsl.js";import{AtmosphereCompositingTechnique as S}from"../../shaders/AtmosphereCompositingTechnique.js";import{DepthStencilAttachment as C,ColorAttachment0 as w,PrimitiveType as T}from"../../../../webgl/enums.js";import E from"../../../../../webscene/background/ColorBackground.js";let D=class extends p{constructor(){super(...arguments),this._emissionDisabled=!!has(`disable-feature:emissive-sun`),this._passParameters=new g,this._compositingPassParameters=new x,this._configuration=new v}initialize(){this.addHandles([r(()=>this.view.environment.background,e=>{let t=e instanceof E?e.color.toUnitRGBA():d;l(this._passParameters.backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3])},i),r(()=>this.view.stage?.renderer?.highResolutionAtmosphere,e=>this._passParameters.reduced=!e,i),r(()=>this.view.map.ground.undergroundColor,e=>{this._passParameters.undergroundColor=e?.toUnitRGBA()??d,this.requestRender(1)},a),r(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),i)])}destroy(){this._vao=n(this._vao)}precompile(){this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._configuration.hasClouds=!!this.bindParameters.clouds.data?.cubeMap?.colorTexture,this._configuration.hasEmissive=this._hasEmissive&&!this._passParameters.reduced,this.techniques.precompile(_,this._configuration),this._passParameters.reduced&&(this._configuration.hasEmissive=this._hasEmissive,this.techniques.precompile(S,this._configuration))}render(){let e=this.input;if(!this.bindParameters.mainDepth)return e;let n=this.renderingContext,r=e.getAttachment(C);this._update(),this._vao??=y(n,1),this.bindParameters.clouds?.isFading&&this.requestRender(2),this._configuration.hasEmissive=this._hasEmissive&&!this._passParameters.reduced;let i=this.techniques.get(_,this._configuration);if(!this._passParameters.reduced)return e.detachDepth(),n.bindFramebuffer(e.fbo),n.bindTechnique(i,this.bindParameters,this._passParameters),n.bindVAO(this._vao),this._emissionDisabled&&n.setDrawBuffers([w]),n.drawArrays(T.TRIANGLE_STRIP,0,4),e.attachDepth(r),e;let a=n.getViewport(),o=this.bindParameters.camera,c=u(o.eye)-f.radius,l,d=f.atmosphereHeight;if(c<d){let e=Math.min(1,Math.max(0,c/d));l=t(.2,.3,e)}else{let e=Math.min(1,Math.max(0,(c-d)/(15*d)));l=t(.3,.6,e)}let p=this.renderingContext.parameters.maxTextureSize,m=b(Math.round(l*o.fullViewport[2]),p),h=b(Math.round(l*o.fullViewport[3]),p);n.setViewport(0,0,m,h);let g=this.fboCache.acquire(m,h,`chapman`);n.bindFramebuffer(g.fbo),n.clearFramebuffer([0,0,0,1],!0,!0),n.bindTechnique(i,this.bindParameters,this._passParameters),n.bindVAO(this._vao),n.drawArrays(T.TRIANGLE_STRIP,0,4),n.setViewport(a.x,a.y,a.width,a.height),this._configuration.hasEmissive=this.bindParameters.emissions!==0;let v=this.techniques.get(S,this._configuration);return s(this._compositingPassParameters.radii,this._passParameters.radii),this._compositingPassParameters.color=g.getTexture(),e.detachDepth(),n.bindFramebuffer(e.fbo),n.bindTechnique(v,this.bindParameters,this._compositingPassParameters),this._emissionDisabled&&n.setDrawBuffers([w]),n.screen.draw(),e.attachDepth(r),g.release(),e}_update(){let e=this.view.basemapTerrain?.getLowerBoundRadius()??0;c(this._passParameters.radii,e,e+f.atmosphereHeight);let t=u(this.bindParameters.camera.eye);this._passParameters.altitudeFade=m(t-e),this._passParameters.innerFadeDistance=2*Math.sqrt((2*e-h)*h)}get _hasEmissive(){return this.bindParameters.emissions!==0&&!this._emissionDisabled}};D=e([o(`esri.views.3d.webgl-engine.effects.atmosphere.ChapmanAtmosphere`)],D);export{D as ChapmanAtmosphere};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ReloadableShader as i}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as a}from"../../core/shaderTechnique/ShaderTechnique.js";import{ChapmanApproximationPassParameters as o}from"./ChapmanApproximation.glsl.js";import{C as s}from"../../../../../chunks/ChapmanAtmosphere.glsl.js";import{Pos2TexF16 as c}from"../../lib/DefaultVertexBufferLayouts.js";import{makePipelineState as l,defaultColorWrite as u,copySource as d,simpleBlendingParams as f}from"../../../../webgl/renderState.js";class p extends o{constructor(){super(...arguments),this.reduced=!1,this.innerFadeDistance=0,this.altitudeFade=0,this.backgroundColor=n(),this.undergroundColor=r()}}let m=class extends a{constructor(e,t){super(e,t,c),this.shader=new i(s,()=>import(`./ChapmanAtmosphere.glsl.js`)),this._reducedPipeline=l({blending:d,depthTest:{func:519},colorWrite:u})}initializePipeline(){return l({blending:f(
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ReloadableShader as i}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as a}from"../../core/shaderTechnique/ShaderTechnique.js";import{ChapmanApproximationPassParameters as o}from"./ChapmanApproximation.glsl.js";import{C as s}from"../../../../../chunks/ChapmanAtmosphere.glsl.js";import{Pos2TexF16 as c}from"../../lib/DefaultVertexBufferLayouts.js";import{makePipelineState as l,defaultColorWrite as u,copySource as d,simpleBlendingParams as f}from"../../../../webgl/renderState.js";class p extends o{constructor(){super(...arguments),this.reduced=!1,this.innerFadeDistance=0,this.altitudeFade=0,this.backgroundColor=n(),this.undergroundColor=r()}}let m=class extends a{constructor(e,t){super(e,t,c),this.shader=new i(s,()=>import(`./ChapmanAtmosphere.glsl.js`)),this._reducedPipeline=l({blending:d,depthTest:{func:519},colorWrite:u})}initializePipeline(){return l({blending:f(1,771),depthTest:{func:515},colorWrite:u})}getPipeline(e,t){return t.reduced?this._reducedPipeline:super.getPipeline(e,t)}};m=e([t(`esri.views.3d.webgl-engine.effects.atmosphere.ChapmanAtmosphereTechnique`)],m);export{p as ChapmanAtmospherePassParameters,m as ChapmanAtmosphereTechnique};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import{__decorate as e}from"tslib";import{parameter as t}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{EmissiveTechniqueConfiguration as n}from"../../shaders/EmissiveTechniqueConfiguration.js";class r extends n{constructor(){super(...arguments),this.hasClouds=!1}}e([t()],r.prototype,`hasClouds`,void 0);export{r as RealisticAtmosphereConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/has.js";import{clamp as e}from"../../../../../core/mathUtils.js";import{signal as t}from"../../../../../core/signal.js";import{rotate as n}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as r,create as i}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as a,squaredLength as o,normalize as s,scale as c,length as l,subtract as u}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d,fromValues as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as p,fromPoints as m,axis as h}from"../../../../../geometry/support/axisAngleDegrees.js";import{earth as g}from"../../../../../geometry/support/Ellipsoid.js";import{heightLimit as _}from"../../../environment/weather.js";import{ensureClouds as v}from"./Clouds.js";class y{constructor(){this._data=t(null),this._startTime=0,this.coverage=0,this.absorption=0,this._readChannels=0,this.parallax=new b,this.parallaxNew=new b,this._anchorPoint=d(),this._fadeState=t(0),this._fadeFactor=t(1)}get data(){return this._data.value}set data(e){this._data.value=e}get readChannels(){return this._readChannels}needsStationaryAnchorUpdate(e){return E&&this._stationaryAnchorPointDistance(e)>D}get fadeState(){return this._fadeState.value}get fadeFactor(){return this._fadeFactor.value}get opacity(){switch(this.fadeState){case 0:return 0;case 4:return 1-this.fadeFactor;case 1:return this.fadeFactor;case 2:case 3:return 1}}fade(t,n,r,i){if(this.isFading&&this.fadeFactor<1&&(this._fadeFactor.value=r?e((n-this._startTime)/(T*r),0,1):1,this.fadeFactor===1&&this._endFade()),this._evaluateState(t,n),i&&this.needsStationaryAnchorUpdate(t))switch(this.fadeState){case 3:a(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 1:case 2:a(this.parallax.anchorPoint,this._anchorPoint),a(this.parallaxNew.anchorPoint,this._anchorPoint)}this._updateParallax(t)}_evaluateState(e,t){let n=e.relativeElevation,r=this._updateAnchorPoint(e);(Math.abs(n)>1.7*_||r>k)&&this.opacity>0?this._startFade(0,t):this.isFading||(Math.abs(n)>_||r>O*k?this.opacity>0&&this._startFade(4,t):v(this.data)&&(this.opacity===0?this._startFade(1,t):this.data.state===2&&(this.fadeState===2?this._startFade(3,t):this._startFade(2,t))))}_updateParallax(e){let t=o(e.eye);this.parallax.radiusCurvatureCorrection=.84*Math.sqrt(Math.max(t-g.radius*g.radius,0))/Math.sqrt(t),m(x,this.parallax.anchorPoint,S),n(this.parallax.transform,r,S[3],h(S)),m(x,this.parallaxNew.anchorPoint,S),n(this.parallaxNew.transform,r,S[3],h(S))}_updateAnchorPoint(e){return s(this._anchorPoint,e.eye),c(this._anchorPoint,this._anchorPoint,g.radius),this.fadeState===0&&this.data?.state===2?(a(this.parallax.anchorPoint,this._anchorPoint),0):l(u(C,this.parallax.anchorPoint,this._anchorPoint))}_stationaryAnchorPointDistance(e){switch(this.fadeState){case 1:case 2:return s(w,e.eye),c(w,w,g.radius),l(u(C,this.parallax.anchorPoint,w));case 3:return s(w,e.eye),c(w,w,g.radius),l(u(C,this.parallaxNew.anchorPoint,w));case 0:case 4:return 0;default:return this.fadeState,0}}requestFade(){this._fadeFactor.value=0}_startFade(e,t){switch(this._fadeState.value=e,this._startTime=t,e){case 3:this.requestFade(),this._switchReadChannels(),a(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 1:this.requestFade(),this._switchReadChannels(),a(this.parallax.anchorPoint,this._anchorPoint),a(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 4:this.requestFade();break;case 2:this._switchReadChannels(),a(this.parallax.anchorPoint,this._anchorPoint),a(this.parallaxNew.anchorPoint,this._anchorPoint),this._endFade();break;case 0:this._endFade()}}_endFade(){switch(this._fadeFactor.value=1,this.data&&this.data.state!==2&&(this.data.state=0),this.fadeState){case 3:a(this.parallax.anchorPoint,this.parallaxNew.anchorPoint),this._fadeState.value=2;break;case 1:this._fadeState.value=2;break;case 4:this._fadeState.value=0;break;case 2:case 0:break;default:this.fadeState}}_switchReadChannels(){this.data?.state===2&&(this._readChannels=1-this._readChannels,this.data.state=3)}get isFading(){return this.fadeState===4||this.fadeState===1||this.fadeState===3}}class b{constructor(){this.anchorPoint=d(),this.radiusCurvatureCorrection=0,this.transform=i()}}const x=f(0,0,1),S=p(),C=d(),w=d(),T=1.25,E=!1,D=1e-6,O=.5,k=2e5;export{y as CloudsParameters};
|
|
2
|
+
import"../../../../../core/has.js";import{clamp as e}from"../../../../../core/mathUtils.js";import{signal as t}from"../../../../../core/signal.js";import{rotate as n}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as r,create as i}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as a,squaredLength as o,normalize as s,scale as c,length as l,subtract as u}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d,fromValues as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as p,fromPoints as m,axis as h}from"../../../../../geometry/support/axisAngleDegrees.js";import{earth as g}from"../../../../../geometry/support/Ellipsoid.js";import{heightLimit as _}from"../../../environment/weather.js";import{ensureClouds as v}from"./Clouds.js";class y{constructor(){this._data=t(null),this._startTime=0,this.coverage=0,this.absorption=0,this._readChannels=0,this.parallax=new b,this.parallaxNew=new b,this._anchorPoint=d(),this._fadeState=t(0),this._fadeFactor=t(1)}get data(){return this._data.value}set data(e){this._data.value=e}get readChannels(){return this._readChannels}needsStationaryAnchorUpdate(e){return E&&this._stationaryAnchorPointDistance(e)>D}get fadeState(){return this._fadeState.value}get fadeFactor(){return this._fadeFactor.value}get opacity(){switch(this.fadeState){case 0:return 0;case 4:return 1-this.fadeFactor;case 1:return this.fadeFactor;case 2:case 3:return 1}}fade(t,n,r,i){if(!this.data)this._endFade();else{if(this.isFading&&this.fadeFactor<1&&(this._fadeFactor.value=r?e((n-this._startTime)/(T*r),0,1):1,this.fadeFactor===1&&this._endFade()),this._evaluateState(t,n),i&&this.needsStationaryAnchorUpdate(t))switch(this.fadeState){case 3:a(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 1:case 2:a(this.parallax.anchorPoint,this._anchorPoint),a(this.parallaxNew.anchorPoint,this._anchorPoint)}this._updateParallax(t)}}_evaluateState(e,t){let n=e.relativeElevation,r=this._updateAnchorPoint(e);(Math.abs(n)>1.7*_||r>k)&&this.opacity>0?this._startFade(0,t):this.isFading||(Math.abs(n)>_||r>O*k?this.opacity>0&&this._startFade(4,t):v(this.data)&&(this.opacity===0?this._startFade(1,t):this.data.state===2&&(this.fadeState===2?this._startFade(3,t):this._startFade(2,t))))}_updateParallax(e){let t=o(e.eye);this.parallax.radiusCurvatureCorrection=.84*Math.sqrt(Math.max(t-g.radius*g.radius,0))/Math.sqrt(t),m(x,this.parallax.anchorPoint,S),n(this.parallax.transform,r,S[3],h(S)),m(x,this.parallaxNew.anchorPoint,S),n(this.parallaxNew.transform,r,S[3],h(S))}_updateAnchorPoint(e){return s(this._anchorPoint,e.eye),c(this._anchorPoint,this._anchorPoint,g.radius),this.fadeState===0&&this.data?.state===2?(a(this.parallax.anchorPoint,this._anchorPoint),0):l(u(C,this.parallax.anchorPoint,this._anchorPoint))}_stationaryAnchorPointDistance(e){switch(this.fadeState){case 1:case 2:return s(w,e.eye),c(w,w,g.radius),l(u(C,this.parallax.anchorPoint,w));case 3:return s(w,e.eye),c(w,w,g.radius),l(u(C,this.parallaxNew.anchorPoint,w));case 0:case 4:return 0;default:return this.fadeState,0}}requestFade(){this._fadeFactor.value=0}_startFade(e,t){switch(this._fadeState.value=e,this._startTime=t,e){case 3:this.requestFade(),this._switchReadChannels(),a(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 1:this.requestFade(),this._switchReadChannels(),a(this.parallax.anchorPoint,this._anchorPoint),a(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 4:this.requestFade();break;case 2:this._switchReadChannels(),a(this.parallax.anchorPoint,this._anchorPoint),a(this.parallaxNew.anchorPoint,this._anchorPoint),this._endFade();break;case 0:this._endFade()}}_endFade(){switch(this._fadeFactor.value=1,this.data&&this.data.state!==2&&(this.data.state=0),this.fadeState){case 3:a(this.parallax.anchorPoint,this.parallaxNew.anchorPoint),this._fadeState.value=2;break;case 1:this._fadeState.value=2;break;case 4:this._fadeState.value=0;break;case 2:case 0:break;default:this.fadeState}}_switchReadChannels(){this.data?.state===2&&(this._readChannels=1-this._readChannels,this.data.state=3)}get isFading(){return this.fadeState===4||this.fadeState===1||this.fadeState===3}}class b{constructor(){this.anchorPoint=d(),this.radiusCurvatureCorrection=0,this.transform=i()}}const x=f(0,0,1),S=p(),C=d(),w=d(),T=1.25,E=!1,D=1e-6,O=.5,k=2e5;export{y as CloudsParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
class e{constructor(e,t,n,r,i,a,o,s,c=.5){this.coverage=e,this.density=t,this.absorption=n,this.cloudSize=r,this.detailSize=i,this.smoothness=a,this.cloudHeight=o,this.raymarchingSteps=s,this.median=c}}const t={sunny:new e([0,.6],[.03,.03],[0,0],[.9,.9],[.8,.8],[.7,.7],[.05,.05],0),cloudy:new e([.3,.65],[.2,.4],[0,0],[.85,.85],[.75,.75],[.3,.4],[1,1],2,.6),rainy:new e([.6,.8],[.5,.8],[.1,.5],[.9,.9],[.75,.75],[.5,.5],[1,1],2,.4),snowy:new e([.25,.75],[.3,.3],[0,0],[.95,.95],[.7,.7],[.69,.75],[.3,1],1,.65),foggy:new e([
|
|
2
|
+
class e{constructor(e,t,n,r,i,a,o,s,c=.5){this.coverage=e,this.density=t,this.absorption=n,this.cloudSize=r,this.detailSize=i,this.smoothness=a,this.cloudHeight=o,this.raymarchingSteps=s,this.median=c}}const t={sunny:new e([0,.6],[.03,.03],[0,0],[.9,.9],[.8,.8],[.7,.7],[.05,.05],0),cloudy:new e([.3,.65],[.2,.4],[0,0],[.85,.85],[.75,.75],[.3,.4],[1,1],2,.6),rainy:new e([.6,.8],[.5,.8],[.1,.5],[.9,.9],[.75,.75],[.5,.5],[1,1],2,.4),snowy:new e([.25,.75],[.3,.3],[0,0],[.95,.95],[.7,.7],[.69,.75],[.3,1],1,.65),foggy:new e([0,0],[.5,.5],[0,0],[.95,.95],[.9,.9],[.55,.55],[.3,.3],0)};t.default=t.sunny;const n=t.cloudy.coverage[0]/t.rainy.coverage[0];export{e as CloudPreset,t as cloudPresets,n as rainyToCloudy};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../environment/FoggyWeather.js";import{mainDepth as n}from"../../core/shaderLibrary/bindUniforms.js";import{ReadDepth as r}from"../../core/shaderLibrary/output/ReadDepth.glsl.js";import{FloatBindUniform as i}from"../../core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as a}from"../../core/shaderModules/FloatPassUniform.js";import{glsl as o}from"../../core/shaderModules/glsl.js";import{Texture2DPassUniform as s}from"../../core/shaderModules/Texture2DPassUniform.js";import{parameter as c}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DistanceFalloffPassParameters as l,getDistanceFalloff as u}from"../raymarching/DistanceFalloff.glsl.js";import{FloatBlendScaleConfiguration as d,floatBlendScale as f}from"../../shaders/floatBlendScale.glsl.js";import{ToneMapping as p}from"../../shaders/ToneMapping.glsl.js";class m extends l{constructor(){super(...arguments),this.mipmapLevels=1,this.boost=1,this.scattering=1e-4}}class h extends d{constructor(){super(...arguments),this.hasFog=!1}}e([c()],h.prototype,`hasFog`,void 0);function g(e,c){e.include(f,c),e.include(u),e.include(r),e.include(p),e.uniforms.add(new s(`emissionTexture`,({emission:e})=>e?.attachment),n,new a(`scattering`,({scattering:e})=>e),new a(`boost`,({boost:e})=>1+e*.5),new a(`levels`,({mipmapLevels:e},{camera:t})=>e+1+Math.log2(t.pixelScale)),new i(`pixelRatioCorrection`,({camera:e})=>Math.log2(e.pixelScale)),new s(`mipmapTexture`,({mipmapTexture:e})=>e?.getTexture())).constants.add(`maxScattering`,`float`,t.maxScattering).constants.add(`maxDispersion`,`float`,c.hasFog?1:.1).code.add(o`vec3 readEmission(float level) {
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../environment/FoggyWeather.js";import{mainDepth as n}from"../../core/shaderLibrary/bindUniforms.js";import{ReadDepth as r}from"../../core/shaderLibrary/output/ReadDepth.glsl.js";import{FloatBindUniform as i}from"../../core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as a}from"../../core/shaderModules/FloatPassUniform.js";import{glsl as o}from"../../core/shaderModules/glsl.js";import{Texture2DPassUniform as s}from"../../core/shaderModules/Texture2DPassUniform.js";import{parameter as c}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DistanceFalloffPassParameters as l,getDistanceFalloff as u}from"../raymarching/DistanceFalloff.glsl.js";import{FloatBlendScaleConfiguration as d,floatBlendScale as f}from"../../shaders/floatBlendScale.glsl.js";import{ToneMapping as p}from"../../shaders/ToneMapping.glsl.js";class m extends l{constructor(){super(...arguments),this.mipmapLevels=1,this.boost=1,this.scattering=1e-4}}class h extends d{constructor(){super(...arguments),this.hasFog=!1}}e([c()],h.prototype,`hasFog`,void 0);function g(e,c){e.include(f,c),e.include(u),e.include(r),e.include(p),e.uniforms.add(new s(`emissionTexture`,({emission:e})=>e?.attachment),new i(`emissionFade`,e=>e.emissionFade),n,new a(`scattering`,({scattering:e})=>e),new a(`boost`,({boost:e})=>1+e*.5),new a(`levels`,({mipmapLevels:e},{camera:t})=>e+1+Math.log2(t.pixelScale)),new i(`pixelRatioCorrection`,({camera:e})=>Math.log2(e.pixelScale)),new s(`mipmapTexture`,({mipmapTexture:e})=>e?.getTexture())).constants.add(`maxScattering`,`float`,t.maxScattering).constants.add(`maxDispersion`,`float`,c.hasFog?1:.1).code.add(o`vec3 readEmission(float level) {
|
|
3
3
|
level *= levels;
|
|
4
4
|
level = max(0.0, level - pixelRatioCorrection);
|
|
5
5
|
return level < 1.0 ?
|
|
@@ -38,5 +38,5 @@ emission += readEmission(point) * weight;
|
|
|
38
38
|
weights += weight;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
return emission * boost / weights;
|
|
41
|
+
return emission * boost / weights * emissionFade;
|
|
42
42
|
}`)}export{h as EmissiveGlowConfiguration,m as EmissiveGlowPassParameters,g as applyEmissiveGlow};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{releaseMaybe as e}from"../../../../core/maybe.js";import{signal as t}from"../../../../core/signal.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import r from"../../webgl/RenderCamera.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{CloudsParameters as a}from"../effects/clouds/CloudsParameters.js";import{enableOITOffset as o}from"./OrderIndependentTransparency.js";import{ReprojectionUniforms as s}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as c}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as l}from"../lighting/SceneLighting.js";class u{constructor(e,t){this.width=e,this.height=t}}class d{constructor(e){this.shadowMap=e,this.output=0,this.slot=2,this.planarDistanceToGroundRatio=1,this.metersPerRenderUnit=1,this.hasOccludees=!1,this._emissions=t(0),this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=t(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.frameRendererTarget=0,this.overlayStretch=1,this.viewshedEnabled=!1,this.laserlinesEnabled=!1,this.shadowAnalysisEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this._camera=t(new r),this._inverseViewport=n(),this._oldLighting=new l,this._newLighting=new l,this._fadedLighting=new l,this._lighting=this._newLighting,this.screenSpaceReflections=new c,this.reprojection=new s,this.highlights=[],this.highlightMixOrigin=n(),this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new a,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=e(this.depth),this.shadowMap?.dispose()}get emissions(){return this._emissions.value}set emissions(e){this._emissions.value=e}get hasEmission(){switch(this.output){case 0:return this.hasOpaqueEmission;case 1:case 2:return this.hasTransparentEmission;default:return!1}}get hasOpaqueEmission(){return this.emissions===1||this.emissions===3}get hasTransparentEmission(){return this.emissions===2||this.emissions===3}get hasEmissions(){return this.emissions!==0}get camera(){return this._camera.value}set camera(e){this._camera.value=e,this._inverseViewport[0]=1/e.fullViewport[2],this._inverseViewport[1]=1/e.fullViewport[3]}get enableOITOffset(){return o(this.output,this.camera)}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(e,t,n,r){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=n,this._newLighting.set(e),this._oldLighting.updateLegacy(),r===1&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return this.frameRendererTarget!==3&&i(this.output)&&this.screenSpaceReflections.enabled&&this.reprojection.lastFrameColor!=null}get highlight(){return this.highlightLevel==null?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(e){e&&(e.name=`geometry depth`),this._depth=e}get occluder(){return this.slot===10||this.slot===11?this.slot:null}}export{d as BindParameters,u as ViewportSize};
|
|
2
|
+
import{releaseMaybe as e}from"../../../../core/maybe.js";import{signal as t}from"../../../../core/signal.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import r from"../../webgl/RenderCamera.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{CloudsParameters as a}from"../effects/clouds/CloudsParameters.js";import{enableOITOffset as o}from"./OrderIndependentTransparency.js";import{ReprojectionUniforms as s}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as c}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as l}from"../lighting/SceneLighting.js";class u{constructor(e,t){this.width=e,this.height=t}}class d{constructor(e){this.shadowMap=e,this.output=0,this.slot=2,this.planarDistanceToGroundRatio=1,this.metersPerRenderUnit=1,this.hasOccludees=!1,this._emissions=t(0),this.emissionFade=1,this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=t(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.frameRendererTarget=0,this.overlayStretch=1,this.viewshedEnabled=!1,this.laserlinesEnabled=!1,this.shadowAnalysisEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this._camera=t(new r),this._inverseViewport=n(),this._oldLighting=new l,this._newLighting=new l,this._fadedLighting=new l,this._lighting=this._newLighting,this.screenSpaceReflections=new c,this.reprojection=new s,this.highlights=[],this.highlightMixOrigin=n(),this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new a,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=e(this.depth),this.shadowMap?.dispose()}get emissions(){return this._emissions.value}set emissions(e){this._emissions.value=e}get hasEmission(){switch(this.output){case 0:return this.hasOpaqueEmission;case 1:case 2:return this.hasTransparentEmission;default:return!1}}get hasOpaqueEmission(){return this.emissions===1||this.emissions===3}get hasTransparentEmission(){return this.emissions===2||this.emissions===3}get hasEmissions(){return this.emissions!==0}get camera(){return this._camera.value}set camera(e){this._camera.value=e,this._inverseViewport[0]=1/e.fullViewport[2],this._inverseViewport[1]=1/e.fullViewport[3]}get enableOITOffset(){return o(this.output,this.camera)}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(e,t,n,r){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=n,this._newLighting.set(e),this._oldLighting.updateLegacy(),r===1&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return this.frameRendererTarget!==3&&i(this.output)&&this.screenSpaceReflections.enabled&&this.reprojection.lastFrameColor!=null}get highlight(){return this.highlightLevel==null?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(e){e&&(e.name=`geometry depth`),this._depth=e}get occluder(){return this.slot===10||this.slot===11?this.slot:null}}export{d as BindParameters,u as ViewportSize};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../core/maybe.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{length as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{RenderNodeOutput as s}from"../../webgl.js";import{BlurEmission as c}from"../effects/glow/BlurEmission.js";import{E as l,a as u}from"../../../../chunks/EmissionComposite.glsl.js";import{EmissionCompositeTechnique as d}from"./EmissionCompositeTechnique.js";import{ColorAttachment1 as f,ColorAttachment0 as p}from"../../../webgl/enums.js";let m=class extends c{constructor(){super(...arguments),this.produces=s.COMPOSITE,this.consumes={required:[s.COMPOSITE]},this._configuration=new l,this._passParameters=new u}initialize(){this.addHandles([n(()=>this.bindParameters.emissions!==0,e=>this.produces=e?s.COMPOSITE:`disabled`,r)])}precompile(){this.bindParameters.emissions!==0&&(this._configuration.
|
|
2
|
+
import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../core/maybe.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{length as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{RenderNodeOutput as s}from"../../webgl.js";import{BlurEmission as c}from"../effects/glow/BlurEmission.js";import{E as l,a as u}from"../../../../chunks/EmissionComposite.glsl.js";import{EmissionCompositeTechnique as d}from"./EmissionCompositeTechnique.js";import{ColorAttachment1 as f,ColorAttachment0 as p}from"../../../webgl/enums.js";let m=class extends c{constructor(){super(...arguments),this.produces=s.COMPOSITE,this.consumes={required:[s.COMPOSITE]},this._configuration=new l,this._passParameters=new u}initialize(){this.addHandles([n(()=>this.bindParameters.emissions!==0,e=>this.produces=e?s.COMPOSITE:`disabled`,r)])}precompile(){this.bindParameters.emissions!==0&&(this._configuration.hasFog=!!this.view.stage.renderView.fog?.renders,this._configuration.applyBlur=!this._configuration.hasFog&&this._hasBlur,super.precompile(),this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value,this.techniques.precompile(d,this._configuration))}get _needsEmissionBlur(){return this._configuration.applyBlur}render(){let e=this.input,n=e.getAttachment(f);if(!n?.attachment)return e;let r=o(this.bindParameters.camera.eye);this._passParameters.atmosphereC=r**2-this._atmosphereRadius**2,this._passParameters.color=e.getAttachment(p)?.attachment,this._passParameters.emission=n,this._passParameters.scattering=this._configuration.applyBlur&&this.view.environmentView.weather?this.view.stage.renderView.fog?.strength??this.view.environment.weather.scattering:0,this._configuration.applyBlur&&this._renderEmissionMipMap();let i=this.renderingContext,a=this.techniques.get(d,this._configuration),s=this.acquireOutputFramebuffer();return i.clear(16384),i.bindTechnique(a,this.bindParameters,this._passParameters),i.screen.draw(),this._passParameters.mipmapTexture=t(this._passParameters.mipmapTexture),s.moveAttachments(e),s}};e([i()],m.prototype,`produces`,void 0),e([i()],m.prototype,`consumes`,void 0),m=e([a(`esri.views.3d.webgl-engine.lib.EmissionComposite`)],m);export{m as EmissionComposite};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import{clamp as e,lerp as t}from"../../../../core/mathUtils.js";class n{constructor(){this._startFactor=0}update(n,r,i,a){let o=r===0?0:1;if(this._target==null?n.emissionFade=o:o!==this._target&&(this._startFactor=n.emissionFade,this._startTime=i),this._target=o,this._startTime!=null){let r=a>0?e((i-this._startTime)/a,0,1):1;n.emissionFade=t(this._startFactor,o,r),r===1&&(this._startTime=null)}return n.emissions=r===0&&n.emissionFade>0?1:r,n.emissionFade!==o}}export{n as EmissionFader};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as n}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as r,abortMaybe as i,destroyMaybe as a,releaseMaybe as o,releaseReferencedMaybe as s}from"../../../../core/maybe.js";import{throwIfAborted as c}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as u,initial as d,sync as f}from"../../../../core/reactiveUtils.js";import{signal as p}from"../../../../core/signal.js";import{property as m,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{equals as g,invert as _,multiply as v,copy as y}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as x}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as ee}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as te,ZEROS as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as ne}from"../../../../geometry/support/Indices.js";import{InternalRenderCategory as C,RenderNodeOutput as w,AllRenderNodeOutputs as T,AllInternalRenderNodeOutputs as E}from"../../webgl.js";import{minNearDistanceInMeters as re}from"../../state/NearFarHeuristic.js";import{debugFlags as ie}from"../../support/debugFlags.js";import{FBOCache as ae}from"../core/FBOCache.js";import{RenderPassManager as oe}from"../core/renderPasses/RenderPassManager.js";import{isColor as se}from"../core/shaderLibrary/ShaderOutput.js";import{RenderNodes as ce}from"../effects/RenderNodes.js";import{RenderPluginContext as le}from"../effects/RenderPluginContext.js";import{RenderPluginManager as D}from"../effects/RenderPluginManager.js";import{WeatherFader as O}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as ue}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as de}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as fe,renderHighlightBuffer as pe}from"../effects/highlight/Highlight.js";import{OITBlend as me}from"../effects/transparency/OITBlend.js";import{AnimationTimer as he}from"./AnimationTimer.js";import{AnimationTimeStep as ge}from"./AnimationTimeStep.js";import{BoundingInfo as _e}from"./BoundingInfo.js";import{Compositor as ve}from"./Compositor.js";import{DepthRange as k}from"./DepthRange.js";import{depthRangeFromScene as A}from"./depthRangeUtils.js";import{MainFramebuffer as ye}from"./MainFramebuffer.js";import{NavigationDepthCache as be}from"./NavigationDepthCache.js";import{blendingColorAlphaClear as j}from"./OrderIndependentTransparency.js";import{RenderContext as M,defaultRenderOccludedMask as N}from"./RenderContext.js";import{RendererBase as xe}from"./RendererBase.js";import{setupFeatureDefaults as P}from"./RenderFeature.js";import{RenderPluginInput as F}from"./RenderPluginInput.js";import{ShadowMap as Se}from"./ShadowMap.js";import Ce from"./SliceHelper.js";import{MergedRenderer as we}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as I}from"../parts/renderUtils.js";import{RendererPerformanceInfo as Te,PerformanceCategory as L}from"../statistics/RendererPerformanceInfo.js";import{PixelType as Ee,ColorAttachment0 as R,ColorAttachment1 as z,ColorAttachment2 as B,DrawBufferNone as De}from"../../../webgl/enums.js";const Oe=has(`disable-feature:async-navigation-3d-depth-readback`);let V=class extends xe{constructor(e,t,n,r,i){super({stage:e}),this._techniques=n,this._rctx=r,this._requestRender=i,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new oe,this._isRendering=!1,this._backgroundColor=te(0,0,0,1),this._sliceHelper=new Ce,this._shadowAccumulator=null,this._shadowCastOptions=null,this.sceneDepthRange=p(k.Infinite),this._state=p(2),this._hasAnimations=!1,this._animationTimestep=new ge,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=p(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new F,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(let t of Me)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new ae(r),this._compositor=new ve(r,n),this._renderStateFeatures=p(P(e.view.qualityProfile));let a=new Se(this._fboCache,e.viewingMode);this._renderContext=new M(this._rctx,a,n),this._framebuffer=new ye(this._fboCache,this._bindParameters),this._performanceInfo=new Te(this._rctx),this._blit=new de(n),this.navigationDepthCache=new be(this._rctx,this._fboCache,n,()=>this._requestRender(0)),this._nodes=new ce(this._renderContext),this._plugins=new D(new le(this._renderContext,n,t,e,i)),this._plugins.add(this.renderPassManager),this.weatherFader=new O({view:e.view,context:this._renderContext}),this.addHandles([l(()=>e.view.state.camera,()=>i(),u),l(()=>ie.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},i()},d),l(()=>e.view.environment.background?.color,e=>{let t=e?e.toUnitRGBA():S;ee(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),i()},u),l(()=>e.view.environmentView.shadowsAvailable,e=>{this._bindParameters.shadowMap.enabled=e,this._requestRender(1)},u),l(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},f),l(()=>this._bindParameters.clouds.data?.state,()=>i(),f),l(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,i()},d),l(()=>e.view.environment.lighting?.type===`sun`,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},u)])}destroy(){this._gpuTimerHandle=r(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator=null,this._shadowCastOptions=null,this._loadEdgeViewTask=i(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.navigationDepthCache.destroy(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,_e.prune(),we.prune(),ne()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new me(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=P(e),this.updateGlobalIllumination(this.stage.view.environment.lighting.globalIllumination),this._requestRender()}updateGlobalIllumination(e){let t=P(this.stage.view.qualityProfile);for(let n of[0,1,2])this.setFeatureEnabled(11,n,e),this.setFeatureEnabled(10,n,e&&n===2),this.setFeatureEnabled(3,n,!e&&(t.get(n,3)??!1))}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,n){this.isFeatureEnabled(e,t)!==n&&(this._renderStateFeatures.mutate(r=>r.set(t,e,n)),this._requestRender())}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this._nodes.produces(C.AMBIENT_ILLUMINATION)}get hasGlobalIllumination(){return this.stage.renderView?.globalIllumination?.enabled??!1}get hasGlobalIlluminationHighQuality(){let e=this.stage.renderView?.globalIllumination;return this.hasGlobalIllumination&&e?.hasHighQuality===!0}get hasSMAA(){return this.isFeatureEnabled(0)}get _emissions(){let e=this._plugins.emissions;return this._hasTransparentGeometry?e:+(e===1||e===3)}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}setShadowAccumulator(e){this._shadowAccumulator=e,this._shadowCastOptions&&e.setParameters(this._shadowCastOptions)}_releaseFBOs(){this._bindParameters.hudOcclusion=o(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose();let e=this._bindParameters;e.globalIllumination=o(e.globalIllumination),e.reprojection.lastFrameDepth=o(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=o(e.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||=n(async e=>{let{EdgeView:t}=await import(`./edgeRendering/EdgeView.js`);c(e);let n=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ne(this.stage.view.resourceController)});return this.addHandles(l(()=>n.updating,()=>this._requestRender(),f)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(n)),this._edgeViewCallbacks.length=0,n}),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView().catch(()=>{}),this._edgeView==null?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&g(this._bindParameters.reprojection.matrix,b)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&(this._shadowCastOptions={...this._shadowCastOptions,...e.shadowCast},this._shadowAccumulator?.setParameters(e.shadowCast))}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn(`Renderer.modify called while rendering`),super.commit(e,t,this._plugins.context)?(this.updateHasFlags(),!0):!1}addRenderer(e){this._plugins.add(e)}removeRenderer(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(this.plugins.renderOccludedFlags&8)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){let has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...J),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new he(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);let n=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==n&&(this._gpuTimerHandle=n?r(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,n=!1){try{this._isRendering=!0,this._needsOffscreenPrepass(e.camera,t)&&this._render(e,3,n).color?.release();let r=this._render(e,t,n);return t!==0&&this._disposeOffscreenBuffers(),r}catch(e){console.error(`Exception during rendering: ${e}:\n${e.stack}`)}finally{this._isRendering=!1}return new I(this._pluginInput.get(w.FINAL),null)}_needsOffscreenPrepass(e,t){return(t===1||t===2)&&(this.hasGlobalIllumination||this.hasReflections)&&(!this._framebuffer.hasColor||!this._bindParameters.reprojection.lastFrameCamera.equals(e))}_render(e,t,n){let r=t===0;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r,this._disposeBindBuffers();let{camera:i,contentCamera:a,mode:c,alignPixelEnabled:l}=e;this._state.value=c,this._bindParameters.frameRendererTarget=t,this._bindParameters.output=0,this._bindParameters.emissions=this._emissions,this._bindParameters.alignPixelEnabled=l,this._bindParameters.metersPerRenderUnit=this.stage.view.renderCoordsHelper.unitInMeters,this._bindParameters.decorations=!n,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;let u=!n||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=u?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(C.VIEWSHED),this._bindParameters.laserlinesEnabled=this._nodes.produces(C.LASERLINES),this._bindParameters.shadowAnalysisEnabled=!!this._shadowAccumulator?.active,this._bindParameters.cutFillComputationEnabled=this._nodes.produces(C.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(C.CUTFILL),this._ensureBindParameters(i,a),this._plugins.sortTestsTransparentOrderedSlots(Ae),this._plugins.prepareRender(),this._hasTransparentGeometry=this._plugins.produces(1,...U),this._renderOverlay(),i.setGLViewport(this._rctx);let d=this._framebuffer,f=d.initialize(i.fullWidth,i.fullHeight,this._backgroundColor);this.hasReflections?(f?.setName(`last frame color`),this._bindParameters.reprojection.lastFrameColor?.release(),this._bindParameters.reprojection.lastFrameColor=f):f?.release(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!n,this._precompilePrepasses(),this.performanceInfo.advance(L.PREPARE);let p=this._computeShadowDepthRange(i);this._pluginInput.set(`normals`,this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(i,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p),d.bind(),this._bindParameters.mainDepth=d.depth.attachment,this._precompileShaders(r),this._bindParameters.output=0,this._renderOpaque(),this._renderPreTransparent(),this._renderTransparent(),this._3dGeometryRendered(),d.update(e=>this._renderNodes(C.CUTFILL_COMPUTATION,e)),this._pluginInput.set(C.FOCUSAREA_MASK,this._renderFocusAreaMask()),d.update(e=>this._renderNodes(C.TRANSPARENT_ENVIRONMENT,e)),d.update(e=>this._renderNodes(C.VIEWSHED,e)),d.update(e=>this._renderNodes(C.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=s(this._bindParameters.depth)),d.update(e=>this._renderNodes(C.FOCUSAREA,e)),this._pluginInput.release(C.FOCUSAREA_MASK),d.update(e=>this._renderNodes(C.CUTFILL,e)),this._pluginInput.release(C.GROUND_DEPTH),d.update(e=>this._renderNodes(C.OCCLUDED,e)),this._pluginInput.set(`highlights`,this._renderHighlightPrepass());let m=t===2?this._renderObjectAndLayerIdColor():null;d.update(e=>this._renderNodes(w.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=o(this._bindParameters.shadowHighlight),d.update(e=>this._renderNodes(C.ANTIALIASING,e));let h=this._hasTransparentGeometry?2:1,g=this._bindParameters.emissions;this._bindParameters.emissions=0,this._hasHUDHighlights&&d.update(e=>this._renderHUD(h,e)),d.update(e=>this._renderNodes(C.HIGHLIGHT,e)),this._hasHUDHighlights||d.update(e=>this._renderHUD(h,e)),this._bindParameters.emissions=g,d.update(e=>this._renderNodes(C.MAGNIFIER,e)),d.update(e=>this._renderNodes(w.FINAL,e)),r&&(this._blit.toFramebuffer(d.color,this._bindParameters),Oe||c!==2&&c!==0||this.navigationDepthCache.update(this._bindParameters,d.depth.attachment,this._renderContext.time)),this._bindParameters.reprojection.lastFrameDepth?.release(),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=s(this._bindParameters.depth)),this._releaseFBOs(),d.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd();let _;return r||(_=d.color,_.retain()),this.performanceInfo.finishFrame(),new I(_,m)}_precompileShaders(e){++this._plugins.context.techniques.precompiling;let t=this._bindParameters;t.output=0;let n=t.emissions;if(this._precompileOpaqueGeometry(),this._nodes.precompile(C.OPAQUE_ENVIRONMENT,C.GAUSSIAN_SPLAT,C.OPAQUE_OCCLUSION_QUERY,C.VOXEL),this._precompileOpaqueGeometry(),t.output=3,this._plugins.precompile(...W),t.output=0,this._plugins.precompile(...W),this._hasTransparentGeometry){let e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(t,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(t,!1,1),this._precompileTransparentGeometry(),t.hasTransparentEmission&&(t.emissions=3)}this._nodes.precompile(C.FOCUSAREA_MASK),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,t),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(C.TRANSPARENT_ENVIRONMENT,C.VIEWSHED,C.CUTFILL_COMPUTATION,C.CUTFILL,C.LASERLINES,C.FOCUSAREA,C.OCCLUDED,C.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0);let r=t.emissions;t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=r,this._hasHighlights&&(t.highlights.forEach((e,n)=>{t.highlightLevel=n,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(C.HIGHLIGHT)),t.highlightMixTexture=null,this._nodes.precompile(w.COMPOSITE,C.MAGNIFIER),this._nodes.precompile(C.TRANSPARENT_NO_DEPTH),this._plugins.precompile(8),t.hasOpaqueEmission&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),t.emissions=n,--this._plugins.context.techniques.precompiling}_renderFocusAreaMask(){let e=this._nodes.produce(C.FOCUSAREA_MASK,this._pluginInput);return e&&this.performanceInfo.advance(L.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces(C.OBJECT_AND_LAYER_ID_COLOR))return null;let e=this._bindParameters.output;++this._techniques.precompiling;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,C.OBJECT_AND_LAYER_ID_COLOR).acquireDepth(14);return r=this._renderNodes(C.OBJECT_AND_LAYER_ID_COLOR,r),--this._techniques.precompiling,this._bindParameters.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();let t=this.performanceInfo.gpuSamplingEnabled,n=e===0,r=n?this.performanceInfo.elapsedTime:0;if(n||t){let e=0;t?e=this.performanceInfo.totalGPUTimeSampler.last:(this._rctx.gl.finish(),e=this.performanceInfo.elapsedTime);let i=Math.max(r,e);this._animationTimestep.frame(i,n)}}readAccumulatedShadow(e){return this._shadowAccumulator?.readAccumulatedShadow(e[0],e[1])??0}readMainDepth(e,t){let{mainDepth:n,camera:r}=this._bindParameters;if(!n)return;let i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,`linear depth`);this._rctx.bindFramebuffer(i.fbo),r.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(S),this._compositor.blitDepthToLinearDepth(this._bindParameters,n),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),i.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,Ee.UNSIGNED_BYTE,t),i.release()}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){let t=this._needsEdges;if(!t)return;let{width:n,height:r}=this._framebuffer.size,i=this.fboCache.acquire(n,r,`edges`);i.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(S),t.render(this._bindParameters,e),i.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===1?L.OPAQUE_EDGES:L.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(L.OVERLAY)}_renderShadowMap(e,t,n,r){if(!this.shadowsEnabled)return;let i=this._bindParameters.shadowMap;if(i.start(e,n,r,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,i),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);let n=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(C.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=n,i.disposeOutput(6),i.clear(),this._renderShadowCascades(7,i)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=s(this._bindParameters.depth)),this.performanceInfo.advance(C.SHADOWMAP)}_precompileShadowCascades(e){this._bindParameters.shadowMap.cascades.length!==0&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){let n=this._bindParameters.output,r=e!==6;t.bindFramebuffer();for(let n of t.cascades)n.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(n.camera,n.camera),this.renderAllGeometry(e),r&&this._renderShadowNodes(t.renderTarget);t.finish(e),this._bindParameters.output=n}_renderShadowNodes(e){this._renderInternalNodeCategory(C.SHADOWMAP,e)}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._testsNeedsDepth+ +this._needsShadowHighlight}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){let e=this._bindParameters;e.depth=o(this._bindParameters.depth);let t=this._pluginInput.get(`normals`);if(t){let n=this._nodes.produce(C.AMBIENT_ILLUMINATION,this._pluginInput);this._pluginInput.set(C.AMBIENT_ILLUMINATION,n),this._releaseGlobalIlluminationBuffers(),e.ssao=this.hasGlobalIllumination?null:n,e.globalIllumination=this.hasGlobalIllumination?n:null,e.globalIlluminationEnabled=e.globalIllumination!=null,n&&this.performanceInfo.advance(this.hasGlobalIlluminationHighQuality?L.AMBIENT_ILLUMINATION_HIGH_QUALITY:L.AMBIENT_ILLUMINATION);let r=this._needsDepth;if(r){let n=t.obtainAttachment(R);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),e.depth=t.obtainDepthTexture(),e.depth?.retain(r-1),t.attachColor(n,R),n?.release(),this.performanceInfo.advance(L.DEPTH)}else t.detachDepth();this.hasAmbientIllumination&&this._pluginInput.release(`normals`)}else this._releaseGlobalIlluminationBuffers(),e.ssao=null,this._pluginInput.set(C.AMBIENT_ILLUMINATION,null),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){let e=this._needsDepth;if(e===0)return;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,`geometry depth`,14);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._renderGaussianSplatPrepassDepth(r),this._bindParameters.depth=r.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),r.release(),this.performanceInfo.advance(L.DEPTH)}_renderGaussianSplatPrepassDepth(e){let t=this._shadowAccumulator;if(!t?.active||!t.requireGeometryDepth)return;let n=this._bindParameters.output;this._bindParameters.output=3,this._renderInternalNodeCategory(C.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=n}_renderGaussianSplatDepthAndNormals(e){let t=this._bindParameters.output;this._bindParameters.output=4,this._renderInternalNodeCategory(C.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=t}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||!!this._shadowAccumulator?.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return k.Zero;let t=A(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.union(this._nodes.queryDepthRange(C.SHADOWMAP,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal||this.stage.view.renderCoordsHelper.getAltitude(e.eye)<ue){this.sceneDepthRange.value=k.Infinite;return}let t=e.clone();t.near=re,t.far=1e10;let n=A(t,this._plugins.plugins,this.stage.layers,1);n.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(n)||(this.sceneDepthRange.value=n)}get _normalsRequired(){return this._nodes.require(`normals`,...T,C.VIEWSHED,C.LASERLINES)+ +!!this.hasAmbientIllumination}_precompilePrepasses(){let e=!!this._normalsRequired;if(e?(this._precompilePlugins(4,G),this._needsDepth&&this._precompilePlugins(3,K)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(C.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator?.active&&(this._nodes.precompile(C.SHADOW_ACCUMULATION),this._precompileAllGeometry(5)),this._shadowAccumulator?.active||e){let t=this._bindParameters.output;this._bindParameters.output=e?4:3,this._nodes.precompile(C.GAUSSIAN_SPLAT_DEPTH),this._bindParameters.output=t}(this.shadowsEnabled||this._shadowAccumulator?.active)&&this._nodes.precompile(C.SHADOWMAP),this.hasAmbientIllumination&&e&&this._nodes.precompile(C.AMBIENT_ILLUMINATION)}_renderNormals(){let e=this._normalsRequired;if(e===0)return;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,`normals`);r.acquireDepth(14),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(S,!0,!0),this._bindParameters.output=4,this._plugins.render(...G),this._renderGaussianSplatDepthAndNormals(r);let i=this._nodes.optional(`normals`,...T,C.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(L.NORMALS),r}_releaseGlobalIlluminationBuffers(){let e=this._bindParameters;e.reprojection.lastFrameDepth=o(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=o(e.reprojection.lastFrameEmission),e.globalIllumination=s(e.globalIllumination),e.globalIlluminationEnabled=!1}_precompileAllGeometry(e){let t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...W),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(let n of t)this._bindParameters.slot=n,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(let n of t)this._renderContext.renderOccludedMask=n,this.precompileSlots(e,...q);this._renderContext.renderOccludedMask=N}renderSlots(e,...t){for(let n of t)this._bindParameters.slot=n,e.forAll(e=>{let t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...q),this._renderContext.renderOccludedMask=N}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...je[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){let e=this._bindParameters.output;this._bindParameters.output=8,this._precompileAllGeometry(8),this._nodes.precompile(C.SHADOWMAP),this._bindParameters.output=e}precompileCutFillDepth(){this._precompilePlugins(9,Y)}_precompilePlugins(e,t){let n=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=n}renderViewshedShadowMap(e,t){let{camera:n,contentCamera:r}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._renderShadowNodes(t),this._ensureBindParametersCamera(n,r),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=i}renderCutFillDepth(e){let{camera:t,contentCamera:n}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Y),this._ensureBindParametersCamera(t,n),t.setGLViewport(this._rctx),this._bindParameters.output=r}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;let{width:e,height:t}=this._framebuffer.size,n=this.fboCache.acquire(e,t,C.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,n.fbo,256),this._framebuffer.bind(),n}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...K)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...H),this._nodes.precompile(`opaque-color`))}_renderOpaqueGeometry(){this._plugins.render(...H)}_renderTransparentGeometry(){this._plugins.render(...U),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...W)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;let t=this._bindParameters.output,n=this._bindParameters.hudRenderStyle,r=this._bindParameters.emissions;this._bindParameters.emissions=0,this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...J),this._bindParameters.output=2,this._plugins.precompile(...J),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...J)),this._bindParameters.emissions=r,this._bindParameters.output=t,this._bindParameters.hudRenderStyle=n}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;let n=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);let r=!!t.getTexture(z);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,n.getTexture(),r),n.release(),this.performanceInfo.advance(e===0?L.HUD_OCCLUDED:L.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;let{fboCache:e,_rctx:t,_bindParameters:n}=this,{width:r,height:i}=this._framebuffer.size,{highlights:a}=n,o=a.length>fe?3:1,s=e.acquire(r,i,`highlights`,o);s.acquireDepth(14);let c=this._plugins.produces(10,0);return c&&this._framebuffer.color.fbo&&s.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,1024),t.bindFramebuffer(s.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),c||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(s.fbo),pe(t,e,r,i,n,()=>this._renderHighlightGeometries()),s.detachDepth(),this.performanceInfo.advance(L.HIGHLIGHTS),s.retain(this._nodes.require(`highlights`,...E)+this._nodes.optional(`highlights`,...E)-1),s}_renderHighlightGeometries(){this._plugins.render(...ke),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e){let t=this._shadowAccumulator;if(!t)return;t.updateDepthRange(e);let n=t.requireGeometryDepth;this._bindParameters.output=0;let r=this._nodes.produce(C.SHADOW_ACCUMULATION,this._pluginInput);t.didAccumulate&&this.performanceInfo.advance(L.ACCUMULATED_SHADOWS),this._pluginInput.set(C.SHADOW_ACCUMULATION,null),r?.release(),n&&(this._bindParameters.depth=s(this._bindParameters.depth))}renderShadowAccumulationShadowMap(e,t,n,r,i){let a=this.stage.view.qualitySettings.maximumPixelRatio;n.start(e,r,i,!0,a),this._renderShadowCascades(5,n),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t)}_precompileTransparentGeometry(){se(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...U),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...U),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...U)}_renderOIT(e,t=2){let n=e===1,{width:r,height:i}=this._framebuffer.size,a=n?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),s=this._bindParameters,c=s.useFloatBlend.value?8:5,l=s.output;s.output=1;let u=n?`oit hud`:`oit`,d=this.fboCache.acquire(r,i,u,c).acquireColor(z,this.hasFloatBlend?7:0,`oit alpha`),f=s.hasEmission&&(e===0||t!==1);f&&d.acquireColor(B,c,`oit emissive`),n||d.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(d.fbo),this._rctx.clearFramebuffer(j),f&&this._rctx.clearBuffer(2,j),a(),d.detachDepth(),s.output=2;let p=this.fboCache.acquire(r,i,n?`oit front hud`:`oit front`);f&&p.acquireColor(z,c,`oit front emissive`),n?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(S,n),a(),p.detachDepth();let m=this._pluginsHas.occludedHudElements&&!n,h=m&&s.emissions!==0?B:z;s.hudOcclusion=o(this._bindParameters.hudOcclusion),s.output=0;let g;return n?(g=this.fboCache.acquire(r,i,`oit composite hud`),this._rctx.bindFramebuffer(g.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(s.emissions!==0&&this._framebuffer.ensureEmissionAttachment(),m&&(this._framebuffer.color.acquireColor(h,0,`hud occlusion`),this._rctx.clearBuffer(h-R,S)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,d,p,s,m,e,this._fboCache.debugCallback),g?.detachDepth(),n||(f&&(this._bindParameters.emissions=3),m&&(s.hudOcclusion=this._framebuffer.color.obtainAttachment(h))),p.release(),d.release(),s.output=l,g}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...H)||this.plugins.produces(5,...H)||this.plugins.produces(3,3)}_renderOpaque(){let e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(C.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));let t=this._framebuffer;t.update(t=>this._renderNodes(w.OPAQUE,t,e)),this.fboCache.debugCallback?.(w.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(C.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(C.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(C.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(C.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(C.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(C.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(C.VOXEL,e)),this.fboCache.debugCallback?.(C.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){let e=this._framebuffer;if(this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(w.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(w.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=o(this._bindParameters.ssao),e.update(e=>this._renderNodes(C.TRANSPARENT_NO_DEPTH,e)),this.fboCache.debugCallback?.(C.TRANSPARENT_NO_DEPTH,e.color.fbo),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){let e=this._rctx.setDrawBuffers([De,z]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(L.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,n=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return n&&this.performanceInfo.advance(e),t;let r=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),this._fboCache.debugCallback?.(e,r.fbo),r}_renderInternalNodeCategory(e,t){if(!t)return;let n=t.name;try{this._renderNodes(e,t)}finally{this._pluginInput.set(e,null),t.setName(n)}}_3dGeometryRendered(){let e=this._bindParameters;this.hasReflections&&(e.depth=s(e.depth),e.reprojection.lastFrameColor=s(e.reprojection.lastFrameColor)),e.shadowMap.disposeOutput(5);let t=this._framebuffer.color.getAttachment(z)?.attachment;if(this.hasGlobalIllumination&&t){let{width:n,height:r}=this._framebuffer.size,i=e.useFloatBlend.value?8:5;e.reprojection.lastFrameEmission=this.fboCache.acquire(n,r,`emissive`,i),this._blit.blitTexture(t,e,e.reprojection.lastFrameEmission.fbo)}}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){this.stage.viewingMode===1&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration,this.stage.view.state.stationary),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){let{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){this._ssrEnableTime??=e;let n=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=n>0?Math.min(n,e-this._ssrEnableTime)/n:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination)){this._reprojectionMatrix=b;return}let{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:n}=e,r=!n.equals(t);if(r?(_(Z,t.viewMatrix),_(X,t.projectionMatrix),v(Q,Z,X),v(Q,n.viewMatrix,Q),v(Q,n.projectionMatrix,Q),this._reprojectionMatrix=Q):this._reprojectionMatrix=b,this.hasGlobalIllumination){let{viewMatrix:t}=e;r?(v($,n.viewMatrix,Z),y(t,$)):y(t,b)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,n,r){this._bindParameters.updateLighting(e,t,n,r),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([m({readOnly:!0})],V.prototype,`highResolutionAtmosphere`,null),e([m()],V.prototype,`_edgeView`,void 0),e([m()],V.prototype,`updating`,null),e([m()],V.prototype,`_loadEdgeViewTask`,void 0),V=e([h(`esri.views.3d.webgl-engine.lib.Renderer`)],V);const H=[0,1,2,3],U=[7,6,4,5],W=[7,6],G=[0,1,2,4,...W],K=[3,5],q=[2,4,8],J=[16,12,14,13],ke=[4,5,2,3,0,1,...W],Ae=[4,8,5,11],je={0:[13],1:[12],2:[13,12],3:[13,12]},Y=[0,1,...W],Me=[`normals`,`highlights`],X=x(),Z=x(),Q=x(),$=x();function Ne(e){return t=>e.immediate.schedule(t)}export{V as Renderer};
|
|
2
|
+
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as n}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as r,abortMaybe as i,destroyMaybe as a,releaseMaybe as o,releaseReferencedMaybe as s}from"../../../../core/maybe.js";import{throwIfAborted as c}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as u,initial as d,sync as f}from"../../../../core/reactiveUtils.js";import{signal as p}from"../../../../core/signal.js";import{property as m,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{equals as g,invert as _,multiply as v,copy as y}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as x}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as ee}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as te,ZEROS as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as ne}from"../../../../geometry/support/Indices.js";import{InternalRenderCategory as C,RenderNodeOutput as w,AllRenderNodeOutputs as T,AllInternalRenderNodeOutputs as E}from"../../webgl.js";import{minNearDistanceInMeters as re}from"../../state/NearFarHeuristic.js";import{debugFlags as ie}from"../../support/debugFlags.js";import{FBOCache as ae}from"../core/FBOCache.js";import{RenderPassManager as oe}from"../core/renderPasses/RenderPassManager.js";import{isColor as se}from"../core/shaderLibrary/ShaderOutput.js";import{RenderNodes as ce}from"../effects/RenderNodes.js";import{RenderPluginContext as le}from"../effects/RenderPluginContext.js";import{RenderPluginManager as ue}from"../effects/RenderPluginManager.js";import{WeatherFader as de}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as fe}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as pe}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as D,renderHighlightBuffer as me}from"../effects/highlight/Highlight.js";import{OITBlend as he}from"../effects/transparency/OITBlend.js";import{AnimationTimer as ge}from"./AnimationTimer.js";import{AnimationTimeStep as _e}from"./AnimationTimeStep.js";import{BoundingInfo as ve}from"./BoundingInfo.js";import{Compositor as ye}from"./Compositor.js";import{DepthRange as O}from"./DepthRange.js";import{depthRangeFromScene as k}from"./depthRangeUtils.js";import{EmissionFader as be}from"./EmissionFader.js";import{MainFramebuffer as xe}from"./MainFramebuffer.js";import{NavigationDepthCache as A}from"./NavigationDepthCache.js";import{blendingColorAlphaClear as j}from"./OrderIndependentTransparency.js";import{RenderContext as M,defaultRenderOccludedMask as N}from"./RenderContext.js";import{RendererBase as Se}from"./RendererBase.js";import{setupFeatureDefaults as P}from"./RenderFeature.js";import{RenderPluginInput as Ce}from"./RenderPluginInput.js";import{ShadowMap as we}from"./ShadowMap.js";import Te from"./SliceHelper.js";import{MergedRenderer as Ee}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as F}from"../parts/renderUtils.js";import{RendererPerformanceInfo as De,PerformanceCategory as I}from"../statistics/RendererPerformanceInfo.js";import{PixelType as Oe,ColorAttachment0 as L,ColorAttachment1 as R,ColorAttachment2 as z,DrawBufferNone as ke}from"../../../webgl/enums.js";const Ae=has(`disable-feature:async-navigation-3d-depth-readback`);let B=class extends Se{constructor(e,t,n,r,i){super({stage:e}),this._techniques=n,this._rctx=r,this._requestRender=i,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new oe,this._isRendering=!1,this._backgroundColor=te(0,0,0,1),this._sliceHelper=new Te,this._shadowAccumulator=null,this._shadowCastOptions=null,this.sceneDepthRange=p(O.Infinite),this._state=p(2),this._emissionFader=new be,this._hasAnimations=!1,this._animationTimestep=new _e,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=p(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new Ce,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(let t of Ne)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new ae(r),this._compositor=new ye(r,n),this._renderStateFeatures=p(P(e.view.qualityProfile));let a=new we(this._fboCache,e.viewingMode);this._renderContext=new M(this._rctx,a,n),this._framebuffer=new xe(this._fboCache,this._bindParameters),this._performanceInfo=new De(this._rctx),this._blit=new pe(n),this.navigationDepthCache=new A(this._rctx,this._fboCache,n,()=>this._requestRender(0)),this._nodes=new ce(this._renderContext),this._plugins=new ue(new le(this._renderContext,n,t,e,i)),this._plugins.add(this.renderPassManager),this.weatherFader=new de({view:e.view,context:this._renderContext}),this.addHandles([l(()=>e.view.state.camera,()=>i(),u),l(()=>ie.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},i()},d),l(()=>e.view.environment.background?.color,e=>{let t=e?e.toUnitRGBA():S;ee(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),i()},u),l(()=>e.view.environmentView.shadowsAvailable,e=>{this._bindParameters.shadowMap.enabled=e,this._requestRender(1)},u),l(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},f),l(()=>this._bindParameters.clouds.data?.state,()=>i(),f),l(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,i()},d),l(()=>e.view.environment.lighting?.type===`sun`,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},u)])}destroy(){this._gpuTimerHandle=r(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator=null,this._shadowCastOptions=null,this._loadEdgeViewTask=i(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.navigationDepthCache.destroy(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,ve.prune(),Ee.prune(),ne()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new he(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=P(e),this.updateGlobalIllumination(this.stage.view.environment.lighting.globalIllumination),this._requestRender()}updateGlobalIllumination(e){let t=P(this.stage.view.qualityProfile);for(let n of[0,1,2])this.setFeatureEnabled(11,n,e),this.setFeatureEnabled(10,n,e&&n===2),this.setFeatureEnabled(3,n,!e&&(t.get(n,3)??!1))}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,n){this.isFeatureEnabled(e,t)!==n&&(this._renderStateFeatures.mutate(r=>r.set(t,e,n)),this._requestRender())}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this._nodes.produces(C.AMBIENT_ILLUMINATION)}get hasGlobalIllumination(){return this.stage.renderView?.globalIllumination?.enabled??!1}get hasGlobalIlluminationHighQuality(){let e=this.stage.renderView?.globalIllumination;return this.hasGlobalIllumination&&e?.hasHighQuality===!0}get hasSMAA(){return this.isFeatureEnabled(0)}get _emissions(){let e=this._plugins.emissions;return this._hasTransparentGeometry?e:+(e===1||e===3)}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}setShadowAccumulator(e){this._shadowAccumulator=e,this._shadowCastOptions&&e.setParameters(this._shadowCastOptions)}_releaseFBOs(){this._bindParameters.hudOcclusion=o(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose();let e=this._bindParameters;e.globalIllumination=o(e.globalIllumination),e.reprojection.lastFrameDepth=o(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=o(e.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||=n(async e=>{let{EdgeView:t}=await import(`./edgeRendering/EdgeView.js`);c(e);let n=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Pe(this.stage.view.resourceController)});return this.addHandles(l(()=>n.updating,()=>this._requestRender(),f)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(n)),this._edgeViewCallbacks.length=0,n}),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView().catch(()=>{}),this._edgeView==null?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&g(this._bindParameters.reprojection.matrix,b)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&(this._shadowCastOptions={...this._shadowCastOptions,...e.shadowCast},this._shadowAccumulator?.setParameters(e.shadowCast))}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn(`Renderer.modify called while rendering`),super.commit(e,t,this._plugins.context)?(this.updateHasFlags(),!0):!1}addRenderer(e){this._plugins.add(e)}removeRenderer(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(this.plugins.renderOccludedFlags&8)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){let has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...q),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new ge(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);let n=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==n&&(this._gpuTimerHandle=n?r(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,n=!1){try{this._isRendering=!0,this._needsOffscreenPrepass(e.camera,t)&&this._render(e,3,n).color?.release();let r=this._render(e,t,n);return t!==0&&this._disposeOffscreenBuffers(),r}catch(e){console.error(`Exception during rendering: ${e}:\n${e.stack}`)}finally{this._isRendering=!1}return new F(this._pluginInput.get(w.FINAL),null)}_needsOffscreenPrepass(e,t){return(t===1||t===2)&&(this.hasGlobalIllumination||this.hasReflections)&&(!this._framebuffer.hasColor||!this._bindParameters.reprojection.lastFrameCamera.equals(e))}_render(e,t,n){let r=t===0;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r,this._disposeBindBuffers();let{camera:i,contentCamera:a,mode:c,alignPixelEnabled:l}=e;this._state.value=c;let u=this._bindParameters,d=this.stage.view,f=this._renderContext.time;u.frameRendererTarget=t,u.output=0,u.alignPixelEnabled=l,u.metersPerRenderUnit=d.renderCoordsHelper.unitInMeters,u.decorations=!n,u.mainDepth=null,u.useFloatBlend.value=this.hasFloatBlend,u.slicePlane=!n||!this._sliceHelper.isDecoration?this._sliceHelper.plane:null,u.viewshedEnabled=this._nodes.produces(C.VIEWSHED),u.laserlinesEnabled=this._nodes.produces(C.LASERLINES),u.shadowAnalysisEnabled=!!this._shadowAccumulator?.active,u.cutFillComputationEnabled=this._nodes.produces(C.CUTFILL_COMPUTATION),u.cutFillVisualizationEnabled=this._nodes.produces(C.CUTFILL),this._ensureBindParameters(i,a),this._plugins.sortTestsTransparentOrderedSlots(J),this._plugins.prepareRender(),this._hasTransparentGeometry=this._plugins.produces(1,...H),this._emissionFader.update(u,this._emissions,f,d.qualitySettings.fadeDuration)&&this._requestRender(),this._renderOverlay(),i.setGLViewport(this._rctx);let p=this._framebuffer,m=p.initialize(i.fullWidth,i.fullHeight,this._backgroundColor);this.hasReflections?(m?.setName(`last frame color`),u.reprojection.lastFrameColor?.release(),u.reprojection.lastFrameColor=m):m?.release(),u.hasShadowHighlights=this._needsShadowHighlight&&!n,this._precompilePrepasses(),this.performanceInfo.advance(I.PREPARE);let h=this._computeShadowDepthRange(i);this._pluginInput.set(`normals`,this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(i,a,u.lighting.mainLight.direction,h),this._renderShadowAccumulation(h),p.bind(),u.mainDepth=p.depth.attachment,this._precompileShaders(r),u.output=0,this._renderOpaque(),this._renderPreTransparent(),this._renderTransparent(),this._3dGeometryRendered(),p.update(e=>this._renderNodes(C.CUTFILL_COMPUTATION,e)),this._pluginInput.set(C.FOCUSAREA_MASK,this._renderFocusAreaMask()),p.update(e=>this._renderNodes(C.TRANSPARENT_ENVIRONMENT,e)),p.update(e=>this._renderNodes(C.VIEWSHED,e)),p.update(e=>this._renderNodes(C.LASERLINES,e)),this._nodes.requireGeometryDepth&&(u.depth=s(u.depth)),p.update(e=>this._renderNodes(C.FOCUSAREA,e)),this._pluginInput.release(C.FOCUSAREA_MASK),p.update(e=>this._renderNodes(C.CUTFILL,e)),this._pluginInput.release(C.GROUND_DEPTH),p.update(e=>this._renderNodes(C.OCCLUDED,e)),this._pluginInput.set(`highlights`,this._renderHighlightPrepass());let g=t===2?this._renderObjectAndLayerIdColor():null;p.update(e=>this._renderNodes(w.COMPOSITE,e)),u.shadowMap.disposeOutputs(),u.shadowHighlight=o(u.shadowHighlight),p.update(e=>this._renderNodes(C.ANTIALIASING,e));let _=this._hasTransparentGeometry?2:1,v=u.emissions;u.emissions=0,this._hasHUDHighlights&&p.update(e=>this._renderHUD(_,e)),p.update(e=>this._renderNodes(C.HIGHLIGHT,e)),this._hasHUDHighlights||p.update(e=>this._renderHUD(_,e)),u.emissions=v,p.update(e=>this._renderNodes(C.MAGNIFIER,e)),p.update(e=>this._renderNodes(w.FINAL,e)),r&&(this._blit.toFramebuffer(p.color,u),Ae||c!==2&&c!==0||this.navigationDepthCache.update(u,p.depth.attachment,f)),u.reprojection.lastFrameDepth?.release(),this.hasGlobalIllumination&&(u.reprojection.lastFrameDepth=u.depth),this._testsNeedsDepth&&(u.depth=s(u.depth)),this._releaseFBOs(),p.releaseDepth(),u.reprojection.lastFrameCamera.copyFrom(u.camera),this.fboCache.frameEnd();let y;return r||(y=p.color,y.retain()),this.performanceInfo.finishFrame(),new F(y,g)}_precompileShaders(e){++this._plugins.context.techniques.precompiling;let t=this._bindParameters;t.output=0;let n=t.emissions;if(this._precompileOpaqueGeometry(),this._nodes.precompile(C.OPAQUE_ENVIRONMENT,C.GAUSSIAN_SPLAT,C.OPAQUE_OCCLUSION_QUERY,C.VOXEL),this._precompileOpaqueGeometry(),t.output=3,this._plugins.precompile(...U),t.output=0,this._plugins.precompile(...U),this._hasTransparentGeometry){let e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(t,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(t,!1,1),this._precompileTransparentGeometry(),t.hasTransparentEmission&&(t.emissions=3)}this._nodes.precompile(C.FOCUSAREA_MASK),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,t),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(C.TRANSPARENT_ENVIRONMENT,C.VIEWSHED,C.CUTFILL_COMPUTATION,C.CUTFILL,C.LASERLINES,C.FOCUSAREA,C.OCCLUDED,C.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0);let r=t.emissions;t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=r,this._hasHighlights&&(t.highlights.forEach((e,n)=>{t.highlightLevel=n,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(C.HIGHLIGHT)),t.highlightMixTexture=null,this._nodes.precompile(w.COMPOSITE,C.MAGNIFIER),this._nodes.precompile(C.TRANSPARENT_NO_DEPTH),this._plugins.precompile(8),t.hasOpaqueEmission&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),t.emissions=n,--this._plugins.context.techniques.precompiling}_renderFocusAreaMask(){let e=this._nodes.produce(C.FOCUSAREA_MASK,this._pluginInput);return e&&this.performanceInfo.advance(I.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces(C.OBJECT_AND_LAYER_ID_COLOR))return null;let e=this._bindParameters.output;++this._techniques.precompiling;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,C.OBJECT_AND_LAYER_ID_COLOR).acquireDepth(14);return r=this._renderNodes(C.OBJECT_AND_LAYER_ID_COLOR,r),--this._techniques.precompiling,this._bindParameters.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();let t=this.performanceInfo.gpuSamplingEnabled,n=e===0,r=n?this.performanceInfo.elapsedTime:0;if(n||t){let e=0;t?e=this.performanceInfo.totalGPUTimeSampler.last:(this._rctx.gl.finish(),e=this.performanceInfo.elapsedTime);let i=Math.max(r,e);this._animationTimestep.frame(i,n)}}readAccumulatedShadow(e){return this._shadowAccumulator?.readAccumulatedShadow(e[0],e[1])??0}readMainDepth(e,t){let{mainDepth:n,camera:r}=this._bindParameters;if(!n)return;let i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,`linear depth`);this._rctx.bindFramebuffer(i.fbo),r.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(S),this._compositor.blitDepthToLinearDepth(this._bindParameters,n),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),i.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,Oe.UNSIGNED_BYTE,t),i.release()}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){let t=this._needsEdges;if(!t)return;let{width:n,height:r}=this._framebuffer.size,i=this.fboCache.acquire(n,r,`edges`);i.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(S),t.render(this._bindParameters,e),i.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===1?I.OPAQUE_EDGES:I.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(I.OVERLAY)}_renderShadowMap(e,t,n,r){if(!this.shadowsEnabled)return;let i=this._bindParameters.shadowMap;if(i.start(e,n,r,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,i),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);let n=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(C.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=n,i.disposeOutput(6),i.clear(),this._renderShadowCascades(7,i)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=s(this._bindParameters.depth)),this.performanceInfo.advance(C.SHADOWMAP)}_precompileShadowCascades(e){this._bindParameters.shadowMap.cascades.length!==0&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){let n=this._bindParameters.output,r=e!==6;t.bindFramebuffer();for(let n of t.cascades)n.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(n.camera,n.camera),this.renderAllGeometry(e),r&&this._renderShadowNodes(t.renderTarget);t.finish(e),this._bindParameters.output=n}_renderShadowNodes(e){this._renderInternalNodeCategory(C.SHADOWMAP,e)}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._testsNeedsDepth+ +this._needsShadowHighlight}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){let e=this._bindParameters;e.depth=o(this._bindParameters.depth);let t=this._pluginInput.get(`normals`);if(t){let n=this._nodes.produce(C.AMBIENT_ILLUMINATION,this._pluginInput);this._pluginInput.set(C.AMBIENT_ILLUMINATION,n),this._releaseGlobalIlluminationBuffers(),e.ssao=this.hasGlobalIllumination?null:n,e.globalIllumination=this.hasGlobalIllumination?n:null,e.globalIlluminationEnabled=e.globalIllumination!=null,n&&this.performanceInfo.advance(this.hasGlobalIlluminationHighQuality?I.AMBIENT_ILLUMINATION_HIGH_QUALITY:I.AMBIENT_ILLUMINATION);let r=this._needsDepth;if(r){let n=t.obtainAttachment(L);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),e.depth=t.obtainDepthTexture(),e.depth?.retain(r-1),t.attachColor(n,L),n?.release(),this.performanceInfo.advance(I.DEPTH)}else t.detachDepth();this.hasAmbientIllumination&&this._pluginInput.release(`normals`)}else this._releaseGlobalIlluminationBuffers(),e.ssao=null,this._pluginInput.set(C.AMBIENT_ILLUMINATION,null),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){let e=this._needsDepth;if(e===0)return;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,`geometry depth`,14);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._renderGaussianSplatPrepassDepth(r),this._bindParameters.depth=r.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),r.release(),this.performanceInfo.advance(I.DEPTH)}_renderGaussianSplatPrepassDepth(e){let t=this._shadowAccumulator;if(!t?.active||!t.requireGeometryDepth)return;let n=this._bindParameters.output;this._bindParameters.output=3,this._renderInternalNodeCategory(C.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=n}_renderGaussianSplatDepthAndNormals(e){let t=this._bindParameters.output;this._bindParameters.output=4,this._renderInternalNodeCategory(C.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=t}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||!!this._shadowAccumulator?.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return O.Zero;let t=k(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.union(this._nodes.queryDepthRange(C.SHADOWMAP,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal||this.stage.view.renderCoordsHelper.getAltitude(e.eye)<fe){this.sceneDepthRange.value=O.Infinite;return}let t=e.clone();t.near=re,t.far=1e10;let n=k(t,this._plugins.plugins,this.stage.layers,1);n.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(n)||(this.sceneDepthRange.value=n)}get _normalsRequired(){return this._nodes.require(`normals`,...T,C.VIEWSHED,C.LASERLINES)+ +!!this.hasAmbientIllumination}_precompilePrepasses(){let e=!!this._normalsRequired;if(e?(this._precompilePlugins(4,W),this._needsDepth&&this._precompilePlugins(3,G)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(C.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator?.active&&(this._nodes.precompile(C.SHADOW_ACCUMULATION),this._precompileAllGeometry(5)),this._shadowAccumulator?.active||e){let t=this._bindParameters.output;this._bindParameters.output=e?4:3,this._nodes.precompile(C.GAUSSIAN_SPLAT_DEPTH),this._bindParameters.output=t}(this.shadowsEnabled||this._shadowAccumulator?.active)&&this._nodes.precompile(C.SHADOWMAP),this.hasAmbientIllumination&&e&&this._nodes.precompile(C.AMBIENT_ILLUMINATION)}_renderNormals(){let e=this._normalsRequired;if(e===0)return;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,`normals`);r.acquireDepth(14),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(S,!0,!0),this._bindParameters.output=4,this._plugins.render(...W),this._renderGaussianSplatDepthAndNormals(r);let i=this._nodes.optional(`normals`,...T,C.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(I.NORMALS),r}_releaseGlobalIlluminationBuffers(){let e=this._bindParameters;e.reprojection.lastFrameDepth=o(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=o(e.reprojection.lastFrameEmission),e.globalIllumination=s(e.globalIllumination),e.globalIlluminationEnabled=!1}_precompileAllGeometry(e){let t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...U),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(let n of t)this._bindParameters.slot=n,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(let n of t)this._renderContext.renderOccludedMask=n,this.precompileSlots(e,...K);this._renderContext.renderOccludedMask=N}renderSlots(e,...t){for(let n of t)this._bindParameters.slot=n,e.forAll(e=>{let t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...K),this._renderContext.renderOccludedMask=N}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Me[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){let e=this._bindParameters.output;this._bindParameters.output=8,this._precompileAllGeometry(8),this._nodes.precompile(C.SHADOWMAP),this._bindParameters.output=e}precompileCutFillDepth(){this._precompilePlugins(9,Y)}_precompilePlugins(e,t){let n=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=n}renderViewshedShadowMap(e,t){let{camera:n,contentCamera:r}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._renderShadowNodes(t),this._ensureBindParametersCamera(n,r),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=i}renderCutFillDepth(e){let{camera:t,contentCamera:n}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Y),this._ensureBindParametersCamera(t,n),t.setGLViewport(this._rctx),this._bindParameters.output=r}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;let{width:e,height:t}=this._framebuffer.size,n=this.fboCache.acquire(e,t,C.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,n.fbo,256),this._framebuffer.bind(),n}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...G)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...V),this._nodes.precompile(`opaque-color`))}_renderOpaqueGeometry(){this._plugins.render(...V)}_renderTransparentGeometry(){this._plugins.render(...H),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...U)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;let t=this._bindParameters.output,n=this._bindParameters.hudRenderStyle,r=this._bindParameters.emissions;this._bindParameters.emissions=0,this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...q),this._bindParameters.output=2,this._plugins.precompile(...q),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...q)),this._bindParameters.emissions=r,this._bindParameters.output=t,this._bindParameters.hudRenderStyle=n}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;let n=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);let r=!!t.getTexture(R);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,n.getTexture(),r),n.release(),this.performanceInfo.advance(e===0?I.HUD_OCCLUDED:I.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;let{fboCache:e,_rctx:t,_bindParameters:n}=this,{width:r,height:i}=this._framebuffer.size,{highlights:a}=n,o=a.length>D?3:1,s=e.acquire(r,i,`highlights`,o);s.acquireDepth(14);let c=this._plugins.produces(10,0);return c&&this._framebuffer.color.fbo&&s.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,1024),t.bindFramebuffer(s.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),c||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(s.fbo),me(t,e,r,i,n,()=>this._renderHighlightGeometries()),s.detachDepth(),this.performanceInfo.advance(I.HIGHLIGHTS),s.retain(this._nodes.require(`highlights`,...E)+this._nodes.optional(`highlights`,...E)-1),s}_renderHighlightGeometries(){this._plugins.render(...je),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e){let t=this._shadowAccumulator;if(!t)return;t.updateDepthRange(e);let n=t.requireGeometryDepth;this._bindParameters.output=0;let r=this._nodes.produce(C.SHADOW_ACCUMULATION,this._pluginInput);t.didAccumulate&&this.performanceInfo.advance(I.ACCUMULATED_SHADOWS),this._pluginInput.set(C.SHADOW_ACCUMULATION,null),r?.release(),n&&(this._bindParameters.depth=s(this._bindParameters.depth))}renderShadowAccumulationShadowMap(e,t,n,r,i){let a=this.stage.view.qualitySettings.maximumPixelRatio;n.start(e,r,i,!0,a),this._renderShadowCascades(5,n),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t)}_precompileTransparentGeometry(){se(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...H),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...H),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...H)}_renderOIT(e,t=2){let n=e===1,{width:r,height:i}=this._framebuffer.size,a=n?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),s=this._bindParameters,c=s.useFloatBlend.value?8:5,l=s.output;s.output=1;let u=n?`oit hud`:`oit`,d=this.fboCache.acquire(r,i,u,c).acquireColor(R,this.hasFloatBlend?7:0,`oit alpha`),f=s.hasEmission&&(e===0||t!==1);f&&d.acquireColor(z,c,`oit emissive`),n||d.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(d.fbo),this._rctx.clearFramebuffer(j),f&&this._rctx.clearBuffer(2,j),a(),d.detachDepth(),s.output=2;let p=this.fboCache.acquire(r,i,n?`oit front hud`:`oit front`);f&&p.acquireColor(R,c,`oit front emissive`),n?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(S,n),a(),p.detachDepth();let m=this._pluginsHas.occludedHudElements&&!n,h=m&&s.emissions!==0?z:R;s.hudOcclusion=o(this._bindParameters.hudOcclusion),s.output=0;let g;return n?(g=this.fboCache.acquire(r,i,`oit composite hud`),this._rctx.bindFramebuffer(g.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(s.emissions!==0&&this._framebuffer.ensureEmissionAttachment(),m&&(this._framebuffer.color.acquireColor(h,0,`hud occlusion`),this._rctx.clearBuffer(h-L,S)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,d,p,s,m,e,this._fboCache.debugCallback),g?.detachDepth(),n||(f&&(this._bindParameters.emissions=3),m&&(s.hudOcclusion=this._framebuffer.color.obtainAttachment(h))),p.release(),d.release(),s.output=l,g}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...V)||this.plugins.produces(5,...V)||this.plugins.produces(3,3)}_renderOpaque(){let e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(C.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));let t=this._framebuffer;t.update(t=>this._renderNodes(w.OPAQUE,t,e)),this.fboCache.debugCallback?.(w.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(C.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(C.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(C.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(C.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(C.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(C.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(C.VOXEL,e)),this.fboCache.debugCallback?.(C.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){let e=this._framebuffer;if(this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(w.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(w.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=o(this._bindParameters.ssao),e.update(e=>this._renderNodes(C.TRANSPARENT_NO_DEPTH,e)),this.fboCache.debugCallback?.(C.TRANSPARENT_NO_DEPTH,e.color.fbo),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){let e=this._rctx.setDrawBuffers([ke,R]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(I.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,n=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return n&&this.performanceInfo.advance(e),t;let r=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),this._fboCache.debugCallback?.(e,r.fbo),r}_renderInternalNodeCategory(e,t){if(!t)return;let n=t.name;try{this._renderNodes(e,t)}finally{this._pluginInput.set(e,null),t.setName(n)}}_3dGeometryRendered(){let e=this._bindParameters;this.hasReflections&&(e.depth=s(e.depth),e.reprojection.lastFrameColor=s(e.reprojection.lastFrameColor)),e.shadowMap.disposeOutput(5);let t=this._framebuffer.color.getAttachment(R)?.attachment;if(this.hasGlobalIllumination&&t){let{width:n,height:r}=this._framebuffer.size,i=e.useFloatBlend.value?8:5;e.reprojection.lastFrameEmission=this.fboCache.acquire(n,r,`emissive`,i),this._blit.blitTexture(t,e,e.reprojection.lastFrameEmission.fbo)}}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){this.stage.viewingMode===1&&((this._bindParameters.clouds.data||!this.weatherFader?.readyToRun)&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration,this.stage.view.state.stationary),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){let{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){this._ssrEnableTime??=e;let n=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=n>0?Math.min(n,e-this._ssrEnableTime)/n:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination)){this._reprojectionMatrix=b;return}let{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:n}=e,r=!n.equals(t);if(r?(_(Z,t.viewMatrix),_(X,t.projectionMatrix),v(Q,Z,X),v(Q,n.viewMatrix,Q),v(Q,n.projectionMatrix,Q),this._reprojectionMatrix=Q):this._reprojectionMatrix=b,this.hasGlobalIllumination){let{viewMatrix:t}=e;r?(v($,n.viewMatrix,Z),y(t,$)):y(t,b)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,n,r){this._bindParameters.updateLighting(e,t,n,r),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([m({readOnly:!0})],B.prototype,`highResolutionAtmosphere`,null),e([m()],B.prototype,`_edgeView`,void 0),e([m()],B.prototype,`updating`,null),e([m()],B.prototype,`_loadEdgeViewTask`,void 0),B=e([h(`esri.views.3d.webgl-engine.lib.Renderer`)],B);const V=[0,1,2,3],H=[7,6,4,5],U=[7,6],W=[0,1,2,4,...U],G=[3,5],K=[2,4,8],q=[16,12,14,13],je=[4,5,2,3,0,1,...U],J=[4,8,5,11],Me={0:[13],1:[12],2:[13,12],3:[13,12]},Y=[0,1,...U],Ne=[`normals`,`highlights`],X=x(),Z=x(),Q=x(),$=x();function Pe(e){return t=>e.immediate.schedule(t)}export{B as Renderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{clamp as e}from"../../../../core/mathUtils.js";import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{isFloat32Array as n}from"../../../../core/typedArrayUtil.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as i,copy as a,nan as o,fromValues as s,empty as c}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as l}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{intersectsTransformedAabb as d}from"../../../../geometry/support/frustumPlanes.js";import{newContinuousIndexArray as f}from"../../../../geometry/support/Indices.js";import{createPositionReader as p}from"./PositionReader.js";import{MeshIntersectionOptions as m,intersectRayTriangles as h}from"./RayIntersections.js";import{forEachTriangleRangeScreenPolygonHit as g}from"./screenPolygonTriangleIntersections.js";const _=1e-6;class v{constructor(t,n,i){this.globalTriangleVertexIndices=t,this.numTriangles=n,this.positions=i,this._rayDirection=r(),this._callback=T,this._intersectionOptions=w,this._screenPolygonCallback=E,this._screenPolygonDisplacement=null,this._screenPolygonIntersector=null,this._screenPolygonQuery=null,this._screenPolygonTransformation=null,this.bspNodeTree=[],this.triangleIndexMap=f(n),this._readPosition=p(i.data,t,i.stride);let{triangleAABBs:a,rootAabb:o}=S(t,n,i.data,i.stride);if(this._rootAabb=o,n<=40)return;let s=e(Math.log2(n/40),2,10),c=(e,t,n,r)=>{let i=t-e,{axis:o,midValue:l}=x(r),{next:u,mid:d,leftAabb:f,middleAabb:p,rightAabb:m}=b(this.triangleIndexMap,a,e,t,o,l),h=new y(f,p,m,o,l,u,d);if(this.bspNodeTree.push(h),n<=s){let r=.8*i,a=u-e;a>40&&a<r&&(h.leftNode=c(e,u,n+1,f));let o=t-d;o>40&&o<r&&(h.rightNode=c(d,t,n+1,m))}return h};c(0,n,0,this._rootAabb)}intersectRayTriangleRange(e,t){if(e>=t)return;let{data:n,stride:r}=this.positions;h(this._rayFrom,this._rayDirection,e,t,this.globalTriangleVertexIndices,n,r,this._intersectionOptions.normalRequired,this._callback,this.triangleIndexMap),v.numFacesTested+=t-e}forEachScreenPolygonHit(e,t,n,r,i){e.camera!=null&&(this._screenPolygonIntersector=e,this._screenPolygonTransformation=t,this._screenPolygonQuery=n,this._screenPolygonDisplacement=r,this._screenPolygonCallback=i,this._intersectScreenPolygonBSP(this.bspNodeTree[0],0,this.triangleIndexMap.length),this._screenPolygonCallback=E,this._screenPolygonDisplacement=null,this._screenPolygonQuery=null,this._screenPolygonTransformation=null,this._screenPolygonIntersector=null)}intersectRay(e,t,n,r){v.numFacesTested=0;let i=e,a=t,o=a[0]-i[0],s=a[1]-i[1],c=a[2]-i[2];if(o*o+s*s+c*c<_)return;this._rayFrom=i;let l=this._rayDirection;l[0]=o,l[1]=s,l[2]=c;let u=this.triangleIndexMap.length;this._callback=r,this._intersectionOptions=n;let d=this.bspNodeTree[0];d===void 0?C(this._rootAabb,i,l)&&this.intersectRayTriangleRange(0,u):this.intersectRayBSP(d,0,u),this._callback=T,this._intersectionOptions=w}intersectRayBSP(e,t,n){let r=this._rayFrom,i=this._rayDirection;this._traverseBSP(e,t,n,e=>C(e,r,i),e=>{let t=e.axis;return r[t]
|
|
2
|
+
import{clamp as e}from"../../../../core/mathUtils.js";import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{isFloat32Array as n}from"../../../../core/typedArrayUtil.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as i,copy as a,nan as o,fromValues as s,empty as c}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as l}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{intersectsTransformedAabb as d}from"../../../../geometry/support/frustumPlanes.js";import{newContinuousIndexArray as f}from"../../../../geometry/support/Indices.js";import{createPositionReader as p}from"./PositionReader.js";import{MeshIntersectionOptions as m,intersectRayTriangles as h}from"./RayIntersections.js";import{forEachTriangleRangeScreenPolygonHit as g}from"./screenPolygonTriangleIntersections.js";const _=1e-6;class v{constructor(t,n,i){this.globalTriangleVertexIndices=t,this.numTriangles=n,this.positions=i,this._rayDirection=r(),this._callback=T,this._intersectionOptions=w,this._screenPolygonCallback=E,this._screenPolygonDisplacement=null,this._screenPolygonIntersector=null,this._screenPolygonQuery=null,this._screenPolygonTransformation=null,this.bspNodeTree=[],this.triangleIndexMap=f(n),this._readPosition=p(i.data,t,i.stride);let{triangleAABBs:a,rootAabb:o}=S(t,n,i.data,i.stride);if(this._rootAabb=o,n<=40)return;let s=e(Math.log2(n/40),2,10),c=(e,t,n,r)=>{let i=t-e,{axis:o,midValue:l}=x(r),{next:u,mid:d,leftAabb:f,middleAabb:p,rightAabb:m}=b(this.triangleIndexMap,a,e,t,o,l),h=new y(f,p,m,o,l,u,d);if(this.bspNodeTree.push(h),n<=s){let r=.8*i,a=u-e;a>40&&a<r&&(h.leftNode=c(e,u,n+1,f));let o=t-d;o>40&&o<r&&(h.rightNode=c(d,t,n+1,m))}return h};c(0,n,0,this._rootAabb)}intersectRayTriangleRange(e,t){if(e>=t)return;let{data:n,stride:r}=this.positions;h(this._rayFrom,this._rayDirection,e,t,this.globalTriangleVertexIndices,n,r,this._intersectionOptions.normalRequired,this._callback,this.triangleIndexMap),v.numFacesTested+=t-e}forEachScreenPolygonHit(e,t,n,r,i){e.camera!=null&&(this._screenPolygonIntersector=e,this._screenPolygonTransformation=t,this._screenPolygonQuery=n,this._screenPolygonDisplacement=r,this._screenPolygonCallback=i,this._intersectScreenPolygonBSP(this.bspNodeTree[0],0,this.triangleIndexMap.length),this._screenPolygonCallback=E,this._screenPolygonDisplacement=null,this._screenPolygonQuery=null,this._screenPolygonTransformation=null,this._screenPolygonIntersector=null)}intersectRay(e,t,n,r){v.numFacesTested=0;let i=e,a=t,o=a[0]-i[0],s=a[1]-i[1],c=a[2]-i[2];if(o*o+s*s+c*c<_)return;this._rayFrom=i;let l=this._rayDirection;l[0]=o,l[1]=s,l[2]=c;let u=this.triangleIndexMap.length;this._callback=r,this._intersectionOptions=n;let d=this.bspNodeTree[0];d===void 0?C(this._rootAabb,i,l)&&this.intersectRayTriangleRange(0,u):this.intersectRayBSP(d,0,u),this._callback=T,this._intersectionOptions=w}intersectRayBSP(e,t,n){let r=this._rayFrom,i=this._rayDirection;this._traverseBSP(e,t,n,e=>C(e,r,i),e=>{let t=e.axis;return r[t]<=e.d||i[t]<0},e=>{let t=e.axis;return r[t]>=e.d||i[t]>0},(e,t)=>this.intersectRayTriangleRange(e,t))}_intersectScreenPolygonTriangleRange(e,t){if(e>=t)return;let n=this._screenPolygonIntersector,r=this._screenPolygonQuery;if(n!=null&&r!=null)for(let i of g(n,this._screenPolygonTransformation,r,e,t,this._readPosition,this._screenPolygonDisplacement,this.triangleIndexMap))this._screenPolygonCallback(i.distance,i.primitiveIndex,i.point)}_intersectScreenPolygonBSP(e,t,n){let r=this._screenPolygonIntersector,i=this._screenPolygonQuery;r?.camera!=null&&i!=null&&(e===void 0?this._nodeIntersectsScreenPolygonBroadPhase(this._rootAabb)&&this._intersectScreenPolygonTriangleRange(t,n):this._traverseBSP(e,t,n,e=>this._nodeIntersectsScreenPolygonBroadPhase(e),()=>!0,()=>!0,(e,t)=>this._intersectScreenPolygonTriangleRange(e,t)))}_traverseBSP(e,t,n,r,i,a,o){if(!r(this._rootAabb))return;let s=[{node:e,rangeStart:t,rangeEnd:n}];for(;s.length>0;){let{node:e,rangeStart:t,rangeEnd:n}=s.pop();i(e)&&this._traverseBSPRange(s,e.leftNode,e.leftAabb,t,e.midStartIndex,r,o),e.midStartIndex<e.rightStartIndex&&r(e.middleAabb)&&o(e.midStartIndex,e.rightStartIndex),a(e)&&this._traverseBSPRange(s,e.rightNode,e.rightAabb,e.rightStartIndex,n,r,o)}}_traverseBSPRange(e,t,n,r,i,a,o){r>=i||!a(n)||(t===void 0?o(r,i):e.push({node:t,rangeStart:r,rangeEnd:i}))}_nodeIntersectsScreenPolygonBroadPhase(e){let t=this._screenPolygonQuery;if(t==null)return!1;let n=this._screenPolygonDisplacement,r=n?n.applyToAabb(a(D,e)):e;return d(t.broadPhaseFrustum,r,this._screenPolygonTransformation)}static{this.numFacesTested=0}get estimatedMemoryUsage(){return t(this.triangleIndexMap)}}class y{constructor(e,t,n,r,i,a,o){this.leftAabb=e,this.middleAabb=t,this.rightAabb=n,this.axis=r,this.d=i,this.midStartIndex=a,this.rightStartIndex=o}}function b(e,t,n,r,i,a){let s=i+3,l=c(),u=c(),d=c(),f=n,p=n,m=r;for(;p<m;){let n=e[p],r=n*6,o=t[r+s],c;o<=a?(c=l,p!==f&&(e[p]=e[f],e[f]=n),++f,++p):t[r+i]>=a?(c=d,--m,p!==m&&(e[p]=e[m],e[m]=n)):(c=u,++p),c[0]=Math.min(c[0],t[r]),c[1]=Math.min(c[1],t[r+1]),c[2]=Math.min(c[2],t[r+2]),c[3]=Math.max(c[3],t[r+3]),c[4]=Math.max(c[4],t[r+4]),c[5]=Math.max(c[5],t[r+5])}return{next:f,mid:m,leftAabb:n<f?l:o,middleAabb:f<m?u:o,rightAabb:m<r?d:o}}function x(e){let t=e[3]-e[0],n=e[4]-e[1],r=e[5]-e[2],i=t>n?t>r?0:n>r?1:2:n>r?1:r>t?2:0;return{axis:i,midValue:(e[i]+e[i+3])/2}}function S(e,t,r,i){let a=n(r)?u(t*6,!0):l(t*6),c=1/0,d=1/0,f=1/0,p=-1/0,m=-1/0,h=-1/0;for(let n=0;n<t;++n){let t=3*n,o=e[t]*i,s=e[t+1]*i,l=e[t+2]*i,u=r[o],g=r[o+1],_=r[o+2],v=r[s],y=r[s+1],b=r[s+2],x=r[l],S=r[l+1],C=r[l+2],w=Math.min(u,v,x),T=Math.min(g,y,S),E=Math.min(_,b,C),D=Math.max(u,v,x),O=Math.max(g,y,S),k=Math.max(_,b,C),A=n*6;a[A]=w,a[A+1]=T,a[A+2]=E,a[A+3]=D,a[A+4]=O,a[A+5]=k,c=Math.min(c,w),d=Math.min(d,T),f=Math.min(f,E),p=Math.max(p,D),m=Math.max(m,O),h=Math.max(h,k)}return{triangleAABBs:a,rootAabb:t>0?s(c,d,f,p,m,h):o}}function C(e,t,n){let r=t,i=n,a=0,o=1/0;for(let t=0;t<3;++t){{let n=e[t];if(r[t]<n){if(i[t]<=_)return!1;let e=(n-r[t])/i[t];a=Math.max(a,e)}else if(i[t]<=-1e-6){let e=(n-r[t])/i[t];o=Math.min(o,e)}if(a>o)return!1}{let n=e[t+3];if(r[t]>n){if(i[t]>=-1e-6)return!1;let e=(n-r[t])/i[t];a=Math.max(a,e)}else if(i[t]>=_){let e=(n-r[t])/i[t];o=Math.min(o,e)}if(a>o)return!1}}return!0}const w=new m,T=()=>{},E=()=>{},D=i();export{v as TriangleIntersectionData};
|