@arcgis/core 6.0.0-next.36 → 6.0.0-next.38

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 (389) hide show
  1. package/analysis/DimensionAnalysis.js +1 -1
  2. package/analysis/DimensionSimpleStyle.js +1 -1
  3. package/analysis/LengthDimension.js +1 -1
  4. package/analysis/LineOfSightAnalysis.js +1 -1
  5. package/analysis/LineOfSightAnalysisTarget.js +1 -1
  6. package/analysis/Viewshed.js +1 -1
  7. package/analysis/ViewshedAnalysis.js +1 -1
  8. package/assets/esri/core/workers/RemoteClient.js +1 -1
  9. package/assets/esri/core/workers/chunks/{0202eb8c2b2865f99981.js → 00311d1b18d5952a014b.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{9503eedfdda55fc5adab.js → 091ec4fe83038f3558f4.js} +1 -1
  11. package/assets/esri/core/workers/chunks/0b21d0e2e5a91c34a108.js +1 -0
  12. package/assets/esri/core/workers/chunks/{322b22a5d54e404bebd5.js → 0c893837f67829757df7.js} +1 -1
  13. package/assets/esri/core/workers/chunks/123541f79be7adff0818.js +1 -0
  14. package/assets/esri/core/workers/chunks/{155861fbd0e5fc2db80c.js → 1a91443970d64a59521d.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1e37337f47f45d6d8005.js +1 -0
  16. package/assets/esri/core/workers/chunks/{4e5405134d079bdf9b7a.js → 1f76f6dcdae9f55389cb.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{f717005e14a7e9141df7.js → 2050c844b5a29b1df28a.js} +1 -1
  18. package/assets/esri/core/workers/chunks/2c3612379111457c3221.js +1 -0
  19. package/assets/esri/core/workers/chunks/2d16b5a44f840147e882.js +1 -0
  20. package/assets/esri/core/workers/chunks/{d9a240a3c6bf85124474.js → 342a97974a78007b25e0.js} +1 -1
  21. package/assets/esri/core/workers/chunks/34467f7d84baffd772a3.js +1 -0
  22. package/assets/esri/core/workers/chunks/396299c22994c502e41c.js +1 -0
  23. package/assets/esri/core/workers/chunks/{03daf6f235c6edef6268.js → 398ec098fffe6abceedd.js} +1 -1
  24. package/assets/esri/core/workers/chunks/3b32a24488b3068f0cb7.js +1 -0
  25. package/assets/esri/core/workers/chunks/3b5e9e0b180dc10491ec.js +1 -0
  26. package/assets/esri/core/workers/chunks/{4d18b48d4a282a0f341c.js → 427d929dc7f89b0a1ea9.js} +1 -1
  27. package/assets/esri/core/workers/chunks/432728c557be5dfa26b5.js +1 -0
  28. package/assets/esri/core/workers/chunks/46969f379623810b2eca.js +1 -0
  29. package/assets/esri/core/workers/chunks/46edd6c9ed6701e6b975.js +1 -0
  30. package/assets/esri/core/workers/chunks/{8b0d5551978ab0aac0d1.js → 520f499d79fa71f262c7.js} +1 -1
  31. package/assets/esri/core/workers/chunks/5473409fee59db80f87d.js +1 -0
  32. package/assets/esri/core/workers/chunks/553a8bf5bc5c56d1bcaf.js +1 -0
  33. package/assets/esri/core/workers/chunks/{2211ff0a1f1ae8100231.js → 585ae43c7bcb86a26762.js} +1 -1
  34. package/assets/esri/core/workers/chunks/58716a3a6106a1b0fb9d.js +1 -0
  35. package/assets/esri/core/workers/chunks/{aa6ee2aa4ff6e6d41efb.js → 5882f349f3771868e67f.js} +1 -1
  36. package/assets/esri/core/workers/chunks/592b5db1459c02cf6a0c.js +1 -0
  37. package/assets/esri/core/workers/chunks/{1b17f5f720f6cf3f6d73.js → 5be386b3af867b19ff39.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{ea81f9d71b0842a4be26.js → 5e48898cebb6dbaf09b5.js} +1 -1
  39. package/assets/esri/core/workers/chunks/6a21dc13a465757ba007.js +1 -0
  40. package/assets/esri/core/workers/chunks/{139e753d95cfc9470e74.js → 6a65fc1a2931230fe994.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{3e406043a374ee17475b.js → 6f2e7e663229b223b4df.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{379db67f78161ebd5468.js → 7023651ed6398dcf8efb.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{90360c0bd053d3e3fd77.js → 7027a0e7bfabb3bb7fc2.js} +1 -1
  44. package/assets/esri/core/workers/chunks/76e80381fa6d1e084796.js +1 -0
  45. package/assets/esri/core/workers/chunks/78818c2a898444f7e890.js +1 -0
  46. package/assets/esri/core/workers/chunks/{40c2674dae73f0942751.js → 7d497df6e13162156342.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{3b380e64566a6cce59e2.js → 7e0ed6e8f7b77e43f628.js} +1 -1
  48. package/assets/esri/core/workers/chunks/8c3779de09291170497f.js +1 -0
  49. package/assets/esri/core/workers/chunks/8e391b5b82429f39791e.js +1 -0
  50. package/assets/esri/core/workers/chunks/947f3a1cad976bba9738.js +1 -0
  51. package/assets/esri/core/workers/chunks/{59a1b637d2c107504a04.js → 966204d6dedc8149c3e9.js} +1 -1
  52. package/assets/esri/core/workers/chunks/9826baa3c15ea2062669.js +1 -0
  53. package/assets/esri/core/workers/chunks/{d3369ffed19f4c264dcd.js → 9ab0735e86cf8932bf9d.js} +1 -1
  54. package/assets/esri/core/workers/chunks/ab0ea4042f4e13874aed.js +1 -0
  55. package/assets/esri/core/workers/chunks/ab98ade3257360015d6c.js +1 -0
  56. package/assets/esri/core/workers/chunks/ac107079342251a984dd.js +1 -0
  57. package/assets/esri/core/workers/chunks/{572aec57593a08b8045b.js → b15a8d4322f3b7819d2f.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{552c36b40e5a5ec117fb.js → b472c0a21ae29e653f7d.js} +1 -1
  59. package/assets/esri/core/workers/chunks/b90271ce38522bcf813b.js +1 -0
  60. package/assets/esri/core/workers/chunks/ba91df9835cdea7698a9.js +1 -0
  61. package/assets/esri/core/workers/chunks/bdd76a0b6c14e7fb6984.js +1 -0
  62. package/assets/esri/core/workers/chunks/bfe13ac9fa1aafb190a1.js +1 -0
  63. package/assets/esri/core/workers/chunks/{f372f4eb5527238c46f5.js → c31830ee897d5a7f2582.js} +1 -1
  64. package/assets/esri/core/workers/chunks/c48d97c38e821be17dc5.js +1 -0
  65. package/assets/esri/core/workers/chunks/{0a508e25ec05363e1f04.js → c7ad62f54d2abe1d17a0.js} +1 -1
  66. package/assets/esri/core/workers/chunks/cb1642ea8b66231cbfb5.js +1 -0
  67. package/assets/esri/core/workers/chunks/ce0274847ccce6a1ac53.js +1 -0
  68. package/assets/esri/core/workers/chunks/cf21b217b13770757cb8.js +1 -0
  69. package/assets/esri/core/workers/chunks/cf2e5f827cea7d7319ce.js +1 -0
  70. package/assets/esri/core/workers/chunks/d42a4f47843e075c56a8.js +1 -0
  71. package/assets/esri/core/workers/chunks/dae2036faa28dade2119.js +1 -0
  72. package/assets/esri/core/workers/chunks/e2430bc3a1edeb5c3266.js +1 -0
  73. package/assets/esri/core/workers/chunks/e9457a67befc61e11095.js +1 -0
  74. package/assets/esri/core/workers/chunks/f06ef153e106b26a6748.js +1 -0
  75. package/assets/esri/core/workers/chunks/faae3c43048b42341536.js +1 -0
  76. package/assets/esri/core/workers/chunks/fc77eb7683e708774168.js +1 -0
  77. package/assets/esri/core/workers/chunks/fd967a9f3cf0e2890dbb.js +1 -0
  78. package/chunks/Clouds.glsl.js +7 -11
  79. package/chunks/h.js +2 -0
  80. package/chunks/projector.js +2 -0
  81. package/config.js +1 -1
  82. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  83. package/core/sanitizerUtils.js +1 -1
  84. package/form/FormTemplate.js +1 -1
  85. package/form/elements/Element.js +1 -1
  86. package/form/elements/FieldElement.js +1 -1
  87. package/geometry/ellipsoidUtils.js +4 -4
  88. package/geometry/support/frustumPlanes.js +1 -1
  89. package/geometry/support/plane.js +1 -1
  90. package/geometry/support/triangle.js +1 -1
  91. package/kernel.js +1 -1
  92. package/layers/BaseElevationLayer.js +1 -1
  93. package/layers/ElevationLayer.js +1 -1
  94. package/layers/GraphicsLayer.js +1 -1
  95. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  96. package/layers/IntegratedMeshLayer.d.ts +2 -0
  97. package/layers/IntegratedMeshLayer.js +1 -1
  98. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  99. package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
  100. package/layers/geospatialPDF/support/datumUtils.js +2 -0
  101. package/layers/geospatialPDF/support/ellipsoidUtils.js +2 -0
  102. package/layers/geospatialPDF/support/geographicProjectionUtils.js +2 -0
  103. package/layers/geospatialPDF/support/parameterUtils.js +2 -0
  104. package/layers/geospatialPDF/support/projectedProjectionUtils.js +3 -0
  105. package/layers/geospatialPDF/support/projectionToSpatialReference.js +2 -0
  106. package/layers/geospatialPDF/support/statePlaneUtils.js +2 -0
  107. package/layers/geospatialPDF/support/unitUtils.js +2 -0
  108. package/layers/geospatialPDF/support/validateProjectionUtils.js +2 -0
  109. package/layers/graphics/sources/support/clientSideDefaults.js +2 -2
  110. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  111. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  112. package/layers/ogc/ogcFeatureUtils.js +1 -1
  113. package/layers/save/imageryUtils.js +1 -1
  114. package/layers/save/mediaLayerUtils.js +1 -1
  115. package/layers/save/streamLayerUtils.js +1 -1
  116. package/layers/support/ControlPoint.js +1 -1
  117. package/layers/support/ControlPointsGeoreference.js +1 -1
  118. package/layers/support/DimensionalDefinition.js +1 -1
  119. package/layers/support/ElevationQuery.js +1 -1
  120. package/layers/support/LabelClass.js +1 -1
  121. package/layers/support/LabelExpressionInfo.js +1 -1
  122. package/layers/support/MediaElementBase.js +1 -1
  123. package/layers/support/MosaicRule.js +1 -1
  124. package/layers/support/MultidimensionalSubset.js +1 -1
  125. package/layers/support/RasterBandInfo.js +1 -1
  126. package/layers/support/RasterFunction.js +1 -1
  127. package/layers/support/RasterFunctionTemplate.js +1 -1
  128. package/layers/support/RasterInfo.js +1 -1
  129. package/layers/support/RasterSensorInfo.js +1 -1
  130. package/layers/support/RasterStorageInfo.js +1 -1
  131. package/layers/support/VideoElement.js +1 -1
  132. package/layers/support/layersLoader.js +1 -1
  133. package/layers/video/VideoController.js +3 -3
  134. package/layers/video/types.d.ts +12 -0
  135. package/legend/ActiveLayerInfo.d.ts +5 -1
  136. package/legend/ActiveLayerInfo.js +1 -1
  137. package/libs/maquette-advanced-projector/projector.js +1 -1
  138. package/linkChart/LayoutSettings.js +1 -1
  139. package/linkChart/RootedLayoutSettings.js +1 -1
  140. package/package.json +3 -3
  141. package/renderers/FlowRenderer.js +1 -1
  142. package/renderers/RasterColormapRenderer.js +1 -1
  143. package/renderers/RasterShadedReliefRenderer.js +1 -1
  144. package/renderers/RasterStretchRenderer.js +1 -1
  145. package/renderers/VectorFieldRenderer.js +1 -1
  146. package/renderers/support/ColormapInfo.js +1 -1
  147. package/renderers/support/RasterPresetRenderer.js +1 -1
  148. package/renderers/support/rasterRendererHelper.js +1 -1
  149. package/rest/knowledgeGraph/GraphApplyEdits.js +1 -1
  150. package/rest/support/BaseImageMeasureParameters.js +1 -1
  151. package/rest/support/BaseImageMeasureResult.js +1 -1
  152. package/rest/support/FindImagesParameters.js +1 -1
  153. package/rest/support/FindImagesResult.js +1 -1
  154. package/rest/support/ImageAngleParameters.js +1 -1
  155. package/rest/support/ImageAngleResult.js +1 -1
  156. package/rest/support/ImageAreaParameters.js +1 -1
  157. package/rest/support/ImageAreaResult.js +1 -1
  158. package/rest/support/ImageBoundaryParameters.js +1 -1
  159. package/rest/support/ImageBoundaryResult.js +1 -1
  160. package/rest/support/ImageDistanceParameters.js +1 -1
  161. package/rest/support/ImageDistanceResult.js +1 -1
  162. package/rest/support/ImageGPSInfoParameters.js +1 -1
  163. package/rest/support/ImageGPSInfoResult.js +1 -1
  164. package/rest/support/ImageHeightParameters.js +1 -1
  165. package/rest/support/ImageHeightResult.js +1 -1
  166. package/rest/support/ImageHistogramParameters.js +1 -1
  167. package/rest/support/ImageIdentifyParameters.js +1 -1
  168. package/rest/support/ImageIdentifyResult.js +1 -1
  169. package/rest/support/ImagePixelLocationParameters.js +1 -1
  170. package/rest/support/ImagePixelLocationResult.js +1 -1
  171. package/rest/support/ImagePointParameters.js +1 -1
  172. package/rest/support/ImagePointResult.js +1 -1
  173. package/rest/support/ImageSample.js +1 -1
  174. package/rest/support/ImageSampleParameters.js +1 -1
  175. package/rest/support/ImageSampleResult.js +1 -1
  176. package/rest/support/ImageToMapMultirayParameters.js +1 -1
  177. package/rest/support/ImageToMapParameters.js +1 -1
  178. package/rest/support/ImageUrlParameters.js +1 -1
  179. package/rest/support/ImageUrlResult.js +1 -1
  180. package/rest/support/ImageVolumeParameters.js +1 -1
  181. package/rest/support/ImageVolumeResult.js +1 -1
  182. package/rest/support/MapToImageParameters.js +1 -1
  183. package/rest/support/MeasureAreaFromImageResult.js +1 -1
  184. package/rest/support/MeasureFromImageParameters.js +1 -1
  185. package/rest/support/MeasureLengthFromImageResult.js +1 -1
  186. package/symbols/support/cimSymbolUtils.js +1 -1
  187. package/symbols/support/renderUtils.js +1 -1
  188. package/views/2d/ViewState.d.ts +3 -3
  189. package/views/2d/ViewState.js +1 -1
  190. package/views/2d/ViewStateManager.js +1 -1
  191. package/views/2d/engine/Bitmap.js +1 -1
  192. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  193. package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
  194. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  195. package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +1 -1
  196. package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +1 -1
  197. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  198. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  199. package/views/2d/engine/webgl/Overlay.js +1 -1
  200. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  201. package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
  202. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  203. package/views/2d/engine/webgl/animations/store/AnimationStore.js +1 -1
  204. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  205. package/views/2d/engine/webgl/collisions/LabelStore.js +1 -1
  206. package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
  207. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  208. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  209. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  210. package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
  211. package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +1 -1
  212. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  213. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  214. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
  215. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  216. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  217. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  218. package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +1 -1
  219. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  220. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  221. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
  222. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  223. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
  224. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  225. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
  226. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  227. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTexture.js +1 -1
  228. package/views/2d/engine/webgl/textureUtils.js +1 -1
  229. package/views/2d/engine/webgl/util/IntervalMatcher.js +1 -1
  230. package/views/2d/layers/LayerView2D.js +1 -1
  231. package/views/2d/webglDeps.js +1 -1
  232. package/views/3d/FocusAreasView.js +1 -1
  233. package/views/3d/GroundView3D.js +1 -1
  234. package/views/3d/input/SceneInputManager.js +1 -1
  235. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  236. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  237. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  238. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  239. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  240. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  241. package/views/3d/state/ConstraintsManager.js +1 -1
  242. package/views/3d/state/ViewState.js +1 -1
  243. package/views/3d/state/ViewStateManager.js +1 -1
  244. package/views/3d/support/engineContent/line.js +1 -1
  245. package/views/3d/support/engineContent/marker.js +1 -1
  246. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  247. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  248. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  249. package/views/3d/support/flow/geometryUtils.js +1 -1
  250. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  251. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  252. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  253. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  254. package/views/3d/support/gaussianSplatting/GaussianTileBuilder.js +2 -0
  255. package/views/3d/support/gaussianSplatting/GaussianTileLifecycle.js +2 -0
  256. package/views/3d/support/gaussianSplatting/formatConstants.js +2 -0
  257. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  258. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  259. package/views/3d/terrain/OverlayManager.js +1 -1
  260. package/views/3d/terrain/OverlayRenderer.js +1 -1
  261. package/views/3d/terrain/TerrainRenderer.js +1 -1
  262. package/views/3d/terrain/TerrainSurface.js +1 -1
  263. package/views/3d/terrain/Tile.js +1 -1
  264. package/views/3d/terrain/TileCompositor.js +1 -1
  265. package/views/3d/terrain/TileRenderer.js +1 -1
  266. package/views/3d/terrain/tileUtils.js +1 -1
  267. package/views/3d/webgl/RenderNode.d.ts +1 -1
  268. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  269. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  270. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
  271. package/views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js +1 -1
  272. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +15 -11
  273. package/views/3d/webgl-engine/effects/WeatherFader.js +1 -1
  274. package/views/3d/webgl-engine/effects/atmosphere/LocalAtmosphere.js +1 -1
  275. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  276. package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
  277. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +19 -9
  278. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  279. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  280. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  281. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  282. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  283. package/views/3d/webgl-engine/lib/AttributeView.js +1 -1
  284. package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
  285. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  286. package/views/3d/webgl-engine/lib/DDSUtil.js +1 -1
  287. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  288. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  289. package/views/3d/webgl-engine/lib/GaussianSplatRenderUtils.js +1 -1
  290. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  291. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  292. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  293. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  294. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
  295. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +1 -1
  296. package/views/3d/webgl-engine/lib/VerticesView.js +2 -0
  297. package/views/3d/webgl-engine/lib/attributeViewUtils.js +1 -1
  298. package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
  299. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  300. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  301. package/views/3d/webgl-engine/lib/screenPolygonOverlapUtils.js +1 -1
  302. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  303. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  304. package/views/3d/webgl-engine/materials/HUDMaterialBaseInstance.js +1 -1
  305. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  306. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  307. package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
  308. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  309. package/views/3d/webgl-engine/materials/internal/lineMarkerBufferUtils.js +2 -0
  310. package/views/3d/webgl-engine/materials/internal/ribbonLineBufferUtils.js +2 -0
  311. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  312. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  313. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  314. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  315. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  316. package/views/3d/webgl-engine/shaders/hudMaterialLayouts.js +2 -0
  317. package/views/3d/webgl-engine/shaders/lineMarkerLayouts.js +2 -0
  318. package/views/draw/support/ManagedTooltipField.js +1 -1
  319. package/views/overlay/LineOverlayItem.js +1 -1
  320. package/views/overlay/TextOverlayItem.js +1 -1
  321. package/views/overlay/ViewOverlay.js +1 -1
  322. package/views/support/GroundElevationSampler.js +1 -1
  323. package/views/support/HighlightOptions.d.ts +2 -2
  324. package/views/support/HighlightOptions.js +1 -1
  325. package/views/support/TextureCompressionHelper.js +1 -1
  326. package/views/support/imageReprojection.js +1 -1
  327. package/views/webgl/FramebufferObject.js +1 -1
  328. package/views/webgl/RenderingContext.js +1 -1
  329. package/views/webgl/Texture.js +1 -1
  330. package/views/webgl/Util.js +1 -1
  331. package/views/webgl/rasterUtils.js +1 -1
  332. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  333. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  334. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  335. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  336. package/widgets/OrientedImageryViewer.js +1 -1
  337. package/widgets/ScaleRangeSlider/types.d.ts +3 -3
  338. package/assets/esri/core/workers/chunks/01f55004d64309f8538b.js +0 -1
  339. package/assets/esri/core/workers/chunks/039d9bc5b5015012f811.js +0 -1
  340. package/assets/esri/core/workers/chunks/08140725277de5d2e41a.js +0 -1
  341. package/assets/esri/core/workers/chunks/0d99bfb75dcb9fa29080.js +0 -1
  342. package/assets/esri/core/workers/chunks/144bad0c2415c345736a.js +0 -1
  343. package/assets/esri/core/workers/chunks/165ca7a97b611c8f26c4.js +0 -1
  344. package/assets/esri/core/workers/chunks/16cda273927ab0a39544.js +0 -1
  345. package/assets/esri/core/workers/chunks/1989410a618865f02dec.js +0 -1
  346. package/assets/esri/core/workers/chunks/29c610ce1c81ebb84a6b.js +0 -1
  347. package/assets/esri/core/workers/chunks/3223f9fbc76ba9ef8d13.js +0 -1
  348. package/assets/esri/core/workers/chunks/338d800d4efcc91cead1.js +0 -1
  349. package/assets/esri/core/workers/chunks/3415531224f8494d79ca.js +0 -1
  350. package/assets/esri/core/workers/chunks/3fdcc383bbd9cf0d274c.js +0 -1
  351. package/assets/esri/core/workers/chunks/46c290108a90518ef695.js +0 -1
  352. package/assets/esri/core/workers/chunks/48b8b57f559a53c6c513.js +0 -1
  353. package/assets/esri/core/workers/chunks/4a979fce1c971b614a18.js +0 -1
  354. package/assets/esri/core/workers/chunks/59a88dd53f8806bbec06.js +0 -1
  355. package/assets/esri/core/workers/chunks/5aeb5e18514644fe2cf9.js +0 -1
  356. package/assets/esri/core/workers/chunks/5bd1414220e42cb8ebcf.js +0 -1
  357. package/assets/esri/core/workers/chunks/5d781c2c6204cffffd0d.js +0 -1
  358. package/assets/esri/core/workers/chunks/6edc13a426e00bb93a9b.js +0 -1
  359. package/assets/esri/core/workers/chunks/723df53cfa0189837d01.js +0 -1
  360. package/assets/esri/core/workers/chunks/7400b8c454b47ee4fb3c.js +0 -1
  361. package/assets/esri/core/workers/chunks/7862abd24fb5c3b12e6b.js +0 -1
  362. package/assets/esri/core/workers/chunks/796c6195b6bf59dcc9bd.js +0 -1
  363. package/assets/esri/core/workers/chunks/7af4edc6e87d27b9d467.js +0 -1
  364. package/assets/esri/core/workers/chunks/81bcc495e6eaf2cf7474.js +0 -1
  365. package/assets/esri/core/workers/chunks/934e1f2153e6fad6ed23.js +0 -1
  366. package/assets/esri/core/workers/chunks/990e96139b5a1dccb061.js +0 -1
  367. package/assets/esri/core/workers/chunks/a607541959169741a943.js +0 -1
  368. package/assets/esri/core/workers/chunks/aa779896fd9e5c341349.js +0 -1
  369. package/assets/esri/core/workers/chunks/c131e0dd180a4c10e12e.js +0 -1
  370. package/assets/esri/core/workers/chunks/c7adb7b77721c75891f4.js +0 -1
  371. package/assets/esri/core/workers/chunks/cd55cad81accf51d2989.js +0 -1
  372. package/assets/esri/core/workers/chunks/ce324dde6d7daea33638.js +0 -1
  373. package/assets/esri/core/workers/chunks/d3412518a7b518860fbb.js +0 -1
  374. package/assets/esri/core/workers/chunks/dac69c0047488fdf986d.js +0 -1
  375. package/assets/esri/core/workers/chunks/dba5f44c4e4a3f075df2.js +0 -1
  376. package/assets/esri/core/workers/chunks/e67ea2f1714e5abeae44.js +0 -1
  377. package/assets/esri/core/workers/chunks/e8fb2ba7b7a4f0916325.js +0 -1
  378. package/assets/esri/core/workers/chunks/f10c883eb26330e3421c.js +0 -1
  379. package/assets/esri/core/workers/chunks/f3b4159c0722df8ffe13.js +0 -1
  380. package/assets/esri/core/workers/chunks/f75eec2cbc541eec9712.js +0 -1
  381. package/layers/geospatialPDF/projectionToWKTUtils.js +0 -3
  382. package/libs/maquette/cache.js +0 -2
  383. package/libs/maquette/dom.js +0 -2
  384. package/libs/maquette/h.js +0 -2
  385. package/libs/maquette/index.js +0 -2
  386. package/libs/maquette/mapping.js +0 -2
  387. package/libs/maquette/projection.js +0 -2
  388. package/libs/maquette/projector.js +0 -2
  389. package/libs/maquette/utilities/window-performance-projector-logger.js +0 -2
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Float3PassUniform as t}from"../../shaderModules/Float3PassUniform.js";import{glsl as n}from"../../shaderModules/glsl.js";import{NoParameters as r}from"../../../../../webgl/NoParameters.js";class i extends r{constructor(){super(...arguments),this.tileCameraPosition=e(),this.cameraDelta=e()}}function a(e){e.code.add(n`float unpackOpacity(uvec4 packedGaussian) {
2
+ import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{gaussianSplatGridCellSize as t}from"../../../../support/gaussianSplatting/formatConstants.js";import{Float3PassUniform as n}from"../../shaderModules/Float3PassUniform.js";import{glsl as r}from"../../shaderModules/glsl.js";import{NoParameters as i}from"../../../../../webgl/NoParameters.js";class a extends i{constructor(){super(...arguments),this.tileCameraPosition=e(),this.cameraDelta=e()}}function o(e){e.code.add(r`float unpackOpacity(uvec4 packedGaussian) {
3
3
  return float((packedGaussian.w >> 24u) & 0xffu) / 255.0;
4
4
  }
5
5
  vec4 unpackColor(uvec4 packedGaussian) {
@@ -9,14 +9,14 @@ color.g = float((packedGaussian.w >> 9u) & 0xffu);
9
9
  color.b = float((packedGaussian.w >> 16u) & 0xfeu);
10
10
  color.a = float((packedGaussian.w >> 24u) & 0xffu);
11
11
  return color / 255.0;
12
- }`),e.code.add(n`vec3 unpackScale(uvec4 packedGaussian) {
12
+ }`),e.code.add(r`vec3 unpackScale(uvec4 packedGaussian) {
13
13
  uint sx = (packedGaussian.z >> 10u) & 0xffu;
14
14
  uint sy = (packedGaussian.z >> 18u) & 0xffu;
15
15
  uint szLow = (packedGaussian.z >> 26u) & 0x3fu;
16
16
  uint szHigh = packedGaussian.a & 0x3u;
17
17
  uint sz = szLow | (szHigh << 6u);
18
18
  return exp(vec3(sx, sy, sz) / 16.0 - 10.0);
19
- }`),e.code.add(n`const uint MASK_9_BITS = 0x1FFu;
19
+ }`),e.code.add(r`const uint MASK_9_BITS = 0x1FFu;
20
20
  const float SQRT_HALF = 0.7071067811865476;
21
21
  vec4 unpackQuaternion(uvec4 packedGaussian) {
22
22
  uint packedRotation = packedGaussian.x;
@@ -28,7 +28,7 @@ vec4 quaternion = vec4(components, sqrt(1.0 - dot(components, components)));
28
28
  return largestComponent == 0u ? quaternion.wzyx :
29
29
  largestComponent == 1u ? quaternion.zwyx :
30
30
  largestComponent == 2u ? quaternion.zywx : quaternion.zyxw;
31
- }`),e.code.add(n`vec3 unpackTileOriginRelativePosition(uvec4 packedGaussian) {
31
+ }`),e.code.add(r`vec3 unpackTileOriginRelativePosition(uvec4 packedGaussian) {
32
32
  uint packedPositionLow = packedGaussian.y;
33
33
  uint packedPositionHigh = packedGaussian.z;
34
34
  uint x = packedPositionLow & 0x3FFFu;
@@ -37,10 +37,14 @@ uint zLow = (packedPositionLow >> 28u) & 0xFu;
37
37
  uint zHigh = packedPositionHigh & 0x3FFu;
38
38
  uint z = zLow | (zHigh << 4u);
39
39
  return vec3(float(x), float(y), float(z));
40
- }`),e.uniforms.add(new t(`tileCameraPosition`,e=>e.tileCameraPosition),new t(`cameraDelta`,e=>e.cameraDelta)).code.add(n`vec3 unpackCameraRelativeGaussianPosition(uvec4 packedHeader, highp vec3 position) {
41
- vec3 tileOrigin = uintBitsToFloat(packedHeader.xyz);
42
- float invPosScale = 1.0 / exp2(float(packedHeader.w & 0xfu));
43
- vec3 delta = tileOrigin.xyz - tileCameraPosition;
44
- vec3 cameraRelativePosition = position * invPosScale + delta * 2.048 - cameraDelta;
45
- return cameraRelativePosition;
46
- }`)}export{a as GaussianSplatUnpacking,i as GaussianSplatUnpackingPassParameters};
40
+ }`),e.uniforms.add(new n(`tileCameraPosition`,e=>e.tileCameraPosition),new n(`cameraDelta`,e=>e.cameraDelta)).code.add(r`
41
+ vec3 unpackCameraRelativeGaussianPosition(uvec4 packedHeader, highp vec3 position) {
42
+ // Unpack the header
43
+ vec3 tileOrigin = uintBitsToFloat(packedHeader.xyz);
44
+ float invPosScale = 1.0 / exp2(float(packedHeader.w & 0xfu));
45
+ vec3 delta = tileOrigin.xyz - tileCameraPosition;
46
+ vec3 cameraRelativePosition = position * invPosScale + delta * ${r.float(t)} - cameraDelta;
47
+
48
+ return cameraRelativePosition;
49
+ }
50
+ `)}export{o as GaussianSplatUnpacking,a as GaussianSplatUnpackingPassParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,sync as i}from"../../../../core/reactiveUtils.js";import{signal as a}from"../../../../core/signal.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{cloudPresets as c}from"./clouds/CloudsPresets.js";import{CloudsRenderer as l}from"./clouds/CloudsRenderer.js";import{Precipitation as u}from"./precipitation/Precipitation.js";let d=class extends t{constructor(e){super(e),this._clouds=a(null),this._incarnation=0,this._precipitation=null}initialize(){let e=()=>this._requestRender();this.addHandles([r(()=>this._precipitation,e,i),r(()=>this._clouds.value?.state,e,i),r(()=>this.view.state.mode,e,i),r(()=>this.view.state.stationary&&!!this.context.bind.clouds.data&&this.context.bind.clouds.needsStationaryAnchorUpdate(this.view.state.camera),t=>{t&&e()},i),r(()=>this._updateClouds(),e,i),r(()=>this._updatePrecipitation(),e,i),r(()=>this.view.environmentView.weatherEnabled?this.view.environment.weather:null,e=>this._initWeather(e))])}destroy(){this.removeHandles(),this._clouds.value=n(this._clouds.value),this._precipitation=null,this._precipitationOutgoing=null}get readyToRun(){return!!this._clouds.value?.readyToRun||this.view.state.stationary&&!!this.context.bind.clouds.data&&this.context.bind.clouds.needsStationaryAnchorUpdate(this.view.state.camera)}get usedMemory(){return this._clouds.value?.usedMemory??0}_fadeOutPrecipitation(){this._precipitation&&(this._precipitationOutgoing?.destroy(),this._precipitationOutgoing=this._precipitation,this._precipitationOutgoing.fadeOut(()=>this._precipitationOutgoing=n(this._precipitationOutgoing)),this._precipitation=null,++this._incarnation)}get snowCover(){return this._precipitationOutgoing?.snowCover??this._precipitation?.snowCover??0}cleanupCubemap(){let e=this._clouds.value;e?.state===0&&e.coverage===0&&!e.readyToRun&&e.destroyCubeMap()}_requestRender(){this.view.stage.renderView.requestRender()}_initWeather(e){!e||!this.context?this._clouds.value=n(this._clouds.value):this._clouds.value||(this._clouds.value=new l({context:this.context,view:this.view,requestRender:()=>this._requestRender()}))}_updateClouds(){let e=this.view.environment.weather;return e==null||this._clouds.value==null||this._clouds.value.applyPreset(c[e.type],f(e)),++this._incarnation}_updatePrecipitation(){let e=this.view.environment.weather;return e.type===this._precipitation?.type||(this._fadeOutPrecipitation(),(e.type===`rainy`||e.type===`snowy`)&&(this._precipitation=new u({view:this.view,type:e.type}),++this._incarnation)),this._incarnation}get test(){}};e([o({constructOnly:!0})],d.prototype,`view`,void 0),e([o({constructOnly:!0})],d.prototype,`context`,void 0),d=e([s(`esri.views.3d.webgl-engine.effects.WeatherFader`)],d);function f(e){switch(e.type){case`rainy`:case`snowy`:case`cloudy`:case`sunny`:return e.cloudCover;case`foggy`:return e.fogStrength}}export{d as WeatherFader};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,sync as i}from"../../../../core/reactiveUtils.js";import{signal as a}from"../../../../core/signal.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{cloudPresets as c}from"./clouds/CloudsPresets.js";import{CloudsRenderer as l}from"./clouds/CloudsRenderer.js";import{Precipitation as u}from"./precipitation/Precipitation.js";let d=class extends t{constructor(e){super(e),this._clouds=a(null)}initialize(){let e=()=>this._requestRender();this.addHandles([r(()=>this._precipitation,e,i),r(()=>this._clouds.value,e,i),r(()=>this._clouds.value?.state,e,i),r(()=>this.view.state.mode,e,i),r(()=>this.view.state.stationary&&!!this.context.bind.clouds.data&&this.context.bind.clouds.needsStationaryAnchorUpdate(this.view.state.camera),t=>{t&&e()},i),r(()=>[this._weather?.type,f(this._weather)],([e,t])=>this._updateClouds(e,t)),r(()=>this._weather?.type,e=>this._updatePrecipitation(e))])}destroy(){this.removeHandles(),this._clouds.value=n(this._clouds.value),this._precipitation=null,this._precipitationOutgoing=null}get readyToRun(){return!!this._clouds.value?.readyToRun||this.view.state.stationary&&!!this.context.bind.clouds.data&&this.context.bind.clouds.needsStationaryAnchorUpdate(this.view.state.camera)}get usedMemory(){return this._clouds.value?.usedMemory??0}get _weather(){return this.view.environmentView.weatherEnabled?this.view.environment.weather:null}_fadeOutPrecipitation(){this._precipitation&&=(this._precipitationOutgoing?.destroy(),this._precipitationOutgoing=this._precipitation,this._precipitationOutgoing.fadeOut(()=>this._precipitationOutgoing=n(this._precipitationOutgoing)),null)}get snowCover(){return this._precipitationOutgoing?.snowCover??this._precipitation?.snowCover??0}cleanupCubemap(){let e=this._clouds.value;e?.state===0&&e.coverage===0&&!e.readyToRun&&e.destroyCubeMap()}_requestRender(){this.view.stage.renderView.requestRender()}_updateClouds(e,t){!e||!this.context?this._clouds.value=n(this._clouds.value):(this._clouds.value??=new l({context:this.context,view:this.view,requestRender:()=>this._requestRender()}),this._clouds.value.applyPreset(c[e],t))}_updatePrecipitation(e){e!==this._precipitation?.type&&(this._fadeOutPrecipitation(),(e===`rainy`||e===`snowy`)&&(this._precipitation=new u({view:this.view,type:e})))}get test(){}};e([o({constructOnly:!0})],d.prototype,`view`,void 0),e([o({constructOnly:!0})],d.prototype,`context`,void 0),e([o()],d.prototype,`_precipitation`,void 0),d=e([s(`esri.views.3d.webgl-engine.effects.WeatherFader`)],d);function f(e){switch(e?.type){case`rainy`:case`snowy`:case`cloudy`:case`sunny`:return e.cloudCover;case`foggy`:return e.fogStrength;case void 0:return-1}}export{d as WeatherFader};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as n,initial as r}from"../../../../../core/reactiveUtils.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{copy as a}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{InternalRenderCategory as s}from"../../../webgl.js";import{glLayout as c}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as l}from"../OpaqueEnvironment.js";import{S as u}from"../../../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as d,layout as f}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as p}from"./SimpleAtmosphereTechniqueConfiguration.js";import{earthAtmosphereTextureSimple as m}from"./SimpleAtmosphereTexture.js";import{createPolySphereData as h}from"../../lib/GeometryUtil.js";import{VertexArrayObject as g}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as _,PrimitiveType as v}from"../../../../webgl/enums.js";import y from"../../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as x}from"../../../../webgl/VertexBuffer.js";let S=class extends l{constructor(){super(...arguments),this._configuration=new p,this._passParameters=new u,this._vao=null,this._vaoCount=0}initialize(){this._configuration.geometry=1,this.addHandles([n(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),r)])}destroy(){this._passParameters.texture=t(this._passParameters.texture),this._vao=t(this._vao)}render(e){let t=e.find(({name:e})=>e===s.OPAQUE_ENVIRONMENT),n=this.techniques.getCompiled(d,this._configuration);if(!n)return this.requestRender(1),t;let r=this.renderingContext;if(this._vao||(this._vao=C(r),this._vaoCount=this._vao.vertexCount(`geometry`)),!this._passParameters.texture){let e=new b(1,512);e.wrapMode=33071,e.flipped=!0,this._passParameters.texture=new y(r,e,m)}let i=r.bindTechnique(n,this.bindParameters,this._passParameters);return r.setDrawBuffers([_]),w(T,this.bindParameters.camera.viewMatrix),i.setUniformMatrix4fv(`view`,T),r.bindVAO(this._vao),i.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(v.TRIANGLES,0,this._vaoCount),t}};S=e([i(`esri.views.3d.webgl-engine.effects.atmosphere.LocalAtmosphere`)],S);function C(e){let{data:t,indices:n}=h(1,2,!1)[0][1],r=f.createBuffer(n.length),i=r.position;for(let e=0;e<n.length;++e){let r=n[e%3==0?e+2:e%3==2?e-2:e]*3;i.set(e,0,t[r]),i.set(e,1,t[r+1]),i.set(e,2,t[r+2])}return new g(e,new x(e,c(f),r.buffer))}function w(e,t){a(e,t),e[12]=0,e[13]=0,e[14]=0,e[15]=1}const T=o();export{S as LocalAtmosphere};
2
+ import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as n,initial as r}from"../../../../../core/reactiveUtils.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{copy as a}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{InternalRenderCategory as s}from"../../../webgl.js";import{glLayout as c}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as l}from"../OpaqueEnvironment.js";import{S as u}from"../../../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as d,layout as f}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as p}from"./SimpleAtmosphereTechniqueConfiguration.js";import{earthAtmosphereTextureSimple as m}from"./SimpleAtmosphereTexture.js";import{createPolySphereData as h}from"../../lib/GeometryUtil.js";import{VertexArrayObject as g}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as _,PrimitiveType as v}from"../../../../webgl/enums.js";import{Texture as y}from"../../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as x}from"../../../../webgl/VertexBuffer.js";let S=class extends l{constructor(){super(...arguments),this._configuration=new p,this._passParameters=new u,this._vao=null,this._vaoCount=0}initialize(){this._configuration.geometry=1,this.addHandles([n(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),r)])}destroy(){this._passParameters.texture=t(this._passParameters.texture),this._vao=t(this._vao)}render(e){let t=e.find(({name:e})=>e===s.OPAQUE_ENVIRONMENT),n=this.techniques.getCompiled(d,this._configuration);if(!n)return this.requestRender(1),t;let r=this.renderingContext;if(this._vao||(this._vao=C(r),this._vaoCount=this._vao.vertexCount(`geometry`)),!this._passParameters.texture){let e=new b(1,512);e.wrapMode=33071,e.flipped=!0,this._passParameters.texture=new y(r,e,m)}let i=r.bindTechnique(n,this.bindParameters,this._passParameters);return r.setDrawBuffers([_]),w(T,this.bindParameters.camera.viewMatrix),i.setUniformMatrix4fv(`view`,T),r.bindVAO(this._vao),i.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(v.TRIANGLES,0,this._vaoCount),t}};S=e([i(`esri.views.3d.webgl-engine.effects.atmosphere.LocalAtmosphere`)],S);function C(e){let{data:t,indices:n}=h(1,2,!1)[0][1],r=f.createBuffer(n.length),i=r.position;for(let e=0;e<n.length;++e){let r=n[e%3==0?e+2:e%3==2?e-2:e]*3;i.set(e,0,t[r]),i.set(e,1,t[r+1]),i.set(e,2,t[r+2])}return new g(e,new x(e,c(f),r.buffer))}function w(e,t){a(e,t),e[12]=0,e[13]=0,e[14]=0,e[15]=1}const T=o();export{S as LocalAtmosphere};
@@ -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,clamp as n}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,initial as a}from"../../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{lookAt as s}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as l}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as u,scale as d,add as f,distance as p,cross as m,squaredLength 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{newFloatArray as v}from"../../../../../geometry/support/FloatArray.js";import{InternalRenderCategory as y}from"../../../webgl.js";import{makePiecewiseLinearFunction as b}from"../../../support/mathUtils.js";import{glLayout as x}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as S}from"../OpaqueEnvironment.js";import{computeInnerAltitudeFade as C,innerAtmosphereDepth as w}from"./atmosphereUtils.js";import{marsAtmosphereTextureSimple as T}from"./MarsAtmosphereTexture.js";import{S as E}from"../../../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as D,layout as O}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as k}from"./SimpleAtmosphereTechniqueConfiguration.js";import{createQuadVAO as A}from"../../lib/glUtil3D.js";import{project as j}from"../../lib/Util.js";import{VertexArrayObject as M}from"../../lib/VertexArrayObject.js";import{PrimitiveType as N}from"../../../../webgl/enums.js";import P from"../../../../webgl/Texture.js";import{TextureDescriptor as F}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as I}from"../../../../webgl/VertexBuffer.js";const L=-w,R=()=>1-511/512,z=b([[50,1-460/512],[500,1-400/512],[5e3,1-250/512],[5e4,1-300/512]]);let B=class extends S{constructor(e){super(e),this._passParameters=new E,this._configuration=new k,this._vao=null,this._fadeVao=null,this._texV1=1;let t=e.view,{outerAtmosphereRimWidth:n,radius:r}=_(t.spatialReference);this._planetRadius=r,this._innerRimFactor=1+L/r,this._middleRimFactor=1+0/r,this._outerRimFactor=1+n/r,this._texV0=0/n,this._texVScale=this._texV1-this._texV0}initialize(){this.addHandles(i(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),a))}destroy(){this._passParameters.texture=r(this._passParameters.texture),this._fadeVao=r(this._fadeVao),this._vao=r(this._vao)}render(e){let t=e.find(({name:e})=>e===y.OPAQUE_ENVIRONMENT);this._update();let n=this.renderingContext;if(!this._passParameters.texture){let e=new F(1,512);e.wrapMode=33071,e.flipped=!0,this._passParameters.texture=new P(n,e,T)}if(this._passParameters.undergroundFadeAlpha<1){this._vao??=this._createRibbon(n),this._configuration.geometry=0;let e=this.techniques.getCompiled(D,this._configuration);if(!e)return this.requestRender(1),t;n.bindTechnique(e,this.bindParameters,this._passParameters),n.bindVAO(this._vao),n.drawArrays(N.TRIANGLES,0,this._vao.vertexCount(`geometry`))}if(this._passParameters.undergroundFadeAlpha>0){this._fadeVao??=A(n),this._configuration.geometry=2;let e=this.techniques.getCompiled(D,this._configuration);if(!e)return this.requestRender(1),t;n.bindTechnique(e,this.bindParameters,this._passParameters),n.bindVAO(this._fadeVao),n.drawArrays(N.TRIANGLE_STRIP,0,this._fadeVao.vertexCount(`geometry`))}return t}_update(){let e=this.bindParameters.camera,r=g(),i=this._planetRadius,a=u(e.eye),o=a-i;if(o<0){let e=Math.min(-o/5e3,1);this._passParameters.undergroundFadeAlpha=e}else this._passParameters.undergroundFadeAlpha=0;let s=Math.max(50,o),c=i+L;this._passParameters.innerScale=G(i+s,i,c)-1,this._passParameters.altitudeFade=C(o),d(r,e.eye,(i+50)/a),V(r,e.center,e.up,i,this._passParameters.silhouette);let f=this._computeScreenRimWidth(e,r,e.up,this._passParameters.silhouette),p=R(),m=z(o),h=this._texV0+p*this._texVScale,_=this._texV0+f*m*this._texVScale;if(o>50){V(e.eye,e.center,e.up,i,this._passParameters.silhouette);let r=this._computeScreenRimWidth(e,e.eye,e.up,this._passParameters.silhouette),a=n((r-1.5)/(f-1.5),0,1);h=this._texV0+a*p*this._texVScale,_=this._texV0+t(this._texV1,f*m,a)*this._texVScale}l(this._passParameters.texV,h,_)}_createRibbon(e){let t=v(1155),n=new Uint32Array(1920);t[0]=0,t[1]=0,t[2]=-1;for(let e=0;e<128;e++){let r=e*9+3;t[r]=e,t[r+1]=this._innerRimFactor,t[r+2]=-1,t[r+3]=e,t[r+4]=this._middleRimFactor,t[r+5]=0,t[r+6]=e,t[r+7]=this._outerRimFactor,t[r+8]=1;let i=3*e+1,a=e===127?1:i+3,o=e*15;n[o]=i,n[o+1]=i+1,n[o+2]=a+1,n[o+3]=a+1,n[o+4]=a,n[o+5]=i,n[o+6]=i+1,n[o+7]=i+2,n[o+8]=a+2,n[o+9]=a+2,n[o+10]=a+1,n[o+11]=i+1,n[o+12]=i,n[o+13]=a,n[o+14]=0}let r=O.createBuffer(n.length),i=r.position;for(let e=0;e<n.length;++e){let r=n[e]*3;i.set(e,0,t[r]),i.set(e,1,t[r+1]),i.set(e,2,t[r+2])}return new M(e,new I(e,x(O),r.buffer))}_computeScreenRimWidth(e,t,n,r){return f(U,r.center,r.v2),d(W,U,this._outerRimFactor),s(H,t,U,n),j(U,H,e.projectionMatrix,e.viewport,U),j(W,H,e.projectionMatrix,e.viewport,W),p(U,W)/e.height}};B=e([o(`esri.views.3d.webgl-engine.effects.atmosphere.MarsAtmosphere`)],B);function V(e,t,n,r,i){let a=u(e),o=r*Math.sqrt(a*a-r*r)/a,s=Math.sqrt(r*r-o*o),c=i.v1,l=i.v2;return d(i.center,e,s/a),m(c,e,t),h(c)<1&&m(c,e,n),d(c,c,o/u(c)),m(l,c,e),d(l,l,o/u(l)),o}const H=c(),U=g(),W=g();function G(e,t,n){let r=Math.sqrt(e*e-t*t),i=Math.sqrt(e*e-n*n);return e*e/(r*i+t*n)}export{B as MarsAtmosphere};
2
+ import{__decorate as e}from"tslib";import{lerp as t,clamp as n}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,initial as a}from"../../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{lookAt as s}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as l}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as u,scale as d,add as f,distance as p,cross as m,squaredLength 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{newFloatArray as v}from"../../../../../geometry/support/FloatArray.js";import{InternalRenderCategory as y}from"../../../webgl.js";import{makePiecewiseLinearFunction as b}from"../../../support/mathUtils.js";import{glLayout as x}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as S}from"../OpaqueEnvironment.js";import{computeInnerAltitudeFade as C,innerAtmosphereDepth as w}from"./atmosphereUtils.js";import{marsAtmosphereTextureSimple as T}from"./MarsAtmosphereTexture.js";import{S as E}from"../../../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as D,layout as O}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as k}from"./SimpleAtmosphereTechniqueConfiguration.js";import{createQuadVAO as A}from"../../lib/glUtil3D.js";import{project as j}from"../../lib/Util.js";import{VertexArrayObject as M}from"../../lib/VertexArrayObject.js";import{PrimitiveType as N}from"../../../../webgl/enums.js";import{Texture as P}from"../../../../webgl/Texture.js";import{TextureDescriptor as F}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as I}from"../../../../webgl/VertexBuffer.js";const L=-w,R=()=>1-511/512,z=b([[50,1-460/512],[500,1-400/512],[5e3,1-250/512],[5e4,1-300/512]]);let B=class extends S{constructor(e){super(e),this._passParameters=new E,this._configuration=new k,this._vao=null,this._fadeVao=null,this._texV1=1;let t=e.view,{outerAtmosphereRimWidth:n,radius:r}=_(t.spatialReference);this._planetRadius=r,this._innerRimFactor=1+L/r,this._middleRimFactor=1+0/r,this._outerRimFactor=1+n/r,this._texV0=0/n,this._texVScale=this._texV1-this._texV0}initialize(){this.addHandles(i(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),a))}destroy(){this._passParameters.texture=r(this._passParameters.texture),this._fadeVao=r(this._fadeVao),this._vao=r(this._vao)}render(e){let t=e.find(({name:e})=>e===y.OPAQUE_ENVIRONMENT);this._update();let n=this.renderingContext;if(!this._passParameters.texture){let e=new F(1,512);e.wrapMode=33071,e.flipped=!0,this._passParameters.texture=new P(n,e,T)}if(this._passParameters.undergroundFadeAlpha<1){this._vao??=this._createRibbon(n),this._configuration.geometry=0;let e=this.techniques.getCompiled(D,this._configuration);if(!e)return this.requestRender(1),t;n.bindTechnique(e,this.bindParameters,this._passParameters),n.bindVAO(this._vao),n.drawArrays(N.TRIANGLES,0,this._vao.vertexCount(`geometry`))}if(this._passParameters.undergroundFadeAlpha>0){this._fadeVao??=A(n),this._configuration.geometry=2;let e=this.techniques.getCompiled(D,this._configuration);if(!e)return this.requestRender(1),t;n.bindTechnique(e,this.bindParameters,this._passParameters),n.bindVAO(this._fadeVao),n.drawArrays(N.TRIANGLE_STRIP,0,this._fadeVao.vertexCount(`geometry`))}return t}_update(){let e=this.bindParameters.camera,r=g(),i=this._planetRadius,a=u(e.eye),o=a-i;if(o<0){let e=Math.min(-o/5e3,1);this._passParameters.undergroundFadeAlpha=e}else this._passParameters.undergroundFadeAlpha=0;let s=Math.max(50,o),c=i+L;this._passParameters.innerScale=G(i+s,i,c)-1,this._passParameters.altitudeFade=C(o),d(r,e.eye,(i+50)/a),V(r,e.center,e.up,i,this._passParameters.silhouette);let f=this._computeScreenRimWidth(e,r,e.up,this._passParameters.silhouette),p=R(),m=z(o),h=this._texV0+p*this._texVScale,_=this._texV0+f*m*this._texVScale;if(o>50){V(e.eye,e.center,e.up,i,this._passParameters.silhouette);let r=this._computeScreenRimWidth(e,e.eye,e.up,this._passParameters.silhouette),a=n((r-1.5)/(f-1.5),0,1);h=this._texV0+a*p*this._texVScale,_=this._texV0+t(this._texV1,f*m,a)*this._texVScale}l(this._passParameters.texV,h,_)}_createRibbon(e){let t=v(1155),n=new Uint32Array(1920);t[0]=0,t[1]=0,t[2]=-1;for(let e=0;e<128;e++){let r=e*9+3;t[r]=e,t[r+1]=this._innerRimFactor,t[r+2]=-1,t[r+3]=e,t[r+4]=this._middleRimFactor,t[r+5]=0,t[r+6]=e,t[r+7]=this._outerRimFactor,t[r+8]=1;let i=3*e+1,a=e===127?1:i+3,o=e*15;n[o]=i,n[o+1]=i+1,n[o+2]=a+1,n[o+3]=a+1,n[o+4]=a,n[o+5]=i,n[o+6]=i+1,n[o+7]=i+2,n[o+8]=a+2,n[o+9]=a+2,n[o+10]=a+1,n[o+11]=i+1,n[o+12]=i,n[o+13]=a,n[o+14]=0}let r=O.createBuffer(n.length),i=r.position;for(let e=0;e<n.length;++e){let r=n[e]*3;i.set(e,0,t[r]),i.set(e,1,t[r+1]),i.set(e,2,t[r+2])}return new M(e,new I(e,x(O),r.buffer))}_computeScreenRimWidth(e,t,n,r){return f(U,r.center,r.v2),d(W,U,this._outerRimFactor),s(H,t,U,n),j(U,H,e.projectionMatrix,e.viewport,U),j(W,H,e.projectionMatrix,e.viewport,W),p(U,W)/e.height}};B=e([o(`esri.views.3d.webgl-engine.effects.atmosphere.MarsAtmosphere`)],B);function V(e,t,n,r,i){let a=u(e),o=r*Math.sqrt(a*a-r*r)/a,s=Math.sqrt(r*r-o*o),c=i.v1,l=i.v2;return d(i.center,e,s/a),m(c,e,t),h(c)<1&&m(c,e,n),d(c,c,o/u(c)),m(l,c,e),d(l,l,o/u(l)),o}const H=c(),U=g(),W=g();function G(e,t,n){let r=Math.sqrt(e*e-t*t),i=Math.sqrt(e*e-n*n);return e*e/(r*i+t*n)}export{B as MarsAtmosphere};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{lerp as n}from"../../../../../core/mathUtils.js";import{destroyMaybe as r,disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as a,initial as o}from"../../../../../core/reactiveUtils.js";import{signal as s}from"../../../../../core/signal.js";import{property as c,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as u}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{targetTo as d}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{equals as p,copy as m,set as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{clone as g,ZEROS as _,zeros as v}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as y}from"../../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{zeros as b}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as x}from"../../../../../geometry/ellipsoidUtils.js";import{C as S,c as C}from"../../../../../chunks/Clouds.glsl.js";import{cloudPresets as w}from"./CloudsPresets.js";import{CloudsTechnique as T}from"./CloudsTechnique.js";import{CloudsTechniqueConfiguration as E}from"./CloudsTechniqueConfiguration.js";import{NoiseTextureAtlas as D}from"./NoiseTextureAtlas.js";import{TaskPriority as O}from"../../../../support/Scheduler.js";import{Yield as k}from"../../../../support/Yield.js";import{ColorAttachment0 as A}from"../../../../webgl/enums.js";import{DisposableFramebufferObject as j}from"../../../../webgl/FramebufferObject.js";import{TextureDescriptor as M}from"../../../../webgl/TextureDescriptor.js";let N=class extends t{constructor(e){super(e),this._state=s(0),this._passParameters=new S,this._weatherTileCount=128,this._sliceIndex=0,this._tileIndex=0,this._tilesPerSlice=1,this.coverage=n(w.default.coverage[0],w.default.coverage[1],.5),this.density=n(w.default.density[0],w.default.density[1],.5),this.absorption=n(w.default.absorption[0],w.default.absorption[1],.5),this.cloudSize=n(w.default.cloudSize[0],w.default.cloudSize[1],.5),this.detailSize=n(w.default.detailSize[0],w.default.detailSize[1],.5),this.smoothness=n(w.default.smoothness[0],w.default.smoothness[1],.5),this.cloudHeight=n(w.default.cloudHeight[0],w.default.cloudHeight[1],.5),this.raymarchingSteps=w.default.raymarchingSteps,this._viewMatrix=f(),this._dirty=!0,this.readyToRun=!0,this._configuration=new E}initialize(){let e=x(this.view.spatialReference);this._passParameters.cloudRadius=.5*e.radius;let t=()=>this.setDirty();this.addHandles([this.view.resourceController.scheduler.registerTask(O.CLOUDS_GENERATOR,this),a(()=>this.coverage,t,o),a(()=>this.density,t,o),a(()=>this.absorption,t,o),a(()=>this.cloudSize,t,o),a(()=>this.detailSize,t,o),a(()=>this.smoothness,t,o),a(()=>this.cloudHeight,t,o),a(()=>this.raymarchingSteps,t,o)]);let n=g(this._computeWeatherTile()),r=0;this.addHandles(a(()=>{let e=this._computeWeatherTile();return p(n,e)||(++r,m(n,e)),r},t))}destroy(){this.destroyCubeMap(),this._passParameters.noiseTexture=r(this._passParameters.noiseTexture)}_acquireTechnique(){switch(this.raymarchingSteps){case 0:this._tilesPerSlice=1;break;case 1:this._tilesPerSlice=4;break;case 3:case 2:this._tilesPerSlice=8;break;default:this.raymarchingSteps}return this._configuration.steps=this.raymarchingSteps,this._configuration.writeTextureChannels=1-this.parameters.readChannels,this.context.techniques.getCompiled(T,this._configuration)}_computeWeatherTile(){let{camera:e,environment:t}=this.view,{latitude:n,longitude:r}=e.position;if(n==null||r==null)return _;h(L,(n+90)/180,(r+180)/360);let i=Math.floor(this._weatherTileCount*Math.abs(2*L[0]-1));L[0]=Math.floor(2*this._weatherTileCount*L[0]),L[1]=Math.floor(4*(this._weatherTileCount-i)*L[1]);let a=0,o=0;if(t?.lighting?.type!==`virtual`&&t?.lighting?.date!=null){let e=new Date(t.lighting.date);e.setUTCHours(t.lighting.date.getUTCHours()+(t.lighting.displayUTCOffset??0)),a=e.getUTCMonth()*31+e.getUTCDate(),o=e.getUTCFullYear()}return L[0]=(L[0]+a)%(2*this._weatherTileCount),L[1]=(L[1]+o%100)%(4*this._weatherTileCount),L}get state(){return this._state.value}set state(e){this._state.value=e}get usedMemory(){return(this._fbo?.usedMemory??0)+(this._passParameters.noiseTexture?.textureAtlas?.usedMemory??0)}_ensureNoiseTexture(){return this._passParameters.noiseTexture??=new D({context:this.context}),this._passParameters.noiseTexture}_ensureFrameBufferCube(e){let t=this.context.rctx;if(this._fbo==null){let n=new M(e,e/2);n.target=35866,n.depth=6,n.wrapMode=33071,this._fbo=new j(t,n),this.parameters.data=this,this.parameters.absorption=this.absorption,this.parameters.coverage=this.coverage}return t.unbindTexture(this._fbo.colorTexture),this._fbo}get cubeMap(){return this._fbo}get parameters(){return this.context.bind.clouds}destroyCubeMap(){this._fbo=i(this._fbo),this.parameters.data=null}applyPreset(e,t){let r=e.median,i=e=>{let i=n(e[0],e[1],r);return t<.5?n(e[0],i,t*2):n(i,e[1],(t-.5)*2)};this.coverage=i(e.coverage),this.density=i(e.density),this.absorption=i(e.absorption),this.cloudSize=i(e.cloudSize),this.detailSize=i(e.detailSize),this.smoothness=i(e.smoothness),this.cloudHeight=i(e.cloudHeight),this.raymarchingSteps=e.raymarchingSteps}setDirty(){this._dirty=this.readyToRun=!0}runTask(e){if(this.state===3)return k;this._dirty&&=(this._sliceIndex=this._tileIndex=0,this.state=1,this._passParameters.absorption=this.absorption,this._passParameters.density=this.density,this._passParameters.cloudSize=this.cloudSize,this._passParameters.detailSize=this.detailSize,this._passParameters.smoothness=this.smoothness,this._passParameters.cloudHeight=this.cloudHeight,this._passParameters.coverage=this.coverage,this._ensureNoiseTexture().updateWeatherMap(this._computeWeatherTile()),!1);let t=this._acquireTechnique();if(!this._ensureNoiseTexture().textureAtlas||!t)return k;let n=P[this._sliceIndex],r=F[this._sliceIndex];d(this._viewMatrix,I,n,r),u(this._passParameters.viewMatrix,this._viewMatrix);let i=this.context.rctx,a=i.getViewport(),o=C/this._tilesPerSlice,s=this._tileIndex*o;i.setViewport(0,s,C,o);let c=this._ensureFrameBufferCube(C);return i.bindFramebuffer(c),this._passParameters.lastSlice=this._sliceIndex===5,i.bindTechnique(t,this.context.bind,this._passParameters),c.setColorTextureTarget(35866,A,this._sliceIndex),i.screen.draw(),i.gl.flush(),i.setViewport(a.x,a.y,a.width,a.height),this.requestRender(),++this._tileIndex,this._sliceIndex===5&&this._tileIndex===this._tilesPerSlice?(this._sliceIndex=this._tileIndex=0,this.state=2,this.readyToRun=!1):this._tileIndex===this._tilesPerSlice&&(++this._sliceIndex,this._tileIndex=0),e.madeProgress(),k}};e([c({constructOnly:!0})],N.prototype,`context`,void 0),e([c({constructOnly:!0})],N.prototype,`view`,void 0),e([c({constructOnly:!0})],N.prototype,`requestRender`,void 0),e([c()],N.prototype,`coverage`,void 0),e([c()],N.prototype,`density`,void 0),e([c()],N.prototype,`absorption`,void 0),e([c()],N.prototype,`cloudSize`,void 0),e([c()],N.prototype,`detailSize`,void 0),e([c()],N.prototype,`smoothness`,void 0),e([c()],N.prototype,`cloudHeight`,void 0),e([c()],N.prototype,`raymarchingSteps`,void 0),e([c()],N.prototype,`readyToRun`,void 0),N=e([l(`esri.views.3d.webgl-engine.effects.clouds.CloudsRenderer`)],N);const P=[y(1,0,0),y(-1,0,0),y(0,1,0),y(0,-1,0),y(0,0,1),y(0,0,1)],F=[y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,1,0),y(0,1,0)],I=b(),L=v();export{N as CloudsRenderer};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{lerp as n}from"../../../../../core/mathUtils.js";import{destroyMaybe as r,disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as a,initial as o}from"../../../../../core/reactiveUtils.js";import{signal as s}from"../../../../../core/signal.js";import{property as c,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as u}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{targetTo as d}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{equals as p,copy as m,set as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{clone as g,ZEROS as _,zeros as v}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as y}from"../../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{zeros as b}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as x}from"../../../../../geometry/ellipsoidUtils.js";import{C as S,c as C}from"../../../../../chunks/Clouds.glsl.js";import{cloudPresets as w}from"./CloudsPresets.js";import{CloudsTechnique as T}from"./CloudsTechnique.js";import{CloudsTechniqueConfiguration as E}from"./CloudsTechniqueConfiguration.js";import{NoiseTextureAtlas as D}from"./NoiseTextureAtlas.js";import{TaskPriority as O}from"../../../../support/Scheduler.js";import{Yield as k}from"../../../../support/Yield.js";import{ColorAttachment0 as A}from"../../../../webgl/enums.js";import{DisposableFramebufferObject as j}from"../../../../webgl/FramebufferObject.js";import{TextureDescriptor as M}from"../../../../webgl/TextureDescriptor.js";let N=class extends t{constructor(e){super(e),this._state=s(0),this._passParameters=new S,this._weatherTileCount=128,this._sliceIndex=0,this._tileIndex=0,this._tilesPerSlice=1,this.coverage=n(w.default.coverage[0],w.default.coverage[1],.5),this.density=n(w.default.density[0],w.default.density[1],.5),this.absorption=n(w.default.absorption[0],w.default.absorption[1],.5),this.cloudSize=n(w.default.cloudSize[0],w.default.cloudSize[1],.5),this.detailSize=n(w.default.detailSize[0],w.default.detailSize[1],.5),this.smoothness=n(w.default.smoothness[0],w.default.smoothness[1],.5),this.cloudHeight=n(w.default.cloudHeight[0],w.default.cloudHeight[1],.5),this.raymarchingSteps=w.default.raymarchingSteps,this._viewMatrix=f(),this._dirty=!0,this.readyToRun=!0,this._configuration=new E}initialize(){let e=x(this.view.spatialReference);this._passParameters.cloudRadius=.5*e.radius;let t=()=>this.setDirty();this.addHandles([this.view.resourceController.scheduler.registerTask(O.CLOUDS_GENERATOR,this),a(()=>this.coverage,t,o),a(()=>this.density,t,o),a(()=>this.absorption,t,o),a(()=>this.cloudSize,t,o),a(()=>this.detailSize,t,o),a(()=>this.smoothness,t,o),a(()=>this.cloudHeight,t,o),a(()=>this.raymarchingSteps,t,o)]);let n=g(this._computeWeatherTile()),r=0;this.addHandles(a(()=>{let e=this._computeWeatherTile();return p(n,e)||(++r,m(n,e)),r},t))}destroy(){this.destroyCubeMap(),this._passParameters.noiseTexture=r(this._passParameters.noiseTexture)}_acquireTechnique(){switch(this.raymarchingSteps){case 0:this._tilesPerSlice=1;break;case 1:this._tilesPerSlice=4;break;case 3:case 2:this._tilesPerSlice=8;break;default:this.raymarchingSteps}return this._configuration.steps=this.raymarchingSteps,this._configuration.writeTextureChannels=1-this.parameters.readChannels,this.context.techniques.getCompiled(T,this._configuration)}_computeWeatherTile(){let{camera:e,environment:t}=this.view,{latitude:n,longitude:r}=e.position;if(n==null||r==null)return _;h(L,(n+90)/180,(r+180)/360);let i=Math.floor(this._weatherTileCount*Math.abs(2*L[0]-1));L[0]=Math.floor(2*this._weatherTileCount*L[0]),L[1]=Math.floor(4*(this._weatherTileCount-i)*L[1]);let a=0,o=0;if(t?.lighting?.type!==`virtual`&&t?.lighting?.date!=null){let e=new Date(t.lighting.date);e.setUTCHours(t.lighting.date.getUTCHours()+(t.lighting.displayUTCOffset??0)),a=e.getUTCMonth()*31+e.getUTCDate(),o=e.getUTCFullYear()}return L[0]=(L[0]+a)%(2*this._weatherTileCount),L[1]=(L[1]+o%100)%(4*this._weatherTileCount),L}get state(){return this._state.value}set state(e){this._state.value=e}get usedMemory(){return(this._fbo?.usedMemory??0)+(this._passParameters.noiseTexture?.textureAtlas?.usedMemory??0)}_ensureNoiseTexture(){return this._passParameters.noiseTexture??=new D({context:this.context}),this._passParameters.noiseTexture}_ensureCubemap(e){let t=this.context.rctx;if(this._fbo==null){let n=new M(e,e/2);n.target=35866,n.depth=6,n.wrapMode=33071,this._fbo=new j(t,n),this.parameters.data=this,this.parameters.absorption=this.absorption,this.parameters.coverage=this.coverage}return t.unbindTexture(this._fbo.colorTexture),this._fbo}_clearCubemap(){if(this._fbo==null)return;let e=this.context.rctx;e.bindFramebuffer(this._fbo),this.parameters.readChannels===1?e.setColorMask(!0,!0,!1,!1):e.setColorMask(!1,!1,!0,!0),e.setClearColor(0,1,0,1);for(let t=0;t<6;++t)this._fbo.setColorTextureTarget(35866,A,t),e.gl.clear(16384);e.setClearColor(1,1,1,1),e.setColorMask(!0,!0,!0,!0)}get cubeMap(){return this._fbo}get parameters(){return this.context.bind.clouds}destroyCubeMap(){this._fbo=i(this._fbo),this.parameters.data=null}applyPreset(e,t){let r=e.median,i=e=>{let i=n(e[0],e[1],r);return t<.5?n(e[0],i,t*2):n(i,e[1],(t-.5)*2)};this.coverage=i(e.coverage),this.density=i(e.density),this.absorption=i(e.absorption),this.cloudSize=i(e.cloudSize),this.detailSize=i(e.detailSize),this.smoothness=i(e.smoothness),this.cloudHeight=i(e.cloudHeight),this.raymarchingSteps=e.raymarchingSteps}setDirty(){this._dirty=this.readyToRun=!0}runTask(e){if(this.state===3)return k;if(this._dirty&&=(this._sliceIndex=this._tileIndex=0,this.state=1,this._passParameters.absorption=this.absorption,this._passParameters.density=this.density,this._passParameters.cloudSize=this.cloudSize,this._passParameters.detailSize=this.detailSize,this._passParameters.smoothness=this.smoothness,this._passParameters.cloudHeight=this.cloudHeight,this._passParameters.coverage=this.coverage,this._ensureNoiseTexture().updateWeatherMap(this._computeWeatherTile()),!1),this._passParameters.coverage===0){this._clearCubemap(),this._sliceIndex=this._tileIndex=0,this.state=2,this.readyToRun=!1,e.madeProgress();return}let t=this._acquireTechnique();if(!this._ensureNoiseTexture().textureAtlas||!t)return k;let n=P[this._sliceIndex],r=F[this._sliceIndex];d(this._viewMatrix,I,n,r),u(this._passParameters.viewMatrix,this._viewMatrix);let i=this.context.rctx,a=i.getViewport(),o=C/this._tilesPerSlice,s=this._tileIndex*o;i.setViewport(0,s,C,o);let c=this._ensureCubemap(C);return i.bindFramebuffer(c),this._passParameters.lastSlice=this._sliceIndex===5,i.bindTechnique(t,this.context.bind,this._passParameters),c.setColorTextureTarget(35866,A,this._sliceIndex),i.screen.draw(),i.gl.flush(),i.setViewport(a.x,a.y,a.width,a.height),this.requestRender(),++this._tileIndex,this._sliceIndex===5&&this._tileIndex===this._tilesPerSlice?(this._sliceIndex=this._tileIndex=0,this.state=2,this.readyToRun=!1):this._tileIndex===this._tilesPerSlice&&(++this._sliceIndex,this._tileIndex=0),e.madeProgress(),k}};e([c({constructOnly:!0})],N.prototype,`context`,void 0),e([c({constructOnly:!0})],N.prototype,`view`,void 0),e([c({constructOnly:!0})],N.prototype,`requestRender`,void 0),e([c()],N.prototype,`coverage`,void 0),e([c()],N.prototype,`density`,void 0),e([c()],N.prototype,`absorption`,void 0),e([c()],N.prototype,`cloudSize`,void 0),e([c()],N.prototype,`detailSize`,void 0),e([c()],N.prototype,`smoothness`,void 0),e([c()],N.prototype,`cloudHeight`,void 0),e([c()],N.prototype,`raymarchingSteps`,void 0),e([c()],N.prototype,`readyToRun`,void 0),N=e([l(`esri.views.3d.webgl-engine.effects.clouds.CloudsRenderer`)],N);const P=[y(1,0,0),y(-1,0,0),y(0,1,0),y(0,-1,0),y(0,0,1),y(0,0,1)],F=[y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,1,0),y(0,1,0)],I=b(),L=v();export{N as CloudsRenderer};
@@ -70,18 +70,28 @@ depth`),o=this.fboCache.acquire(e,t,`fbo visualizer`),s=i.boundFramebuffer;i.bin
70
70
  return linearDepthFromFloat(rgbaToFloat(depth));
71
71
  }
72
72
 
73
- vec4 readTexture(sampler2D tex, vec2 uv, int lod) {
74
- ivec2 iuv = ivec2(uv * vec2(textureSize(tex, lod)));
75
- return texelFetch(tex, iuv, lod);
76
- }
77
73
 
78
- ${n[0]===`float`?`float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {
74
+ ${s(n[0]===`float`,`
75
+ vec4 readTexture(sampler2D tex, vec2 uv, int lod) {
76
+ ivec2 iuv = ivec2(uv * vec2(textureSize(tex, lod)));
77
+ return texelFetch(tex, iuv, lod);
78
+ }
79
+
80
+ float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {
79
81
  ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));
80
82
  return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));
81
- }`:`float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {
82
- ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));
83
- return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);
84
- }`}
83
+ }
84
+ `,`
85
+ vec4 readTexture(usampler2D tex, vec2 uv, int lod) {
86
+ ivec2 iuv = ivec2(uv * vec2(textureSize(tex, lod)));
87
+ return vec4(texelFetch(tex, iuv, lod));
88
+ }
89
+
90
+ float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {
91
+ ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));
92
+ return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);
93
+ }
94
+ `)}
85
95
 
86
96
  void main() {
87
97
  ${p(n)}
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{equals as t}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{releaseMaybe as n,disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,initial as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{set as c}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as l}from"../../../webgl.js";import u from"../../../webgl/RenderNode.js";import{HighlightApplyTechnique as d}from"./HighlightApplyTechnique.js";import{H as f}from"../../../../../chunks/HighlightBlur.glsl.js";import{HighlightBlurTechnique as p}from"./HighlightBlurTechnique.js";import{H as m,g as h}from"../../../../../chunks/HighlightDownsample.glsl.js";import{HighlightDownsampleTechnique as g}from"./HighlightDownsampleTechnique.js";import{HighlightPassParameters as _}from"./HighlightPassParameters.js";import{m as v}from"../../../../../chunks/HighlightSharpApply.glsl.js";import{HighlightSharpApplyTechnique as y}from"./HighlightSharpApplyTechnique.js";import{HighlightToSingleTechnique as b}from"./HighlightToSingleTechnique.js";import{Compositor as x}from"../../lib/Compositor.js";import{NoVertex as S}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as C}from"../../lib/VertexArrayObject.js";import{BufferObject as w}from"../../../../webgl/BufferObject.js";import{ColorAttachment0 as T,PrimitiveType as E,DataType as D}from"../../../../webgl/enums.js";import O from"../../../../webgl/Texture.js";import{TextureDescriptor as k}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as A}from"../../../../webgl/VertexBuffer.js";let j=class extends u{constructor(e){super(e),this.consumes={required:[l.HIGHLIGHT,`highlights`]},this.produces=l.HIGHLIGHT,this._renderSharpHighlights=(e,t,n)=>{let{techniques:r}=this,i=r.getCompiled(y);if(!i||!this._compositor.isPremultipliedAlphaReady(!1))return!1;let a=this._prepareAndDownSample(t),{fullWidth:o,fullHeight:s,pixelRatio:c,fullViewport:l}=this.bindParameters.camera,u=this.fboCache.acquire(o,s,`highlight overlay`,5);this._clearHighlightOverlay(u),this._passParameters.pixelRatio=Math.min(c,v);let{renderingContext:d,bindParameters:f,_passParameters:p}=this,m=this.view.stage.renderView.renderer;for(let e=0;e<n.length;++e){let{name:t}=n[e];m.hasHighlight(t)&&(p.highlightLevel=e,d.bindFramebuffer(u.fbo),d.setViewport4fv(f.camera.fullViewport),d.bindTechnique(i,f,p),this._renderGrid(a))}let h=this.antialias.isEnabled()?this.antialias.renderTo(u,`highlight antialiasing`,{coverageTexture:a.coverage.getTexture(),horizontalCellCount:a.horizontalCellCount,verticalCellCount:a.verticalCellCount,draw:()=>this._renderGrid(a)}):u;h!==u&&u.release();let{_compositor:g}=this;return d.bindFramebuffer(e.fbo),d.setDrawBuffers([T]),d.setViewport4fv(l),g.compositePreMultipliedAlpha(this.bindParameters,h.getTexture(),!1),h.release(),!0},this._renderGaussianHighlights=(e,t,n)=>{let{renderingContext:r,bindParameters:i,fboCache:a,_passParameters:o,techniques:s}=this,l=s.getCompiled(b),u=s.getCompiled(p),f=s.getCompiled(d);if(!l||!u||!f)return!1;let m=this._prepareAndDownSample(t),{width:h,height:g}=t.descriptor,{fullWidth:_,fullHeight:v,pixelRatio:y,fullViewport:x}=i.camera,S=Math.ceil(_/y),C=Math.ceil(v/y),{_highlightBlurDrawParameters:w}=this,E=this.view.stage.renderView.renderer;for(let t=0;t<n.length;++t){let{name:s}=n[t];if(!E.hasHighlight(s))continue;o.highlightLevel=t,r.setClearColor(0,0,0,0);let d=a.acquire(h,g,`single highlight`,2);r.bindFramebuffer(d.fbo),r.setViewport(0,0,h,g),r.clear(16384),r.bindTechnique(l,i,o),this._renderGrid(m),w.blurInput=d.getTexture(),c(w.blurSize,1/S,0);let p=a.acquire(S,C,`single highlight blur`,2);r.unbindTexture(p.fbo?.colorTexture),r.bindFramebuffer(p.fbo),r.setViewport(0,0,S,C),r.clear(16384),r.bindTechnique(u,i,o,w),this._renderGrid(m),d.release(),c(w.blurSize,0,1/C),o.highlightBlurTexture=p.getTexture(),r.bindFramebuffer(e.fbo),r.setDrawBuffers([T]),r.setViewport4fv(x),r.bindTechnique(f,i,o,w),this._renderGrid(m),p.release()}return!0},this._downsampleDrawParameters=new m,this._passParameters=new _,this._highlightBlurDrawParameters=new f,this._compositor=null,this._grid=new M}initialize(){this._compositor=new x(this.renderingContext,this.techniques),this.addHandles([i(()=>this._optionsData,e=>this._updateOptionsTexture(e),a)])}destroy(){this._grid.coverage=n(this._grid.coverage),this._grid.vao=r(this._grid.vao),this._passParameters.highlightOptionsTexture=n(this._passParameters.highlightOptionsTexture)}get _optionsData(){let e=new Uint8Array(128),n=0;for(let t of this.view.state.highlights){let r=n*4,i=n*4+64;++n;let{color:a}=t,o=t.haloColor??a;e[r+0]=a.r,e[r+1]=a.g,e[r+2]=a.b,e[r+3]=t.fillOpacity*a.a*255,e[i+0]=o.r,e[i+1]=o.g,e[i+2]=o.b,e[i+3]=t.haloOpacity*o.a*255}let r=this._get(`_optionsData`);return t(e,r)?r:e}_updateOptionsTexture(e){if(this._passParameters.highlightOptionsTexture==null){let e=new k(16,2);e.internalFormat=6408,e.samplingMode=9728,this._passParameters.highlightOptionsTexture=new O(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(e),this.requestRender(1)}render(e){let t=e.find(({name:e})=>e===l.HIGHLIGHT),{techniques:n,bindParameters:r,_passParameters:i}=this;if(!r.decorations)return t;if(!n.getCompiled(g))return this.requestRender(1),t;let a=this.view.stage.renderer.isFeatureEnabled(13),o=e.find(({name:e})=>e===`highlights`).getTexture(),s=a?this._renderSharpHighlights:this._renderGaussianHighlights,c=a?this._renderGaussianHighlights:this._renderSharpHighlights;return!s(t,o,r.highlights)&&(this.requestRender(1),!c(t,o,r.highlights))||(i.coverageTexture=null,i.highlightTexture=null),t}_clearHighlightOverlay(e){let{renderingContext:t}=this;t.bindFramebuffer(e.fbo),t.setViewport4fv(this.bindParameters.camera.fullViewport),t.setClearColor(0,0,0,0),t.clear(16384)}_prepareAndDownSample(e){this._passParameters.highlightTexture=e,this._gridUpdateResources(e);let t=this.techniques.get(g),n=this._gridComputeCoverage(t,e),{horizontalCellCount:r,verticalCellCount:i}=n,a=this._passParameters;return a.horizontalCellCount=r,a.verticalCellCount=i,a.coverageTexture=n.coverage?.getTexture(),n}_renderGrid(e){let t=e.verticalCellCount*e.horizontalCellCount;this.renderingContext.bindVAO(e.vao),this.renderingContext.drawElementsInstanced(E.TRIANGLES,6,D.UNSIGNED_BYTE,0,t)}_gridUpdateResources(e){let t=this._grid,{width:n,height:r}=e.descriptor;if(t.horizontalCellCount=Math.ceil(n/h),t.verticalCellCount=Math.ceil(r/h),t.vao)return;let i=this.renderingContext,a=w.createIndex(i,35044,F);t.vao=new C(i,new A(i,S),a)}_gridComputeCoverage(e,t){let n=this.renderingContext,r=this._grid,i=t.descriptor,a=Math.ceil(i.width/h),o=Math.ceil(i.height/h);this._downsampleDrawParameters.input=t;let{highlights:s}=this.bindParameters;r.coverage?.release();let c=this.fboCache.acquire(a,o,`highlight coverage`,s.length>L?3:1);return r.coverage=c,n.bindFramebuffer(c.fbo),n.bindTechnique(e,this.bindParameters,this._passParameters,this._downsampleDrawParameters),n.setViewport(0,0,a,o),n.screen.draw(),r}get test(){}};e([o()],j.prototype,`consumes`,void 0),e([o()],j.prototype,`produces`,void 0),e([o({constructOnly:!0})],j.prototype,`antialias`,void 0),e([o()],j.prototype,`_optionsData`,null),j=e([s(`esri.views.3d.webgl-engine.effects.highlight.Highlight`)],j);class M{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}let N=0;function P(e){let t=0;for(let n of e){let{name:e}=n;t+=e.length;let{color:r,fillOpacity:i,haloColor:a,haloOpacity:o}=n;t+=r.r+r.g+r.b+r.a+i,t+=a?a.r+a.g+a.b+a.a+o:0}let n=e.at(0);if(n){let{shadowOpacity:e,shadowDifference:r,shadowColor:i}=n;t+=e+r+i.r+i.g+i.b+i.a}return N+++(t>=0?0:1)}const F=new Uint8Array([0,1,2,2,1,3]);function I(e,t,n,r,i,a,o=0){let{highlights:s}=i,l=s.length>1?t.acquire(n,r,`highlight mix`,s.length>L?3:1):null,{gl:u}=e;if(l){let t=e.boundFramebuffer;e.bindFramebuffer(l.fbo),u.clearBufferuiv(u.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}let d=l?.getTexture();i.highlightMixTexture=d,c(i.highlightMixOrigin,o,0),s.forEach((t,s)=>{if(s>0){let t=O.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(d,t),e.setActiveTexture(t),u.copyTexSubImage2D(3553,0,0,0,o,0,n,r),e.bindTexture(null,t)}e.clear(256),i.highlightLevel=s,a()}),i.highlightLevel=null,i.highlightMixTexture=null,l?.release()}const L=4;export{j as Highlight,L as maxHighlightsPerChannel,I as renderHighlightBuffer,P as trackHighlightOptions};
2
+ import{__decorate as e}from"tslib";import{equals as t}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{releaseMaybe as n,disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,initial as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{set as c}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as l}from"../../../webgl.js";import u from"../../../webgl/RenderNode.js";import{HighlightApplyTechnique as d}from"./HighlightApplyTechnique.js";import{H as f}from"../../../../../chunks/HighlightBlur.glsl.js";import{HighlightBlurTechnique as p}from"./HighlightBlurTechnique.js";import{H as m,g as h}from"../../../../../chunks/HighlightDownsample.glsl.js";import{HighlightDownsampleTechnique as g}from"./HighlightDownsampleTechnique.js";import{HighlightPassParameters as _}from"./HighlightPassParameters.js";import{m as v}from"../../../../../chunks/HighlightSharpApply.glsl.js";import{HighlightSharpApplyTechnique as y}from"./HighlightSharpApplyTechnique.js";import{HighlightToSingleTechnique as b}from"./HighlightToSingleTechnique.js";import{Compositor as x}from"../../lib/Compositor.js";import{NoVertex as S}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as C}from"../../lib/VertexArrayObject.js";import{BufferObject as w}from"../../../../webgl/BufferObject.js";import{ColorAttachment0 as T,PrimitiveType as E,DataType as D}from"../../../../webgl/enums.js";import{Texture as O}from"../../../../webgl/Texture.js";import{TextureDescriptor as k}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as A}from"../../../../webgl/VertexBuffer.js";let j=class extends u{constructor(e){super(e),this.consumes={required:[l.HIGHLIGHT,`highlights`]},this.produces=l.HIGHLIGHT,this._renderSharpHighlights=(e,t,n)=>{let{techniques:r}=this,i=r.getCompiled(y);if(!i||!this._compositor.isPremultipliedAlphaReady(!1))return!1;let a=this._prepareAndDownSample(t),{fullWidth:o,fullHeight:s,pixelRatio:c,fullViewport:l}=this.bindParameters.camera,u=this.fboCache.acquire(o,s,`highlight overlay`,5);this._clearHighlightOverlay(u),this._passParameters.pixelRatio=Math.min(c,v);let{renderingContext:d,bindParameters:f,_passParameters:p}=this,m=this.view.stage.renderView.renderer;for(let e=0;e<n.length;++e){let{name:t}=n[e];m.hasHighlight(t)&&(p.highlightLevel=e,d.bindFramebuffer(u.fbo),d.setViewport4fv(f.camera.fullViewport),d.bindTechnique(i,f,p),this._renderGrid(a))}let h=this.antialias.isEnabled()?this.antialias.renderTo(u,`highlight antialiasing`,{coverageTexture:a.coverage.getTexture(),horizontalCellCount:a.horizontalCellCount,verticalCellCount:a.verticalCellCount,draw:()=>this._renderGrid(a)}):u;h!==u&&u.release();let{_compositor:g}=this;return d.bindFramebuffer(e.fbo),d.setDrawBuffers([T]),d.setViewport4fv(l),g.compositePreMultipliedAlpha(this.bindParameters,h.getTexture(),!1),h.release(),!0},this._renderGaussianHighlights=(e,t,n)=>{let{renderingContext:r,bindParameters:i,fboCache:a,_passParameters:o,techniques:s}=this,l=s.getCompiled(b),u=s.getCompiled(p),f=s.getCompiled(d);if(!l||!u||!f)return!1;let m=this._prepareAndDownSample(t),{width:h,height:g}=t.descriptor,{fullWidth:_,fullHeight:v,pixelRatio:y,fullViewport:x}=i.camera,S=Math.ceil(_/y),C=Math.ceil(v/y),{_highlightBlurDrawParameters:w}=this,E=this.view.stage.renderView.renderer;for(let t=0;t<n.length;++t){let{name:s}=n[t];if(!E.hasHighlight(s))continue;o.highlightLevel=t,r.setClearColor(0,0,0,0);let d=a.acquire(h,g,`single highlight`,2);r.bindFramebuffer(d.fbo),r.setViewport(0,0,h,g),r.clear(16384),r.bindTechnique(l,i,o),this._renderGrid(m),w.blurInput=d.getTexture(),c(w.blurSize,1/S,0);let p=a.acquire(S,C,`single highlight blur`,2);r.unbindTexture(p.fbo?.colorTexture),r.bindFramebuffer(p.fbo),r.setViewport(0,0,S,C),r.clear(16384),r.bindTechnique(u,i,o,w),this._renderGrid(m),d.release(),c(w.blurSize,0,1/C),o.highlightBlurTexture=p.getTexture(),r.bindFramebuffer(e.fbo),r.setDrawBuffers([T]),r.setViewport4fv(x),r.bindTechnique(f,i,o,w),this._renderGrid(m),p.release()}return!0},this._downsampleDrawParameters=new m,this._passParameters=new _,this._highlightBlurDrawParameters=new f,this._compositor=null,this._grid=new M}initialize(){this._compositor=new x(this.renderingContext,this.techniques),this.addHandles([i(()=>this._optionsData,e=>this._updateOptionsTexture(e),a)])}destroy(){this._grid.coverage=n(this._grid.coverage),this._grid.vao=r(this._grid.vao),this._passParameters.highlightOptionsTexture=n(this._passParameters.highlightOptionsTexture)}get _optionsData(){let e=new Uint8Array(128),n=0;for(let t of this.view.state.highlights){let r=n*4,i=n*4+64;++n;let{color:a}=t,o=t.haloColor??a;e[r+0]=a.r,e[r+1]=a.g,e[r+2]=a.b,e[r+3]=t.fillOpacity*a.a*255,e[i+0]=o.r,e[i+1]=o.g,e[i+2]=o.b,e[i+3]=t.haloOpacity*o.a*255}let r=this._get(`_optionsData`);return t(e,r)?r:e}_updateOptionsTexture(e){if(this._passParameters.highlightOptionsTexture==null){let e=new k(16,2);e.internalFormat=6408,e.samplingMode=9728,this._passParameters.highlightOptionsTexture=new O(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(e),this.requestRender(1)}render(e){let t=e.find(({name:e})=>e===l.HIGHLIGHT),{techniques:n,bindParameters:r,_passParameters:i}=this;if(!r.decorations)return t;if(!n.getCompiled(g))return this.requestRender(1),t;let a=this.view.stage.renderer.isFeatureEnabled(13),o=e.find(({name:e})=>e===`highlights`).getTexture(),s=a?this._renderSharpHighlights:this._renderGaussianHighlights,c=a?this._renderGaussianHighlights:this._renderSharpHighlights;return!s(t,o,r.highlights)&&(this.requestRender(1),!c(t,o,r.highlights))||(i.coverageTexture=null,i.highlightTexture=null),t}_clearHighlightOverlay(e){let{renderingContext:t}=this;t.bindFramebuffer(e.fbo),t.setViewport4fv(this.bindParameters.camera.fullViewport),t.setClearColor(0,0,0,0),t.clear(16384)}_prepareAndDownSample(e){this._passParameters.highlightTexture=e,this._gridUpdateResources(e);let t=this.techniques.get(g),n=this._gridComputeCoverage(t,e),{horizontalCellCount:r,verticalCellCount:i}=n,a=this._passParameters;return a.horizontalCellCount=r,a.verticalCellCount=i,a.coverageTexture=n.coverage?.getTexture(),n}_renderGrid(e){let t=e.verticalCellCount*e.horizontalCellCount;this.renderingContext.bindVAO(e.vao),this.renderingContext.drawElementsInstanced(E.TRIANGLES,6,D.UNSIGNED_BYTE,0,t)}_gridUpdateResources(e){let t=this._grid,{width:n,height:r}=e.descriptor;if(t.horizontalCellCount=Math.ceil(n/h),t.verticalCellCount=Math.ceil(r/h),t.vao)return;let i=this.renderingContext,a=w.createIndex(i,35044,N);t.vao=new C(i,new A(i,S),a)}_gridComputeCoverage(e,t){let n=this.renderingContext,r=this._grid,i=t.descriptor,a=Math.ceil(i.width/h),o=Math.ceil(i.height/h);this._downsampleDrawParameters.input=t;let{highlights:s}=this.bindParameters;r.coverage?.release();let c=this.fboCache.acquire(a,o,`highlight coverage`,s.length>F?3:1);return r.coverage=c,n.bindFramebuffer(c.fbo),n.bindTechnique(e,this.bindParameters,this._passParameters,this._downsampleDrawParameters),n.setViewport(0,0,a,o),n.screen.draw(),r}get test(){}};e([o()],j.prototype,`consumes`,void 0),e([o()],j.prototype,`produces`,void 0),e([o({constructOnly:!0})],j.prototype,`antialias`,void 0),e([o()],j.prototype,`_optionsData`,null),j=e([s(`esri.views.3d.webgl-engine.effects.highlight.Highlight`)],j);class M{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}const N=new Uint8Array([0,1,2,2,1,3]);function P(e,t,n,r,i,a,o=0){let{highlights:s}=i,l=s.length>1?t.acquire(n,r,`highlight mix`,s.length>F?3:1):null,{gl:u}=e;if(l){let t=e.boundFramebuffer;e.bindFramebuffer(l.fbo),u.clearBufferuiv(u.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}let d=l?.getTexture();i.highlightMixTexture=d,c(i.highlightMixOrigin,o,0),s.forEach((t,s)=>{if(s>0){let t=O.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(d,t),e.setActiveTexture(t),u.copyTexSubImage2D(3553,0,0,0,o,0,n,r),e.bindTexture(null,t)}e.clear(256),i.highlightLevel=s,a()}),i.highlightLevel=null,i.highlightMixTexture=null,l?.release()}const F=4;export{j as Highlight,F as maxHighlightsPerChannel,P as renderHighlightBuffer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{createTask as t}from"../../../../../core/asyncUtils.js";import{clamp as n}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{createScreenPointArray as o,createRenderScreenPointArray as s,screenPointObjectToArray as c}from"../../../../../core/screenUtils.js";import{isSVG as l}from"../../../../../core/urlUtils.js";import{property as u,subclass as d}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as f}from"../../../../../request/image.js";import{InternalRenderCategory as p}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{M as h}from"../../../../../chunks/Magnifier.glsl.js";import{MagnifierTechnique as g}from"./MagnifierTechnique.js";import{createQuadVAO as _}from"../../lib/glUtil3D.js";import{loadMagnifierResources as v}from"../../../../magnifier/resources.js";import{ColorAttachment0 as y,PrimitiveType as b}from"../../../../webgl/enums.js";import x from"../../../../webgl/Texture.js";import{TextureDescriptor as S}from"../../../../webgl/TextureDescriptor.js";let C=class extends m{constructor(){super(...arguments),this.consumes={required:[p.MAGNIFIER]},this.produces=p.MAGNIFIER,this._imageSources=null,this._imageLoadTask=null,this._passParameters=new h,this._magnifier=null,this._tmpScreenPoint=o(),this._tmpRenderPoint=s()}initialize(){this.addHandles([i(()=>this.view.magnifier,e=>this._update(e),a)])}_update(e){if(e===this._magnifier)return;this.removeAllHandles(),this._magnifier=e;let t=()=>{let e=this._validMagnifier;e?(this._loadResources(e),this.produces=p.MAGNIFIER):this.produces=`disabled`,this.requestRender()};this._magnifier&&this.addHandles(i(()=>this._magnifier?.version,t)),t()}get _validMagnifier(){return this._magnifier?.visible&&this._magnifier?.position&&this._magnifier?.size>0?this._magnifier:null}get _factor(){return this._magnifier?.factor||1}destroy(){this._magnifier=null,this._imageLoadTask!=null&&(this._imageLoadTask.task.abort(),this._imageLoadTask=null),this._disposeTextures(),this._vao=r(this._vao)}_disposeTextures(){this._passParameters.mask=r(this._passParameters.mask),this._passParameters.overlay=r(this._passParameters.overlay),this._passParameters.input=r(this._passParameters.input)}render(){let e=this._validMagnifier,t=this.input;if(e==null)return t;if(this._imageSources==null)return this.requestRender(1),t;let r=this.renderingContext,i=this.camera.pixelRatio,a=Math.ceil(i*e.size);this._vao??=_(r,0,0,1);let o=this.techniques.getCompiled(g);if(this._ensureTextureResources(r,a),!o||!this._passParameters.input)return this.requestRender(1),t;let s=Math.ceil(1/this._factor*a),l=this._passParameters.input;l.resize(s,s),c(e.position,this._tmpScreenPoint);let u=this.camera.screenToRender(this._tmpScreenPoint,this._tmpRenderPoint),d=this.camera.fullWidth,f=this.camera.fullHeight,p=.5*s,m=.5*s;u[0]=n(u[0],p,d-p-1),u[1]=n(u[1],m,f-m-1);let h=Math.floor(u[0]-p),v=Math.floor(u[1]-m);return r.bindFramebuffer(t.fbo),o.program.bindTexture(`textureInput`,l),r.gl.copyTexImage2D(l.descriptor.target,0,l.descriptor.pixelFormat,h,v,s,s,0),this._passParameters.magnifier=e,r.bindTechnique(o,this.bindParameters,this._passParameters),r.setDrawBuffers([y]),r.bindVAO(this._vao),r.drawArrays(b.TRIANGLE_STRIP,0,4),t}_loadResources(e){let{maskUrl:n,overlayUrl:r}=e;(this._imageLoadTask?.maskUrl!==n||this._imageLoadTask?.overlayUrl!==r)&&(this._imageLoadTask?.task.abort(),this._imageLoadTask=this._imageSources=null),this._imageSources||this._imageLoadTask||(this._imageLoadTask={maskUrl:n,overlayUrl:r,task:t(async e=>{let t=n==null||r==null?v(e):null,i=n==null?t.then(e=>e.mask):f(n,{signal:e}),a=r==null?t.then(e=>e.overlay):f(r,{signal:e});this._imageSources={mask:await i,overlay:await a}})})}_ensureTextureResources(e,t){this._imageSources==null||this._passParameters.size===t&&this._passParameters.input&&this._passParameters.mask&&this._passParameters.overlay||(this._disposeTextures(),this._imageSources.overlay.width=this._imageSources.mask.width=t,this._imageSources.overlay.height=this._imageSources.mask.height=t,this._passParameters.overlay=new x(e,this._createTextureDescriptor(t,6408,this._imageSources.overlay),this._imageSources.overlay),this._passParameters.mask=new x(e,this._createTextureDescriptor(t,6406,this._imageSources.mask),this._imageSources.mask),this._passParameters.input=new x(e,this._createTextureDescriptor(t,6408,null)))}_createTextureDescriptor(e,t,n){let r=this.renderingContext,i=new S(e);return i.pixelFormat=i.internalFormat=t,i.wrapMode=33071,i.flipped=!!n,i.preMultiplyAlpha=!(t!==6408||!n||l(n.src)&&r.driverTest.svgPremultipliesAlpha.result),i}};e([u()],C.prototype,`consumes`,void 0),e([u()],C.prototype,`produces`,void 0),e([u()],C.prototype,`_imageSources`,void 0),e([u()],C.prototype,`_imageLoadTask`,void 0),C=e([d(`esri.views.3d.webgl-engine.effects.magnifier.Magnifier`)],C);export{C as Magnifier};
2
+ import{__decorate as e}from"tslib";import{createTask as t}from"../../../../../core/asyncUtils.js";import{clamp as n}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{createScreenPointArray as o,createRenderScreenPointArray as s,screenPointObjectToArray as c}from"../../../../../core/screenUtils.js";import{isSVG as l}from"../../../../../core/urlUtils.js";import{property as u,subclass as d}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as f}from"../../../../../request/image.js";import{InternalRenderCategory as p}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{M as h}from"../../../../../chunks/Magnifier.glsl.js";import{MagnifierTechnique as g}from"./MagnifierTechnique.js";import{createQuadVAO as _}from"../../lib/glUtil3D.js";import{loadMagnifierResources as v}from"../../../../magnifier/resources.js";import{ColorAttachment0 as y,PrimitiveType as b}from"../../../../webgl/enums.js";import{Texture as x}from"../../../../webgl/Texture.js";import{TextureDescriptor as S}from"../../../../webgl/TextureDescriptor.js";let C=class extends m{constructor(){super(...arguments),this.consumes={required:[p.MAGNIFIER]},this.produces=p.MAGNIFIER,this._imageSources=null,this._imageLoadTask=null,this._passParameters=new h,this._magnifier=null,this._tmpScreenPoint=o(),this._tmpRenderPoint=s()}initialize(){this.addHandles([i(()=>this.view.magnifier,e=>this._update(e),a)])}_update(e){if(e===this._magnifier)return;this.removeAllHandles(),this._magnifier=e;let t=()=>{let e=this._validMagnifier;e?(this._loadResources(e),this.produces=p.MAGNIFIER):this.produces=`disabled`,this.requestRender()};this._magnifier&&this.addHandles(i(()=>this._magnifier?.version,t)),t()}get _validMagnifier(){return this._magnifier?.visible&&this._magnifier?.position&&this._magnifier?.size>0?this._magnifier:null}get _factor(){return this._magnifier?.factor||1}destroy(){this._magnifier=null,this._imageLoadTask!=null&&(this._imageLoadTask.task.abort(),this._imageLoadTask=null),this._disposeTextures(),this._vao=r(this._vao)}_disposeTextures(){this._passParameters.mask=r(this._passParameters.mask),this._passParameters.overlay=r(this._passParameters.overlay),this._passParameters.input=r(this._passParameters.input)}render(){let e=this._validMagnifier,t=this.input;if(e==null)return t;if(this._imageSources==null)return this.requestRender(1),t;let r=this.renderingContext,i=this.camera.pixelRatio,a=Math.ceil(i*e.size);this._vao??=_(r,0,0,1);let o=this.techniques.getCompiled(g);if(this._ensureTextureResources(r,a),!o||!this._passParameters.input)return this.requestRender(1),t;let s=Math.ceil(1/this._factor*a),l=this._passParameters.input;l.resize(s,s),c(e.position,this._tmpScreenPoint);let u=this.camera.screenToRender(this._tmpScreenPoint,this._tmpRenderPoint),d=this.camera.fullWidth,f=this.camera.fullHeight,p=.5*s,m=.5*s;u[0]=n(u[0],p,d-p-1),u[1]=n(u[1],m,f-m-1);let h=Math.floor(u[0]-p),v=Math.floor(u[1]-m);return r.bindFramebuffer(t.fbo),o.program.bindTexture(`textureInput`,l),r.gl.copyTexImage2D(l.descriptor.target,0,l.descriptor.pixelFormat,h,v,s,s,0),this._passParameters.magnifier=e,r.bindTechnique(o,this.bindParameters,this._passParameters),r.setDrawBuffers([y]),r.bindVAO(this._vao),r.drawArrays(b.TRIANGLE_STRIP,0,4),t}_loadResources(e){let{maskUrl:n,overlayUrl:r}=e;(this._imageLoadTask?.maskUrl!==n||this._imageLoadTask?.overlayUrl!==r)&&(this._imageLoadTask?.task.abort(),this._imageLoadTask=this._imageSources=null),this._imageSources||this._imageLoadTask||(this._imageLoadTask={maskUrl:n,overlayUrl:r,task:t(async e=>{let t=n==null||r==null?v(e):null,i=n==null?t.then(e=>e.mask):f(n,{signal:e}),a=r==null?t.then(e=>e.overlay):f(r,{signal:e});this._imageSources={mask:await i,overlay:await a}})})}_ensureTextureResources(e,t){this._imageSources==null||this._passParameters.size===t&&this._passParameters.input&&this._passParameters.mask&&this._passParameters.overlay||(this._disposeTextures(),this._imageSources.overlay.width=this._imageSources.mask.width=t,this._imageSources.overlay.height=this._imageSources.mask.height=t,this._passParameters.overlay=new x(e,this._createTextureDescriptor(t,6408,this._imageSources.overlay),this._imageSources.overlay),this._passParameters.mask=new x(e,this._createTextureDescriptor(t,6406,this._imageSources.mask),this._imageSources.mask),this._passParameters.input=new x(e,this._createTextureDescriptor(t,6408,null)))}_createTextureDescriptor(e,t,n){let r=this.renderingContext,i=new S(e);return i.pixelFormat=i.internalFormat=t,i.wrapMode=33071,i.flipped=!!n,i.preMultiplyAlpha=!(t!==6408||!n||l(n.src)&&r.driverTest.svgPremultipliesAlpha.result),i}};e([u()],C.prototype,`consumes`,void 0),e([u()],C.prototype,`produces`,void 0),e([u()],C.prototype,`_imageSources`,void 0),e([u()],C.prototype,`_imageLoadTask`,void 0),C=e([d(`esri.views.3d.webgl-engine.effects.magnifier.Magnifier`)],C);export{C as Magnifier};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../../core/Logger.js";import{abortMaybe as n,disposeMaybe as r}from"../../../../../core/maybe.js";import{throwIfAborted as i,isAbortError as a}from"../../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as u}from"../../../../../request/image.js";import{InternalRenderCategory as d}from"../../../webgl.js";import f from"../../../webgl/RenderNode.js";import{SMAABlendWeightsTechnique as p}from"./SMAABlendWeightsTechnique.js";import{SMAABlurTechnique as m}from"./SMAABlurTechnique.js";import{SMAAEdgeDetectTechnique as h}from"./SMAAEdgeDetectTechnique.js";import{SMAAPassParameters as g}from"./SMAAPassParameters.js";import{SMAATechniqueConfiguration as _}from"./SMAATechniqueConfiguration.js";import v from"../../../../webgl/Texture.js";import{TextureDescriptor as y}from"../../../../webgl/TextureDescriptor.js";let b=class extends f{constructor(e){super(e),this.consumes={required:[d.ANTIALIASING]},this.produces=`disabled`,this._areaTexture=null,this._searchTexture=null,this._configuration=new _,this._smaaParameters=new g}initialize(){this.addHandles([o(()=>this.isEnabled(),e=>e?this.view.addUpdatingPromise(this.enable()):this.disable(),s)])}async enable(){if(this.destroyed||(this.produces=d.ANTIALIASING,this.requestRender(1),this._abortController||this._areaTexture&&this._searchTexture))return;this._abortController=new AbortController;let e=this._abortController.signal;try{let t=await import(`./SMAAData.js`);i(e),await this._loadTextures(t,e),i(e),this.requestRender(1)}catch(e){a(e)||t.getLogger(this).errorOnce(e)}this._abortController=null}async _loadTextures(e,t){i(t);let[n,r]=await Promise.allSettled([u(e.areaTexture,{signal:t}),u(e.searchTexure,{signal:t})]);if(i(t),n.status!==`fulfilled`||r.status!==`fulfilled`)return;let a=this.renderingContext;this._areaTexture=x(a,9729,6407,n.value),this._searchTexture=x(a,9728,6409,r.value)}disable(){this.produces=`disabled`,this.requestRender(1)}destroy(){this._abortController=n(this._abortController),this._searchTexture=r(this._searchTexture),this._areaTexture=r(this._areaTexture)}render(){return this.renderTo(this.input,d.ANTIALIASING)}renderTo(e,t,n){this._configuration.useHighlightGrid=n!=null;let r=this.techniques.getCompiled(h,this._configuration),i=this.techniques.getCompiled(p,this._configuration),a=this.techniques.getCompiled(m,this._configuration);if(!this._areaTexture||!this._searchTexture||!r||!i||!a)return this.requestRender(1),e;let{width:o,height:s}=e.fbo,c=this.renderingContext,l=this._smaaParameters;l.highlightTexture=e.getTexture(),l.coverageTexture=n?.coverageTexture,l.horizontalCellCount=n?.horizontalCellCount??0,l.verticalCellCount=n?.verticalCellCount??0,c.setViewport(0,0,o,s);let u=this.fboCache.acquire(o,s,`smaa edges`,2);c.bindFramebuffer(u.fbo),c.setClearColor(0,0,0,1),c.clear(16384),l.color=e.getTexture();let d=this.bindParameters;c.bindTechnique(r,d,l),n?n.draw():c.screen.draw();let f=this.fboCache.acquire(o,s,`smaa blend`);c.bindFramebuffer(f.fbo),c.setClearColor(0,0,1,1),c.clear(16384),l.inputTexture=u.getTexture(),l.areaTexture=this._areaTexture,l.searchTexture=this._searchTexture,c.bindTechnique(i,d,l),n?n.draw():c.screen.draw(),u.release();let g=this.fboCache.acquire(o,s,t);return c.bindFramebuffer(g.fbo),c.setClearColor(0,+!n,0,+!n),c.clear(16384),l.inputTexture=f.getTexture(),c.bindTechnique(a,d,l),n?n.draw():c.screen.draw(),f.release(),g.moveAttachments(e),l.highlightTexture=null,l.coverageTexture=null,g}};e([c()],b.prototype,`consumes`,void 0),e([c()],b.prototype,`produces`,void 0),e([c({constructOnly:!0})],b.prototype,`isEnabled`,void 0),e([c()],b.prototype,`_abortController`,void 0),b=e([l(`esri.views.3d.webgl-engine.effects.smaa.SMAA`)],b);function x(e,t,n,r){let i=new y(r.width,r.height);return i.pixelFormat=n,i.wrapMode=33071,i.samplingMode=t,new v(e,i,r)}export{b as SMAA};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Logger.js";import{abortMaybe as n,disposeMaybe as r}from"../../../../../core/maybe.js";import{throwIfAborted as i,isAbortError as a}from"../../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as u}from"../../../../../request/image.js";import{InternalRenderCategory as d}from"../../../webgl.js";import f from"../../../webgl/RenderNode.js";import{SMAABlendWeightsTechnique as p}from"./SMAABlendWeightsTechnique.js";import{SMAABlurTechnique as m}from"./SMAABlurTechnique.js";import{SMAAEdgeDetectTechnique as h}from"./SMAAEdgeDetectTechnique.js";import{SMAAPassParameters as g}from"./SMAAPassParameters.js";import{SMAATechniqueConfiguration as _}from"./SMAATechniqueConfiguration.js";import{Texture as v}from"../../../../webgl/Texture.js";import{TextureDescriptor as y}from"../../../../webgl/TextureDescriptor.js";let b=class extends f{constructor(e){super(e),this.consumes={required:[d.ANTIALIASING]},this.produces=`disabled`,this._areaTexture=null,this._searchTexture=null,this._configuration=new _,this._smaaParameters=new g}initialize(){this.addHandles([o(()=>this.isEnabled(),e=>e?this.view.addUpdatingPromise(this.enable()):this.disable(),s)])}async enable(){if(this.destroyed||(this.produces=d.ANTIALIASING,this.requestRender(1),this._abortController||this._areaTexture&&this._searchTexture))return;this._abortController=new AbortController;let e=this._abortController.signal;try{let t=await import(`./SMAAData.js`);i(e),await this._loadTextures(t,e),i(e),this.requestRender(1)}catch(e){a(e)||t.getLogger(this).errorOnce(e)}this._abortController=null}async _loadTextures(e,t){i(t);let[n,r]=await Promise.allSettled([u(e.areaTexture,{signal:t}),u(e.searchTexure,{signal:t})]);if(i(t),n.status!==`fulfilled`||r.status!==`fulfilled`)return;let a=this.renderingContext;this._areaTexture=x(a,9729,6407,n.value),this._searchTexture=x(a,9728,6409,r.value)}disable(){this.produces=`disabled`,this.requestRender(1)}destroy(){this._abortController=n(this._abortController),this._searchTexture=r(this._searchTexture),this._areaTexture=r(this._areaTexture)}render(){return this.renderTo(this.input,d.ANTIALIASING)}renderTo(e,t,n){this._configuration.useHighlightGrid=n!=null;let r=this.techniques.getCompiled(h,this._configuration),i=this.techniques.getCompiled(p,this._configuration),a=this.techniques.getCompiled(m,this._configuration);if(!this._areaTexture||!this._searchTexture||!r||!i||!a)return this.requestRender(1),e;let{width:o,height:s}=e.fbo,c=this.renderingContext,l=this._smaaParameters;l.highlightTexture=e.getTexture(),l.coverageTexture=n?.coverageTexture,l.horizontalCellCount=n?.horizontalCellCount??0,l.verticalCellCount=n?.verticalCellCount??0,c.setViewport(0,0,o,s);let u=this.fboCache.acquire(o,s,`smaa edges`,2);c.bindFramebuffer(u.fbo),c.setClearColor(0,0,0,1),c.clear(16384),l.color=e.getTexture();let d=this.bindParameters;c.bindTechnique(r,d,l),n?n.draw():c.screen.draw();let f=this.fboCache.acquire(o,s,`smaa blend`);c.bindFramebuffer(f.fbo),c.setClearColor(0,0,1,1),c.clear(16384),l.inputTexture=u.getTexture(),l.areaTexture=this._areaTexture,l.searchTexture=this._searchTexture,c.bindTechnique(i,d,l),n?n.draw():c.screen.draw(),u.release();let g=this.fboCache.acquire(o,s,t);return c.bindFramebuffer(g.fbo),c.setClearColor(0,+!n,0,+!n),c.clear(16384),l.inputTexture=f.getTexture(),c.bindTechnique(a,d,l),n?n.draw():c.screen.draw(),f.release(),g.moveAttachments(e),l.highlightTexture=null,l.coverageTexture=null,g}};e([c()],b.prototype,`consumes`,void 0),e([c()],b.prototype,`produces`,void 0),e([c({constructOnly:!0})],b.prototype,`isEnabled`,void 0),e([c()],b.prototype,`_abortController`,void 0),b=e([l(`esri.views.3d.webgl-engine.effects.smaa.SMAA`)],b);function x(e,t,n,r){let i=new y(r.width,r.height);return i.pixelFormat=n,i.wrapMode=33071,i.samplingMode=t,new v(e,i,r)}export{b as SMAA};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{clamp as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as n}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{Milliseconds as a}from"../../../../../core/time.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as s}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as c}from"../../../webgl.js";import{distanceFadeEnd as l,distanceFadeStart as u}from"../../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{AmbientIllumination as d}from"../AmbientIllumination.js";import{g as f}from"../../../../../chunks/SSAO.glsl.js";import{SSAOBlurTechnique as p}from"./SSAOBlurTechnique.js";import{noiseData as m}from"./SSAONoiseData.js";import{SSAOPassParameters as h,BlurDrawParameters as g}from"./SSAOParameters.js";import{SSAOTechnique as _}from"./SSAOTechnique.js";import{DepthStencilAttachment as v}from"../../../../webgl/enums.js";import y from"../../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../../webgl/TextureDescriptor.js";const x=2;let S=class extends d{constructor(e){super(e),this._enableTime=a(0),this._passParameters=new h,this._drawParameters=new g}initialize(){let e=Uint8Array.from(atob(m),e=>e.charCodeAt(0)),t=new b(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new y(this.renderingContext,t,e),this.addHandles(r(()=>this._useSSAO,e=>{this._enableTime=a(0),e?this._enable():this._disable()},i))}destroy(){this._passParameters.noiseTexture=n(this._passParameters.noiseTexture)}render(e){let n=e.find(({name:e})=>e===`normals`),r=n?.getTexture(),i=n?.getTexture(v);if(!r||!i)return;let o=this.techniques.getCompiled(_),d=this.techniques.getCompiled(p);if(!o||!d){this._enableTime=a(performance.now()),this.requestRender(1);return}this._enableTime===0&&(this._enableTime=a(performance.now()));let m=this.renderingContext,h=this.view.qualitySettings.fadeDuration,g=this.bindParameters,y=g.camera,b=y.relativeElevation,x=t((l-b)/(l-u),0,1),S=h>0?Math.min(h,performance.now()-this._enableTime)/h:1,w=S*x;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/y.computeScreenPixelSizeAtDistance(1),this._passParameters.intensity=4*C/f(y)**6*w;let T=y.fullViewport[2],E=y.fullViewport[3],D=this.fboCache.acquire(T,E,`ssao input`,2);m.bindFramebuffer(D.fbo),m.setViewport(0,0,T,E),m.bindTechnique(o,g,this._passParameters,this._drawParameters),m.screen.draw();let O=Math.round(T/2),k=Math.round(E/2),A=this.fboCache.acquire(O,k,`ssao blur`,0);m.bindFramebuffer(A.fbo),this._drawParameters.colorTexture=D.getTexture(),s(this._drawParameters.blurSize,0,2/E),m.bindTechnique(d,g,this._passParameters,this._drawParameters),m.setViewport(0,0,O,k),m.screen.draw(),D.release();let j=this.fboCache.acquire(O,k,c.AMBIENT_ILLUMINATION,0);return m.bindFramebuffer(j.fbo),m.setViewport(0,0,T,E),m.setClearColor(1,1,1,0),m.clear(16384),this._drawParameters.colorTexture=A.getTexture(),s(this._drawParameters.blurSize,2/T,0),m.bindTechnique(d,g,this._passParameters,this._drawParameters),m.setViewport(0,0,O,k),m.screen.draw(),m.setViewport4fv(y.fullViewport),A.release(),S<1&&this.requestRender(2),j}};S=e([o(`esri.views.3d.webgl-engine.effects.ssao.SSAO`)],S);const C=.5;export{S as SSAO,x as blurSizePixels};
2
+ import{__decorate as e}from"tslib";import{clamp as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as n}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{Milliseconds as a}from"../../../../../core/time.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as s}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as c}from"../../../webgl.js";import{distanceFadeEnd as l,distanceFadeStart as u}from"../../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{AmbientIllumination as d}from"../AmbientIllumination.js";import{g as f}from"../../../../../chunks/SSAO.glsl.js";import{SSAOBlurTechnique as p}from"./SSAOBlurTechnique.js";import{noiseData as m}from"./SSAONoiseData.js";import{SSAOPassParameters as h,BlurDrawParameters as g}from"./SSAOParameters.js";import{SSAOTechnique as _}from"./SSAOTechnique.js";import{DepthStencilAttachment as v}from"../../../../webgl/enums.js";import{Texture as y}from"../../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../../webgl/TextureDescriptor.js";const x=2;let S=class extends d{constructor(e){super(e),this._enableTime=a(0),this._passParameters=new h,this._drawParameters=new g}initialize(){let e=Uint8Array.from(atob(m),e=>e.charCodeAt(0)),t=new b(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new y(this.renderingContext,t,e),this.addHandles(r(()=>this._useSSAO,e=>{this._enableTime=a(0),e?this._enable():this._disable()},i))}destroy(){this._passParameters.noiseTexture=n(this._passParameters.noiseTexture)}render(e){let n=e.find(({name:e})=>e===`normals`),r=n?.getTexture(),i=n?.getTexture(v);if(!r||!i)return;let o=this.techniques.getCompiled(_),d=this.techniques.getCompiled(p);if(!o||!d){this._enableTime=a(performance.now()),this.requestRender(1);return}this._enableTime===0&&(this._enableTime=a(performance.now()));let m=this.renderingContext,h=this.view.qualitySettings.fadeDuration,g=this.bindParameters,y=g.camera,b=y.relativeElevation,x=t((l-b)/(l-u),0,1),S=h>0?Math.min(h,performance.now()-this._enableTime)/h:1,w=S*x;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/y.computeScreenPixelSizeAtDistance(1),this._passParameters.intensity=4*C/f(y)**6*w;let T=y.fullViewport[2],E=y.fullViewport[3],D=this.fboCache.acquire(T,E,`ssao input`,2);m.bindFramebuffer(D.fbo),m.setViewport(0,0,T,E),m.bindTechnique(o,g,this._passParameters,this._drawParameters),m.screen.draw();let O=Math.round(T/2),k=Math.round(E/2),A=this.fboCache.acquire(O,k,`ssao blur`,0);m.bindFramebuffer(A.fbo),this._drawParameters.colorTexture=D.getTexture(),s(this._drawParameters.blurSize,0,2/E),m.bindTechnique(d,g,this._passParameters,this._drawParameters),m.setViewport(0,0,O,k),m.screen.draw(),D.release();let j=this.fboCache.acquire(O,k,c.AMBIENT_ILLUMINATION,0);return m.bindFramebuffer(j.fbo),m.setViewport(0,0,T,E),m.setClearColor(1,1,1,0),m.clear(16384),this._drawParameters.colorTexture=A.getTexture(),s(this._drawParameters.blurSize,2/T,0),m.bindTechnique(d,g,this._passParameters,this._drawParameters),m.setViewport(0,0,O,k),m.screen.draw(),m.setViewport4fv(y.fullViewport),A.release(),S<1&&this.requestRender(2),j}};S=e([o(`esri.views.3d.webgl-engine.effects.ssao.SSAO`)],S);const C=.5;export{S as SSAO,x as blurSizePixels};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{fetchAsset as t}from"../../../../../assets.js";import{createTask as n}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Error.js";import i from"../../../../../core/Logger.js";import{abortMaybe as a,disposeMaybe as o}from"../../../../../core/maybe.js";import{isAbortError as s,throwIfAborted as c}from"../../../../../core/promiseUtils.js";import{watch as l,initial as u,syncAndInitial as d}from"../../../../../core/reactiveUtils.js";import{subclass as f}from"../../../../../core/accessorSupport/decorators.js";import{copy as p,rotateZ as m,multiply as h,invertOrIdentity as g}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{squaredLength as _}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{getReferenceEllipsoid as v}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as y}from"../../../webgl.js";import{glLayout as b}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as x}from"../OpaqueEnvironment.js";import{DeepSkyPassParameters as S,DeepSkyTechnique as C}from"./DeepSkyTechnique.js";import{StarPassParameters as w,StarsTechnique as T,layout as E}from"./StarsTechnique.js";import{getDailyRotationCoefficient as D,computeDayDuration as O,eq2ec as k,ec2eq as A}from"./starsUtils.js";import{VertexArrayObject as j}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as M,PrimitiveType as N}from"../../../../webgl/enums.js";import P from"../../../../webgl/Texture.js";import{TextureDescriptor as F}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as I}from"../../../../webgl/VertexBuffer.js";let L=class extends x{constructor(){super(...arguments),this._numPoints=0,this._passParameters=new w,this._deepSkyPassParameters=new S}initialize(){this.addHandles([l(()=>this.view.environment.starsEnabled,e=>e?this._enable():this._disable(),u),l(()=>this.view.environment.lighting.type===`virtual`?null:this.view.environment.lighting.date,e=>this._update(e),d)])}_enable(){super._enable(),this._bandTextureTask=this._createLoadBandTextureTask(),this._loadDataTask=this._createLoadDataTask()}get loading(){return!!this._loadDataTask&&!this._loadDataTask.finished||!!this._bandTextureTask&&!this._bandTextureTask.finished}destroy(){this._bandTextureTask=a(this._bandTextureTask),this._bandTexture=o(this._bandTexture),this._loadDataTask=a(this._loadDataTask),this._numPoints=0,this._vao=o(this._vao),this._starData=null}render(e){let t=e.find(({name:e})=>e===y.OPAQUE_ENVIRONMENT),n=this.techniques.getCompiled(T),r=this.techniques.getCompiled(C);if(this.loading||!n||!r)return this.requestRender(1),t;let i=this.renderingContext;return this._bandTexture&&(this._deepSkyPassParameters.bandTexture=this._bandTexture,this._deepSkyPassParameters.heightAboveSeaLevelSquared=_(this.bindParameters.camera.eye),i.bindTechnique(r,this.bindParameters,this._deepSkyPassParameters),i.setDrawBuffers([M]),i.screen.draw()),this._starData&&(this._vao??=this._ensureResources(this._starData),i.bindTechnique(n,this.bindParameters,this._passParameters),i.setDrawBuffers([M]),i.bindVAO(this._vao),i.drawArrays(N.POINTS,0,this._numPoints)),t}_ensureResources(e){this._numPoints=e.byteLength/G;let t=new Float32Array(e,0,this._numPoints*2),n=new Uint8Array(e,this._numPoints*2*4,this._numPoints);return R(this.renderingContext,t,n,this._numPoints)}_update(e){let t=v(this.view.spatialReference).radius,n=t*.05,r=t*.3;if(this._deepSkyPassParameters.radiusCloseToGround=(t+r)**2,this._deepSkyPassParameters.radiusBrightnessTransitionEnd=(t+r+n)**2,!e)return;let i=D(e),a=2*O(e),o=p(this._passParameters.modelMatrix,k);m(o,o,-a*Math.PI),h(o,A,o),m(o,o,-i*Math.PI),g(this._deepSkyPassParameters.inverseModelMatrix,o),this.requestRender(1)}_createLoadDataTask(){if(this._starData)return null;let e=n(async e=>{let{data:n}=await t(H,{responseType:`array-buffer`,signal:e});z(n),this._starData=n});return e.promise.catch(e=>{s(e)||i.getLogger(this).error(e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}_createLoadBandTextureTask(){if(this._bandTexture)return null;let e=n(async e=>{let{data:n}=await t(U,{responseType:`blob`,signal:e});c(e);let r=await createImageBitmap(n,{colorSpaceConversion:`none`,premultiplyAlpha:`none`});try{c(e);let t=new F(r.width,r.height);t.wrapMode=33071,t.maxAnisotropy=8,t.pixelFormat=6407,this._bandTexture=new P(this.renderingContext,t,r)}finally{r.close()}});return e.promise.catch(e=>{s(e)||i.getLogger(this).warn(`Failed to load Milky Way band texture.`,e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}};L=e([f(`esri.views.3d.webgl-engine.effects.stars.Stars`)],L);function R(e,t,n,r){let i=E.createBuffer(r),a=i.position,o=i.color,s=i.size;for(let e=0;e<r;e++){let r=t[e*2],i=t[e*2+1];a.set(e,0,-Math.cos(r)*Math.sin(i)),a.set(e,1,-Math.sin(r)*Math.sin(i)),a.set(e,2,-Math.cos(i));let c=V(n[e]),l=B(W[c[1]]);o.set(e,0,l[0]),o.set(e,1,l[1]),o.set(e,2,l[2]),o.set(e,3,255),s.set(e,c[0])}return new j(e,new I(e,b(E),i.buffer))}function z(e){if(!e)throw new r(`stars:no-data-received`,`Failed to create stars because star catalogue is missing`);let t=e.byteLength/G;if(t%1!=0||t>5e4||t<5e3)throw new r(`stars:invalid-data`,`Failed to create stars because star catalogue data is invalid`)}function B(e){return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function V(e){return e>=192?[2.9,e-192]:e>=160?[2.5,e-160]:e>=128?[2,e-128]:e>=96?[1.5,e-96]:e>=64?[1,e-64]:e>=32?[.7,e-32]:[.4,e]}const H=`esri/views/3d/environment/resources/stars.wsv`,U=`esri/views/3d/environment/resources/milkyway-band.avif`,W=[`9bb2ff`,`9eb5ff`,`aabfff`,`bbccff`,`ccd8ff `,`dae2ff`,`e4e9ff`,`eeefff`,`f8f6ff`,`fff9fb`,`fff5ef`,`fff1e5`,`ffeddb`,`ffe9d2`,`ffe6ca`,`ffe3c3`,`ffe0bb`,`ffddb4`,`ffdaad`,`ffd6a5`,`ffd29c`,`ffcc8f`,`ffc178`,`ffa94b`,`ff7b00`],G=9;export{L as Stars};
2
+ import{__decorate as e}from"tslib";import{fetchAsset as t}from"../../../../../assets.js";import{createTask as n}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Error.js";import i from"../../../../../core/Logger.js";import{abortMaybe as a,disposeMaybe as o}from"../../../../../core/maybe.js";import{isAbortError as s,throwIfAborted as c}from"../../../../../core/promiseUtils.js";import{watch as l,initial as u,syncAndInitial as d}from"../../../../../core/reactiveUtils.js";import{subclass as f}from"../../../../../core/accessorSupport/decorators.js";import{copy as p,rotateZ as m,multiply as h,invertOrIdentity as g}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{squaredLength as _}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{getReferenceEllipsoid as v}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as y}from"../../../webgl.js";import{glLayout as b}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as x}from"../OpaqueEnvironment.js";import{DeepSkyPassParameters as S,DeepSkyTechnique as C}from"./DeepSkyTechnique.js";import{StarPassParameters as w,StarsTechnique as T,layout as E}from"./StarsTechnique.js";import{getDailyRotationCoefficient as D,computeDayDuration as O,eq2ec as k,ec2eq as A}from"./starsUtils.js";import{VertexArrayObject as j}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as M,PrimitiveType as N}from"../../../../webgl/enums.js";import{Texture as P}from"../../../../webgl/Texture.js";import{TextureDescriptor as F}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as I}from"../../../../webgl/VertexBuffer.js";let L=class extends x{constructor(){super(...arguments),this._numPoints=0,this._passParameters=new w,this._deepSkyPassParameters=new S}initialize(){this.addHandles([l(()=>this.view.environment.starsEnabled,e=>e?this._enable():this._disable(),u),l(()=>this.view.environment.lighting.type===`virtual`?null:this.view.environment.lighting.date,e=>this._update(e),d)])}_enable(){super._enable(),this._bandTextureTask=this._createLoadBandTextureTask(),this._loadDataTask=this._createLoadDataTask()}get loading(){return!!this._loadDataTask&&!this._loadDataTask.finished||!!this._bandTextureTask&&!this._bandTextureTask.finished}destroy(){this._bandTextureTask=a(this._bandTextureTask),this._bandTexture=o(this._bandTexture),this._loadDataTask=a(this._loadDataTask),this._numPoints=0,this._vao=o(this._vao),this._starData=null}render(e){let t=e.find(({name:e})=>e===y.OPAQUE_ENVIRONMENT),n=this.techniques.getCompiled(T),r=this.techniques.getCompiled(C);if(this.loading||!n||!r)return this.requestRender(1),t;let i=this.renderingContext;return this._bandTexture&&(this._deepSkyPassParameters.bandTexture=this._bandTexture,this._deepSkyPassParameters.heightAboveSeaLevelSquared=_(this.bindParameters.camera.eye),i.bindTechnique(r,this.bindParameters,this._deepSkyPassParameters),i.setDrawBuffers([M]),i.screen.draw()),this._starData&&(this._vao??=this._ensureResources(this._starData),i.bindTechnique(n,this.bindParameters,this._passParameters),i.setDrawBuffers([M]),i.bindVAO(this._vao),i.drawArrays(N.POINTS,0,this._numPoints)),t}_ensureResources(e){this._numPoints=e.byteLength/G;let t=new Float32Array(e,0,this._numPoints*2),n=new Uint8Array(e,this._numPoints*2*4,this._numPoints);return R(this.renderingContext,t,n,this._numPoints)}_update(e){let t=v(this.view.spatialReference).radius,n=t*.05,r=t*.3;if(this._deepSkyPassParameters.radiusCloseToGround=(t+r)**2,this._deepSkyPassParameters.radiusBrightnessTransitionEnd=(t+r+n)**2,!e)return;let i=D(e),a=2*O(e),o=p(this._passParameters.modelMatrix,k);m(o,o,-a*Math.PI),h(o,A,o),m(o,o,-i*Math.PI),g(this._deepSkyPassParameters.inverseModelMatrix,o),this.requestRender(1)}_createLoadDataTask(){if(this._starData)return null;let e=n(async e=>{let{data:n}=await t(H,{responseType:`array-buffer`,signal:e});z(n),this._starData=n});return e.promise.catch(e=>{s(e)||i.getLogger(this).error(e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}_createLoadBandTextureTask(){if(this._bandTexture)return null;let e=n(async e=>{let{data:n}=await t(U,{responseType:`blob`,signal:e});c(e);let r=await createImageBitmap(n,{colorSpaceConversion:`none`,premultiplyAlpha:`none`});try{c(e);let t=new F(r.width,r.height);t.wrapMode=33071,t.maxAnisotropy=8,t.pixelFormat=6407,this._bandTexture=new P(this.renderingContext,t,r)}finally{r.close()}});return e.promise.catch(e=>{s(e)||i.getLogger(this).warn(`Failed to load Milky Way band texture.`,e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}};L=e([f(`esri.views.3d.webgl-engine.effects.stars.Stars`)],L);function R(e,t,n,r){let i=E.createBuffer(r),a=i.position,o=i.color,s=i.size;for(let e=0;e<r;e++){let r=t[e*2],i=t[e*2+1];a.set(e,0,-Math.cos(r)*Math.sin(i)),a.set(e,1,-Math.sin(r)*Math.sin(i)),a.set(e,2,-Math.cos(i));let c=V(n[e]),l=B(W[c[1]]);o.set(e,0,l[0]),o.set(e,1,l[1]),o.set(e,2,l[2]),o.set(e,3,255),s.set(e,c[0])}return new j(e,new I(e,b(E),i.buffer))}function z(e){if(!e)throw new r(`stars:no-data-received`,`Failed to create stars because star catalogue is missing`);let t=e.byteLength/G;if(t%1!=0||t>5e4||t<5e3)throw new r(`stars:invalid-data`,`Failed to create stars because star catalogue data is invalid`)}function B(e){return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function V(e){return e>=192?[2.9,e-192]:e>=160?[2.5,e-160]:e>=128?[2,e-128]:e>=96?[1.5,e-96]:e>=64?[1,e-64]:e>=32?[.7,e-32]:[.4,e]}const H=`esri/views/3d/environment/resources/stars.wsv`,U=`esri/views/3d/environment/resources/milkyway-band.avif`,W=[`9bb2ff`,`9eb5ff`,`aabfff`,`bbccff`,`ccd8ff `,`dae2ff`,`e4e9ff`,`eeefff`,`f8f6ff`,`fff9fb`,`fff5ef`,`fff1e5`,`ffeddb`,`ffe9d2`,`ffe6ca`,`ffe3c3`,`ffe0bb`,`ffddb4`,`ffdaad`,`ffd6a5`,`ffd29c`,`ffcc8f`,`ffc178`,`ffa94b`,`ff7b00`],G=9;export{L as Stars};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- function e(e,n){return e.size===n?new t(e):null}class t{constructor(e){this._attribute=e}get count(){return this._attribute.indices.length}get(e,t=0){let{data:n,indices:r,stride:i}=this._attribute;return n[r[e]*i+t]}getVec(e,t){let{data:n,indices:r,size:i,stride:a}=this._attribute,o=r[e]*a;for(let e=0;e<i;e++)t[e]=n[o+e];return t}}export{t as AttributeView,e as createAttributeView};
2
+ import{VerticesView as e}from"./VerticesView.js";function t(e,t){return e.size===t?new n(e):null}class n extends e{constructor(e){super(e),this._attribute=e}get count(){return this._attribute.indices.length}_getOffset(e){return this._attribute.indices[e]*this._attribute.stride}}export{n as AttributeView,t as createAttributeView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{getBasisTranscoder as t}from"../../../../libs/basisu/BasisUTranscoder.js";import{readKTX2TextureMetadata as n,readBasisTextureMetadata as r}from"../../../../libs/basisu/textureMetadata.js";import{CompressedTextureFormat as i,SizedPixelFormat as a}from"../../../webgl/enums.js";import o from"../../../webgl/Texture.js";import{getFormatBytesPerElement as s}from"../../../webgl/Util.js";const c=()=>e.getLogger(`esri.views.3d.webgl-engine.lib.BasisUtil`);let l=null,u=null;async function d(){return u??(u=t(),l=await u),u}function f(e,t){let n=r(e);return n?m(n,t):0}function p(e,t){let r=n(e);return r?m(r,t):0}function m({levels:e,hasAlpha:t,width:n,height:r},a){let o=s(t?i.COMPRESSED_RGBA8_ETC2_EAC:i.COMPRESSED_RGB8_ETC2),c=a&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(n*r*o*c)}function h(e){return e.getNumImages()>=1&&!e.isUASTC()}function g(e){return e.getFaces()>=1&&(e.isETC1S()||e.isUASTC())}function _(e,t,n,r){return e?n?{basisFormat:1,internalFormat:r?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}:{basisFormat:0,internalFormat:r?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2}:t?n?{basisFormat:3,internalFormat:i.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{basisFormat:2,internalFormat:i.COMPRESSED_RGB_S3TC_DXT1_EXT}:{basisFormat:13,internalFormat:r?a.SRGB8_ALPHA8:6408}}async function v(e,t,n){l??=await d();let r=new l.BasisFile(new Uint8Array(n));if(!h(r))return null;r.startTranscoding();let i=b(e,t,r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),(e,t)=>r.getImageTranscodedSizeInBytes(0,e,t),(e,t,n)=>r.transcodeImage(n,0,e,t,0,0));return r.close(),r.delete(),i}async function y(e,t,n,r=!1){l??=await d();let i=new l.KTX2File(new Uint8Array(n));if(!g(i))return null;let a=r&&i.getDFDTransferFunc()===2;i.startTranscoding();let o=b(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,n)=>i.transcodeImage(n,e,0,0,t,0,-1,-1),a);return i.close(),i.delete(),o}function b(e,t,n,r,i,a,s,c,l=!1){let{compressedTextureETC:u,compressedTextureS3TC:d}=e.capabilities,{basisFormat:f,internalFormat:p}=_(u!=null,d!=null,r,l),m=t.hasMipmap?n:Math.min(1,n),h=[];for(let e=0;e<m;e++)h.push(new Uint8Array(s(e,f))),c(e,f,h[e]);return t.internalFormat=p,t.hasMipmap=h.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=i,t.height=a,new o(e,t,{type:`compressed`,levels:h})}function x(e,t,n){let r=S(n,t.hasMipmap??!1);if(r==null)throw Error(`KTX1 texture data is null`);let{textureData:i,internalFormat:a,width:s,height:c}=r;return t.samplingMode=i.levels.length>1?9987:9729,t.hasMipmap=i.levels.length>1,t.internalFormat=a,t.width=s,t.height=c,new o(e,t,i)}function S(e,t){let n=new Uint32Array(e.buffer,e.byteOffset,16);if(n[0]!==1481919403||n[1]!==3140563232||n[2]!==169478669)return c().error(`Invalid magic number in KTX1 header`),null;if(n[3]!==67305985||n[5]!==1||n[7]!==i.COMPRESSED_RGB8_ETC2||n[8]!==6407)return c().error(`Unsupported KTX1 image`),null;let r=n[7],a=1,o=n[9],s=n[10];if(o&3||s&3)return null;let l=o,u=s;t!==!1&&(a=Math.max(1,n[14]));let d,f,p=e.byteOffset+64,m=[];for(let t=0;t<a;++t)f=(e[p]|e[p+1]<<8|e[p+2]<<16|e[p+3]<<24)>>>0,p+=4,d=new Uint8Array(e.buffer,p,f),m.push(d),p+=f,o=Math.max(1,o>>1),s=Math.max(1,s>>1);return{textureData:{type:`compressed`,levels:m},internalFormat:r,width:l,height:u}}export{g as checkKTX2,S as createKTX1TextureData,v as createTextureBasis,x as createTextureKTX1,y as createTextureKTX2,f as estimateMemoryBasis,p as estimateMemoryKTX2,d as loadBasisTranscoder,_ as selectBasisTextureFormats};
2
+ import e from"../../../../core/Logger.js";import{getBasisTranscoder as t}from"../../../../libs/basisu/BasisUTranscoder.js";import{readKTX2TextureMetadata as n,readBasisTextureMetadata as r}from"../../../../libs/basisu/textureMetadata.js";import{CompressedTextureFormat as i,SizedPixelFormat as a}from"../../../webgl/enums.js";import{Texture as o}from"../../../webgl/Texture.js";import{getFormatBytesPerElement as s}from"../../../webgl/Util.js";const c=()=>e.getLogger(`esri.views.3d.webgl-engine.lib.BasisUtil`);let l=null,u=null;async function d(){return u??(u=t(),l=await u),u}function f(e,t){let n=r(e);return n?m(n,t):0}function p(e,t){let r=n(e);return r?m(r,t):0}function m({levels:e,hasAlpha:t,width:n,height:r},a){let o=s(t?i.COMPRESSED_RGBA8_ETC2_EAC:i.COMPRESSED_RGB8_ETC2),c=a&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(n*r*o*c)}function h(e){return e.getNumImages()>=1&&!e.isUASTC()}function g(e){return e.getFaces()>=1&&(e.isETC1S()||e.isUASTC())}function _(e,t,n,r){return e?n?{basisFormat:1,internalFormat:r?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}:{basisFormat:0,internalFormat:r?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2}:t?n?{basisFormat:3,internalFormat:i.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{basisFormat:2,internalFormat:i.COMPRESSED_RGB_S3TC_DXT1_EXT}:{basisFormat:13,internalFormat:r?a.SRGB8_ALPHA8:6408}}async function v(e,t,n){l??=await d();let r=new l.BasisFile(new Uint8Array(n));if(!h(r))return null;r.startTranscoding();let i=b(e,t,r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),(e,t)=>r.getImageTranscodedSizeInBytes(0,e,t),(e,t,n)=>r.transcodeImage(n,0,e,t,0,0));return r.close(),r.delete(),i}async function y(e,t,n,r=!1){l??=await d();let i=new l.KTX2File(new Uint8Array(n));if(!g(i))return null;let a=r&&i.getDFDTransferFunc()===2;i.startTranscoding();let o=b(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,n)=>i.transcodeImage(n,e,0,0,t,0,-1,-1),a);return i.close(),i.delete(),o}function b(e,t,n,r,i,a,s,c,l=!1){let{compressedTextureETC:u,compressedTextureS3TC:d}=e.capabilities,{basisFormat:f,internalFormat:p}=_(u!=null,d!=null,r,l),m=t.hasMipmap?n:Math.min(1,n),h=[];for(let e=0;e<m;e++)h.push(new Uint8Array(s(e,f))),c(e,f,h[e]);return t.internalFormat=p,t.hasMipmap=h.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=i,t.height=a,new o(e,t,{type:`compressed`,levels:h})}function x(e,t,n){let r=S(n,t.hasMipmap??!1);if(r==null)throw Error(`KTX1 texture data is null`);let{textureData:i,internalFormat:a,width:s,height:c}=r;return t.samplingMode=i.levels.length>1?9987:9729,t.hasMipmap=i.levels.length>1,t.internalFormat=a,t.width=s,t.height=c,new o(e,t,i)}function S(e,t){let n=new Uint32Array(e.buffer,e.byteOffset,16);if(n[0]!==1481919403||n[1]!==3140563232||n[2]!==169478669)return c().error(`Invalid magic number in KTX1 header`),null;if(n[3]!==67305985||n[5]!==1||n[7]!==i.COMPRESSED_RGB8_ETC2||n[8]!==6407)return c().error(`Unsupported KTX1 image`),null;let r=n[7],a=1,o=n[9],s=n[10];if(o&3||s&3)return null;let l=o,u=s;t!==!1&&(a=Math.max(1,n[14]));let d,f,p=e.byteOffset+64,m=[];for(let t=0;t<a;++t)f=(e[p]|e[p+1]<<8|e[p+2]<<16|e[p+3]<<24)>>>0,p+=4,d=new Uint8Array(e.buffer,p,f),m.push(d),p+=f,o=Math.max(1,o>>1),s=Math.max(1,s>>1);return{textureData:{type:`compressed`,levels:m},internalFormat:r,width:l,height:u}}export{g as checkKTX2,S as createKTX1TextureData,v as createTextureBasis,x as createTextureKTX1,y as createTextureKTX2,f as estimateMemoryBasis,p as estimateMemoryKTX2,d as loadBasisTranscoder,_ as selectBasisTextureFormats};
@@ -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{ReprojectionUniforms as o}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as s}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as c}from"../lighting/SceneLighting.js";class l{constructor(e,t){this.width=e,this.height=t}}class u{constructor(e){this.shadowMap=e,this.output=0,this.slot=2,this.slicePlane=null,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 c,this._newLighting=new c,this._fadedLighting=new c,this._lighting=this._newLighting,this.screenSpaceReflections=new s,this.reprojection=new o,this.highlights=[],this.highlightMixOrigin=n(),this.highlightMixTexture=null,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 this.camera.relativeElevation<5e5}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{u as BindParameters,l 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{ReprojectionUniforms as o}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as s}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as c}from"../lighting/SceneLighting.js";class l{constructor(e,t){this.width=e,this.height=t}}class u{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 c,this._newLighting=new c,this._fadedLighting=new c,this._lighting=this._newLighting,this.screenSpaceReflections=new s,this.reprojection=new o,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 this.camera.relativeElevation<5e5}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{u as BindParameters,l as ViewportSize};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{CompressedTextureFormat as t}from"../../../webgl/enums.js";import n from"../../../webgl/Texture.js";const r=()=>e.getLogger(`esri.views.3d.webgl-engine.lib.DDSUtil`);function i(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function a(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}const o=i(`DXT1`),s=i(`DXT3`),c=i(`DXT5`);function l(e,t,r){let i=u(r,t.hasMipmap??!1);if(i==null)throw Error(`DDS texture data is null`);let{textureData:a,internalFormat:o,width:s,height:c}=i;return t.samplingMode=a.levels.length>1?9987:9729,t.hasMipmap=a.levels.length>1,t.internalFormat=o,t.width=s,t.height=c,new n(e,t,a)}function u(e,n){let i=new Int32Array(e.buffer,e.byteOffset,31);if(i[0]!==542327876)return r().error(`Invalid magic number in DDS header`),null;if(!(i[20]&4))return r().error(`Unsupported format, must contain a FourCC code`),null;let l=i[21],u,d;switch(l){case o:u=8,d=t.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case s:u=16,d=t.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case c:u=16,d=t.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return r().error(`Unsupported FourCC code:`,a(l)),null}let f=1,p=i[4],m=i[3];(p&3||m&3)&&(r().warn(`Rounding up compressed texture size to nearest multiple of 4.`),p=p+3&-4,m=m+3&-4);let h=p,g=m;i[2]&131072&&n!==!1&&(f=Math.max(1,i[7]));let _,v,y=e.byteOffset+i[1]+4,b=[];for(let t=0;t<f;++t)v=(p+3>>2)*(m+3>>2)*u,_=new Uint8Array(e.buffer,y,v),b.push(_),y+=v,p=Math.max(1,p>>1),m=Math.max(1,m>>1);return{textureData:{type:`compressed`,levels:b},internalFormat:d,width:h,height:g}}export{l as createDDSTexture,u as createDDSTextureData};
2
+ import e from"../../../../core/Logger.js";import{CompressedTextureFormat as t}from"../../../webgl/enums.js";import{Texture as n}from"../../../webgl/Texture.js";const r=()=>e.getLogger(`esri.views.3d.webgl-engine.lib.DDSUtil`);function i(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function a(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}const o=i(`DXT1`),s=i(`DXT3`),c=i(`DXT5`);function l(e,t,r){let i=u(r,t.hasMipmap??!1);if(i==null)throw Error(`DDS texture data is null`);let{textureData:a,internalFormat:o,width:s,height:c}=i;return t.samplingMode=a.levels.length>1?9987:9729,t.hasMipmap=a.levels.length>1,t.internalFormat=o,t.width=s,t.height=c,new n(e,t,a)}function u(e,n){let i=new Int32Array(e.buffer,e.byteOffset,31);if(i[0]!==542327876)return r().error(`Invalid magic number in DDS header`),null;if(!(i[20]&4))return r().error(`Unsupported format, must contain a FourCC code`),null;let l=i[21],u,d;switch(l){case o:u=8,d=t.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case s:u=16,d=t.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case c:u=16,d=t.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return r().error(`Unsupported FourCC code:`,a(l)),null}let f=1,p=i[4],m=i[3];(p&3||m&3)&&(r().warn(`Rounding up compressed texture size to nearest multiple of 4.`),p=p+3&-4,m=m+3&-4);let h=p,g=m;i[2]&131072&&n!==!1&&(f=Math.max(1,i[7]));let _,v,y=e.byteOffset+i[1]+4,b=[];for(let t=0;t<f;++t)v=(p+3>>2)*(m+3>>2)*u,_=new Uint8Array(e.buffer,y,v),b.push(_),y+=v,p=Math.max(1,p>>1),m=Math.max(1,m>>1);return{textureData:{type:`compressed`,levels:b},internalFormat:d,width:h,height:g}}export{l as createDDSTexture,u as createDDSTextureData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../core/maybe.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{createQuadVAO as a}from"./glUtil3D.js";import{SortedRenderGeometryRenderer as o}from"./SortedRenderGeometryRenderer.js";import{HeatmapPassParameters as s,HeatmapTechnique as c}from"../shaders/HeatmapTechnique.js";import{HeatmapTechniqueConfiguration as l}from"../shaders/HeatmapTechniqueConfiguration.js";import{PixelType as u}from"../../../webgl/enums.js";import{DisposableFramebufferObject as d}from"../../../webgl/FramebufferObject.js";import f from"../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../webgl/TextureDescriptor.js";let m=class extends o{constructor(e){super(e),this.pixelRatio=1,this._colorRampData=new Uint8ClampedArray(4),this.type=`draped-heatmap`,this._passParameters=new s,this._configuration=new l;let t=new p;t.pixelFormat=e.pixelFormat,t.internalFormat=e.internalFormat,t.dataType=e.dataType,t.samplingMode=e.samplingMode,t.wrapMode=33071;let n=e.rendererContext.rctx;this._densityMap=new d(n,t),this._vao=a(n),this._configuration.usesHalfFloat=e.dataType!==u.FLOAT,e.rendererContext.pluginContext.techniques.precompile(c,this._configuration)}initialize(){let e=this._colorRampData,t=new p(e.length/4,1);t.wrapMode=33071,this._colorRamp=new f(this.rctx,t,e),this._passParameters.densityMap=this._densityMap.colorTexture,this.addHandles(n(()=>[this.colorRampData,this.minDensity,this.maxDensity,this.fieldTotal,this.pixelRatio,this.searchRadius],()=>this.rendererContext.notifyContentChanged()))}destroy(){this._densityMap=t(this._densityMap),this._vao=t(this._vao),this._colorRamp=t(this._colorRamp)}get searchRadius(){return this._passParameters.searchRadius}set searchRadius(e){e!==this._passParameters.searchRadius&&(this._passParameters.searchRadius=e,this.notifyChange(`searchRadius`))}get minDensity(){return this._passParameters.minDensity}set minDensity(e){e!==this._passParameters.minDensity&&(this._passParameters.minDensity=e,this.notifyChange(`minDensity`))}get maxDensity(){return this._passParameters.maxDensity}set maxDensity(e){e!==this._passParameters.maxDensity&&(this._passParameters.maxDensity=e,this.notifyChange(`maxDensity`))}get fieldTotal(){return this._passParameters.fieldTotal}set fieldTotal(e){this._passParameters.fieldTotal=e,this.notifyChange(`fieldTotal`)}get colorRampData(){return this._colorRampData}set colorRampData(e){let{colorRamp:t}=this._passParameters;if(t!=null&&e!==this._colorRampData){let n=t.descriptor.width,r=e.length/4;r!==n&&t.resize(r,1),t.setData(e)}this._colorRampData=e}get _colorRamp(){return this._passParameters.colorRamp}set _colorRamp(e){this._passParameters.colorRamp=e}get hasHighlights(){return!1}get hasWater(){return!1}render(e){let t=this.sortedRenderers;if(t.length===0)return;let n=this.rctx.boundFramebuffer,r=this.rctx.getViewport(),{pixelRatio:i}=this,a=Math.ceil(r.width*i),o=Math.ceil(r.height*i);this._densityMap.resize(a,o),this.rctx.bindFramebuffer(this._densityMap),this.rctx.setViewport(0,0,a,o),this.rctx.clear(16384);let s=!1;if(t.forAll(t=>{let n=t.acquireTechniques(e);n&&(t.render(e,n),s=!0)}),this.rctx.bindFramebuffer(n),this.rctx.setViewport(r.x,r.y,r.width,r.height),!s)return;this.rctx.bindVAO(this._vao);let l=this.rendererContext.pluginContext.techniques.get(c,this._configuration);this.rctx.bindTechnique(l,e.bind,this._passParameters),this.rctx.drawArrays(l.primitiveType,0,this._vao.vertexCount(`geometry`))}};e([r()],m.prototype,`searchRadius`,null),e([r()],m.prototype,`minDensity`,null),e([r()],m.prototype,`maxDensity`,null),e([r()],m.prototype,`fieldTotal`,null),e([r()],m.prototype,`pixelRatio`,void 0),e([r()],m.prototype,`colorRampData`,null),e([r({constructOnly:!0})],m.prototype,`dataType`,void 0),e([r({constructOnly:!0})],m.prototype,`samplingMode`,void 0),e([r({constructOnly:!0})],m.prototype,`pixelFormat`,void 0),e([r({constructOnly:!0})],m.prototype,`internalFormat`,void 0),e([r()],m.prototype,`_colorRampData`,void 0),m=e([i(`esri.views.3d.webgl-engine.lib.DrapedHeatmapRenderer`)],m);export{m as DrapedHeatmapRenderer};
2
+ import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../core/maybe.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{createQuadVAO as a}from"./glUtil3D.js";import{SortedRenderGeometryRenderer as o}from"./SortedRenderGeometryRenderer.js";import{HeatmapPassParameters as s,HeatmapTechnique as c}from"../shaders/HeatmapTechnique.js";import{HeatmapTechniqueConfiguration as l}from"../shaders/HeatmapTechniqueConfiguration.js";import{PixelType as u}from"../../../webgl/enums.js";import{DisposableFramebufferObject as d}from"../../../webgl/FramebufferObject.js";import{Texture as f}from"../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../webgl/TextureDescriptor.js";let m=class extends o{constructor(e){super(e),this.pixelRatio=1,this._colorRampData=new Uint8ClampedArray(4),this.type=`draped-heatmap`,this._passParameters=new s,this._configuration=new l;let t=new p;t.pixelFormat=e.pixelFormat,t.internalFormat=e.internalFormat,t.dataType=e.dataType,t.samplingMode=e.samplingMode,t.wrapMode=33071;let n=e.rendererContext.rctx;this._densityMap=new d(n,t),this._vao=a(n),this._configuration.usesHalfFloat=e.dataType!==u.FLOAT,e.rendererContext.pluginContext.techniques.precompile(c,this._configuration)}initialize(){let e=this._colorRampData,t=new p(e.length/4,1);t.wrapMode=33071,this._colorRamp=new f(this.rctx,t,e),this._passParameters.densityMap=this._densityMap.colorTexture,this.addHandles(n(()=>[this.colorRampData,this.minDensity,this.maxDensity,this.fieldTotal,this.pixelRatio,this.searchRadius],()=>this.rendererContext.notifyContentChanged()))}destroy(){this._densityMap=t(this._densityMap),this._vao=t(this._vao),this._colorRamp=t(this._colorRamp)}get searchRadius(){return this._passParameters.searchRadius}set searchRadius(e){e!==this._passParameters.searchRadius&&(this._passParameters.searchRadius=e,this.notifyChange(`searchRadius`))}get minDensity(){return this._passParameters.minDensity}set minDensity(e){e!==this._passParameters.minDensity&&(this._passParameters.minDensity=e,this.notifyChange(`minDensity`))}get maxDensity(){return this._passParameters.maxDensity}set maxDensity(e){e!==this._passParameters.maxDensity&&(this._passParameters.maxDensity=e,this.notifyChange(`maxDensity`))}get fieldTotal(){return this._passParameters.fieldTotal}set fieldTotal(e){this._passParameters.fieldTotal=e,this.notifyChange(`fieldTotal`)}get colorRampData(){return this._colorRampData}set colorRampData(e){let{colorRamp:t}=this._passParameters;if(t!=null&&e!==this._colorRampData){let n=t.descriptor.width,r=e.length/4;r!==n&&t.resize(r,1),t.setData(e)}this._colorRampData=e}get _colorRamp(){return this._passParameters.colorRamp}set _colorRamp(e){this._passParameters.colorRamp=e}get hasHighlights(){return!1}get hasWater(){return!1}render(e){let t=this.sortedRenderers;if(t.length===0)return;let n=this.rctx.boundFramebuffer,r=this.rctx.getViewport(),{pixelRatio:i}=this,a=Math.ceil(r.width*i),o=Math.ceil(r.height*i);this._densityMap.resize(a,o),this.rctx.bindFramebuffer(this._densityMap),this.rctx.setViewport(0,0,a,o),this.rctx.clear(16384);let s=!1;if(t.forAll(t=>{let n=t.acquireTechniques(e);n&&(t.render(e,n),s=!0)}),this.rctx.bindFramebuffer(n),this.rctx.setViewport(r.x,r.y,r.width,r.height),!s)return;this.rctx.bindVAO(this._vao);let l=this.rendererContext.pluginContext.techniques.get(c,this._configuration);this.rctx.bindTechnique(l,e.bind,this._passParameters),this.rctx.drawArrays(l.primitiveType,0,this._vao.vertexCount(`geometry`))}};e([r()],m.prototype,`searchRadius`,null),e([r()],m.prototype,`minDensity`,null),e([r()],m.prototype,`maxDensity`,null),e([r()],m.prototype,`fieldTotal`,null),e([r()],m.prototype,`pixelRatio`,void 0),e([r()],m.prototype,`colorRampData`,null),e([r({constructOnly:!0})],m.prototype,`dataType`,void 0),e([r({constructOnly:!0})],m.prototype,`samplingMode`,void 0),e([r({constructOnly:!0})],m.prototype,`pixelFormat`,void 0),e([r({constructOnly:!0})],m.prototype,`internalFormat`,void 0),e([r()],m.prototype,`_colorRampData`,void 0),m=e([i(`esri.views.3d.webgl-engine.lib.DrapedHeatmapRenderer`)],m);export{m as DrapedHeatmapRenderer};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../../../core/has.js";import{disposeMaybe as t,destroyMaybe as n}from"../../../../core/maybe.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{multiply as a,fromTranslation as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as c,sub as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderNodeOutput as d}from"../../webgl.js";import{debugFlags as f}from"../../support/debugFlags.js";import{glLayout as p}from"../../support/buffer/glUtil.js";import{newLayout as m}from"../../support/buffer/InterleavedLayout.js";import h from"../../webgl/RenderNode.js";import{Pos2Locations as g}from"./DefaultVertexBufferLayouts.js";import{VertexArrayObject as _}from"./VertexArrayObject.js";import{TaskPriority as v}from"../../../support/Scheduler.js";import{Yield as y}from"../../../support/Yield.js";import{BufferObject as b}from"../../../webgl/BufferObject.js";import{PrimitiveType as x,DataType as S,PixelType as C}from"../../../webgl/enums.js";import{makePipelineState as w,defaultColorWrite as T}from"../../../webgl/renderState.js";import{Sync as E}from"../../../webgl/Sync.js";import D from"../../../webgl/Texture.js";import{TextureDescriptor as O}from"../../../webgl/TextureDescriptor.js";import{getFormatComponents as k}from"../../../webgl/Util.js";import{fromLayout as A}from"../../../webgl/VertexAttributeLocations.js";import{VertexBuffer as j}from"../../../webgl/VertexBuffer.js";let M=class extends h{constructor(e){super(e),this.category=d.COMPOSITE,this._debugVao=null,this._debugVaoLength=0,this.readyToRun=!1,this.done=!0,this._start=!1,this._origin=u(),this._textureWidth=256,this._uploadBuffer=new Float32Array(this._textureWidth*3),this._counter=0,this._width=0,this._height=0,this._pipeline=w({colorWrite:T})}initialize(){this.addHandles(this.view.resourceController.scheduler.registerTask(v.OCCLUSION_QUERY,this)),this.produces=`disabled`,this.consumes.required=[this.category]}destroy(){this._debugVao=t(this._debugVao),this._sync=n(this._sync),this._pixelBuffer=t(this._pixelBuffer),this._texture=t(this._texture)}precompile(){this._ensureProgram(this.renderingContext),this._debug&&this._ensureDebugProgram(this.renderingContext)}render(){let e=this.input,t=this.renderingContext;if(this._debug){let n=this._ensureDebugProgram(t);t.useProgram(n),L(n,this.camera,this._origin),t.bindTexture(this._texture,1),n.setUniform1i(`positionTex`,1),t.bindFramebuffer(e.fbo),t.bindVAO(this._ensureDebugVao(t,this._width*this._height)),t.setDepthWriteEnabled(!1),t.setDepthTestEnabled(!1),n.setUniform4f(`color`,1,0,0,1),t.drawArrays(x.POINTS,0,this._counter),t.setDepthTestEnabled(!0),n.setUniform4f(`color`,0,1,0,1),t.drawArrays(x.POINTS,0,this._counter)}let n=this.gl,r=e.getTexture(n.DEPTH_STENCIL_ATTACHMENT),i=this.view.stage?.renderer.fboCache;if(!r||!i||this._sync||!this._start)return e;this._start=!1,this.produces=f.OCCLUSION_QUERY_DEBUG_PIXEL?this.category:`disabled`;let a=i.acquire(this._width,this._height,`hud visibility`,10);t.bindFramebuffer(a.fbo),t.setPipelineState(this._pipeline);let o=this._ensureProgram(t);return t.useProgram(o),L(o,this.camera,this._origin),t.bindTexture(r,0),o.setUniform1i(`depthTex`,0),t.bindTexture(this._texture,1),o.setUniform1i(`positionTex`,1),o.setUniform1i(`count`,this._counter),t.screen.draw(),this.pixelFormat??=n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT)===6403&&n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)===S.FLOAT?6403:6408,this._pixelBuffer??=b.createPixelPack(t,n.STREAM_READ),this._pixelBuffer.setSize(this._width*this._height*this._formatComponents*4),t.bindBuffer(this._pixelBuffer),n.readPixels(0,0,this._width,this._height,this.pixelFormat,S.FLOAT,0),t.unbindBuffer(35051),t.bindFramebuffer(null),a.release(),this._sync=new E(n),setTimeout(()=>this.readyToRun=!0,0),e}get _debug(){return!1}get _formatComponents(){return this.pixelFormat?k(this.pixelFormat):1}runTask(){if(!this._sync||!this._pixelBuffer)this.readyToRun=!1;else{try{if(!this._sync.poll())return y}catch{this.readyToRun=!1,this._sync=n(this._sync);return}this.readyToRun=!1,this._sync=n(this._sync),this._cpuBuffer=new Float32Array(this._width*this._height*this._formatComponents),this._pixelBuffer.getSubData(this._cpuBuffer),this.done=!0}}cancel(){this._start=!1,this._sync=n(this._sync)}init(e,t){this.cancel();let n=this._textureWidth;if(this._width=n,this._height=Math.ceil(e/n),this._counter=0,this._texture?.dispose(),this._height===0)return;let r=new O(this._width,this._height);r.pixelFormat=6407,r.dataType=C.FLOAT,r.samplingMode=9728,this._texture=new D(this.renderingContext,r),this.done=!1,c(this._origin,Math.fround(t[0]),Math.fround(t[1]),Math.fround(t[2]))}addPosition(e){let t=this._width;if(this._counter>=t*this._height)return-1;let n=this._counter%t;return l(R,e,this._origin),this._uploadBuffer[n*3+0]=R[0],this._uploadBuffer[n*3+1]=R[1],this._uploadBuffer[n*3+2]=R[2],n===t-1&&this._flush(),this._counter++}start(){if(this._width===0||this._height===0){this.done=!0;return}let e=this._width;this._counter%e>0&&this._flush(),this.produces=this.category,this._start=!0,this.requestRender(1)}getOcclusion(e){return this._cpuBuffer?.[e*this._formatComponents]??-1}get usedMemory(){return(this._texture?.usedMemory??0)+(this._pixelBuffer?.usedMemory??0)+(this._uploadBuffer?.length??0)*4+(this._cpuBuffer?.length??0)*4}_flush(){let e=this._width,t=Math.floor(this._counter/e);this._texture?.updateData(0,0,t,e,1,this._uploadBuffer)}_ensureProgram(e){return this._program??=e.programCache.get(F,I,g),this._program}_ensureDebugProgram(e){return this._debugProgram??=e.programCache.get(N,P,V),this._debugProgram}_ensureDebugVao(e,n){if(!this._debugVao||this._debugVaoLength<n){let r=new Float32Array(n);for(let e=0;e<n;e++)r[e]=e;this._debugVao=t(this._debugVao),this._debugVao=new _(e,new j(e,B,r))}return this._debugVao}};e([r()],M.prototype,`category`,void 0),e([r()],M.prototype,`pixelFormat`,void 0),e([r()],M.prototype,`_formatComponents`,null),e([r()],M.prototype,`readyToRun`,void 0),e([r()],M.prototype,`done`,void 0),M=e([i(`esri.views.3d.webgl-engine.lib.GPUPointOcclusionQuery`)],M);const N=`#version 300 es
2
+ import{__decorate as e}from"tslib";import"../../../../core/has.js";import{disposeMaybe as t,destroyMaybe as n}from"../../../../core/maybe.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{multiply as a,fromTranslation as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as c,sub as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderNodeOutput as d}from"../../webgl.js";import{debugFlags as f}from"../../support/debugFlags.js";import{glLayout as p}from"../../support/buffer/glUtil.js";import{newLayout as m}from"../../support/buffer/InterleavedLayout.js";import h from"../../webgl/RenderNode.js";import{Pos2Locations as g}from"./DefaultVertexBufferLayouts.js";import{VertexArrayObject as _}from"./VertexArrayObject.js";import{TaskPriority as v}from"../../../support/Scheduler.js";import{Yield as y}from"../../../support/Yield.js";import{BufferObject as b}from"../../../webgl/BufferObject.js";import{PrimitiveType as x,DataType as S,PixelType as C}from"../../../webgl/enums.js";import{makePipelineState as w,defaultColorWrite as T}from"../../../webgl/renderState.js";import{Sync as E}from"../../../webgl/Sync.js";import{Texture as D}from"../../../webgl/Texture.js";import{TextureDescriptor as O}from"../../../webgl/TextureDescriptor.js";import{getFormatComponents as k}from"../../../webgl/Util.js";import{fromLayout as A}from"../../../webgl/VertexAttributeLocations.js";import{VertexBuffer as j}from"../../../webgl/VertexBuffer.js";let M=class extends h{constructor(e){super(e),this.category=d.COMPOSITE,this._debugVao=null,this._debugVaoLength=0,this.readyToRun=!1,this.done=!0,this._start=!1,this._origin=u(),this._textureWidth=256,this._uploadBuffer=new Float32Array(this._textureWidth*3),this._counter=0,this._width=0,this._height=0,this._pipeline=w({colorWrite:T})}initialize(){this.addHandles(this.view.resourceController.scheduler.registerTask(v.OCCLUSION_QUERY,this)),this.produces=`disabled`,this.consumes.required=[this.category]}destroy(){this._debugVao=t(this._debugVao),this._sync=n(this._sync),this._pixelBuffer=t(this._pixelBuffer),this._texture=t(this._texture)}precompile(){this._ensureProgram(this.renderingContext),this._debug&&this._ensureDebugProgram(this.renderingContext)}render(){let e=this.input,t=this.renderingContext;if(this._debug){let n=this._ensureDebugProgram(t);t.useProgram(n),L(n,this.camera,this._origin),t.bindTexture(this._texture,1),n.setUniform1i(`positionTex`,1),t.bindFramebuffer(e.fbo),t.bindVAO(this._ensureDebugVao(t,this._width*this._height)),t.setDepthWriteEnabled(!1),t.setDepthTestEnabled(!1),n.setUniform4f(`color`,1,0,0,1),t.drawArrays(x.POINTS,0,this._counter),t.setDepthTestEnabled(!0),n.setUniform4f(`color`,0,1,0,1),t.drawArrays(x.POINTS,0,this._counter)}let n=this.gl,r=e.getTexture(n.DEPTH_STENCIL_ATTACHMENT),i=this.view.stage?.renderer.fboCache;if(!r||!i||this._sync||!this._start)return e;this._start=!1,this.produces=f.OCCLUSION_QUERY_DEBUG_PIXEL?this.category:`disabled`;let a=i.acquire(this._width,this._height,`hud visibility`,10);t.bindFramebuffer(a.fbo),t.setPipelineState(this._pipeline);let o=this._ensureProgram(t);return t.useProgram(o),L(o,this.camera,this._origin),t.bindTexture(r,0),o.setUniform1i(`depthTex`,0),t.bindTexture(this._texture,1),o.setUniform1i(`positionTex`,1),o.setUniform1i(`count`,this._counter),t.screen.draw(),this.pixelFormat??=n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT)===6403&&n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)===S.FLOAT?6403:6408,this._pixelBuffer??=b.createPixelPack(t,n.STREAM_READ),this._pixelBuffer.setSize(this._width*this._height*this._formatComponents*4),t.bindBuffer(this._pixelBuffer),n.readPixels(0,0,this._width,this._height,this.pixelFormat,S.FLOAT,0),t.unbindBuffer(35051),t.bindFramebuffer(null),a.release(),this._sync=new E(n),setTimeout(()=>this.readyToRun=!0,0),e}get _debug(){return!1}get _formatComponents(){return this.pixelFormat?k(this.pixelFormat):1}runTask(){if(!this._sync||!this._pixelBuffer)this.readyToRun=!1;else{try{if(!this._sync.poll())return y}catch{this.readyToRun=!1,this._sync=n(this._sync);return}this.readyToRun=!1,this._sync=n(this._sync),this._cpuBuffer=new Float32Array(this._width*this._height*this._formatComponents),this._pixelBuffer.getSubData(this._cpuBuffer),this.done=!0}}cancel(){this._start=!1,this._sync=n(this._sync)}init(e,t){this.cancel();let n=this._textureWidth;if(this._width=n,this._height=Math.ceil(e/n),this._counter=0,this._texture?.dispose(),this._height===0)return;let r=new O(this._width,this._height);r.pixelFormat=6407,r.dataType=C.FLOAT,r.samplingMode=9728,this._texture=new D(this.renderingContext,r),this.done=!1,c(this._origin,Math.fround(t[0]),Math.fround(t[1]),Math.fround(t[2]))}addPosition(e){let t=this._width;if(this._counter>=t*this._height)return-1;let n=this._counter%t;return l(R,e,this._origin),this._uploadBuffer[n*3+0]=R[0],this._uploadBuffer[n*3+1]=R[1],this._uploadBuffer[n*3+2]=R[2],n===t-1&&this._flush(),this._counter++}start(){if(this._width===0||this._height===0){this.done=!0;return}let e=this._width;this._counter%e>0&&this._flush(),this.produces=this.category,this._start=!0,this.requestRender(1)}getOcclusion(e){return this._cpuBuffer?.[e*this._formatComponents]??-1}get usedMemory(){return(this._texture?.usedMemory??0)+(this._pixelBuffer?.usedMemory??0)+(this._uploadBuffer?.length??0)*4+(this._cpuBuffer?.length??0)*4}_flush(){let e=this._width,t=Math.floor(this._counter/e);this._texture?.updateData(0,0,t,e,1,this._uploadBuffer)}_ensureProgram(e){return this._program??=e.programCache.get(F,I,g),this._program}_ensureDebugProgram(e){return this._debugProgram??=e.programCache.get(N,P,V),this._debugProgram}_ensureDebugVao(e,n){if(!this._debugVao||this._debugVaoLength<n){let r=new Float32Array(n);for(let e=0;e<n;e++)r[e]=e;this._debugVao=t(this._debugVao),this._debugVao=new _(e,new j(e,B,r))}return this._debugVao}};e([r()],M.prototype,`category`,void 0),e([r()],M.prototype,`pixelFormat`,void 0),e([r()],M.prototype,`_formatComponents`,null),e([r()],M.prototype,`readyToRun`,void 0),e([r()],M.prototype,`done`,void 0),M=e([i(`esri.views.3d.webgl-engine.lib.GPUPointOcclusionQuery`)],M);const N=`#version 300 es
3
3
  precision highp float;
4
4
  precision highp int;
5
5
 
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{set as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as t,scale as n,floor as r,subtract as i,set as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{positiveInfinity as o}from"../../../../geometry/support/aaBoundingBox.js";function s(e){return e.visibleGaussians>0&&e.orderTexture.texture!=null&&e.textureAtlas.texture!=null&&e.headerTexture.texture!=null}function c(e){return e.laserlinesEnabled||e.viewshedEnabled}function l(e){return e.viewshedEnabled}function u(n,r,i){d(n,r,i,i.eye),n.splatFading=r.data.fadingTexture.texture;let{fullHeight:a,fullWidth:o}=i,s=Math.tan(i.fovY*.5),c=s/a*o;e(n.tanFov,c,s),n.focalLength=a/(2*s),t(n.origin,i.eye)}function d(e,t,s,c){let l=t.data;e.splatOrder=l.orderTexture.texture,e.splatAtlas=l.textureAtlas.texture,e.splatHeader=l.headerTexture.texture;let{fullHeight:u,fullWidth:d}=s;e.minSplatRadius=t.view.qualitySettings.gaussianSplat.minimumPixelRadius*Math.sqrt(d*u)/1440,n(e.tileCameraPosition,c,1/f),r(e.tileCameraPosition,e.tileCameraPosition),n(e.cameraDelta,e.tileCameraPosition,f),i(e.cameraDelta,c,e.cameraDelta),e.slicePlaneLocalOrigin=c;let[p,m,h,g,_,v]=t.clippingBox||o,[y,b,x]=c;a(e.clipMinCameraRelative,p-y,m-b,h-x),a(e.clipMaxCameraRelative,g-y,_-b,v-x)}const f=2.048;export{s as canRenderGaussianSplats,f as gaussianSplatTileSize,u as prepareGaussianSplatPerspectiveParameters,d as prepareGaussianSplatRenderParameters,l as requiresPreciseColorDepth,c as requiresPreciseDepth};
2
+ import{set as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as t,scale as n,floor as r,subtract as i,set as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{positiveInfinity as o}from"../../../../geometry/support/aaBoundingBox.js";import{gaussianSplatGridCellSize as s}from"../../support/gaussianSplatting/formatConstants.js";function c(e){return e.visibleGaussians>0&&e.orderTexture.texture!=null&&e.textureAtlas.texture!=null&&e.headerTexture.texture!=null}function l(e){return e.laserlinesEnabled||e.viewshedEnabled}function u(e){return e.viewshedEnabled}function d(n,r,i){f(n,r,i,i.eye),n.splatFading=r.data.fadingTexture.texture;let{fullHeight:a,fullWidth:o}=i,s=Math.tan(i.fovY*.5),c=s/a*o;e(n.tanFov,c,s),n.focalLength=a/(2*s),t(n.origin,i.eye)}function f(e,t,c,l){let u=t.data;e.splatOrder=u.orderTexture.texture,e.splatAtlas=u.textureAtlas.texture,e.splatHeader=u.headerTexture.texture;let{fullHeight:d,fullWidth:f}=c;e.minSplatRadius=t.view.qualitySettings.gaussianSplat.minimumPixelRadius*Math.sqrt(f*d)/1440,n(e.tileCameraPosition,l,1/s),r(e.tileCameraPosition,e.tileCameraPosition),n(e.cameraDelta,e.tileCameraPosition,s),i(e.cameraDelta,l,e.cameraDelta),e.slicePlaneLocalOrigin=l;let[p,m,h,g,_,v]=t.clippingBox||o,[y,b,x]=l;a(e.clipMinCameraRelative,p-y,m-b,h-x),a(e.clipMaxCameraRelative,g-y,_-b,v-x)}export{c as canRenderGaussianSplats,d as prepareGaussianSplatPerspectiveParameters,f as prepareGaussianSplatRenderParameters,u as requiresPreciseColorDepth,l as requiresPreciseDepth};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{set as e,transformMat4 as t,subtract as n,normalize as r,scale as i,add as a,dot as o,cross as s,copy as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as l,fromValues as u,create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{ZEROS as f,UNIT_Z as p,create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newDoubleArray as h}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as g,floatArrayFrom as _}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as v,getZeroIndexArray as y}from"../../../../geometry/support/Indices.js";import{create as b,fromPositionAndNormal as x,intersectRay as S}from"../../../../geometry/support/plane.js";import{wrap as C}from"../../../../geometry/support/ray.js";import{timeStampsToAttribute as w,numTimeStampValuesPerVertex as T}from"../../support/engineContent/line.js";import{Attribute as E}from"./Attribute.js";import{BufferGeometry as D}from"./BufferGeometry.js";import{Buffers as O}from"./Buffers.js";import{scale as k,length as A,normalize as j,add as M}from"./bufferVectorMath.js";import{Geometry as N}from"./Geometry.js";import{assert as P}from"./Util.js";import{getHUDMaterialBufferBaseInstance as F}from"../materials/HUDMaterialBaseInstance.js";import{getInstanceLayout as I}from"../shaders/HUDMaterialTechnique.js";const L=[[-.5,-.5,.5],[.5,-.5,.5],[.5,.5,.5],[-.5,.5,.5],[-.5,-.5,-.5],[.5,-.5,-.5],[.5,.5,-.5],[-.5,.5,-.5]],R=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],z=[0,0,1,0,1,1,0,1],ee=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],B=Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)B[e*6+t]=e;const V=Array(36);for(let e=0;e<6;e++)V[e*6]=0,V[e*6+1]=1,V[e*6+2]=2,V[e*6+3]=2,V[e*6+4]=3,V[e*6+5]=0;function te(e,t){Array.isArray(t)||(t=[t,t,t]);let n=Array(24);for(let e=0;e<8;e++)n[e*3]=L[e][0]*t[0],n[e*3+1]=L[e][1]*t[1],n[e*3+2]=L[e][2]*t[2];return new N(e,[[`position`,new E(n,ee,3,!0)],[`normal`,new E(R,B,3)],[`uv0`,new E(z,V,2)]])}const H=[[-.5,0,-.5],[.5,0,-.5],[.5,0,.5],[-.5,0,.5],[0,-.5,0],[0,.5,0]],ne=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],re=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],U=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];function W(e,t){Array.isArray(t)||(t=[t,t,t]);let n=Array(18);for(let e=0;e<6;e++)n[e*3]=H[e][0]*t[0],n[e*3+1]=H[e][1]*t[1],n[e*3+2]=H[e][2]*t[2];return new N(e,[[`position`,new E(n,re,3,!0)],[`normal`,new E(ne,U,3)]])}const G=u(-.5,0,-.5),ie=u(.5,0,-.5),K=u(0,0,.5),q=u(0,.5,0),J=d(),Y=d(),X=d(),Z=d(),Q=d();n(J,G,q),n(Y,G,ie),s(X,J,Y),r(X,X),n(J,ie,q),n(Y,ie,K),s(Z,J,Y),r(Z,Z),n(J,K,q),n(Y,K,G),s(Q,J,Y),r(Q,Q);const ae=[G,ie,K,q],oe=[0,-1,0,X[0],X[1],X[2],Z[0],Z[1],Z[2],Q[0],Q[1],Q[2]],se=[0,1,2,3,1,0,3,2,1,3,0,2],ce=[0,0,0,1,1,1,2,2,2,3,3,3];function le(e,t){Array.isArray(t)||(t=[t,t,t]);let n=Array(12);for(let e=0;e<4;e++)n[e*3]=ae[e][0]*t[0],n[e*3+1]=ae[e][1]*t[1],n[e*3+2]=ae[e][2]*t[2];return new N(e,[[`position`,new E(n,se,3,!0)],[`normal`,new E(oe,ce,3)]])}function ue(e,t,n,r,i={uv:!0}){let a=-Math.PI,o=Math.PI*2,s=-Math.PI/2,c=Math.PI,l=Math.max(3,Math.floor(n)),u=Math.max(2,Math.floor(r)),d=(l+1)*(u+1),f=g(d*3),p=g(d*3),m=g(d*2),h=[],_=0;for(let e=0;e<=u;e++){let n=[],r=e/u,i=s+r*c,d=Math.cos(i);for(let e=0;e<=l;e++){let s=e/l,c=a+s*o,u=Math.cos(c)*d,h=Math.sin(i),g=-Math.sin(c)*d;f[3*_]=u*t,f[3*_+1]=h*t,f[3*_+2]=g*t,p[3*_]=u,p[3*_+1]=h,p[3*_+2]=g,m[2*_]=s,m[2*_+1]=r,n.push(_),++_}h.push(n)}let v=[];for(let e=0;e<u;e++)for(let t=0;t<l;t++){let n=h[e][t],r=h[e][t+1],i=h[e+1][t+1],a=h[e+1][t];e===0?(v.push(n),v.push(i),v.push(a)):e===u-1?(v.push(n),v.push(r),v.push(i)):(v.push(n),v.push(r),v.push(i),v.push(i),v.push(a),v.push(n))}let b=[[`position`,new E(f,v,3,!0)],[`normal`,new E(p,v,3,!0)]];return i.uv&&b.push([`uv0`,new E(m,v,2,!0)]),i.offset&&(b[0][0]=`offset`,b.push([`position`,new E(Float64Array.from(i.offset),y(v.length),3,!0)])),new N(e,b)}function de(e,t,n,r){let i=fe(t,n,r);return new N(e,i)}function fe(e,t,n){let r=e,i,a;if(n)i=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],a=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{let e=r*(1+Math.sqrt(5))/2;i=[-r,e,0,r,e,0,-r,-e,0,r,-e,0,0,-r,e,0,r,e,0,-r,-e,0,r,-e,e,0,-r,e,0,r,-e,0,-r,-e,0,r],a=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let t=0;t<i.length;t+=3)k(i,t,e/A(i,t));let o={};function s(t,n){t>n&&([t,n]=[n,t]);let r=t.toString()+`.`+n.toString();if(o[r])return o[r];let a=i.length;return i.length+=3,M(i,t*3,i,n*3,i,a),k(i,a,e/A(i,a)),a/=3,o[r]=a,a}for(let e=0;e<t;e++){let e=a.length,t=Array(e*4);for(let n=0;n<e;n+=3){let e=a[n],r=a[n+1],i=a[n+2],o=s(e,r),c=s(r,i),l=s(i,e),u=n*4;t[u]=e,t[u+1]=o,t[u+2]=l,t[u+3]=r,t[u+4]=c,t[u+5]=o,t[u+6]=i,t[u+7]=l,t[u+8]=c,t[u+9]=o,t[u+10]=c,t[u+11]=l}a=t,o={}}let c=_(i);for(let e=0;e<c.length;e+=3)j(c,e);return[[`position`,new E(_(i),a,3,!0)],[`normal`,new E(c,a,3,!0)]]}function pe(e,t,{position:r,normal:i,groundDistance:a,size:o,rotation:s,color:c,uvi:l,centerOffset:u,featureAttribute:d,olidColor:m}={}){let h=I(e.parameters).createBuffer(1);return n($,r??f,t.vec3),h.position.setVec(0,$),h.normal.setVec(0,i??p),h.groundDistance.set(0,a??1),o!=null&&h.size?.setVec(0,o),s!=null&&h.rotation?.set(0,s),c!=null&&h.color?.setVec(0,c),l!=null&&h.uvi?.setVec(0,l),u!=null&&h.centerOffset?.setVec(0,u),d!=null&&h.featureAttribute?.setVec(0,d),m!=null&&h.olidColor?.setVec(0,m),new D(e,new O(h),t,null,F())}const me=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0]];function he(e,t=me){let n=Array(12);for(let e=0;e<4;e++)for(let r=0;r<3;r++)n[e*3+r]=t[e][r];let r=[0,1,2,2,3,0],i=[0,0,1],a=[0,0,0,0,0,0],o=[[`position`,new E(n,r,3,!0)],[`normal`,new E(i,a,3,!0)],[`uv0`,new E([0,0,1,0,1,1,0,1],r,2,!0)],[`color`,new E([255,255,255,255],a,4,!0)]];return new N(e,o)}function ge(e,t,n,r,i=!0,a=!0){let o=0,s=t,c=e,l=u(0,o,0),d=u(0,o+c,0),f=u(0,-1,0),p=u(0,1,0);r&&(o=c,d=u(0,0,0),l=u(0,o,0),f=u(0,1,0),p=u(0,-1,0));let m=[d,l],h=[f,p],_=n+2,v=Math.sqrt(c*c+s*s);if(r)for(let e=n-1;e>=0;e--){let t=2*Math.PI/n*e,r=u(Math.cos(t)*s,o,Math.sin(t)*s);m.push(r);let i=u(c*Math.cos(t)/v,-s/v,c*Math.sin(t)/v);h.push(i)}else for(let e=0;e<n;e++){let t=2*Math.PI/n*e,r=u(Math.cos(t)*s,o,Math.sin(t)*s);m.push(r);let i=u(c*Math.cos(t)/v,s/v,c*Math.sin(t)/v);h.push(i)}let y=[],b=[];if(i){for(let e=3;e<m.length;e++)y.push(1),y.push(e-1),y.push(e),b.push(0),b.push(0),b.push(0);y.push(m.length-1),y.push(2),y.push(1),b.push(0),b.push(0),b.push(0)}if(a){for(let e=3;e<m.length;e++)y.push(e),y.push(e-1),y.push(0),b.push(e),b.push(e-1),b.push(1);y.push(0),y.push(2),y.push(m.length-1),b.push(1),b.push(2),b.push(h.length-1)}let x=g(_*3);for(let e=0;e<_;e++)x[e*3]=m[e][0],x[e*3+1]=m[e][1],x[e*3+2]=m[e][2];let S=g(_*3);for(let e=0;e<_;e++)S[e*3]=h[e][0],S[e*3+1]=h[e][1],S[e*3+2]=h[e][2];return[[`position`,new E(x,y,3,!0)],[`normal`,new E(S,b,3,!0)]]}function _e(e,t,n,r,i,a=!0,o=!0){return new N(e,ge(t,n,r,i,a,o))}function ve(t,n,c,f,p,m,h){let _=p?l(p):u(1,0,0),v=m?l(m):u(0,0,0);h??=!0;let y=d();r(y,_);let b=d();i(b,y,Math.abs(n));let x=d();i(x,b,-.5),a(x,x,v);let S=u(0,1,0);Math.abs(1-o(y,S))<.2&&e(S,0,0,1);let C=d();s(C,y,S),r(C,C),s(S,C,y);let w=f*2+(h?2:0),T=f+(h?2:0),D=g(w*3),O=g(T*3),k=g(w*2),A=Array(f*3*(h?4:2)),j=Array(f*3*(h?4:2));h&&(D[(w-2)*3]=x[0],D[(w-2)*3+1]=x[1],D[(w-2)*3+2]=x[2],k[(w-2)*2]=0,k[(w-2)*2+1]=0,D[(w-1)*3]=D[(w-2)*3]+b[0],D[(w-1)*3+1]=D[(w-2)*3+1]+b[1],D[(w-1)*3+2]=D[(w-2)*3+2]+b[2],k[(w-1)*2]=1,k[(w-1)*2+1]=1,O[(T-2)*3]=-y[0],O[(T-2)*3+1]=-y[1],O[(T-2)*3+2]=-y[2],O[(T-1)*3]=y[0],O[(T-1)*3+1]=y[1],O[(T-1)*3+2]=y[2]);let M=(e,t,n)=>{A[e]=t,j[e]=n},P=0,F=d(),I=d();for(let e=0;e<f;e++){let t=2*Math.PI/f*e;i(F,S,Math.sin(t)),i(I,C,Math.cos(t)),a(F,F,I),O[e*3]=F[0],O[e*3+1]=F[1],O[e*3+2]=F[2],i(F,F,c),a(F,F,x),D[e*3]=F[0],D[e*3+1]=F[1],D[e*3+2]=F[2],k[e*2]=e/f,k[e*2+1]=0,D[(e+f)*3]=D[e*3]+b[0],D[(e+f)*3+1]=D[e*3+1]+b[1],D[(e+f)*3+2]=D[e*3+2]+b[2],k[(e+f)*2]=e/f,k[e*2+1]=1;let n=(e+1)%f;M(P++,e,e),M(P++,e+f,e),M(P++,n,n),M(P++,n,n),M(P++,e+f,e),M(P++,n+f,n)}if(h){for(let e=0;e<f;e++){let t=(e+1)%f;M(P++,w-2,T-2),M(P++,e,T-2),M(P++,t,T-2)}for(let e=0;e<f;e++){let t=(e+1)%f;M(P++,e+f,T-1),M(P++,w-1,T-1),M(P++,t+f,T-1)}}let L=[[`position`,new E(D,A,3,!0)],[`normal`,new E(O,j,3,!0)],[`uv0`,new E(k,A,2,!0)]];return new N(t,L)}function ye(e,t,n,r,i,a){r||=10,i??=!0,P(t.length>1);let o=[[0,0,0]],s=[],c=[];for(let e=0;e<r;e++){s.push([0,-e-1,-((e+1)%r)-1]);let t=e/r*2*Math.PI;c.push([Math.cos(t)*n,Math.sin(t)*n])}return be(e,c,t,o,s,i,a)}function be(t,o,l,d,f,p,h=u(0,0,0)){let _=o.length,v=g(l.length*_*3+(d.length*6||0)),y=g(l.length*_*3+(d?6:0)),w=[],T=[],D=0,O=0,k=m(),A=m(),j=m(),M=m(),P=m(),F=m(),I=m(),L=m(),R=m(),z=m(),ee=m(),B=m(),V=m(),te=b();e(R,0,1,0),n(A,l[1],l[0]),r(A,A),p?(a(L,l[0],h),r(j,L)):e(j,0,0,1),Ee(A,j,R,R,P,j,De),c(M,j),c(B,P);for(let e=0;e<d.length;e++)i(F,P,d[e][0]),i(L,j,d[e][2]),a(F,F,L),a(F,F,l[0]),v[D++]=F[0],v[D++]=F[1],v[D++]=F[2];y[O++]=-A[0],y[O++]=-A[1],y[O++]=-A[2];for(let e=0;e<f.length;e++)w.push(f[e][0]>0?f[e][0]:-f[e][0]-1+d.length),w.push(f[e][1]>0?f[e][1]:-f[e][1]-1+d.length),w.push(f[e][2]>0?f[e][2]:-f[e][2]-1+d.length),T.push(0),T.push(0),T.push(0);let H=d.length,ne=d.length-1;for(let e=0;e<l.length;e++){let t=!1;e>0&&(c(k,A),e<l.length-1?(n(A,l[e+1],l[e]),r(A,A)):t=!0,a(z,k,A),r(z,z),a(ee,l[e-1],M),x(l[e],z,te),S(te,C(ee,k),L)?(n(L,L,l[e]),r(j,L),s(P,z,j),r(P,P)):Ee(z,M,B,R,P,j,De),c(M,j),c(B,P)),p&&(a(L,l[e],h),r(V,L));for(let n=0;n<_;n++)if(i(F,P,o[n][0]),i(L,j,o[n][1]),a(F,F,L),r(I,F),y[O++]=I[0],y[O++]=I[1],y[O++]=I[2],a(F,F,l[e]),v[D++]=F[0],v[D++]=F[1],v[D++]=F[2],!t){let e=(n+1)%_;w.push(H+n),w.push(H+_+n),w.push(H+e),w.push(H+e),w.push(H+_+n),w.push(H+_+e);for(let e=0;e<6;e++){let t=w.length-6;T.push(w[t+e]-ne)}}H+=_}let re=l[l.length-1];for(let e=0;e<d.length;e++)i(F,P,d[e][0]),i(L,j,d[e][1]),a(F,F,L),a(F,F,re),v[D++]=F[0],v[D++]=F[1],v[D++]=F[2];let U=O/3;y[O++]=A[0],y[O++]=A[1],y[O++]=A[2];let W=H-_;for(let e=0;e<f.length;e++)w.push(f[e][0]>=0?H+f[e][0]:-f[e][0]-1+W),w.push(f[e][2]>=0?H+f[e][2]:-f[e][2]-1+W),w.push(f[e][1]>=0?H+f[e][1]:-f[e][1]-1+W),T.push(U),T.push(U),T.push(U);let G=[[`position`,new E(v,w,3,!0)],[`normal`,new E(y,T,3,!0)]];return new N(t,G)}function xe(e,t,n,r,i){let a=h(t.length*3),o=Array(2*(t.length-1)),s=0,c=0;for(let e=0;e<t.length;e++){for(let n=0;n<3;n++)a[s++]=t[e][n];e>0&&(o[c++]=e-1,o[c++]=e)}let l=[[`position`,new E(a,o,3,!0)]];if(n?.length===t.length&&n[0].length===3){let e=g(n.length*3),r=0;for(let i=0;i<t.length;i++)for(let t=0;t<3;t++)e[r++]=n[i][t];l.push([`normal`,new E(e,o,3,!0)])}if(r&&l.push([`color`,new E(r,v(r.length/4),4)]),i?.length===t.length){let e=w(i,1);l.push([`timeStamps`,new E(e,o,T,!0)])}return new N(e,l,null)}function Se(e,t,n,r,i,a=0){let o=Array(18),s=[[-n,a,i/2],[r,a,i/2],[0,t+a,i/2],[-n,a,-i/2],[r,a,-i/2],[0,t+a,-i/2]],c=[0,1,2,3,0,2,2,5,3,1,4,5,5,2,1,1,0,3,3,4,1,4,3,5];for(let e=0;e<6;e++)o[e*3]=s[e][0],o[e*3+1]=s[e][1],o[e*3+2]=s[e][2];return new N(e,[[`position`,new E(o,c,3,!0)]])}function Ce(n,r){let i=n.getMutableAttribute(`position`).data;for(let n=0;n<i.length;n+=3){let a=i[n],o=i[n+1],s=i[n+2];e($,a,o,s),t($,$,r),i[n]=$[0],i[n+1]=$[1],i[n+2]=$[2]}}function we(e,t=e){let n=e.attributes,r=n.get(`position`).data,i=n.get(`normal`).data;if(i){let e=t.getMutableAttribute(`normal`).data;for(let t=0;t<i.length;t+=3){let n=i[t+1];e[t+1]=-i[t+2],e[t+2]=n}}if(r){let e=t.getMutableAttribute(`position`).data;for(let t=0;t<r.length;t+=3){let n=r[t+1];e[t+1]=-r[t+2],e[t+2]=n}}}function Te(e,t,n,i,a){return Math.abs(o(t,e))>a?!1:(s(n,e,t),r(n,n),s(i,n,e),r(i,i),!0)}function Ee(e,t,n,r,i,a,o){return Te(e,t,i,a,o)||Te(e,n,i,a,o)||Te(e,r,i,a,o)}const De=.99619469809,$=m();export{we as cgToGIS,te as createBoxGeometry,_e as createConeGeometry,ge as createConeGeometryData,ve as createCylinderGeometry,W as createDiamondGeometry,Se as createExtrudedTriangle,be as createPathExtrusionGeometry,pe as createPointBufferGeometry,fe as createPolySphereData,de as createPolySphereGeometry,xe as createPolylineGeometry,ue as createSphereGeometry,he as createSquareGeometry,le as createTetrahedronGeometry,ye as createTubeGeometry,Ee as makeOrthoBasisDirUpFallback,Ce as transformInPlace};
2
+ import{set as e,transformMat4 as t,subtract as n,normalize as r,scale as i,add as a,dot as o,cross as s,copy as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as l,fromValues as u,create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{ZEROS as f,UNIT_Z as p,create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newDoubleArray as h}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as g,floatArrayFrom as _}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as v,getZeroIndexArray as y}from"../../../../geometry/support/Indices.js";import{create as b,fromPositionAndNormal as x,intersectRay as S}from"../../../../geometry/support/plane.js";import{wrap as C}from"../../../../geometry/support/ray.js";import{timeStampsToAttribute as w,numTimeStampValuesPerVertex as T}from"../../support/engineContent/line.js";import{Attribute as E}from"./Attribute.js";import{BufferGeometry as D}from"./BufferGeometry.js";import{Buffers as O}from"./Buffers.js";import{scale as k,length as A,normalize as j,add as M}from"./bufferVectorMath.js";import{Geometry as N}from"./Geometry.js";import{assert as P}from"./Util.js";import{getHUDMaterialBufferBaseInstance as F}from"../materials/HUDMaterialBaseInstance.js";import{getInstanceLayout as I}from"../shaders/hudMaterialLayouts.js";const L=[[-.5,-.5,.5],[.5,-.5,.5],[.5,.5,.5],[-.5,.5,.5],[-.5,-.5,-.5],[.5,-.5,-.5],[.5,.5,-.5],[-.5,.5,-.5]],R=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],z=[0,0,1,0,1,1,0,1],ee=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],B=Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)B[e*6+t]=e;const V=Array(36);for(let e=0;e<6;e++)V[e*6]=0,V[e*6+1]=1,V[e*6+2]=2,V[e*6+3]=2,V[e*6+4]=3,V[e*6+5]=0;function te(e,t){Array.isArray(t)||(t=[t,t,t]);let n=Array(24);for(let e=0;e<8;e++)n[e*3]=L[e][0]*t[0],n[e*3+1]=L[e][1]*t[1],n[e*3+2]=L[e][2]*t[2];return new N(e,[[`position`,new E(n,ee,3,!0)],[`normal`,new E(R,B,3)],[`uv0`,new E(z,V,2)]])}const H=[[-.5,0,-.5],[.5,0,-.5],[.5,0,.5],[-.5,0,.5],[0,-.5,0],[0,.5,0]],ne=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],re=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],U=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];function W(e,t){Array.isArray(t)||(t=[t,t,t]);let n=Array(18);for(let e=0;e<6;e++)n[e*3]=H[e][0]*t[0],n[e*3+1]=H[e][1]*t[1],n[e*3+2]=H[e][2]*t[2];return new N(e,[[`position`,new E(n,re,3,!0)],[`normal`,new E(ne,U,3)]])}const G=u(-.5,0,-.5),ie=u(.5,0,-.5),K=u(0,0,.5),q=u(0,.5,0),J=d(),Y=d(),X=d(),Z=d(),Q=d();n(J,G,q),n(Y,G,ie),s(X,J,Y),r(X,X),n(J,ie,q),n(Y,ie,K),s(Z,J,Y),r(Z,Z),n(J,K,q),n(Y,K,G),s(Q,J,Y),r(Q,Q);const ae=[G,ie,K,q],oe=[0,-1,0,X[0],X[1],X[2],Z[0],Z[1],Z[2],Q[0],Q[1],Q[2]],se=[0,1,2,3,1,0,3,2,1,3,0,2],ce=[0,0,0,1,1,1,2,2,2,3,3,3];function le(e,t){Array.isArray(t)||(t=[t,t,t]);let n=Array(12);for(let e=0;e<4;e++)n[e*3]=ae[e][0]*t[0],n[e*3+1]=ae[e][1]*t[1],n[e*3+2]=ae[e][2]*t[2];return new N(e,[[`position`,new E(n,se,3,!0)],[`normal`,new E(oe,ce,3)]])}function ue(e,t,n,r,i={uv:!0}){let a=-Math.PI,o=Math.PI*2,s=-Math.PI/2,c=Math.PI,l=Math.max(3,Math.floor(n)),u=Math.max(2,Math.floor(r)),d=(l+1)*(u+1),f=g(d*3),p=g(d*3),m=g(d*2),h=[],_=0;for(let e=0;e<=u;e++){let n=[],r=e/u,i=s+r*c,d=Math.cos(i);for(let e=0;e<=l;e++){let s=e/l,c=a+s*o,u=Math.cos(c)*d,h=Math.sin(i),g=-Math.sin(c)*d;f[3*_]=u*t,f[3*_+1]=h*t,f[3*_+2]=g*t,p[3*_]=u,p[3*_+1]=h,p[3*_+2]=g,m[2*_]=s,m[2*_+1]=r,n.push(_),++_}h.push(n)}let v=[];for(let e=0;e<u;e++)for(let t=0;t<l;t++){let n=h[e][t],r=h[e][t+1],i=h[e+1][t+1],a=h[e+1][t];e===0?(v.push(n),v.push(i),v.push(a)):e===u-1?(v.push(n),v.push(r),v.push(i)):(v.push(n),v.push(r),v.push(i),v.push(i),v.push(a),v.push(n))}let b=[[`position`,new E(f,v,3,!0)],[`normal`,new E(p,v,3,!0)]];return i.uv&&b.push([`uv0`,new E(m,v,2,!0)]),i.offset&&(b[0][0]=`offset`,b.push([`position`,new E(Float64Array.from(i.offset),y(v.length),3,!0)])),new N(e,b)}function de(e,t,n,r){let i=fe(t,n,r);return new N(e,i)}function fe(e,t,n){let r=e,i,a;if(n)i=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],a=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{let e=r*(1+Math.sqrt(5))/2;i=[-r,e,0,r,e,0,-r,-e,0,r,-e,0,0,-r,e,0,r,e,0,-r,-e,0,r,-e,e,0,-r,e,0,r,-e,0,-r,-e,0,r],a=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let t=0;t<i.length;t+=3)k(i,t,e/A(i,t));let o={};function s(t,n){t>n&&([t,n]=[n,t]);let r=t.toString()+`.`+n.toString();if(o[r])return o[r];let a=i.length;return i.length+=3,M(i,t*3,i,n*3,i,a),k(i,a,e/A(i,a)),a/=3,o[r]=a,a}for(let e=0;e<t;e++){let e=a.length,t=Array(e*4);for(let n=0;n<e;n+=3){let e=a[n],r=a[n+1],i=a[n+2],o=s(e,r),c=s(r,i),l=s(i,e),u=n*4;t[u]=e,t[u+1]=o,t[u+2]=l,t[u+3]=r,t[u+4]=c,t[u+5]=o,t[u+6]=i,t[u+7]=l,t[u+8]=c,t[u+9]=o,t[u+10]=c,t[u+11]=l}a=t,o={}}let c=_(i);for(let e=0;e<c.length;e+=3)j(c,e);return[[`position`,new E(_(i),a,3,!0)],[`normal`,new E(c,a,3,!0)]]}function pe(e,t,{position:r,normal:i,groundDistance:a,size:o,rotation:s,color:c,uvi:l,centerOffset:u,featureAttribute:d,olidColor:m}={}){let h=I(e.parameters).createBuffer(1);return n($,r??f,t.vec3),h.position.setVec(0,$),h.normal.setVec(0,i??p),h.groundDistance.set(0,a??1),o!=null&&h.size?.setVec(0,o),s!=null&&h.rotation?.set(0,s),c!=null&&h.color?.setVec(0,c),l!=null&&h.uvi?.setVec(0,l),u!=null&&h.centerOffset?.setVec(0,u),d!=null&&h.featureAttribute?.setVec(0,d),m!=null&&h.olidColor?.setVec(0,m),new D(e,new O(h),t,null,F())}const me=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0]];function he(e,t=me){let n=Array(12);for(let e=0;e<4;e++)for(let r=0;r<3;r++)n[e*3+r]=t[e][r];let r=[0,1,2,2,3,0],i=[0,0,1],a=[0,0,0,0,0,0],o=[[`position`,new E(n,r,3,!0)],[`normal`,new E(i,a,3,!0)],[`uv0`,new E([0,0,1,0,1,1,0,1],r,2,!0)],[`color`,new E([255,255,255,255],a,4,!0)]];return new N(e,o)}function ge(e,t,n,r,i=!0,a=!0){let o=0,s=t,c=e,l=u(0,o,0),d=u(0,o+c,0),f=u(0,-1,0),p=u(0,1,0);r&&(o=c,d=u(0,0,0),l=u(0,o,0),f=u(0,1,0),p=u(0,-1,0));let m=[d,l],h=[f,p],_=n+2,v=Math.sqrt(c*c+s*s);if(r)for(let e=n-1;e>=0;e--){let t=2*Math.PI/n*e,r=u(Math.cos(t)*s,o,Math.sin(t)*s);m.push(r);let i=u(c*Math.cos(t)/v,-s/v,c*Math.sin(t)/v);h.push(i)}else for(let e=0;e<n;e++){let t=2*Math.PI/n*e,r=u(Math.cos(t)*s,o,Math.sin(t)*s);m.push(r);let i=u(c*Math.cos(t)/v,s/v,c*Math.sin(t)/v);h.push(i)}let y=[],b=[];if(i){for(let e=3;e<m.length;e++)y.push(1),y.push(e-1),y.push(e),b.push(0),b.push(0),b.push(0);y.push(m.length-1),y.push(2),y.push(1),b.push(0),b.push(0),b.push(0)}if(a){for(let e=3;e<m.length;e++)y.push(e),y.push(e-1),y.push(0),b.push(e),b.push(e-1),b.push(1);y.push(0),y.push(2),y.push(m.length-1),b.push(1),b.push(2),b.push(h.length-1)}let x=g(_*3);for(let e=0;e<_;e++)x[e*3]=m[e][0],x[e*3+1]=m[e][1],x[e*3+2]=m[e][2];let S=g(_*3);for(let e=0;e<_;e++)S[e*3]=h[e][0],S[e*3+1]=h[e][1],S[e*3+2]=h[e][2];return[[`position`,new E(x,y,3,!0)],[`normal`,new E(S,b,3,!0)]]}function _e(e,t,n,r,i,a=!0,o=!0){return new N(e,ge(t,n,r,i,a,o))}function ve(t,n,c,f,p,m,h){let _=p?l(p):u(1,0,0),v=m?l(m):u(0,0,0);h??=!0;let y=d();r(y,_);let b=d();i(b,y,Math.abs(n));let x=d();i(x,b,-.5),a(x,x,v);let S=u(0,1,0);Math.abs(1-o(y,S))<.2&&e(S,0,0,1);let C=d();s(C,y,S),r(C,C),s(S,C,y);let w=f*2+(h?2:0),T=f+(h?2:0),D=g(w*3),O=g(T*3),k=g(w*2),A=Array(f*3*(h?4:2)),j=Array(f*3*(h?4:2));h&&(D[(w-2)*3]=x[0],D[(w-2)*3+1]=x[1],D[(w-2)*3+2]=x[2],k[(w-2)*2]=0,k[(w-2)*2+1]=0,D[(w-1)*3]=D[(w-2)*3]+b[0],D[(w-1)*3+1]=D[(w-2)*3+1]+b[1],D[(w-1)*3+2]=D[(w-2)*3+2]+b[2],k[(w-1)*2]=1,k[(w-1)*2+1]=1,O[(T-2)*3]=-y[0],O[(T-2)*3+1]=-y[1],O[(T-2)*3+2]=-y[2],O[(T-1)*3]=y[0],O[(T-1)*3+1]=y[1],O[(T-1)*3+2]=y[2]);let M=(e,t,n)=>{A[e]=t,j[e]=n},P=0,F=d(),I=d();for(let e=0;e<f;e++){let t=2*Math.PI/f*e;i(F,S,Math.sin(t)),i(I,C,Math.cos(t)),a(F,F,I),O[e*3]=F[0],O[e*3+1]=F[1],O[e*3+2]=F[2],i(F,F,c),a(F,F,x),D[e*3]=F[0],D[e*3+1]=F[1],D[e*3+2]=F[2],k[e*2]=e/f,k[e*2+1]=0,D[(e+f)*3]=D[e*3]+b[0],D[(e+f)*3+1]=D[e*3+1]+b[1],D[(e+f)*3+2]=D[e*3+2]+b[2],k[(e+f)*2]=e/f,k[e*2+1]=1;let n=(e+1)%f;M(P++,e,e),M(P++,e+f,e),M(P++,n,n),M(P++,n,n),M(P++,e+f,e),M(P++,n+f,n)}if(h){for(let e=0;e<f;e++){let t=(e+1)%f;M(P++,w-2,T-2),M(P++,e,T-2),M(P++,t,T-2)}for(let e=0;e<f;e++){let t=(e+1)%f;M(P++,e+f,T-1),M(P++,w-1,T-1),M(P++,t+f,T-1)}}let L=[[`position`,new E(D,A,3,!0)],[`normal`,new E(O,j,3,!0)],[`uv0`,new E(k,A,2,!0)]];return new N(t,L)}function ye(e,t,n,r,i,a){r||=10,i??=!0,P(t.length>1);let o=[[0,0,0]],s=[],c=[];for(let e=0;e<r;e++){s.push([0,-e-1,-((e+1)%r)-1]);let t=e/r*2*Math.PI;c.push([Math.cos(t)*n,Math.sin(t)*n])}return be(e,c,t,o,s,i,a)}function be(t,o,l,d,f,p,h=u(0,0,0)){let _=o.length,v=g(l.length*_*3+(d.length*6||0)),y=g(l.length*_*3+(d?6:0)),w=[],T=[],D=0,O=0,k=m(),A=m(),j=m(),M=m(),P=m(),F=m(),I=m(),L=m(),R=m(),z=m(),ee=m(),B=m(),V=m(),te=b();e(R,0,1,0),n(A,l[1],l[0]),r(A,A),p?(a(L,l[0],h),r(j,L)):e(j,0,0,1),Ee(A,j,R,R,P,j,De),c(M,j),c(B,P);for(let e=0;e<d.length;e++)i(F,P,d[e][0]),i(L,j,d[e][2]),a(F,F,L),a(F,F,l[0]),v[D++]=F[0],v[D++]=F[1],v[D++]=F[2];y[O++]=-A[0],y[O++]=-A[1],y[O++]=-A[2];for(let e=0;e<f.length;e++)w.push(f[e][0]>0?f[e][0]:-f[e][0]-1+d.length),w.push(f[e][1]>0?f[e][1]:-f[e][1]-1+d.length),w.push(f[e][2]>0?f[e][2]:-f[e][2]-1+d.length),T.push(0),T.push(0),T.push(0);let H=d.length,ne=d.length-1;for(let e=0;e<l.length;e++){let t=!1;e>0&&(c(k,A),e<l.length-1?(n(A,l[e+1],l[e]),r(A,A)):t=!0,a(z,k,A),r(z,z),a(ee,l[e-1],M),x(l[e],z,te),S(te,C(ee,k),L)?(n(L,L,l[e]),r(j,L),s(P,z,j),r(P,P)):Ee(z,M,B,R,P,j,De),c(M,j),c(B,P)),p&&(a(L,l[e],h),r(V,L));for(let n=0;n<_;n++)if(i(F,P,o[n][0]),i(L,j,o[n][1]),a(F,F,L),r(I,F),y[O++]=I[0],y[O++]=I[1],y[O++]=I[2],a(F,F,l[e]),v[D++]=F[0],v[D++]=F[1],v[D++]=F[2],!t){let e=(n+1)%_;w.push(H+n),w.push(H+_+n),w.push(H+e),w.push(H+e),w.push(H+_+n),w.push(H+_+e);for(let e=0;e<6;e++){let t=w.length-6;T.push(w[t+e]-ne)}}H+=_}let re=l[l.length-1];for(let e=0;e<d.length;e++)i(F,P,d[e][0]),i(L,j,d[e][1]),a(F,F,L),a(F,F,re),v[D++]=F[0],v[D++]=F[1],v[D++]=F[2];let U=O/3;y[O++]=A[0],y[O++]=A[1],y[O++]=A[2];let W=H-_;for(let e=0;e<f.length;e++)w.push(f[e][0]>=0?H+f[e][0]:-f[e][0]-1+W),w.push(f[e][2]>=0?H+f[e][2]:-f[e][2]-1+W),w.push(f[e][1]>=0?H+f[e][1]:-f[e][1]-1+W),T.push(U),T.push(U),T.push(U);let G=[[`position`,new E(v,w,3,!0)],[`normal`,new E(y,T,3,!0)]];return new N(t,G)}function xe(e,t,n,r,i){let a=h(t.length*3),o=Array(2*(t.length-1)),s=0,c=0;for(let e=0;e<t.length;e++){for(let n=0;n<3;n++)a[s++]=t[e][n];e>0&&(o[c++]=e-1,o[c++]=e)}let l=[[`position`,new E(a,o,3,!0)]];if(n?.length===t.length&&n[0].length===3){let e=g(n.length*3),r=0;for(let i=0;i<t.length;i++)for(let t=0;t<3;t++)e[r++]=n[i][t];l.push([`normal`,new E(e,o,3,!0)])}if(r&&l.push([`color`,new E(r,v(r.length/4),4)]),i?.length===t.length){let e=w(i,1);l.push([`timeStamps`,new E(e,o,T,!0)])}return new N(e,l,null)}function Se(e,t,n,r,i,a=0){let o=Array(18),s=[[-n,a,i/2],[r,a,i/2],[0,t+a,i/2],[-n,a,-i/2],[r,a,-i/2],[0,t+a,-i/2]],c=[0,1,2,3,0,2,2,5,3,1,4,5,5,2,1,1,0,3,3,4,1,4,3,5];for(let e=0;e<6;e++)o[e*3]=s[e][0],o[e*3+1]=s[e][1],o[e*3+2]=s[e][2];return new N(e,[[`position`,new E(o,c,3,!0)]])}function Ce(n,r){let i=n.getMutableAttribute(`position`).data;for(let n=0;n<i.length;n+=3){let a=i[n],o=i[n+1],s=i[n+2];e($,a,o,s),t($,$,r),i[n]=$[0],i[n+1]=$[1],i[n+2]=$[2]}}function we(e,t=e){let n=e.attributes,r=n.get(`position`).data,i=n.get(`normal`).data;if(i){let e=t.getMutableAttribute(`normal`).data;for(let t=0;t<i.length;t+=3){let n=i[t+1];e[t+1]=-i[t+2],e[t+2]=n}}if(r){let e=t.getMutableAttribute(`position`).data;for(let t=0;t<r.length;t+=3){let n=r[t+1];e[t+1]=-r[t+2],e[t+2]=n}}}function Te(e,t,n,i,a){return Math.abs(o(t,e))>a?!1:(s(n,e,t),r(n,n),s(i,n,e),r(i,i),!0)}function Ee(e,t,n,r,i,a,o){return Te(e,t,i,a,o)||Te(e,n,i,a,o)||Te(e,r,i,a,o)}const De=.99619469809,$=m();export{we as cgToGIS,te as createBoxGeometry,_e as createConeGeometry,ge as createConeGeometryData,ve as createCylinderGeometry,W as createDiamondGeometry,Se as createExtrudedTriangle,be as createPathExtrusionGeometry,pe as createPointBufferGeometry,fe as createPolySphereData,de as createPolySphereGeometry,xe as createPolylineGeometry,ue as createSphereGeometry,he as createSquareGeometry,le as createTetrahedronGeometry,ye as createTubeGeometry,Ee as makeOrthoBasisDirUpFallback,Ce as transformInPlace};