@arcgis/core 5.1.0-next.93 → 5.1.0-next.95

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 (499) hide show
  1. package/Graphic.js +1 -1
  2. package/analysis/Viewshed.js +1 -1
  3. package/arcade/arcadeAsyncRuntime.js +1 -1
  4. package/arcade/arcadeCompiler.js +1 -1
  5. package/arcade/arcadeRuntime.js +1 -1
  6. package/arcade/compilerUtils.js +1 -1
  7. package/arcade/debug.d.ts +10 -1
  8. package/arcade.js +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/02aaeaa988e9e7d65a7f.js +1 -0
  11. package/assets/esri/core/workers/chunks/031ea31bbdb7f1be791e.js +1 -0
  12. package/assets/esri/core/workers/chunks/03a4543b94f9adeb1852.js +1 -0
  13. package/assets/esri/core/workers/chunks/05c52e8f187740da9b36.js +1 -0
  14. package/assets/esri/core/workers/chunks/0630ce1975c91ae362d9.js +1 -0
  15. package/assets/esri/core/workers/chunks/{7f0f10946f05a09b5654.js → 07ddf1b1f7602063ceb0.js} +1 -1
  16. package/assets/esri/core/workers/chunks/0ab1384282afc8731857.js +1 -0
  17. package/assets/esri/core/workers/chunks/{be47e42c6c8c0820efd8.js → 0e6b24e8864940ed9877.js} +1 -1
  18. package/assets/esri/core/workers/chunks/0f527961805cd45c14e2.js +1 -0
  19. package/assets/esri/core/workers/chunks/11a99ee68409a641810e.js +1 -0
  20. package/assets/esri/core/workers/chunks/11b0d3a825fe50dd1e84.js +1 -0
  21. package/assets/esri/core/workers/chunks/130abc6a353e4d79a1b1.js +1 -0
  22. package/assets/esri/core/workers/chunks/16006dc0cb95f7c291a5.js +1 -0
  23. package/assets/esri/core/workers/chunks/177472a6a9beb1590934.js +1 -0
  24. package/assets/esri/core/workers/chunks/19a9a555365a8363d34b.js +1 -0
  25. package/assets/esri/core/workers/chunks/1a68a249540fda9083a9.js +1 -0
  26. package/assets/esri/core/workers/chunks/1ae016e4f5e39c34a941.js +1 -0
  27. package/assets/esri/core/workers/chunks/{43f58604ba4a94a9167c.js → 1f3a676e7a4eae5ad566.js} +1 -1
  28. package/assets/esri/core/workers/chunks/23241e6093e245f9c774.js +1 -0
  29. package/assets/esri/core/workers/chunks/{172228d1a392ca7a5b21.js → 246253fbbb2ecea48f91.js} +1 -1
  30. package/assets/esri/core/workers/chunks/25d795a1697803d77e56.js +1 -0
  31. package/assets/esri/core/workers/chunks/268ed861c882740c805b.js +1 -0
  32. package/assets/esri/core/workers/chunks/{da008d6a3afb30d18392.js → 299b4eecd0288348c971.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{df8a3d3cac454d42e14d.js → 29aba121db7f00e0cf81.js} +1 -1
  34. package/assets/esri/core/workers/chunks/2b52c1c01cf568ba01fb.js +1 -0
  35. package/assets/esri/core/workers/chunks/2f6ba01ea8b8f193bea5.js +1 -0
  36. package/assets/esri/core/workers/chunks/{f52443cd203e687551da.js → 2fda38219d778f0447b5.js} +1 -1
  37. package/assets/esri/core/workers/chunks/2ffffc1931b2e27c6617.js +1 -0
  38. package/assets/esri/core/workers/chunks/3116a1c2b67a296ba86e.js +1 -0
  39. package/assets/esri/core/workers/chunks/31837f2f8859e2cf2efd.js +1 -0
  40. package/assets/esri/core/workers/chunks/3241e0ed26aff61ec213.js +1 -0
  41. package/assets/esri/core/workers/chunks/330da3828eefd8d72d3f.js +1 -0
  42. package/assets/esri/core/workers/chunks/359465b9726edcc70c83.js +1 -0
  43. package/assets/esri/core/workers/chunks/36ecb0082b8804b10fbf.js +1 -0
  44. package/assets/esri/core/workers/chunks/389e57aab12d52d72695.js +1 -0
  45. package/assets/esri/core/workers/chunks/38b1d2ffcc318ac0119d.js +1 -0
  46. package/assets/esri/core/workers/chunks/390717f079def83a0d9c.js +1 -0
  47. package/assets/esri/core/workers/chunks/{3397eae416622c64e628.js → 3f0483cbcd893acf240c.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{77c2d8d0ce1c1ab469e9.js → 40afdb74517a7df59e0d.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{41cbde4738ae4adf973d.js → 4142d5232c99d8aa943d.js} +5 -5
  50. package/assets/esri/core/workers/chunks/41e811138c96d85fd3e8.js +1 -0
  51. package/assets/esri/core/workers/chunks/43b5cfb34b11c4124b51.js +1 -0
  52. package/assets/esri/core/workers/chunks/{747e258f57f0543c836e.js → 43cc82373be791b7cb4c.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{8a370cc1a99ddc7ce70b.js → 4456bbb4b7dfe80c7477.js} +1 -1
  54. package/assets/esri/core/workers/chunks/44b30dfce12824ee1f33.js +1 -0
  55. package/assets/esri/core/workers/chunks/453c3b265481c80fc625.js +1 -0
  56. package/assets/esri/core/workers/chunks/4644e1b00fd4e628219d.js +1 -0
  57. package/assets/esri/core/workers/chunks/47dd2bfecc5c4b5f10f0.js +1 -0
  58. package/assets/esri/core/workers/chunks/4b19acf8bde5b2e80692.js +1 -0
  59. package/assets/esri/core/workers/chunks/4faaf61d20e20fcf6c18.js +1 -0
  60. package/assets/esri/core/workers/chunks/{a169d9fe66b5865911d9.js → 503439246250d9e1cbd5.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{f8072a4cf1b25d8b93f9.js → 509beae195c900a85e0b.js} +1 -1
  62. package/assets/esri/core/workers/chunks/5217d676749bca59d90f.js +1 -0
  63. package/assets/esri/core/workers/chunks/{1e3fe89970c57a883fe5.js → 53ff47c06ccfc0be885c.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{53750e85f3128993a43a.js → 545c38789267e3487dbd.js} +1 -1
  65. package/assets/esri/core/workers/chunks/54dad475dc806a38c287.js +1 -0
  66. package/assets/esri/core/workers/chunks/5648379d1ed4ca02eedd.js +1 -0
  67. package/assets/esri/core/workers/chunks/{12f41c1c66fb446b6286.js → 5853925d2f7fb550bd2e.js} +11 -11
  68. package/assets/esri/core/workers/chunks/58579c53be1a44bd08d2.js +1 -0
  69. package/assets/esri/core/workers/chunks/598271956c46e21e5c09.js +1 -0
  70. package/assets/esri/core/workers/chunks/{d82da31dc702b8fd6a07.js → 59a64d72eed8c40c63cf.js} +1 -1
  71. package/assets/esri/core/workers/chunks/5ea0096a282e87a269bd.js +1 -0
  72. package/assets/esri/core/workers/chunks/63378b0b4265a547656b.js +1 -0
  73. package/assets/esri/core/workers/chunks/{394812e19b6915d560b0.js → 642be1619c0e76355cb6.js} +1 -1
  74. package/assets/esri/core/workers/chunks/65b0b4e808479187da00.js +1 -0
  75. package/assets/esri/core/workers/chunks/6666cd3bf1a3d175dc8c.js +1 -0
  76. package/assets/esri/core/workers/chunks/69a1cbf0af059548f96a.js +1 -0
  77. package/assets/esri/core/workers/chunks/6ae2408ac075b974e887.js +1 -0
  78. package/assets/esri/core/workers/chunks/{19a0cb2d335d97ad9488.js → 6b4c99c7648f37feec00.js} +1 -1
  79. package/assets/esri/core/workers/chunks/6b79c254897ece95b7a3.js +1 -0
  80. package/assets/esri/core/workers/chunks/6d66dc77af8d112c33c6.js +1 -0
  81. package/assets/esri/core/workers/chunks/71119398ec91f1b209d7.js +1 -0
  82. package/assets/esri/core/workers/chunks/71e12db99589c98a4357.js +1 -0
  83. package/assets/esri/core/workers/chunks/7536f0683e488159d8bd.js +1 -0
  84. package/assets/esri/core/workers/chunks/76589434d573111a8fb4.js +1 -0
  85. package/assets/esri/core/workers/chunks/{6f67c9f68101a084b683.js → 765bc49e58e9d0caa496.js} +6 -6
  86. package/assets/esri/core/workers/chunks/7c2d2f22df057ba8cb50.js +1 -0
  87. package/assets/esri/core/workers/chunks/7d6299ab7b0db23ab961.js +1 -0
  88. package/assets/esri/core/workers/chunks/8042e001545e2782499c.js +1 -0
  89. package/assets/esri/core/workers/chunks/82b2acc6f181927de89c.js +1 -0
  90. package/assets/esri/core/workers/chunks/85a200aecc7a844c9566.js +1 -0
  91. package/assets/esri/core/workers/chunks/89250d268dc2554a9ece.js +1 -0
  92. package/assets/esri/core/workers/chunks/8a23a62cbf1c5b4019c5.js +1 -0
  93. package/assets/esri/core/workers/chunks/8ac8ef856ed9592c433b.js +1 -0
  94. package/assets/esri/core/workers/chunks/8bfe4841c83eb3abfbe8.js +1 -0
  95. package/assets/esri/core/workers/chunks/{6aed2e42e65ac80f1fab.js → 8de61993e114f453579b.js} +1 -1
  96. package/assets/esri/core/workers/chunks/8e374ce47256a567ae11.js +1 -0
  97. package/assets/esri/core/workers/chunks/8f992ff87173a3ca1621.js +640 -0
  98. package/assets/esri/core/workers/chunks/{d7e7f3efd1d28617b808.js → 92e7067960549733f8e6.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{f1673e723b336204ad77.js → 9b23d999db902d25ba58.js} +1 -1
  100. package/assets/esri/core/workers/chunks/9bb2251ba58932f85d13.js +1 -0
  101. package/assets/esri/core/workers/chunks/{d8ccc713c5ad93e7a0c3.js → 9bd713d96502ddc2ce25.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{8351012ceb466f01b8fd.js → 9d8e7839772029d83c93.js} +1 -1
  103. package/assets/esri/core/workers/chunks/a12fd6a445f42326642f.js +1 -0
  104. package/assets/esri/core/workers/chunks/a50fd0e66b01fe205033.js +1 -0
  105. package/assets/esri/core/workers/chunks/{51716e411fad624ac21c.js → a567d001fcfa1f1cdeea.js} +1 -1
  106. package/assets/esri/core/workers/chunks/{5eff240a0e41a4f80e61.js → a68b5cb66c2c5e6b46e0.js} +1 -1
  107. package/assets/esri/core/workers/chunks/a8e2fbbfbdf1c3203d5e.js +1 -0
  108. package/assets/esri/core/workers/chunks/a94674826e5893c9d197.js +1 -0
  109. package/assets/esri/core/workers/chunks/aad02c7417648d881129.js +1 -0
  110. package/assets/esri/core/workers/chunks/ad329226c8b579d0964c.js +1 -0
  111. package/assets/esri/core/workers/chunks/afdc6fc453157528cf9b.js +1 -0
  112. package/assets/esri/core/workers/chunks/b2504657d3ef8769005e.js +1 -0
  113. package/assets/esri/core/workers/chunks/b7f5d51ac26f37837b3b.js +1 -0
  114. package/assets/esri/core/workers/chunks/b90db0829da3f96e4a19.js +1 -0
  115. package/assets/esri/core/workers/chunks/{359d3acb3953e64e5a78.js → ba7fe21a78ea37a02b7c.js} +1 -1
  116. package/assets/esri/core/workers/chunks/bd17ac2e6f1eb8cf7abf.js +1 -0
  117. package/assets/esri/core/workers/chunks/bd721bbc7afc75d3bddb.js +1 -0
  118. package/assets/esri/core/workers/chunks/bd9dae2d5ec199f8e9ba.js +1 -0
  119. package/assets/esri/core/workers/chunks/{75c09a2fa4c34b4844c5.js → be0eab592db0e651b023.js} +6 -6
  120. package/assets/esri/core/workers/chunks/be19d4a6fb9b1c923127.js +1 -0
  121. package/assets/esri/core/workers/chunks/beba9f2213d8a850ddb6.js +1 -0
  122. package/assets/esri/core/workers/chunks/{f706bfea34d22539b46a.js → bf6c6bc15b0d2d82d1a4.js} +2 -2
  123. package/assets/esri/core/workers/chunks/bf706a5d065a357de51b.js +1 -0
  124. package/assets/esri/core/workers/chunks/{baea6f86b2dbe067940e.js → bf73232057ebc1ecc0ad.js} +1 -1
  125. package/assets/esri/core/workers/chunks/c2589e5e0e0f81a378c2.js +1 -0
  126. package/assets/esri/core/workers/chunks/c321bcda8e8893577948.js +1 -0
  127. package/assets/esri/core/workers/chunks/c33f1f722499a5c6fc11.js +1 -0
  128. package/assets/esri/core/workers/chunks/c452c74ba9de218c3e57.js +1 -0
  129. package/assets/esri/core/workers/chunks/{fade7b878a9498382bb2.js → c514135bf7703ba69a47.js} +1 -1
  130. package/assets/esri/core/workers/chunks/c798a40418e7ff38042a.js +1 -0
  131. package/assets/esri/core/workers/chunks/{969f58a2de4ebe63619d.js → c88fd4f69cb2b53b48ec.js} +1 -1
  132. package/assets/esri/core/workers/chunks/ca6c128940ddbebcaaab.js +1 -0
  133. package/assets/esri/core/workers/chunks/{c7ee05f46b26b17f9414.js → ce2ed9405ff1b704d35c.js} +1 -1
  134. package/assets/esri/core/workers/chunks/ce3e51c799a80648e46d.js +1 -0
  135. package/assets/esri/core/workers/chunks/{e81afc8a058a8ecc9b24.js → ce4e09b623ebb640c46c.js} +1 -1
  136. package/assets/esri/core/workers/chunks/cf7acf5acb6d322fd996.js +1 -0
  137. package/assets/esri/core/workers/chunks/{e0b27bceb397482bd0e8.js → d122431f3b0b88dcb488.js} +1 -1
  138. package/assets/esri/core/workers/chunks/{2647c739cda29361a463.js → d87e504082e293640ece.js} +2 -2
  139. package/assets/esri/core/workers/chunks/d8c4fb66c733ab2f66d3.js +1 -0
  140. package/assets/esri/core/workers/chunks/d8d338665fe00494c826.js +1 -0
  141. package/assets/esri/core/workers/chunks/d93a4ccf8f0208dc6ad7.js +1 -0
  142. package/assets/esri/core/workers/chunks/de11ebcea2b8f9dfe65d.js +1 -0
  143. package/assets/esri/core/workers/chunks/e03713dee3205c96d53f.js +1 -0
  144. package/assets/esri/core/workers/chunks/e133840540abf20262a4.js +1 -0
  145. package/assets/esri/core/workers/chunks/e54ad3683ad992682deb.js +1 -0
  146. package/assets/esri/core/workers/chunks/{3092184350d66c79f610.js → e5d969214d9eda5c0b4c.js} +1 -1
  147. package/assets/esri/core/workers/chunks/e63e24101e7e92c62d98.js +1 -0
  148. package/assets/esri/core/workers/chunks/e7e7c7cbfd8542bd7a46.js +1 -0
  149. package/assets/esri/core/workers/chunks/ead6e4d0a515c0913bee.js +1 -0
  150. package/assets/esri/core/workers/chunks/ee635172be7fdea69367.js +1 -0
  151. package/assets/esri/core/workers/chunks/{aefeb5a17bb481c95da3.js → eeb847bfea558566adf6.js} +1 -1
  152. package/assets/esri/core/workers/chunks/{d11de13537b623739e14.js → f14e3693cd644265f909.js} +1 -1
  153. package/assets/esri/core/workers/chunks/f196ad0c7dbcbf632776.js +1 -0
  154. package/assets/esri/core/workers/chunks/f31deeedb2508e81293b.js +2 -0
  155. package/assets/esri/core/workers/chunks/f618ee43581e8de6ad0c.js +1 -0
  156. package/assets/esri/core/workers/chunks/{2fd4220131bfc3f5e2dd.js → f635a8e3b0bfeda99ed5.js} +1 -1
  157. package/assets/esri/core/workers/chunks/f66262f8582909157f01.js +1 -0
  158. package/assets/esri/core/workers/chunks/f69c44479ee3fd8c831d.js +1 -0
  159. package/assets/esri/core/workers/chunks/{ea97619a4470f1540b99.js → f6ebec8d2248c719b89f.js} +1 -1
  160. package/assets/esri/core/workers/chunks/f948e4a80a7dbda70f2e.js +1 -0
  161. package/assets/esri/core/workers/chunks/f95e3333a65a0c09fd1e.js +1 -0
  162. package/assets/esri/core/workers/chunks/fa3138dd8139008b430d.js +1 -0
  163. package/assets/esri/core/workers/chunks/fa9ab152ea785b5e97e0.js +1 -0
  164. package/assets/esri/core/workers/chunks/fae147d03ed723ab234d.js +1 -0
  165. package/assets/esri/core/workers/chunks/fae79769df54eb4c4154.js +1 -0
  166. package/assets/esri/core/workers/chunks/fd2afff07aaac8203c18.js +1 -0
  167. package/assets/esri/core/workers/chunks/fdb7851e98e8d2ba48d3.js +1 -0
  168. package/assets/esri/core/workers/chunks/ff7708aaa2de720e3a47.js +1 -0
  169. package/assets/esri/core/workers/chunks/ffb8fa77297578afef7c.js +1 -0
  170. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  171. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  172. package/chunks/GaussianSplat.glsl.js +8 -8
  173. package/chunks/GlobalIllumination.glsl.js +31 -31
  174. package/chunks/GlowComposition.glsl.js +4 -4
  175. package/chunks/OITBlend.glsl.js +3 -7
  176. package/chunks/OITBlendEmission.glsl.js +22 -0
  177. package/chunks/{OITDim.glsl.js → OITDimOpaque.glsl.js} +2 -2
  178. package/chunks/RibbonLine.glsl.js +57 -53
  179. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  180. package/chunks/arcgis-knowledge-client-core.js +1 -1
  181. package/config.js +1 -1
  182. package/core/has.js +1 -1
  183. package/geometry/support/geometryUtils.js +1 -1
  184. package/geometry/support/heightModelInfoUtils.js +1 -1
  185. package/kernel.js +1 -1
  186. package/layers/DimensionFeatureLayer.d.ts +7 -0
  187. package/layers/DimensionFeatureLayer.js +2 -0
  188. package/layers/FeatureLayer.d.ts +27 -1
  189. package/layers/FeatureLayer.js +1 -1
  190. package/layers/catalog/CatalogFootprintLayer.js +1 -1
  191. package/layers/graphics/OptimizedFeature.js +1 -1
  192. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  193. package/layers/graphics/data/optimizedFeatureQueryEngineAdapter.js +1 -1
  194. package/layers/graphics/featureConversionUtils.js +1 -1
  195. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  196. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  197. package/layers/mixins/ArcGISImageService.js +1 -1
  198. package/layers/mixins/FeatureReductionLayer.js +1 -1
  199. package/layers/mixins/PortalLayer.js +1 -1
  200. package/layers/raster/datasets/ImageAuxRaster.js +1 -1
  201. package/layers/raster/datasets/InMemoryRaster.js +1 -1
  202. package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
  203. package/layers/raster/formats/RasterCodec.js +1 -1
  204. package/layers/support/RasterJobHandler.js +1 -1
  205. package/layers/support/capabilities.js +1 -1
  206. package/layers/support/layerUtils.js +1 -1
  207. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  208. package/layers/types.d.ts +1 -1
  209. package/networks/support/CircuitPathConnectivityElement.js +1 -1
  210. package/networks/support/networkFieldUtils.js +1 -1
  211. package/package.json +2 -2
  212. package/popup/Features.js +1 -1
  213. package/portal/schemas/definitions.js +1 -1
  214. package/portal/support/layersLoader.js +1 -1
  215. package/rest/knowledgeGraph/ReplicaDefinition.d.ts +0 -3
  216. package/rest/knowledgeGraph/types.d.ts +1 -1
  217. package/rest/knowledgeGraph/wasmInterface/queryToWasmEncodedFactories.js +1 -1
  218. package/rest/knowledgeGraph/wasmInterface/replicaToWasmEncodedFactories.js +1 -1
  219. package/rest/support/Query.js +1 -1
  220. package/rest/versionManagement/gdbVersion/support/ConflictsParameters.js +1 -1
  221. package/rest/versionManagement/gdbVersion/support/DifferencesParameters.js +1 -1
  222. package/rest/versionManagement/gdbVersion/support/DifferencesResult.d.ts +25 -0
  223. package/rest/versionManagement/gdbVersion/support/InspectConflictsParameters.js +1 -1
  224. package/rest/versionManagement/gdbVersion/support/ReconcileParameters.d.ts +3 -5
  225. package/rest/versionManagement/gdbVersion/support/ReconcileParameters.js +1 -1
  226. package/support/revision.js +1 -1
  227. package/symbols/cim/CIMEffects.js +1 -1
  228. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  229. package/symbols/cim/CIMSymbolHelper.js +1 -1
  230. package/symbols/cim/defaultCIMValues.js +1 -1
  231. package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
  232. package/symbols/cim/effects/EffectArrow.js +1 -1
  233. package/symbols/cim/effects/EffectBuffer.js +1 -1
  234. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  235. package/symbols/cim/effects/EffectCut.js +1 -1
  236. package/symbols/cim/effects/EffectDashes.js +1 -1
  237. package/symbols/cim/effects/EffectDonut.js +1 -1
  238. package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
  239. package/symbols/cim/effects/EffectHelper.js +1 -1
  240. package/symbols/cim/effects/EffectJog.js +1 -1
  241. package/symbols/cim/effects/EffectMove.js +1 -1
  242. package/symbols/cim/effects/EffectOffset.js +1 -1
  243. package/symbols/cim/effects/EffectRadial.js +1 -1
  244. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  245. package/symbols/cim/effects/EffectWave.js +1 -1
  246. package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
  247. package/symbols/cim/types.d.ts +34 -1
  248. package/symbols/cim/utils.js +1 -1
  249. package/symbols/dimensions/effects/LinearDimensionArrowEffect.js +1 -1
  250. package/symbols/dimensions/effects/LinearDimensionExtensionLineEffect.js +1 -1
  251. package/symbols/dimensions/effects/LinearDimensionLeaderLineEffect.js +1 -1
  252. package/symbols/dimensions/effects/LinearDimensionLineEffect.js +1 -1
  253. package/symbols/dimensions/effects/LinearDimensionPointEffect.js +1 -1
  254. package/symbols/dimensions/effects/LinearDimensionTextEffect.js +1 -1
  255. package/symbols/types.d.ts +1 -1
  256. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  257. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  258. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  259. package/views/2d/engine/webgl/GlyphSDFCreator.js +1 -1
  260. package/views/2d/engine/webgl/alignmentUtils.js +1 -1
  261. package/views/2d/engine/webgl/definitions.js +1 -1
  262. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  263. package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
  264. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  265. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
  266. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  267. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
  268. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
  269. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
  270. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js +1 -1
  271. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
  272. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js +1 -1
  273. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  274. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js +1 -1
  275. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
  276. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js +1 -1
  277. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  278. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  279. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js +1 -1
  280. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  281. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  282. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  283. package/views/2d/layerViewModuleImportUtils.js +1 -1
  284. package/views/2d/layers/DimensionLayerView2D.js +2 -0
  285. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  286. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  287. package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +2 -0
  288. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  289. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  290. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  291. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  292. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  293. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  294. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  295. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  296. package/views/2d/layers/features/sources/strategies/AFeatureTileLoadStrategy.js +1 -1
  297. package/views/2d/layers/features/sources/strategies/FeatureHybridTileLoadStrategy.js +2 -0
  298. package/views/2d/layers/features/sources/strategies/chunks/ByReferenceTileSourceChunk.js +2 -0
  299. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  300. package/views/2d/layers/features/support/DisplayIdGenerator.js +1 -1
  301. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  302. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  303. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  304. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  305. package/views/2d/layers/features/support/RefCounted.js +2 -0
  306. package/views/2d/types.d.ts +2 -0
  307. package/views/3d/layerViewModuleImportUtils.js +1 -1
  308. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  309. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  310. package/views/3d/support/QualityProfile.js +1 -1
  311. package/views/3d/support/QualitySettings.js +1 -1
  312. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  313. package/views/3d/types.d.ts +2 -0
  314. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +11 -12
  315. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +5 -5
  316. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +1 -1
  317. package/views/3d/webgl-engine/core/shaderLibrary/util/{ComputeCovariance.glsl.js → GaussianSplatCovariance.glsl.js} +15 -9
  318. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js +43 -0
  319. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js +36 -0
  320. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
  321. package/views/3d/webgl-engine/effects/atmosphere/LocalAtmosphere.js +1 -1
  322. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  323. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  324. package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
  325. package/views/3d/webgl-engine/effects/clouds/NoiseTextureAtlas.js +1 -1
  326. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  327. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  328. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  329. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  330. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  331. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  332. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  333. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  334. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.js +1 -1
  335. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  336. package/views/3d/webgl-engine/effects/precipitation/Precipitation.js +1 -1
  337. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  338. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  339. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  340. package/views/3d/webgl-engine/effects/transparency/OITBlend.glsl.js +1 -1
  341. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  342. package/views/3d/webgl-engine/effects/transparency/OITBlendEmission.glsl.js +2 -0
  343. package/views/3d/webgl-engine/effects/transparency/OITBlendEmissionTechnique.js +2 -0
  344. package/views/3d/webgl-engine/effects/transparency/OITBlendEmissionTechniqueConfiguration.js +2 -0
  345. package/views/3d/webgl-engine/effects/transparency/OITBlendTechniqueConfiguration.js +1 -1
  346. package/views/3d/webgl-engine/effects/transparency/{OITDim.glsl.js → OITDimOpaque.glsl.js} +1 -1
  347. package/views/3d/webgl-engine/effects/transparency/OITDimOpaqueTechnique.js +2 -0
  348. package/views/3d/webgl-engine/effects/transparency/{OITDimTechniqueConfiguration.js → OITDimOpaqueTechniqueConfiguration.js} +1 -1
  349. package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
  350. package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
  351. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  352. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  353. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  354. package/views/3d/webgl-engine/shaders/oitResolution.glsl.js +1 -1
  355. package/views/PopupView.js +1 -1
  356. package/views/SceneView.d.ts +3 -3
  357. package/views/layers/FeatureLikeLayerView.d.ts +2 -1
  358. package/views/layers/FeatureLikeLayerView.js +1 -1
  359. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +12 -12
  360. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  361. package/widgets/FeatureTable/Grid/Column.d.ts +2 -17
  362. package/widgets/FeatureTable/Grid/Column.js +1 -1
  363. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  364. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  365. package/widgets/FeatureTable/Grid/GroupColumn.d.ts +1 -7
  366. package/widgets/FeatureTable/Grid/GroupColumn.js +1 -1
  367. package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +1 -9
  368. package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
  369. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  370. package/widgets/FeatureTable/support/types.d.ts +0 -8
  371. package/widgets/FeatureTable.d.ts +18 -3
  372. package/widgets/FeatureTable.js +1 -1
  373. package/widgets/Features/FeaturesViewModel.js +1 -1
  374. package/widgets/Search/support/layerSearchUtils.js +1 -1
  375. package/widgets/Search/support/locatorUtils.js +1 -1
  376. package/assets/esri/core/workers/chunks/00e9e25269d5776f8645.js +0 -1
  377. package/assets/esri/core/workers/chunks/014a5fad55f97b9b5166.js +0 -1
  378. package/assets/esri/core/workers/chunks/015fc0a17b17d69cc3bb.js +0 -1
  379. package/assets/esri/core/workers/chunks/02e8fc598ee09cf1b678.js +0 -1
  380. package/assets/esri/core/workers/chunks/06003996a378c45bc605.js +0 -1
  381. package/assets/esri/core/workers/chunks/0a6df243b18acae471be.js +0 -1
  382. package/assets/esri/core/workers/chunks/127cd8fee3717a473fc5.js +0 -1
  383. package/assets/esri/core/workers/chunks/146424b5717d0a645ee1.js +0 -1
  384. package/assets/esri/core/workers/chunks/169ca3724053fc046d1b.js +0 -1
  385. package/assets/esri/core/workers/chunks/17445fd8048966617d49.js +0 -1
  386. package/assets/esri/core/workers/chunks/1765dfeac20e34ce25b7.js +0 -1
  387. package/assets/esri/core/workers/chunks/1768f1a7e3caa6074d91.js +0 -1
  388. package/assets/esri/core/workers/chunks/1906416c84bab369bbd6.js +0 -1
  389. package/assets/esri/core/workers/chunks/1a35121a0c2595a41fdb.js +0 -1
  390. package/assets/esri/core/workers/chunks/1f85646936200a399c15.js +0 -1
  391. package/assets/esri/core/workers/chunks/1ff3c15a51c4dc991806.js +0 -1
  392. package/assets/esri/core/workers/chunks/206bdfd868a9ef88f3a8.js +0 -1
  393. package/assets/esri/core/workers/chunks/2343b1105bc4c1b4a086.js +0 -1
  394. package/assets/esri/core/workers/chunks/2387613b855771a3e537.js +0 -1
  395. package/assets/esri/core/workers/chunks/2b0b398180ed98c2c84c.js +0 -1
  396. package/assets/esri/core/workers/chunks/3469df5c4846b0cee012.js +0 -1
  397. package/assets/esri/core/workers/chunks/34b6b5dd415c68f0b0d1.js +0 -1
  398. package/assets/esri/core/workers/chunks/34f7450769826e8b7069.js +0 -636
  399. package/assets/esri/core/workers/chunks/36f6673b23579b88d8f7.js +0 -1
  400. package/assets/esri/core/workers/chunks/384c235d36f32769e32b.js +0 -1
  401. package/assets/esri/core/workers/chunks/38c28189f273636e4017.js +0 -1
  402. package/assets/esri/core/workers/chunks/3a183259805638c25363.js +0 -1
  403. package/assets/esri/core/workers/chunks/3d9032217347dadcbe41.js +0 -1
  404. package/assets/esri/core/workers/chunks/3efbb684c0409955186d.js +0 -1
  405. package/assets/esri/core/workers/chunks/3feec3d08424b94e1bcf.js +0 -1
  406. package/assets/esri/core/workers/chunks/412745bfacef23e3b702.js +0 -1
  407. package/assets/esri/core/workers/chunks/46b16501db6681dc467b.js +0 -1
  408. package/assets/esri/core/workers/chunks/47b3a5213539548ff3a6.js +0 -1
  409. package/assets/esri/core/workers/chunks/48549d3d7bf0154c0afa.js +0 -1
  410. package/assets/esri/core/workers/chunks/4b79ebfb3328f9483147.js +0 -1
  411. package/assets/esri/core/workers/chunks/4c97cc922eece3a91b6b.js +0 -1
  412. package/assets/esri/core/workers/chunks/4dbbf59c79d9e72f20ee.js +0 -1
  413. package/assets/esri/core/workers/chunks/4e206957b28253ddc1a3.js +0 -1
  414. package/assets/esri/core/workers/chunks/52b3a11c962810bc6dbe.js +0 -1
  415. package/assets/esri/core/workers/chunks/53ef72edc3ed80bf558c.js +0 -1
  416. package/assets/esri/core/workers/chunks/54c035cdc171998d0776.js +0 -1
  417. package/assets/esri/core/workers/chunks/54c6e870262469d0d702.js +0 -1
  418. package/assets/esri/core/workers/chunks/55fd201ca5e10c6e4761.js +0 -1
  419. package/assets/esri/core/workers/chunks/566f6319ded0634769e0.js +0 -1
  420. package/assets/esri/core/workers/chunks/56717ff315c6ec874142.js +0 -1
  421. package/assets/esri/core/workers/chunks/56941e8bbd2d49bf2656.js +0 -1
  422. package/assets/esri/core/workers/chunks/5fccb372b4d5ee2f64cc.js +0 -1
  423. package/assets/esri/core/workers/chunks/60cee9a44929decd2474.js +0 -1
  424. package/assets/esri/core/workers/chunks/6124141ac642e4ce1454.js +0 -1
  425. package/assets/esri/core/workers/chunks/61fada8942b65fa0b5e1.js +0 -1
  426. package/assets/esri/core/workers/chunks/65c61171e6c6be5c5c2f.js +0 -1
  427. package/assets/esri/core/workers/chunks/6a3d207308b29651f397.js +0 -1
  428. package/assets/esri/core/workers/chunks/6d696beddcc5fbed5875.js +0 -1
  429. package/assets/esri/core/workers/chunks/6dac8dfcd63fc757ae2d.js +0 -1
  430. package/assets/esri/core/workers/chunks/71cfab6305f275cfb04e.js +0 -1
  431. package/assets/esri/core/workers/chunks/728ad5bbbcbf88d6249f.js +0 -1
  432. package/assets/esri/core/workers/chunks/7b505112c7e6d9b7a239.js +0 -1
  433. package/assets/esri/core/workers/chunks/7b6c8be59ed87e386aa4.js +0 -1
  434. package/assets/esri/core/workers/chunks/7ba67f1d7831a5576a5a.js +0 -1
  435. package/assets/esri/core/workers/chunks/7c820c5f6f05480d5050.js +0 -1
  436. package/assets/esri/core/workers/chunks/7ef51b0ebd560113ae7e.js +0 -1
  437. package/assets/esri/core/workers/chunks/80f4f686ce403cb2693f.js +0 -1
  438. package/assets/esri/core/workers/chunks/81d761c837b7456ec99f.js +0 -1
  439. package/assets/esri/core/workers/chunks/83f1871d04c979fa23b7.js +0 -1
  440. package/assets/esri/core/workers/chunks/85da2987e17b6755a94e.js +0 -1
  441. package/assets/esri/core/workers/chunks/8a3bff0f58483c1665f9.js +0 -1
  442. package/assets/esri/core/workers/chunks/8a5a827ee557d9f9a66e.js +0 -1
  443. package/assets/esri/core/workers/chunks/8a7a99533d02eb9cb058.js +0 -2
  444. package/assets/esri/core/workers/chunks/8b046e28f879079caada.js +0 -1
  445. package/assets/esri/core/workers/chunks/8d738e9acc2f222235ea.js +0 -1
  446. package/assets/esri/core/workers/chunks/915e2711d3a2cfa402b2.js +0 -1
  447. package/assets/esri/core/workers/chunks/9a5ef33d99a8f89956ff.js +0 -1
  448. package/assets/esri/core/workers/chunks/9c09097e390985bbac58.js +0 -1
  449. package/assets/esri/core/workers/chunks/9c402657f63a4d5668d0.js +0 -1
  450. package/assets/esri/core/workers/chunks/9f51a69b8f1937a8794a.js +0 -1
  451. package/assets/esri/core/workers/chunks/a015c2f54eb91e43a1f4.js +0 -1
  452. package/assets/esri/core/workers/chunks/a232d05c0a055f398c6e.js +0 -1
  453. package/assets/esri/core/workers/chunks/a242ec19a7508de436da.js +0 -1
  454. package/assets/esri/core/workers/chunks/a25acccda8febac71a3d.js +0 -1
  455. package/assets/esri/core/workers/chunks/a432219de6a873f88776.js +0 -1
  456. package/assets/esri/core/workers/chunks/a6b75576d598ec161cc4.js +0 -1
  457. package/assets/esri/core/workers/chunks/a7f9f478bd1493fc3c76.js +0 -1
  458. package/assets/esri/core/workers/chunks/aac6a57edd7494125204.js +0 -1
  459. package/assets/esri/core/workers/chunks/afc0baf86ece710ef867.js +0 -1
  460. package/assets/esri/core/workers/chunks/b2662bfdbd1e3623ceb9.js +0 -1
  461. package/assets/esri/core/workers/chunks/b4bac22467e96be7a974.js +0 -1
  462. package/assets/esri/core/workers/chunks/b73c146d3e550eaf07eb.js +0 -1
  463. package/assets/esri/core/workers/chunks/b7af0e6b9aadbcaf6a0b.js +0 -1
  464. package/assets/esri/core/workers/chunks/bc78937986854e500b8e.js +0 -1
  465. package/assets/esri/core/workers/chunks/bd10d21545bca9a49de0.js +0 -1
  466. package/assets/esri/core/workers/chunks/bea170f08f5261e22d29.js +0 -1
  467. package/assets/esri/core/workers/chunks/bec3ee5ea945e1e07a35.js +0 -1
  468. package/assets/esri/core/workers/chunks/bf4dd8e50704e4040966.js +0 -1
  469. package/assets/esri/core/workers/chunks/c31ee5617c61a933cb0e.js +0 -1
  470. package/assets/esri/core/workers/chunks/c3e89c7c7b677bd18557.js +0 -1
  471. package/assets/esri/core/workers/chunks/cb81d524f12edcadb9bb.js +0 -1
  472. package/assets/esri/core/workers/chunks/cc0f3b9b153a0c232afe.js +0 -1
  473. package/assets/esri/core/workers/chunks/cd0c232f4e3868d91a05.js +0 -1
  474. package/assets/esri/core/workers/chunks/ce7ef7c4ca14d66d96f6.js +0 -1
  475. package/assets/esri/core/workers/chunks/d3d9d40556c847bba1a7.js +0 -1
  476. package/assets/esri/core/workers/chunks/d55cef8199b8246fea3f.js +0 -1
  477. package/assets/esri/core/workers/chunks/d8decaee2c780e1b5e35.js +0 -1
  478. package/assets/esri/core/workers/chunks/dc54d4a9fe1691862356.js +0 -1
  479. package/assets/esri/core/workers/chunks/dd5b362bded458afa2d6.js +0 -1
  480. package/assets/esri/core/workers/chunks/dde94664110ff231a52d.js +0 -1
  481. package/assets/esri/core/workers/chunks/de3e5d82502ee15b7eae.js +0 -1
  482. package/assets/esri/core/workers/chunks/e18badd11f360cc2912b.js +0 -1
  483. package/assets/esri/core/workers/chunks/e6f1ed5e56f1d9862821.js +0 -1
  484. package/assets/esri/core/workers/chunks/e6fe8b5fbe95de01453b.js +0 -1
  485. package/assets/esri/core/workers/chunks/eaab5ac049622986e3bc.js +0 -1
  486. package/assets/esri/core/workers/chunks/ee7e9bca57160694b3c4.js +0 -1
  487. package/assets/esri/core/workers/chunks/ef0085aa743b33cb549f.js +0 -1
  488. package/assets/esri/core/workers/chunks/f0250cecb243b32cdba7.js +0 -1
  489. package/assets/esri/core/workers/chunks/f1e5626a0cc1631a1efb.js +0 -1
  490. package/assets/esri/core/workers/chunks/f36345ebb9851ab92453.js +0 -1
  491. package/assets/esri/core/workers/chunks/f468c6ea2818a1f97e19.js +0 -1
  492. package/assets/esri/core/workers/chunks/f49c7bb5d134bcb22155.js +0 -1
  493. package/assets/esri/core/workers/chunks/f6c8e93ca2987e83f925.js +0 -1
  494. package/assets/esri/core/workers/chunks/f7531aa69a87814c60d1.js +0 -1
  495. package/assets/esri/themes/base/fonts/cdn.scss +0 -3
  496. package/views/3d/webgl-engine/effects/transparency/OITDimTechnique.js +0 -2
  497. /package/assets/esri/core/workers/chunks/{f706bfea34d22539b46a.js.LICENSE.txt → bf6c6bc15b0d2d82d1a4.js.LICENSE.txt} +0 -0
  498. /package/assets/esri/core/workers/chunks/{2647c739cda29361a463.js.LICENSE.txt → d87e504082e293640ece.js.LICENSE.txt} +0 -0
  499. /package/assets/esri/core/workers/chunks/{8a7a99533d02eb9cb058.js.LICENSE.txt → f31deeedb2508e81293b.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{lerp as e,clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{watch as i,initial as o}from"../../../../../core/reactiveUtils.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators.js";import{lookAt as m}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as p,scale as c,add as l,distance as u,cross as _,squaredLength as f}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as g}from"../../../../../geometry/ellipsoidUtils.js";import{newFloatArray as x}from"../../../../../geometry/support/FloatArray.js";import{InternalRenderCategory as b}from"../../../webgl.js";import{makePiecewiseLinearFunction as j}from"../../../support/mathUtils.js";import{glLayout as V}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as P}from"../OpaqueEnvironment.js";import{computeInnerAltitudeFade as v,innerAtmosphereDepth as w}from"./atmosphereUtils.js";import{marsAtmosphereTextureSimple as R}from"./MarsAtmosphereTexture.js";import{S as A}from"../../../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as y,layout as S}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as q}from"./SimpleAtmosphereTechniqueConfiguration.js";import{createQuadVAO as F}from"../../lib/glUtil3D.js";import{project as M}from"../../lib/Util.js";import{VertexArrayObject as T}from"../../lib/VertexArrayObject.js";import{PrimitiveType as U}from"../../../../webgl/enums.js";import E from"../../../../webgl/Texture.js";import{TextureDescriptor as C}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as O}from"../../../../webgl/VertexBuffer.js";const N=128,I=-w,W=0,B=50,D=()=>1-511/512,G=j([[50,.1015625],[500,.21875],[5e3,1-250/512],[5e4,.4140625]]);let L=class extends P{constructor(t){super(t),this._passParameters=new A,this._configuration=new q,this._vao=null,this._fadeVao=null,this._texV1=1;const e=t.view,r=g(e.spatialReference),{outerAtmosphereRimWidth:s,radius:i}=r;this._planetRadius=i,this._innerRimFactor=1+I/i,this._middleRimFactor=1+W/i,this._outerRimFactor=1+s/i,this._texV0=W/s,this._texVScale=this._texV1-this._texV0;const o=e.stage.renderView.techniques;o.precompile(y,this._configuration),this._configuration.geometry=2,o.precompile(y,this._configuration)}initialize(){this.addHandles(i(()=>this.view.environment.atmosphereEnabled,t=>t?this._enable():this._disable(),o))}destroy(){this._passParameters.texture=s(this._passParameters.texture),this._fadeVao=s(this._fadeVao),this._vao=s(this._vao)}render(t){const e=t.find(({name:t})=>t===b.OPAQUE_ENVIRONMENT);this._update();const r=this.renderingContext;if(!this._passParameters.texture){const t=new C(1,512);t.wrapMode=33071,t.flipped=!0,this._passParameters.texture=new E(r,t,R)}if(this._passParameters.undergroundFadeAlpha<1){this._vao??=this._createRibbon(r),this._configuration.geometry=0;const t=this.techniques.getCompiled(y,this._configuration);if(!t)return this.requestRender(1),e;r.bindTechnique(t,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(U.TRIANGLES,0,this._vao.vertexCount("geometry"))}if(this._passParameters.undergroundFadeAlpha>0){this._fadeVao??=F(r),this._configuration.geometry=2;const t=this.techniques.getCompiled(y,this._configuration);if(!t)return this.requestRender(1),e;r.bindTechnique(t,this.bindParameters,this._passParameters),r.bindVAO(this._fadeVao),r.drawArrays(U.TRIANGLE_STRIP,0,this._fadeVao.vertexCount("geometry"))}return e}_update(){const t=this.bindParameters.camera,s=d(),i=this._planetRadius,o=p(t.eye),a=o-i;if(a<0){const t=Math.min(-a/5e3,1);this._passParameters.undergroundFadeAlpha=t}else this._passParameters.undergroundFadeAlpha=0;const m=Math.max(B,a),n=i+I;this._passParameters.innerScale=J(i+m,i,n)-1,this._passParameters.altitudeFade=v(a),c(s,t.eye,(i+B)/o),k(s,t.center,t.up,i,this._passParameters.silhouette);const l=this._computeScreenRimWidth(t,s,t.up,this._passParameters.silhouette),u=D(),_=G(a);let f=this._texV0+u*this._texVScale,g=this._texV0+l*_*this._texVScale;if(a>B){k(t.eye,t.center,t.up,i,this._passParameters.silhouette);const s=this._computeScreenRimWidth(t,t.eye,t.up,this._passParameters.silhouette),o=r((s-1.5)/(l-1.5),0,1);f=this._texV0+o*u*this._texVScale,g=this._texV0+e(this._texV1,l*_,o)*this._texVScale}h(this._passParameters.texV,f,g)}_createRibbon(t){const e=x(3+3*N*3),r=new Uint32Array(3*N*5);e[0]=0,e[1]=0,e[2]=-1;for(let o=0;o<N;o++){const t=9*o+3;e[t]=o,e[t+1]=this._innerRimFactor,e[t+2]=-1,e[t+3]=o,e[t+4]=this._middleRimFactor,e[t+5]=0,e[t+6]=o,e[t+7]=this._outerRimFactor,e[t+8]=1;const s=3*o+1,i=o===N-1?1:s+3,a=15*o;r[a]=s,r[a+1]=s+1,r[a+2]=i+1,r[a+3]=i+1,r[a+4]=i,r[a+5]=s,r[a+6]=s+1,r[a+7]=s+2,r[a+8]=i+2,r[a+9]=i+2,r[a+10]=i+1,r[a+11]=s+1,r[a+12]=s,r[a+13]=i,r[a+14]=0}const s=S.createBuffer(r.length),i=s.position;for(let o=0;o<r.length;++o){const t=3*r[o];i.set(o,0,e[t]),i.set(o,1,e[t+1]),i.set(o,2,e[t+2])}return new T(t,new O(t,V(S),s.buffer))}_computeScreenRimWidth(t,e,r,s){return l(H,s.center,s.v2),c(Q,H,this._outerRimFactor),m(z,e,H,r),M(H,z,t.projectionMatrix,t.viewport,H),M(Q,z,t.projectionMatrix,t.viewport,Q),u(H,Q)/t.height}};function k(t,e,r,s,i){const o=p(t),a=s*Math.sqrt(o*o-s*s)/o,m=Math.sqrt(s*s-a*a),n=i.v1,h=i.v2;return c(i.center,t,m/o),_(n,t,e),f(n)<1&&_(n,t,r),c(n,n,a/p(n)),_(h,n,t),c(h,h,a/p(h)),a}L=t([a("esri.views.3d.webgl-engine.effects.atmosphere.MarsAtmosphere")],L);const z=n(),H=d(),Q=d();function J(t,e,r){return t*t/(Math.sqrt(t*t-e*e)*Math.sqrt(t*t-r*r)+e*r)}export{L as MarsAtmosphere};
2
+ import{__decorate as t}from"tslib";import{lerp as e,clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{watch as i,initial as o}from"../../../../../core/reactiveUtils.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators.js";import{lookAt as m}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as p,scale as c,add as l,distance as u,cross as _,squaredLength as f}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as g}from"../../../../../geometry/ellipsoidUtils.js";import{newFloatArray as x}from"../../../../../geometry/support/FloatArray.js";import{InternalRenderCategory as b}from"../../../webgl.js";import{makePiecewiseLinearFunction as j}from"../../../support/mathUtils.js";import{glLayout as V}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as P}from"../OpaqueEnvironment.js";import{computeInnerAltitudeFade as v,innerAtmosphereDepth as R}from"./atmosphereUtils.js";import{marsAtmosphereTextureSimple as w}from"./MarsAtmosphereTexture.js";import{S as A}from"../../../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as y,layout as S}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as q}from"./SimpleAtmosphereTechniqueConfiguration.js";import{createQuadVAO as F}from"../../lib/glUtil3D.js";import{project as M}from"../../lib/Util.js";import{VertexArrayObject as T}from"../../lib/VertexArrayObject.js";import{PrimitiveType as U}from"../../../../webgl/enums.js";import E from"../../../../webgl/Texture.js";import{TextureDescriptor as C}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as O}from"../../../../webgl/VertexBuffer.js";const N=128,I=-R,W=0,B=50,D=()=>1-511/512,G=j([[50,.1015625],[500,.21875],[5e3,1-250/512],[5e4,.4140625]]);let L=class extends P{constructor(t){super(t),this._passParameters=new A,this._configuration=new q,this._vao=null,this._fadeVao=null,this._texV1=1;const e=t.view,r=g(e.spatialReference),{outerAtmosphereRimWidth:s,radius:i}=r;this._planetRadius=i,this._innerRimFactor=1+I/i,this._middleRimFactor=1+W/i,this._outerRimFactor=1+s/i,this._texV0=W/s,this._texVScale=this._texV1-this._texV0}initialize(){this.addHandles(i(()=>this.view.environment.atmosphereEnabled,t=>t?this._enable():this._disable(),o))}destroy(){this._passParameters.texture=s(this._passParameters.texture),this._fadeVao=s(this._fadeVao),this._vao=s(this._vao)}render(t){const e=t.find(({name:t})=>t===b.OPAQUE_ENVIRONMENT);this._update();const r=this.renderingContext;if(!this._passParameters.texture){const t=new C(1,512);t.wrapMode=33071,t.flipped=!0,this._passParameters.texture=new E(r,t,w)}if(this._passParameters.undergroundFadeAlpha<1){this._vao??=this._createRibbon(r),this._configuration.geometry=0;const t=this.techniques.getCompiled(y,this._configuration);if(!t)return this.requestRender(1),e;r.bindTechnique(t,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(U.TRIANGLES,0,this._vao.vertexCount("geometry"))}if(this._passParameters.undergroundFadeAlpha>0){this._fadeVao??=F(r),this._configuration.geometry=2;const t=this.techniques.getCompiled(y,this._configuration);if(!t)return this.requestRender(1),e;r.bindTechnique(t,this.bindParameters,this._passParameters),r.bindVAO(this._fadeVao),r.drawArrays(U.TRIANGLE_STRIP,0,this._fadeVao.vertexCount("geometry"))}return e}_update(){const t=this.bindParameters.camera,s=d(),i=this._planetRadius,o=p(t.eye),a=o-i;if(a<0){const t=Math.min(-a/5e3,1);this._passParameters.undergroundFadeAlpha=t}else this._passParameters.undergroundFadeAlpha=0;const m=Math.max(B,a),n=i+I;this._passParameters.innerScale=J(i+m,i,n)-1,this._passParameters.altitudeFade=v(a),c(s,t.eye,(i+B)/o),k(s,t.center,t.up,i,this._passParameters.silhouette);const l=this._computeScreenRimWidth(t,s,t.up,this._passParameters.silhouette),u=D(),_=G(a);let f=this._texV0+u*this._texVScale,g=this._texV0+l*_*this._texVScale;if(a>B){k(t.eye,t.center,t.up,i,this._passParameters.silhouette);const s=this._computeScreenRimWidth(t,t.eye,t.up,this._passParameters.silhouette),o=r((s-1.5)/(l-1.5),0,1);f=this._texV0+o*u*this._texVScale,g=this._texV0+e(this._texV1,l*_,o)*this._texVScale}h(this._passParameters.texV,f,g)}_createRibbon(t){const e=x(3+3*N*3),r=new Uint32Array(3*N*5);e[0]=0,e[1]=0,e[2]=-1;for(let o=0;o<N;o++){const t=9*o+3;e[t]=o,e[t+1]=this._innerRimFactor,e[t+2]=-1,e[t+3]=o,e[t+4]=this._middleRimFactor,e[t+5]=0,e[t+6]=o,e[t+7]=this._outerRimFactor,e[t+8]=1;const s=3*o+1,i=o===N-1?1:s+3,a=15*o;r[a]=s,r[a+1]=s+1,r[a+2]=i+1,r[a+3]=i+1,r[a+4]=i,r[a+5]=s,r[a+6]=s+1,r[a+7]=s+2,r[a+8]=i+2,r[a+9]=i+2,r[a+10]=i+1,r[a+11]=s+1,r[a+12]=s,r[a+13]=i,r[a+14]=0}const s=S.createBuffer(r.length),i=s.position;for(let o=0;o<r.length;++o){const t=3*r[o];i.set(o,0,e[t]),i.set(o,1,e[t+1]),i.set(o,2,e[t+2])}return new T(t,new O(t,V(S),s.buffer))}_computeScreenRimWidth(t,e,r,s){return l(H,s.center,s.v2),c(Q,H,this._outerRimFactor),m(z,e,H,r),M(H,z,t.projectionMatrix,t.viewport,H),M(Q,z,t.projectionMatrix,t.viewport,Q),u(H,Q)/t.height}};function k(t,e,r,s,i){const o=p(t),a=s*Math.sqrt(o*o-s*s)/o,m=Math.sqrt(s*s-a*a),n=i.v1,h=i.v2;return c(i.center,t,m/o),_(n,t,e),f(n)<1&&_(n,t,r),c(n,n,a/p(n)),_(h,n,t),c(h,h,a/p(h)),a}L=t([a("esri.views.3d.webgl-engine.effects.atmosphere.MarsAtmosphere")],L);const z=n(),H=d(),Q=d();function J(t,e,r){return t*t/(Math.sqrt(t*t-e*e)*Math.sqrt(t*t-r*r)+e*r)}export{L as MarsAtmosphere};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as i,initial as s}from"../../../../../core/reactiveUtils.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{OpaqueEnvironment as o}from"../OpaqueEnvironment.js";import{CloudsCompositionTechnique as n}from"./CloudsCompositionTechnique.js";import{createQuadVAO as a}from"../../lib/glUtil3D.js";import{ColorAttachment0 as m,PrimitiveType as d}from"../../../../webgl/enums.js";let h=class extends o{initialize(){this.addHandles([i(()=>null!=this.view.environment.weather&&this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),s)])}destroy(){this._vao=t(this._vao)}precompile(){this.bindParameters.clouds.data&&this.techniques.precompile(n)}render(e){const t=e.find(({name:e})=>e===this.produces),i=this.bindParameters.clouds;if(!i.data)return t;const s=this.techniques.getCompiled(n);if(!s)return this.requestRender(1),t;const r=this.renderingContext;this._vao??=a(r);const o=r.bindTechnique(s,this.bindParameters);return r.setDrawBuffers([m]),r.bindVAO(this._vao),o.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(d.TRIANGLE_STRIP,0,4),i.isFading&&this.requestRender(2),t}};h=e([r("esri.views.3d.webgl-engine.effects.clouds.CloudsComposition")],h);export{h as CloudsComposition};
2
+ import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as i,initial as s}from"../../../../../core/reactiveUtils.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{OpaqueEnvironment as o}from"../OpaqueEnvironment.js";import{CloudsCompositionTechnique as n}from"./CloudsCompositionTechnique.js";import{createQuadVAO as a}from"../../lib/glUtil3D.js";import{ColorAttachment0 as m,PrimitiveType as d}from"../../../../webgl/enums.js";let h=class extends o{initialize(){this.addHandles([i(()=>null!=this.view.environment.weather&&this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),s)])}destroy(){this._vao=t(this._vao)}render(e){const t=e.find(({name:e})=>e===this.produces),i=this.bindParameters.clouds;if(!i.data)return t;const s=this.techniques.getCompiled(n);if(!s)return this.requestRender(1),t;const r=this.renderingContext;this._vao??=a(r);const o=r.bindTechnique(s,this.bindParameters);return r.setDrawBuffers([m]),r.bindVAO(this._vao),o.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(d.TRIANGLE_STRIP,0,4),i.isFading&&this.requestRender(2),t}};h=e([r("esri.views.3d.webgl-engine.effects.clouds.CloudsComposition")],h);export{h as CloudsComposition};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import{lerp as s}from"../../../../../core/mathUtils.js";import{destroyMaybe as i,disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as o,initial as a}from"../../../../../core/reactiveUtils.js";import{signal as h}from"../../../../../core/signal.js";import{property as n,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as c}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{targetTo as u}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{equals as p,copy as m,set as f}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{clone as _,ZEROS as g,zeros as x}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 T}from"../../../../../geometry/ellipsoidUtils.js";import{C as v,c as S}from"../../../../../chunks/Clouds.glsl.js";import{cloudPresets as w}from"./CloudsPresets.js";import{CloudsTechnique as C}from"./CloudsTechnique.js";import{CloudsTechniqueConfiguration as P}from"./CloudsTechniqueConfiguration.js";import{NoiseTextureAtlas as j}from"./NoiseTextureAtlas.js";import{TaskPriority as z}from"../../../../support/Scheduler.js";import{Yield as I}from"../../../../support/Yield.js";import{ColorAttachment0 as M}from"../../../../webgl/enums.js";import{DisposableFramebufferObject as H}from"../../../../webgl/FramebufferObject.js";import{TextureDescriptor as q}from"../../../../webgl/TextureDescriptor.js";let R=class extends e{constructor(t){super(t),this._state=h(0),this._passParameters=new v,this._weatherTileCount=128,this._sliceIndex=0,this._tileIndex=0,this._tilesPerSlice=1,this.coverage=s(w.default.coverage[0],w.default.coverage[1],.5),this.density=s(w.default.density[0],w.default.density[1],.5),this.absorption=s(w.default.absorption[0],w.default.absorption[1],.5),this.cloudSize=s(w.default.cloudSize[0],w.default.cloudSize[1],.5),this.detailSize=s(w.default.detailSize[0],w.default.detailSize[1],.5),this.smoothness=s(w.default.smoothness[0],w.default.smoothness[1],.5),this.cloudHeight=s(w.default.cloudHeight[0],w.default.cloudHeight[1],.5),this.raymarchingSteps=w.default.raymarchingSteps,this._viewMatrix=d(),this._dirty=!0,this.readyToRun=!0,this._configuration=new P}initialize(){const t=T(this.view.spatialReference);this._passParameters.cloudRadius=.5*t.radius;const e=()=>this.setDirty();this.addHandles([this.view.resourceController.scheduler.registerTask(z.CLOUDS_GENERATOR,this),o(()=>this.coverage,e,a),o(()=>this.density,e,a),o(()=>this.absorption,e,a),o(()=>this.cloudSize,e,a),o(()=>this.detailSize,e,a),o(()=>this.smoothness,e,a),o(()=>this.cloudHeight,e,a),o(()=>this.raymarchingSteps,e,a)]);const s=_(this._computeWeatherTile());let i=0;this.addHandles(o(()=>{const t=this._computeWeatherTile();return p(s,t)||(++i,m(s,t)),i},e))}destroy(){this.destroyCubeMap(),this._passParameters.noiseTexture=i(this._passParameters.noiseTexture)}_precompile(){this._configuration.steps=this.raymarchingSteps,this._configuration.writeTextureChannels=1-this.parameters.readChannels,this.context.techniques.getCompiled(C,this._configuration)}_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(C,this._configuration)}_computeWeatherTile(){const{camera:t,environment:e}=this.view,{latitude:s,longitude:i}=t.position;if(null==s||null==i)return g;f(D,(s+90)/180,(i+180)/360);const r=Math.floor(this._weatherTileCount*Math.abs(2*D[0]-1));D[0]=Math.floor(2*this._weatherTileCount*D[0]),D[1]=Math.floor(4*(this._weatherTileCount-r)*D[1]);let o=0,a=0;if("virtual"!==e?.lighting?.type&&null!=e?.lighting?.date){const t=new Date(e.lighting.date);t.setUTCHours(e.lighting.date.getUTCHours()+(e.lighting.displayUTCOffset??0)),o=31*t.getUTCMonth()+t.getUTCDate(),a=t.getUTCFullYear()}return D[0]=(D[0]+o)%(2*this._weatherTileCount),D[1]=(D[1]+a%100)%(4*this._weatherTileCount),D}get state(){return this._state.value}set state(t){this._state.value=t}get usedMemory(){return(this._fbo?.usedMemory??0)+(this._passParameters.noiseTexture?.textureAtlas?.usedMemory??0)}_ensureNoiseTexture(){return this._passParameters.noiseTexture??=new j({context:this.context}),this._passParameters.noiseTexture}_ensureFrameBufferCube(t){const e=this.context.rctx;if(null==this._fbo){const s=new q(t,t/2);s.target=35866,s.depth=6,s.wrapMode=33071,this._fbo=new H(e,s),this.parameters.data=this,this.parameters.absorption=this.absorption,this.parameters.coverage=this.coverage}return e.unbindTexture(this._fbo.colorTexture),this._fbo}get cubeMap(){return this._fbo}get parameters(){return this.context.bind.clouds}destroyCubeMap(){this._fbo=r(this._fbo),this.parameters.data=null}applyPreset(t,e){const i=t.median,r=t=>{const r=s(t[0],t[1],i);return e<.5?s(t[0],r,2*e):s(r,t[1],2*(e-.5))};this.coverage=r(t.coverage),this.density=r(t.density),this.absorption=r(t.absorption),this.cloudSize=r(t.cloudSize),this.detailSize=r(t.detailSize),this.smoothness=r(t.smoothness),this.cloudHeight=r(t.cloudHeight),this.raymarchingSteps=t.raymarchingSteps}setDirty(){this._dirty=this.readyToRun=!0,this._precompile()}runTask(t){if(3===this.state)return I;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()),this._dirty=!1);const e=this._acquireTechnique();if(!this._ensureNoiseTexture().textureAtlas||!e)return I;const s=U[this._sliceIndex],i=O[this._sliceIndex];u(this._viewMatrix,k,s,i),c(this._passParameters.viewMatrix,this._viewMatrix);const r=this.context.rctx,o=r.getViewport(),a=S/this._tilesPerSlice,h=this._tileIndex*a;r.setViewport(0,h,S,a);const n=this._ensureFrameBufferCube(S);r.bindFramebuffer(n),this._passParameters.lastSlice=5===this._sliceIndex,r.bindTechnique(e,this.context.bind,this._passParameters);const l=35866;return n.setColorTextureTarget(l,M,this._sliceIndex),r.screen.draw(),r.gl.flush(),r.setViewport(o.x,o.y,o.width,o.height),this.requestRender(),++this._tileIndex,5===this._sliceIndex&&this._tileIndex===this._tilesPerSlice?(this._sliceIndex=this._tileIndex=0,this.state=2,this.readyToRun=!1):this._tileIndex===this._tilesPerSlice&&(++this._sliceIndex,this._tileIndex=0),t.madeProgress(),I}};t([n({constructOnly:!0})],R.prototype,"context",void 0),t([n({constructOnly:!0})],R.prototype,"view",void 0),t([n({constructOnly:!0})],R.prototype,"requestRender",void 0),t([n()],R.prototype,"coverage",void 0),t([n()],R.prototype,"density",void 0),t([n()],R.prototype,"absorption",void 0),t([n()],R.prototype,"cloudSize",void 0),t([n()],R.prototype,"detailSize",void 0),t([n()],R.prototype,"smoothness",void 0),t([n()],R.prototype,"cloudHeight",void 0),t([n()],R.prototype,"raymarchingSteps",void 0),t([n()],R.prototype,"readyToRun",void 0),R=t([l("esri.views.3d.webgl-engine.effects.clouds.CloudsRenderer")],R);const U=[y(1,0,0),y(-1,0,0),y(0,1,0),y(0,-1,0),y(0,0,1),y(0,0,1)],O=[y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,1,0),y(0,1,0)],k=b(),D=x();export{R as CloudsRenderer};
2
+ import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import{lerp as s}from"../../../../../core/mathUtils.js";import{destroyMaybe as i,disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as o,initial as a}from"../../../../../core/reactiveUtils.js";import{signal as h}from"../../../../../core/signal.js";import{property as n,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as c}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{targetTo as u}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{equals as m,copy as p,set as f}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{clone as _,ZEROS as g,zeros as x}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 T}from"../../../../../geometry/ellipsoidUtils.js";import{C as v,c as S}from"../../../../../chunks/Clouds.glsl.js";import{cloudPresets as w}from"./CloudsPresets.js";import{CloudsTechnique as C}from"./CloudsTechnique.js";import{CloudsTechniqueConfiguration as P}from"./CloudsTechniqueConfiguration.js";import{NoiseTextureAtlas as j}from"./NoiseTextureAtlas.js";import{TaskPriority as z}from"../../../../support/Scheduler.js";import{Yield as I}from"../../../../support/Yield.js";import{ColorAttachment0 as M}from"../../../../webgl/enums.js";import{DisposableFramebufferObject as H}from"../../../../webgl/FramebufferObject.js";import{TextureDescriptor as R}from"../../../../webgl/TextureDescriptor.js";let q=class extends e{constructor(t){super(t),this._state=h(0),this._passParameters=new v,this._weatherTileCount=128,this._sliceIndex=0,this._tileIndex=0,this._tilesPerSlice=1,this.coverage=s(w.default.coverage[0],w.default.coverage[1],.5),this.density=s(w.default.density[0],w.default.density[1],.5),this.absorption=s(w.default.absorption[0],w.default.absorption[1],.5),this.cloudSize=s(w.default.cloudSize[0],w.default.cloudSize[1],.5),this.detailSize=s(w.default.detailSize[0],w.default.detailSize[1],.5),this.smoothness=s(w.default.smoothness[0],w.default.smoothness[1],.5),this.cloudHeight=s(w.default.cloudHeight[0],w.default.cloudHeight[1],.5),this.raymarchingSteps=w.default.raymarchingSteps,this._viewMatrix=d(),this._dirty=!0,this.readyToRun=!0,this._configuration=new P}initialize(){const t=T(this.view.spatialReference);this._passParameters.cloudRadius=.5*t.radius;const e=()=>this.setDirty();this.addHandles([this.view.resourceController.scheduler.registerTask(z.CLOUDS_GENERATOR,this),o(()=>this.coverage,e,a),o(()=>this.density,e,a),o(()=>this.absorption,e,a),o(()=>this.cloudSize,e,a),o(()=>this.detailSize,e,a),o(()=>this.smoothness,e,a),o(()=>this.cloudHeight,e,a),o(()=>this.raymarchingSteps,e,a)]);const s=_(this._computeWeatherTile());let i=0;this.addHandles(o(()=>{const t=this._computeWeatherTile();return m(s,t)||(++i,p(s,t)),i},e))}destroy(){this.destroyCubeMap(),this._passParameters.noiseTexture=i(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(C,this._configuration)}_computeWeatherTile(){const{camera:t,environment:e}=this.view,{latitude:s,longitude:i}=t.position;if(null==s||null==i)return g;f(D,(s+90)/180,(i+180)/360);const r=Math.floor(this._weatherTileCount*Math.abs(2*D[0]-1));D[0]=Math.floor(2*this._weatherTileCount*D[0]),D[1]=Math.floor(4*(this._weatherTileCount-r)*D[1]);let o=0,a=0;if("virtual"!==e?.lighting?.type&&null!=e?.lighting?.date){const t=new Date(e.lighting.date);t.setUTCHours(e.lighting.date.getUTCHours()+(e.lighting.displayUTCOffset??0)),o=31*t.getUTCMonth()+t.getUTCDate(),a=t.getUTCFullYear()}return D[0]=(D[0]+o)%(2*this._weatherTileCount),D[1]=(D[1]+a%100)%(4*this._weatherTileCount),D}get state(){return this._state.value}set state(t){this._state.value=t}get usedMemory(){return(this._fbo?.usedMemory??0)+(this._passParameters.noiseTexture?.textureAtlas?.usedMemory??0)}_ensureNoiseTexture(){return this._passParameters.noiseTexture??=new j({context:this.context}),this._passParameters.noiseTexture}_ensureFrameBufferCube(t){const e=this.context.rctx;if(null==this._fbo){const s=new R(t,t/2);s.target=35866,s.depth=6,s.wrapMode=33071,this._fbo=new H(e,s),this.parameters.data=this,this.parameters.absorption=this.absorption,this.parameters.coverage=this.coverage}return e.unbindTexture(this._fbo.colorTexture),this._fbo}get cubeMap(){return this._fbo}get parameters(){return this.context.bind.clouds}destroyCubeMap(){this._fbo=r(this._fbo),this.parameters.data=null}applyPreset(t,e){const i=t.median,r=t=>{const r=s(t[0],t[1],i);return e<.5?s(t[0],r,2*e):s(r,t[1],2*(e-.5))};this.coverage=r(t.coverage),this.density=r(t.density),this.absorption=r(t.absorption),this.cloudSize=r(t.cloudSize),this.detailSize=r(t.detailSize),this.smoothness=r(t.smoothness),this.cloudHeight=r(t.cloudHeight),this.raymarchingSteps=t.raymarchingSteps}setDirty(){this._dirty=this.readyToRun=!0}runTask(t){if(3===this.state)return I;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()),this._dirty=!1);const e=this._acquireTechnique();if(!this._ensureNoiseTexture().textureAtlas||!e)return I;const s=U[this._sliceIndex],i=O[this._sliceIndex];u(this._viewMatrix,k,s,i),c(this._passParameters.viewMatrix,this._viewMatrix);const r=this.context.rctx,o=r.getViewport(),a=S/this._tilesPerSlice,h=this._tileIndex*a;r.setViewport(0,h,S,a);const n=this._ensureFrameBufferCube(S);r.bindFramebuffer(n),this._passParameters.lastSlice=5===this._sliceIndex,r.bindTechnique(e,this.context.bind,this._passParameters);const l=35866;return n.setColorTextureTarget(l,M,this._sliceIndex),r.screen.draw(),r.gl.flush(),r.setViewport(o.x,o.y,o.width,o.height),this.requestRender(),++this._tileIndex,5===this._sliceIndex&&this._tileIndex===this._tilesPerSlice?(this._sliceIndex=this._tileIndex=0,this.state=2,this.readyToRun=!1):this._tileIndex===this._tilesPerSlice&&(++this._sliceIndex,this._tileIndex=0),t.madeProgress(),I}};t([n({constructOnly:!0})],q.prototype,"context",void 0),t([n({constructOnly:!0})],q.prototype,"view",void 0),t([n({constructOnly:!0})],q.prototype,"requestRender",void 0),t([n()],q.prototype,"coverage",void 0),t([n()],q.prototype,"density",void 0),t([n()],q.prototype,"absorption",void 0),t([n()],q.prototype,"cloudSize",void 0),t([n()],q.prototype,"detailSize",void 0),t([n()],q.prototype,"smoothness",void 0),t([n()],q.prototype,"cloudHeight",void 0),t([n()],q.prototype,"raymarchingSteps",void 0),t([n()],q.prototype,"readyToRun",void 0),q=t([l("esri.views.3d.webgl-engine.effects.clouds.CloudsRenderer")],q);const U=[y(1,0,0),y(-1,0,0),y(0,1,0),y(0,-1,0),y(0,0,1),y(0,0,1)],O=[y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,1,0),y(0,1,0)],k=b(),D=x();export{q as CloudsRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import{equals as i,copy as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{N as c}from"../../../../../chunks/NoiseTextureAtlas.glsl.js";import{NoiseTextureAtlasTechniqueConfiguration as a}from"./NoiseTextureAtlasConfiguration.js";import{atlasSize as u}from"./NoiseTextureAtlasDimensions.js";import{NoiseTextureAtlasTechnique as h}from"./NoiseTextureAtlasTechnique.js";import{DisposableFramebufferObject as m}from"../../../../webgl/FramebufferObject.js";import{TextureDescriptor as p}from"../../../../webgl/TextureDescriptor.js";let f=class extends e{constructor(t){super(t),this._passParameters=new c,this._configuration=new a,this._fbo=new m(t.context.rctx,new p(u)),t.context.techniques.precompile(h,this._configuration)}get textureAtlas(){if(this._texture)return this._texture;const t=this.context.techniques.getCompiled(h,this._configuration);return t&&(this._texture=this._render(t)),this._texture}updateWeatherMap(t){i(this._passParameters.weatherTile,t)||(n(this._passParameters.weatherTile,t),this._configuration.mode=this._texture?1:0,this._texture=null,this.context.techniques.precompile(h,this._configuration))}destroy(){this._fbo=r(this._fbo)}_render(t){if(!this._fbo)return null;const e=this.context.rctx,r=e.getViewport();return e.setViewport(0,0,u,u),e.bindFramebuffer(this._fbo),e.bindTechnique(t,this.context.bind,this._passParameters),e.screen.draw(),e.setViewport(r.x,r.y,r.width,r.height),this._fbo.colorTexture}};t([o({constructOnly:!0})],f.prototype,"context",void 0),f=t([s("esri.views.3d.webgl-engine.effects.clouds.NoiseTextureAtlas")],f);export{f as NoiseTextureAtlas};
2
+ import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import{equals as i,copy as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{N as c}from"../../../../../chunks/NoiseTextureAtlas.glsl.js";import{NoiseTextureAtlasTechniqueConfiguration as a}from"./NoiseTextureAtlasConfiguration.js";import{atlasSize as u}from"./NoiseTextureAtlasDimensions.js";import{NoiseTextureAtlasTechnique as m}from"./NoiseTextureAtlasTechnique.js";import{DisposableFramebufferObject as h}from"../../../../webgl/FramebufferObject.js";import{TextureDescriptor as p}from"../../../../webgl/TextureDescriptor.js";let f=class extends e{constructor(t){super(t),this._passParameters=new c,this._configuration=new a,this._fbo=new h(t.context.rctx,new p(u))}get textureAtlas(){if(this._texture)return this._texture;const t=this.context.techniques.getCompiled(m,this._configuration);return t&&(this._texture=this._render(t)),this._texture}updateWeatherMap(t){i(this._passParameters.weatherTile,t)||(n(this._passParameters.weatherTile,t),this._configuration.mode=this._texture?1:0,this._texture=null)}destroy(){this._fbo=r(this._fbo)}_render(t){if(!this._fbo)return null;const e=this.context.rctx,r=e.getViewport();return e.setViewport(0,0,u,u),e.bindFramebuffer(this._fbo),e.bindTechnique(t,this.context.bind,this._passParameters),e.screen.draw(),e.setViewport(r.x,r.y,r.width,r.height),this._fbo.colorTexture}};t([o({constructOnly:!0})],f.prototype,"context",void 0),f=t([s("esri.views.3d.webgl-engine.effects.clouds.NoiseTextureAtlas")],f);export{f as NoiseTextureAtlas};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{watch as t}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{InternalRenderCategory as i}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{F as a}from"../../../../../chunks/FocusAreaColor.glsl.js";import{FocusAreaColorTechnique as n}from"./FocusAreaColorTechnique.js";import{DepthStencilAttachment as c}from"../../../../webgl/enums.js";let d=class extends o{constructor(e){super({...e,view:e.focusAreasView.view}),this.consumes={required:[i.FOCUSAREA_COLOR,i.FOCUSAREA]},this.produces=i.FOCUSAREA_COLOR,this._fadeDirection=0,this._passParameters=new a}precompile(){this.techniques.precompile(n)}fadeOut(e){this.removeAllHandles(),this._startTime=null,this._fadeDirection=1,this.addHandles(t(()=>this._passParameters.fadeFactor.value,t=>{0===t&&(this.removeAllHandles(),e())})),this.requestRender(2)}render(e){const t=e.find(({name:e})=>e===this.produces),s=this.techniques.getCompiled(n);if(!s)return this.requestRender(1),t;const r=this.focusAreasView.style,o=this.bindParameters,a=o.camera,d=a.fullViewport[2],m=a.fullViewport[3];this._startTime??=this.view.stage?.renderer.renderContext.time;const u=this.view.qualitySettings.fadeDuration,p=u>0?Math.min(u,this.view.stage?.renderer.renderContext.time-this._startTime)/u:1,l=e.find(({name:e})=>e===i.FOCUSAREA),f=this.fboCache.acquire(d,m,this.produces),A=this.renderingContext;return A.bindFramebuffer(f.fbo),this._passParameters.color=t.getTexture(),this._passParameters.focusArea=l.getTexture(),this._passParameters.effect=h[r],this._passParameters.fadeFactor.value=0===this._fadeDirection?p:1-p,A.bindTechnique(s,o,this._passParameters),A.screen.draw(),f.attachDepth(t.getAttachment(c)),p<1&&this.requestRender(2),f}};e([s()],d.prototype,"consumes",void 0),e([s()],d.prototype,"produces",void 0),e([s({constructOnly:!0})],d.prototype,"focusAreasView",void 0),d=e([r("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaColorNode")],d);const h={bright:0,dark:1};export{d as FocusAreaColorNode,h as styleToEffect};
2
+ import{__decorate as e}from"tslib";import{watch as t}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{InternalRenderCategory as i}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{F as a}from"../../../../../chunks/FocusAreaColor.glsl.js";import{FocusAreaColorTechnique as n}from"./FocusAreaColorTechnique.js";import{DepthStencilAttachment as c}from"../../../../webgl/enums.js";let d=class extends o{constructor(e){super({...e,view:e.focusAreasView.view}),this.consumes={required:[i.FOCUSAREA_COLOR,i.FOCUSAREA]},this.produces=i.FOCUSAREA_COLOR,this._fadeDirection=0,this._passParameters=new a}fadeOut(e){this.removeAllHandles(),this._startTime=null,this._fadeDirection=1,this.addHandles(t(()=>this._passParameters.fadeFactor.value,t=>{0===t&&(this.removeAllHandles(),e())})),this.requestRender(2)}render(e){const t=e.find(({name:e})=>e===this.produces),s=this.techniques.getCompiled(n);if(!s)return this.requestRender(1),t;const r=this.focusAreasView.style,o=this.bindParameters,a=o.camera,d=a.fullViewport[2],m=a.fullViewport[3];this._startTime??=this.view.stage?.renderer.renderContext.time;const u=this.view.qualitySettings.fadeDuration,f=u>0?Math.min(u,this.view.stage?.renderer.renderContext.time-this._startTime)/u:1,l=e.find(({name:e})=>e===i.FOCUSAREA),p=this.fboCache.acquire(d,m,this.produces),A=this.renderingContext;return A.bindFramebuffer(p.fbo),this._passParameters.color=t.getTexture(),this._passParameters.focusArea=l.getTexture(),this._passParameters.effect=h[r],this._passParameters.fadeFactor.value=0===this._fadeDirection?f:1-f,A.bindTechnique(s,o,this._passParameters),A.screen.draw(),p.attachDepth(t.getAttachment(c)),f<1&&this.requestRender(2),p}};e([s()],d.prototype,"consumes",void 0),e([s()],d.prototype,"produces",void 0),e([s({constructOnly:!0})],d.prototype,"focusAreasView",void 0),d=e([r("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaColorNode")],d);const h={bright:0,dark:1};export{d as FocusAreaColorNode,h as styleToEffect};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as s,subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{RenderNodeOutput as r,InternalRenderCategory as i}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{F as n}from"../../../../../chunks/FocusAreaMask.glsl.js";import{FocusAreaMaskTechnique as a}from"./FocusAreaMaskTechnique.js";import{volumeToVao as c}from"./focusAreaMaskUtils.js";import{DepthStencilAttachment as h,PrimitiveType as l}from"../../../../webgl/enums.js";import{noParameters as u}from"../../../../webgl/NoParameters.js";let p=class extends o{constructor(e){super({...e,view:e.focusAreasView.view}),this.consumes={required:[r.TRANSPARENT]},this.produces=i.FOCUSAREA,this._vaos=new Array,this._counts=new Array,this._origins=new Array,this._maskParameters=new n}initialize(){this.updateGeometries()}destroy(){this._vaos.forEach(e=>e.dispose()),this._vaos.length=this._counts.length=this._origins.length=0}precompile(){this.techniques.precompile(a)}render(e){const s=this.techniques.getCompiled(a);if(!s||!this._vaos)return void this.requestRender(1);const t=e.find(({name:e})=>e===r.TRANSPARENT),o=this.renderingContext,n=this.bindParameters,c=n.camera,p=c.fullViewport[2],m=c.fullViewport[3],d=this.fboCache.acquire(p,m,i.FOCUSAREA,2);this.view.stage.renderer.occludedRequiresStencil?(d.acquireDepth(14),o.blitFramebuffer(t.fbo,d.fbo,256)):d.attachDepth(t.getAttachment(h)),o.bindFramebuffer(d.fbo),o.setClearColor(0,0,0,1),o.clear(17408),o.setViewport(0,0,p,m);const f=o.bindTechnique(s,n);o.setFaceCullingEnabled(!1),o.setStencilTestEnabled(!0),o.setStencilOpSeparate(1028,7680,34055,7680),o.setStencilOpSeparate(1029,7680,34056,7680),o.setDepthWriteEnabled(!1);for(let r=0;r<this._vaos.length;r++){const e=this._vaos[r],s=this._counts[r];this._maskParameters.origin=this._origins[r],f.bindDraw(n,u,this._maskParameters),o.bindVAO(e),o.setDepthTestEnabled(!0),o.setStencilWriteMask(255),o.setStencilFunction(519,0,255),o.setColorMask(!1,!1,!1,!1),o.drawArrays(l.TRIANGLES,0,s),o.setDepthTestEnabled(!1),o.setStencilWriteMask(0),o.setStencilFunction(517,0,255),o.setColorMask(!0,!0,!0,!0),o.drawArrays(l.TRIANGLES,0,s)}return d}updateGeometries(){if(!this.view.stage)return;this._vaos.forEach(e=>e.dispose()),this._vaos.length=this._counts.length=this._origins.length=0;this.focusAreasView.volumes.forEach(e=>{const s=e.geometryVolume,{vao:t,vertexCount:r}=c(this.renderingContext,s);this._vaos.push(t),this._counts.push(r),this._origins.push(e.origin)}),this.requestRender(1)}};e([s()],p.prototype,"consumes",void 0),e([s()],p.prototype,"produces",void 0),e([s({constructOnly:!0})],p.prototype,"focusAreasView",void 0),p=e([t("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaMaskNode")],p);export{p as FocusAreaMaskNode};
2
+ import{__decorate as e}from"tslib";import{property as s,subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{RenderNodeOutput as r,InternalRenderCategory as i}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{F as n}from"../../../../../chunks/FocusAreaMask.glsl.js";import{FocusAreaMaskTechnique as a}from"./FocusAreaMaskTechnique.js";import{volumeToVao as h}from"./focusAreaMaskUtils.js";import{DepthStencilAttachment as c,PrimitiveType as u}from"../../../../webgl/enums.js";import{noParameters as l}from"../../../../webgl/NoParameters.js";let p=class extends o{constructor(e){super({...e,view:e.focusAreasView.view}),this.consumes={required:[r.TRANSPARENT]},this.produces=i.FOCUSAREA,this._vaos=new Array,this._counts=new Array,this._origins=new Array,this._maskParameters=new n}initialize(){this.updateGeometries()}destroy(){this._vaos.forEach(e=>e.dispose()),this._vaos.length=this._counts.length=this._origins.length=0}render(e){const s=this.techniques.getCompiled(a);if(!s||!this._vaos)return void this.requestRender(1);const t=e.find(({name:e})=>e===r.TRANSPARENT),o=this.renderingContext,n=this.bindParameters,h=n.camera,p=h.fullViewport[2],d=h.fullViewport[3],m=this.fboCache.acquire(p,d,i.FOCUSAREA,2);this.view.stage.renderer.occludedRequiresStencil?(m.acquireDepth(14),o.blitFramebuffer(t.fbo,m.fbo,256)):m.attachDepth(t.getAttachment(c)),o.bindFramebuffer(m.fbo),o.setClearColor(0,0,0,1),o.clear(17408),o.setViewport(0,0,p,d);const f=o.bindTechnique(s,n);o.setFaceCullingEnabled(!1),o.setStencilTestEnabled(!0),o.setStencilOpSeparate(1028,7680,34055,7680),o.setStencilOpSeparate(1029,7680,34056,7680),o.setDepthWriteEnabled(!1);for(let r=0;r<this._vaos.length;r++){const e=this._vaos[r],s=this._counts[r];this._maskParameters.origin=this._origins[r],f.bindDraw(n,l,this._maskParameters),o.bindVAO(e),o.setDepthTestEnabled(!0),o.setStencilWriteMask(255),o.setStencilFunction(519,0,255),o.setColorMask(!1,!1,!1,!1),o.drawArrays(u.TRIANGLES,0,s),o.setDepthTestEnabled(!1),o.setStencilWriteMask(0),o.setStencilFunction(517,0,255),o.setColorMask(!0,!0,!0,!0),o.drawArrays(u.TRIANGLES,0,s)}return m}updateGeometries(){if(!this.view.stage)return;this._vaos.forEach(e=>e.dispose()),this._vaos.length=this._counts.length=this._origins.length=0;this.focusAreasView.volumes.forEach(e=>{const s=e.geometryVolume,{vao:t,vertexCount:r}=h(this.renderingContext,s);this._vaos.push(t),this._counts.push(r),this._origins.push(e.origin)}),this.requestRender(1)}};e([s()],p.prototype,"consumes",void 0),e([s()],p.prototype,"produces",void 0),e([s({constructOnly:!0})],p.prototype,"focusAreasView",void 0),p=e([t("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaMaskNode")],p);export{p as FocusAreaMaskNode};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{smoothstep as t,lerp as s}from"../../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{copy as n,normalize as m,dot as h,scale as p,lerp as c,length as d}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as l}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as f}from"../../../webgl.js";import{heightLimit as g}from"../../../environment/weather.js";import{TransparentEnvironment as P}from"../TransparentEnvironment.js";import{F as w}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as b}from"./FogTechnique.js";import{FogTechniqueConfiguration as v}from"./FogTechniqueConfiguration.js";import{DepthStencilAttachment as y,ColorAttachment1 as F}from"../../../../webgl/enums.js";const j=.95,E=1;let R=class extends P{constructor(e){super(e),this._configuration=new v,this._newParameters=new q,this._oldParameters=new q,this._fadedParameters=new q,this._parameters=this._newParameters,this._passParameters=new w;const t=u(e.view.spatialReference);this._planetRadius=t.radius,this._atmosphereRadius=t.radius+t.atmosphereHeight}initialize(){this.addHandles([a(()=>this.view.environment.atmosphereEnabled,()=>this._updateEnabled(),i),a(()=>this.view.environment.weather,()=>this._updateEnabled(),i),a(()=>this._updateFogParameters(),()=>{},i)]),this.addHandles(a(()=>this._fadeFactor,e=>this._fade(e),i))}_updateEnabled(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){const{_newParameters:t,_oldParameters:s}=this;e>=1?(this._parameters=t,this._oldParameters.copyFrom(this._newParameters)):e<=0?this._parameters=s:(this._fadedParameters.lerp(s,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){const e=this.view.environment.weather,t="foggy"===e.type||"snowy"===e.type||"rainy"===e.type;this._newParameters.strength=e.fogOpacity,this._newParameters.amount=t?1:0,"foggy"!==e.type&&"snowy"!==e.type||n(this._newParameters.color,N),"rainy"===e.type&&n(this._newParameters.color,C),this._fadeFactor>=1&&this._oldParameters.copyFrom(this._newParameters),this.requestRender(2)}precompile(){this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._parameters.amount>0&&(this._configuration.hasEmissive=this.bindParameters.hasEmission,this.techniques.precompile(b,this._configuration))}render(e){const t=e.find(({name:e})=>e===f.TRANSPARENT_ENVIRONMENT);if(0===this._parameters.amount)return t;if(this._update(),this._passParameters.amount<=0)return t;this._configuration.hasEmissive=this.bindParameters.hasEmission;const s=this.techniques.getCompiled(b,this._configuration);if(!s)return this.requestRender(1),t;const a=this.renderingContext,i=t.getAttachment(y);return this._passParameters.emission=t.obtainAttachment(F),t.attachDepth(null),a.bindFramebuffer(t.fbo),a.bindTechnique(s,this.bindParameters,this._passParameters),a.screen.draw(),t.attachDepth(i),this._passParameters.emission&&(t.attachColor(this._passParameters.emission,F),this._passParameters.emission=r(this._passParameters.emission)),t}_update(){const e=this.bindParameters.camera;m(x,e.eye);const s=Math.max(0,h(x,this.bindParameters.lighting.mainLight.direction)),r=this._parameters.color;p(T,r,.1),c(this._passParameters.color,T,r,s);const a=d(e.eye);this._passParameters.atmosphereC=a**2-this._atmosphereRadius**2,this._passParameters.amount=(1-t(j*g,E*g,Math.abs(a-this._planetRadius)))*this._parameters.amount,this._passParameters.strength=this._parameters.strength}get test(){return{parameters:this._passParameters}}};R=e([o("esri.views.3d.webgl-engine.effects.fog.Fog")],R);class q{constructor(){this.color=_(),this.strength=0,this.amount=0}copyFrom(e){this.amount=e.amount,this.strength=e.strength,n(this.color,e.color)}lerp(e,t,r){this.amount=s(e.amount,t.amount,r),this.strength=s(e.strength,t.strength,r),c(this.color,e.color,t.color,r)}}const x=_(),T=_(),C=l(.5,.5,.5),N=l(1.5,1.5,1.5);export{R as Fog,q as FogParameters};
2
+ import{__decorate as e}from"tslib";import{smoothstep as t,lerp as s}from"../../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{copy as n,normalize as m,dot as h,scale as p,lerp as c,length as d}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l,fromValues as _}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as g}from"../../../webgl.js";import{heightLimit as f}from"../../../environment/weather.js";import{TransparentEnvironment as P}from"../TransparentEnvironment.js";import{F as w}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as b}from"./FogTechnique.js";import{FogTechniqueConfiguration as v}from"./FogTechniqueConfiguration.js";import{DepthStencilAttachment as y,ColorAttachment1 as F}from"../../../../webgl/enums.js";const j=.95,E=1;let R=class extends P{constructor(e){super(e),this._configuration=new v,this._newParameters=new x,this._oldParameters=new x,this._fadedParameters=new x,this._parameters=this._newParameters,this._passParameters=new w;const t=u(e.view.spatialReference);this._planetRadius=t.radius,this._atmosphereRadius=t.radius+t.atmosphereHeight}initialize(){this.addHandles([a(()=>this.view.environment.atmosphereEnabled,()=>this._updateEnabled(),i),a(()=>this.view.environment.weather,()=>this._updateEnabled(),i),a(()=>this._updateFogParameters(),()=>{},i)]),this.addHandles(a(()=>this._fadeFactor,e=>this._fade(e),i))}_updateEnabled(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){const{_newParameters:t,_oldParameters:s}=this;e>=1?(this._parameters=t,this._oldParameters.copyFrom(this._newParameters)):e<=0?this._parameters=s:(this._fadedParameters.lerp(s,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){const{weather:e,weatherAvailable:t}=this.view.environment,s="foggy"===e.type||"snowy"===e.type||"rainy"===e.type;this._newParameters.strength=t?e.fogOpacity:0,this._newParameters.amount=s?1:0,"foggy"!==e.type&&"snowy"!==e.type||n(this._newParameters.color,A),"rainy"===e.type&&n(this._newParameters.color,C),this._fadeFactor>=1&&this._oldParameters.copyFrom(this._newParameters),this.requestRender(2)}get strength(){return this._parameters.strength}precompile(){this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value}render(e){const t=e.find(({name:e})=>e===g.TRANSPARENT_ENVIRONMENT);if(0===this._parameters.amount)return t;if(this._update(),this._passParameters.amount<=0)return t;this._configuration.hasEmissive=this.bindParameters.hasEmission;const s=this.techniques.getCompiled(b,this._configuration);if(!s)return this.requestRender(1),t;const a=this.renderingContext,i=t.getAttachment(y);return this._passParameters.emission=t.obtainAttachment(F),t.attachDepth(null),a.bindFramebuffer(t.fbo),a.bindTechnique(s,this.bindParameters,this._passParameters),a.screen.draw(),t.attachDepth(i),this._passParameters.emission&&(t.attachColor(this._passParameters.emission,F),this._passParameters.emission=r(this._passParameters.emission)),t}_update(){const e=this.bindParameters.camera;m(T,e.eye);const s=Math.max(0,h(T,this.bindParameters.lighting.mainLight.direction)),r=this._parameters.color;p(q,r,.1),c(this._passParameters.color,q,r,s);const a=d(e.eye);this._passParameters.atmosphereC=a**2-this._atmosphereRadius**2,this._passParameters.amount=(1-t(j*f,E*f,Math.abs(a-this._planetRadius)))*this._parameters.amount,this._passParameters.strength=this._parameters.strength}get test(){return{parameters:this._passParameters}}};R=e([o("esri.views.3d.webgl-engine.effects.fog.Fog")],R);class x{constructor(){this.color=l(),this.strength=0,this.amount=0}copyFrom(e){this.amount=e.amount,this.strength=e.strength,n(this.color,e.color)}lerp(e,t,r){this.amount=s(e.amount,t.amount,r),this.strength=s(e.strength,t.strength,r),c(this.color,e.color,t.color,r)}}const T=l(),q=l(),C=_(.5,.5,.5),A=_(1.5,1.5,1.5);export{R as Fog,x as FogParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../../core/Logger.js";import{abortMaybe as r,disposeMaybe as s}from"../../../../../core/maybe.js";import{throwIfAborted as a,isAbortError as i}from"../../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as n}from"../../../../../core/reactiveUtils.js";import{property as l,subclass as m}from"../../../../../core/accessorSupport/decorators.js";import{set as u}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{requestImage as h}from"../../../../../request/image.js";import{InternalRenderCategory as c}from"../../../webgl.js";import p from"../../../webgl/RenderNode.js";import{G as d}from"../../../../../chunks/GlobalIllumination.glsl.js";import{G as f}from"../../../../../chunks/GlobalIlluminationBlur.glsl.js";import{GlobalIlluminationBlurTechnique as _}from"./GlobalIlluminationBlurTechnique.js";import{GlobalIlluminationTechnique as b}from"./GlobalIlluminationTechnique.js";import{GlobalIlluminationTechniqueConfiguration as g}from"./GlobalIlluminationTechniqueConfiguration.js";import{G as w}from"../../../../../chunks/GlobalIlluminationUpscale.glsl.js";import{GlobalIlluminationUpscaleTechnique as P}from"./GlobalIlluminationUpscaleTechnique.js";import{DepthStencilAttachment as x,ColorAttachment1 as T,SizedPixelFormat as I}from"../../../../webgl/enums.js";import C from"../../../../webgl/Texture.js";import{TextureDescriptor as q}from"../../../../webgl/TextureDescriptor.js";const j=1,A=.25;let B=class extends p{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=c.AMBIENT_ILLUMINATION,this._passParameters=new d,this._drawParameters=new f,this._drawParametersUpscale=new w,this._maxFrames=255,this._configuration=new g,this._resetBuffer=!1}async initialize(){this._abortController=new AbortController;const e=this._abortController.signal;try{const t=(await import("./BlueNoise.js")).data;a(e),await this._loadBlueNoiseTexture(t,e),a(e)}catch(r){i(r)||t.getLogger(this).errorOnce("Failed to load blue noise texture:",r)}this.addHandles(o(()=>this.view.stage.renderer.hasGlobalIllumination,()=>{this.resetAccumulation(),this.requestRender(1)},n))}precompile(){this._canRender&&(this._configuration.hasEmission=this.bindParameters.hasEmission,this.techniques.precompile(b,this._configuration),this.techniques.precompile(_),this._needsUpscalePass(this._mode)&&this.techniques.precompile(P))}destroy(){this._abortController=r(this._abortController),this._passParameters.noiseTexture=s(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),s=t?.getTexture(x),a=this._mode;if(!r||!s)return this._emptyOutput;if(this.view.stage.renderView.updating&&this.resetAccumulation(),0===a)return this._resetBuffer=!1,this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this.requestRender(1),this._emptyOutput;const i=this.bindParameters;this._configuration.hasEmission=i.hasEmission;const o=this.techniques.getCompiled(b,this._configuration),n=this.techniques.getCompiled(_),l=this._needsUpscalePass(a),m=l?A:1,h=l?this.techniques.getCompiled(P):null;if(!o||!n||l&&!h)return this.requestRender(1),this._emptyOutput;const p=this.renderingContext,{camera:d}=i;this._passParameters.normalTexture=r,this._passParameters.depthTexture=s,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.scaleGlobalIllumination=m;const{fullWidth:f,fullHeight:g}=d,w=Math.max(1,Math.floor(f*m)),I=Math.max(1,Math.floor(g*m)),C=this.fboCache.acquire(w,I,"global illumination input").acquireColor(T,0);p.bindFramebuffer(C.fbo),p.setViewport(0,0,w,I),p.bindTechnique(o,i,this._passParameters,this._drawParameters),p.screen.draw();const q=C.obtainAttachment(T),B=Math.max(1,Math.round(w/j)),M=Math.max(1,Math.round(I/j)),G=this.fboCache.acquire(B,M,"global illumination blur horizontal");p.bindFramebuffer(G.fbo),this._drawParameters.texture=C.getTexture(),this._drawParameters.weightTexture=q.attachment,u(this._drawParameters.blurSize,0,j/I),p.bindTechnique(n,i,this._passParameters,this._drawParameters),p.setViewport(0,0,B,M),p.screen.draw(),C.release();const N=l?"global illumination blur vertical":c.AMBIENT_ILLUMINATION,F=this.fboCache.acquire(B,M,N);p.bindFramebuffer(F.fbo),p.setViewport(0,0,B,M),p.setClearColor(1,1,1,0),p.clear(16384),this._drawParameters.texture=G.getTexture(),this._drawParameters.weightTexture=q.attachment,u(this._drawParameters.blurSize,j/B,0),p.bindTechnique(n,i,this._passParameters,this._drawParameters),p.setViewport(0,0,B,M),p.screen.draw(),G.release(),F.attachColor(q,T),q.release();let U=F;return h&&(U=this.fboCache.acquire(f,g,c.AMBIENT_ILLUMINATION).acquireColor(T,0),p.bindFramebuffer(U.fbo),p.setViewport(0,0,f,g),p.setClearColor(1,1,1,0),p.clear(16384),this._drawParametersUpscale.colorTexture=F.getTexture(),this._drawParametersUpscale.weightTexture=F.getTexture(T),p.bindTechnique(h,i,this._passParameters,this._drawParametersUpscale),p.screen.draw(),F.release()),p.setViewport4fv(d.fullViewport),this._passParameters.frameCount=(this._passParameters.frameCount+1)%64,++this._passParameters.accumulatedFrames,this._passParameters.accumulatedFrames<this._maxFrames&&this.requestRender(1),U}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,s=this.fboCache.acquire(t,r,c.AMBIENT_ILLUMINATION).acquireColor(T,0);return e.bindFramebuffer(s.fbo),e.setViewport(0,0,t,r),e.clearBuffer(0,[0,0,0,1]),e.clearBuffer(1,[0,0,0,0]),s}async _loadBlueNoiseTexture(e,t){a(t);const r=await h(e,{signal:t});if(a(t),!r)return;const s=new q;s.internalFormat=I.RGBA8,s.wrapMode=10497,s.isImmutable=!0,this._passParameters.noiseTexture=new C(this.renderingContext,s,r)}get _canRender(){const e=this.bindParameters;return!(!this._passParameters.noiseTexture||!e.reprojection.lastFrameColor||e.hasEmission&&!e.reprojection.lastFrameEmission||!e.reprojection.lastFrameDepth||!e.globalIllumination||this._resetBuffer)}get _mode(){const{hasGlobalIlluminationHighQuality:e,hasGlobalIllumination:t}=this.view.stage.renderer;return e?2:t?1:0}resetAccumulation(){this._passParameters.accumulatedFrames=0}_needsUpscalePass(e){return 1===e}get test(){return{passParameters:this._passParameters,configuration:this._configuration,restartAccumulation:()=>{this.resetAccumulation(),this._passParameters.frameCount=0,this._resetBuffer=!0,this.requestRender(1)}}}};e([l()],B.prototype,"consumes",void 0),e([l()],B.prototype,"produces",void 0),e([l()],B.prototype,"_abortController",void 0),B=e([m("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],B);export{B as GlobalIllumination,j as blurSizePixels};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Logger.js";import{abortMaybe as r,disposeMaybe as s}from"../../../../../core/maybe.js";import{throwIfAborted as a,isAbortError as i}from"../../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as l}from"../../../../../core/reactiveUtils.js";import{property as n,subclass as u}from"../../../../../core/accessorSupport/decorators.js";import{set as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{requestImage as h}from"../../../../../request/image.js";import{InternalRenderCategory as c}from"../../../webgl.js";import p from"../../../webgl/RenderNode.js";import{G as d}from"../../../../../chunks/GlobalIllumination.glsl.js";import{G as f}from"../../../../../chunks/GlobalIlluminationBlur.glsl.js";import{GlobalIlluminationBlurTechnique as _}from"./GlobalIlluminationBlurTechnique.js";import{GlobalIlluminationTechnique as b}from"./GlobalIlluminationTechnique.js";import{GlobalIlluminationTechniqueConfiguration as g}from"./GlobalIlluminationTechniqueConfiguration.js";import{G as w}from"../../../../../chunks/GlobalIlluminationUpscale.glsl.js";import{GlobalIlluminationUpscaleTechnique as x}from"./GlobalIlluminationUpscaleTechnique.js";import{DepthStencilAttachment as P,ColorAttachment1 as T,SizedPixelFormat as I}from"../../../../webgl/enums.js";import C from"../../../../webgl/Texture.js";import{TextureDescriptor as q}from"../../../../webgl/TextureDescriptor.js";const j=1;let y=class extends p{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=c.AMBIENT_ILLUMINATION,this._passParameters=new d,this._drawParameters=new f,this._drawParametersUpscale=new w,this._maxFrames=255,this._lowQualityResolutionScale=.25,this._configuration=new g,this._resetBuffer=!1}async initialize(){this._abortController=new AbortController;const e=this._abortController.signal;try{const t=(await import("./BlueNoise.js")).data;a(e),await this._loadBlueNoiseTexture(t,e),a(e)}catch(r){i(r)||t.getLogger(this).errorOnce("Failed to load blue noise texture:",r)}this.addHandles(o(()=>this.view.stage.renderer.hasGlobalIllumination,()=>{this.resetAccumulation(),this.requestRender(1)},l))}destroy(){this._abortController=r(this._abortController),this._passParameters.noiseTexture=s(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),s=t?.getTexture(P),a=this._mode;if(!r||!s)return this._emptyOutput;if(this.view.stage.renderView.updating&&this.resetAccumulation(),0===a)return this._resetBuffer=!1,this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this.requestRender(1),this._emptyOutput;const i=this.bindParameters;this._configuration.hasEmission=i.hasEmission;const o=this.techniques.getCompiled(b,this._configuration),l=this.techniques.getCompiled(_),n=1===a,u=n?this._lowQualityResolutionScale:1,h=n?this.techniques.getCompiled(x):null;if(!o||!l||n&&!h)return this.requestRender(1),this._emptyOutput;const p=this.renderingContext,{camera:d}=i;this._passParameters.normalTexture=r,this._passParameters.depthTexture=s,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.scaleGlobalIllumination=u;const{fullWidth:f,fullHeight:g}=d,w=Math.max(1,Math.floor(f*u)),I=Math.max(1,Math.floor(g*u)),C=this.fboCache.acquire(w,I,"global illumination input").acquireColor(T,0);p.bindFramebuffer(C.fbo),p.setViewport(0,0,w,I),p.bindTechnique(o,i,this._passParameters,this._drawParameters),p.screen.draw();const q=C.obtainAttachment(T),y=Math.max(1,Math.round(w/j)),F=Math.max(1,Math.round(I/j)),A=this.fboCache.acquire(y,F,"global illumination blur horizontal");p.bindFramebuffer(A.fbo),this._drawParameters.texture=C.getTexture(),this._drawParameters.weightTexture=q.attachment,m(this._drawParameters.blurSize,0,j/I),p.bindTechnique(l,i,this._passParameters,this._drawParameters),p.setViewport(0,0,y,F),p.screen.draw(),C.release();const B=n?"global illumination blur vertical":c.AMBIENT_ILLUMINATION,M=this.fboCache.acquire(y,F,B);p.bindFramebuffer(M.fbo),p.setViewport(0,0,y,F),p.setClearColor(1,1,1,0),p.clear(16384),this._drawParameters.texture=A.getTexture(),this._drawParameters.weightTexture=q.attachment,m(this._drawParameters.blurSize,j/y,0),p.bindTechnique(l,i,this._passParameters,this._drawParameters),p.setViewport(0,0,y,F),p.screen.draw(),A.release(),M.attachColor(q,T),q.release();let G=M;return h&&(G=this.fboCache.acquire(f,g,c.AMBIENT_ILLUMINATION).acquireColor(T,0),p.bindFramebuffer(G.fbo),p.setViewport(0,0,f,g),p.setClearColor(1,1,1,0),p.clear(16384),this._drawParametersUpscale.colorTexture=M.getTexture(),this._drawParametersUpscale.weightTexture=M.getTexture(T),p.bindTechnique(h,i,this._passParameters,this._drawParametersUpscale),p.screen.draw(),M.release()),p.setViewport4fv(d.fullViewport),this._passParameters.frameCount=(this._passParameters.frameCount+1)%64,++this._passParameters.accumulatedFrames,this._passParameters.accumulatedFrames<this._maxFrames&&this.requestRender(1),G}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,s=this.fboCache.acquire(t,r,c.AMBIENT_ILLUMINATION).acquireColor(T,0);return e.bindFramebuffer(s.fbo),e.setViewport(0,0,t,r),e.clearBuffer(0,[0,0,0,1]),e.clearBuffer(1,[0,0,0,0]),s}async _loadBlueNoiseTexture(e,t){a(t);const r=await h(e,{signal:t});if(a(t),!r)return;const s=new q;s.internalFormat=I.RGBA8,s.wrapMode=10497,s.isImmutable=!0,this._passParameters.noiseTexture=new C(this.renderingContext,s,r)}get _canRender(){const e=this.bindParameters;return!(!this._passParameters.noiseTexture||!e.reprojection.lastFrameColor||e.hasEmission&&!e.reprojection.lastFrameEmission||!e.reprojection.lastFrameDepth||!e.globalIllumination||this._resetBuffer)}get _mode(){const{hasGlobalIlluminationHighQuality:e,hasGlobalIllumination:t}=this.view.stage.renderer;return e?2:t?1:0}resetAccumulation(){this._passParameters.accumulatedFrames=0}get test(){const e=this;return{passParameters:this._passParameters,configuration:this._configuration,get maxFrames(){return e._maxFrames},set maxFrames(t){e._maxFrames=t},get lowQualityResolutionScale(){return e._lowQualityResolutionScale},set lowQualityResolutionScale(t){e._lowQualityResolutionScale=t},get mode(){return e._mode},restartAccumulation:()=>{this.resetAccumulation(),this._passParameters.frameCount=0,this._resetBuffer=!0,this.requestRender(1)}}}};e([n()],y.prototype,"consumes",void 0),e([n()],y.prototype,"produces",void 0),e([n()],y.prototype,"_abortController",void 0),y=e([u("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],y);export{y as GlobalIllumination,j as blurSizePixels};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{releaseMaybe as e}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as l}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getReferenceEllipsoid as h}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as m}from"../../../webgl.js";import{TransparentEnvironment as u}from"../TransparentEnvironment.js";import{G as c}from"../../../../../chunks/GlowBlur.glsl.js";import{GlowBlurTechnique as p}from"./GlowBlurTechnique.js";import{GlowBlurTechniqueConfiguration as _}from"./GlowBlurTechniqueConfiguration.js";import{G as d,a as g,m as b}from"../../../../../chunks/GlowComposition.glsl.js";import{GlowCompositionTechnique as f}from"./GlowCompositionTechnique.js";import{GlowCompositionTechniqueConfiguration as P}from"./GlowCompositionTechniqueConfiguration.js";import{floatBlendReductionFactor as C}from"../../shaders/oitResolution.glsl.js";import{ColorAttachment1 as w,DepthStencilAttachment as T}from"../../../../webgl/enums.js";let F=class extends u{constructor(t){super(t),this.consumes={required:[m.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=m.TRANSPARENT_ENVIRONMENT,this._mode=0,this._intensity=.5,this._scatteringFactors={realistic:new d([32,16,8,4,2,1],1),maximumFog:new d([0,.27,.6,1.05,1.58,2.1],6),cartographicMin:new d([.4,.18,.25,.12,.05,0],1),cartographicDefault:new d([1.17,1.08,.78,.4,.26,.11],4),cartographicMax:new d([3.59,3.9,2.46,1.4,.93,.44],13)},this._blurHorizontalConfiguration=new _,this._blurVerticalConfiguration=new _,this._compositionConfiguration=new P,this._compositionParameters=new g,this._blurParameters=new c,this._blurScalePerLod=3.06,this._logicalBlurRadius=.0037;const e=h(t.view.spatialReference);this._atmosphereRadius=e.radius+e.atmosphereHeight}initialize(){this.addHandles([i(()=>this._updateFogParameters(),()=>{},r),i(()=>this._updateParameters(),()=>{},r)])}_updateParameters(){const t=this.view.environment.lighting.glow;this._mode=null==t?this.view.environment.atmosphereEnabled?0:2:1,t&&(this._intensity=t.intensity),this._compositionParameters.minDisperse.preset=this._preset,this.requestRender(1)}_updateFogParameters(){const{weather:t,weatherAvailable:e}=this.view.environment;this._compositionParameters.distanceModifier=e?t.fogOpacity:0,this._compositionParameters.maxDisperse=this._scatteringFactors.maximumFog,this.requestRender(1)}precompile(){this._compositionConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionConfiguration.blurEnabled=2!==this._mode,this._compositionConfiguration.blurEnabled&&(this.techniques.precompile(p,this._blurHorizontalConfiguration),this._blurVerticalConfiguration.glowStage=1,this.techniques.precompile(p,this._blurVerticalConfiguration)),this.techniques.precompile(f,this._compositionConfiguration)}render(t){const i=t.find(({name:t})=>t===m.TRANSPARENT_ENVIRONMENT),r=i.getAttachment(w);if(!r?.attachment)return i;const s=i.getTexture(),o=i.getAttachment(T),a=this.fboCache,{fullWidth:l,fullHeight:h}=this.bindParameters.camera,u=this.renderingContext;if(this._compositionConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionParameters.color=s,this._compositionParameters.emission=r.attachment,this._compositionConfiguration.blurEnabled=2!==this._mode,!this._compositionConfiguration.blurEnabled){this._compositionConfiguration.blurEnabled=!1;const t=this.techniques.getCompiled(f,this._compositionConfiguration);if(!t)return this.requestRender(1),i;const e=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);return this._setupFBO(e,l,h),u.bindTechnique(t,this.bindParameters,this._compositionParameters),u.screen.draw(),e.attachDepth(o),e.attachColor(r,w),e}const c=this.techniques.getCompiled(p,this._blurHorizontalConfiguration),_=this.techniques.getCompiled(p,this._blurVerticalConfiguration),d=this.techniques.getCompiled(f,this._compositionConfiguration);if(!c||!_||!d)return this.requestRender(1),i;const g=this.camera,b=n(g.eye);this._compositionParameters.atmosphereC=b**2-this._atmosphereRadius**2,this._renderGlowMipMap(c,_);const P=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);return P.acquireColor(w,this.bindParameters.useFloatBlend.value?8:5,"emissive glow"),this._setupFBO(P,l,h,!0),u.bindTechnique(d,this.bindParameters,this._compositionParameters),u.screen.draw(),this._compositionParameters.lodTexture=e(this._compositionParameters.lodTexture),P.attachDepth(o),P}_renderGlowMipMap(t,e){const i=this.fboCache,{fullWidth:r,fullHeight:s}=this.camera,o=this.renderingContext,n=5;this._blurParameters.input=this._compositionParameters.emission,this._blurParameters.inputScale=C,this._blurParameters.level=0,this._blurParameters.blurRadius=this._logicalBlurRadius,a(this._blurParameters.size,.5*r,.5*s);let l=Math.floor(this._blurParameters.size[0]),h=Math.floor(this._blurParameters.size[1]);const m=i.acquire(l,h,"glow horizontal",8);for(this._compositionParameters.lodTexture=i.acquire(l,h,"glow mipmap",9);l>1&&h>1&&this._blurParameters.level<n;)this._setupFBO(m,l,h),o.bindTechnique(t,this.bindParameters,this._blurParameters),o.screen.draw(),i.debugCallback?.(`glow horizontal ${this._blurParameters.level}`,m.fbo),this._blurParameters.inputScale=1,this._blurParameters.input=m.getTexture(),this._setupFBO(this._compositionParameters.lodTexture,l,h,!1,this._blurParameters.level),o.bindTechnique(e,this.bindParameters,this._blurParameters),o.screen.draw(),i.debugCallback?.(this._compositionParameters.lodTexture.name,this._compositionParameters.lodTexture.fbo),a(this._blurParameters.size,.5*l,.5*h),l=Math.floor(this._blurParameters.size[0]),h=Math.floor(this._blurParameters.size[1]),this._blurParameters.input=this._compositionParameters.lodTexture.getTexture(),this._blurParameters.blurRadius*=this._blurScalePerLod,++this._blurParameters.level;m.release(),this._compositionParameters.lodTexture.fbo.level=0}get _preset(){return 0===this._mode?this._scatteringFactors.realistic.preset:this._intensity<=.5?b(this._scatteringFactors.cartographicMin.preset,this._scatteringFactors.cartographicDefault.preset,2*this._intensity):b(this._scatteringFactors.cartographicDefault.preset,this._scatteringFactors.cartographicMax.preset,2*(this._intensity-.5))}_setupFBO(t,e,i,r=!1,s=0){t.fbo.level=s;const o=this.renderingContext;o.bindFramebuffer(t.fbo),o.setViewport(0,0,e,i),o.setClearColor(0,0,0,0),o.clear(16384),r&&o.clearBuffer(1,l)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setBlurLodCombination:t=>{this._compositionParameters.dispersionWeight=t},preset:this._preset,setMinDisperse:(t,e)=>{0===this._mode?this._scatteringFactors.realistic.preset[t]=e:(this._scatteringFactors.cartographicMin.preset[t]=e,this._scatteringFactors.cartographicMax.preset[t]=e)},toggleTonemapping:t=>{this._compositionConfiguration.tonemappingEnabled=t,this.requestRender(1)}}}};t([s()],F.prototype,"consumes",void 0),t([s()],F.prototype,"produces",void 0),F=t([o("esri.views.3d.webgl-engine.effects.glow.Glow")],F);export{F as Glow};
2
+ import{__decorate as t}from"tslib";import{releaseMaybe as e}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as h}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getReferenceEllipsoid as l}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as m}from"../../../webgl.js";import{TransparentEnvironment as c}from"../TransparentEnvironment.js";import{G as u}from"../../../../../chunks/GlowBlur.glsl.js";import{GlowBlurTechnique as p}from"./GlowBlurTechnique.js";import{GlowBlurTechniqueConfiguration as _}from"./GlowBlurTechniqueConfiguration.js";import{G as d,a as g,m as b}from"../../../../../chunks/GlowComposition.glsl.js";import{GlowCompositionTechnique as f}from"./GlowCompositionTechnique.js";import{GlowCompositionTechniqueConfiguration as P}from"./GlowCompositionTechniqueConfiguration.js";import{floatBlendReductionFactor as w}from"../../shaders/oitResolution.glsl.js";import{ColorAttachment1 as C,DepthStencilAttachment as T}from"../../../../webgl/enums.js";let v=class extends c{constructor(t){super(t),this.consumes={required:[m.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=m.TRANSPARENT_ENVIRONMENT,this._mode=0,this._intensity=.5,this._scatteringFactors={realistic:new d([32,16,8,4,2,1],1),cartographicMin:new d([.4,.18,.25,.12,.05,0],1),cartographicDefault:new d([1.17,1.08,.78,.4,.26,.11],4),cartographicMax:new d([3.59,3.9,2.46,1.4,.93,.44],13)},this._blurHorizontalConfiguration=new _,this._blurVerticalConfiguration=new _,this._compositionConfiguration=new P,this._compositionParameters=new g,this._blurParameters=new u,this._blurScalePerLod=3.06,this._logicalBlurRadius=.0037;const e=l(t.view.spatialReference);this._atmosphereRadius=e.radius+e.atmosphereHeight,this._blurVerticalConfiguration.glowStage=1}initialize(){this.addHandles([i(()=>this._updateParameters(),()=>{},r)])}_updateParameters(){const t=this.view.environment.lighting.glow;this._mode=null==t?this.view.environment.atmosphereEnabled?0:2:1,t&&(this._intensity=t.intensity),this._compositionParameters.minDisperse.preset=this._preset,this.requestRender(1)}render(t){const i=t.find(({name:t})=>t===m.TRANSPARENT_ENVIRONMENT),r=i.getAttachment(C);if(!r?.attachment)return i;const s=i.getTexture(),o=i.getAttachment(T),a=this.fboCache,{fullWidth:h,fullHeight:l}=this.bindParameters.camera,c=this.renderingContext;if(this._compositionConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionParameters.distanceModifier=this.view.stage.renderView.fog?.strength??0,this._compositionParameters.color=s,this._compositionParameters.emission=r.attachment,this._compositionConfiguration.blurEnabled=2!==this._mode,!this._compositionConfiguration.blurEnabled){const t=this.techniques.getCompiled(f,this._compositionConfiguration);if(!t)return this.requestRender(1),i;const e=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);return this._setupFBO(e,h,l),c.bindTechnique(t,this.bindParameters,this._compositionParameters),c.screen.draw(),e.attachDepth(o),e.attachColor(r,C),e}const u=this.techniques.getCompiled(p,this._blurHorizontalConfiguration),_=this.techniques.getCompiled(p,this._blurVerticalConfiguration),d=this.techniques.getCompiled(f,this._compositionConfiguration);if(!u||!_||!d)return this.requestRender(1),i;const g=this.camera,b=n(g.eye);this._compositionParameters.atmosphereC=b**2-this._atmosphereRadius**2,this._renderGlowMipMap(u,_);const P=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);return P.acquireColor(C,this.bindParameters.useFloatBlend.value?8:5,"emissive glow"),this._setupFBO(P,h,l,!0),c.bindTechnique(d,this.bindParameters,this._compositionParameters),c.screen.draw(),this._compositionParameters.lodTexture=e(this._compositionParameters.lodTexture),P.attachDepth(o),P}_renderGlowMipMap(t,e){const i=this.fboCache,{fullWidth:r,fullHeight:s}=this.camera,o=this.renderingContext,n=5;this._blurParameters.input=this._compositionParameters.emission,this._blurParameters.inputScale=w,this._blurParameters.level=0,this._blurParameters.blurRadius=this._logicalBlurRadius,a(this._blurParameters.size,.5*r,.5*s);let h=Math.floor(this._blurParameters.size[0]),l=Math.floor(this._blurParameters.size[1]);const m=i.acquire(h,l,"glow horizontal",8);for(this._compositionParameters.lodTexture=i.acquire(h,l,"glow mipmap",9);h>1&&l>1&&this._blurParameters.level<n;)this._setupFBO(m,h,l),o.bindTechnique(t,this.bindParameters,this._blurParameters),o.screen.draw(),i.debugCallback?.(`glow horizontal ${this._blurParameters.level}`,m.fbo),this._blurParameters.inputScale=1,this._blurParameters.input=m.getTexture(),this._setupFBO(this._compositionParameters.lodTexture,h,l,!1,this._blurParameters.level),o.bindTechnique(e,this.bindParameters,this._blurParameters),o.screen.draw(),i.debugCallback?.(this._compositionParameters.lodTexture.name,this._compositionParameters.lodTexture.fbo),a(this._blurParameters.size,.5*h,.5*l),h=Math.floor(this._blurParameters.size[0]),l=Math.floor(this._blurParameters.size[1]),this._blurParameters.input=this._compositionParameters.lodTexture.getTexture(),this._blurParameters.blurRadius*=this._blurScalePerLod,++this._blurParameters.level;m.release(),this._compositionParameters.lodTexture.fbo.level=0}get _preset(){return 0===this._mode?this._scatteringFactors.realistic.preset:this._intensity<=.5?b(this._scatteringFactors.cartographicMin.preset,this._scatteringFactors.cartographicDefault.preset,2*this._intensity):b(this._scatteringFactors.cartographicDefault.preset,this._scatteringFactors.cartographicMax.preset,2*(this._intensity-.5))}_setupFBO(t,e,i,r=!1,s=0){t.fbo.level=s;const o=this.renderingContext;o.bindFramebuffer(t.fbo),o.setViewport(0,0,e,i),o.setClearColor(0,0,0,0),o.clear(16384),r&&o.clearBuffer(1,h)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setBlurLodCombination:t=>{this._compositionParameters.dispersionWeight=t},preset:this._preset,setMinDisperse:(t,e)=>{0===this._mode?this._scatteringFactors.realistic.preset[t]=e:(this._scatteringFactors.cartographicMin.preset[t]=e,this._scatteringFactors.cartographicMax.preset[t]=e)},toggleTonemapping:t=>{this._compositionConfiguration.tonemappingEnabled=t,this.requestRender(1)}}}};t([s()],v.prototype,"consumes",void 0),t([s()],v.prototype,"produces",void 0),v=t([o("esri.views.3d.webgl-engine.effects.glow.Glow")],v);export{v as Glow};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{lerp as t,smoothstep as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as s,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as h}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{earth as m}from"../../../../../geometry/support/Ellipsoid.js";import{TransparentEnvironment as u}from"../TransparentEnvironment.js";import{H as d}from"../../../../../chunks/HazeCompositing.glsl.js";import{HazeCompositingTechnique as c}from"./HazeCompositingTechnique.js";import{HazePassParameters as p,HazeTechnique as f}from"./HazeTechnique.js";import{HazeTechniqueConfiguration as l}from"./HazeTechniqueConfiguration.js";import{createQuadVAO as _}from"../../lib/glUtil3D.js";import{applyTextureResizeModulo as g}from"../../lib/textureUtils.js";import{DepthStencilAttachment as b,ColorAttachment0 as w,PrimitiveType as C}from"../../../../webgl/enums.js";let P=class extends u{constructor(e){super(e),this._compositingPassParameters=new d,this._passParameters=new p,this._hazeConfiguration=new l,this._oldAmount=1,this._newAmount=1,this._amount=this._newAmount}initialize(){this.addHandles([s(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),o),s(()=>this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1,e=>this._fade(e),o),s(()=>this.view.environment.weather.type,e=>this._newAmount="rainy"===e?0:1,o),s(()=>this.view.stage.renderer?.highResolutionAtmosphere,e=>this._hazeConfiguration.reduced=!e,o)])}_fade(e){e>=1?(this._amount=this._newAmount,this._oldAmount=this._newAmount):this._amount=e<=0?this._oldAmount:t(this._oldAmount,this._newAmount,e)}destroy(){this._vao=r(this._vao)}precompile(){this.techniques.precompile(f,this._hazeConfiguration),this._hazeConfiguration.reduced&&this.techniques.precompile(c)}render(e){const i=e.find(({name:e})=>e===this.produces);if(!this.bindParameters.mainDepth)return i;const r=this.techniques.getCompiled(f,this._hazeConfiguration),s=!!this._hazeConfiguration.reduced&&this.techniques.getCompiled(c);if(null==r||null==s)return i;const o=this.renderingContext,a=i.getAttachment(b);if(this._update(),!s)return i.detachDepth(),o.bindFramebuffer(i.fbo),o.bindTechnique(r,this.bindParameters,this._passParameters),o.setDrawBuffers([w]),this._renderCommon(o),i.attachDepth(a),i;const n=o.getViewport(),u=this.camera,d=h(u.eye)-m.radius;let p;const l=m.atmosphereHeight;if(d<l){const e=Math.min(1,Math.max(0,d/l));p=t(.4,.5,e)}else{const e=Math.min(1,Math.max(0,(d-l)/(15*l)));p=t(.5,1,e)}const _=this.renderingContext.parameters.maxTextureSize,C=g(Math.round(p*u.fullViewport[2]),_),P=g(Math.round(p*u.fullViewport[3]),_);o.setViewport(0,0,C,P);const v=this.fboCache.acquire(C,P,"haze",5);return o.bindFramebuffer(v.fbo),o.clearFramebuffer([0,0,0,1],!0,!0),o.bindTechnique(r,this.bindParameters,this._passParameters),this._renderCommon(o),o.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=v.getTexture(),i.detachDepth(),o.bindFramebuffer(i.fbo),o.bindTechnique(s,this.bindParameters,this._compositingPassParameters),o.setDrawBuffers([w]),o.screen.draw(),i.attachDepth(a),v.release(),i}_renderCommon(e){this._vao??=_(e,1),e.bindVAO(this._vao),e.drawArrays(C.TRIANGLE_STRIP,0,4)}_update(){const e=this.view.basemapTerrain?.getLowerBoundRadius()??0;n(this._passParameters.radii,e,e+m.atmosphereHeight);const r=h(this.bindParameters.camera.eye);this._passParameters.hazeStrength=t(t(.6,1,i(9500,10500,r-m.radius)),1,this._amount)}};P=e([a("esri.views.3d.webgl-engine.effects.haze.Haze")],P);export{P as Haze};
2
+ import{__decorate as e}from"tslib";import{lerp as t,smoothstep as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as s,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as h}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{earth as m}from"../../../../../geometry/support/Ellipsoid.js";import{TransparentEnvironment as u}from"../TransparentEnvironment.js";import{H as d}from"../../../../../chunks/HazeCompositing.glsl.js";import{HazeCompositingTechnique as c}from"./HazeCompositingTechnique.js";import{HazePassParameters as p,HazeTechnique as f}from"./HazeTechnique.js";import{HazeTechniqueConfiguration as l}from"./HazeTechniqueConfiguration.js";import{createQuadVAO as _}from"../../lib/glUtil3D.js";import{applyTextureResizeModulo as b}from"../../lib/textureUtils.js";import{DepthStencilAttachment as g,ColorAttachment0 as w,PrimitiveType as P}from"../../../../webgl/enums.js";let v=class extends u{constructor(e){super(e),this._compositingPassParameters=new d,this._passParameters=new p,this._hazeConfiguration=new l,this._oldAmount=1,this._newAmount=1,this._amount=this._newAmount}initialize(){this.addHandles([s(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),o),s(()=>this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1,e=>this._fade(e),o),s(()=>this.view.environment.weather.type,e=>this._newAmount="rainy"===e?0:1,o),s(()=>this.view.stage.renderer?.highResolutionAtmosphere,e=>this._hazeConfiguration.reduced=!e,o)])}_fade(e){e>=1?(this._amount=this._newAmount,this._oldAmount=this._newAmount):this._amount=e<=0?this._oldAmount:t(this._oldAmount,this._newAmount,e)}destroy(){this._vao=r(this._vao)}render(e){const i=e.find(({name:e})=>e===this.produces);if(!this.bindParameters.mainDepth)return i;const r=this.techniques.getCompiled(f,this._hazeConfiguration),s=!!this._hazeConfiguration.reduced&&this.techniques.getCompiled(c);if(null==r||null==s)return i;const o=this.renderingContext,a=i.getAttachment(g);if(this._update(),!s)return i.detachDepth(),o.bindFramebuffer(i.fbo),o.bindTechnique(r,this.bindParameters,this._passParameters),o.setDrawBuffers([w]),this._renderCommon(o),i.attachDepth(a),i;const n=o.getViewport(),u=this.camera,d=h(u.eye)-m.radius;let p;const l=m.atmosphereHeight;if(d<l){const e=Math.min(1,Math.max(0,d/l));p=t(.4,.5,e)}else{const e=Math.min(1,Math.max(0,(d-l)/(15*l)));p=t(.5,1,e)}const _=this.renderingContext.parameters.maxTextureSize,P=b(Math.round(p*u.fullViewport[2]),_),v=b(Math.round(p*u.fullViewport[3]),_);o.setViewport(0,0,P,v);const C=this.fboCache.acquire(P,v,"haze",5);return o.bindFramebuffer(C.fbo),o.clearFramebuffer([0,0,0,1],!0,!0),o.bindTechnique(r,this.bindParameters,this._passParameters),this._renderCommon(o),o.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=C.getTexture(),i.detachDepth(),o.bindFramebuffer(i.fbo),o.bindTechnique(s,this.bindParameters,this._compositingPassParameters),o.setDrawBuffers([w]),o.screen.draw(),i.attachDepth(a),C.release(),i}_renderCommon(e){this._vao??=_(e,1),e.bindVAO(this._vao),e.drawArrays(P.TRIANGLE_STRIP,0,4)}_update(){const e=this.view.basemapTerrain?.getLowerBoundRadius()??0;n(this._passParameters.radii,e,e+m.atmosphereHeight);const r=h(this.bindParameters.camera.eye);this._passParameters.hazeStrength=t(t(.6,1,i(9500,10500,r-m.radius)),1,this._amount)}};v=e([a("esri.views.3d.webgl-engine.effects.haze.Haze")],v);export{v as Haze};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{releaseMaybe as t,disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as l}from"../../../webgl.js";import a from"../../../webgl/RenderNode.js";import{HighlightApplyTechnique as g}from"./HighlightApplyTechnique.js";import{H as c}from"../../../../../chunks/HighlightBlur.glsl.js";import{HighlightBlurTechnique as u}from"./HighlightBlurTechnique.js";import{H as m,g as p}from"../../../../../chunks/HighlightDownsample.glsl.js";import{HighlightDownsampleTechnique as d}from"./HighlightDownsampleTechnique.js";import{HighlightPassParameters as f}from"./HighlightPassParameters.js";import{HighlightToSingleTechnique as b}from"./HighlightToSingleTechnique.js";import{NoVertex as w}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as x}from"../../lib/VertexArrayObject.js";import{BufferObject as T}from"../../../../webgl/BufferObject.js";import{ColorAttachment0 as C,PrimitiveType as _,DataType as v}from"../../../../webgl/enums.js";import O from"../../../../webgl/Texture.js";import{TextureDescriptor as j}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as H}from"../../../../webgl/VertexBuffer.js";let q=class extends a{constructor(){super(...arguments),this.produces=l.HIGHLIGHT_COLOR,this.consumes={required:[l.HIGHLIGHT_COLOR,"highlights"]},this._downsampleDrawParameters=new m,this._passParameters=new f,this._highlightBlurDrawParameters=new c,this._grid=new P}initialize(){this.addHandles([i(()=>this._updateOptionsTexture(),()=>{},s)])}destroy(){this._grid.coverage=t(this._grid.coverage),this._grid.vao=r(this._grid.vao),this._passParameters.highlightOptionsTexture=t(this._passParameters.highlightOptionsTexture)}_updateOptionsTexture(){if(null==this._passParameters.highlightOptionsTexture){const e=new j(16,2);e.internalFormat=6408,e.samplingMode=9728,this._passParameters.highlightOptionsTexture=new O(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(D(this.view.state.highlights)),this.requestRender(1)}precompile(){this.bindParameters.decorations&&(this.techniques.precompile(d),this.techniques.precompile(b),this.techniques.precompile(u),this.techniques.precompile(g))}render(e){const t=e.find(({name:e})=>e===l.HIGHLIGHT_COLOR),{techniques:r,bindParameters:i,fboCache:s,_passParameters:o,renderingContext:h}=this;if(!i.decorations)return t;const a=r.getCompiled(d),c=r.getCompiled(b),m=r.getCompiled(u),p=r.getCompiled(g);if(!(a&&p&&m&&c))return this.requestRender(1),t;const f=e.find(({name:e})=>"highlights"===e).getTexture();o.highlightTexture=f;const w=this._prepareAndDownSample(f),{width:x,height:T}=f.descriptor;o.highlightTexture=f;const{camera:_}=i,{fullWidth:v,fullHeight:O,pixelRatio:j,fullViewport:H}=_,q=Math.ceil(v/j),P=Math.ceil(O/j),{_highlightBlurDrawParameters:D}=this,y=this.view.stage.renderView.renderer,{highlights:I}=i;for(let l=0;l<I.length;++l){const{name:e}=I[l];if(!y.hasHighlight(e))continue;o.highlightLevel=l,h.setClearColor(0,0,0,0);const r=s.acquire(x,T,"single highlight",2);h.bindFramebuffer(r.fbo),h.setViewport(0,0,x,T),h.clear(16384),h.bindTechnique(c,i,o),this._renderGrid(w),D.blurInput=r.getTexture(),n(D.blurSize,1/q,0);const a=s.acquire(q,P,"single highlight blur",2);h.unbindTexture(a.fbo?.colorTexture),h.bindFramebuffer(a.fbo),h.setViewport(0,0,q,P),h.clear(16384),h.bindTechnique(m,i,o,D),this._renderGrid(w),r.release(),n(D.blurSize,0,1/P),o.highlightBlurTexture=a.getTexture(),h.bindFramebuffer(t.fbo),h.setDrawBuffers([C]),h.setViewport4fv(H),h.bindTechnique(p,i,o,D),this._renderGrid(w),a.release()}return o.coverageTexture=o.highlightTexture=null,t}_prepareAndDownSample(e){this._gridUpdateResources(e);const t=this.techniques.get(d),r=this._gridComputeCoverage(t,e),{horizontalCellCount:i,verticalCellCount:s}=r,o=this._passParameters;return o.horizontalCellCount=i,o.verticalCellCount=s,o.coverageTexture=r.coverage?.getTexture(),r}_renderGrid(e){const t=e.verticalCellCount*e.horizontalCellCount;this.renderingContext.bindVAO(e.vao),this.renderingContext.drawElementsInstanced(_.TRIANGLES,6,v.UNSIGNED_BYTE,0,t)}_gridUpdateResources(e){const t=this._grid,{width:r,height:i}=e.descriptor;if(t.horizontalCellCount=Math.ceil(r/p),t.verticalCellCount=Math.ceil(i/p),t.vao)return;const s=this.renderingContext,o=T.createIndex(s,35044,R);t.vao=new x(s,new H(s,w),o)}_gridComputeCoverage(e,t){const r=this.renderingContext,i=this._grid,s=t.descriptor,o=Math.ceil(s.width/p),h=Math.ceil(s.height/p);this._downsampleDrawParameters.input=t;const{highlights:n}=this.bindParameters;i.coverage?.release();const l=this.fboCache.acquire(o,h,"highlight coverage",n.length>L?3:1);return i.coverage=l,r.bindFramebuffer(l.fbo),r.bindTechnique(e,this.bindParameters,this._passParameters,this._downsampleDrawParameters),r.setViewport(0,0,o,h),r.screen.draw(),i}get test(){}};e([o()],q.prototype,"produces",void 0),e([o()],q.prototype,"consumes",void 0),q=e([h("esri.views.3d.webgl-engine.effects.highlight.Highlight")],q);class P{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}function D(e){const t=new Uint8Array(128);let r=0;for(const i of e){const e=4*r,s=4*r+64;++r;const{color:o}=i,h=i.haloColor??o;t[e+0]=o.r,t[e+1]=o.g,t[e+2]=o.b,t[e+3]=i.fillOpacity*o.a*255,t[s+0]=h.r,t[s+1]=h.g,t[s+2]=h.b,t[s+3]=i.haloOpacity*h.a*255}return t}let y=0;function I(e){let t=0;for(const i of e){const{name:e}=i;t+=e.length;const{color:r,fillOpacity:s,haloColor:o,haloOpacity:h}=i;t+=r.r+r.g+r.b+r.a+s,t+=o?o.r+o.g+o.b+o.a+h:0}const r=e.at(0);if(r){const{shadowOpacity:e,shadowDifference:i,shadowColor:s}=r;t+=e+i+s.r+s.g+s.b+s.a}return y+++(t>=0?0:1)}const R=new Uint8Array([0,1,2,2,1,3]);function G(e,t,r,i,s,o,h=0){const{highlights:l}=s,a=l.length>1?t.acquire(r,i,"highlight mix",l.length>L?3:1):null,{gl:g}=e;if(a){const t=e.boundFramebuffer;e.bindFramebuffer(a.fbo),g.clearBufferuiv(g.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}const c=a?.getTexture();s.highlightMixTexture=c,n(s.highlightMixOrigin,h,0),l.forEach((t,n)=>{if(n>0){const t=O.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(c,t),e.setActiveTexture(t),g.copyTexSubImage2D(3553,0,0,0,h,0,r,i),e.bindTexture(null,t)}e.clear(256),s.highlightLevel=n,o()}),s.highlightLevel=null,s.highlightMixTexture=null,a?.release()}const L=4;export{q as Highlight,L as maxHighlightsPerChannel,G as renderHighlightBuffer,I as trackHighlightOptions};
2
+ import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{releaseMaybe as t,disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as l}from"../../../webgl.js";import a from"../../../webgl/RenderNode.js";import{HighlightApplyTechnique as g}from"./HighlightApplyTechnique.js";import{H as u}from"../../../../../chunks/HighlightBlur.glsl.js";import{HighlightBlurTechnique as c}from"./HighlightBlurTechnique.js";import{H as m,g as d}from"../../../../../chunks/HighlightDownsample.glsl.js";import{HighlightDownsampleTechnique as p}from"./HighlightDownsampleTechnique.js";import{HighlightPassParameters as f}from"./HighlightPassParameters.js";import{HighlightToSingleTechnique as b}from"./HighlightToSingleTechnique.js";import{NoVertex as w}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as x}from"../../lib/VertexArrayObject.js";import{BufferObject as T}from"../../../../webgl/BufferObject.js";import{ColorAttachment0 as C,PrimitiveType as _,DataType as v}from"../../../../webgl/enums.js";import O from"../../../../webgl/Texture.js";import{TextureDescriptor as j}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as H}from"../../../../webgl/VertexBuffer.js";let P=class extends a{constructor(){super(...arguments),this.produces=l.HIGHLIGHT_COLOR,this.consumes={required:[l.HIGHLIGHT_COLOR,"highlights"]},this._downsampleDrawParameters=new m,this._passParameters=new f,this._highlightBlurDrawParameters=new u,this._grid=new q}initialize(){this.addHandles([i(()=>this._updateOptionsTexture(),()=>{},s)])}destroy(){this._grid.coverage=t(this._grid.coverage),this._grid.vao=r(this._grid.vao),this._passParameters.highlightOptionsTexture=t(this._passParameters.highlightOptionsTexture)}_updateOptionsTexture(){if(null==this._passParameters.highlightOptionsTexture){const e=new j(16,2);e.internalFormat=6408,e.samplingMode=9728,this._passParameters.highlightOptionsTexture=new O(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(D(this.view.state.highlights)),this.requestRender(1)}render(e){const t=e.find(({name:e})=>e===l.HIGHLIGHT_COLOR),{techniques:r,bindParameters:i,fboCache:s,_passParameters:o,renderingContext:h}=this;if(!i.decorations)return t;const a=r.getCompiled(p),u=r.getCompiled(b),m=r.getCompiled(c),d=r.getCompiled(g);if(!(a&&d&&m&&u))return this.requestRender(1),t;const f=e.find(({name:e})=>"highlights"===e).getTexture();o.highlightTexture=f;const w=this._prepareAndDownSample(f),{width:x,height:T}=f.descriptor;o.highlightTexture=f;const{camera:_}=i,{fullWidth:v,fullHeight:O,pixelRatio:j,fullViewport:H}=_,P=Math.ceil(v/j),q=Math.ceil(O/j),{_highlightBlurDrawParameters:D}=this,y=this.view.stage.renderView.renderer,{highlights:I}=i;for(let l=0;l<I.length;++l){const{name:e}=I[l];if(!y.hasHighlight(e))continue;o.highlightLevel=l,h.setClearColor(0,0,0,0);const r=s.acquire(x,T,"single highlight",2);h.bindFramebuffer(r.fbo),h.setViewport(0,0,x,T),h.clear(16384),h.bindTechnique(u,i,o),this._renderGrid(w),D.blurInput=r.getTexture(),n(D.blurSize,1/P,0);const a=s.acquire(P,q,"single highlight blur",2);h.unbindTexture(a.fbo?.colorTexture),h.bindFramebuffer(a.fbo),h.setViewport(0,0,P,q),h.clear(16384),h.bindTechnique(m,i,o,D),this._renderGrid(w),r.release(),n(D.blurSize,0,1/q),o.highlightBlurTexture=a.getTexture(),h.bindFramebuffer(t.fbo),h.setDrawBuffers([C]),h.setViewport4fv(H),h.bindTechnique(d,i,o,D),this._renderGrid(w),a.release()}return o.coverageTexture=o.highlightTexture=null,t}_prepareAndDownSample(e){this._gridUpdateResources(e);const t=this.techniques.get(p),r=this._gridComputeCoverage(t,e),{horizontalCellCount:i,verticalCellCount:s}=r,o=this._passParameters;return o.horizontalCellCount=i,o.verticalCellCount=s,o.coverageTexture=r.coverage?.getTexture(),r}_renderGrid(e){const t=e.verticalCellCount*e.horizontalCellCount;this.renderingContext.bindVAO(e.vao),this.renderingContext.drawElementsInstanced(_.TRIANGLES,6,v.UNSIGNED_BYTE,0,t)}_gridUpdateResources(e){const t=this._grid,{width:r,height:i}=e.descriptor;if(t.horizontalCellCount=Math.ceil(r/d),t.verticalCellCount=Math.ceil(i/d),t.vao)return;const s=this.renderingContext,o=T.createIndex(s,35044,R);t.vao=new x(s,new H(s,w),o)}_gridComputeCoverage(e,t){const r=this.renderingContext,i=this._grid,s=t.descriptor,o=Math.ceil(s.width/d),h=Math.ceil(s.height/d);this._downsampleDrawParameters.input=t;const{highlights:n}=this.bindParameters;i.coverage?.release();const l=this.fboCache.acquire(o,h,"highlight coverage",n.length>L?3:1);return i.coverage=l,r.bindFramebuffer(l.fbo),r.bindTechnique(e,this.bindParameters,this._passParameters,this._downsampleDrawParameters),r.setViewport(0,0,o,h),r.screen.draw(),i}get test(){}};e([o()],P.prototype,"produces",void 0),e([o()],P.prototype,"consumes",void 0),P=e([h("esri.views.3d.webgl-engine.effects.highlight.Highlight")],P);class q{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}function D(e){const t=new Uint8Array(128);let r=0;for(const i of e){const e=4*r,s=4*r+64;++r;const{color:o}=i,h=i.haloColor??o;t[e+0]=o.r,t[e+1]=o.g,t[e+2]=o.b,t[e+3]=i.fillOpacity*o.a*255,t[s+0]=h.r,t[s+1]=h.g,t[s+2]=h.b,t[s+3]=i.haloOpacity*h.a*255}return t}let y=0;function I(e){let t=0;for(const i of e){const{name:e}=i;t+=e.length;const{color:r,fillOpacity:s,haloColor:o,haloOpacity:h}=i;t+=r.r+r.g+r.b+r.a+s,t+=o?o.r+o.g+o.b+o.a+h:0}const r=e.at(0);if(r){const{shadowOpacity:e,shadowDifference:i,shadowColor:s}=r;t+=e+i+s.r+s.g+s.b+s.a}return y+++(t>=0?0:1)}const R=new Uint8Array([0,1,2,2,1,3]);function G(e,t,r,i,s,o,h=0){const{highlights:l}=s,a=l.length>1?t.acquire(r,i,"highlight mix",l.length>L?3:1):null,{gl:g}=e;if(a){const t=e.boundFramebuffer;e.bindFramebuffer(a.fbo),g.clearBufferuiv(g.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}const u=a?.getTexture();s.highlightMixTexture=u,n(s.highlightMixOrigin,h,0),l.forEach((t,n)=>{if(n>0){const t=O.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(u,t),e.setActiveTexture(t),g.copyTexSubImage2D(3553,0,0,0,h,0,r,i),e.bindTexture(null,t)}e.clear(256),s.highlightLevel=n,o()}),s.highlightLevel=null,s.highlightMixTexture=null,a?.release()}const L=4;export{P as Highlight,L as maxHighlightsPerChannel,G as renderHighlightBuffer,I as trackHighlightOptions};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{smoothstep as t,clamp as s}from"../../../../../core/mathUtils.js";import{watch as i,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{property as a,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{normalize as o,set as c,dot as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderNodeOutput as d}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{ShadowHighlightPassParameters as l,ShadowHighlightTechnique as u}from"./ShadowHighlightTechnique.js";import{defaultShadowOpacity as g,defaultShadowDifference as f,defaultShadowColor as w}from"../../../../support/HighlightDefaults.js";import{ColorAttachment0 as _}from"../../../../webgl/enums.js";const O=1/512,y=4e4,P=5e4;let b=class extends m{constructor(e){super(e),this.produces=d.COMPOSITE,this.consumes={required:[d.COMPOSITE,"highlights"]},this._passParameters=new l,this._maxOpacity=1,this._shadowDifference=.2}initialize(){this.addHandles([i(()=>this.view.defaultHighlight?.shadowOpacity,e=>{this._passParameters.shadowOpacity=e??g,this._updateOccludedShadowOpacity(),this._ensureMaxOpacity()},r),i(()=>this.view.defaultHighlight?.shadowDifference,e=>{this._shadowDifference=e??f,this._updateOccludedShadowOpacity(),this._ensureMaxOpacity()},r),i(()=>this.view.defaultHighlight?.shadowColor,e=>{this._passParameters.shadowColor=(e??w).toUnitRGBA(),this._ensureMaxOpacity()},r)])}_updateOccludedShadowOpacity(){this._passParameters.occludedShadowOpacity=this._passParameters.shadowOpacity*(1-this._shadowDifference)}_ensureMaxOpacity(){const e=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity);this._maxOpacity=e*this._passParameters.shadowColor[3],this.requestRender(1)}precompile(){this._ensureIfVisible()&&this.techniques.precompile(u)}render(e){const t=e.find(({name:e})=>e===d.COMPOSITE),s=this.bindParameters;if(!this._ensureIfVisible())return t;const i=this.techniques.getCompiled(u);if(!i)return this.requestRender(1),t;this._passParameters.highlightTexture=e.find(({name:e})=>"highlights"===e)?.getTexture(),this._passParameters.origin=s.camera.center;const r=this.renderingContext,a=t.obtainDepthTexture();return r.bindFramebuffer(t.fbo),r.setDrawBuffers([_]),r.bindTechnique(i,s,this._passParameters),r.screen.draw(),t.attachDepth(a),a?.release(),t}_ensureIfVisible(){const e=this.bindParameters;if(!e.hasShadowHighlights||!e.mainDepth||!e.shadowHighlight?.getTexture())return!1;const{camera:i,lighting:r}=e;this._passParameters.opacityElevation=1-t(y,P,i.relativeElevation);const a=1===this.viewingMode?o(x,i.center):c(x,0,0,1),h=n(a,r.mainLight.direction);return this._passParameters.dayNightTerminator=t(0,1,s(30*h,0,1)),this._maxOpacity*this._passParameters.opacityElevation*this._passParameters.dayNightTerminator>=O}};e([a()],b.prototype,"produces",void 0),e([a()],b.prototype,"consumes",void 0),e([a({constructOnly:!0})],b.prototype,"viewingMode",void 0),b=e([h("esri.views.3d.webgl-engine.effects.highlight.ShadowHighlight")],b);const x=p();export{b as ShadowHighlight};
2
+ import{__decorate as e}from"tslib";import{smoothstep as t,clamp as s}from"../../../../../core/mathUtils.js";import{watch as i,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{property as r,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{normalize as h,set as c,dot as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderNodeOutput as p}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{ShadowHighlightPassParameters as l,ShadowHighlightTechnique as u}from"./ShadowHighlightTechnique.js";import{defaultShadowOpacity as g,defaultShadowDifference as f,defaultShadowColor as w}from"../../../../support/HighlightDefaults.js";import{ColorAttachment0 as _}from"../../../../webgl/enums.js";const O=1/512,y=4e4,P=5e4;let x=class extends m{constructor(e){super(e),this.produces=p.COMPOSITE,this.consumes={required:[p.COMPOSITE,"highlights"]},this._passParameters=new l,this._maxOpacity=1,this._shadowDifference=.2}initialize(){this.addHandles([i(()=>this.view.defaultHighlight?.shadowOpacity,e=>{this._passParameters.shadowOpacity=e??g,this._updateOccludedShadowOpacity(),this._ensureMaxOpacity()},a),i(()=>this.view.defaultHighlight?.shadowDifference,e=>{this._shadowDifference=e??f,this._updateOccludedShadowOpacity(),this._ensureMaxOpacity()},a),i(()=>this.view.defaultHighlight?.shadowColor,e=>{this._passParameters.shadowColor=(e??w).toUnitRGBA(),this._ensureMaxOpacity()},a)])}_updateOccludedShadowOpacity(){this._passParameters.occludedShadowOpacity=this._passParameters.shadowOpacity*(1-this._shadowDifference)}_ensureMaxOpacity(){const e=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity);this._maxOpacity=e*this._passParameters.shadowColor[3],this.requestRender(1)}render(e){const t=e.find(({name:e})=>e===p.COMPOSITE),s=this.bindParameters;if(!this._ensureIfVisible())return t;const i=this.techniques.getCompiled(u);if(!i)return this.requestRender(1),t;this._passParameters.highlightTexture=e.find(({name:e})=>"highlights"===e)?.getTexture(),this._passParameters.origin=s.camera.center;const a=this.renderingContext,r=t.obtainDepthTexture();return a.bindFramebuffer(t.fbo),a.setDrawBuffers([_]),a.bindTechnique(i,s,this._passParameters),a.screen.draw(),t.attachDepth(r),r?.release(),t}_ensureIfVisible(){const e=this.bindParameters;if(!e.hasShadowHighlights||!e.mainDepth||!e.shadowHighlight?.getTexture())return!1;const{camera:i,lighting:a}=e;this._passParameters.opacityElevation=1-t(y,P,i.relativeElevation);const r=1===this.viewingMode?h(b,i.center):c(b,0,0,1),o=n(r,a.mainLight.direction);return this._passParameters.dayNightTerminator=t(0,1,s(30*o,0,1)),this._maxOpacity*this._passParameters.opacityElevation*this._passParameters.dayNightTerminator>=O}};e([r()],x.prototype,"produces",void 0),e([r()],x.prototype,"consumes",void 0),e([r({constructOnly:!0})],x.prototype,"viewingMode",void 0),x=e([o("esri.views.3d.webgl-engine.effects.highlight.ShadowHighlight")],x);const b=d();export{x as ShadowHighlight};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as r,subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as s}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as i}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{ReadShadowMapOrigin as a}from"../../core/shaderLibrary/shading/calculateUVZShadow.glsl.js";import{ShadowHighlightBufferTechnique as h}from"./ShadowHighlightBufferTechnique.js";let n=class extends o{get requireGeometryDepth(){return this.bindParameters.hasShadowHighlights}constructor(e){super(e),this.produces=i.SHADOW_HIGHLIGHT,this._passParameters=new a}precompile(){this.bindParameters.hasShadowHighlights&&this.techniques.precompile(h)}render(){const e=this.bindParameters,r=null!=e.depth,t=null!=e.shadowMap.getOutput(6);if(!e.hasShadowHighlights||!r&&!t)return;const o=this.techniques.getCompiled(h);if(!o)return void this.requestRender(1);const{fullWidth:a,fullHeight:n}=e.camera,c=this.fboCache.acquire(a,n,i.SHADOW_HIGHLIGHT,0);this._passParameters.origin=e.camera.center;const d=this.renderingContext;return d.bindFramebuffer(c.fbo),d.clearFramebuffer(s),d.bindTechnique(o,e,this._passParameters),d.screen.draw(),c}};e([r()],n.prototype,"produces",void 0),n=e([t("esri.views.3d.webgl-engine.effects.highlight.ShadowHighlightBuffer")],n);export{n as ShadowHighlightBuffer};
2
+ import{__decorate as e}from"tslib";import{property as r,subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as s}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as i}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{ReadShadowMapOrigin as a}from"../../core/shaderLibrary/shading/calculateUVZShadow.glsl.js";import{ShadowHighlightBufferTechnique as h}from"./ShadowHighlightBufferTechnique.js";let n=class extends o{get requireGeometryDepth(){return this.bindParameters.hasShadowHighlights}constructor(e){super(e),this.produces=i.SHADOW_HIGHLIGHT,this._passParameters=new a}render(){const e=this.bindParameters,r=null!=e.depth,t=null!=e.shadowMap.getOutput(6);if(!e.hasShadowHighlights||!r&&!t)return;const o=this.techniques.getCompiled(h);if(!o)return void this.requestRender(1);const{fullWidth:a,fullHeight:n}=e.camera,c=this.fboCache.acquire(a,n,i.SHADOW_HIGHLIGHT,0);this._passParameters.origin=e.camera.center;const d=this.renderingContext;return d.bindFramebuffer(c.fbo),d.clearFramebuffer(s),d.bindTechnique(o,e,this._passParameters),d.screen.draw(),c}};e([r()],n.prototype,"produces",void 0),n=e([t("esri.views.3d.webgl-engine.effects.highlight.ShadowHighlightBuffer")],n);export{n as ShadowHighlightBuffer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{createTask as s}from"../../../../../core/asyncUtils.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as t,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{createScreenPointArray as o,createRenderScreenPointArray as m,screenPointObjectToArray as n}from"../../../../../core/screenUtils.js";import{isSVG as h}from"../../../../../core/urlUtils.js";import{property as l,subclass as u}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as p}from"../../../../../request/image.js";import{InternalRenderCategory as c}from"../../../webgl.js";import _ from"../../../webgl/RenderNode.js";import{M as g}from"../../../../../chunks/Magnifier.glsl.js";import{MagnifierTechnique as d}from"./MagnifierTechnique.js";import{createQuadVAO as f}from"../../lib/glUtil3D.js";import{loadMagnifierResources as v}from"../../../../magnifier/resources.js";import{ColorAttachment0 as T,PrimitiveType as k}from"../../../../webgl/enums.js";import P from"../../../../webgl/Texture.js";import{TextureDescriptor as y}from"../../../../webgl/TextureDescriptor.js";let x=class extends _{constructor(){super(...arguments),this.produces=c.MAGNIFIER,this.consumes={required:[c.MAGNIFIER]},this._imageSources=null,this._imageLoadTask=null,this._passParameters=new g,this._magnifier=null,this._tmpScreenPoint=o(),this._tmpRenderPoint=m()}initialize(){this.addHandles([t(()=>this.view.magnifier,e=>this._update(e),a)])}_update(e){if(e===this._magnifier)return;this.removeAllHandles(),this._magnifier=e;const s=()=>{const e=this._validMagnifier;e?(this._loadResources(e),this.produces=c.MAGNIFIER):this.produces="disabled",this.requestRender()};this._magnifier&&this.addHandles(t(()=>this._magnifier?.version,s)),s()}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,null!=this._imageLoadTask&&(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)}precompile(){this._imageSources&&this.techniques.precompile(d)}render(e){const s=this._validMagnifier,r=e.find(({name:e})=>e===c.MAGNIFIER);if(null==s)return r;if(null==this._imageSources)return this.requestRender(1),r;const t=this.renderingContext,a=this.camera.pixelRatio,o=Math.ceil(a*s.size);this._vao??=f(t,0,0,1);const m=this.techniques.getCompiled(d);if(this._ensureTextureResources(t,o),!m||!this._passParameters.input)return this.requestRender(1),r;const h=Math.ceil(1/this._factor*o),l=this._passParameters.input;l.resize(h,h),n(s.position,this._tmpScreenPoint);const u=this.camera.screenToRender(this._tmpScreenPoint,this._tmpRenderPoint),p=this.camera.fullWidth,_=this.camera.fullHeight,g=.5*h,v=.5*h;u[0]=i(u[0],g,p-g-1),u[1]=i(u[1],v,_-v-1);const P=Math.floor(u[0]-g),y=Math.floor(u[1]-v);t.bindFramebuffer(r.fbo);return m.program.bindTexture("textureInput",l),t.gl.copyTexImage2D(l.descriptor.target,0,l.descriptor.pixelFormat,P,y,h,h,0),this._passParameters.magnifier=s,t.bindTechnique(m,this.bindParameters,this._passParameters),t.setDrawBuffers([T]),t.bindVAO(this._vao),t.drawArrays(k.TRIANGLE_STRIP,0,4),r}_loadResources(e){const{maskUrl:i,overlayUrl:r}=e;this._imageLoadTask?.maskUrl===i&&this._imageLoadTask?.overlayUrl===r||(this._imageLoadTask?.task.abort(),this._imageLoadTask=this._imageSources=null),this._imageSources||this._imageLoadTask||(this._imageLoadTask={maskUrl:i,overlayUrl:r,task:s(async e=>{const s=null==i||null==r?v(e):null,t=null!=i?p(i,{signal:e}):s.then(e=>e.mask),a=null!=r?p(r,{signal:e}):s.then(e=>e.overlay);this._imageSources={mask:await t,overlay:await a}})})}_ensureTextureResources(e,s){null==this._imageSources||this._passParameters.size===s&&this._passParameters.input&&this._passParameters.mask&&this._passParameters.overlay||(this._disposeTextures(),this._imageSources.overlay.width=this._imageSources.mask.width=s,this._imageSources.overlay.height=this._imageSources.mask.height=s,this._passParameters.overlay=new P(e,this._createTextureDescriptor(s,6408,this._imageSources.overlay),this._imageSources.overlay),this._passParameters.mask=new P(e,this._createTextureDescriptor(s,6406,this._imageSources.mask),this._imageSources.mask),this._passParameters.input=new P(e,this._createTextureDescriptor(s,6408,null)))}_createTextureDescriptor(e,s,i){const r=this.renderingContext,t=new y(e);return t.pixelFormat=t.internalFormat=s,t.wrapMode=33071,t.flipped=!!i,t.preMultiplyAlpha=!(6408!==s||!i||h(i.src)&&r.driverTest.svgPremultipliesAlpha.result),t}};e([l()],x.prototype,"produces",void 0),e([l()],x.prototype,"consumes",void 0),e([l()],x.prototype,"_imageSources",void 0),e([l()],x.prototype,"_imageLoadTask",void 0),x=e([u("esri.views.3d.webgl-engine.effects.magnifier.Magnifier")],x);export{x as Magnifier};
2
+ import{__decorate as e}from"tslib";import{createTask as s}from"../../../../../core/asyncUtils.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as t,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{createScreenPointArray as o,createRenderScreenPointArray as m,screenPointObjectToArray as n}from"../../../../../core/screenUtils.js";import{isSVG as h}from"../../../../../core/urlUtils.js";import{property as l,subclass as u}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as p}from"../../../../../request/image.js";import{InternalRenderCategory as c}from"../../../webgl.js";import _ from"../../../webgl/RenderNode.js";import{M as g}from"../../../../../chunks/Magnifier.glsl.js";import{MagnifierTechnique as d}from"./MagnifierTechnique.js";import{createQuadVAO as f}from"../../lib/glUtil3D.js";import{loadMagnifierResources as v}from"../../../../magnifier/resources.js";import{ColorAttachment0 as T,PrimitiveType as k}from"../../../../webgl/enums.js";import P from"../../../../webgl/Texture.js";import{TextureDescriptor as y}from"../../../../webgl/TextureDescriptor.js";let x=class extends _{constructor(){super(...arguments),this.produces=c.MAGNIFIER,this.consumes={required:[c.MAGNIFIER]},this._imageSources=null,this._imageLoadTask=null,this._passParameters=new g,this._magnifier=null,this._tmpScreenPoint=o(),this._tmpRenderPoint=m()}initialize(){this.addHandles([t(()=>this.view.magnifier,e=>this._update(e),a)])}_update(e){if(e===this._magnifier)return;this.removeAllHandles(),this._magnifier=e;const s=()=>{const e=this._validMagnifier;e?(this._loadResources(e),this.produces=c.MAGNIFIER):this.produces="disabled",this.requestRender()};this._magnifier&&this.addHandles(t(()=>this._magnifier?.version,s)),s()}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,null!=this._imageLoadTask&&(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(e){const s=this._validMagnifier,r=e.find(({name:e})=>e===c.MAGNIFIER);if(null==s)return r;if(null==this._imageSources)return this.requestRender(1),r;const t=this.renderingContext,a=this.camera.pixelRatio,o=Math.ceil(a*s.size);this._vao??=f(t,0,0,1);const m=this.techniques.getCompiled(d);if(this._ensureTextureResources(t,o),!m||!this._passParameters.input)return this.requestRender(1),r;const h=Math.ceil(1/this._factor*o),l=this._passParameters.input;l.resize(h,h),n(s.position,this._tmpScreenPoint);const u=this.camera.screenToRender(this._tmpScreenPoint,this._tmpRenderPoint),p=this.camera.fullWidth,_=this.camera.fullHeight,g=.5*h,v=.5*h;u[0]=i(u[0],g,p-g-1),u[1]=i(u[1],v,_-v-1);const P=Math.floor(u[0]-g),y=Math.floor(u[1]-v);t.bindFramebuffer(r.fbo);return m.program.bindTexture("textureInput",l),t.gl.copyTexImage2D(l.descriptor.target,0,l.descriptor.pixelFormat,P,y,h,h,0),this._passParameters.magnifier=s,t.bindTechnique(m,this.bindParameters,this._passParameters),t.setDrawBuffers([T]),t.bindVAO(this._vao),t.drawArrays(k.TRIANGLE_STRIP,0,4),r}_loadResources(e){const{maskUrl:i,overlayUrl:r}=e;this._imageLoadTask?.maskUrl===i&&this._imageLoadTask?.overlayUrl===r||(this._imageLoadTask?.task.abort(),this._imageLoadTask=this._imageSources=null),this._imageSources||this._imageLoadTask||(this._imageLoadTask={maskUrl:i,overlayUrl:r,task:s(async e=>{const s=null==i||null==r?v(e):null,t=null!=i?p(i,{signal:e}):s.then(e=>e.mask),a=null!=r?p(r,{signal:e}):s.then(e=>e.overlay);this._imageSources={mask:await t,overlay:await a}})})}_ensureTextureResources(e,s){null==this._imageSources||this._passParameters.size===s&&this._passParameters.input&&this._passParameters.mask&&this._passParameters.overlay||(this._disposeTextures(),this._imageSources.overlay.width=this._imageSources.mask.width=s,this._imageSources.overlay.height=this._imageSources.mask.height=s,this._passParameters.overlay=new P(e,this._createTextureDescriptor(s,6408,this._imageSources.overlay),this._imageSources.overlay),this._passParameters.mask=new P(e,this._createTextureDescriptor(s,6406,this._imageSources.mask),this._imageSources.mask),this._passParameters.input=new P(e,this._createTextureDescriptor(s,6408,null)))}_createTextureDescriptor(e,s,i){const r=this.renderingContext,t=new y(e);return t.pixelFormat=t.internalFormat=s,t.wrapMode=33071,t.flipped=!!i,t.preMultiplyAlpha=!(6408!==s||!i||h(i.src)&&r.driverTest.svgPremultipliesAlpha.result),t}};e([l()],x.prototype,"produces",void 0),e([l()],x.prototype,"consumes",void 0),e([l()],x.prototype,"_imageSources",void 0),e([l()],x.prototype,"_imageLoadTask",void 0),x=e([u("esri.views.3d.webgl-engine.effects.magnifier.Magnifier")],x);export{x as Magnifier};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{lerp as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as r,sync as n}from"../../../../../core/reactiveUtils.js";import{secondsFromMilliseconds as o}from"../../../../../core/time.js";import{property as a,subclass as c}from"../../../../../core/accessorSupport/decorators.js";import{getReferenceEllipsoid as d}from"../../../../../geometry/ellipsoidUtils.js";import{getContinuousIndexArray as p}from"../../../../../geometry/support/Indices.js";import{InternalRenderCategory as m}from"../../../webgl.js";import{glLayout as h}from"../../../support/buffer/glUtil.js";import{newLayout as f}from"../../../support/buffer/InterleavedLayout.js";import{TransparentEnvironment as u}from"../TransparentEnvironment.js";import{PrecipitationPassParameters as l,PrecipitationTechnique as _}from"./PrecipitationTechnique.js";import{PrecipitationTechniqueConfiguration as b}from"./PrecipitationTechniqueConfiguration.js";import{VertexArrayObject as y}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as w,PrimitiveType as v}from"../../../../webgl/enums.js";import{bindVertexBufferLayout as g}from"../../../../webgl/Util.js";import{fromLayout as j}from"../../../../webgl/VertexAttributeLocations.js";import{VertexBuffer as P}from"../../../../webgl/VertexBuffer.js";let I=class extends u{constructor(e){super(e),this._hasSnowCover=!1,this._rainSpeed=.1,this._snowSpeed=.01,this._numParticles=0,this._passParameters=new l,this._configuration=new b,this._forcedTime=null;const{view:t,type:s}=e;this._configuration.type="rainy"===s?0:1,this._passParameters.time=0,this._passParameters.radius=d(t.spatialReference).radius,this.addHandles([i(()=>t.environment.weather,e=>{e.type===s&&this.addHandles([i(()=>e.precipitation,e=>this._adjustParticles(e),r),i(()=>"snowy"===e.type&&"enabled"===e.snowCover,e=>this._hasSnowCover=e,r)])},r)]),this.addHandles(i(()=>t.stage?.renderer.renderContext.bind.clouds.fadeFactor??1,e=>{this._passParameters.opacity=e,1===e&&(this.removeHandles("opacity"),this.addHandles(i(()=>t.stage?.renderer.renderContext.bind.clouds.opacity??1,e=>this._passParameters.opacity=e,r),"opacity"))},n),"opacity")}initialize(){this.addHandles([i(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),r)])}_adjustParticles(e){const s=.35,i=e<.5?t(0,s,2*e):t(s,1,2*(e-.5));this._numParticles=C*i}destroy(){this._numParticles=0,this._vao=s(this._vao),this._instanceIdBuffer=s(this._instanceIdBuffer)}fadeOut(e){this.removeAllHandles(),this.addHandles(i(()=>this.renderContext?.bind.clouds.fadeFactor??1,t=>{this._passParameters.opacity=1-t,1===t&&(this.removeAllHandles(),e())}),"opacity")}get snowCover(){return this._hasSnowCover?this._passParameters.opacity:null}updateAnimation(e){const t=("rainy"===this.type?this._rainSpeed:this._snowSpeed)*o(this._forcedTime??e.time)%1e5;return this._passParameters.time!==t&&(this._passParameters.time=t,!0)}precompile(){this.view.stage.renderView.techniques.precompile(_,this._configuration)}render(e){const t=e.find(({name:e})=>e===m.TRANSPARENT_ENVIRONMENT),s=this.techniques.getCompiled(_,this._configuration);if(!s)return this.requestRender(1),t;const i=Math.round(this._numParticles*this._passParameters.opacity);if(i<1)return t;const r=this.renderingContext,n=r.bindTechnique(s,this.bindParameters,this._passParameters);return r.setDrawBuffers([w]),this._vao??=A(r),r.bindVAO(this._vao),this._bindInstanceIdBuffer(n.locations),n.assertCompatibleVertexAttributeLocations(this._vao,j(x)),r.drawArraysInstanced(v.TRIANGLES,0,3,i),r.unbindBuffer(34962),t}_bindInstanceIdBuffer(e){const t=this.renderingContext;if(this._instanceIdBuffer)return void t.bindBuffer(this._instanceIdBuffer);const s=p(C);this._instanceIdBuffer=new P(t,x,new Float32Array(s)),g(t,e,this._instanceIdBuffer,0)}get test(){}};function A(e){const t=new Float32Array([-1,0,1,1,0,-1,1,0,1]);return new y(e,new P(e,h(B),t))}e([a({constructOnly:!0})],I.prototype,"type",void 0),I=e([c("esri.views.3d.webgl-engine.effects.precipitation.Precipitation")],I);const C=25e4,B=f().vec3f("position").freeze(),x=h(f().f32("instanceFeatureAttribute"),1);export{I as Precipitation};
2
+ import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{lerp as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as r,sync as n}from"../../../../../core/reactiveUtils.js";import{secondsFromMilliseconds as o}from"../../../../../core/time.js";import{property as a,subclass as d}from"../../../../../core/accessorSupport/decorators.js";import{getReferenceEllipsoid as c}from"../../../../../geometry/ellipsoidUtils.js";import{getContinuousIndexArray as m}from"../../../../../geometry/support/Indices.js";import{InternalRenderCategory as p}from"../../../webgl.js";import{glLayout as h}from"../../../support/buffer/glUtil.js";import{newLayout as f}from"../../../support/buffer/InterleavedLayout.js";import{TransparentEnvironment as u}from"../TransparentEnvironment.js";import{PrecipitationPassParameters as l,PrecipitationTechnique as _}from"./PrecipitationTechnique.js";import{PrecipitationTechniqueConfiguration as b}from"./PrecipitationTechniqueConfiguration.js";import{VertexArrayObject as y}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as w,PrimitiveType as v}from"../../../../webgl/enums.js";import{bindVertexBufferLayout as j}from"../../../../webgl/Util.js";import{fromLayout as P}from"../../../../webgl/VertexAttributeLocations.js";import{VertexBuffer as g}from"../../../../webgl/VertexBuffer.js";let I=class extends u{constructor(e){super(e),this._hasSnowCover=!1,this._rainSpeed=.1,this._snowSpeed=.01,this._numParticles=0,this._passParameters=new l,this._configuration=new b,this._forcedTime=null;const{view:t,type:s}=e;this._configuration.type="rainy"===s?0:1,this._passParameters.time=0,this._passParameters.radius=c(t.spatialReference).radius,this.addHandles([i(()=>t.environment.weather,e=>{e.type===s&&this.addHandles([i(()=>e.precipitation,e=>this._adjustParticles(e),r),i(()=>"snowy"===e.type&&"enabled"===e.snowCover,e=>this._hasSnowCover=e,r)])},r)]),this.addHandles(i(()=>t.stage?.renderer.renderContext.bind.clouds.fadeFactor??1,e=>{this._passParameters.opacity=e,1===e&&(this.removeHandles("opacity"),this.addHandles(i(()=>t.stage?.renderer.renderContext.bind.clouds.opacity??1,e=>this._passParameters.opacity=e,r),"opacity"))},n),"opacity")}initialize(){this.addHandles([i(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),r)])}_adjustParticles(e){const s=.35,i=e<.5?t(0,s,2*e):t(s,1,2*(e-.5));this._numParticles=C*i}destroy(){this._numParticles=0,this._vao=s(this._vao),this._instanceIdBuffer=s(this._instanceIdBuffer)}fadeOut(e){this.removeAllHandles(),this.addHandles(i(()=>this.renderContext?.bind.clouds.fadeFactor??1,t=>{this._passParameters.opacity=1-t,1===t&&(this.removeAllHandles(),e())}),"opacity")}get snowCover(){return this._hasSnowCover?this._passParameters.opacity:null}updateAnimation(e){const t=("rainy"===this.type?this._rainSpeed:this._snowSpeed)*o(this._forcedTime??e.time)%1e5;return this._passParameters.time!==t&&(this._passParameters.time=t,!0)}render(e){const t=e.find(({name:e})=>e===p.TRANSPARENT_ENVIRONMENT),s=this.techniques.getCompiled(_,this._configuration);if(!s)return this.requestRender(1),t;const i=Math.round(this._numParticles*this._passParameters.opacity);if(i<1)return t;const r=this.renderingContext,n=r.bindTechnique(s,this.bindParameters,this._passParameters);return r.setDrawBuffers([w]),this._vao??=A(r),r.bindVAO(this._vao),this._bindInstanceIdBuffer(n.locations),n.assertCompatibleVertexAttributeLocations(this._vao,P(x)),r.drawArraysInstanced(v.TRIANGLES,0,3,i),r.unbindBuffer(34962),t}_bindInstanceIdBuffer(e){const t=this.renderingContext;if(this._instanceIdBuffer)return void t.bindBuffer(this._instanceIdBuffer);const s=m(C);this._instanceIdBuffer=new g(t,x,new Float32Array(s)),j(t,e,this._instanceIdBuffer,0)}get test(){}};function A(e){const t=new Float32Array([-1,0,1,1,0,-1,1,0,1]);return new y(e,new g(e,h(B),t))}e([a({constructOnly:!0})],I.prototype,"type",void 0),I=e([d("esri.views.3d.webgl-engine.effects.precipitation.Precipitation")],I);const C=25e4,B=f().vec3f("position").freeze(),x=h(f().f32("instanceFeatureAttribute"),1);export{I as Precipitation};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import r from"../../../../../core/Logger.js";import{abortMaybe as t,disposeMaybe as s}from"../../../../../core/maybe.js";import{throwIfAborted as i,isAbortError as a}from"../../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as n}from"../../../../../core/reactiveUtils.js";import{property as h,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as u}from"../../../../../request/image.js";import{InternalRenderCategory as c}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{SMAABlendWeightsTechnique as d}from"./SMAABlendWeightsTechnique.js";import{SMAABlurTechnique as p}from"./SMAABlurTechnique.js";import{SMAAEdgeDetectTechnique as b}from"./SMAAEdgeDetectTechnique.js";import{SMAAPassParameters as f}from"./SMAAPassParameters.js";import T from"../../../../webgl/Texture.js";import{TextureDescriptor as x}from"../../../../webgl/TextureDescriptor.js";let _=class extends m{constructor(e){super(e),this.produces="disabled",this.consumes={required:[c.ANTIALIASING]},this._areaTexture=null,this._searchTexture=null,this._smaaParameters=new f}initialize(){this.addHandles([o(()=>this.isEnabled(),e=>e?this.view.addUpdatingPromise(this.enable()):this.disable(),n)])}async enable(){if(this.destroyed)return;if(this.produces=c.ANTIALIASING,this.requestRender(1),this._abortController||this._areaTexture&&this._searchTexture)return;this._abortController=new AbortController;const e=this._abortController.signal;try{const r=await import("./SMAAData.js");i(e),await this._loadTextures(r,e),i(e),this.requestRender(1)}catch(t){a(t)||r.getLogger(this).errorOnce(t)}this._abortController=null}async _loadTextures(e,r){i(r);const[t,s]=await Promise.allSettled([u(e.areaTexture,{signal:r}),u(e.searchTexure,{signal:r})]);if(i(r),"fulfilled"!==t.status||"fulfilled"!==s.status)return;const a=this.renderingContext;this._areaTexture=g(a,9729,6407,t.value),this._searchTexture=g(a,9728,6409,s.value)}disable(){this.produces="disabled",this.requestRender(1)}destroy(){this._abortController=t(this._abortController),this._searchTexture=s(this._searchTexture),this._areaTexture=s(this._areaTexture)}precompile(){this.techniques.precompile(b),this.techniques.precompile(d),this.techniques.precompile(p)}render(e){const r=e.find(({name:e})=>e===c.ANTIALIASING),t=this.techniques.getCompiled(b),s=this.techniques.getCompiled(d),i=this.techniques.getCompiled(p);if(!(this._areaTexture&&this._searchTexture&&t&&s&&i))return this.requestRender(1),r;const{width:a,height:o}=r.fbo,n=this.renderingContext;n.setViewport(0,0,a,o);const h=this.fboCache.acquire(a,o,"smaa edges",2);n.bindFramebuffer(h.fbo),n.setClearColor(0,0,0,1),n.clear(16384),this._smaaParameters.color=r.getTexture();const l=this.bindParameters;n.bindTechnique(t,l,this._smaaParameters),n.screen.draw();const u=this.fboCache.acquire(a,o,"smaa blend");n.bindFramebuffer(u.fbo),n.setClearColor(0,0,1,1),n.clear(16384),this._smaaParameters.inputTexture=h.getTexture(),this._smaaParameters.areaTexture=this._areaTexture,this._smaaParameters.searchTexture=this._searchTexture,n.bindTechnique(s,l,this._smaaParameters),n.screen.draw(),h.release();const m=this.fboCache.acquire(a,o,c.ANTIALIASING);return n.bindFramebuffer(m.fbo),n.setClearColor(0,1,0,1),n.clear(16384),this._smaaParameters.inputTexture=u.getTexture(),n.bindTechnique(i,l,this._smaaParameters),n.screen.draw(),u.release(),m}};function g(e,r,t,s){const i=new x(s.width,s.height);return i.pixelFormat=t,i.wrapMode=33071,i.samplingMode=r,new T(e,i,s)}e([h()],_.prototype,"produces",void 0),e([h()],_.prototype,"consumes",void 0),e([h({constructOnly:!0})],_.prototype,"isEnabled",void 0),e([h()],_.prototype,"_abortController",void 0),_=e([l("esri.views.3d.webgl-engine.effects.smaa.SMAA")],_);export{_ as SMAA};
2
+ import{__decorate as e}from"tslib";import r from"../../../../../core/Logger.js";import{abortMaybe as t,disposeMaybe as s}from"../../../../../core/maybe.js";import{throwIfAborted as i,isAbortError as a}from"../../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as n}from"../../../../../core/reactiveUtils.js";import{property as h,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as u}from"../../../../../request/image.js";import{InternalRenderCategory as c}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{SMAABlendWeightsTechnique as d}from"./SMAABlendWeightsTechnique.js";import{SMAABlurTechnique as p}from"./SMAABlurTechnique.js";import{SMAAEdgeDetectTechnique as b}from"./SMAAEdgeDetectTechnique.js";import{SMAAPassParameters as f}from"./SMAAPassParameters.js";import T from"../../../../webgl/Texture.js";import{TextureDescriptor as x}from"../../../../webgl/TextureDescriptor.js";let _=class extends m{constructor(e){super(e),this.produces="disabled",this.consumes={required:[c.ANTIALIASING]},this._areaTexture=null,this._searchTexture=null,this._smaaParameters=new f}initialize(){this.addHandles([o(()=>this.isEnabled(),e=>e?this.view.addUpdatingPromise(this.enable()):this.disable(),n)])}async enable(){if(this.destroyed)return;if(this.produces=c.ANTIALIASING,this.requestRender(1),this._abortController||this._areaTexture&&this._searchTexture)return;this._abortController=new AbortController;const e=this._abortController.signal;try{const r=await import("./SMAAData.js");i(e),await this._loadTextures(r,e),i(e),this.requestRender(1)}catch(t){a(t)||r.getLogger(this).errorOnce(t)}this._abortController=null}async _loadTextures(e,r){i(r);const[t,s]=await Promise.allSettled([u(e.areaTexture,{signal:r}),u(e.searchTexure,{signal:r})]);if(i(r),"fulfilled"!==t.status||"fulfilled"!==s.status)return;const a=this.renderingContext;this._areaTexture=g(a,9729,6407,t.value),this._searchTexture=g(a,9728,6409,s.value)}disable(){this.produces="disabled",this.requestRender(1)}destroy(){this._abortController=t(this._abortController),this._searchTexture=s(this._searchTexture),this._areaTexture=s(this._areaTexture)}render(e){const r=e.find(({name:e})=>e===c.ANTIALIASING),t=this.techniques.getCompiled(b),s=this.techniques.getCompiled(d),i=this.techniques.getCompiled(p);if(!(this._areaTexture&&this._searchTexture&&t&&s&&i))return this.requestRender(1),r;const{width:a,height:o}=r.fbo,n=this.renderingContext;n.setViewport(0,0,a,o);const h=this.fboCache.acquire(a,o,"smaa edges",2);n.bindFramebuffer(h.fbo),n.setClearColor(0,0,0,1),n.clear(16384),this._smaaParameters.color=r.getTexture();const l=this.bindParameters;n.bindTechnique(t,l,this._smaaParameters),n.screen.draw();const u=this.fboCache.acquire(a,o,"smaa blend");n.bindFramebuffer(u.fbo),n.setClearColor(0,0,1,1),n.clear(16384),this._smaaParameters.inputTexture=h.getTexture(),this._smaaParameters.areaTexture=this._areaTexture,this._smaaParameters.searchTexture=this._searchTexture,n.bindTechnique(s,l,this._smaaParameters),n.screen.draw(),h.release();const m=this.fboCache.acquire(a,o,c.ANTIALIASING);return n.bindFramebuffer(m.fbo),n.setClearColor(0,1,0,1),n.clear(16384),this._smaaParameters.inputTexture=u.getTexture(),n.bindTechnique(i,l,this._smaaParameters),n.screen.draw(),u.release(),m}};function g(e,r,t,s){const i=new x(s.width,s.height);return i.pixelFormat=t,i.wrapMode=33071,i.samplingMode=r,new T(e,i,s)}e([h()],_.prototype,"produces",void 0),e([h()],_.prototype,"consumes",void 0),e([h({constructOnly:!0})],_.prototype,"isEnabled",void 0),e([h()],_.prototype,"_abortController",void 0),_=e([l("esri.views.3d.webgl-engine.effects.smaa.SMAA")],_);export{_ as SMAA};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as s}from"../../../../../core/reactiveUtils.js";import{Milliseconds as i}from"../../../../../core/time.js";import{property as a,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as n}from"../../../webgl.js";import p from"../../../webgl/RenderNode.js";import{distanceFadeEnd as h,distanceFadeStart as c}from"../../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{g as u}from"../../../../../chunks/SSAO.glsl.js";import{SSAOBlurTechnique as l}from"./SSAOBlurTechnique.js";import{noiseData as d}from"./SSAONoiseData.js";import{SSAOPassParameters as f,BlurDrawParameters as b}from"./SSAOParameters.js";import{SSAOTechnique as w}from"./SSAOTechnique.js";import{DepthStencilAttachment as T}from"../../../../webgl/enums.js";import _ from"../../../../webgl/Texture.js";import{TextureDescriptor as P}from"../../../../webgl/TextureDescriptor.js";const g=2;let S=class extends p{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=n.AMBIENT_ILLUMINATION,this._enableTime=i(0),this._passParameters=new f,this._drawParameters=new b}initialize(){const e=Uint8Array.from(atob(d),e=>e.charCodeAt(0)),r=new P(32);r.wrapMode=33071,r.pixelFormat=6407,r.wrapMode=10497,r.hasMipmap=!0,this._passParameters.noiseTexture=new _(this.renderingContext,r,e),this.addHandles(s(()=>this.view.stage.renderer.hasAmbientIllumination,()=>this._enableTime=i(0)))}destroy(){this._passParameters.noiseTexture=t(this._passParameters.noiseTexture)}precompile(){this.techniques.precompile(w),this.techniques.precompile(l)}render(e){const t=e.find(({name:e})=>"normals"===e),s=t?.getTexture(),a=t?.getTexture(T);if(!s||!a)return;const o=this.techniques.getCompiled(w),p=this.techniques.getCompiled(l);if(!o||!p)return this._enableTime=i(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=i(performance.now()));const d=this.renderingContext,f=this.view.qualitySettings.fadeDuration,b=this.bindParameters,_=b.camera,P=_.relativeElevation,S=r((h-P)/(h-c),0,1),j=f>0?Math.min(f,performance.now()-this._enableTime)/f:1,q=j*S;this._passParameters.normalTexture=s,this._passParameters.depthTexture=a,this._passParameters.projScale=1/_.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*x/u(_)**6*q;const A=_.fullViewport[2],v=_.fullViewport[3],C=this.fboCache.acquire(A,v,"ssao input",2);d.bindFramebuffer(C.fbo),d.setViewport(0,0,A,v),d.bindTechnique(o,b,this._passParameters,this._drawParameters),d.screen.draw();const M=Math.round(A/g),I=Math.round(v/g),y=this.fboCache.acquire(M,I,"ssao blur",0);d.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=C.getTexture(),m(this._drawParameters.blurSize,0,g/v),d.bindTechnique(p,b,this._passParameters,this._drawParameters),d.setViewport(0,0,M,I),d.screen.draw(),C.release();const N=this.fboCache.acquire(M,I,n.AMBIENT_ILLUMINATION,0);return d.bindFramebuffer(N.fbo),d.setViewport(0,0,A,v),d.setClearColor(1,1,1,0),d.clear(16384),this._drawParameters.colorTexture=y.getTexture(),m(this._drawParameters.blurSize,g/A,0),d.bindTechnique(p,b,this._passParameters,this._drawParameters),d.setViewport(0,0,M,I),d.screen.draw(),d.setViewport4fv(_.fullViewport),y.release(),j<1&&this.requestRender(2),N}};e([a()],S.prototype,"consumes",void 0),e([a()],S.prototype,"produces",void 0),S=e([o("esri.views.3d.webgl-engine.effects.ssao.SSAO")],S);const x=.5;export{S as SSAO,g as blurSizePixels};
2
+ import{__decorate as e}from"tslib";import{clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as s}from"../../../../../core/reactiveUtils.js";import{Milliseconds as i}from"../../../../../core/time.js";import{property as a,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as m}from"../../../webgl.js";import p from"../../../webgl/RenderNode.js";import{distanceFadeEnd as h,distanceFadeStart as c}from"../../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{g as u}from"../../../../../chunks/SSAO.glsl.js";import{SSAOBlurTechnique as l}from"./SSAOBlurTechnique.js";import{noiseData as d}from"./SSAONoiseData.js";import{SSAOPassParameters as f,BlurDrawParameters as b}from"./SSAOParameters.js";import{SSAOTechnique as w}from"./SSAOTechnique.js";import{DepthStencilAttachment as T}from"../../../../webgl/enums.js";import _ from"../../../../webgl/Texture.js";import{TextureDescriptor as P}from"../../../../webgl/TextureDescriptor.js";const g=2;let S=class extends p{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=m.AMBIENT_ILLUMINATION,this._enableTime=i(0),this._passParameters=new f,this._drawParameters=new b}initialize(){const e=Uint8Array.from(atob(d),e=>e.charCodeAt(0)),r=new P(32);r.wrapMode=33071,r.pixelFormat=6407,r.wrapMode=10497,r.hasMipmap=!0,this._passParameters.noiseTexture=new _(this.renderingContext,r,e),this.addHandles(s(()=>this.view.stage.renderer.hasAmbientIllumination,()=>this._enableTime=i(0)))}destroy(){this._passParameters.noiseTexture=t(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),s=t?.getTexture(),a=t?.getTexture(T);if(!s||!a)return;const o=this.techniques.getCompiled(w),p=this.techniques.getCompiled(l);if(!o||!p)return this._enableTime=i(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=i(performance.now()));const d=this.renderingContext,f=this.view.qualitySettings.fadeDuration,b=this.bindParameters,_=b.camera,P=_.relativeElevation,S=r((h-P)/(h-c),0,1),j=f>0?Math.min(f,performance.now()-this._enableTime)/f:1,q=j*S;this._passParameters.normalTexture=s,this._passParameters.depthTexture=a,this._passParameters.projScale=1/_.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*x/u(_)**6*q;const A=_.fullViewport[2],v=_.fullViewport[3],C=this.fboCache.acquire(A,v,"ssao input",2);d.bindFramebuffer(C.fbo),d.setViewport(0,0,A,v),d.bindTechnique(o,b,this._passParameters,this._drawParameters),d.screen.draw();const M=Math.round(A/g),I=Math.round(v/g),y=this.fboCache.acquire(M,I,"ssao blur",0);d.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=C.getTexture(),n(this._drawParameters.blurSize,0,g/v),d.bindTechnique(p,b,this._passParameters,this._drawParameters),d.setViewport(0,0,M,I),d.screen.draw(),C.release();const N=this.fboCache.acquire(M,I,m.AMBIENT_ILLUMINATION,0);return d.bindFramebuffer(N.fbo),d.setViewport(0,0,A,v),d.setClearColor(1,1,1,0),d.clear(16384),this._drawParameters.colorTexture=y.getTexture(),n(this._drawParameters.blurSize,g/A,0),d.bindTechnique(p,b,this._passParameters,this._drawParameters),d.setViewport(0,0,M,I),d.screen.draw(),d.setViewport4fv(_.fullViewport),y.release(),j<1&&this.requestRender(2),N}};e([a()],S.prototype,"consumes",void 0),e([a()],S.prototype,"produces",void 0),S=e([o("esri.views.3d.webgl-engine.effects.ssao.SSAO")],S);const x=.5;export{S as SSAO,g as blurSizePixels};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{fetchAsset as e}from"../../../../../assets.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Error.js";import i from"../../../../../core/Logger.js";import{abortMaybe as a,disposeMaybe as n}from"../../../../../core/maybe.js";import{isAbortError as o}from"../../../../../core/promiseUtils.js";import{watch as f,initial as c,syncAndInitial as m}from"../../../../../core/reactiveUtils.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{copy as u,rotateZ as l,multiply as d}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{fromValues as p}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{InternalRenderCategory as b}from"../../../webgl.js";import{glLayout as _}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as g}from"../OpaqueEnvironment.js";import{StarPassParameters as w,StarsTechnique as v,layout as j}from"./StarsTechnique.js";import{VertexArrayObject as P}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as D,PrimitiveType as y}from"../../../../webgl/enums.js";import{VertexBuffer as T}from"../../../../webgl/VertexBuffer.js";let M=class extends g{constructor(){super(...arguments),this._numPoints=0,this._passParameters=new w}initialize(){this.addHandles([f(()=>this.view.environment.starsEnabled,t=>t?this._enable():this._disable(),c),f(()=>"virtual"===this.view.environment.lighting.type?null:this.view.environment.lighting.date,t=>this._update(t),m)])}_enable(){super._enable(),this._loadDataTask=this._createLoadDataTask()}get loading(){return!!this._loadDataTask&&!this._loadDataTask.finished}destroy(){this._loadDataTask=a(this._loadDataTask),this._numPoints=0,this._vao=n(this._vao),this._starData=null}precompile(){this.techniques.precompile(v)}render(t){const e=t.find(({name:t})=>t===b.OPAQUE_ENVIRONMENT),s=this.techniques.getCompiled(v);if(this.loading||!s)return this.requestRender(1),e;if(!this._starData)return e;this._vao??=this._ensureResources(this._starData);const r=this.renderingContext;return r.bindTechnique(s,this.bindParameters,this._passParameters),r.setDrawBuffers([D]),r.bindVAO(this._vao),r.drawArrays(y.POINTS,0,this._numPoints),e}_ensureResources(t){this._numPoints=t.byteLength/R;const e=new Float32Array(t,0,2*this._numPoints),s=new Uint8Array(t,2*this._numPoints*4,this._numPoints);return x(this.renderingContext,e,s,this._numPoints)}_update(t){if(!t)return;const e=(t.getHours()/12+t.getMinutes()/60*(2/24)+t.getSeconds()/60*(2/1440)-.9972222)%2,s=2*q(t),r=u(this._passParameters.modelMatrix,O);l(r,r,-s*Math.PI),d(r,L,r),l(r,r,-e*Math.PI),this.requestRender(1)}_createLoadDataTask(){if(this._starData)return null;const t=s(async t=>{const{data:s}=await e("esri/views/3d/environment/resources/stars.wsv",{responseType:"array-buffer",signal:t});k(s),this._starData=s});return t.promise.catch(t=>{o(t)||i.getLogger(this).error(t)}).then(()=>{this.destroyed||this.requestRender(1)}),t}};function x(t,e,s,r){const i=j.createBuffer(r),a=i.position,n=i.color,o=i.size;for(let f=0;f<r;f++){const t=e[2*f],r=e[2*f+1];a.set(f,0,-Math.cos(t)*Math.sin(r)),a.set(f,1,-Math.sin(t)*Math.sin(r)),a.set(f,2,-Math.cos(r));const i=A(s[f]),c=I(E[i[1]]);n.set(f,0,255*c[0]),n.set(f,1,255*c[1]),n.set(f,2,255*c[2]),n.set(f,3,255),o.set(f,i[0])}return new P(t,new T(t,_(j),i.buffer))}function q(t){const e=t,s=new Date(t.getFullYear(),0,1,11,58,56);return(+e-+s)/(+new Date(t.getFullYear()+1,0,1,11,58,55)-+s)}function k(t){if(!t)throw new r("stars:no-data-received","Failed to create stars because star catalogue is missing");const e=t.byteLength/R;if(e%1!=0||e>5e4||e<5e3)throw new r("stars:invalid-data","Failed to create stars because star catalogue data is invalid")}function I(t){return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function A(t){return t>=192?[2.9,t-192]:t>=160?[2.5,t-160]:t>=128?[2,t-128]:t>=96?[1.5,t-96]:t>=64?[1,t-64]:t>=32?[.7,t-32]:[.4,t]}M=t([h("esri.views.3d.webgl-engine.effects.stars.Stars")],M);const E=["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"],L=p(1,0,0,0,0,.9174771405229186,.39778850739794974,0,0,-.39778850739794974,.9174771405229186,0,0,0,0,1),O=p(1,0,0,0,0,.9174771405229186,-.39778850739794974,0,0,.39778850739794974,.9174771405229186,0,0,0,0,1),R=9;export{M as Stars};
2
+ import{__decorate as t}from"tslib";import{fetchAsset as e}from"../../../../../assets.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Error.js";import a from"../../../../../core/Logger.js";import{abortMaybe as i,disposeMaybe as n}from"../../../../../core/maybe.js";import{isAbortError as o}from"../../../../../core/promiseUtils.js";import{watch as f,initial as c,syncAndInitial as m}from"../../../../../core/reactiveUtils.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{copy as u,rotateZ as d,multiply as l}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{fromValues as p}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{InternalRenderCategory as b}from"../../../webgl.js";import{glLayout as _}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as g}from"../OpaqueEnvironment.js";import{StarPassParameters as w,StarsTechnique as v,layout as j}from"./StarsTechnique.js";import{VertexArrayObject as P}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as D,PrimitiveType as y}from"../../../../webgl/enums.js";import{VertexBuffer as T}from"../../../../webgl/VertexBuffer.js";let M=class extends g{constructor(){super(...arguments),this._numPoints=0,this._passParameters=new w}initialize(){this.addHandles([f(()=>this.view.environment.starsEnabled,t=>t?this._enable():this._disable(),c),f(()=>"virtual"===this.view.environment.lighting.type?null:this.view.environment.lighting.date,t=>this._update(t),m)])}_enable(){super._enable(),this._loadDataTask=this._createLoadDataTask()}get loading(){return!!this._loadDataTask&&!this._loadDataTask.finished}destroy(){this._loadDataTask=i(this._loadDataTask),this._numPoints=0,this._vao=n(this._vao),this._starData=null}render(t){const e=t.find(({name:t})=>t===b.OPAQUE_ENVIRONMENT),s=this.techniques.getCompiled(v);if(this.loading||!s)return this.requestRender(1),e;if(!this._starData)return e;this._vao??=this._ensureResources(this._starData);const r=this.renderingContext;return r.bindTechnique(s,this.bindParameters,this._passParameters),r.setDrawBuffers([D]),r.bindVAO(this._vao),r.drawArrays(y.POINTS,0,this._numPoints),e}_ensureResources(t){this._numPoints=t.byteLength/R;const e=new Float32Array(t,0,2*this._numPoints),s=new Uint8Array(t,2*this._numPoints*4,this._numPoints);return x(this.renderingContext,e,s,this._numPoints)}_update(t){if(!t)return;const e=(t.getHours()/12+t.getMinutes()/60*(2/24)+t.getSeconds()/60*(2/1440)-.9972222)%2,s=2*k(t),r=u(this._passParameters.modelMatrix,O);d(r,r,-s*Math.PI),l(r,L,r),d(r,r,-e*Math.PI),this.requestRender(1)}_createLoadDataTask(){if(this._starData)return null;const t=s(async t=>{const{data:s}=await e("esri/views/3d/environment/resources/stars.wsv",{responseType:"array-buffer",signal:t});q(s),this._starData=s});return t.promise.catch(t=>{o(t)||a.getLogger(this).error(t)}).then(()=>{this.destroyed||this.requestRender(1)}),t}};function x(t,e,s,r){const a=j.createBuffer(r),i=a.position,n=a.color,o=a.size;for(let f=0;f<r;f++){const t=e[2*f],r=e[2*f+1];i.set(f,0,-Math.cos(t)*Math.sin(r)),i.set(f,1,-Math.sin(t)*Math.sin(r)),i.set(f,2,-Math.cos(r));const a=A(s[f]),c=I(E[a[1]]);n.set(f,0,255*c[0]),n.set(f,1,255*c[1]),n.set(f,2,255*c[2]),n.set(f,3,255),o.set(f,a[0])}return new P(t,new T(t,_(j),a.buffer))}function k(t){const e=t,s=new Date(t.getFullYear(),0,1,11,58,56);return(+e-+s)/(+new Date(t.getFullYear()+1,0,1,11,58,55)-+s)}function q(t){if(!t)throw new r("stars:no-data-received","Failed to create stars because star catalogue is missing");const e=t.byteLength/R;if(e%1!=0||e>5e4||e<5e3)throw new r("stars:invalid-data","Failed to create stars because star catalogue data is invalid")}function I(t){return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function A(t){return t>=192?[2.9,t-192]:t>=160?[2.5,t-160]:t>=128?[2,t-128]:t>=96?[1.5,t-96]:t>=64?[1,t-64]:t>=32?[.7,t-32]:[.4,t]}M=t([h("esri.views.3d.webgl-engine.effects.stars.Stars")],M);const E=["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"],L=p(1,0,0,0,0,.9174771405229186,.39778850739794974,0,0,-.39778850739794974,.9174771405229186,0,0,0,0,1),O=p(1,0,0,0,0,.9174771405229186,-.39778850739794974,0,0,.39778850739794974,.9174771405229186,0,0,0,0,1),R=9;export{M as Stars};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../../chunks/OITDim.glsl.js";import"../../shaders/oitResolution.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{O as OITBlendPassParameters,b as build}from"../../../../../chunks/OITBlend.glsl.js";
2
+ import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../../chunks/OITDimOpaque.glsl.js";import"../../shaders/oitResolution.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{O as OITBlendPassParameters,b as build}from"../../../../../chunks/OITBlend.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{O as e}from"../../../../../chunks/OITBlend.glsl.js";import{OITBlendTechnique as i}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as t}from"./OITBlendTechniqueConfiguration.js";import{OITDimTechnique as s}from"./OITDimTechnique.js";import{OITDimTechniqueConfiguration as n}from"./OITDimTechniqueConfiguration.js";import{ColorAttachment2 as o,ColorAttachment1 as r,DrawBufferNone as a}from"../../../../webgl/enums.js";class u{constructor(i){this._techniques=i,this._parameters=new e,this._configuration=new t,this._dimConfiguration=new n}precompile({useFloatBlend:e,hasEmission:t,emissions:n},o,r){this._configuration.useFloatBlend=e.value,this._configuration.hasEmission=t,this._configuration.computeHudOcclusion=o,this._configuration.frontFaceMask=1===r,this._techniques.precompile(i,this._configuration),0!==n&&2!==n&&1!==r&&(this._dimConfiguration.useFloatBlend=e.value,this._techniques.precompile(s,this._dimConfiguration))}blend(e,t,n,u,c,h,m){if(this._configuration.useFloatBlend=u.useFloatBlend.value,this._configuration.hasEmission=c,this._configuration.computeHudOcclusion=h,this._configuration.frontFaceMask=1===m,this._parameters.colorTexture=t.getTexture(),this._parameters.alphaTexture=t.getTexture(c?o:r),this._parameters.frontFaceTexture=n.getTexture(),c){if(this._dimConfiguration.useFloatBlend=u.useFloatBlend.value,1!==m&&2!==u.emissions){const i=this._techniques.get(s,this._dimConfiguration);e.bindTechnique(i,u,this._parameters);const t=e.setDrawBuffers([a,r]);e.screen.draw(),e.setDrawBuffers(t)}this._parameters.emissionTexture=t.getTexture(r),this._parameters.emissionFrontFaceTexture=n.getTexture(r)}const f=this._techniques.get(i,this._configuration);e.bindTechnique(f,u,this._parameters),e.screen.draw()}}export{u as OITBlend};
2
+ import{O as e}from"../../../../../chunks/OITBlend.glsl.js";import{OITBlendEmissionTechnique as i}from"./OITBlendEmissionTechnique.js";import{OITBlendEmissionTechniqueConfiguration as t}from"./OITBlendEmissionTechniqueConfiguration.js";import{OITBlendTechnique as s}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as n}from"./OITBlendTechniqueConfiguration.js";import{OITDimOpaqueTechnique as r}from"./OITDimOpaqueTechnique.js";import{OITDimOpaqueTechniqueConfiguration as o}from"./OITDimOpaqueTechniqueConfiguration.js";import{ColorAttachment2 as a,ColorAttachment1 as u,DrawBufferNone as c,ColorAttachment0 as h}from"../../../../webgl/enums.js";class m{constructor(i){this._techniques=i,this._parameters=new e,this._configuration=new n,this._dimConfiguration=new o,this._dimTransparentConfiguration=new t}precompile({useFloatBlend:e,emissions:t},n,o){this._configuration.useFloatBlend=e.value,this._configuration.computeHudOcclusion=n,this._configuration.frontFaceMask=1===o,this._techniques.precompile(s,this._configuration),0!==t&&2!==t&&0===o&&(this._dimConfiguration.useFloatBlend=e.value,this._techniques.precompile(r,this._dimConfiguration)),0!==t&&0===o&&(this._dimTransparentConfiguration.useFloatBlend=e.value,this._techniques.precompile(i,this._dimTransparentConfiguration))}blend(e,t,n,o,m,f,l){if(this._configuration.useFloatBlend=o.useFloatBlend.value,this._configuration.computeHudOcclusion=f,this._configuration.frontFaceMask=1===l,this._parameters.colorTexture=t.getTexture(),this._parameters.alphaTexture=t.getTexture(m?a:u),this._parameters.frontFaceTexture=n.getTexture(),m&&(this._dimConfiguration.useFloatBlend=o.useFloatBlend.value,0===l&&2!==o.emissions)){const i=this._techniques.get(r,this._dimConfiguration);e.bindTechnique(i,o,this._parameters);const t=e.setDrawBuffers([c,u]);e.screen.draw(),e.setDrawBuffers(t)}const p=this._techniques.get(s,this._configuration);if(e.bindTechnique(p,o,this._parameters),m){const i=e.setDrawBuffers([h]);e.screen.draw(),e.setDrawBuffers(i)}else e.screen.draw();if(m&&0===l){this._parameters.emissionTexture=t.getTexture(u),this._parameters.emissionFrontFaceTexture=n.getTexture(u),this._dimTransparentConfiguration.useFloatBlend=o.useFloatBlend.value;const s=this._techniques.get(i,this._dimTransparentConfiguration);e.bindTechnique(s,o,this._parameters);const r=e.setDrawBuffers([c,u]);e.screen.draw(),e.setDrawBuffers(r)}}}export{m as OITBlend};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../../chunks/OITDimOpaque.glsl.js";import"../../shaders/oitResolution.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{a as OITBlendEmissionPassParameters,b as build}from"../../../../../chunks/OITBlendEmission.glsl.js";
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as s}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../../core/shaderTechnique/ShaderTechnique.js";import{O as o}from"../../../../../chunks/OITBlendEmission.glsl.js";import{makePipelineState as n,defaultColorWrite as t,unpremultipliedAlphaToPremultipliedAlpha as l}from"../../../../webgl/renderState.js";let c=class extends i{constructor(){super(...arguments),this.shader=new s(o,()=>import("./OITBlendEmission.glsl.js"))}initializePipeline(){return n({blending:l,colorWrite:t})}};c=e([r("esri.views.3d.webgl-engine.effects.transparency.OITBlendEmissionTechnique")],c);export{c as OITBlendEmissionTechnique};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as r}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class t extends r{constructor(){super(...arguments),this.useFloatBlend=!0}}e([o()],t.prototype,"useFloatBlend",void 0);export{t as OITBlendEmissionTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as o}from"tslib";import{parameter as t,ShaderTechniqueConfiguration as s}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class e extends s{constructor(){super(...arguments),this.useFloatBlend=!0,this.hasEmission=!1,this.computeHudOcclusion=!1,this.frontFaceMask=!1}}o([t()],e.prototype,"useFloatBlend",void 0),o([t()],e.prototype,"hasEmission",void 0),o([t()],e.prototype,"computeHudOcclusion",void 0),o([t()],e.prototype,"frontFaceMask",void 0);export{e as OITBlendTechniqueConfiguration};
2
+ import{__decorate as o}from"tslib";import{parameter as t,ShaderTechniqueConfiguration as e}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends e{constructor(){super(...arguments),this.useFloatBlend=!0,this.computeHudOcclusion=!1,this.frontFaceMask=!1}}o([t()],r.prototype,"useFloatBlend",void 0),o([t()],r.prototype,"computeHudOcclusion",void 0),o([t()],r.prototype,"frontFaceMask",void 0);export{r as OITBlendTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/util/EmissionDimming.glsl.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../shaders/oitResolution.glsl.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{O as OITDimPassParameters,b as build}from"../../../../../chunks/OITDim.glsl.js";
2
+ import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/util/EmissionDimming.glsl.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../shaders/oitResolution.glsl.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{O as OITDimOpaquePassParameters,b as build}from"../../../../../chunks/OITDimOpaque.glsl.js";
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as i}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as o}from"../../../../../chunks/OITDimOpaque.glsl.js";import{makePipelineState as t,defaultColorWrite as a,modulateDestination as n}from"../../../../webgl/renderState.js";let c=class extends s{constructor(){super(...arguments),this.shader=new i(o,()=>import("./OITDimOpaque.glsl.js"))}initializePipeline(){return t({blending:n,colorWrite:a})}};c=e([r("esri.views.3d.webgl-engine.effects.transparency.OITDimOpaqueTechnique")],c);export{c as OITDimOpaqueTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as r}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class t extends r{constructor(){super(...arguments),this.useFloatBlend=!0}}e([o()],t.prototype,"useFloatBlend",void 0);export{t as OITDimTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as r}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class t extends r{constructor(){super(...arguments),this.useFloatBlend=!0}}e([o()],t.prototype,"useFloatBlend",void 0);export{t as OITDimOpaqueTechniqueConfiguration};