@arcgis/core 6.0.0-next.44 → 6.0.0-next.46

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.
Files changed (487) hide show
  1. package/Basemap.d.ts +2 -1
  2. package/Camera.d.ts +2 -1
  3. package/Graphic.d.ts +2 -1
  4. package/Ground.d.ts +2 -1
  5. package/Map.d.ts +2 -1
  6. package/PopupTemplate.d.ts +2 -1
  7. package/WebDocument2D.d.ts +2 -1
  8. package/WebScene.d.ts +2 -1
  9. package/analysis/Analysis.d.ts +2 -1
  10. package/analysis/DimensionSimpleStyle.d.ts +2 -1
  11. package/analysis/LengthDimension.d.ts +2 -1
  12. package/analysis/LineOfSightAnalysisObserver.d.ts +2 -1
  13. package/analysis/LineOfSightAnalysisTarget.d.ts +2 -1
  14. package/analysis/SlicePlane.d.ts +2 -1
  15. package/analysis/Viewshed.d.ts +2 -1
  16. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +2 -1
  17. package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.d.ts +2 -1
  18. package/analysis/VolumeMeasurement/VolumeMeasurementInputUnits.d.ts +2 -1
  19. package/arcgisGlobal.d.ts +1 -3
  20. package/assets/esri/core/workers/RemoteClient.js +1 -1
  21. package/assets/esri/core/workers/chunks/{d64054cd6865d3a1af78.js → 0ac38ca04285cd5ef1a0.js} +3 -3
  22. package/assets/esri/core/workers/chunks/{c420ab79d85e5dbddb0b.js → 3e67d50a2b2f8f837831.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{0caaa03659f4f4e8df03.js → b3c0c9c91bcdbbb8e719.js} +1 -1
  24. package/basemapGallery/PortalBasemapsSource.d.ts +2 -1
  25. package/basemapGallery/support/BasemapItem.d.ts +2 -1
  26. package/chunks/AtmosphereCompositing.glsl.js +24 -6
  27. package/chunks/ChapmanAtmosphere.glsl.js +32 -25
  28. package/chunks/EmissionComposite.glsl.js +1 -1
  29. package/{portal/schemas → chunks}/definitions.js +1 -1
  30. package/chunks/webScene.js +2 -0
  31. package/config.js +1 -1
  32. package/core/Clonable.d.ts +2 -1
  33. package/core/Evented.d.ts +2 -1
  34. package/core/Identifiable.d.ts +2 -1
  35. package/core/JSONSupport.d.ts +2 -1
  36. package/core/Loadable.d.ts +2 -1
  37. package/core/MultiOriginJSONSupport.d.ts +2 -1
  38. package/core/Promise.d.ts +2 -1
  39. package/core/ReadOnlyMultiOriginJSONSupport.d.ts +2 -1
  40. package/editing/sharedTemplates/SharedTemplate.d.ts +2 -1
  41. package/effects/FocusArea.d.ts +2 -1
  42. package/effects/FocusAreaOutline.d.ts +2 -1
  43. package/effects/FocusAreas.d.ts +2 -1
  44. package/form/FormTemplate.d.ts +2 -1
  45. package/form/elements/UtilityNetworkAssociationsElement.d.ts +2 -1
  46. package/form/elements/inputs/attachments/Input.d.ts +2 -1
  47. package/geometry/Mesh.d.ts +2 -1
  48. package/geometry/operators/support/GeographicTransformation.d.ts +2 -1
  49. package/geometry/operators/support/GeographicTransformationStep.d.ts +2 -1
  50. package/geometry/support/MeshComponent.d.ts +2 -1
  51. package/geometry/support/MeshGeoreferencedVertexSpace.d.ts +2 -1
  52. package/geometry/support/MeshLocalVertexSpace.d.ts +2 -1
  53. package/geometry/support/MeshMaterial.d.ts +2 -1
  54. package/geometry/support/MeshTexture.d.ts +2 -1
  55. package/geometry/support/MeshTextureTransform.d.ts +2 -1
  56. package/geometry/support/MeshTransform.d.ts +2 -1
  57. package/geometry/support/MeshVertexAttributes.d.ts +2 -1
  58. package/interfaces.d.ts +0 -82
  59. package/kernel.js +1 -1
  60. package/layerList/Item.d.ts +2 -1
  61. package/layerList/ItemPanel.d.ts +2 -1
  62. package/layerList/TableItem.d.ts +2 -1
  63. package/layerList/TableItemPanel.d.ts +2 -1
  64. package/layers/AnnotationFeatureLayer.d.ts +2 -1
  65. package/layers/BaseDynamicLayer.d.ts +2 -1
  66. package/layers/BaseElevationLayer.d.ts +2 -1
  67. package/layers/BaseTileLayer.d.ts +2 -1
  68. package/layers/BingMapsLayer.d.ts +2 -1
  69. package/layers/BuildingSceneLayer.d.ts +2 -1
  70. package/layers/CSVLayer.d.ts +2 -1
  71. package/layers/CatalogLayer.d.ts +2 -1
  72. package/layers/DimensionFeatureLayer.d.ts +2 -1
  73. package/layers/DimensionLayer.d.ts +2 -1
  74. package/layers/ElevationLayer.d.ts +2 -1
  75. package/layers/FeatureLayer.d.ts +2 -1
  76. package/layers/GaussianSplatLayer.d.ts +2 -1
  77. package/layers/GeoJSONLayer.d.ts +2 -1
  78. package/layers/GeoRSSLayer.d.ts +2 -1
  79. package/layers/GeospatialPDFLayer.d.ts +2 -1
  80. package/layers/GraphicsLayer.d.ts +2 -1
  81. package/layers/GroupLayer.d.ts +2 -1
  82. package/layers/ImageryLayer.d.ts +2 -1
  83. package/layers/ImageryTileLayer.d.ts +2 -1
  84. package/layers/IntegratedMesh3DTilesLayer.d.ts +2 -1
  85. package/layers/IntegratedMeshLayer.d.ts +2 -1
  86. package/layers/KMLLayer.d.ts +2 -1
  87. package/layers/KnowledgeGraphLayer.d.ts +2 -1
  88. package/layers/Layer.d.ts +2 -1
  89. package/layers/LineOfSightLayer.d.ts +2 -1
  90. package/layers/LinkChartLayer.d.ts +2 -1
  91. package/layers/MapImageLayer.d.ts +2 -1
  92. package/layers/MapNotesLayer.d.ts +2 -1
  93. package/layers/MediaLayer.d.ts +2 -1
  94. package/layers/OGCFeatureLayer.d.ts +2 -1
  95. package/layers/ParquetLayer.d.ts +2 -1
  96. package/layers/PointCloudLayer.d.ts +2 -1
  97. package/layers/RouteLayer.d.ts +2 -1
  98. package/layers/SceneLayer.d.ts +2 -1
  99. package/layers/SketchLayer.d.ts +2 -1
  100. package/layers/StreamLayer.d.ts +2 -1
  101. package/layers/SubtypeGroupLayer.d.ts +2 -1
  102. package/layers/TileLayer.d.ts +2 -1
  103. package/layers/UnknownLayer.d.ts +2 -1
  104. package/layers/UnsupportedLayer.d.ts +2 -1
  105. package/layers/VectorTileLayer.d.ts +2 -1
  106. package/layers/VideoLayer.d.ts +2 -1
  107. package/layers/VideoLayer.js +1 -1
  108. package/layers/ViewshedLayer.d.ts +2 -1
  109. package/layers/VoxelLayer.d.ts +2 -1
  110. package/layers/WCSLayer.d.ts +2 -1
  111. package/layers/WFSLayer.d.ts +3 -2
  112. package/layers/WMSLayer.d.ts +2 -1
  113. package/layers/WMTSLayer.d.ts +2 -1
  114. package/layers/WebTileLayer.d.ts +2 -1
  115. package/layers/buildingSublayers/BuildingComponentSublayer.d.ts +2 -1
  116. package/layers/buildingSublayers/BuildingSublayer.d.ts +2 -1
  117. package/layers/catalog/CatalogDynamicGroupLayer.d.ts +2 -1
  118. package/layers/catalog/CatalogFootprintLayer.d.ts +2 -1
  119. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +2 -1
  120. package/layers/mixins/APIKeyMixin.d.ts +2 -1
  121. package/layers/mixins/ArcGISCachedService.d.ts +2 -1
  122. package/layers/mixins/ArcGISImageService.d.ts +2 -1
  123. package/layers/mixins/ArcGISMapService.d.ts +2 -1
  124. package/layers/mixins/BlendLayer.d.ts +2 -1
  125. package/layers/mixins/CustomParametersMixin.d.ts +2 -1
  126. package/layers/mixins/DataSeriesLayer.d.ts +2 -1
  127. package/layers/mixins/DisplayFilteredLayer.d.ts +2 -1
  128. package/layers/mixins/EditBusLayer.d.ts +2 -1
  129. package/layers/mixins/FeatureEffectLayer.d.ts +2 -1
  130. package/layers/mixins/FeatureLayerBase.d.ts +2 -1
  131. package/layers/mixins/FeatureReductionLayer.d.ts +2 -1
  132. package/layers/mixins/OperationalLayer.d.ts +2 -1
  133. package/layers/mixins/OrderedLayer.d.ts +2 -1
  134. package/layers/mixins/PortalLayer.d.ts +2 -1
  135. package/layers/mixins/PublishableLayer.d.ts +2 -1
  136. package/layers/mixins/RasterPresetRendererMixin.d.ts +2 -1
  137. package/layers/mixins/RefreshableLayer.d.ts +2 -1
  138. package/layers/mixins/ReloadableLayer.d.ts +2 -1
  139. package/layers/mixins/ScaleRangeLayer.d.ts +2 -1
  140. package/layers/mixins/SceneService.d.ts +2 -1
  141. package/layers/mixins/SublayersOwner.d.ts +2 -1
  142. package/layers/mixins/TemporalLayer.d.ts +2 -1
  143. package/layers/mixins/TiledImagery.d.ts +2 -1
  144. package/layers/mixins/TrackableLayer.d.ts +2 -1
  145. package/layers/orientedImagery/core/ElevationSourceDefinitions.d.ts +2 -1
  146. package/layers/support/AnnotationFeatureSublayer.d.ts +2 -1
  147. package/layers/support/BuildingFilterMode.d.ts +2 -1
  148. package/layers/support/BuildingSummaryStatistics.d.ts +2 -1
  149. package/layers/support/ControlPointsGeoreference.d.ts +2 -1
  150. package/layers/support/DisplayFilter.d.ts +2 -1
  151. package/layers/support/DisplayFilterInfo.d.ts +2 -1
  152. package/layers/support/EditFieldsInfo.d.ts +2 -1
  153. package/layers/support/ExpressionInfo.d.ts +2 -1
  154. package/layers/support/FeatureReductionBinning.d.ts +2 -1
  155. package/layers/support/FeatureReductionCluster.d.ts +2 -1
  156. package/layers/support/FeatureTemplate.d.ts +2 -1
  157. package/layers/support/FeatureType.d.ts +2 -1
  158. package/layers/support/FieldConfiguration.d.ts +2 -1
  159. package/layers/support/FieldFormat.d.ts +2 -1
  160. package/layers/support/GeometryEncodingLocation.d.ts +2 -1
  161. package/layers/support/GeometryEncodingWkb.d.ts +2 -1
  162. package/layers/support/GeometryFieldsInfo.d.ts +2 -1
  163. package/layers/support/KMLSublayer.d.ts +2 -1
  164. package/layers/support/LocalMediaElementSource.d.ts +2 -1
  165. package/layers/support/MediaElementBase.d.ts +2 -1
  166. package/layers/support/ParquetFilesData.d.ts +2 -1
  167. package/layers/support/ParquetPortalItemData.d.ts +2 -1
  168. package/layers/support/PlaybackInfo.d.ts +2 -1
  169. package/layers/support/PortalItemData.d.ts +2 -1
  170. package/layers/support/Relationship.d.ts +2 -1
  171. package/layers/support/SceneModifications.d.ts +2 -1
  172. package/layers/support/Sublayer.d.ts +2 -1
  173. package/layers/support/Subtype.d.ts +2 -1
  174. package/layers/support/SubtypeSublayer.d.ts +2 -1
  175. package/layers/support/SymbolLayerDrawing.d.ts +2 -1
  176. package/layers/support/TelemetryData.d.ts +2 -1
  177. package/layers/support/TelemetryDisplay.d.ts +2 -1
  178. package/layers/support/TimeInfo.d.ts +2 -1
  179. package/layers/support/TimeSeriesCalculationMethod.d.ts +2 -1
  180. package/layers/support/TimeSeriesFieldTimeMapping.d.ts +2 -1
  181. package/layers/support/TimeSeriesInfo.d.ts +2 -1
  182. package/layers/support/TrackInfo.d.ts +2 -1
  183. package/layers/support/TrackPartInfo.d.ts +2 -1
  184. package/layers/support/VideoTimeExtent.d.ts +2 -1
  185. package/layers/support/WMSSublayer.d.ts +2 -1
  186. package/layers/support/schemaValidator.js +1 -1
  187. package/layers/voxel/VoxelColorStop.d.ts +2 -1
  188. package/layers/voxel/VoxelDynamicSection.d.ts +2 -1
  189. package/layers/voxel/VoxelIsosurface.d.ts +2 -1
  190. package/layers/voxel/VoxelOpacityStop.d.ts +2 -1
  191. package/layers/voxel/VoxelRangeFilter.d.ts +2 -1
  192. package/layers/voxel/VoxelSlice.d.ts +2 -1
  193. package/layers/voxel/VoxelTransferFunctionStyle.d.ts +2 -1
  194. package/layers/voxel/VoxelUniqueValue.d.ts +2 -1
  195. package/linkChart/ChronologicalLayoutSettings.d.ts +2 -1
  196. package/linkChart/LayoutSettings.d.ts +2 -1
  197. package/linkChart/LinkChartProperties.d.ts +2 -1
  198. package/linkChart/NonspatialDataDisplay.d.ts +2 -1
  199. package/linkChart/OrganicLayoutSettings.d.ts +2 -1
  200. package/linkChart/RootedLayoutSettings.d.ts +2 -1
  201. package/networks/Network.d.ts +2 -1
  202. package/networks/support/Circuit.d.ts +2 -1
  203. package/networks/support/CircuitSection.d.ts +2 -1
  204. package/networks/support/NamedTraceConfiguration.d.ts +2 -1
  205. package/networks/support/Subcircuit.d.ts +2 -1
  206. package/networks/support/TraceConfiguration.d.ts +2 -1
  207. package/networks/support/UNTraceConfiguration.d.ts +2 -1
  208. package/package.json +5 -5
  209. package/parcelFabric/ParcelFabric.d.ts +2 -1
  210. package/popup/FeatureModel.d.ts +2 -1
  211. package/popup/FeaturesModel.d.ts +2 -1
  212. package/popup/FieldInfo.d.ts +2 -1
  213. package/popup/content/AttachmentsContent.d.ts +2 -1
  214. package/popup/content/RelationshipContent.d.ts +2 -1
  215. package/popup/content/UtilityNetworkAssociationsContent.d.ts +2 -1
  216. package/popup/support/AttachmentsOrderByInfo.d.ts +2 -1
  217. package/popup/support/FieldInfoFormat.d.ts +2 -1
  218. package/popup/support/UtilityNetworkAssociationType.d.ts +2 -1
  219. package/portal/Portal.d.ts +2 -1
  220. package/portal/PortalItem.d.ts +2 -1
  221. package/renderers/ClassBreaksRenderer.d.ts +2 -1
  222. package/renderers/DictionaryRenderer.d.ts +2 -1
  223. package/renderers/DotDensityRenderer.d.ts +2 -1
  224. package/renderers/FlowRenderer.d.ts +8 -6
  225. package/renderers/PieChartRenderer.d.ts +2 -1
  226. package/renderers/SimpleRenderer.d.ts +2 -1
  227. package/renderers/UniqueValueRenderer.d.ts +2 -1
  228. package/renderers/VectorFieldRenderer.d.ts +2 -1
  229. package/renderers/mixins/VisualVariablesMixin.d.ts +2 -1
  230. package/renderers/support/HeatmapLegendOptions.d.ts +2 -1
  231. package/renderers/support/OthersCategory.d.ts +2 -1
  232. package/renderers/support/RasterPresetRenderer.d.ts +2 -1
  233. package/renderers/support/RendererLegendOptions.d.ts +2 -1
  234. package/renderers/support/UniqueValue.d.ts +2 -1
  235. package/renderers/support/UniqueValueClass.d.ts +2 -1
  236. package/renderers/support/UniqueValueGroup.d.ts +2 -1
  237. package/renderers/visualVariables/support/VisualVariableLegendOptions.d.ts +2 -1
  238. package/rest/featureService/FeatureService.d.ts +2 -1
  239. package/rest/layerSources/DynamicDataLayer.d.ts +2 -1
  240. package/rest/layerSources/DynamicWorkspaceLayer.d.ts +2 -1
  241. package/rest/networks/support/TraceLocation.d.ts +2 -1
  242. package/rest/print.js +1 -1
  243. package/rest/support/AttributeBinsFeatureSet.d.ts +2 -1
  244. package/rest/support/AttributeBinsGrouping.d.ts +2 -1
  245. package/rest/support/AttributeBinsQuery.d.ts +2 -1
  246. package/rest/support/AutoIntervalBinParameters.d.ts +2 -1
  247. package/rest/support/BinParametersBase.d.ts +2 -1
  248. package/rest/support/CameraInfo.d.ts +2 -1
  249. package/rest/support/CameraInfoMixin.d.ts +2 -1
  250. package/rest/support/ClosestFacilityParameters.d.ts +2 -1
  251. package/rest/support/DataLayer.d.ts +2 -1
  252. package/rest/support/DateBinTimeInterval.d.ts +2 -1
  253. package/rest/support/DirectionLine.d.ts +2 -1
  254. package/rest/support/DirectionPoint.d.ts +2 -1
  255. package/rest/support/FindImagesParameters.d.ts +2 -1
  256. package/rest/support/FixedIntervalBinParameters.d.ts +2 -1
  257. package/rest/support/ImageBoundaryParameters.d.ts +2 -1
  258. package/rest/support/ImageGPSInfoParameters.d.ts +2 -1
  259. package/rest/support/ImageInspectionInfo.d.ts +2 -1
  260. package/rest/support/ImageToMapMultirayParameters.d.ts +2 -1
  261. package/rest/support/ImageToMapParameters.d.ts +2 -1
  262. package/rest/support/ImageUrlParameters.d.ts +2 -1
  263. package/rest/support/ImageVolumeParameters.d.ts +2 -1
  264. package/rest/support/LastMileDeliveryParameters.d.ts +2 -1
  265. package/rest/support/LocateSettingBase.d.ts +2 -1
  266. package/rest/support/LocateSettingSource.d.ts +2 -1
  267. package/rest/support/LocateSettings.d.ts +2 -1
  268. package/rest/support/LocateSettingsOverrides.d.ts +2 -1
  269. package/rest/support/MapToImageParameters.d.ts +2 -1
  270. package/rest/support/NetworkUrl.d.ts +2 -1
  271. package/rest/support/NormalizationBinParametersMixin.d.ts +2 -1
  272. package/rest/support/OutDistance.d.ts +2 -1
  273. package/rest/support/PointBarrier.d.ts +2 -1
  274. package/rest/support/PolygonBarrier.d.ts +2 -1
  275. package/rest/support/PolylineBarrier.d.ts +2 -1
  276. package/rest/support/RouteInfo.d.ts +2 -1
  277. package/rest/support/RouteParameters.d.ts +2 -1
  278. package/rest/support/ServiceAreaParameters.d.ts +2 -1
  279. package/rest/support/Stop.d.ts +2 -1
  280. package/rest/support/TravelMode.d.ts +2 -1
  281. package/support/LayersMixin.d.ts +2 -1
  282. package/support/TablesMixin.d.ts +2 -1
  283. package/support/actions/ActionBase.d.ts +2 -1
  284. package/symbols/LineStyleMarker3D.d.ts +2 -1
  285. package/symbols/patterns/LinePattern3D.d.ts +2 -1
  286. package/symbols/patterns/Pattern3D.d.ts +2 -1
  287. package/symbols/support/ElevationInfo.d.ts +2 -1
  288. package/symbols/support/OccludedVisibility.d.ts +2 -1
  289. package/symbols/support/Symbol3DEmissive.d.ts +2 -1
  290. package/symbols/support/Symbol3DMaterial.d.ts +2 -1
  291. package/symbols/support/Symbol3DTextBackground.d.ts +2 -1
  292. package/tables/elements/AttributeTableAttachmentElement.d.ts +2 -1
  293. package/tables/elements/AttributeTableFieldElement.d.ts +2 -1
  294. package/tables/elements/AttributeTableGroupElement.d.ts +2 -1
  295. package/tables/elements/AttributeTableRelationshipElement.d.ts +2 -1
  296. package/tables/support/FieldOrder.d.ts +2 -1
  297. package/time/TimeInterval.d.ts +2 -1
  298. package/versionManagement/VersionManagementService.d.ts +2 -1
  299. package/versionManagement/VersioningState.d.ts +2 -1
  300. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  301. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  302. package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
  303. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  304. package/views/2d/interactive/editingTools/manipulations/DragManipulation.js +1 -1
  305. package/views/2d/interactive/editingTools/manipulations/RotateManipulation.js +1 -1
  306. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  307. package/views/2d/interactive/editingTools/manipulations/utils.js +1 -1
  308. package/views/2d/layers/LayerView2D.js +1 -1
  309. package/views/3d/environment/SunLighting.d.ts +2 -1
  310. package/views/3d/environment/VirtualLighting.d.ts +2 -1
  311. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  312. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  313. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
  314. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
  315. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +3 -1
  316. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +14 -13
  317. package/views/3d/webgl-engine/effects/atmosphere/ChapmanApproximation.glsl.js +14 -4
  318. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.glsl.js +1 -1
  319. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
  320. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphereTechnique.js +1 -1
  321. package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphereConfiguration.js +2 -0
  322. package/views/3d/webgl-engine/effects/clouds/CloudsParameters.js +1 -1
  323. package/views/3d/webgl-engine/effects/clouds/CloudsPresets.js +1 -1
  324. package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +2 -2
  325. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  326. package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
  327. package/views/3d/webgl-engine/lib/EmissionFader.js +2 -0
  328. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  329. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  330. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  331. package/views/3d/webgl-engine/materials/renderers/IndexLayout.js +1 -1
  332. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  333. package/views/3d/webgl-engine/shaders/AtmosphereCompositing.glsl.js +1 -1
  334. package/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique.js +1 -1
  335. package/views/3d/webgl-engine/shaders/floatBlendScale.glsl.js +1 -1
  336. package/views/BreakpointsOwner.d.ts +2 -1
  337. package/views/DOMContainer.d.ts +2 -1
  338. package/views/PopupView.d.ts +2 -1
  339. package/views/SceneView.d.ts +2 -1
  340. package/views/Theme.d.ts +2 -1
  341. package/views/VideoView.d.ts +2 -1
  342. package/views/View.d.ts +2 -1
  343. package/views/View2D.d.ts +2 -1
  344. package/views/Viewport2DMixin.d.ts +2 -1
  345. package/views/analysis/AnalysisView.d.ts +2 -1
  346. package/views/draw/DrawAction.d.ts +2 -1
  347. package/views/interactive/GraphicManipulator.d.ts +4 -0
  348. package/views/interactive/GraphicManipulator.js +1 -1
  349. package/views/interactive/options/SnappingOptions.d.ts +2 -1
  350. package/views/layers/FeatureLikeLayerView.d.ts +0 -32
  351. package/views/layers/FeatureLikeLayerView.js +1 -1
  352. package/views/layers/GraphicsLayerView.d.ts +0 -32
  353. package/views/layers/GraphicsLayerView.js +1 -1
  354. package/views/layers/ImageryLayerView.d.ts +1 -62
  355. package/views/layers/LayerView.d.ts +2 -1
  356. package/views/layers/LayerView.js +1 -1
  357. package/views/layers/PointCloudLayerView.d.ts +2 -1
  358. package/views/ui/UI.d.ts +1 -12
  359. package/views/webgl/Program.js +2 -2
  360. package/webdoc/GeotriggersInfo.d.ts +2 -1
  361. package/webdoc/IPSInfo.d.ts +2 -1
  362. package/webdoc/geotriggersInfo/DeviceLocationFeed.d.ts +2 -1
  363. package/webdoc/geotriggersInfo/ExpressionInfo.d.ts +2 -1
  364. package/webdoc/geotriggersInfo/FeatureFenceParameters.d.ts +2 -1
  365. package/webdoc/geotriggersInfo/FeatureFilter.d.ts +2 -1
  366. package/webdoc/geotriggersInfo/FeatureLayerSource.d.ts +2 -1
  367. package/webdoc/geotriggersInfo/Geotrigger.d.ts +2 -1
  368. package/webdoc/geotriggersInfo/GeotriggerNotificationOptions.d.ts +2 -1
  369. package/webdoc/ips/AppleIPSProperties.d.ts +2 -1
  370. package/webdoc/ips/Configuration.d.ts +2 -1
  371. package/webdoc/ips/GNSSProperties.d.ts +2 -1
  372. package/webdoc/ips/PathSnappingProperties.d.ts +2 -1
  373. package/webdoc/ips/PositioningService.d.ts +2 -1
  374. package/webdoc/ips/SmoothingProperties.d.ts +2 -1
  375. package/webdoc/support/SlideThumbnail.d.ts +2 -1
  376. package/webmap/Bookmark.d.ts +2 -1
  377. package/webmap/InitialViewProperties.d.ts +2 -1
  378. package/webscene/Glow.d.ts +2 -1
  379. package/webscene/InitialViewProperties.d.ts +2 -1
  380. package/webscene/Presentation.d.ts +2 -1
  381. package/webscene/Slide.d.ts +2 -1
  382. package/webscene/SlideLegendInfo.d.ts +2 -1
  383. package/webscene/spec-certification/spec.js +1 -1
  384. package/webscene/support/Description.d.ts +2 -1
  385. package/webscene/support/FeatureReference.d.ts +2 -1
  386. package/webscene/support/FeatureReferenceId.d.ts +2 -1
  387. package/webscene/support/LayerReference.d.ts +2 -1
  388. package/webscene/support/SlideElements.d.ts +2 -1
  389. package/webscene/support/SlideEnvironment.d.ts +2 -1
  390. package/webscene/support/SlideGround.d.ts +2 -1
  391. package/webscene/support/SlidePopupInfo.d.ts +2 -1
  392. package/webscene/support/SlideVisibleLayer.d.ts +2 -1
  393. package/webscene/support/Title.d.ts +2 -1
  394. package/webscene/support/schemaValidator.js +1 -1
  395. package/webscene/version.js +1 -1
  396. package/widgets/BasemapGallery/support/BasemapGalleryItem.d.ts +2 -1
  397. package/widgets/BasemapGallery/support/PortalBasemapsSource.d.ts +2 -1
  398. package/widgets/BasemapLayerList.d.ts +2 -1
  399. package/widgets/Bookmarks/BookmarksViewModel.d.ts +2 -1
  400. package/widgets/Bookmarks.d.ts +2 -1
  401. package/widgets/CatalogLayerList.d.ts +2 -1
  402. package/widgets/Compass/CompassViewModel.d.ts +2 -1
  403. package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +2 -1
  404. package/widgets/Directions/DirectionsViewModel.d.ts +2 -1
  405. package/widgets/Feature/FeatureViewModel.d.ts +2 -1
  406. package/widgets/FeatureForm/FeatureFormViewModel.d.ts +2 -1
  407. package/widgets/FeatureForm/UtilityNetworkAssociationInput.d.ts +2 -1
  408. package/widgets/FeatureTable/support/ColumnTemplate.d.ts +2 -1
  409. package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +2 -1
  410. package/widgets/FeatureTable/support/EditableColumnTemplateMixin.d.ts +2 -1
  411. package/widgets/FeatureTable/support/FieldColumnTemplate.d.ts +2 -1
  412. package/widgets/FeatureTable/support/TableTemplate.d.ts +2 -1
  413. package/widgets/FeatureTemplates/TemplateItemGroup.d.ts +2 -1
  414. package/widgets/Features/FeaturesViewModel.d.ts +2 -1
  415. package/widgets/FloorFilter/FloorFilterViewModel.d.ts +2 -1
  416. package/widgets/Home/HomeViewModel.d.ts +2 -1
  417. package/widgets/LayerList/ListItem.d.ts +2 -1
  418. package/widgets/LayerList/ListItemPanel.d.ts +2 -1
  419. package/widgets/LayerList.d.ts +2 -1
  420. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.d.ts +2 -1
  421. package/widgets/Print/PrintViewModel.d.ts +2 -1
  422. package/widgets/Search/SearchSource.d.ts +2 -1
  423. package/widgets/Search/SearchViewModel.d.ts +2 -1
  424. package/widgets/TableList/ListItem.d.ts +2 -1
  425. package/widgets/TableList/ListItemPanel.d.ts +2 -1
  426. package/widgets/TableList.d.ts +2 -1
  427. package/widgets/Widget.d.ts +2 -1
  428. package/widgets/support/GeolocationPositioning.d.ts +2 -1
  429. package/widgets/support/GoTo.d.ts +2 -1
  430. package/widgets/types.d.ts +0 -21
  431. package/assets/esri/widgets/Attribution/t9n/messages.ar.json +0 -1
  432. package/assets/esri/widgets/Attribution/t9n/messages.bg.json +0 -1
  433. package/assets/esri/widgets/Attribution/t9n/messages.bs.json +0 -1
  434. package/assets/esri/widgets/Attribution/t9n/messages.ca.json +0 -1
  435. package/assets/esri/widgets/Attribution/t9n/messages.cs.json +0 -1
  436. package/assets/esri/widgets/Attribution/t9n/messages.da.json +0 -1
  437. package/assets/esri/widgets/Attribution/t9n/messages.de.json +0 -1
  438. package/assets/esri/widgets/Attribution/t9n/messages.el.json +0 -1
  439. package/assets/esri/widgets/Attribution/t9n/messages.en.json +0 -1
  440. package/assets/esri/widgets/Attribution/t9n/messages.es.json +0 -1
  441. package/assets/esri/widgets/Attribution/t9n/messages.et.json +0 -1
  442. package/assets/esri/widgets/Attribution/t9n/messages.fi.json +0 -1
  443. package/assets/esri/widgets/Attribution/t9n/messages.fr.json +0 -1
  444. package/assets/esri/widgets/Attribution/t9n/messages.he.json +0 -1
  445. package/assets/esri/widgets/Attribution/t9n/messages.hr.json +0 -1
  446. package/assets/esri/widgets/Attribution/t9n/messages.hu.json +0 -1
  447. package/assets/esri/widgets/Attribution/t9n/messages.id.json +0 -1
  448. package/assets/esri/widgets/Attribution/t9n/messages.it.json +0 -1
  449. package/assets/esri/widgets/Attribution/t9n/messages.ja.json +0 -1
  450. package/assets/esri/widgets/Attribution/t9n/messages.ko.json +0 -1
  451. package/assets/esri/widgets/Attribution/t9n/messages.lt.json +0 -1
  452. package/assets/esri/widgets/Attribution/t9n/messages.lv.json +0 -1
  453. package/assets/esri/widgets/Attribution/t9n/messages.nl.json +0 -1
  454. package/assets/esri/widgets/Attribution/t9n/messages.no.json +0 -1
  455. package/assets/esri/widgets/Attribution/t9n/messages.pl.json +0 -1
  456. package/assets/esri/widgets/Attribution/t9n/messages.pt-BR.json +0 -1
  457. package/assets/esri/widgets/Attribution/t9n/messages.pt-PT.json +0 -1
  458. package/assets/esri/widgets/Attribution/t9n/messages.ro.json +0 -1
  459. package/assets/esri/widgets/Attribution/t9n/messages.ru.json +0 -1
  460. package/assets/esri/widgets/Attribution/t9n/messages.sk.json +0 -1
  461. package/assets/esri/widgets/Attribution/t9n/messages.sl.json +0 -1
  462. package/assets/esri/widgets/Attribution/t9n/messages.sr.json +0 -1
  463. package/assets/esri/widgets/Attribution/t9n/messages.sv.json +0 -1
  464. package/assets/esri/widgets/Attribution/t9n/messages.th.json +0 -1
  465. package/assets/esri/widgets/Attribution/t9n/messages.tr.json +0 -1
  466. package/assets/esri/widgets/Attribution/t9n/messages.uk.json +0 -1
  467. package/assets/esri/widgets/Attribution/t9n/messages.vi.json +0 -1
  468. package/assets/esri/widgets/Attribution/t9n/messages.zh-CN.json +0 -1
  469. package/assets/esri/widgets/Attribution/t9n/messages.zh-HK.json +0 -1
  470. package/assets/esri/widgets/Attribution/t9n/messages.zh-TW.json +0 -1
  471. package/chunks/CloudsComposition.glsl.js +0 -3
  472. package/popup/content.d.ts +0 -192
  473. package/popup/content.js +0 -2
  474. package/portal/schemas/buildingSceneLayerItem.js +0 -2
  475. package/portal/schemas/gaussianSplatLayerItem.js +0 -2
  476. package/portal/schemas/integratedMesh3DTilesLayerItem.js +0 -2
  477. package/portal/schemas/integratedMeshLayerItem.js +0 -2
  478. package/portal/schemas/pointCloudLayerItem.js +0 -2
  479. package/portal/schemas/sceneLayerItem.js +0 -2
  480. package/portal/schemas/webScene.js +0 -2
  481. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.glsl.js +0 -2
  482. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +0 -2
  483. package/views/3d/webgl-engine/effects/clouds/CloudsCompositionTechnique.js +0 -2
  484. package/widgets/Attribution/AttributionViewModel.d.ts +0 -41
  485. package/widgets/Attribution/AttributionViewModel.js +0 -2
  486. package/widgets/Attribution.d.ts +0 -105
  487. package/widgets/Attribution.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"../../../../core/has.js";import{normalize as e,add as t,scale as n,length as r,set as i,equals as a,subtract as o,dot as s,len as c,sqrDist as l,copy as u,sub as d,scaleAndAdd as f,distance as p,squaredLength as m,squaredDistance as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../geometry/ellipsoidUtils.js";import v from"../../../../geometry/Point.js";import y from"../../../../geometry/SpatialReference.js";import{getSphericalPCPF as b}from"../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as ee}from"../../../../geometry/projection/projectBoundingRect.js";import{projectBoundingSphere as te}from"../../../../geometry/projection/projectBoundingSphere.js";import{getProjector as ne}from"../../../../geometry/projection/projectors.js";import{create as re,fromValues as x}from"../../../../geometry/support/aaBoundingRect.js";import{create as ie,fromPoints as S,distance2 as ae}from"../../../../geometry/support/lineSegment.js";import{signedDistance as C,getNormal as w}from"../../../../geometry/support/plane.js";import{isPlateCarree as oe,webMercatorValid as se}from"../../../../geometry/support/spatialReferenceUtils.js";import{Sphere as T}from"../../../../geometry/support/sphere.js";import{evaluateElevationAlignmentAtPoint as E}from"../graphics/elevationAlignmentUtils.js";import{ElevationContext as ce}from"../graphics/ElevationContext.js";import{createContextWithoutExpressionSupport as le,extractExpressionInfo as ue}from"../graphics/featureExpressionInfoUtils.js";import{intersectBoundingRectWithMbs as D}from"./I3SUtil.js";import{Frustum as de}from"../../state/Frustum.js";import{groundNavigationConstants as fe}from"../../state/utils/groundNavigationUtils.js";import"../../support/elevationUpdateExtentUtils.js";import{Obb as O,computeOffsetObb as pe}from"../../support/orientedBoundingBox.js";import{SweptSphereCylindricalVolume as me,SphereGlobal as he,SweptSphereConicalVolume as k}from"../../support/SweptSphereVolume.js";import{sphereToGeographicExtent as A,intersectsGeographicExtent as j}from"../../support/sphereExtentUtils.js";const M=1e5;class N{get _frustumPlanes(){return this._frustum.planes}constructor(e,t,n,r,i,a,o,s,c={}){this._indexSR=e,this._renderCoordsHelper=t,this._clippingArea=i,this._elevationProvider=a,this._viewingMode=o,this._options=c,this._viewDirection=g(),this._useFrustumCulling=!1,this._poi=g(),this._cameraPOIDirection=g(),this._elevationContext=null,this._checkBelowSegmentEnd=g(),this.minCenterDistance=1/0,this.maxCenterDistance=0,this.maxLodLevel=2,this._screenspaceErrorBias=c.screenspaceErrorBias||1,this._progressiveLoadFactor=c.progressiveLoadFactor||1,this._frustum=new de(t),this.updateCamera(n,r);let l=this._renderCoordsHelper.spatialReference;this._renderSR=l,this._renderSRSphericalPCPF=b(l),this._isGlobalMode=this._viewingMode===1,this.elevationIntersectionSpatialReference=this._isGlobalMode?this._indexSR.isWebMercator?this._indexSR:this._elevationProvider.spatialReference:l,this.updateElevationInfo(s),this._isECEFOBBInLocalMode=this._indexSR.isWGS84&&(l.isWebMercator||oe(l)),this._indexSREllipsoidRadius=_(this._indexSR).radius,this._indexSRSphericalPCPF=b(e),this._projectorIndexSRToIndexSRSphericalPCPF=ne(this._indexSR,this._indexSRSphericalPCPF),this._groundNavigationCheckDistance=fe.i3sNodeDownwardCheckDistanceInMeters/this._renderCoordsHelper.unitInMeters}updateElevationInfo(e){e==null?this._elevationContext=null:(this._elevationContext=ce.fromElevationInfo(e),this._elevationContext.setFeatureExpressionInfoContext(le(ue(e,!1))))}updateCamera(r,i){this._useFrustumCulling=i,e(this._viewDirection,r.viewForward),i&&this._frustum.update(r),this._halfScreenPixelSizePerDistance=r.screenPixelSizePerDistance/2,this._camPos=r.eye,this._updateCameraPOIDirection(),this.minCenterDistance=1/0,this.maxCenterDistance=0,t(this._checkBelowSegmentEnd,this._camPos,n(this._checkBelowSegmentEnd,this._renderCoordsHelper.worldUpAtPosition(this._camPos,this._checkBelowSegmentEnd),-this._groundNavigationCheckDistance))}setPointOfInterest(e){this._poi=e,this._updateCameraPOIDirection()}updateScreenSpaceErrorBias(e){let t=this._screenspaceErrorBias;return this._screenspaceErrorBias=e,t}updateClippingArea(e){this._clippingArea=e}expandElevationRange(e,t,n){if(this._elevationContext==null)return;let r=e.serviceMbsInIndexSR;if(!r)return;let i=this._elevationContext.mode===`relative-to-scene`?`scene`:`ground`,a=this._elevationProvider;if(a.getSphereElevationRange){let e=a.getSphereElevationRange(r,this._indexSR,i);if(e){n.expandElevationRange(e);return}}let[o,s,c]=r.center,l=a.getElevation(o,s,c,this._indexSR,i);l&&n.expandElevationRangeValues(l,l);let u=t?null:a.getRootElevationRange?.();u&&n.expandElevationRange(u)}calculateServiceMbsInRenderSR(e){let{serviceMbsInRenderSR:t}=e;if(t.isValid)return t;let{serviceMbsInIndexSR:n}=e;if(!n?.isValid)return t;let r=G;return te(n,this._indexSR,r,this._renderSR),e.updateServiceMbsInRenderSR(r)}intersectsElevationUpdate(e,t){if(this._isGlobalMode&&this._indexSR.isWebMercator){let n=t.serviceMbsInIndexSR;if(!n?.isValid)return!0;let[r,i]=se,a=i-r,o=e[2]-e[0]>=a,s=o?0:Math.round((n.center[0]-(e[0]+e[2])/2)/a)*a;return x(o?-1/0:e[0]+s,e[1],o?1/0:e[2]+s,e[3],K),D(K,n)!==0}let n=this.calculateServiceMbsInRenderSR(t);if(!n.isValid)return!0;if(!this._isGlobalMode)return D(e,n)!==0;let r=t.serviceMbsElevationUpdateExtent;return r[0]>r[2]&&(A(n,r),this.elevationIntersectionSpatialReference.isWebMercator&&Number.isFinite(r[0])&&(r[1]=Math.max(-90,r[1]),r[3]=Math.min(90,r[3]),ee(r,y.WGS84,r,this.elevationIntersectionSpatialReference)||x(-1/0,-1/0,1/0,1/0,r))),j(e,r,this.elevationIntersectionSpatialReference)}_evaluateElevationAlignmentInIndexSR(e,t){return B.x=e[0],B.y=e[1],B.z=e[2],B.spatialReference=this._indexSR,E(B,this._elevationProvider,t,this._renderCoordsHelper)}calculateServiceMbsInRenderSRElevationAdjusted(e){let{serviceMbsInRenderSRElevationAdjusted:t}=e;if(t.isValid)return t;let{serviceMbsInIndexSR:n}=e,r=this.calculateServiceMbsInRenderSR(e);if(!r.isValid||!n?.isValid)return t;let i=G;i.copyFrom(r);let{_elevationContext:a}=this;if(a){let{minElevation:t}=e,{_renderCoordsHelper:r}=this,o=n.center,s=0;if(Number.isFinite(t)){let n=0,c=0,{maxElevation:l}=e,u=o[2];switch(a.mode){case`relative-to-ground`:case`relative-to-scene`:n=a.geometryZWithOffset(u,r)+t-u,c=l-t;break;case`on-the-ground`:n=t-u,c=l-t}s=n+.5*c,i.radius+=.5*c}else i.radius<M&&(s=this._evaluateElevationAlignmentInIndexSR(o,a)-o[2]);s&&ye(i,s,this._viewingMode)}return e.updateServiceMbsInRenderSRElevationAdjusted(i)}_isGlobalMbsContainingPlanetCenter(e){return this._viewingMode===1&&r(e.center)<=e.radius}calculateMbsConeInRenderSR(e){let{mbsConeInRenderSR:t}=e;if(t)return t;if(!e.elevationRangeValid)return null;let{minElevation:n,maxElevation:r}=e;if(!Number.isFinite(n)||!(n<r))return null;let i=this.calculateServiceMbsInRenderSR(e);if(!i.isValid)return null;let a=this._elevationContext;if(a?.mode===`relative-to-ground`||a?.mode===`relative-to-scene`){let t=e.serviceMbsInIndexSR;if(!t?.isValid)return null;let i=t.center[2],o=a.geometryZWithOffset(i,this._renderCoordsHelper);if(this._viewingMode===2)n+=o,r+=o;else{let e=o-i;n+=e,r+=e}}let o=this._renderCoordsHelper.referenceEllipsoid.radius,s=this._viewingMode===2?new me(i,n,r):this._isGlobalMbsContainingPlanetCenter(i)?new he(i,o+n,o+r):new k(i,o+n,o+r);return e.updateMbsConeInRenderSR(s)}getAndUpdateVisibilityObbInRenderSR(e){{let t=e.visibilityObbInRenderSR;if(t)return t}let t=this._indexSREllipsoidRadius*.01,{serviceMbsInIndexSR:n,serviceObbInIndexSR:r}=e;if(r==null||!n||!r.isValid||this._isECEFOBBInLocalMode&&(r.halfSizeX>t||r.halfSizeY>t||r.halfSizeZ>t))return null;{let t=e.serviceObbInRenderSR;if(t==null)t=new O,e.serviceObbInRenderSR=t;else if(t.isValid)return t;let a=n.radius,o=0,s=0,c=r.centerZ,l=this._renderCoordsHelper,u=this._elevationContext;if(u&&e.elevationRangeValid){let{minElevation:t,maxElevation:n}=e;switch(u.mode){case`relative-to-ground`:case`relative-to-scene`:o=u.geometryZWithOffset(c,l)+t-c,s=n-t;break;case`on-the-ground`:o=t-c,s=n-t}}else if(u&&a<M){let e=i(z,r.centerX,r.centerY,c);o=this._evaluateElevationAlignmentInIndexSR(e,u)-c}let d=s>0,f=d?R:t;return r.transform(f,this._indexSR,this._renderSR,o,this._renderSRSphericalPCPF,this._indexSRSphericalPCPF,this._projectorIndexSRToIndexSRSphericalPCPF),d&&pe(f,0,s,this._viewingMode,t),t}}getNodeObbInRenderSRIndependentOfElevationOffset(e){{let t=e.visibilityObbInRenderSR??e.serviceObbInRenderSR??null;if(t?.isValid)return t}let t=e.serviceObbInIndexSR;return t?this._viewingMode===2&&Math.max(t.halfSizeX,t.halfSizeY,t.halfSizeZ)>.2*this._indexSREllipsoidRadius?null:(t.transform(R,this._indexSR,this._renderSR,void 0,this._renderSRSphericalPCPF,this._indexSRSphericalPCPF,this._projectorIndexSRToIndexSRSphericalPCPF),R):null}ensureElevationAgnosticBoundingVolume(e){return!e.elevationAgnosticBoundingVolume.valid&&e.level>0&&(this._viewingMode===1?this._updateElevationAgnosticBoundingVolumeGlobal(e):this._updateElevationAgnosticBoundingVolumeLocal(e)),e.elevationAgnosticBoundingVolume}_updateCameraPOIDirection(){a(this._poi,this._camPos)?this._cameraPOIDirection=this._viewDirection:(o(this._cameraPOIDirection,this._camPos,this._poi),e(this._cameraPOIDirection,this._cameraPOIDirection))}_updateElevationAgnosticBoundingVolumeGlobal(t){let n=this.getNodeObbInRenderSRIndependentOfElevationOffset(t),r=t.elevationAgnosticBoundingVolume,i=-1,a;if(n){let t=z;n.getCenter(t),e(t,t),a=t,n.getCorners(V);for(let n of V){e(n,n);let a=s(n,t);if(a<=0){r.invalidate();return}let o=Math.sqrt(Math.max(0,1-a*a));i=Math.max(i,o)}}else{let n=t.serviceMbsInRenderSR;if(!n.isValid){r.invalidate();return}let{center:o,radius:s}=n,l=c(o);if(l<s){r.invalidate();return}i=s/l,a=e(W,o)}r.set(a,i+we)}_updateElevationAgnosticBoundingVolumeLocal(e){let t=e.elevationAgnosticBoundingVolume,n=this.getNodeObbInRenderSRIndependentOfElevationOffset(e);if(n){let e=n.getCenter(z);e[2]=0;let r=0,i=H;n.getCorners(V);for(let e of V){e[2]=0;let t=l(i,e);r=Math.max(r,t)}t.set(e,Math.sqrt(r))}else{let n=e.serviceMbsInRenderSR;if(n.isValid){let e=u(z,n.center);e[2]=0,t.set(e,n.radius)}}}isNodeVisible(e,t=!1){if(!this._isMBSinClippingArea(this.calculateServiceMbsInRenderSR(e)))return!1;if(!this._useFrustumCulling||t&&this.isNodeCloseBelowCamera(e))return!0;let n=this.getAndUpdateVisibilityObbInRenderSR(e);return n?n.intersectsFrustumConservativeApproximation(this._frustumPlanes):this._frustum.intersectsSphere(this.calculateServiceMbsInRenderSRElevationAdjusted(e))}isNodeCloseBelowCamera(e){let t=this.getAndUpdateVisibilityObbInRenderSR(e);if(t?.isValid)return t.intersectSegment(this._camPos,this._checkBelowSegmentEnd);let n=this.calculateServiceMbsInRenderSRElevationAdjusted(e);if(!n.isValid)return!0;let r=S(this._camPos,this._checkBelowSegmentEnd,ge);return ae(r,n.center)<=n.radius**2}isElevationAgnosticBoundingVolumeVisible(e,t){return!this._useFrustumCulling||!e.valid?!0:e.intersectsFrustumConservative(this._frustum,this._viewingMode,1+t)?this._viewingMode!==1||this._isConeVisibleInFrustum(e):!1}_isConeVisibleInFrustum(t){let r=t.radius;if(r>Se)return!0;let i=this._frustumPlanes,{center:a,radius:o}=this._frustum.boundingSphere,c=t.getAxis(W),l=s(c,a),u=o+1,p=l-u,m=l+u;if(p<=0)return!0;let h=n(F,c,p),g=n(I,c,m),_=r/Math.sqrt(1-r*r);for(let t of i){let r=w(t),i=e(L,r),a=s(i,c);if(Math.abs(1-a)<Ce)continue;let o=_e;n(o,c,a),d(o,o,i),e(o,o);let l=ve;if(f(l,h,o,p*_),!(C(t,l)<=0)&&(f(l,g,o,m*_),!(C(t,l)<=0)))return!1}return!0}isObbVisibleIndependentOfElevation(e,t){if(!this._useFrustumCulling||!e.valid)return!0;let{center:r,radius:i}=this._frustum.boundingSphere,a=i+1,o=this._frustumPlanes,c=V;if(t.getCorners(c),this._viewingMode===1){let t=e.getAxis(W),i=s(t,r),l=i-a,u=i+a;if(l<=0)return!0;for(let e of o){let r=!0;for(let i of c){let a=s(i,t),o=U;if(n(o,i,l/a),C(e,o)<=0){r=!1;break}let c=U;if(n(c,i,u/a),C(e,c)<=0){r=!1;break}}if(r)return!1}}else{let e=r[2]-a,t=r[2]+a;for(let n of o){let r=!0,i=w(n),a=i[0],o=i[1],s=i[2],l=n[3];for(let n of c){let i=a*n[0]+o*n[1]+l;if(i+s*e<=0||i+s*t<=0){r=!1;break}}if(r)return!1}}return!0}isGeometryVisible(e,t){if(!this._useFrustumCulling)return!0;let n=e.geometryObbInRenderSR;return!n?.isValid||n.intersectsFrustumConservativeApproximation(this._frustumPlanes)||t&&n.intersectSegment(this._camPos,this._checkBelowSegmentEnd)}_isMBSinClippingArea(e){return this._clippingArea==null||D(this._clippingArea,e)!==0}_screenSpaceDiameterMbs(e,t){let n=this.calcCameraDistanceToSurfaceAndUpdateMinmaxWithCenterDistance(e);return n<0?be:t/n/this._halfScreenPixelSizePerDistance}calcCameraDistanceToSurfaceAndUpdateMinmaxWithCenterDistance(e){let t=this.calculateMbsConeInRenderSR(e);if(t==null)return this.calcCameraDistanceToSurfaceAndUpdateMinmaxWithSphere(e);let n=t.calculateSurfaceDistanceFromPoint(this._camPos),r=t.calculateCenterDistanceFromPoint(this._camPos);return this._updateMinMaxDistanceToCenter(r),n}calcCameraDistanceToSurfaceAndUpdateMinmaxWithSphere(e){return this.calcCameraDistanceToCenterAndUpdateMinmax(e)-this.calculateServiceMbsInRenderSRElevationAdjusted(e).radius}calcCameraDistanceToCenterAndUpdateMinmax(e){let t=this.calculateServiceMbsInRenderSRElevationAdjusted(e),n=p(t.center,this._camPos);return this._updateMinMaxDistanceToCenter(n),n}_calculateAngleDependentLoDForSphere(e,t){let n=d(H,e,this._camPos),i=r(e),a=r(n);if(i===0||a===0)return 1;let o=(Math.abs(s(e,n))/i+t)/a;return Math.min(1,o)}calcAngleDependentLoD(e){let t=this.calculateMbsConeInRenderSR(e);if(t==null){let{center:t,radius:n}=this.calculateServiceMbsInRenderSRElevationAdjusted(e);return this._calculateAngleDependentLoDForSphere(t,n)}let{center:i,radius:a}=this.calculateServiceMbsInRenderSR(e);if(this._viewingMode===2)u(q,i),q[2]=t.lowerCenterHeight,u(J,i),J[2]=t.upperCenterHeight;else{let e=r(i);if(e===0)return 1;n(q,i,t.lowerCenterHeight/e),n(J,i,t.upperCenterHeight/e)}let o=this._calculateAngleDependentLoDForSphere(q,a),c=this._calculateAngleDependentLoDForSphere(J,a);if(this._viewingMode===2)u(Y,i),Y[2]=Math.max(t.lowerCenterHeight,Math.min(t.upperCenterHeight,this._camPos[2]));else{let e=r(i);if(e===0)return Math.max(o,c);let a=Math.max(t.lowerCenterHeight,Math.min(t.upperCenterHeight,s(this._camPos,i)/e));n(Y,i,a/e)}return Math.max(o,c,this._calculateAngleDependentLoDForSphere(Y,a))}hasLOD(e){return e.lodMetric!==0}_getDistanceToSurfaceGlobeMode(e,i){let a=r(i.center),c=r(e)-a;n(q,e,s(e,i.center)/m(e));let l=h(i.center,q),u=i.radius;if(l<=u*u)return Math.abs(c);let d=n(q,i.center,1/a),f=u*u/(2*a),g=n(J,d,a-f),_=o(Y,e,g),v=o(Y,_,n(X,d,s(d,_))),y=t(Y,g,n(Y,v,u/r(v))),b=p(e,y);if(c>=Z){let t=o(J,e,y),n=s(t,d)/r(t);n<Q&&(n=$),b/=n}return b}_getDistanceToSurface(e,t){return this._isGlobalMode?this._getDistanceToSurfaceGlobeMode(e,t):P(e,t)}_applyGlobalFlatAngleCorrectionToConeDistance(e,t){t.calculateClosestCenterToPoint(this._camPos,X);let n=r(X);if(n===0||r(this._camPos)-n<Z)return e;let i=o(Y,this._camPos,X),a=r(i);if(a===0)return e;let c=s(i,X)/(a*n);return e/(c<Q?$:c)}calculateScreenSpaceRelativeSphere(e){let t=this.calculateServiceMbsInRenderSRElevationAdjusted(e),n=this._getDistanceToSurface(this._camPos,t),r=n+t.radius;return this._updateMinMaxDistanceToCenter(r),2*n*this._halfScreenPixelSizePerDistance}calculateScreenSpaceRelativeCone(e){let t=e.calculateCenterDistanceFromPoint(this._camPos);this._updateMinMaxDistanceToCenter(t);let n=e.calculateSurfaceDistanceFromPoint(this._camPos);return 2*(this._isGlobalMode?this._applyGlobalFlatAngleCorrectionToConeDistance(n,e):n)*this._halfScreenPixelSizePerDistance}_updateMinMaxDistanceToCenter(e){e>0?(this.minCenterDistance=Math.min(this.minCenterDistance,e),this.maxCenterDistance=Math.max(this.maxCenterDistance,e)):(this.minCenterDistance=0,this.maxCenterDistance=Math.max(this.maxCenterDistance,-e))}getLodLevel(e){if(e.lodMetric===0)return 0;if(e.childCount===0)return this.maxLodLevel;if(this._useFrustumCulling&&this._progressiveLoadFactor<1){let t=this._progressiveLoadFactor*this._screenspaceErrorBias,n=this._screenspaceErrorBias;return this.evaluateLODmetric(e,t)?this.evaluateLODmetric(e,n)?2:1:0}return this.evaluateLODmetric(e,this._screenspaceErrorBias)?this.maxLodLevel:0}evaluateLODmetric(e,t){switch(e.lodMetric){case 1:{let n=this._screenSpaceDiameterMbs(e,(e.serviceMbsInIndexSR?.radius??0)*t);return this._options.angleDependentLoD&&(n*=this.calcAngleDependentLoD(e)),n<e.maxError}case 2:{let n=this.calculateMbsConeInRenderSR(e),r=n?this.calculateScreenSpaceRelativeCone(n):this.calculateScreenSpaceRelativeSphere(e);return e.maxError*t<=r}case 3:return this._screenSpaceDiameterMbs(e,e.maxError)*t<xe;case 4:return this.calcCameraDistanceToSurfaceAndUpdateMinmaxWithCenterDistance(e)>e.maxError*t}return!1}distToCameraPOIRay(e){if(e==null)return 0;let t=this.calculateServiceMbsInRenderSRElevationAdjusted(e),n=t.center,r=s(n,this._cameraPOIDirection),i=r*r,a=m(n)-i;return Math.sqrt(a)-t.radius}distCameraToPOI(){return p(this._camPos,this._poi)}}function P(e,t){let n=e[0]-t.center[0],r=e[1]-t.center[1],i=e[2]-t.center[2],a=n*n+r*r,o=t.radius;if(a<=o*o)return Math.abs(i);let s=Math.sqrt(a)-o;return Math.sqrt(i*i+s*s)}const F=g(),I=g(),L=g(),R=new O,z=g(),B=new v,V=[g(),g(),g(),g(),g(),g(),g(),g()],H=g(),ge=ie(),_e=g(),ve=g(),U=g(),W=g(),G=new T,K=re(),q=g(),J=g(),Y=g(),X=g();function ye(e,t,i){if(i===2)e.center[2]+=t;else{let i=r(e.center);if(i===0){e.radius+=Math.abs(t);return}n(e.center,e.center,1+t/i)}}const be=.5*Number.MAX_VALUE,xe=10,Z=2e5,Q=.08,$=1e-4,Se=.9,Ce=.01,we=.001;export{N as default};
2
+ import"../../../../core/has.js";import{normalize as e,add as t,scale as n,length as r,set as i,equals as a,subtract as o,dot as s,len as c,sqrDist as l,copy as u,sub as d,scaleAndAdd as f,distance as p,squaredLength as m,squaredDistance as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../geometry/ellipsoidUtils.js";import v from"../../../../geometry/Point.js";import y from"../../../../geometry/SpatialReference.js";import{getSphericalPCPF as b}from"../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as ee}from"../../../../geometry/projection/projectBoundingRect.js";import{projectBoundingSphere as te}from"../../../../geometry/projection/projectBoundingSphere.js";import{getProjector as ne}from"../../../../geometry/projection/projectors.js";import{create as re,fromValues as x}from"../../../../geometry/support/aaBoundingRect.js";import{create as ie,fromPoints as S,distance2 as ae}from"../../../../geometry/support/lineSegment.js";import{signedDistance as C,getNormal as w}from"../../../../geometry/support/plane.js";import{isPlateCarree as oe,webMercatorValid as se}from"../../../../geometry/support/spatialReferenceUtils.js";import{Sphere as T}from"../../../../geometry/support/sphere.js";import{evaluateElevationAlignmentAtPoint as E}from"../graphics/elevationAlignmentUtils.js";import{ElevationContext as ce}from"../graphics/ElevationContext.js";import{createContextWithoutExpressionSupport as le,extractExpressionInfo as ue}from"../graphics/featureExpressionInfoUtils.js";import{intersectBoundingRectWithMbs as D}from"./I3SUtil.js";import{Frustum as de}from"../../state/Frustum.js";import{groundNavigationConstants as fe}from"../../state/utils/groundNavigationUtils.js";import"../../support/elevationUpdateExtentUtils.js";import{Obb as O,computeOffsetObb as pe}from"../../support/orientedBoundingBox.js";import{SweptSphereCylindricalVolume as me,SphereGlobal as k,SweptSphereConicalVolume as A}from"../../support/SweptSphereVolume.js";import{sphereToGeographicExtent as j,intersectsGeographicExtent as M}from"../../support/sphereExtentUtils.js";const N=1e5;class P{get _frustumPlanes(){return this._frustum.planes}constructor(e,t,n,r,i,a,o,s,c={}){this._indexSR=e,this._renderCoordsHelper=t,this._clippingArea=i,this._elevationProvider=a,this._viewingMode=o,this._options=c,this._viewDirection=g(),this._useFrustumCulling=!1,this._poi=g(),this._cameraPOIDirection=g(),this._elevationContext=null,this._checkBelowSegmentEnd=g(),this.minCenterDistance=1/0,this.maxCenterDistance=0,this.maxLodLevel=2,this._screenspaceErrorBias=c.screenspaceErrorBias||1,this._progressiveLoadFactor=c.progressiveLoadFactor||1,this._frustum=new de(t),this.updateCamera(n,r);let l=this._renderCoordsHelper.spatialReference;this._renderSR=l,this._renderSRSphericalPCPF=b(l),this._isGlobalMode=this._viewingMode===1,this.elevationIntersectionSpatialReference=this._isGlobalMode?this._indexSR.isWebMercator?this._indexSR:this._elevationProvider.spatialReference:l,this.updateElevationInfo(s),this._isECEFOBBInLocalMode=this._indexSR.isWGS84&&(l.isWebMercator||oe(l)),this._indexSREllipsoidRadius=_(this._indexSR).radius,this._indexSRSphericalPCPF=b(e),this._projectorIndexSRToIndexSRSphericalPCPF=ne(this._indexSR,this._indexSRSphericalPCPF),this._groundNavigationCheckDistance=fe.i3sNodeDownwardCheckDistanceInMeters/this._renderCoordsHelper.unitInMeters}updateElevationInfo(e){e==null?this._elevationContext=null:(this._elevationContext=ce.fromElevationInfo(e),this._elevationContext.setFeatureExpressionInfoContext(le(ue(e,!1))))}updateCamera(r,i){this._useFrustumCulling=i,e(this._viewDirection,r.viewForward),i&&this._frustum.update(r),this._halfScreenPixelSizePerDistance=r.screenPixelSizePerDistance/2,this._camPos=r.eye,this._updateCameraPOIDirection(),this.minCenterDistance=1/0,this.maxCenterDistance=0,t(this._checkBelowSegmentEnd,this._camPos,n(this._checkBelowSegmentEnd,this._renderCoordsHelper.worldUpAtPosition(this._camPos,this._checkBelowSegmentEnd),-this._groundNavigationCheckDistance))}setPointOfInterest(e){this._poi=e,this._updateCameraPOIDirection()}updateScreenSpaceErrorBias(e){let t=this._screenspaceErrorBias;return this._screenspaceErrorBias=e,t}updateClippingArea(e){this._clippingArea=e}expandElevationRange(e,t,n){if(this._elevationContext==null)return;let r=e.serviceMbsInIndexSR;if(!r)return;let i=this._elevationContext.mode===`relative-to-scene`?`scene`:`ground`,a=this._elevationProvider;if(a.getSphereElevationRange){let e=a.getSphereElevationRange(r,this._indexSR,i);if(e){n.expandElevationRange(e);return}}let[o,s,c]=r.center,l=a.getElevation(o,s,c,this._indexSR,i);l&&n.expandElevationRangeValues(l,l);let u=t?null:a.getRootElevationRange?.();u&&n.expandElevationRange(u)}calculateServiceMbsInRenderSR(e){let{serviceMbsInRenderSR:t}=e;if(t.isValid)return t;let{serviceMbsInIndexSR:n}=e;if(!n?.isValid)return t;let r=G;return te(n,this._indexSR,r,this._renderSR),e.updateServiceMbsInRenderSR(r)}intersectsElevationUpdate(e,t){if(this._isGlobalMode&&this._indexSR.isWebMercator){let n=t.serviceMbsInIndexSR;if(!n?.isValid)return!0;let[r,i]=se,a=i-r,o=e[2]-e[0]>=a,s=o?0:Math.round((n.center[0]-(e[0]+e[2])/2)/a)*a;return x(o?-1/0:e[0]+s,e[1],o?1/0:e[2]+s,e[3],K),D(K,n)!==0}let n=this.calculateServiceMbsInRenderSR(t);if(!n.isValid)return!0;if(!this._isGlobalMode)return D(e,n)!==0;let r=t.serviceMbsElevationUpdateExtent;return r[0]>r[2]&&(j(n,r),this.elevationIntersectionSpatialReference.isWebMercator&&Number.isFinite(r[0])&&(r[1]=Math.max(-90,r[1]),r[3]=Math.min(90,r[3]),ee(r,y.WGS84,r,this.elevationIntersectionSpatialReference)||x(-1/0,-1/0,1/0,1/0,r))),M(e,r,this.elevationIntersectionSpatialReference)}_evaluateElevationAlignmentInIndexSR(e,t){return V.x=e[0],V.y=e[1],V.z=e[2],V.spatialReference=this._indexSR,E(V,this._elevationProvider,t,this._renderCoordsHelper)}calculateServiceMbsInRenderSRElevationAdjusted(e){let{serviceMbsInRenderSRElevationAdjusted:t}=e;if(t.isValid)return t;let{serviceMbsInIndexSR:n}=e,r=this.calculateServiceMbsInRenderSR(e);if(!r.isValid||!n?.isValid)return t;let i=G;i.copyFrom(r);let{_elevationContext:a}=this;if(a){let{minElevation:t}=e,{_renderCoordsHelper:r}=this,o=n.center,s=0;if(Number.isFinite(t)){let n=0,c=0,{maxElevation:l}=e,u=o[2];switch(a.mode){case`relative-to-ground`:case`relative-to-scene`:n=a.geometryZWithOffset(u,r)+t-u,c=l-t;break;case`on-the-ground`:n=t-u,c=l-t}s=n+.5*c,i.radius+=.5*c}else i.radius<N&&(s=this._evaluateElevationAlignmentInIndexSR(o,a)-o[2]);s&&ye(i,s,this._viewingMode)}return e.updateServiceMbsInRenderSRElevationAdjusted(i)}_isGlobalMbsContainingPlanetCenter(e){return this._viewingMode===1&&r(e.center)<=e.radius}calculateMbsConeInRenderSR(e){let{mbsConeInRenderSR:t}=e;if(t)return t;if(!e.elevationRangeValid)return null;let{minElevation:n,maxElevation:r}=e;if(!Number.isFinite(n)||!(n<r))return null;let i=this.calculateServiceMbsInRenderSR(e);if(!i.isValid)return null;let a=this._elevationContext;if(a?.mode===`relative-to-ground`||a?.mode===`relative-to-scene`){let t=e.serviceMbsInIndexSR;if(!t?.isValid)return null;let i=t.center[2],o=a.geometryZWithOffset(i,this._renderCoordsHelper);if(this._viewingMode===2)n+=o,r+=o;else{let e=o-i;n+=e,r+=e}}let o=this._renderCoordsHelper.referenceEllipsoid.radius,s=this._viewingMode===2?new me(i,n,r):this._isGlobalMbsContainingPlanetCenter(i)?new k(i,o+n,o+r):new A(i,o+n,o+r);return e.updateMbsConeInRenderSR(s)}getAndUpdateVisibilityObbInRenderSR(e){{let t=e.visibilityObbInRenderSR;if(t)return t}let t=this._indexSREllipsoidRadius*.01,{serviceMbsInIndexSR:n,serviceObbInIndexSR:r}=e;if(r==null||!n||!r.isValid||this._isECEFOBBInLocalMode&&(r.halfSizeX>t||r.halfSizeY>t||r.halfSizeZ>t))return null;{let t=e.serviceObbInRenderSR;if(t==null)t=new O,e.serviceObbInRenderSR=t;else if(t.isValid)return t;let a=n.radius,o=0,s=0,c=r.centerZ,l=this._renderCoordsHelper,u=this._elevationContext;if(u&&e.elevationRangeValid){let{minElevation:t,maxElevation:n}=e;switch(u.mode){case`relative-to-ground`:case`relative-to-scene`:o=u.geometryZWithOffset(c,l)+t-c,s=n-t;break;case`on-the-ground`:o=t-c,s=n-t}}else if(u&&a<N){let e=i(B,r.centerX,r.centerY,c);o=this._evaluateElevationAlignmentInIndexSR(e,u)-c}let d=s>0,f=d?z:t;return r.transform(f,this._indexSR,this._renderSR,o,this._renderSRSphericalPCPF,this._indexSRSphericalPCPF,this._projectorIndexSRToIndexSRSphericalPCPF),d&&pe(f,0,s,this._viewingMode,t),t}}getNodeObbInRenderSRIndependentOfElevationOffset(e){{let t=e.visibilityObbInRenderSR??e.serviceObbInRenderSR??null;if(t?.isValid)return t}let t=e.serviceObbInIndexSR;return t?this._viewingMode===2&&Math.max(t.halfSizeX,t.halfSizeY,t.halfSizeZ)>.2*this._indexSREllipsoidRadius?null:(t.transform(z,this._indexSR,this._renderSR,void 0,this._renderSRSphericalPCPF,this._indexSRSphericalPCPF,this._projectorIndexSRToIndexSRSphericalPCPF),z):null}ensureElevationAgnosticBoundingVolume(e){return!e.elevationAgnosticBoundingVolume.valid&&e.level>0&&(this._viewingMode===1?this._updateElevationAgnosticBoundingVolumeGlobal(e):this._updateElevationAgnosticBoundingVolumeLocal(e)),e.elevationAgnosticBoundingVolume}_updateCameraPOIDirection(){a(this._poi,this._camPos)?this._cameraPOIDirection=this._viewDirection:(o(this._cameraPOIDirection,this._camPos,this._poi),e(this._cameraPOIDirection,this._cameraPOIDirection))}_updateElevationAgnosticBoundingVolumeGlobal(t){let n=this.getNodeObbInRenderSRIndependentOfElevationOffset(t),r=t.elevationAgnosticBoundingVolume,i=-1,a;if(n){let t=B;n.getCenter(t),e(t,t),a=t,n.getCorners(H);for(let n of H){e(n,n);let a=s(n,t);if(a<=0){r.invalidate();return}let o=Math.sqrt(Math.max(0,1-a*a));i=Math.max(i,o)}}else{let n=t.serviceMbsInRenderSR;if(!n.isValid){r.invalidate();return}let{center:o,radius:s}=n,l=c(o);if(l<s){r.invalidate();return}i=s/l,a=e(W,o)}r.set(a,i+we)}_updateElevationAgnosticBoundingVolumeLocal(e){let t=e.elevationAgnosticBoundingVolume,n=this.getNodeObbInRenderSRIndependentOfElevationOffset(e);if(n){let e=n.getCenter(B);e[2]=0;let r=0;n.getCorners(H);for(let t of H){t[2]=0;let n=l(e,t);r=Math.max(r,n)}t.set(e,Math.sqrt(r))}else{let n=e.serviceMbsInRenderSR;if(n.isValid){let e=u(B,n.center);e[2]=0,t.set(e,n.radius)}}}isNodeVisible(e,t=!1){if(!this._isMBSinClippingArea(this.calculateServiceMbsInRenderSR(e)))return!1;if(!this._useFrustumCulling||t&&this.isNodeCloseBelowCamera(e))return!0;let n=this.getAndUpdateVisibilityObbInRenderSR(e);return n?n.intersectsFrustumConservativeApproximation(this._frustumPlanes):this._frustum.intersectsSphere(this.calculateServiceMbsInRenderSRElevationAdjusted(e))}isNodeCloseBelowCamera(e){let t=this.getAndUpdateVisibilityObbInRenderSR(e);if(t?.isValid)return t.intersectSegment(this._camPos,this._checkBelowSegmentEnd);let n=this.calculateServiceMbsInRenderSRElevationAdjusted(e);if(!n.isValid)return!0;let r=S(this._camPos,this._checkBelowSegmentEnd,ge);return ae(r,n.center)<=n.radius**2}isElevationAgnosticBoundingVolumeVisible(e,t){return!this._useFrustumCulling||!e.valid?!0:e.intersectsFrustumConservative(this._frustum,this._viewingMode,1+t)?this._viewingMode!==1||this._isConeVisibleInFrustum(e):!1}_isConeVisibleInFrustum(t){let r=t.radius;if(r>Se)return!0;let i=this._frustumPlanes,{center:a,radius:o}=this._frustum.boundingSphere,c=t.getAxis(W),l=s(c,a),u=o+1,p=l-u,m=l+u;if(p<=0)return!0;let h=n(I,c,p),g=n(L,c,m),_=r/Math.sqrt(1-r*r);for(let t of i){let r=w(t),i=e(R,r),a=s(i,c);if(Math.abs(1-a)<Ce)continue;let o=_e;n(o,c,a),d(o,o,i),e(o,o);let l=ve;if(f(l,h,o,p*_),!(C(t,l)<=0)&&(f(l,g,o,m*_),!(C(t,l)<=0)))return!1}return!0}isObbVisibleIndependentOfElevation(e,t){if(!this._useFrustumCulling||!e.valid)return!0;let{center:r,radius:i}=this._frustum.boundingSphere,a=i+1,o=this._frustumPlanes,c=H;if(t.getCorners(c),this._viewingMode===1){let t=e.getAxis(W),i=s(t,r),l=i-a,u=i+a;if(l<=0)return!0;for(let e of o){let r=!0;for(let i of c){let a=s(i,t),o=U;if(n(o,i,l/a),C(e,o)<=0){r=!1;break}let c=U;if(n(c,i,u/a),C(e,c)<=0){r=!1;break}}if(r)return!1}}else{let e=r[2]-a,t=r[2]+a;for(let n of o){let r=!0,i=w(n),a=i[0],o=i[1],s=i[2],l=n[3];for(let n of c){let i=a*n[0]+o*n[1]+l;if(i+s*e<=0||i+s*t<=0){r=!1;break}}if(r)return!1}}return!0}isGeometryVisible(e,t){if(!this._useFrustumCulling)return!0;let n=e.geometryObbInRenderSR;return!n?.isValid||n.intersectsFrustumConservativeApproximation(this._frustumPlanes)||t&&n.intersectSegment(this._camPos,this._checkBelowSegmentEnd)}_isMBSinClippingArea(e){return this._clippingArea==null||D(this._clippingArea,e)!==0}_screenSpaceDiameterMbs(e,t){let n=this.calcCameraDistanceToSurfaceAndUpdateMinmaxWithCenterDistance(e);return n<0?be:t/n/this._halfScreenPixelSizePerDistance}calcCameraDistanceToSurfaceAndUpdateMinmaxWithCenterDistance(e){let t=this.calculateMbsConeInRenderSR(e);if(t==null)return this.calcCameraDistanceToSurfaceAndUpdateMinmaxWithSphere(e);let n=t.calculateSurfaceDistanceFromPoint(this._camPos),r=t.calculateCenterDistanceFromPoint(this._camPos);return this._updateMinMaxDistanceToCenter(r),n}calcCameraDistanceToSurfaceAndUpdateMinmaxWithSphere(e){return this.calcCameraDistanceToCenterAndUpdateMinmax(e)-this.calculateServiceMbsInRenderSRElevationAdjusted(e).radius}calcCameraDistanceToCenterAndUpdateMinmax(e){let t=this.calculateServiceMbsInRenderSRElevationAdjusted(e),n=p(t.center,this._camPos);return this._updateMinMaxDistanceToCenter(n),n}_calculateAngleDependentLoDForSphere(e,t){let n=d(he,e,this._camPos),i=r(e),a=r(n);if(i===0||a===0)return 1;let o=(Math.abs(s(e,n))/i+t)/a;return Math.min(1,o)}calcAngleDependentLoD(e){let t=this.calculateMbsConeInRenderSR(e);if(t==null){let{center:t,radius:n}=this.calculateServiceMbsInRenderSRElevationAdjusted(e);return this._calculateAngleDependentLoDForSphere(t,n)}let{center:i,radius:a}=this.calculateServiceMbsInRenderSR(e);if(this._viewingMode===2)u(q,i),q[2]=t.lowerCenterHeight,u(J,i),J[2]=t.upperCenterHeight;else{let e=r(i);if(e===0)return 1;n(q,i,t.lowerCenterHeight/e),n(J,i,t.upperCenterHeight/e)}let o=this._calculateAngleDependentLoDForSphere(q,a),c=this._calculateAngleDependentLoDForSphere(J,a);if(this._viewingMode===2)u(Y,i),Y[2]=Math.max(t.lowerCenterHeight,Math.min(t.upperCenterHeight,this._camPos[2]));else{let e=r(i);if(e===0)return Math.max(o,c);let a=Math.max(t.lowerCenterHeight,Math.min(t.upperCenterHeight,s(this._camPos,i)/e));n(Y,i,a/e)}return Math.max(o,c,this._calculateAngleDependentLoDForSphere(Y,a))}hasLOD(e){return e.lodMetric!==0}_getDistanceToSurfaceGlobeMode(e,i){let a=r(i.center),c=r(e)-a;n(q,e,s(e,i.center)/m(e));let l=h(i.center,q),u=i.radius;if(l<=u*u)return Math.abs(c);let d=n(q,i.center,1/a),f=u*u/(2*a),g=n(J,d,a-f),_=o(Y,e,g),v=o(Y,_,n(X,d,s(d,_))),y=t(Y,g,n(Y,v,u/r(v))),b=p(e,y);if(c>=Z){let t=o(J,e,y),n=s(t,d)/r(t);n<Q&&(n=$),b/=n}return b}_getDistanceToSurface(e,t){return this._isGlobalMode?this._getDistanceToSurfaceGlobeMode(e,t):F(e,t)}_applyGlobalFlatAngleCorrectionToConeDistance(e,t){t.calculateClosestCenterToPoint(this._camPos,X);let n=r(X);if(n===0||r(this._camPos)-n<Z)return e;let i=o(Y,this._camPos,X),a=r(i);if(a===0)return e;let c=s(i,X)/(a*n);return e/(c<Q?$:c)}calculateScreenSpaceRelativeSphere(e){let t=this.calculateServiceMbsInRenderSRElevationAdjusted(e),n=this._getDistanceToSurface(this._camPos,t),r=n+t.radius;return this._updateMinMaxDistanceToCenter(r),2*n*this._halfScreenPixelSizePerDistance}calculateScreenSpaceRelativeCone(e){let t=e.calculateCenterDistanceFromPoint(this._camPos);this._updateMinMaxDistanceToCenter(t);let n=e.calculateSurfaceDistanceFromPoint(this._camPos);return 2*(this._isGlobalMode?this._applyGlobalFlatAngleCorrectionToConeDistance(n,e):n)*this._halfScreenPixelSizePerDistance}_updateMinMaxDistanceToCenter(e){e>0?(this.minCenterDistance=Math.min(this.minCenterDistance,e),this.maxCenterDistance=Math.max(this.maxCenterDistance,e)):(this.minCenterDistance=0,this.maxCenterDistance=Math.max(this.maxCenterDistance,-e))}getLodLevel(e){if(e.lodMetric===0)return 0;if(e.childCount===0)return this.maxLodLevel;if(this._useFrustumCulling&&this._progressiveLoadFactor<1){let t=this._progressiveLoadFactor*this._screenspaceErrorBias,n=this._screenspaceErrorBias;return this.evaluateLODmetric(e,t)?this.evaluateLODmetric(e,n)?2:1:0}return this.evaluateLODmetric(e,this._screenspaceErrorBias)?this.maxLodLevel:0}evaluateLODmetric(e,t){switch(e.lodMetric){case 1:{let n=this._screenSpaceDiameterMbs(e,(e.serviceMbsInIndexSR?.radius??0)*t);return this._options.angleDependentLoD&&(n*=this.calcAngleDependentLoD(e)),n<e.maxError}case 2:{let n=this.calculateMbsConeInRenderSR(e),r=n?this.calculateScreenSpaceRelativeCone(n):this.calculateScreenSpaceRelativeSphere(e);return e.maxError*t<=r}case 3:return this._screenSpaceDiameterMbs(e,e.maxError)*t<xe;case 4:return this.calcCameraDistanceToSurfaceAndUpdateMinmaxWithCenterDistance(e)>e.maxError*t}return!1}distToCameraPOIRay(e){if(e==null)return 0;let t=this.calculateServiceMbsInRenderSRElevationAdjusted(e),n=t.center,r=s(n,this._cameraPOIDirection),i=r*r,a=m(n)-i;return Math.sqrt(a)-t.radius}distCameraToPOI(){return p(this._camPos,this._poi)}}function F(e,t){let n=e[0]-t.center[0],r=e[1]-t.center[1],i=e[2]-t.center[2],a=n*n+r*r,o=t.radius;if(a<=o*o)return Math.abs(i);let s=Math.sqrt(a)-o;return Math.sqrt(i*i+s*s)}const I=g(),L=g(),R=g(),z=new O,B=g(),V=new v,H=[g(),g(),g(),g(),g(),g(),g(),g()],he=g(),ge=ie(),_e=g(),ve=g(),U=g(),W=g(),G=new T,K=re(),q=g(),J=g(),Y=g(),X=g();function ye(e,t,i){if(i===2)e.center[2]+=t;else{let i=r(e.center);if(i===0){e.radius+=Math.abs(t);return}n(e.center,e.center,1+t/i)}}const be=.5*Number.MAX_VALUE,xe=10,Z=2e5,Q=.08,$=1e-4,Se=.9,Ce=.01,we=.001;export{P as default};
@@ -15,4 +15,4 @@ import{pt2px as e}from"../../../../../../core/screenUtils.js";import{set as t}fr
15
15
  vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
16
16
  return worldPos + calculateVerticalOffset(worldPos, localOrigin);
17
17
  }
18
- `)):n.code.add(c`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const d=n();function f(e){e.uniforms.add(new s(`verticalOffset`,(e,n)=>{let{minWorldLength:r,maxWorldLength:i,screenLength:a}=e.verticalOffset,o=Math.tan(.5*n.camera.fovY)/(n.camera.fullViewport[3]*.5),s=n.camera.pixelRatio||1;return t(d,a*s,o,r,i)}))}export{u as VerticalOffset,l as VerticalOffsetParameters,f as addVerticalOffset};
18
+ `)):n.code.add(c`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const d=n();function f(e){e.uniforms.add(new s(`verticalOffset`,(e,n)=>{let{minWorldLength:r,maxWorldLength:i,screenLength:a}=e.verticalOffset,o=n.camera.screenPixelSizePerDistance;return t(d,a,o,r,i)}))}export{u as VerticalOffset,l as VerticalOffsetParameters,f as addVerticalOffset};
@@ -23,7 +23,7 @@ posView /= factor;
23
23
  }
24
24
  }
25
25
  return groundRelative;
26
- }`),(!p.draped||p.hasVerticalOffset)&&m.uniforms.add(n),p.draped||(m.uniforms.add(new c(`hudPixelSizePerDistance`,e=>Math.tan(e.camera.fovY/2)/(e.camera.fullViewport[3]/2))),m.code.add(u`
26
+ }`),(!p.draped||p.hasVerticalOffset)&&m.uniforms.add(n),p.draped||(m.uniforms.add(new c(`hudPixelSizePerDistance`,e=>e.camera.renderPixelSizePerDistance)),m.code.add(u`
27
27
  void applyHUDVerticalGroundOffset(vec3 normalModel, inout vec3 posModel, inout vec3 posView) {
28
28
  float distanceToCamera = length(posView);
29
29
 
@@ -37,7 +37,9 @@ foam = foamIntensity2FoamColor(foamIntensityExternal, foamIntensity, skyZenitCol
37
37
  }
38
38
  float correctionViewingFactor = pow(max(dot(v, localUp), 0.0), correctionViewingPowerFactor);
39
39
  vec3 normalCorrectedClouds = mix(localUp, n, correctionViewingFactor);
40
- vec3 reflectedWorld = normalize(reflect(-v, normalCorrectedClouds));`),g.cloudReflections&&_.uniforms.add(d).code.add(p`vec4 cloudsColor = renderClouds(reflectedWorld, position);
40
+ vec3 reflectedWorld = normalize(reflect(-v, normalCorrectedClouds));`),g.cloudReflections&&_.uniforms.add(d).code.add(p`vec3 emission = vec3(0.0);
41
+ vec4 cloudsColor = renderClouds(reflectedWorld, position, emission);
42
+ cloudsColor.rgb += emission;
41
43
  cloudsColor.a = 1.0 - cloudsColor.a;
42
44
  cloudsColor = pow(cloudsColor, vec4(GAMMA));
43
45
  cloudsColor *= clamp(fresnelModifier.y * cloudFresnelModifier[0] - cloudFresnelModifier[1], 0.0, 1.0) * cloudsOpacity;`),g.screenSpaceReflections?_.uniforms.add(l,e,new f(`fadeFactorSSR`,e=>e.screenSpaceReflections.fadeFactor)).code.add(p`vec3 viewDir = normalize(viewPosition);
@@ -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 i,mainLightIntensity as a}from"../shading/lightingUniforms.js";import{LookupCloudsFromTextureArray as o}from"./LookupCloudsFromTextureArray.glsl.js";import{BooleanBindUniform as s}from"../../shaderModules/BooleanBindUniform.js";import{Float3BindUniform as c}from"../../shaderModules/Float3BindUniform.js";import{FloatBindUniform as l}from"../../shaderModules/FloatBindUniform.js";import{glsl as u}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as d}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DArrayBindUniform as f}from"../../shaderModules/Texture2DArrayBindUniform.js";function p(t){let n=t.fragment;n.constants.add(`radiusCloudsSquared`,`float`,m).code.add(u`vec3 intersectWithCloudLayer(vec3 dir, vec3 cameraPosition, vec3 spherePos) {
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 l(`radiusCurvatureCorrection`,({clouds:e})=>e.parallax.radiusCurvatureCorrection)).code.add(u`vec3 correctForPlanetCurvature(vec3 dir) {
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(u`vec3 rotateDirectionToAnchorPoint(mat4 rotMat, vec3 inVec) {
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(`RIM_COLOR`,`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(i,a).code.add(u`vec3 calculateCloudColor(vec3 cameraPosition, vec3 worldSpaceRay, vec4 clouds) {
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
- vec3 directSunScattering = RIM_COLOR * rimLightIntensity * (pow(dirDotLight, rimScattering)) * scatteringMod;
22
+ emission = rimColor * rimLightIntensity * (pow(dirDotLight, rimScattering)) * scatteringMod;
23
23
  float additionalLight = backlightFactor * pow(dirDotLight, backlightScattering) * (1. - pow(sunsetTransition, backlightTransition)) ;
24
- return vec3(baseCloudColor * (1.0 + additionalLight) + directSunScattering);
25
- }`),t.include(o),n.uniforms.add(new s(`readChannelsRG`,e=>e.clouds.readChannels===0),new f(`cubeMap`,e=>e.clouds.data?.cubeMap?.colorTexture)).code.add(u`vec4 sampleCloud(vec3 rayDir, bool readOtherChannel) {
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 c(`anchorPoint`,e=>e.clouds.parallax.anchorPoint),new c(`anchorPointNew`,e=>e.clouds.parallaxNew.anchorPoint),new d(`rotationClouds`,e=>e.clouds.parallax.transform),new d(`rotationCloudsNew`,e=>e.clouds.parallaxNew.transform),h,new l(`fadeFactor`,e=>e.clouds.fadeFactor),new s(`crossFade`,e=>e.clouds.fadeState===3)).code.add(u`vec4 renderClouds(vec3 worldRay, vec3 cameraPosition) {
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
- vec4 cloudColorNew = vec4(calculateCloudColor(cameraPositionN, worldRay, cloudData), cloudData.a);
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 m=(t.radius+n)**2,h=new l(`cloudsOpacity`,e=>e.clouds.opacity);export{p as CloudsParallaxShading,h as cloudsOpacity};
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 r}from"../../../../../geometry/support/Ellipsoid.js";import{cameraPosition as i}from"../../core/shaderLibrary/util/cameraUniforms.js";import{Float2PassUniform as a}from"../../core/shaderModules/Float2PassUniform.js";import{FloatsPassUniform as o}from"../../core/shaderModules/FloatsPassUniform.js";import{glsl as s}from"../../core/shaderModules/glsl.js";import{SphereIntersect as c}from"../../shaders/SphereIntersect.glsl.js";import{NoParameters as l}from"../../../../webgl/NoParameters.js";class u extends l{constructor(){super(...arguments),this.radii=t()}}function d(e){e.code.add(s`float chapmanApproximation(float thickness, float height, float cosZenith) {
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`,r.scaleHeight*r.atmosphereHeight).uniforms.add(new a(`radii`,e=>e.radii)).code.add(s`float getOpticalDepth(vec3 position, vec3 dir, float h) {
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.include(c),e.constants.add(`planetRadiusReduction`,`float`,p).uniforms.add(new o(`heightParameters`,5,(e,t)=>f(t,e)),i).code.add(s`vec4 planetIntersect(vec3 rayDir) {
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 f({camera:t},{radii:i}){let a=n(t.eye),o=Math.sqrt(a);return m[0]=o,m[1]=a-i[1]**2,m[2]=e((o-i[0])/r.atmosphereHeight,0,1),m[3]=a-i[0]**2,m[4]=a-(i[0]-p)**2,m}const p=2e4,m=[];export{d as ChapmanApproximation,u as ChapmanApproximationPassParameters,f as getHeightParameters};
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/shaderModules/BooleanPassUniform.js";import"../../core/shaderModules/Float2PassUniform.js";import"../../core/shaderModules/Float3PassUniform.js";import"../../core/shaderModules/Float4PassUniform.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/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";
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 s}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{set as c,length as l}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as u}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{earth as d}from"../../../../../geometry/support/Ellipsoid.js";import{OpaqueEnvironment as f}from"../OpaqueEnvironment.js";import{computeInnerAltitudeFade as p,innerAtmosphereDepth as m}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as h,ChapmanAtmosphereTechnique as g}from"./ChapmanAtmosphereTechnique.js";import{createQuadVAO as _}from"../../lib/glUtil3D.js";import{applyTextureResizeModulo as v}from"../../lib/textureUtils.js";import{A as y}from"../../../../../chunks/AtmosphereCompositing.glsl.js";import{AtmosphereCompositingTechnique as b}from"../../shaders/AtmosphereCompositingTechnique.js";import{DepthStencilAttachment as x,ColorAttachment0 as S,PrimitiveType as C}from"../../../../webgl/enums.js";import w from"../../../../../webscene/background/ColorBackground.js";let T=class extends f{constructor(){super(...arguments),this._compositingPassParameters=new y,this._vao=null,this._passParameters=new h}initialize(){this.addHandles([r(()=>this.view.environment.background,e=>{let t=e instanceof w?e.color.toUnitRGBA():u;c(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()??u,this.requestRender(1)},a),r(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),i)])}destroy(){this._vao=n(this._vao)}render(){let e=this.input;if(!this.bindParameters.mainDepth)return e;let n=this.renderingContext;this._vao??=_(n,1);let r=e.getAttachment(x);this._update();let i=this.techniques.getCompiled(g),a=this.techniques.getCompiled(b);if(!i||!a)return this.requestRender(1),e;if(!this._passParameters.reduced)return e.detachDepth(),n.bindFramebuffer(e.fbo),n.bindTechnique(i,this.bindParameters,this._passParameters),n.setDrawBuffers([S]),n.bindVAO(this._vao),n.drawArrays(C.TRIANGLE_STRIP,0,4),e.attachDepth(r),e;let o=n.getViewport(),s=this.bindParameters.camera,c=l(s.eye)-d.radius,u,f=d.atmosphereHeight;if(c<f){let e=Math.min(1,Math.max(0,c/f));u=t(.2,.3,e)}else{let e=Math.min(1,Math.max(0,(c-f)/(15*f)));u=t(.3,.6,e)}let p=this.renderingContext.parameters.maxTextureSize,m=v(Math.round(u*s.fullViewport[2]),p),h=v(Math.round(u*s.fullViewport[3]),p);n.setViewport(0,0,m,h);let y=this.fboCache.acquire(m,h,`chapman`);return n.bindFramebuffer(y.fbo),n.clearFramebuffer([0,0,0,1],!0,!0),n.bindTechnique(i,this.bindParameters,this._passParameters),n.bindVAO(this._vao),n.drawArrays(C.TRIANGLE_STRIP,0,4),n.setViewport(o.x,o.y,o.width,o.height),this._compositingPassParameters.color=y.getTexture(),e.detachDepth(),n.bindFramebuffer(e.fbo),n.bindTechnique(a,this.bindParameters,this._compositingPassParameters),n.setDrawBuffers([S]),n.screen.draw(),e.attachDepth(r),y.release(),e}_update(){let e=this.view.basemapTerrain?.getLowerBoundRadius()??0;s(this._passParameters.radii,e,e+d.atmosphereHeight);let t=l(this.bindParameters.camera.eye);this._passParameters.altitudeFade=p(t-e),this._passParameters.innerFadeDistance=2*Math.sqrt((2*e-m)*m)}};T=e([o(`esri.views.3d.webgl-engine.effects.atmosphere.ChapmanAtmosphere`)],T);export{T as ChapmanAtmosphere};
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(770,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};
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([.8,.8],[.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};
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.applyBlur=!this.view.stage.renderView.fog?.renders&&this._hasBlur,super.precompile(),this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value,this.techniques.precompile(d,this._configuration))}get _needsEmissionBlur(){return this._configuration.applyBlur}render(){let e=this.input,n=e.getAttachment(f);if(!n?.attachment)return e;let r=o(this.bindParameters.camera.eye);this._passParameters.atmosphereC=r**2-this._atmosphereRadius**2,this._passParameters.color=e.getAttachment(p)?.attachment,this._passParameters.emission=n,this._passParameters.scattering=this._configuration.applyBlur&&this.view.environmentView.weather?this.view.stage.renderView.fog?.strength??this.view.environment.weather.scattering:0,this._configuration.applyBlur&&this._renderEmissionMipMap();let i=this.renderingContext,a=this.techniques.get(d,this._configuration),s=this.acquireOutputFramebuffer();return i.clear(16384),i.bindTechnique(a,this.bindParameters,this._passParameters),i.screen.draw(),this._passParameters.mipmapTexture=t(this._passParameters.mipmapTexture),s.moveAttachments(e),s}};e([i()],m.prototype,`produces`,void 0),e([i()],m.prototype,`consumes`,void 0),m=e([a(`esri.views.3d.webgl-engine.lib.EmissionComposite`)],m);export{m as EmissionComposite};
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};