@arcgis/core 5.2.0-next.112 → 5.2.0-next.113

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 (419) hide show
  1. package/Ground.d.ts +4 -5
  2. package/Ground.js +1 -1
  3. package/arcgisGlobal.d.ts +5 -0
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/01ca17092545d72be7b6.js +1 -0
  6. package/assets/esri/core/workers/chunks/{f5a988bb850f7a7af143.js → 05b373a663cb5d4d722f.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{36f8caeb574dcd5c0ed5.js → 0b727d7bf3e36e146725.js} +1 -1
  8. package/assets/esri/core/workers/chunks/0c65862e3dd810015491.js +1 -0
  9. package/assets/esri/core/workers/chunks/0e3e58ba8e2d358121a5.js +1 -0
  10. package/assets/esri/core/workers/chunks/0edebc6c516f0b9dac7b.js +1 -0
  11. package/assets/esri/core/workers/chunks/1004e77593dfa506cd5d.js +1 -0
  12. package/assets/esri/core/workers/chunks/184942ea601237c8241a.js +1 -0
  13. package/assets/esri/core/workers/chunks/20de0ea9fa08a6545978.js +1 -0
  14. package/assets/esri/core/workers/chunks/214d63813d268afc265d.js +1 -0
  15. package/assets/esri/core/workers/chunks/22e85819e23202a8ba90.js +1 -0
  16. package/assets/esri/core/workers/chunks/{6e677505d257e0848075.js → 23f9ab77e4e263f82636.js} +1 -1
  17. package/assets/esri/core/workers/chunks/28a04887ecaee5445d14.js +1 -0
  18. package/assets/esri/core/workers/chunks/{2fc5c1504691badc7792.js → 2ac2d0a7623dd060c144.js} +1 -1
  19. package/assets/esri/core/workers/chunks/2afce71e8b6ae86e0792.js +1 -0
  20. package/assets/esri/core/workers/chunks/36792b8a85e88044cb49.js +1 -0
  21. package/assets/esri/core/workers/chunks/36a7e19f43517aa94577.js +1 -0
  22. package/assets/esri/core/workers/chunks/{6e6cdff4bbe1ff2f44ac.js → 3ab25279aaa30f035038.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{e6dae16208f6978b59e0.js → 3b499cfc89c8f87cdb20.js} +1 -1
  24. package/assets/esri/core/workers/chunks/445b0ca1b70730c9a2e6.js +1 -0
  25. package/assets/esri/core/workers/chunks/{24673aac70d6c949b6fa.js → 4bf2cc4d092601ff2b86.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{d45483dd0dc2853b18b7.js → 4bfd63f3cf9208eb839b.js} +33 -33
  27. package/assets/esri/core/workers/chunks/501df20cdd09384f6ee2.js +1 -0
  28. package/assets/esri/core/workers/chunks/510a190a6f0a60ae38c3.js +1 -0
  29. package/assets/esri/core/workers/chunks/{89a785f8b61263e2d592.js → 552c92b01a5f02a115c5.js} +1 -1
  30. package/assets/esri/core/workers/chunks/564fdf0d663b773806cc.js +1 -0
  31. package/assets/esri/core/workers/chunks/{d9270f4935eb0d044db3.js → 57328c206f1e699ac06f.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{50951fb13013b11b8a24.js → 58e62c8ce1292f4d3b06.js} +1 -1
  33. package/assets/esri/core/workers/chunks/5aee7739afb5160d4ace.js +1 -0
  34. package/assets/esri/core/workers/chunks/5b9925f23d4b10a7087e.js +1 -0
  35. package/assets/esri/core/workers/chunks/5f79ba5639067f734791.js +1 -0
  36. package/assets/esri/core/workers/chunks/{b013b70e40dfb6ce013e.js → 60c61f34733063730386.js} +1 -1
  37. package/assets/esri/core/workers/chunks/62b1f94f4fa978d4da48.js +1 -0
  38. package/assets/esri/core/workers/chunks/6b264006b96cbf93d8ed.js +1 -0
  39. package/assets/esri/core/workers/chunks/6b9d29ca568590358478.js +1 -0
  40. package/assets/esri/core/workers/chunks/{7c5310e0104c22da0261.js → 6c7cb7974969e3167f2b.js} +1 -1
  41. package/assets/esri/core/workers/chunks/6c82cbcd504c711a7450.js +1 -0
  42. package/assets/esri/core/workers/chunks/{e98b785e8f4edc8bd3ff.js → 6eceeca33fac8e900d9d.js} +1 -1
  43. package/assets/esri/core/workers/chunks/7232fc11b23777b6be94.js +1 -0
  44. package/assets/esri/core/workers/chunks/726ca458b98bb4334431.js +1 -0
  45. package/assets/esri/core/workers/chunks/785206da3962ba23de16.js +1 -0
  46. package/assets/esri/core/workers/chunks/{1c70620f40be02f532b5.js → 7b169eabafcc03bfaee6.js} +1 -1
  47. package/assets/esri/core/workers/chunks/7bbc3d22383388d11345.js +1 -0
  48. package/assets/esri/core/workers/chunks/{082069f80eee0407b828.js → 7edf57e31ff07af9032b.js} +1 -1
  49. package/assets/esri/core/workers/chunks/83ed38468e316302b157.js +1 -0
  50. package/assets/esri/core/workers/chunks/85c876ee9e63d5732937.js +1 -0
  51. package/assets/esri/core/workers/chunks/8f0ecf4d06ec7b67d4ed.js +1 -0
  52. package/assets/esri/core/workers/chunks/8f1c5f5e70d4b33d021d.js +1 -0
  53. package/assets/esri/core/workers/chunks/{a1916bca1af5c65be4b0.js → 90ab3c47138875070a53.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{10389c87d9c6a43363ce.js → 917dec9c004218c58950.js} +1 -1
  55. package/assets/esri/core/workers/chunks/91f451b98e0f696043df.js +1 -0
  56. package/assets/esri/core/workers/chunks/943d0026ca4d49eb3ac2.js +1 -0
  57. package/assets/esri/core/workers/chunks/982a396bd4fffa62e911.js +1 -0
  58. package/assets/esri/core/workers/chunks/98a5327fd96d9542b39f.js +1 -0
  59. package/assets/esri/core/workers/chunks/9b9a60f1e0c48aa701f0.js +1 -0
  60. package/assets/esri/core/workers/chunks/9d92e6f0beed9a8580fa.js +1 -0
  61. package/assets/esri/core/workers/chunks/9df379041e8860fe7f01.js +1 -0
  62. package/assets/esri/core/workers/chunks/{1e8ceb4a4b28625236e3.js → a42505b978d54d36d3b6.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{bfbe6ff786435fe1e7cf.js → a86a4e550a92f770d6d5.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{a34eee4c9d4c1c2b8c49.js → ab60f3bc18b5ea504f70.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{18b9ec6ba7a6c0fa2ac6.js → b1880d9f5eafd50ce84b.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{777fc163530448eea13e.js → b4222152efaf73b37b53.js} +1 -1
  67. package/assets/esri/core/workers/chunks/b6ca73c1384f07b30b74.js +1 -0
  68. package/assets/esri/core/workers/chunks/bb4cbf6b7c35e8c78cc7.js +1 -0
  69. package/assets/esri/core/workers/chunks/bb831d23422acfb00ae2.js +1 -0
  70. package/assets/esri/core/workers/chunks/c0855be20ffcd52c7026.js +1 -0
  71. package/assets/esri/core/workers/chunks/{a0f742fd947104662d37.js → c6277236ec47586dca00.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{3be33a129d3ae7dc4f06.js → caf38cf4d8542fb11c46.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{2728eda8178e02fbca47.js → cd0f5cd0fefe7f49e3d8.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{48a53bfeef11c32dadcc.js → d25fb32a233d2128afbe.js} +1 -1
  75. package/assets/esri/core/workers/chunks/d629708bf23da24ee523.js +1 -0
  76. package/assets/esri/core/workers/chunks/db141122060d8d9b38da.js +1 -0
  77. package/assets/esri/core/workers/chunks/dc1944a7601b518a9c48.js +1 -0
  78. package/assets/esri/core/workers/chunks/{573ee2e59d26bc75201e.js → dc8670f32bb0b93c1473.js} +1 -1
  79. package/assets/esri/core/workers/chunks/e1f2b07be33e33117313.js +1 -0
  80. package/assets/esri/core/workers/chunks/e52f30dfb7c82491a7f2.js +1 -0
  81. package/assets/esri/core/workers/chunks/e5906b28b981199fd489.js +1 -0
  82. package/assets/esri/core/workers/chunks/{b3293ee9f221423a6825.js → e611e452f04a9ce64cf8.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{0f20c458f873564faff2.js → ec4f887153c24ab83f2c.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{707b4ae689c4329cad3b.js → f40ceb5e03c699605302.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{547a073c789fdfb78310.js → f42243c62dd0b6993816.js} +1 -1
  86. package/assets/esri/core/workers/chunks/f91cab9904020cf25d50.js +1 -0
  87. package/assets/esri/core/workers/chunks/f9b29d2ce1cd31c0fce1.js +1 -0
  88. package/assets/esri/core/workers/chunks/fdf5ceffec9d5185953d.js +1 -0
  89. package/assets/esri/views/3d/environment/resources/milkyway-band.ktx2 +0 -0
  90. package/chunks/DeepSky.glsl.js +1 -1
  91. package/chunks/FocusArea.glsl.js +1 -1
  92. package/chunks/GaussianSplatDepth.glsl.js +3 -3
  93. package/chunks/RibbonLine.glsl.js +15 -13
  94. package/config.js +1 -1
  95. package/geometry/Extent.js +1 -1
  96. package/geometry/operators/affineTransformOperator.d.ts +9 -3
  97. package/geometry/operators/affineTransformOperator.js +1 -1
  98. package/geometry/operators/alphaShapeOperator.d.ts +14 -4
  99. package/geometry/operators/alphaShapeOperator.js +1 -1
  100. package/geometry/operators/areaOperator.d.ts +11 -3
  101. package/geometry/operators/areaOperator.js +1 -1
  102. package/geometry/operators/autoCompleteOperator.d.ts +6 -2
  103. package/geometry/operators/autoCompleteOperator.js +1 -1
  104. package/geometry/operators/boundaryOperator.d.ts +9 -3
  105. package/geometry/operators/boundaryOperator.js +1 -1
  106. package/geometry/operators/bufferOperator.d.ts +19 -5
  107. package/geometry/operators/bufferOperator.js +1 -1
  108. package/geometry/operators/centroidOperator.d.ts +6 -2
  109. package/geometry/operators/centroidOperator.js +1 -1
  110. package/geometry/operators/clipOperator.d.ts +9 -3
  111. package/geometry/operators/clipOperator.js +1 -1
  112. package/geometry/operators/containsOperator.d.ts +9 -3
  113. package/geometry/operators/containsOperator.js +1 -1
  114. package/geometry/operators/convexHullOperator.d.ts +17 -5
  115. package/geometry/operators/convexHullOperator.js +1 -1
  116. package/geometry/operators/crossesOperator.d.ts +9 -3
  117. package/geometry/operators/crossesOperator.js +1 -1
  118. package/geometry/operators/cutOperator.d.ts +6 -2
  119. package/geometry/operators/cutOperator.js +1 -1
  120. package/geometry/operators/densifyOperator.d.ts +14 -4
  121. package/geometry/operators/densifyOperator.js +1 -1
  122. package/geometry/operators/differenceOperator.d.ts +9 -3
  123. package/geometry/operators/differenceOperator.js +1 -1
  124. package/geometry/operators/disjointOperator.d.ts +9 -3
  125. package/geometry/operators/disjointOperator.js +1 -1
  126. package/geometry/operators/distanceOperator.d.ts +11 -3
  127. package/geometry/operators/distanceOperator.js +1 -1
  128. package/geometry/operators/equalsOperator.d.ts +9 -3
  129. package/geometry/operators/equalsOperator.js +1 -1
  130. package/geometry/operators/extendOperator.d.ts +11 -3
  131. package/geometry/operators/extendOperator.js +1 -1
  132. package/geometry/operators/generalizeOperator.d.ts +14 -4
  133. package/geometry/operators/generalizeOperator.js +1 -1
  134. package/geometry/operators/geodesicBufferOperator.d.ts +25 -7
  135. package/geometry/operators/geodesicBufferOperator.js +1 -1
  136. package/geometry/operators/geodesicProximityOperator.d.ts +28 -8
  137. package/geometry/operators/geodesicProximityOperator.js +1 -1
  138. package/geometry/operators/geodeticAreaOperator.d.ts +17 -5
  139. package/geometry/operators/geodeticAreaOperator.js +1 -1
  140. package/geometry/operators/geodeticDensifyOperator.d.ts +20 -6
  141. package/geometry/operators/geodeticDensifyOperator.js +1 -1
  142. package/geometry/operators/geodeticDistanceOperator.d.ts +17 -5
  143. package/geometry/operators/geodeticDistanceOperator.js +1 -1
  144. package/geometry/operators/geodeticLengthOperator.d.ts +17 -5
  145. package/geometry/operators/geodeticLengthOperator.js +1 -1
  146. package/geometry/operators/geodeticUtilsOperator.d.ts +17 -5
  147. package/geometry/operators/geodeticUtilsOperator.js +1 -1
  148. package/geometry/operators/graphicBufferOperator.d.ts +11 -3
  149. package/geometry/operators/graphicBufferOperator.js +1 -1
  150. package/geometry/operators/integrateOperator.d.ts +6 -2
  151. package/geometry/operators/integrateOperator.js +1 -1
  152. package/geometry/operators/intersectionOperator.d.ts +12 -4
  153. package/geometry/operators/intersectionOperator.js +1 -1
  154. package/geometry/operators/intersectsOperator.d.ts +9 -3
  155. package/geometry/operators/intersectsOperator.js +1 -1
  156. package/geometry/operators/isNearOperator.d.ts +11 -3
  157. package/geometry/operators/isNearOperator.js +1 -1
  158. package/geometry/operators/json/bufferOperator.js +1 -1
  159. package/geometry/operators/json/containsOperator.js +1 -1
  160. package/geometry/operators/json/convexHullOperator.js +1 -1
  161. package/geometry/operators/json/crossesOperator.js +1 -1
  162. package/geometry/operators/json/disjointOperator.js +1 -1
  163. package/geometry/operators/json/generalizeOperator.js +1 -1
  164. package/geometry/operators/json/geodesicBufferOperator.js +1 -1
  165. package/geometry/operators/json/graphicBufferOperator.js +1 -1
  166. package/geometry/operators/json/intersectionOperator.js +1 -1
  167. package/geometry/operators/json/intersectsOperator.js +1 -1
  168. package/geometry/operators/json/lengthOperator.js +1 -1
  169. package/geometry/operators/json/offsetOperator.js +1 -1
  170. package/geometry/operators/json/overlapsOperator.js +1 -1
  171. package/geometry/operators/json/projectOperator.js +1 -1
  172. package/geometry/operators/json/simplifyOperator.js +1 -1
  173. package/geometry/operators/json/simplifyOperatorOGC.js +1 -1
  174. package/geometry/operators/json/touchesOperator.js +1 -1
  175. package/geometry/operators/json/unionOperator.js +1 -1
  176. package/geometry/operators/json/withinOperator.js +1 -1
  177. package/geometry/operators/labelPointOperator.d.ts +9 -3
  178. package/geometry/operators/labelPointOperator.js +1 -1
  179. package/geometry/operators/lengthOperator.d.ts +11 -3
  180. package/geometry/operators/lengthOperator.js +1 -1
  181. package/geometry/operators/linesToPolygonsOperator.d.ts +6 -2
  182. package/geometry/operators/linesToPolygonsOperator.js +1 -1
  183. package/geometry/operators/locateBetweenOperator.d.ts +6 -2
  184. package/geometry/operators/locateBetweenOperator.js +1 -1
  185. package/geometry/operators/minimumBoundingCircleOperator.d.ts +14 -4
  186. package/geometry/operators/minimumBoundingCircleOperator.js +1 -1
  187. package/geometry/operators/multiPartToSinglePartOperator.d.ts +11 -3
  188. package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
  189. package/geometry/operators/offsetOperator.d.ts +14 -4
  190. package/geometry/operators/offsetOperator.js +1 -1
  191. package/geometry/operators/overlapsOperator.d.ts +9 -3
  192. package/geometry/operators/overlapsOperator.js +1 -1
  193. package/geometry/operators/polygonOverlayOperator.d.ts +11 -3
  194. package/geometry/operators/polygonOverlayOperator.js +1 -1
  195. package/geometry/operators/polygonSlicerOperator.d.ts +22 -6
  196. package/geometry/operators/polygonSlicerOperator.js +1 -1
  197. package/geometry/operators/projectOperator.d.ts +15 -5
  198. package/geometry/operators/projectOperator.js +1 -1
  199. package/geometry/operators/proximityOperator.d.ts +22 -6
  200. package/geometry/operators/proximityOperator.js +1 -1
  201. package/geometry/operators/relateOperator.d.ts +12 -4
  202. package/geometry/operators/relateOperator.js +1 -1
  203. package/geometry/operators/reshapeOperator.d.ts +6 -2
  204. package/geometry/operators/reshapeOperator.js +1 -1
  205. package/geometry/operators/shapePreservingProjectOperator.d.ts +20 -6
  206. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  207. package/geometry/operators/simplifyOGCOperator.d.ts +3 -1
  208. package/geometry/operators/simplifyOGCOperator.js +1 -1
  209. package/geometry/operators/simplifyOperator.d.ts +12 -4
  210. package/geometry/operators/simplifyOperator.js +1 -1
  211. package/geometry/operators/singlePartToMultiPartOperator.js +1 -1
  212. package/geometry/operators/support/deprecatedOperator.js +2 -0
  213. package/geometry/operators/symmetricDifferenceOperator.d.ts +9 -3
  214. package/geometry/operators/symmetricDifferenceOperator.js +1 -1
  215. package/geometry/operators/touchesOperator.d.ts +9 -3
  216. package/geometry/operators/touchesOperator.js +1 -1
  217. package/geometry/operators/unionOperator.d.ts +9 -3
  218. package/geometry/operators/unionOperator.js +1 -1
  219. package/geometry/operators/withinOperator.d.ts +9 -3
  220. package/geometry/operators/withinOperator.js +1 -1
  221. package/geometry/support/intersectsBase.js +1 -1
  222. package/geometry/support/normalizeUtils.js +1 -1
  223. package/kernel.js +1 -1
  224. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  225. package/layers/IntegratedMeshLayer.js +1 -1
  226. package/layers/SceneLayer.js +1 -1
  227. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  228. package/layers/list/BasemapItemCollection.d.ts +40 -14
  229. package/layers/list/BasemapItemCollection.js +1 -1
  230. package/layers/list/CatalogItemCollection.d.ts +29 -11
  231. package/layers/list/CatalogItemCollection.js +1 -1
  232. package/layers/list/Item.d.ts +66 -122
  233. package/layers/list/Item.js +1 -1
  234. package/layers/list/ItemPanel.d.ts +23 -34
  235. package/layers/list/LayerItemCollection.d.ts +33 -43
  236. package/layers/list/LayerItemCollection.js +1 -1
  237. package/layers/list/TableItem.d.ts +42 -53
  238. package/layers/list/TableItem.js +1 -1
  239. package/layers/list/TableItemCollection.d.ts +25 -55
  240. package/layers/list/TableItemCollection.js +1 -1
  241. package/layers/list/TableItemPanel.d.ts +25 -23
  242. package/layers/list/support/layerListUtils.js +1 -1
  243. package/layers/list/types.d.ts +158 -37
  244. package/layers/support/ElevationQuery.js +1 -1
  245. package/layers/support/FeatureFilter.d.ts +2 -1
  246. package/layers/support/FeatureFilter.js +1 -1
  247. package/package.json +2 -2
  248. package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.d.ts +0 -1
  249. package/support/revision.js +1 -1
  250. package/symbols/LineSymbol3DLayer.d.ts +9 -3
  251. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  252. package/symbols/cim/CIMSymbolHelper.js +1 -1
  253. package/symbols/cim/OverrideHelper.js +1 -1
  254. package/symbols/cim/Rasterizer.js +1 -1
  255. package/symbols/cim/cimAnalyzer.js +1 -1
  256. package/symbols/cim/dashUtils.js +2 -0
  257. package/symbols/cim/effects/EffectDashes.js +1 -1
  258. package/symbols/cim/fromCIMFontStyle.js +2 -0
  259. package/symbols/cim/richTextUtils.js +1 -1
  260. package/symbols/cim/utils.js +1 -1
  261. package/symbols/patterns/LinePattern3D.d.ts +10 -4
  262. package/symbols/patterns/LinePattern3D.js +1 -1
  263. package/symbols/patterns/LineTemplatePattern3D.d.ts +48 -0
  264. package/symbols/patterns/LineTemplatePattern3D.js +2 -0
  265. package/symbols/patterns/utils.js +1 -1
  266. package/symbols/support/Symbol3DOutline.js +1 -1
  267. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  268. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  269. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  270. package/views/2d/engine/webgl/GlyphWorker.js +1 -1
  271. package/views/2d/engine/webgl/TextureManager.js +1 -1
  272. package/views/2d/engine/webgl/decorGlyphRect.js +2 -0
  273. package/views/2d/engine/webgl/definitions.js +1 -1
  274. package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
  275. package/views/2d/engine/webgl/effects/highlight/MultiHighlightGradient.js +1 -1
  276. package/views/2d/engine/webgl/hashMosaic.js +2 -0
  277. package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
  278. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  279. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ShaderHighlight.js +1 -1
  280. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
  281. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  282. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  283. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  284. package/views/2d/layers/LayerView2D.js +1 -1
  285. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  286. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  287. package/views/2d/layers/RouteLayerView2D.js +1 -1
  288. package/views/2d/layers/TileLayerView2D.js +1 -1
  289. package/views/2d/layers/features/FeatureContainer.js +1 -1
  290. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  291. package/views/2d/layers/features/Processor.js +1 -1
  292. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  293. package/views/2d/layers/features/processor/AggregateStrategy.js +1 -1
  294. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  295. package/views/2d/layers/features/processor/bins/BinLevelState.js +1 -1
  296. package/views/2d/layers/features/processor/clusters/ClusterLevelState.js +1 -1
  297. package/views/2d/layers/features/processor/tracks/TrackLevelState.js +1 -1
  298. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  299. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  300. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  301. package/views/2d/layers/graphics/AGraphicContainer.js +1 -1
  302. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  303. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  304. package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
  305. package/views/2d/layers/support/FilterSchema.js +2 -0
  306. package/views/2d/layers/support/HighlightRegistry.js +2 -0
  307. package/views/2d/layers/support/annodime/dimensionUtils.js +1 -1
  308. package/views/2d/layers/support/util.js +1 -1
  309. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  310. package/views/3d/input/SceneInputManager.js +1 -1
  311. package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
  312. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  313. package/views/3d/layers/I3SMeshView3D.js +1 -1
  314. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  315. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  316. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  317. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  318. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  319. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  320. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  321. package/views/3d/navigation/Navigation3D.d.ts +16 -0
  322. package/views/3d/navigation/Navigation3D.js +2 -0
  323. package/views/3d/navigation/modes/DefaultNavigationMode3D.d.ts +4 -0
  324. package/views/3d/navigation/modes/DefaultNavigationMode3D.js +2 -0
  325. package/views/3d/navigation/modes/GroundNavigationMode3D.d.ts +4 -0
  326. package/views/3d/navigation/modes/GroundNavigationMode3D.js +2 -0
  327. package/views/3d/navigation/modes/NavigationMode3D.d.ts +4 -0
  328. package/views/3d/navigation/modes/NavigationMode3D.js +2 -0
  329. package/views/3d/navigation/modes/NavigationMode3DUnion.d.ts +5 -0
  330. package/views/3d/state/ConstraintsManager.js +1 -1
  331. package/views/3d/support/QualityProfile.js +1 -1
  332. package/views/3d/support/hitTest.js +1 -1
  333. package/views/3d/terrain/ExtentHelper.js +1 -1
  334. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  335. package/views/3d/webgl-engine/effects/AmbientIllumination.js +2 -0
  336. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  337. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  338. package/views/3d/webgl-engine/effects/glow/BlurEmission.js +1 -1
  339. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  340. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  341. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  342. package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
  343. package/views/3d/webgl-engine/lib/GaussianSplatDepthRenderer.js +1 -1
  344. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  345. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  346. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  347. package/views/3d/webgl-engine/materials/lineStippleUtils.js +1 -1
  348. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  349. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +12 -8
  350. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  351. package/views/PopupView.js +1 -1
  352. package/views/SceneView.js +1 -1
  353. package/views/View.js +1 -1
  354. package/views/layers/FeatureLikeLayerView.js +1 -1
  355. package/widgets/LayerList/LayerListViewModel.d.ts +1 -0
  356. package/widgets/LayerList/LayerListViewModel.js +1 -1
  357. package/widgets/LayerList/ListItem.d.ts +4 -0
  358. package/widgets/LayerList/ListItemPanel.d.ts +3 -0
  359. package/widgets/OrientedImageryViewer/types.d.ts +2 -2
  360. package/widgets/OrientedImageryViewer.d.ts +20 -1
  361. package/widgets/OrientedImageryViewer.js +1 -1
  362. package/widgets/Sketch/SketchViewModel.js +1 -1
  363. package/widgets/support/iconUtils.js +1 -1
  364. package/assets/esri/core/workers/chunks/03601be8b0763f82e88f.js +0 -1
  365. package/assets/esri/core/workers/chunks/0bff8d589312be6588fe.js +0 -1
  366. package/assets/esri/core/workers/chunks/0de90b1ad8118457fd5a.js +0 -1
  367. package/assets/esri/core/workers/chunks/0e1a067ab243900d0371.js +0 -1
  368. package/assets/esri/core/workers/chunks/0ee6109e6578395a7900.js +0 -1
  369. package/assets/esri/core/workers/chunks/0ee7376c29e0fd8f676c.js +0 -1
  370. package/assets/esri/core/workers/chunks/13551987fbeaae154df8.js +0 -1
  371. package/assets/esri/core/workers/chunks/186350d720352bd5ff33.js +0 -1
  372. package/assets/esri/core/workers/chunks/25ecf94d776c3b6db0f3.js +0 -1
  373. package/assets/esri/core/workers/chunks/262052dfaec3af8a58b9.js +0 -1
  374. package/assets/esri/core/workers/chunks/2c01477b69c38f691e19.js +0 -1
  375. package/assets/esri/core/workers/chunks/307297e025eed110095f.js +0 -1
  376. package/assets/esri/core/workers/chunks/33422dca6f4bcaa0ea74.js +0 -1
  377. package/assets/esri/core/workers/chunks/33e583166ab3943ecf0e.js +0 -1
  378. package/assets/esri/core/workers/chunks/37ae52c71bf9c70fbb92.js +0 -1
  379. package/assets/esri/core/workers/chunks/3daddcb106a7009c5a70.js +0 -1
  380. package/assets/esri/core/workers/chunks/3de6e54b6ed0feae1940.js +0 -1
  381. package/assets/esri/core/workers/chunks/448f068a14f24f2f8a43.js +0 -1
  382. package/assets/esri/core/workers/chunks/4c088c26d5d546c95c90.js +0 -1
  383. package/assets/esri/core/workers/chunks/5134241be1f1bf25231a.js +0 -1
  384. package/assets/esri/core/workers/chunks/56163189fbe63aa11e94.js +0 -1
  385. package/assets/esri/core/workers/chunks/571cf99c3eab8e517542.js +0 -1
  386. package/assets/esri/core/workers/chunks/5762746cfb02a4119d82.js +0 -1
  387. package/assets/esri/core/workers/chunks/5830deda121e4c95d199.js +0 -1
  388. package/assets/esri/core/workers/chunks/58e4aecabca047f1d229.js +0 -1
  389. package/assets/esri/core/workers/chunks/5c8f423812a23c02c1fd.js +0 -1
  390. package/assets/esri/core/workers/chunks/5eb726317b6602f1e206.js +0 -1
  391. package/assets/esri/core/workers/chunks/6e2075bd4832ff0db68c.js +0 -1
  392. package/assets/esri/core/workers/chunks/7608de0d942b4c16b2f6.js +0 -1
  393. package/assets/esri/core/workers/chunks/7610dd0b46948b7bd840.js +0 -1
  394. package/assets/esri/core/workers/chunks/7737ab739eba6d81282d.js +0 -1
  395. package/assets/esri/core/workers/chunks/7be56ac60e580c806a5d.js +0 -1
  396. package/assets/esri/core/workers/chunks/7d9468e38f3bf006f86e.js +0 -1
  397. package/assets/esri/core/workers/chunks/7efc51324cfc8e08c756.js +0 -1
  398. package/assets/esri/core/workers/chunks/84dc2afd89263a311b81.js +0 -1
  399. package/assets/esri/core/workers/chunks/852649460d664b0a1a1d.js +0 -1
  400. package/assets/esri/core/workers/chunks/ab332bd411d6c7d4190c.js +0 -1
  401. package/assets/esri/core/workers/chunks/bc9b96a539f28afcb8cb.js +0 -1
  402. package/assets/esri/core/workers/chunks/be69e2dda75b079362b2.js +0 -1
  403. package/assets/esri/core/workers/chunks/bf9eba555aebca2c132b.js +0 -1
  404. package/assets/esri/core/workers/chunks/c18de0f6cbeecee4ce34.js +0 -1
  405. package/assets/esri/core/workers/chunks/c9df18e9ff7367a004b6.js +0 -1
  406. package/assets/esri/core/workers/chunks/d33d08cb6856cd2eb35e.js +0 -1
  407. package/assets/esri/core/workers/chunks/e688e6e816824b53a25e.js +0 -1
  408. package/assets/esri/core/workers/chunks/ea068c797e3e462f4518.js +0 -1
  409. package/assets/esri/core/workers/chunks/eaf1d38f09744b7e84f5.js +0 -1
  410. package/assets/esri/core/workers/chunks/eff99e45d818e58fd443.js +0 -1
  411. package/assets/esri/core/workers/chunks/f219ba010c480bb75684.js +0 -1
  412. package/assets/esri/core/workers/chunks/f60d5ce49c173d5381ec.js +0 -1
  413. package/assets/esri/core/workers/chunks/f72f4413fc7461e11a2a.js +0 -1
  414. package/assets/esri/core/workers/chunks/f834aa732c3f06525089.js +0 -1
  415. package/assets/esri/core/workers/chunks/fae14e30fa7d81bf706e.js +0 -1
  416. package/assets/esri/core/workers/chunks/fb6f1b562ee0983c8c6e.js +0 -1
  417. package/assets/esri/core/workers/chunks/fc1658eae7b312502fab.js +0 -1
  418. package/views/2d/engine/webgl/Utils.js +0 -2
  419. package/views/2d/layers/support/HighlightCounter.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../Graphic.js";import{isIterable as n}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as t,isScreenPolygon as i,isScreenRect as r,createScreenPointArray as s,createScreenPoint as o}from"../../../core/screenUtils.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"../../../geometry/Point.js";import c from"../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../geometry/projection/projectVectorToVector.js";import{Sphere as d,sphereCSO as p}from"../../../geometry/support/sphere.js";import{fallbackObjectIDAttribute as f}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as m}from"../../../layers/support/layerUtils.js";import{debugFlags as g}from"./debugFlags.js";import{getElevationAtPoint as y}from"./ElevationProvider.js";import{getGraphicHitDedupeKey as h,resolveOrderedIntersectionHits as w}from"./intersectionHitUtils.js";import{Intersector as b}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResultRay as S}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as x,toOwner as E}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as U}from"../webgl-engine/lib/verticalOffsetUtils.js";async function j(e,n,t,o){const l=t?C(e,t):o;if(i(n))return I(e,n,l,t?.excludeLabels);if(r(n))return I(e,V(n),l,t?.excludeLabels);const a=n,c=s(a.x,a.y);l.requiresGroundFeedback=!0,l.enableDraped=!0;const u=new b(e.state.viewingMode);u.options.selectionMode=!0,u.options.store=2,u.options.excludeLabels=t?.excludeLabels??!1,e.sceneIntersectionHelper.intersectIntersectorScreen(c,u,l);const d=await Array.fromAsync(M(e,u.results.all,l.graphics,{getDistance:e=>e.distanceInRenderSpace,getMapPoint:n=>L(e,n),stopAtSupportSurface:!0})),p=u.results.ground,f=E(p,e),y=null!=f&&"type"in f&&m(f)?f:null,h={screenPoint:a,results:d,ground:{mapPoint:L(e,p),distance:S(p)?p.distanceInRenderSpace:0,layer:y}};return g.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=u),h}async function I(e,n,i,r){i.enableDraped=!0;const s=new b(e.state.viewingMode);s.options.selectionMode=!0,s.options.store=2,s.options.excludeLabels=r??!1,await e.sceneIntersectionHelper.intersectIntersectorScreenPolygon(n.map(e=>t(e)),s,i);const o=new Array;await e.sceneIntersectionHelper.screenPolygonIntersectionTask.scheduleGenerator(async function*(n){for await(const t of M(e,R(e,s.polygonResults.all),i.graphics,{getDistance:e=>e.distance,getMapPoint:()=>null}))o.push(t),n.madeProgress()&&(n=yield)});const l={screenPoint:null,results:o,ground:{mapPoint:null,distance:0,layer:null}};return g.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(l.intersector=s),l}function*R(e,n){const t=T(e);if(null!=t)for(const i of n)null!=i.distance&&i.distance<=t&&(yield i);else yield*n}function T(e){const n=e.basemapTerrain,t=e.state.camera;if(1!==e.state.viewingMode||!t.aboveGround||!n?.opaque)return null;z.radius=n.getLowerBoundRadius();return p.distanceToSilhouette(z,t.eye)*F}function V(e){return[o(e.x,e.y),o(e.x+e.width,e.y),o(e.x+e.width,e.y+e.height),o(e.x,e.y+e.height)]}function P(e,n,i,r){const s=i?C(e,i):r,o=!(!s.graphics?.include&&!s.graphics?.exclude),l=!(!s.mediaElements?.include&&!s.mediaElements?.exclude),a=t(n);s.enableDraped=s.include&&!s.include.has(U)||s.exclude?.has(U);const c=e.sceneIntersectionHelper,u=new b(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=o||l?2:0,u.options.excludeLabels=i?.excludeLabels??!1,c.intersectIntersectorScreen(a,u,s),o||l){for(const n of u.results.all){const t=x(n,e);if(null==t)return L(e,n);if(o&&("graphic"!==t.type||G(s.graphics,t.graphic)))return L(e,n);if(l&&("media"!==t.type||H(s.mediaElements,t.element)))return L(e,n)}return null}return L(e,u.results.min)}async function*M(e,n,t,i){const r=w(e,i.stopAtSupportSurface?function*(){for(const t of n){yield t;const n=E(t,e);if(null!=n&&(n===e.map.ground||"type"in n&&m(n)))break}}():n,{getDedupeKey:e=>"graphic"===e.type?v(e.graphic):null,filterHit:e=>"graphic"!==e.type||G(t,e.graphic)});for await(const{input:s,hit:o}of r){const e=i.getMapPoint(s),n=i.getDistance(s);if("media"===o.type){const t=e?o.element.toSource(e):null;yield{...o,mapPoint:e,distance:n,sourcePoint:t}}else yield{...o,mapPoint:e,distance:n}}}function L(e,n,t){return n.getIntersectionPoint(q)?(t=D(e,q,t),7===n.intersector&&e.basemapTerrain&&(t.z=y(e.basemapTerrain,t)??0),t):null}function v(e){const n=e.getObjectId()??e.attributes?.[f];return e.origin&&null!=n?`o-${e.origin.id}-${n}`:`u-${h(e)}`}function G(e,n){return H(e,v(n))}function H(e,n){return null==e||(null==e.include||e.include.has(n))&&(null==e.exclude||!e.exclude.has(n))}function D(e,n,t){let i=e.spatialReference||c.WGS84;return u(n,e.renderSpatialReference,q,i)?n=q:(i=c.WGS84,u(n,e.renderSpatialReference,q,i)&&(n=q)),t?(t.x=n[0],t.y=n[1],t.z=n[2],t.spatialReference=i):t=new a(n,i),t}function C(e,n){const t=N(e,n.include,0),i=N(e,n.exclude,1);return{include:t.layerViewUids,exclude:i.layerViewUids,graphics:{include:t.graphicUids,exclude:i.graphicUids},mediaElements:{include:t.mediaElements,exclude:i.mediaElements}}}function N(t,i,r,s=new _){if(!i)return s;if(i instanceof e)k(s,v(i)),0===r&&(null!=t.graphicsView&&i.layer===t?O(s,t.graphicsView.uid):i.layer&&A(s,t,i.layer.uid));else if("layer"in i&&"element"in i)$(s,i.element),0===r&&A(s,t,i.layer.uid);else if(n(i))for(const e of i)e===t.graphics&&null!=t.graphicsView?O(s,t.graphicsView.uid):e===t.map.ground?(O(s,U),t.map.ground.integratedMeshGround&&A(s,t,t.map.ground.integratedMeshGround.uid)):N(t,e,r,s);else"layer"in i&&W(s,t,i),"uid"in i&&A(s,t,i.uid);return s}class _{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function A(e,n,t){const i=n.allLayerViews.find(e=>e.layer.uid===t);i&&O(e,i.uid)}function O(e,n){e.layerViewUids??=new Map,e.layerViewUids.set(n,!0)}function W(e,n,t){const i=n.allLayerViews.find(e=>e.layer.uid===t.layer.uid);if(!i)return;e.layerViewUids??=new Map;const r=e.layerViewUids.get(i.uid);!0!==r&&(r?r.add(t.id):e.layerViewUids.set(i.uid,new Set([t.id])))}function k(e,n){e.graphicUids??=new Set,e.graphicUids.add(n)}function $(e,n){e.mediaElements??=new Set,e.mediaElements.add(n)}const q=l(),z=new d,F=1.2;export{D as computeMapPointFromVec3d,C as externalToInternalIntersectOptions,j as hitTest,L as intersectResultToMapPoint,G as testGraphicUidFilter,P as toMap};
2
+ import e from"../../../Graphic.js";import has from"../../../core/has.js";import{isIterable as n}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as t,isScreenPolygon as i,isScreenRect as r,createScreenPointArray as s,createScreenPoint as o}from"../../../core/screenUtils.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"../../../geometry/Point.js";import c from"../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../geometry/projection/projectVectorToVector.js";import{Sphere as d,sphereCSO as p}from"../../../geometry/support/sphere.js";import{fallbackObjectIDAttribute as f}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as m}from"../../../layers/support/layerUtils.js";import{debugFlags as g}from"./debugFlags.js";import{getElevationAtPoint as y}from"./ElevationProvider.js";import{getGraphicHitDedupeKey as h,resolveOrderedIntersectionHits as w}from"./intersectionHitUtils.js";import{Intersector as b}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResultRay as S}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as x,toOwner as E}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as U}from"../webgl-engine/lib/verticalOffsetUtils.js";async function j(e,n,t,o){const l=t?D(e,t):o;if(i(n))return I(e,n,l,t?.excludeLabels);if(r(n))return I(e,V(n),l,t?.excludeLabels);const a=n,c=s(a.x,a.y);l.requiresGroundFeedback=!0,l.enableDraped=!0;const u=new b(e.state.viewingMode);u.options.selectionMode=!0,u.options.store=2,u.options.excludeLabels=t?.excludeLabels??!1,e.sceneIntersectionHelper.intersectIntersectorScreen(c,u,l);const d=await Array.fromAsync(M(e,u.results.all,l.graphics,{getDistance:e=>e.distanceInRenderSpace,getMapPoint:n=>L(e,n),stopAtSupportSurface:!0})),p=u.results.ground,f=E(p,e),y=null!=f&&"type"in f&&m(f)&&(!has("enable-feature:im-as-ground")||f.isUsedAsGroundLayer)?f:null,h={screenPoint:a,results:d,ground:{mapPoint:L(e,p),distance:S(p)?p.distanceInRenderSpace:0,layer:y}};return g.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=u),h}async function I(e,n,i,r){i.enableDraped=!0;const s=new b(e.state.viewingMode);s.options.selectionMode=!0,s.options.store=2,s.options.excludeLabels=r??!1,await e.sceneIntersectionHelper.intersectIntersectorScreenPolygon(n.map(e=>t(e)),s,i);const o=new Array;await e.sceneIntersectionHelper.screenPolygonIntersectionTask.scheduleGenerator(async function*(n){for await(const t of M(e,R(e,s.polygonResults.all),i.graphics,{getDistance:e=>e.distance,getMapPoint:()=>null}))o.push(t),n.madeProgress()&&(n=yield)});const l={screenPoint:null,results:o,ground:{mapPoint:null,distance:0,layer:null}};return g.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(l.intersector=s),l}function*R(e,n){const t=T(e);if(null!=t)for(const i of n)null!=i.distance&&i.distance<=t&&(yield i);else yield*n}function T(e){const n=e.basemapTerrain,t=e.state.camera;if(1!==e.state.viewingMode||!t.aboveGround||!n?.opaque)return null;z.radius=n.getLowerBoundRadius();return p.distanceToSilhouette(z,t.eye)*F}function V(e){return[o(e.x,e.y),o(e.x+e.width,e.y),o(e.x+e.width,e.y+e.height),o(e.x,e.y+e.height)]}function P(e,n,i,r){const s=i?D(e,i):r,o=!(!s.graphics?.include&&!s.graphics?.exclude),l=!(!s.mediaElements?.include&&!s.mediaElements?.exclude),a=t(n);s.enableDraped=s.include&&!s.include.has(U)||s.exclude?.has(U);const c=e.sceneIntersectionHelper,u=new b(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=o||l?2:0,u.options.excludeLabels=i?.excludeLabels??!1,c.intersectIntersectorScreen(a,u,s),o||l){for(const n of u.results.all){const t=x(n,e);if(null==t)return L(e,n);if(o&&("graphic"!==t.type||G(s.graphics,t.graphic)))return L(e,n);if(l&&("media"!==t.type||H(s.mediaElements,t.element)))return L(e,n)}return null}return L(e,u.results.min)}async function*M(e,n,t,i){const r=w(e,i.stopAtSupportSurface?function*(){for(const t of n){yield t;const n=E(t,e);if(null!=n&&(n===e.map.ground||"type"in n&&m(n)&&(!has("enable-feature:im-as-ground")||n.isUsedAsGroundLayer)))break}}():n,{getDedupeKey:e=>"graphic"===e.type?v(e.graphic):null,filterHit:e=>"graphic"!==e.type||G(t,e.graphic)});for await(const{input:s,hit:o}of r){const e=i.getMapPoint(s),n=i.getDistance(s);if("media"===o.type){const t=e?o.element.toSource(e):null;yield{...o,mapPoint:e,distance:n,sourcePoint:t}}else yield{...o,mapPoint:e,distance:n}}}function L(e,n,t){return n.getIntersectionPoint(q)?(t=A(e,q,t),7===n.intersector&&e.basemapTerrain&&(t.z=y(e.basemapTerrain,t)??0),t):null}function v(e){const n=e.getObjectId()??e.attributes?.[f];return e.origin&&null!=n?`o-${e.origin.id}-${n}`:`u-${h(e)}`}function G(e,n){return H(e,v(n))}function H(e,n){return null==e||(null==e.include||e.include.has(n))&&(null==e.exclude||!e.exclude.has(n))}function A(e,n,t){let i=e.spatialReference||c.WGS84;return u(n,e.renderSpatialReference,q,i)?n=q:(i=c.WGS84,u(n,e.renderSpatialReference,q,i)&&(n=q)),t?(t.x=n[0],t.y=n[1],t.z=n[2],t.spatialReference=i):t=new a(n,i),t}function D(e,n){const t=C(e,n.include,0),i=C(e,n.exclude,1);return{include:t.layerViewUids,exclude:i.layerViewUids,graphics:{include:t.graphicUids,exclude:i.graphicUids},mediaElements:{include:t.mediaElements,exclude:i.mediaElements}}}function C(t,i,r,s=new N){if(!i)return s;if(i instanceof e)k(s,v(i)),0===r&&(null!=t.graphicsView&&i.layer===t?O(s,t.graphicsView.uid):i.layer&&_(s,t,i.layer.uid));else if("layer"in i&&"element"in i)$(s,i.element),0===r&&_(s,t,i.layer.uid);else if(n(i))for(const e of i)e===t.graphics&&null!=t.graphicsView?O(s,t.graphicsView.uid):e===t.map.ground?(O(s,U),t.map.ground.integratedMeshGround&&_(s,t,t.map.ground.integratedMeshGround.uid)):C(t,e,r,s);else"layer"in i&&W(s,t,i),"uid"in i&&_(s,t,i.uid);return s}class N{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function _(e,n,t){const i=n.allLayerViews.find(e=>e.layer.uid===t);i&&O(e,i.uid)}function O(e,n){e.layerViewUids??=new Map,e.layerViewUids.set(n,!0)}function W(e,n,t){const i=n.allLayerViews.find(e=>e.layer.uid===t.layer.uid);if(!i)return;e.layerViewUids??=new Map;const r=e.layerViewUids.get(i.uid);!0!==r&&(r?r.add(t.id):e.layerViewUids.set(i.uid,new Set([t.id])))}function k(e,n){e.graphicUids??=new Set,e.graphicUids.add(n)}function $(e,n){e.mediaElements??=new Set,e.mediaElements.add(n)}const q=l(),z=new d,F=1.2;export{A as computeMapPointFromVec3d,D as externalToInternalIntersectOptions,j as hitTest,L as intersectResultToMapPoint,G as testGraphicUidFilter,P as toMap};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as r,subclass as n}from"../../../core/accessorSupport/decorators.js";import{projectWithoutEngine as l}from"../../../geometry/projectionUtils.js";import{fromExtent as i,empty as s,expand as a,allFinite as o,equals as c}from"../../../geometry/support/aaBoundingRect.js";import{isIntegratedMeshLayer as p,isTiledLayer as u}from"../../../layers/support/layerUtils.js";import{webMercatorWorldExtent as y,geographicWorldExtent as f}from"./TerrainConst.js";import{getTiledLayerInfo as E,isProjectableRasterLayer as d}from"./terrainUtils.js";let x=class extends t{constructor(e){super(e)}initialize(){this.addHandles([this.layerViews.on("change",()=>this.notifyChange("stencilEnabledExtents"))])}destroy(){}get layerViewsExtent(){return this._computeLayerViewsExtent()}get tiledLayersExtent(){return this._computeTiledLayersExtent()}get stencilEnabledExtents(){return this._computeStencilEnabledExtents()}_computeStencilEnabledExtents(){const e=[];return this.layerViews.forEach(t=>{const r=t.layer;if(p(r)&&null!=this.viewSpatialReference){const t=g(r.fullExtent,this.viewSpatialReference);null!=t&&e.push(i(t))}}),e}};function h(e,t){return 1===e?new m(t):new w(t)}e([r({readOnly:!0})],x.prototype,"layerViewsExtent",null),e([r({readOnly:!0})],x.prototype,"tiledLayersExtent",null),e([r({readOnly:!0})],x.prototype,"stencilEnabledExtents",null),e([r()],x.prototype,"viewSpatialReference",void 0),e([r()],x.prototype,"tilingScheme",void 0),e([r()],x.prototype,"defaultTiledLayersExtent",void 0),e([r({constructOnly:!0})],x.prototype,"layers",void 0),e([r({constructOnly:!0})],x.prototype,"layerViews",void 0),x=e([n("esri.views.3d.terrain.ExtentHelper")],x);let m=class extends x{_computeLayerViewsExtent(){return this._globalExtent}_computeTiledLayersExtent(){return this._globalExtent}get _globalExtent(){return this.viewSpatialReference.isWebMercator?y:f}};m=e([n("esri.views.3d.terrain.ExtentHelper.ExtentHelperGlobal")],m);let w=class extends x{_computeLayerViewsExtent(){const e=s(),t=this.viewSpatialReference;this.layerViews.forEach(r=>{const n=r.layer;if(r.isResolved()&&("graphics"!==n.type||!n.internal)){const n=g("fullExtentInLocalViewSpatialReference"in r&&r.fullExtentInLocalViewSpatialReference||r.layer.fullExtent,t);a(e,n,e)}});const r=o(e)?e:null,n=this._get("layerViewsExtent");return c(r,n)?n:r}_computeTiledLayersExtent(){const e=this.tilingScheme;if(!e)return null;const t=this.viewSpatialReference,r=s();this.layers.forEach(n=>{if(n.loaded&&u(n)){const l=E(n,t,2);if(null==l)return;const{tileInfo:i,fullExtent:s}=l,o="tilemapCache"in n?n.tilemapCache?.effectiveMaxLOD:void 0;null!=i&&null!=s&&(d(n)||e.compatibleWith(i,o)&&s.spatialReference.equals(e.spatialReference))&&a(r,s,r)}}),a(r,this.defaultTiledLayersExtent,r);const n=o(r)?r:null,l=this._get("tiledLayersExtent");return c(n,l)?l:n}};function g(e,t){return null==e||e.spatialReference.equals(t)?e:l(e,e.spatialReference,t)}w=e([n("esri.views.3d.terrain.ExtentHelper.ExtentHelperLocal")],w);export{x as ExtentHelper,h as create};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import{property as r,subclass as n}from"../../../core/accessorSupport/decorators.js";import{projectWithoutEngine as i}from"../../../geometry/projectionUtils.js";import{fromExtent as l,empty as s,expand as a,allFinite as o,equals as c}from"../../../geometry/support/aaBoundingRect.js";import{isIntegratedMeshLayer as p,isTiledLayer as u}from"../../../layers/support/layerUtils.js";import{webMercatorWorldExtent as y,geographicWorldExtent as f}from"./TerrainConst.js";import{getTiledLayerInfo as d,isProjectableRasterLayer as E}from"./terrainUtils.js";let x=class extends t{constructor(e){super(e)}initialize(){this.addHandles([this.layerViews.on("change",()=>this.notifyChange("stencilEnabledExtents"))])}destroy(){}get layerViewsExtent(){return this._computeLayerViewsExtent()}get tiledLayersExtent(){return this._computeTiledLayersExtent()}get stencilEnabledExtents(){return this._computeStencilEnabledExtents()}_computeStencilEnabledExtents(){const e=[];return this.layerViews.forEach(t=>{const r=t.layer;if(p(r)&&(!has("enable-feature:im-as-ground")||r.isUsedAsGroundLayer)&&null!=this.viewSpatialReference){const t=g(r.fullExtent,this.viewSpatialReference);null!=t&&e.push(l(t))}}),e}};function m(e,t){return 1===e?new h(t):new w(t)}e([r({readOnly:!0})],x.prototype,"layerViewsExtent",null),e([r({readOnly:!0})],x.prototype,"tiledLayersExtent",null),e([r({readOnly:!0})],x.prototype,"stencilEnabledExtents",null),e([r()],x.prototype,"viewSpatialReference",void 0),e([r()],x.prototype,"tilingScheme",void 0),e([r()],x.prototype,"defaultTiledLayersExtent",void 0),e([r({constructOnly:!0})],x.prototype,"layers",void 0),e([r({constructOnly:!0})],x.prototype,"layerViews",void 0),x=e([n("esri.views.3d.terrain.ExtentHelper")],x);let h=class extends x{_computeLayerViewsExtent(){return this._globalExtent}_computeTiledLayersExtent(){return this._globalExtent}get _globalExtent(){return this.viewSpatialReference.isWebMercator?y:f}};h=e([n("esri.views.3d.terrain.ExtentHelper.ExtentHelperGlobal")],h);let w=class extends x{_computeLayerViewsExtent(){const e=s(),t=this.viewSpatialReference;this.layerViews.forEach(r=>{const n=r.layer;if(r.isResolved()&&("graphics"!==n.type||!n.internal)){const n=g("fullExtentInLocalViewSpatialReference"in r&&r.fullExtentInLocalViewSpatialReference||r.layer.fullExtent,t);a(e,n,e)}});const r=o(e)?e:null,n=this._get("layerViewsExtent");return c(r,n)?n:r}_computeTiledLayersExtent(){const e=this.tilingScheme;if(!e)return null;const t=this.viewSpatialReference,r=s();this.layers.forEach(n=>{if(n.loaded&&u(n)){const i=d(n,t,2);if(null==i)return;const{tileInfo:l,fullExtent:s}=i,o="tilemapCache"in n?n.tilemapCache?.effectiveMaxLOD:void 0;null!=l&&null!=s&&(E(n)||e.compatibleWith(l,o)&&s.spatialReference.equals(e.spatialReference))&&a(r,s,r)}}),a(r,this.defaultTiledLayersExtent,r);const n=o(r)?r:null,i=this._get("tiledLayersExtent");return c(n,i)?i:n}};function g(e,t){return null==e||e.spatialReference.equals(t)?e:i(e,e.spatialReference,t)}w=e([n("esri.views.3d.terrain.ExtentHelper.ExtentHelperLocal")],w);export{x as ExtentHelper,m as create};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{ComponentTechnique as e}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as t}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as s}from"../../../core/material/MaterialBase.js";import{isColor as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{hasShadowHighlights as a}from"../../../shaders/ReceiveShadowsConfiguration.js";import{isSphereDepthInterpolateActive as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class o extends s{constructor(e,s,r,a,i){super(),this.parameters=e,this.key=i;const o=u(e,r);this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this._emissions=0!==o,this.materialPass=n(e,r),this._configuration=new t(a),this._supportsSphereDepthInterpolate=e.sphereDepthInterpolate&&this._configuration.spherical,this._initializeMaterialConfiguration(e,s,r)}destroy(){}get emissions(){if(!this._emissions)return 0;switch(this.materialPass){case 0:case 3:return 1;case 1:case 4:return 2;case 2:return 3}}acquireTechnique(t,s,r,a){const o=this._updateConfiguration(s,r);if(this._supportsSphereDepthInterpolate&&t.precompiling>0){o.sphereDepthInterpolate=!1;const s=t.get(e,o,a.layout);o.sphereDepthInterpolate=!0;const n=t.get(e,o,a.layout);return i(r.camera,o)?n:s}return t.get(e,o,a.layout)}_initializeMaterialConfiguration(e,t,s){const r=this._configuration;r.hasMetallicRoughnessTexture=e.hasMetallicRoughnessTexture,r.hasOcclusionTexture=e.hasOcclusionTexture,r.hasNormalTexture=e.hasNormalTexture,r.sphereDepthInterpolate=!1,r.ellipsoidMode=e.ellipsoidMode,r.doubleSidedMode=e.doubleSided?1:0,r.hasColorTexture=e.hasBaseColorTexture,r.cullFace=e.cullFace,r.alphaDiscardMode=e.alphaDiscardMode,r.hasVertexColors=t.hasVertexColors,r.textureCoordinateType=t.textureCoordinateType,r.shadeNormals=t.shadeNormals,r.normalType=t.hasNormals?1:2,r.polygonOffset=e.polygonOffset,r.vertexPositionRotationType=t.vertexPositionRotationType,r.componentDataType=s.componentDataType,r.emissionSource=u(e,s),r.groundTransparencyMode=e.groundTransparencyMode}_updateConfiguration(e,t){const s=this._configuration,{identifier:o}=e,n=0===o;s.output=t.output,s.enableOITOffset=t.enableOITOffset,s.sphereDepthInterpolate=this._supportsSphereDepthInterpolate&&i(t.camera,s),s.hasEmission=t.hasEmission,s.renderOccluded=9===t.slot;const l=this.isIntegratedMesh?c(t)?h(t)?3:2:1:0;s.integratedMeshMode=l,s.pbrMode=3===l?4:this.usePBR?this.hasParametersFromSource?0!==s.shadeNormals&&this.isIntegratedMesh?0:2:1:0,s.hasSlicePlane=null!=t.slicePlane&&this.slicePlaneEnabled,s.isGroundSlice=s.hasSlicePlane&&this.isGround;const{materialPass:u}=this;s.transparent=n&&(1===u||2===u&&e.transparent||4===u)||s.isGroundSlice,s.hasHighlightMixTexture=2===o&&null!=t.highlightMixTexture,s.snowCover=n&&t.snowCover>0,s.vertexDiscardMode=n&&2===u?e.transparent?2:1:0;const p=r(t.output);return s.receiveAmbientOcclusion=p&&this.applySSAO&&!s.renderOccluded&&null!=t.ssao?.getTexture(),s.receiveGlobalIllumination=p&&this.applySSAO&&!s.renderOccluded&&t.globalIlluminationEnabled,s.hasOccludees=p&&t.hasOccludees,s.receiveShadows=p&&t.shadowMap.ready,s.hasShadowHighlights=a(s,t),s.screenSpaceReflections=t.hasScreenSpaceReflections,s.cloudReflections=p&&null!=t.clouds.data?.cubeMap?.colorTexture,s}}function n(e,t){const{alphaDiscardMode:s,isIntegratedMesh:r,slicePlaneEnabled:a}=e,{transparent:i,opaqueOverride:o}=t,n=e.isObjectTransparent,l=e.hasBaseColorTransparency;if(r)return n||a?4:3;if(n)return 1;if(0===o)return 0;if(l||0===s||3===s)return 1;switch(i){case 2:return 0;case 0:return 1;case 1:return 2}}function l(e){return e.hasEmissionTexture||e.hasEmissiveBaseColor}function u(e,{emissiveSourceOverride:t,emissiveOverride:s}){const r=e.hasEmissionTexture,a=1===t,i=2===t;return 2!==s&&(l(e)||2!==t)?l(e)?i?r?4:2:a?r?5:7:6:a?7:6:0}function h(e){return null!=e.overlay?.getTexture(3)}function c(e){return null!=e.overlay?.getTexture(1)}export{o as ComponentMaterial,n as computeMaterialPass,u as getEmissionSource};
2
+ import has from"../../../../../../core/has.js";import{ComponentTechnique as e}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as t}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as s}from"../../../core/material/MaterialBase.js";import{isColor as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{hasShadowHighlights as a}from"../../../shaders/ReceiveShadowsConfiguration.js";import{isSphereDepthInterpolateActive as o}from"../../../shaders/SphereDepthInterpolate.glsl.js";class i extends s{constructor(e,s,r,a,o){super(),this.parameters=e,this.key=o;const i=u(e,r);this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this._emissions=0!==i,this.materialPass=n(e,r),this._configuration=new t(a),this._supportsSphereDepthInterpolate=e.sphereDepthInterpolate&&this._configuration.spherical,this._initializeMaterialConfiguration(e,s,r)}destroy(){}get emissions(){if(!this._emissions)return 0;switch(this.materialPass){case 0:case 3:return 1;case 1:case 4:return 2;case 2:return 3}}acquireTechnique(t,s,r,a){const i=this._updateConfiguration(s,r);if(this._supportsSphereDepthInterpolate&&t.precompiling>0){i.sphereDepthInterpolate=!1;const s=t.get(e,i,a.layout);i.sphereDepthInterpolate=!0;const n=t.get(e,i,a.layout);return o(r.camera,i)?n:s}return t.get(e,i,a.layout)}_initializeMaterialConfiguration(e,t,s){const r=this._configuration;r.hasMetallicRoughnessTexture=e.hasMetallicRoughnessTexture,r.hasOcclusionTexture=e.hasOcclusionTexture,r.hasNormalTexture=e.hasNormalTexture,r.sphereDepthInterpolate=!1,r.ellipsoidMode=e.ellipsoidMode,r.doubleSidedMode=e.doubleSided?1:0,r.hasColorTexture=e.hasBaseColorTexture,r.cullFace=e.cullFace,r.alphaDiscardMode=e.alphaDiscardMode,r.hasVertexColors=t.hasVertexColors,r.textureCoordinateType=t.textureCoordinateType,r.shadeNormals=t.shadeNormals,r.normalType=t.hasNormals?1:2,r.polygonOffset=e.polygonOffset,r.vertexPositionRotationType=t.vertexPositionRotationType,r.componentDataType=s.componentDataType,r.emissionSource=u(e,s),r.groundTransparencyMode=e.groundTransparencyMode}_updateConfiguration(e,t){const s=this._configuration,{identifier:i}=e,n=0===i;s.output=t.output,s.enableOITOffset=t.enableOITOffset,s.sphereDepthInterpolate=this._supportsSphereDepthInterpolate&&o(t.camera,s),s.hasEmission=t.hasEmission,s.renderOccluded=9===t.slot;const l=this.isIntegratedMesh?c(t)?h(t)?3:2:1:0;s.integratedMeshMode=l,s.pbrMode=3===l?4:this.usePBR?this.hasParametersFromSource?0!==s.shadeNormals&&this.isIntegratedMesh?0:2:1:0,s.hasSlicePlane=null!=t.slicePlane&&this.slicePlaneEnabled,s.isGroundSlice=s.hasSlicePlane&&this.isGround;const{materialPass:u}=this;s.transparent=n&&(1===u||2===u&&e.transparent||4===u)||s.isGroundSlice,s.hasHighlightMixTexture=2===i&&null!=t.highlightMixTexture,s.snowCover=n&&t.snowCover>0,s.vertexDiscardMode=n&&2===u?e.transparent?2:1:0;const p=r(t.output);return s.receiveAmbientOcclusion=p&&this.applySSAO&&!s.renderOccluded&&null!=t.ssao?.getTexture(),s.receiveGlobalIllumination=p&&this.applySSAO&&!s.renderOccluded&&t.globalIlluminationEnabled,s.hasOccludees=p&&t.hasOccludees,s.receiveShadows=p&&t.shadowMap.ready,s.hasShadowHighlights=a(s,t),s.screenSpaceReflections=t.hasScreenSpaceReflections,s.cloudReflections=p&&null!=t.clouds.data?.cubeMap?.colorTexture,s}}function n(e,t){const{alphaDiscardMode:s,isIntegratedMesh:r,slicePlaneEnabled:a}=e,{transparent:o,opaqueOverride:i}=t,n=e.isObjectTransparent,l=e.hasBaseColorTransparency;if(r)return n||a&&(!has("enable-feature:im-as-ground")||e.isGround)?4:3;if(n)return 1;if(0===i)return 0;if(l||0===s||3===s)return 1;switch(o){case 2:return 0;case 0:return 1;case 1:return 2}}function l(e){return e.hasEmissionTexture||e.hasEmissiveBaseColor}function u(e,{emissiveSourceOverride:t,emissiveOverride:s}){const r=e.hasEmissionTexture,a=1===t,o=2===t;return 2!==s&&(l(e)||2!==t)?l(e)?o?r?4:2:a?r?5:7:6:a?7:6:0}function h(e){return null!=e.overlay?.getTexture(3)}function c(e){return null!=e.overlay?.getTexture(1)}export{i as ComponentMaterial,n as computeMaterialPass,u as getEmissionSource};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import has from"../../../../core/has.js";import{property as t,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{InternalRenderCategory as s}from"../../webgl.js";import i from"../../webgl/RenderNode.js";import{distanceFadeEnd as o}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";let a=class extends i{constructor(){super(...arguments),this.consumes={required:["normals"]},this.produces="disabled",this._globalIlluminationAvailable=!has("disable-feature:global-illumination")}get enabled(){return!this.destroying&&!this.destroyed&&this.produces===s.AMBIENT_ILLUMINATION}get _belowMaxElevation(){return(this.view.state.camera.relativeElevation??1/0)<o}get _globalIlluminationEnabled(){return this._globalIlluminationAvailable&&this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(11)}get _ssaoEnabled(){return this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(3)&&!this._globalIlluminationEnabled}_enable(){this.produces=s.AMBIENT_ILLUMINATION,this.requestRender(1)}_disable(){this.produces="disabled",this.requestRender(1)}};e([t()],a.prototype,"consumes",void 0),e([t()],a.prototype,"produces",void 0),a=e([r("esri.views.3d.webgl-engine.effects.AmbientIllumination")],a);export{a as AmbientIllumination};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/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{signal as o}from"../../../../../core/signal.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{add as h,normalize as m,length as p,dot as l,scale as u,lerp as c}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g,fromValues as _}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as d}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{heightLimit as f}from"../../../environment/weather.js";import{betaRayleigh as P,betaCombined as v}from"../atmosphere/atmosphereUtils.js";import{F as b}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as w}from"./FogTechnique.js";import{BlurEmission as y}from"../glow/BlurEmission.js";import{EmissiveTechniqueConfiguration as F}from"../../shaders/EmissiveTechniqueConfiguration.js";import{floatBlendReductionFactor as j}from"../../shaders/floatBlendScale.glsl.js";import{ColorAttachment1 as B,SizedPixelFormat as C,ColorAttachment0 as q,DepthStencilAttachment as x}from"../../../../webgl/enums.js";const E=.9*f,T=1.1*f;let A=class extends y{constructor(){super(...arguments),this._configuration=new F,this._newParameters=new M,this._oldParameters=new M,this._fadedParameters=new M,this._parameters=this._newParameters,this._passParameters=new b}initialize(){this.addHandles([a(()=>this.view.environment.atmosphereEnabled,()=>this._updateEnabled(),i),a(()=>this.view.environment.weather,()=>this._updateEnabled(),i),a(()=>this._updateFogParameters(),()=>{},i),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.copy(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.value=t?e.scattering:0,this._newParameters.amount.value=s?1:0,"foggy"!==e.type&&"snowy"!==e.type||(this._newParameters.fogBrightness=G),"rainy"===e.type&&(this._newParameters.fogBrightness=z),this._fadeFactor>=1&&this._oldParameters.copy(this._newParameters),this.requestRender(2)}get strength(){return this._parameters.strength.value*this._heightFade}get amount(){return this._parameters.amount.value*this._heightFade}get _heightFade(){const e=p(this.bindParameters.camera.eye);return 1-t(E,T,Math.abs(e-this._ellipsoid.radius))}precompile(){this._update(),this._passParameters.amount>0&&(super.precompile(),this.techniques.precompile(w,this._configuration))}render(){const e=this.input,t=this._getTechnique();if(!t)return e;this._passParameters.emission=e.obtainAttachment(B),this._passParameters.inputScale=this._passParameters.emission?.attachment.descriptor.internalFormat===C.RGBA8?j:1;const s=this.renderingContext;this._passParameters.emission&&(this._renderEmissionMipMap(),this._configuration.useFloatBlend?(e.acquireColor(B,8,"emissive"),s.clearBuffer(1,d)):(this._passParameters.color=e.obtainAttachment(q),e.acquireColor(q,5),e.acquireColor(B,8,"emissive")));const a=e.getAttachment(x);return e.attachDepth(null),s.bindFramebuffer(e.fbo),s.bindTechnique(t,this.bindParameters,this._passParameters),s.screen.draw(),this._passParameters.color=r(this._passParameters.color),this._passParameters.emission=r(this._passParameters.emission),this._passParameters.mipmapTexture=r(this._passParameters.mipmapTexture),e.attachDepth(a),this.fboCache.debugCallback?.("fog-color",e.fbo),e}_getTechnique(){return this.renders?this.techniques.get(w,this._configuration):null}get renders(){return this._update(),this._passParameters.amount>0}_update(){const e=this.bindParameters.camera;m(R,e.eye);const t=Math.max(0,l(R,this.bindParameters.lighting.mainLight.direction)),s=this._parameters.fogBrightness;u(this._passParameters.fogColor,k,s),u(S,k,.1*s),c(this._passParameters.fogColor,S,this._passParameters.fogColor,t);const r=p(e.eye);this._passParameters.atmosphereC=r**2-this._atmosphereRadius**2,this._passParameters.amount=this.amount,this._passParameters.strength=this.strength,this._configuration.hasEmissive=this.bindParameters.hasEmission,this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value}get test(){return{parameters:this._passParameters}}};A=e([n("esri.views.3d.webgl-engine.effects.fog.Fog")],A);class M{constructor(){this.fogBrightness=0,this.strength=o(0),this.amount=o(0)}copy(e){this.fogBrightness=e.fogBrightness,this.strength.value=e.strength.value,this.amount.value=e.amount.value}lerp(e,t,r){this.fogBrightness=s(e.fogBrightness,t.fogBrightness,r),this.strength.value=s(e.strength.value,t.strength.value,r),this.amount.value=s(e.amount.value,t.amount.value,r)}}const R=g(),S=g(),U=_(3e-4,3e-4,3e-4),k=g();h(k,v,P),h(k,k,U),m(k,k);const D=k.reduce((e,t)=>e+t,0)/3,z=.5/D,G=1.5/D;export{A as Fog,M 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{signal as o}from"../../../../../core/signal.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{add as h,normalize as m,length as p,dot as l,scale as u,lerp as c}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g,fromValues as _}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as d}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{heightLimit as f}from"../../../environment/weather.js";import{betaRayleigh as P,betaCombined as v}from"../atmosphere/atmosphereUtils.js";import{F as b}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as w}from"./FogTechnique.js";import{BlurEmission as y}from"../glow/BlurEmission.js";import{EmissiveTechniqueConfiguration as F}from"../../shaders/EmissiveTechniqueConfiguration.js";import{floatBlendReductionFactor as B}from"../../shaders/floatBlendScale.glsl.js";import{ColorAttachment1 as j,SizedPixelFormat as C,ColorAttachment0 as E,DepthStencilAttachment as q}from"../../../../webgl/enums.js";const x=.9*f,T=1.1*f;let A=class extends y{constructor(){super(...arguments),this._configuration=new F,this._newParameters=new M,this._oldParameters=new M,this._fadedParameters=new M,this._parameters=this._newParameters,this._passParameters=new b}initialize(){this.addHandles([a(()=>this.view.environment.atmosphereEnabled,()=>this._updateEnabled(),i),a(()=>this.view.environment.weather,()=>this._updateEnabled(),i),a(()=>this._updateFogParameters(),()=>{},i),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.copy(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.value=t?e.scattering:0,this._newParameters.amount.value=s?1:0,"foggy"!==e.type&&"snowy"!==e.type||(this._newParameters.fogBrightness=G),"rainy"===e.type&&(this._newParameters.fogBrightness=z),this._fadeFactor>=1&&this._oldParameters.copy(this._newParameters),this.requestRender(2)}get strength(){return this._parameters.strength.value*this._heightFade}get amount(){return this._parameters.amount.value*this._heightFade}get _heightFade(){const e=p(this.bindParameters.camera.eye);return 1-t(x,T,Math.abs(e-this._ellipsoid.radius))}precompile(){this._update(),this._passParameters.amount>0&&(super.precompile(),this.techniques.precompile(w,this._configuration))}get _needsEmissionBlur(){return this._configuration.hasEmissive}render(){const e=this.input,t=this._getTechnique();if(!t)return e;this._passParameters.emission=e.obtainAttachment(j),this._passParameters.inputScale=this._passParameters.emission?.attachment.descriptor.internalFormat===C.RGBA8?B:1;const s=this.renderingContext;this._passParameters.emission&&(this._renderEmissionMipMap(),this._configuration.useFloatBlend?(e.acquireColor(j,8,"emissive"),s.clearBuffer(1,d)):(this._passParameters.color=e.obtainAttachment(E),e.acquireColor(E,5),e.acquireColor(j,8,"emissive")));const a=e.getAttachment(q);return e.attachDepth(null),s.bindFramebuffer(e.fbo),s.bindTechnique(t,this.bindParameters,this._passParameters),s.screen.draw(),this._passParameters.color=r(this._passParameters.color),this._passParameters.emission=r(this._passParameters.emission),this._passParameters.mipmapTexture=r(this._passParameters.mipmapTexture),e.attachDepth(a),this.fboCache.debugCallback?.("fog-color",e.fbo),e}_getTechnique(){return this.renders?this.techniques.get(w,this._configuration):null}get renders(){return this._update(),this._passParameters.amount>0}_update(){const e=this.bindParameters.camera;m(R,e.eye);const t=Math.max(0,l(R,this.bindParameters.lighting.mainLight.direction)),s=this._parameters.fogBrightness;u(this._passParameters.fogColor,k,s),u(S,k,.1*s),c(this._passParameters.fogColor,S,this._passParameters.fogColor,t);const r=p(e.eye);this._passParameters.atmosphereC=r**2-this._atmosphereRadius**2,this._passParameters.amount=this.amount,this._passParameters.strength=this.strength,this._configuration.hasEmissive=this.bindParameters.hasEmission,this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value}get test(){return{parameters:this._passParameters}}};A=e([n("esri.views.3d.webgl-engine.effects.fog.Fog")],A);class M{constructor(){this.fogBrightness=0,this.strength=o(0),this.amount=o(0)}copy(e){this.fogBrightness=e.fogBrightness,this.strength.value=e.strength.value,this.amount.value=e.amount.value}lerp(e,t,r){this.fogBrightness=s(e.fogBrightness,t.fogBrightness,r),this.strength.value=s(e.strength.value,t.strength.value,r),this.amount.value=s(e.amount.value,t.amount.value,r)}}const R=g(),S=g(),U=_(3e-4,3e-4,3e-4),k=g();h(k,v,P),h(k,k,U),m(k,k);const D=k.reduce((e,t)=>e+t,0)/3,z=.5/D,G=1.5/D;export{A as Fog,M as FogParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../../core/maybe.js";import{watch as s,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{property as a,subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{set as l}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_W as o,ZEROS as u}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as n}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{G as h}from"../../../../../chunks/GlobalIllumination.glsl.js";import{G as c}from"../../../../../chunks/GlobalIlluminationBlur.glsl.js";import{GlobalIlluminationBlurTechnique as p}from"./GlobalIlluminationBlurTechnique.js";import{GlobalIlluminationTechnique as _}from"./GlobalIlluminationTechnique.js";import{GlobalIlluminationTechniqueConfiguration as d}from"./GlobalIlluminationTechniqueConfiguration.js";import{G as f}from"../../../../../chunks/GlobalIlluminationUpscale.glsl.js";import{GlobalIlluminationUpscaleTechnique as b}from"./GlobalIlluminationUpscaleTechnique.js";import{DepthStencilAttachment as g,ColorAttachment1 as w}from"../../../../webgl/enums.js";const P=1,I=100;let x=class extends m{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=n.AMBIENT_ILLUMINATION,this._passParameters=new h,this._drawParameters=new c,this._drawParametersUpscale=new f,this._maxFrames=256,this._lowQualityResolutionScale=.25,this._configuration=new d,this._lastOutput=null,this._isGlobalIlluminationUpdate=!1,this._resetBuffer=!1}initialize(){this.addHandles(s(()=>this.view.stage.renderer.hasGlobalIllumination,()=>{this._reset(),this._requestRender()},r))}destroy(){this._lastOutput=t(this._lastOutput)}resetAccumulatedFrames(){this._isGlobalIlluminationUpdate||!(this._passParameters.accumulatedFrames>I)&&this._configuration.hasEmission||this._reset()}render(e){if(this._passParameters.accumulatedFrames>=this._maxFrames)return this._lastOutput?.retain(),this._lastOutput;const t=e.find(({name:e})=>"normals"===e),s=t?.getTexture(),r=t?.getTexture(g),a=this._mode;if(!s||!r)return this._emptyOutput;if(0===a)return this._resetBuffer=!1,this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this._requestRender(),this._emptyOutput;const i=this.bindParameters;this._configuration.hasEmission=!!i.reprojection.lastFrameEmission;const o=this.techniques.getCompiled(_,this._configuration),u=this.techniques.getCompiled(p),m=1===a,h=m?this._lowQualityResolutionScale:1,c=m?this.techniques.getCompiled(b):null;if(!o||!u||m&&!c)return this._requestRender(),this._emptyOutput;const d=this.renderingContext,{camera:f}=i;this._passParameters.normalTexture=s,this._passParameters.depthTexture=r,this._passParameters.projScale=1/f.computeScreenPixelSizeAtDist(1),this._passParameters.scaleGlobalIllumination=h;const{fullWidth:I,fullHeight:x}=f,T=Math.max(1,Math.floor(I*h)),q=Math.max(1,Math.floor(x*h)),F=this.fboCache.acquire(T,q,"global illumination input").acquireColor(w,2);d.bindFramebuffer(F.fbo),d.setViewport(0,0,T,q),d.bindTechnique(o,i,this._passParameters,this._drawParameters),d.screen.draw();const O=F.obtainAttachment(w),C=Math.max(1,Math.round(T/P)),G=Math.max(1,Math.round(q/P)),j=this.fboCache.acquire(C,G,"global illumination blur horizontal");d.bindFramebuffer(j.fbo),this._drawParameters.texture=F.getTexture(),this._drawParameters.weightTexture=O.attachment,l(this._drawParameters.blurSize,0,P/q),d.bindTechnique(u,i,this._passParameters,this._drawParameters),d.setViewport(0,0,C,G),d.screen.draw(),F.release();const y=m?"global illumination blur vertical":n.AMBIENT_ILLUMINATION,M=this.fboCache.acquire(C,G,y);d.bindFramebuffer(M.fbo),d.setViewport(0,0,C,G),d.setClearColor(1,1,1,0),d.clear(16384),this._drawParameters.texture=j.getTexture(),this._drawParameters.weightTexture=O.attachment,l(this._drawParameters.blurSize,P/C,0),d.bindTechnique(u,i,this._passParameters,this._drawParameters),d.setViewport(0,0,C,G),d.screen.draw(),j.release(),M.attachColor(O,w),O.release();let R=M;return c&&(R=this.fboCache.acquire(I,x,n.AMBIENT_ILLUMINATION).acquireColor(w,2),d.bindFramebuffer(R.fbo),d.setViewport(0,0,I,x),d.setClearColor(1,1,1,0),d.clear(16384),this._drawParametersUpscale.colorTexture=M.getTexture(),this._drawParametersUpscale.weightTexture=M.getTexture(w),d.bindTechnique(c,i,this._passParameters,this._drawParametersUpscale),d.screen.draw(),M.release()),d.setViewport4fv(f.fullViewport),this._passParameters.temporalSampleFrame=(this._passParameters.temporalSampleFrame+1)%64,++this._passParameters.accumulatedFrames,this._storeOutput(R),this._passParameters.accumulatedFrames<this._maxFrames&&this._requestRender(),R}_requestRender(){this._isGlobalIlluminationUpdate=!0,this.requestRender(1),this._isGlobalIlluminationUpdate=!1}_storeOutput(e){this._lastOutput!==e&&(this._lastOutput=t(this._lastOutput),this._lastOutput=e,this._lastOutput.retain())}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:s}=this.bindParameters.camera,r=this.fboCache.acquire(t,s,n.AMBIENT_ILLUMINATION).acquireColor(w,2);return e.bindFramebuffer(r.fbo),e.setViewport(0,0,t,s),e.clearBuffer(0,o),e.clearBuffer(1,u),r}get _canRender(){const{reprojection:e,hasEmission:t,globalIllumination:s}=this.bindParameters;return!(!e.lastFrameColor||t&&!e.lastFrameEmission||!e.lastFrameDepth||!s||this._resetBuffer)}get _mode(){const{hasGlobalIlluminationHighQuality:e,hasGlobalIllumination:t}=this.view.stage.renderer;return e?2:t?1:0}_reset(){this._passParameters.accumulatedFrames=0,this._lastOutput=t(this._lastOutput)}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._reset(),this._passParameters.temporalSampleFrame=0,this._resetBuffer=!0,this._requestRender()}}}};e([a()],x.prototype,"consumes",void 0),e([a()],x.prototype,"produces",void 0),x=e([i("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],x);export{x as GlobalIllumination,P as blurSizePixels};
2
+ import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../../core/maybe.js";import{watch as s,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators.js";import{set as i}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_W as l,ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as u}from"../../../webgl.js";import{AmbientIllumination as n}from"../AmbientIllumination.js";import{G as m}from"../../../../../chunks/GlobalIllumination.glsl.js";import{G as h}from"../../../../../chunks/GlobalIlluminationBlur.glsl.js";import{GlobalIlluminationBlurTechnique as c}from"./GlobalIlluminationBlurTechnique.js";import{GlobalIlluminationTechnique as p}from"./GlobalIlluminationTechnique.js";import{GlobalIlluminationTechniqueConfiguration as _}from"./GlobalIlluminationTechniqueConfiguration.js";import{G as d}from"../../../../../chunks/GlobalIlluminationUpscale.glsl.js";import{GlobalIlluminationUpscaleTechnique as f}from"./GlobalIlluminationUpscaleTechnique.js";import{DepthStencilAttachment as b,ColorAttachment1 as g}from"../../../../webgl/enums.js";const w=1,P=100;let x=class extends n{constructor(e){super(e),this._passParameters=new m,this._drawParameters=new h,this._drawParametersUpscale=new d,this._maxFrames=256,this._lowQualityResolutionScale=.35,this._configuration=new _,this._lastOutput=null,this._isGlobalIlluminationUpdate=!1,this._resetBuffer=!1}initialize(){this.addHandles(s(()=>this._mode,e=>{0===e?this._disable():this._enable()},r))}destroy(){this._lastOutput=t(this._lastOutput)}get hasHighQuality(){return 2===this._mode}resetAccumulatedFrames(){this._isGlobalIlluminationUpdate||!(this._passParameters.accumulatedFrames>P)&&this._configuration.hasEmission||this._reset()}precompile(){this.techniques.getCompiled(f)}render(e){if(this._passParameters.accumulatedFrames>=this._maxFrames)return this._lastOutput?.retain(),this._lastOutput;const t=e.find(({name:e})=>"normals"===e),s=t?.getTexture(),r=t?.getTexture(b),a=this._mode;if(!s||!r)return this._emptyOutput;if(0===a)return this._resetBuffer=!1,this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this._requestRender(),this._emptyOutput;const l=this.bindParameters;this._configuration.hasEmission=!!l.reprojection.lastFrameEmission;const o=this.techniques.getCompiled(p,this._configuration),n=this.techniques.getCompiled(c),m=1===a,h=m?this._lowQualityResolutionScale:1,_=m?this.techniques.getCompiled(f):null;if(!o||!n||m&&!_)return this._requestRender(),this._emptyOutput;const d=this.renderingContext,{camera:P}=l;this._passParameters.normalTexture=s,this._passParameters.depthTexture=r,this._passParameters.projScale=1/P.computeScreenPixelSizeAtDist(1),this._passParameters.scaleGlobalIllumination=h;const{fullWidth:x,fullHeight:I}=P,q=Math.max(1,Math.floor(x*h)),F=Math.max(1,Math.floor(I*h)),T=this.fboCache.acquire(q,F,"global illumination input").acquireColor(g,2);d.bindFramebuffer(T.fbo),d.setViewport(0,0,q,F),d.bindTechnique(o,l,this._passParameters,this._drawParameters),d.screen.draw();const O=T.obtainAttachment(g),C=Math.max(1,Math.round(q/w)),j=Math.max(1,Math.round(F/w)),G=this.fboCache.acquire(C,j,"global illumination blur horizontal");d.bindFramebuffer(G.fbo),this._drawParameters.texture=T.getTexture(),this._drawParameters.weightTexture=O.attachment,i(this._drawParameters.blurSize,0,w/F),d.bindTechnique(n,l,this._passParameters,this._drawParameters),d.setViewport(0,0,C,j),d.screen.draw(),T.release();const S=m?"global illumination blur vertical":u.AMBIENT_ILLUMINATION,y=this.fboCache.acquire(C,j,S);d.bindFramebuffer(y.fbo),d.setViewport(0,0,C,j),d.setClearColor(1,1,1,0),d.clear(16384),this._drawParameters.texture=G.getTexture(),this._drawParameters.weightTexture=O.attachment,i(this._drawParameters.blurSize,w/C,0),d.bindTechnique(n,l,this._passParameters,this._drawParameters),d.setViewport(0,0,C,j),d.screen.draw(),G.release(),y.attachColor(O,g),O.release();let M=y;return _&&(M=this.fboCache.acquire(x,I,u.AMBIENT_ILLUMINATION).acquireColor(g,2),d.bindFramebuffer(M.fbo),d.setViewport(0,0,x,I),d.setClearColor(1,1,1,0),d.clear(16384),this._drawParametersUpscale.colorTexture=y.getTexture(),this._drawParametersUpscale.weightTexture=y.getTexture(g),d.bindTechnique(_,l,this._passParameters,this._drawParametersUpscale),d.screen.draw(),y.release()),d.setViewport4fv(P.fullViewport),this._passParameters.temporalSampleFrame=(this._passParameters.temporalSampleFrame+1)%64,++this._passParameters.accumulatedFrames,this._storeOutput(M),this._passParameters.accumulatedFrames<this._maxFrames&&this._requestRender(),M}_requestRender(){this._isGlobalIlluminationUpdate=!0,this.requestRender(1),this._isGlobalIlluminationUpdate=!1}_storeOutput(e){this._lastOutput!==e&&(this._lastOutput=t(this._lastOutput),this._lastOutput=e,this._lastOutput.retain())}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:s}=this.bindParameters.camera,r=this.fboCache.acquire(t,s,u.AMBIENT_ILLUMINATION).acquireColor(g,2);return e.bindFramebuffer(r.fbo),e.setViewport(0,0,t,s),e.clearBuffer(0,l),e.clearBuffer(1,o),r}get _canRender(){const{reprojection:e,hasEmission:t,globalIllumination:s}=this.bindParameters;return!(!e.lastFrameColor||t&&!e.lastFrameEmission||!e.lastFrameDepth||!s||this._resetBuffer)}get _mode(){return this._globalIlluminationEnabled?this.view.stage.renderer.isFeatureEnabled(10)?2:1:0}_reset(){this._passParameters.accumulatedFrames=0,this._lastOutput=t(this._lastOutput)}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._reset(),this._passParameters.temporalSampleFrame=0,this._resetBuffer=!0,this._requestRender()}}}};x=e([a("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],x);export{x as GlobalIllumination,w as blurSizePixels};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{lerp as t}from"../../../../../core/mathUtils.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{getReferenceEllipsoid as o}from"../../../../../geometry/ellipsoidUtils.js";import{TransparentEnvironment as h}from"../TransparentEnvironment.js";import{B as n}from"../../../../../chunks/BlurEmission.glsl.js";import{BlurEmissionTechnique as l}from"./BlurEmissionTechnique.js";import{floatBlendReductionFactor as m}from"../../shaders/floatBlendScale.glsl.js";import{noParameters as p}from"../../../../webgl/NoParameters.js";let d=class extends h{constructor(e){super(e),this._glowBoost={realistic:0,cartographicMin:.5,cartographicDefault:2.5,cartographicMax:5},this._drawParameters=new n,this._ellipsoid=o(e.view.spatialReference)}initialize(){this.addHandles([r(()=>this._boost,e=>{this._passParameters.boost=e,this.requestRender(1)},s),r(()=>this.view.stage.renderView.fog?.strength??0,e=>{this._passParameters.scattering=e,this.requestRender(1)},s)])}precompile(){this.techniques.precompile(l)}get _atmosphereRadius(){return this._ellipsoid.radius+this._ellipsoid.atmosphereHeight}_renderEmissionMipMap(){const e=this._passParameters.emission?.attachment;if(!e)return;this._drawParameters.input=e,this._drawParameters.inputScale=this.bindParameters.useFloatBlend.value?1:m,this._drawParameters.level=0,a(this._drawParameters.size,1,1);const t=Math.floor(.5*e.descriptor.width),r=Math.floor(.5*e.descriptor.height),s=this.fboCache,i=s.acquire(t,e.descriptor.height,"blur horizontal",8);let o,h=t,n=e.descriptor.height;const d=this.renderingContext,c=this.techniques.get(l),g=d.bindTechnique(c,this.bindParameters,p);for(;h>=1&&n>=1;)this._drawParameters.isHorizontal=!0,this._setupFBO(i,h,n),g.bindDraw(this.bindParameters,p,this._drawParameters),d.screen.draw(),n=Math.floor(.5*n),this._drawParameters.input=i.getTexture(),this._drawParameters.inputScale=1,this._drawParameters.isHorizontal=!1,a(this._drawParameters.size,h/t,n/r),o??=s.acquire(h,n,"blur mipmap",9),this._setupFBO(o,h,n,this._drawParameters.level),g.bindDraw(this.bindParameters,p,this._drawParameters),d.screen.draw(),s.debugCallback?.(o.name,o.fbo),h=Math.floor(.5*h),this._drawParameters.input=o.getTexture(),++this._drawParameters.level;i.release(),o&&(o.fbo.level=0),this._passParameters.mipmapLevels=this._drawParameters.level,this._passParameters.mipmapTexture=o,d.setViewport(0,0,e.descriptor.width,e.descriptor.height)}get _boost(){return 0===this._mode?this._glowBoost.realistic:this._intensity<=.5?t(this._glowBoost.cartographicMin,this._glowBoost.cartographicDefault,2*this._intensity):t(this._glowBoost.cartographicDefault,this._glowBoost.cartographicMax,2*(this._intensity-.5))}get _mode(){return null==this.view.environment.lighting.glow?this.view.environment.atmosphereEnabled?0:2:1}get _hasBlur(){return 2!==this._mode}get _intensity(){return this.view.environment.lighting.glow?.intensity??0}_setupFBO(e,t,r,s=0){e.fbo.level=s;const i=this.renderingContext;i.bindFramebuffer(e.fbo),i.setViewport(0,0,t,r),i.setClearColor(0,0,0,0),i.clear(16384)}};d=e([i("esri.views.3d.webgl-engine.effects.glow.BlurEmission")],d);export{d as BlurEmission};
2
+ import{__decorate as e}from"tslib";import{lerp as t}from"../../../../../core/mathUtils.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{getReferenceEllipsoid as o}from"../../../../../geometry/ellipsoidUtils.js";import{TransparentEnvironment as h}from"../TransparentEnvironment.js";import{B as n}from"../../../../../chunks/BlurEmission.glsl.js";import{BlurEmissionTechnique as l}from"./BlurEmissionTechnique.js";import{floatBlendReductionFactor as m}from"../../shaders/floatBlendScale.glsl.js";import{noParameters as p}from"../../../../webgl/NoParameters.js";let d=class extends h{constructor(e){super(e),this._glowBoost={realistic:0,cartographicMin:.5,cartographicDefault:2.5,cartographicMax:5},this._drawParameters=new n,this._ellipsoid=o(e.view.spatialReference)}initialize(){this.addHandles([r(()=>this._boost,e=>{this._passParameters.boost=e,this.requestRender(1)},s),r(()=>this.view.stage.renderView.fog?.strength??0,e=>{this._passParameters.scattering=e,this.requestRender(1)},s)])}precompile(){this._needsEmissionBlur&&this.techniques.precompile(l)}get _atmosphereRadius(){return this._ellipsoid.radius+this._ellipsoid.atmosphereHeight}_renderEmissionMipMap(){const e=this._passParameters.emission?.attachment;if(!e)return;this._drawParameters.input=e,this._drawParameters.inputScale=this.bindParameters.useFloatBlend.value?1:m,this._drawParameters.level=0,a(this._drawParameters.size,1,1);const t=Math.floor(.5*e.descriptor.width),r=Math.floor(.5*e.descriptor.height),s=this.fboCache,i=s.acquire(t,e.descriptor.height,"blur horizontal",8);let o,h=t,n=e.descriptor.height;const d=this.renderingContext,c=this.techniques.get(l),g=d.bindTechnique(c,this.bindParameters,p);for(;h>=1&&n>=1;)this._drawParameters.isHorizontal=!0,this._setupFBO(i,h,n),g.bindDraw(this.bindParameters,p,this._drawParameters),d.screen.draw(),n=Math.floor(.5*n),this._drawParameters.input=i.getTexture(),this._drawParameters.inputScale=1,this._drawParameters.isHorizontal=!1,a(this._drawParameters.size,h/t,n/r),o??=s.acquire(h,n,"blur mipmap",9),this._setupFBO(o,h,n,this._drawParameters.level),g.bindDraw(this.bindParameters,p,this._drawParameters),d.screen.draw(),s.debugCallback?.(o.name,o.fbo),h=Math.floor(.5*h),this._drawParameters.input=o.getTexture(),++this._drawParameters.level;i.release(),o&&(o.fbo.level=0),this._passParameters.mipmapLevels=this._drawParameters.level,this._passParameters.mipmapTexture=o,d.setViewport(0,0,e.descriptor.width,e.descriptor.height)}get _boost(){return 0===this._mode?this._glowBoost.realistic:this._intensity<=.5?t(this._glowBoost.cartographicMin,this._glowBoost.cartographicDefault,2*this._intensity):t(this._glowBoost.cartographicDefault,this._glowBoost.cartographicMax,2*(this._intensity-.5))}get _mode(){return null==this.view.environment.lighting.glow?this.view.environment.atmosphereEnabled?0:2:1}get _hasBlur(){return 2!==this._mode}get _intensity(){return this.view.environment.lighting.glow?.intensity??0}_setupFBO(e,t,r,s=0){e.fbo.level=s;const i=this.renderingContext;i.bindFramebuffer(e.fbo),i.setViewport(0,0,t,r),i.setClearColor(0,0,0,0),i.clear(16384)}};d=e([i("esri.views.3d.webgl-engine.effects.glow.BlurEmission")],d);export{d as BlurEmission};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/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 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};
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,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{Milliseconds as a}from"../../../../../core/time.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as m}from"../../../webgl.js";import{distanceFadeEnd as h,distanceFadeStart as p}from"../../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{AmbientIllumination as c}from"../AmbientIllumination.js";import{g as l}from"../../../../../chunks/SSAO.glsl.js";import{SSAOBlurTechnique as u}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 _}from"../../../../webgl/enums.js";import T from"../../../../webgl/Texture.js";import{TextureDescriptor as P}from"../../../../webgl/TextureDescriptor.js";const S=2;let x=class extends c{constructor(e){super(e),this._enableTime=a(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 T(this.renderingContext,r,e),this.addHandles(s(()=>this._ssaoEnabled,e=>{this._enableTime=a(0),e?this._enable():this._disable()},i))}destroy(){this._passParameters.noiseTexture=t(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),s=t?.getTexture(),i=t?.getTexture(_);if(!s||!i)return;const o=this.techniques.getCompiled(w),c=this.techniques.getCompiled(u);if(!o||!c)return this._enableTime=a(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=a(performance.now()));const d=this.renderingContext,f=this.view.qualitySettings.fadeDuration,b=this.bindParameters,T=b.camera,P=T.relativeElevation,x=r((h-P)/(h-p),0,1),j=f>0?Math.min(f,performance.now()-this._enableTime)/f:1,q=j*x;this._passParameters.normalTexture=s,this._passParameters.depthTexture=i,this._passParameters.projScale=1/T.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*g/l(T)**6*q;const A=T.fullViewport[2],C=T.fullViewport[3],v=this.fboCache.acquire(A,C,"ssao input",2);d.bindFramebuffer(v.fbo),d.setViewport(0,0,A,C),d.bindTechnique(o,b,this._passParameters,this._drawParameters),d.screen.draw();const M=Math.round(A/S),V=Math.round(C/S),O=this.fboCache.acquire(M,V,"ssao blur",0);d.bindFramebuffer(O.fbo),this._drawParameters.colorTexture=v.getTexture(),n(this._drawParameters.blurSize,0,S/C),d.bindTechnique(c,b,this._passParameters,this._drawParameters),d.setViewport(0,0,M,V),d.screen.draw(),v.release();const y=this.fboCache.acquire(M,V,m.AMBIENT_ILLUMINATION,0);return d.bindFramebuffer(y.fbo),d.setViewport(0,0,A,C),d.setClearColor(1,1,1,0),d.clear(16384),this._drawParameters.colorTexture=O.getTexture(),n(this._drawParameters.blurSize,S/A,0),d.bindTechnique(c,b,this._passParameters,this._drawParameters),d.setViewport(0,0,M,V),d.screen.draw(),d.setViewport4fv(T.fullViewport),O.release(),j<1&&this.requestRender(2),y}};x=e([o("esri.views.3d.webgl-engine.effects.ssao.SSAO")],x);const g=.5;export{x as SSAO,S as blurSizePixels};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{fetchAsset as t}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,throwIfAborted as f}from"../../../../../core/promiseUtils.js";import{watch as d,initial as h,syncAndInitial as m}from"../../../../../core/reactiveUtils.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators.js";import{copy as u,rotateZ as l,multiply as p,invertOrIdentity as b}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{squaredLength as _}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{getReferenceEllipsoid as g}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as T}from"../../../webgl.js";import{cloudsHeight as w}from"../../../environment/weather.js";import{glLayout as y}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as P}from"../OpaqueEnvironment.js";import{DeepSkyPassParameters as x,DeepSkyTechnique as v}from"./DeepSkyTechnique.js";import{StarPassParameters as k,StarsTechnique as j,layout as D}from"./StarsTechnique.js";import{getDailyRotationCoefficient as M,computeDayDuration as S,eq2ec as q,ec2eq as L}from"./starsUtils.js";import{createTextureKTX2 as U}from"../../lib/BasisUtil.js";import{VertexArrayObject as A}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as B,PrimitiveType as R}from"../../../../webgl/enums.js";import{TextureDescriptor as E}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as I}from"../../../../webgl/VertexBuffer.js";let C=class extends P{constructor(){super(...arguments),this._numPoints=0,this._passParameters=new k,this._deepSkyPassParameters=new x}initialize(){this.addHandles([d(()=>this.view.environment.starsEnabled,e=>e?this._enable():this._disable(),h),d(()=>"virtual"===this.view.environment.lighting.type?null:this.view.environment.lighting.date,e=>this._update(e),m)])}_enable(){super._enable(),this._bandTextureTask=this._createLoadBandTextureTask(),this._loadDataTask=this._createLoadDataTask()}get loading(){return!!this._loadDataTask&&!this._loadDataTask.finished||!!this._bandTextureTask&&!this._bandTextureTask.finished}destroy(){this._bandTextureTask=i(this._bandTextureTask),this._bandTexture=n(this._bandTexture),this._loadDataTask=i(this._loadDataTask),this._numPoints=0,this._vao=n(this._vao),this._starData=null}render(e){const t=e.find(({name:e})=>e===T.OPAQUE_ENVIRONMENT),s=this.techniques.getCompiled(j),r=this.techniques.getCompiled(v);if(this.loading||!s||!r)return this.requestRender(1),t;const a=this.renderingContext;return this._bandTexture&&(this._deepSkyPassParameters.bandTexture=this._bandTexture,this._deepSkyPassParameters.heightAboveSeaLevelSquared=_(this.bindParameters.camera.eye),a.bindTechnique(r,this.bindParameters,this._deepSkyPassParameters),a.setDrawBuffers([B]),a.screen.draw()),this._starData&&(this._vao??=this._ensureResources(this._starData),a.bindTechnique(s,this.bindParameters,this._passParameters),a.setDrawBuffers([B]),a.bindVAO(this._vao),a.drawArrays(R.POINTS,0,this._numPoints)),t}_ensureResources(e){this._numPoints=e.byteLength/H;const t=new Float32Array(e,0,2*this._numPoints),s=new Uint8Array(e,2*this._numPoints*4,this._numPoints);return O(this.renderingContext,t,s,this._numPoints)}_update(e){const t=g(this.view.spatialReference).radius,s=.03*t;if(this._deepSkyPassParameters.radiusCloseToGround=(t+w)**2,this._deepSkyPassParameters.radiusBrightnessTransitionEnd=(t+w+s)**2,!e)return;const r=M(e),a=2*S(e),i=u(this._passParameters.modelMatrix,q);l(i,i,-a*Math.PI),p(i,L,i),l(i,i,-r*Math.PI),b(this._deepSkyPassParameters.inverseModelMatrix,i),this.requestRender(1)}_createLoadDataTask(){if(this._starData)return null;const e=s(async e=>{const{data:s}=await t(z,{responseType:"array-buffer",signal:e});F(s),this._starData=s});return e.promise.catch(e=>{o(e)||a.getLogger(this).error(e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}_createLoadBandTextureTask(){if(this._bandTexture)return null;const e=s(async e=>{const{data:s}=await t(W,{responseType:"array-buffer",signal:e});f(e);const a=new E;a.wrapMode=33071,a.hasMipmap=!0,a.maxAnisotropy=8;const i=await U(this.renderingContext,a,s);if(e.aborted&&(i?.dispose(),f(e)),!i)throw new r("stars:invalid-band-texture","Failed to transcode Milky Way band texture.");this._bandTexture=i});return e.promise.catch(e=>{o(e)||a.getLogger(this).warn("Failed to load Milky Way band texture.",e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}};function O(e,t,s,r){const a=D.createBuffer(r),i=a.position,n=a.color,o=a.size;for(let f=0;f<r;f++){const e=t[2*f],r=t[2*f+1];i.set(f,0,-Math.cos(e)*Math.sin(r)),i.set(f,1,-Math.sin(e)*Math.sin(r)),i.set(f,2,-Math.cos(r));const a=V(s[f]),d=N(G[a[1]]);n.set(f,0,d[0]),n.set(f,1,d[1]),n.set(f,2,d[2]),n.set(f,3,255),o.set(f,a[0])}return new A(e,new I(e,y(D),a.buffer))}function F(e){if(!e)throw new r("stars:no-data-received","Failed to create stars because star catalogue is missing");const t=e.byteLength/H;if(t%1!=0||t>5e4||t<5e3)throw new r("stars:invalid-data","Failed to create stars because star catalogue data is invalid")}function N(e){return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function V(e){return e>=192?[2.9,e-192]:e>=160?[2.5,e-160]:e>=128?[2,e-128]:e>=96?[1.5,e-96]:e>=64?[1,e-64]:e>=32?[.7,e-32]:[.4,e]}C=e([c("esri.views.3d.webgl-engine.effects.stars.Stars")],C);const z="esri/views/3d/environment/resources/stars.wsv",W="esri/views/3d/environment/resources/milkyway-band.ktx2",G=["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"],H=9;export{C as Stars};
2
+ import{__decorate as e}from"tslib";import{fetchAsset as t}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,throwIfAborted as f}from"../../../../../core/promiseUtils.js";import{watch as d,initial as h,syncAndInitial as m}from"../../../../../core/reactiveUtils.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators.js";import{copy as u,rotateZ as l,multiply as p,invertOrIdentity as b}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{squaredLength as _}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{getReferenceEllipsoid as g}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as T}from"../../../webgl.js";import{cloudsHeight as w}from"../../../environment/weather.js";import{glLayout as y}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as P}from"../OpaqueEnvironment.js";import{DeepSkyPassParameters as x,DeepSkyTechnique as v}from"./DeepSkyTechnique.js";import{StarPassParameters as k,StarsTechnique as j,layout as D}from"./StarsTechnique.js";import{getDailyRotationCoefficient as M,computeDayDuration as S,eq2ec as q,ec2eq as L}from"./starsUtils.js";import{createTextureKTX2 as U}from"../../lib/BasisUtil.js";import{VertexArrayObject as A}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as B,PrimitiveType as R}from"../../../../webgl/enums.js";import{TextureDescriptor as E}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as I}from"../../../../webgl/VertexBuffer.js";let C=class extends P{constructor(){super(...arguments),this._numPoints=0,this._passParameters=new k,this._deepSkyPassParameters=new x}initialize(){this.addHandles([d(()=>this.view.environment.starsEnabled,e=>e?this._enable():this._disable(),h),d(()=>"virtual"===this.view.environment.lighting.type?null:this.view.environment.lighting.date,e=>this._update(e),m)])}_enable(){super._enable(),this._bandTextureTask=this._createLoadBandTextureTask(),this._loadDataTask=this._createLoadDataTask()}get loading(){return!!this._loadDataTask&&!this._loadDataTask.finished||!!this._bandTextureTask&&!this._bandTextureTask.finished}destroy(){this._bandTextureTask=i(this._bandTextureTask),this._bandTexture=n(this._bandTexture),this._loadDataTask=i(this._loadDataTask),this._numPoints=0,this._vao=n(this._vao),this._starData=null}render(e){const t=e.find(({name:e})=>e===T.OPAQUE_ENVIRONMENT),s=this.techniques.getCompiled(j),r=this.techniques.getCompiled(v);if(this.loading||!s||!r)return this.requestRender(1),t;const a=this.renderingContext;return this._bandTexture&&(this._deepSkyPassParameters.bandTexture=this._bandTexture,this._deepSkyPassParameters.heightAboveSeaLevelSquared=_(this.bindParameters.camera.eye),a.bindTechnique(r,this.bindParameters,this._deepSkyPassParameters),a.setDrawBuffers([B]),a.screen.draw()),this._starData&&(this._vao??=this._ensureResources(this._starData),a.bindTechnique(s,this.bindParameters,this._passParameters),a.setDrawBuffers([B]),a.bindVAO(this._vao),a.drawArrays(R.POINTS,0,this._numPoints)),t}_ensureResources(e){this._numPoints=e.byteLength/H;const t=new Float32Array(e,0,2*this._numPoints),s=new Uint8Array(e,2*this._numPoints*4,this._numPoints);return O(this.renderingContext,t,s,this._numPoints)}_update(e){const t=g(this.view.spatialReference).radius,s=.03*t;if(this._deepSkyPassParameters.radiusCloseToGround=(t+w)**2,this._deepSkyPassParameters.radiusBrightnessTransitionEnd=(t+w+s)**2,!e)return;const r=M(e),a=2*S(e),i=u(this._passParameters.modelMatrix,q);l(i,i,-a*Math.PI),p(i,L,i),l(i,i,-r*Math.PI),b(this._deepSkyPassParameters.inverseModelMatrix,i),this.requestRender(1)}_createLoadDataTask(){if(this._starData)return null;const e=s(async e=>{const{data:s}=await t(z,{responseType:"array-buffer",signal:e});F(s),this._starData=s});return e.promise.catch(e=>{o(e)||a.getLogger(this).error(e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}_createLoadBandTextureTask(){if(this._bandTexture)return null;const e=s(async e=>{const{data:s}=await t(W,{responseType:"array-buffer",signal:e});f(e);const a=new E;a.wrapMode=33071,a.maxAnisotropy=8;const i=await U(this.renderingContext,a,s);if(e.aborted&&(i?.dispose(),f(e)),!i)throw new r("stars:invalid-band-texture","Failed to transcode Milky Way band texture.");this._bandTexture=i});return e.promise.catch(e=>{o(e)||a.getLogger(this).warn("Failed to load Milky Way band texture.",e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}};function O(e,t,s,r){const a=D.createBuffer(r),i=a.position,n=a.color,o=a.size;for(let f=0;f<r;f++){const e=t[2*f],r=t[2*f+1];i.set(f,0,-Math.cos(e)*Math.sin(r)),i.set(f,1,-Math.sin(e)*Math.sin(r)),i.set(f,2,-Math.cos(r));const a=V(s[f]),d=N(G[a[1]]);n.set(f,0,d[0]),n.set(f,1,d[1]),n.set(f,2,d[2]),n.set(f,3,255),o.set(f,a[0])}return new A(e,new I(e,y(D),a.buffer))}function F(e){if(!e)throw new r("stars:no-data-received","Failed to create stars because star catalogue is missing");const t=e.byteLength/H;if(t%1!=0||t>5e4||t<5e3)throw new r("stars:invalid-data","Failed to create stars because star catalogue data is invalid")}function N(e){return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function V(e){return e>=192?[2.9,e-192]:e>=160?[2.5,e-160]:e>=128?[2,e-128]:e>=96?[1.5,e-96]:e>=64?[1,e-64]:e>=32?[.7,e-32]:[.4,e]}C=e([c("esri.views.3d.webgl-engine.effects.stars.Stars")],C);const z="esri/views/3d/environment/resources/stars.wsv",W="esri/views/3d/environment/resources/milkyway-band.ktx2",G=["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"],H=9;export{C as Stars};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{releaseMaybe as i}from"../../../../core/maybe.js";import{signal as t}from"../../../../core/signal.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import e from"../../webgl/RenderCamera.js";import{isColor as h}from"../core/shaderLibrary/ShaderOutput.js";import{CloudsParameters as n}from"../effects/clouds/CloudsParameters.js";import{ReprojectionUniforms as r}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as o}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as a}from"../lighting/SceneLighting.js";class l{constructor(i,t){this.width=i,this.height=t}}const g=5e5;class c{constructor(i){this.shadowMap=i,this.output=0,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this._emissions=t(0),this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=t(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.frameRendererTarget=0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this.renderingShadowAnalysisMap=!1,this._camera=t(new e),this._inverseViewport=s(),this._oldLighting=new a,this._newLighting=new a,this._fadedLighting=new a,this._lighting=this._newLighting,this.screenSpaceReflections=new o,this.reprojection=new r,this.highlights=new Array,this.highlightMixOrigin=s(),this.highlightMixTexture=null,this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new n,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=i(this.depth),this.shadowMap?.dispose()}get emissions(){return this._emissions.value}set emissions(i){this._emissions.value=i}get hasEmission(){switch(this.output){case 0:return this.hasOpaqueEmission;case 1:case 2:return this.hasTransparentEmission;default:return!1}}get hasOpaqueEmission(){return 1===this.emissions||3===this.emissions}get hasTransparentEmission(){return 2===this.emissions||3===this.emissions}get hasEmissions(){return 0!==this.emissions}get camera(){return this._camera.value}set camera(i){this._camera.value=i,this._inverseViewport[0]=1/i.fullViewport[2],this._inverseViewport[1]=1/i.fullViewport[3]}get enableOITOffset(){return this.camera.relativeElevation<g}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(i,t,s,e){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=s,this._newLighting.set(i),this._oldLighting.updateLegacy(),1===e&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return h(this.output)&&this.screenSpaceReflections.enabled&&null!=this.reprojection.lastFrameColor}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(i){i&&(i.name="geometry depth"),this._depth=i}get occluder(){return 10===this.slot||11===this.slot?this.slot:null}}export{c as BindParameters,l as ViewportSize};
2
+ import{releaseMaybe as i}from"../../../../core/maybe.js";import{signal as t}from"../../../../core/signal.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import e from"../../webgl/RenderCamera.js";import{isColor as h}from"../core/shaderLibrary/ShaderOutput.js";import{CloudsParameters as n}from"../effects/clouds/CloudsParameters.js";import{ReprojectionUniforms as r}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as o}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as a}from"../lighting/SceneLighting.js";class l{constructor(i,t){this.width=i,this.height=t}}const g=5e5;class c{constructor(i){this.shadowMap=i,this.output=0,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this._emissions=t(0),this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=t(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.frameRendererTarget=0,this.overlayStretch=1,this.viewshedEnabled=!1,this.laserlinesEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this.renderingShadowAnalysisMap=!1,this._camera=t(new e),this._inverseViewport=s(),this._oldLighting=new a,this._newLighting=new a,this._fadedLighting=new a,this._lighting=this._newLighting,this.screenSpaceReflections=new o,this.reprojection=new r,this.highlights=new Array,this.highlightMixOrigin=s(),this.highlightMixTexture=null,this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new n,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=i(this.depth),this.shadowMap?.dispose()}get emissions(){return this._emissions.value}set emissions(i){this._emissions.value=i}get hasEmission(){switch(this.output){case 0:return this.hasOpaqueEmission;case 1:case 2:return this.hasTransparentEmission;default:return!1}}get hasOpaqueEmission(){return 1===this.emissions||3===this.emissions}get hasTransparentEmission(){return 2===this.emissions||3===this.emissions}get hasEmissions(){return 0!==this.emissions}get camera(){return this._camera.value}set camera(i){this._camera.value=i,this._inverseViewport[0]=1/i.fullViewport[2],this._inverseViewport[1]=1/i.fullViewport[3]}get enableOITOffset(){return this.camera.relativeElevation<g}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(i,t,s,e){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=s,this._newLighting.set(i),this._oldLighting.updateLegacy(),1===e&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return h(this.output)&&this.screenSpaceReflections.enabled&&null!=this.reprojection.lastFrameColor}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(i){i&&(i.name="geometry depth"),this._depth=i}get occluder(){return 10===this.slot||11===this.slot?this.slot:null}}export{c as BindParameters,l as ViewportSize};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as s}from"tslib";import{releaseMaybe as e}from"../../../../core/maybe.js";import{watch as t,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{length as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{RenderNodeOutput as m}from"../../webgl.js";import{BlurEmission as n}from"../effects/glow/BlurEmission.js";import{E as p,a as c}from"../../../../chunks/EmissionComposite.glsl.js";import{EmissionCompositeTechnique as h}from"./EmissionCompositeTechnique.js";import{ColorAttachment1 as u,ColorAttachment0 as l}from"../../../webgl/enums.js";let d=class extends n{constructor(){super(...arguments),this.produces=m.COMPOSITE,this.consumes={required:[m.COMPOSITE]},this._configuration=new p,this._passParameters=new c}initialize(){this.addHandles([t(()=>0!==this.bindParameters.emissions,s=>this.produces=s?m.COMPOSITE:"disabled",r)])}precompile(){0!==this.bindParameters.emissions&&(this._configuration.applyBlur=!this.view.stage.renderView.fog?.renders&&this._hasBlur,this._configuration.applyBlur&&super.precompile(),this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value,this.techniques.precompile(h,this._configuration))}render(){const s=this.input,t=s.getAttachment(u);if(!t?.attachment)return s;const r=a(this.bindParameters.camera.eye);this._passParameters.atmosphereC=r**2-this._atmosphereRadius**2,this._passParameters.color=s.getAttachment(l)?.attachment,this._passParameters.emission=t,this._configuration.applyBlur&&this._renderEmissionMipMap();const i=this.renderingContext,o=this.techniques.get(h,this._configuration),m=this.acquireOutputFramebuffer();return i.clear(16384),i.bindTechnique(o,this.bindParameters,this._passParameters),i.screen.draw(),this._passParameters.mipmapTexture=e(this._passParameters.mipmapTexture),m.moveAttachments(s),m}};s([i()],d.prototype,"produces",void 0),s([i()],d.prototype,"consumes",void 0),d=s([o("esri.views.3d.webgl-engine.lib.EmissionComposite")],d);export{d as EmissionComposite};
2
+ import{__decorate as s}from"tslib";import{releaseMaybe as e}from"../../../../core/maybe.js";import{watch as t,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{length as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{RenderNodeOutput as m}from"../../webgl.js";import{BlurEmission as n}from"../effects/glow/BlurEmission.js";import{E as p,a as c}from"../../../../chunks/EmissionComposite.glsl.js";import{EmissionCompositeTechnique as h}from"./EmissionCompositeTechnique.js";import{ColorAttachment1 as u,ColorAttachment0 as l}from"../../../webgl/enums.js";let d=class extends n{constructor(){super(...arguments),this.produces=m.COMPOSITE,this.consumes={required:[m.COMPOSITE]},this._configuration=new p,this._passParameters=new c}initialize(){this.addHandles([t(()=>0!==this.bindParameters.emissions,s=>this.produces=s?m.COMPOSITE:"disabled",r)])}precompile(){0!==this.bindParameters.emissions&&(this._configuration.applyBlur=!this.view.stage.renderView.fog?.renders&&this._hasBlur,super.precompile(),this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value,this.techniques.precompile(h,this._configuration))}get _needsEmissionBlur(){return this._configuration.applyBlur}render(){const s=this.input,t=s.getAttachment(u);if(!t?.attachment)return s;const r=a(this.bindParameters.camera.eye);this._passParameters.atmosphereC=r**2-this._atmosphereRadius**2,this._passParameters.color=s.getAttachment(l)?.attachment,this._passParameters.emission=t,this._configuration.applyBlur&&this._renderEmissionMipMap();const i=this.renderingContext,o=this.techniques.get(h,this._configuration),m=this.acquireOutputFramebuffer();return i.clear(16384),i.bindTechnique(o,this.bindParameters,this._passParameters),i.screen.draw(),this._passParameters.mipmapTexture=e(this._passParameters.mipmapTexture),m.moveAttachments(s),m}};s([i()],d.prototype,"produces",void 0),s([i()],d.prototype,"consumes",void 0),d=s([o("esri.views.3d.webgl-engine.lib.EmissionComposite")],d);export{d as EmissionComposite};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as i,subclass as t}from"../../../../core/accessorSupport/decorators.js";import{InternalRenderCategory as r}from"../../webgl.js";import s from"../../webgl/RenderNode.js";import{prepareGaussianSplatPerspectiveParameters as a,canRenderGaussianSplats as n}from"./GaussianSplatRenderUtils.js";import{GaussianSplatDepthTechnique as o}from"../shaders/GaussianSplatDepthTechnique.js";import{GaussianSplatPassParameters as l}from"../shaders/GaussianSplatPassParameters.js";import{GaussianSplatTechniqueConfiguration as d}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{PrimitiveType as p}from"../../../webgl/enums.js";let h=class extends s{constructor(e){super(e),this.consumes={required:[r.GAUSSIAN_SPLAT_DEPTH]},this.produces=r.GAUSSIAN_SPLAT_DEPTH,this.layerView=null,this._passParameters=new l,this._configuration=new d(e.view.state.isGlobal)}precompile(){this._canRender&&(this._updateConfiguration(),this.techniques.precompile(o,this._configuration))}render(){const e=this.bindRenderTarget();if(this.layerView.fadeHelper.updateForFrame(this.view.stage.renderView.renderer.renderContext.time),!this._canRender)return e;this._updateConfiguration(),a(this._passParameters,this.layerView,this.bindParameters.camera);const i=this.techniques.get(o,this._configuration);return this.renderingContext.bindTechnique(i,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(p.TRIANGLE_STRIP,0,4,this.layerView.data.visibleGaussians),e}get _canRender(){return n(this.layerView.data)}_updateConfiguration(){this._configuration.fadingEnabled=this.layerView.fadeHelper.fadingEnabled,this._configuration.clippingEnabled=null!=this.layerView.clippingBox,this._configuration.hasSlicePlane=this.layerView.slicePlaneEnabled&&null!=this.bindParameters.slicePlane,this._configuration.writeNormals=4===this.bindParameters.output}};e([i()],h.prototype,"consumes",void 0),e([i()],h.prototype,"produces",void 0),e([i({constructOnly:!0})],h.prototype,"layerView",void 0),h=e([t("esri.views.3d.webgl-engine.lib.GaussianSplatDepthRenderer")],h);export{h as GaussianSplatDepthRenderer};
2
+ import{__decorate as e}from"tslib";import{property as i,subclass as t}from"../../../../core/accessorSupport/decorators.js";import{InternalRenderCategory as r}from"../../webgl.js";import s from"../../webgl/RenderNode.js";import{prepareGaussianSplatPerspectiveParameters as a,canRenderGaussianSplats as n}from"./GaussianSplatRenderUtils.js";import{GaussianSplatDepthTechnique as o}from"../shaders/GaussianSplatDepthTechnique.js";import{GaussianSplatPassParameters as l}from"../shaders/GaussianSplatPassParameters.js";import{GaussianSplatTechniqueConfiguration as d}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{PrimitiveType as h}from"../../../webgl/enums.js";let p=class extends s{constructor(e){super(e),this.consumes={required:[r.GAUSSIAN_SPLAT_DEPTH]},this.produces=r.GAUSSIAN_SPLAT_DEPTH,this.layerView=null,this._passParameters=new l,this._configuration=new d(e.view.state.isGlobal)}precompile(){this._canRender&&(this._updateConfiguration(),this.techniques.precompile(o,this._configuration))}render(){const e=this.bindRenderTarget();if(this.layerView.fadeHelper.updateForFrame(this.view.stage.renderView.renderer.renderContext.time),!this._canRender)return e;this._updateConfiguration(),a(this._passParameters,this.layerView,this.bindParameters.camera);const i=this.techniques.get(o,this._configuration);return this.renderingContext.bindTechnique(i,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(h.TRIANGLE_STRIP,0,4,this.layerView.data.visibleGaussians),e}get _canRender(){return n(this.layerView.data)}_updateConfiguration(){this._configuration.preciseDepth=this.bindParameters.laserlinesEnabled,this._configuration.fadingEnabled=this.layerView.fadeHelper.fadingEnabled,this._configuration.clippingEnabled=null!=this.layerView.clippingBox,this._configuration.hasSlicePlane=this.layerView.slicePlaneEnabled&&null!=this.bindParameters.slicePlane,this._configuration.writeNormals=4===this.bindParameters.output}};e([i()],p.prototype,"consumes",void 0),e([i()],p.prototype,"produces",void 0),e([i({constructOnly:!0})],p.prototype,"layerView",void 0),p=e([t("esri.views.3d.webgl-engine.lib.GaussianSplatDepthRenderer")],p);export{p as GaussianSplatDepthRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../../../core/has.js";import{NestedMap as e}from"../../../../core/NestedMap.js";function t(t){const r=new e,n=has("enable-feature:global-illumination");if(r.set(2,4,!0),r.set(2,0,!0),r.set(2,2,!0),r.set(2,1,!0),r.set(2,8,!0),r.set(2,3,!0),n&&(r.set(2,10,!0),r.set(0,3,!0),r.set(1,3,!0)),"low"!==t&&(r.set(2,5,!0),r.set(2,6,!0)),"medium"===t)for(const e of s)r.set(0,e,!0),r.set(1,e,!0),r.set(2,e,!0);else if("high"===t)for(const e of o)r.set(0,e,!0),r.set(1,e,!0),r.set(2,e,!0);return r}const s=[9,7],o=[...s,3,10,0,2,4];export{t as setupFeatureDefaults};
2
+ import has from"../../../../core/has.js";import{NestedMap as e}from"../../../../core/NestedMap.js";function t(t){const i=new e;if(i.set(2,4,!0),i.set(2,0,!0),i.set(2,2,!0),i.set(2,1,!0),i.set(2,8,!0),"high"!==t&&i.set(2,3,!0),"low"!==t&&(i.set(2,5,!0),i.set(2,6,!0)),"medium"===t)for(const e of s)i.set(0,e,!0),i.set(1,e,!0),i.set(2,e,!0);else if("high"===t){const e=has("disable-feature:global-illumination")?3:11;for(const t of[...o,e])i.set(0,t,!0),i.set(1,t,!0),i.set(2,t,!0);11===e&&i.set(2,10,!0)}return i}const s=[9,7],o=[...s,0,2,4];export{t as setupFeatureDefaults};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as u,sync as _}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as b,invert as f,multiply as g,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as A,create as I}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as w}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as E,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as S}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as T,InternalRenderCategory as D,AllRenderNodeOutputs as O,AllInternalRenderNodeOutputs as R}from"../../webgl.js";import{minNearDistanceInMeters as N}from"../../state/NearFarHeuristic.js";import{debugFlags as F}from"../../support/debugFlags.js";import{FBOCache as G}from"../core/FBOCache.js";import{RenderPassManager as H}from"../core/renderPasses/RenderPassManager.js";import{isColor as x}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as y}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as v}from"../effects/RenderNodes.js";import{RenderPluginManager as M}from"../effects/RenderPluginManager.js";import{WeatherFader as L}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as U}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as q}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as j,renderHighlightBuffer as B}from"../effects/highlight/Highlight.js";import{OITBlend as V}from"../effects/transparency/OITBlend.js";import{AnimationTimer as k}from"./AnimationTimer.js";import{AnimationTimeStep as W}from"./AnimationTimeStep.js";import{BoundingInfo as Q}from"./BoundingInfo.js";import{Compositor as z}from"./Compositor.js";import{DepthRange as Y}from"./DepthRange.js";import{depthRangeFromScene as K}from"./depthRangeUtils.js";import{MainFramebuffer as J}from"./MainFramebuffer.js";import{NavigationDepthCache as X}from"./NavigationDepthCache.js";import{blendingColorAlphaClear as $}from"./OrderIndependentTransparency.js";import{RenderContext as Z,defaultRenderOccludedMask as ee}from"./RenderContext.js";import{RendererBase as te}from"./RendererBase.js";import{setupFeatureDefaults as se}from"./RenderFeature.js";import{RenderPluginInput as ie}from"./RenderPluginInput.js";import{ShadowMap as re}from"./ShadowMap.js";import ae from"./SliceHelper.js";import{MergedRenderer as ne}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as he}from"../parts/renderUtils.js";import{RendererPerformanceInfo as oe,PerformanceCategory as de}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as le,PixelType as ue,ColorAttachment0 as _e,ColorAttachment2 as me,DrawBufferNone as pe}from"../../../webgl/enums.js";const ce=has("disable-feature:async-navigation-3d-depth-readback");let be=class extends te{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new H,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=E(0,0,0,1),this._sliceHelper=new ae,this._shadowAccumulator=null,this._shadowCastOptions=null,this.sceneDepthRange=m(Y.Infinite),this._state=m(2),this._hasGlobalIlluminationFlag=!!has("enable-feature:global-illumination"),this._hasAnimations=!1,this._animationTimestep=new W,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new ie,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of Oe)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new G(i),this._compositor=new z(i,s),this._renderStateFeatures=m(se(e.view.qualityProfile));const a=new re(this._fboCache,e.viewingMode);this._renderContext=new Z(this._rctx,a,s),this._framebuffer=new J(this._fboCache,this._bindParameters),this._performanceInfo=new oe(this._rctx),this._blit=new q(s),this.navigationDepthCache=new X(this._rctx,this._fboCache,s,()=>this._requestRender(0)),this._nodes=new v(this._renderContext),this._plugins=new M({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new L({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>F.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},u),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;w(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.environmentManager.shadowsAvailable,e=>{this._bindParameters.shadowMap.enabled=e,this._requestRender(1)},l),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=y,l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},_),d(()=>this._bindParameters.clouds.data?.state,()=>r(),_),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},u),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator=null,this._shadowCastOptions=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.navigationDepthCache.destroy(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,Q.prune(),ne.prune(),S()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new V(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=se(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this.isFeatureEnabled(e,t)!==s&&(this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender())}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this.isFeatureEnabled(3)&&!this._inGlobeView}get hasGlobalIllumination(){return this._hasGlobalIlluminationFlag&&this.hasAmbientIllumination}get hasGlobalIlluminationHighQuality(){return this.hasGlobalIllumination&&this.isFeatureEnabled(10)}get _keepGlobalIlluminationShadingAlive(){return this._hasGlobalIlluminationFlag&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _emissions(){const e=this._plugins.emissions;return this._hasTransparentGeometry?e:1===e||3===e?1:0}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}setShadowAccumulator(e){this._shadowAccumulator=e,this._shadowCastOptions&&e.setParameters(this._shadowCastOptions)}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await(import("./edgeRendering/EdgeView.js"));o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:He(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),_)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView().catch(()=>{}),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.reprojection.matrix,A)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&(this._shadowCastOptions={...this._shadowCastOptions,...e.shadowCast},this._shadowAccumulator?.setParameters(e.shadowCast))}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}addRenderer(e){this._plugins.add(e)}removeRenderer(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...Ee),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new k(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,s=!1){try{return this._isRendering=!0,this._render(e,t,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new he(this._pluginInput.get(T.FINAL),null)}_render(e,t,s){const i=0===t;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:r,contentCamera:a,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.frameRendererTarget=t,this._bindParameters.output=0,this._bindParameters.emissions=this._emissions,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(D.VIEWSHED),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(D.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(D.CUTFILL),this._ensureBindParameters(r,a),this._plugins.sortTestsTransparentOrderedSlots(Se),this._plugins.prepareRender(),this._hasTransparentGeometry=this._plugins.produces(1,...ge),this._renderOverlay(),r.setGLViewport(this._rctx);const u=this._framebuffer,_=u.initialize(r.fullWidth,r.fullHeight,this._backgroundColor),m=this._needsLastFrameColor;m?(_?.retain(m-1),_?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor?.release(),this._bindParameters.reprojection.lastFrameColor=_):_?.release(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!s,this._precompilePrepasses(),this.performanceInfo.advance(de.PREPARE);const p=this._computeShadowDepthRange(r);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(r,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p),u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._precompileShaders(i),this._bindParameters.output=0,this._renderOpaque(),this._renderPreTransparent(),this._renderTransparent(),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor)),this._bindParameters.shadowMap.disposeOutput(5),u.update(e=>this._renderNodes(D.CUTFILL_COMPUTATION,e)),this._pluginInput.set(D.FOCUSAREA_MASK,this._renderFocusAreaMask()),u.update(e=>this._renderNodes(D.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(D.VIEWSHED,e)),u.update(e=>this._renderNodes(D.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),u.update(e=>this._renderNodes(D.FOCUSAREA,e)),this._pluginInput.release(D.FOCUSAREA_MASK),u.update(e=>this._renderNodes(D.CUTFILL,e)),this._pluginInput.release(D.GROUND_DEPTH),u.update(e=>this._renderNodes(D.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===t?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(T.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),u.update(e=>this._renderNodes(D.ANTIALIASING,e));const b=this._hasTransparentGeometry?2:1,f=this._bindParameters.emissions;let g;return this._bindParameters.emissions=0,this._hasHUDHighlights&&u.update(e=>this._renderHUD(b,e)),u.update(e=>this._renderNodes(D.HIGHLIGHT,e)),this._hasHUDHighlights||u.update(e=>this._renderHUD(b,e)),this._bindParameters.emissions=f,u.update(e=>this._renderNodes(D.MAGNIFIER,e)),u.update(e=>this._renderNodes(T.FINAL,e)),i&&(this._blit.toFramebuffer(u.color,this._bindParameters),ce||2!==o&&0!==o||this.navigationDepthCache.update(this._bindParameters,u.depth.attachment,this._renderContext.time)),this._bindParameters.reprojection.lastFrameDepth?.release(),this._bindParameters.reprojection.lastFrameEmission?.release(),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth?.release(),this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth,0!==this._emissions&&(this._bindParameters.reprojection.lastFrameEmission?.release(),this._bindParameters.reprojection.lastFrameEmission=u.color.obtainAttachment(le))),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),u.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(g=u.color,g.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new he(g,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling;const t=this._bindParameters;t.output=0;const s=t.emissions;if(this._precompileOpaqueGeometry(),this._nodes.precompile(D.OPAQUE_ENVIRONMENT,D.GAUSSIAN_SPLAT,D.OPAQUE_OCCLUSION_QUERY,D.VOXEL),this._precompileOpaqueGeometry(),t.output=3,this._plugins.precompile(...Pe),t.output=0,this._plugins.precompile(...Pe),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(t,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(t,!1,1),this._precompileTransparentGeometry(),t.hasTransparentEmission&&(t.emissions=3)}this._nodes.precompile(D.FOCUSAREA_MASK),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,t),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(D.TRANSPARENT_ENVIRONMENT,D.VIEWSHED,D.CUTFILL_COMPUTATION,D.CUTFILL,D.LASERLINES,D.FOCUSAREA,D.OCCLUDED,D.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=s,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(D.HIGHLIGHT)),t.highlightMixTexture=null,this._nodes.precompile(T.COMPOSITE,D.MAGNIFIER),this._nodes.precompile(D.TRANSPARENT_NO_DEPTH),this._plugins.precompile(8),t.hasOpaqueEmission&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaMask(){const e=this._nodes.produce(D.FOCUSAREA_MASK,this._pluginInput);return e&&this.performanceInfo.advance(de.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces(D.OBJECT_AND_LAYER_ID_COLOR))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,D.OBJECT_AND_LAYER_ID_COLOR).acquireDepth(14);return i=this._renderNodes(D.OBJECT_AND_LAYER_ID_COLOR,i),--this._techniques.precompiling,this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e,i=s?this.performanceInfo.elapsedTime:0;if(s||t){let e=0;t?e=this.performanceInfo.totalGPUTimeSampler.last:(this._rctx.gl.finish(),e=this.performanceInfo.elapsedTime);const r=Math.max(i,e);this._animationTimestep.frame(r,s)}}readAccumulatedShadow(e){return this._shadowAccumulator?.readAccumulatedShadow(e[0],e[1])??0}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(C),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,ue.UNSIGNED_BYTE,t),r.release()}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?de.OPAQUE_EDGES:de.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(de.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(D.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(D.SHADOWMAP)}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output,i=6!==e;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e),i&&this._renderShadowNodes(t.renderTarget);t.finish(e),this._bindParameters.output=s}_renderShadowNodes(e){this._renderInternalNodeCategory(D.SHADOWMAP,e)}get _needsLastFrameColor(){return+this.hasReflections+ +this.hasGlobalIllumination}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._testsNeedsDepth+ +this._needsShadowHighlight}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(D.AMBIENT_ILLUMINATION,this._hasGlobalIlluminationFlag?this._renderGlobalIllumination():this._renderSSAO());const t=this._needsDepth;if(t){const s=e.obtainAttachment(_e);this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),e.attachColor(s,_e),s?.release(),this.performanceInfo.advance(de.DEPTH)}else e.detachDepth();this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._hasGlobalIlluminationFlag&&(this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._renderGaussianSplatPrepassDepth(i),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(de.DEPTH)}_renderGaussianSplatPrepassDepth(e){const t=this._shadowAccumulator;if(!t?.active||!t.requireGeometryDepth)return;const s=this._bindParameters.output;this._bindParameters.output=3,this._renderInternalNodeCategory(D.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=s}_renderGaussianSplatDepthAndNormals(e){const t=this._bindParameters.output;this._bindParameters.output=4,this._renderInternalNodeCategory(D.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=t}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||!!this._shadowAccumulator?.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Y.Zero;const t=K(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.union(this._nodes.queryDepthRange(D.SHADOWMAP,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Y.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<U)return void(this.sceneDepthRange.value=Y.Infinite);const t=e.clone();t.near=N,t.far=1e10;const s=K(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...O,D.VIEWSHED,D.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){const e=!!this._normalsRequired;if(e?(this._precompilePlugins(4,Ae),this._needsDepth&&this._precompilePlugins(3,Ie)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(D.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator?.active&&(this._nodes.precompile(D.SHADOW_ACCUMULATION),this._precompileAllGeometry(5)),this._shadowAccumulator?.active||e){const t=this._bindParameters.output;this._bindParameters.output=e?4:3,this._nodes.precompile(D.GAUSSIAN_SPLAT_DEPTH),this._bindParameters.output=t}(this.shadowsEnabled||this._shadowAccumulator?.active)&&this._nodes.precompile(D.SHADOWMAP),this.hasAmbientIllumination&&e&&this._nodes.precompile(D.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals");i.acquireDepth(14),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...Ae),this._renderGaussianSplatDepthAndNormals(i);const r=this._nodes.optional("normals",...O,D.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(de.NORMALS),i}_renderSSAO(){this._bindParameters.globalIlluminationEnabled=!1;const e=this._pluginInput.get("normals");return this.hasAmbientIllumination&&e?(this._bindParameters.ssao=this._nodes.produce(D.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(de.AMBIENT_ILLUMINATION),this._bindParameters.ssao):null}_renderGlobalIllumination(){const e=this._bindParameters;if(!this.hasGlobalIllumination)return this._releaseGlobalIlluminationBuffers(),e.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive,null;const t=this._nodes.produce(D.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIllumination=t,this._bindParameters.globalIlluminationEnabled=!0,this.performanceInfo.advance(this.hasGlobalIlluminationHighQuality?de.AMBIENT_ILLUMINATION_HIGH_QUALITY:de.AMBIENT_ILLUMINATION),e.globalIllumination}_releaseGlobalIlluminationBuffers(){const e=this._bindParameters;e.reprojection.lastFrameColor=h(e.reprojection.lastFrameColor),e.reprojection.lastFrameDepth=n(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=n(e.reprojection.lastFrameEmission),e.globalIllumination=h(e.globalIllumination),e.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...Pe),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...we);this._renderContext.renderOccludedMask=ee}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...we),this._renderContext.renderOccludedMask=ee}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Te[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){const e=this._bindParameters.output;this._bindParameters.output=8,this._precompileAllGeometry(8),this._nodes.precompile(D.SHADOWMAP),this._bindParameters.output=e}precompileCutFillDepth(){this._precompilePlugins(9,De)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e,t){const{camera:s,contentCamera:i}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._renderShadowNodes(t),this._ensureBindParametersCamera(s,i),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=r}renderCutFillDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...De),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,D.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Ie)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...fe),this._nodes.precompile("opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...fe)}_renderTransparentGeometry(){this._plugins.render(...ge),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...Pe)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle,i=this._bindParameters.emissions;this._bindParameters.emissions=0,this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...Ee),this._bindParameters.output=2,this._plugins.precompile(...Ee),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...Ee)),this._bindParameters.emissions=i,this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(le);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?de.HUD_OCCLUDED:de.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>j?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(14);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),B(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(de.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...R)+this._nodes.optional("highlights",...R)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ce),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e){const t=this._shadowAccumulator;if(!t)return;t.updateDepthRange(e);const s=t.requireGeometryDepth;this._bindParameters.output=0;const i=this._nodes.produce(D.SHADOW_ACCUMULATION,this._pluginInput);t.didAccumulate&&this.performanceInfo.advance(de.ACCUMULATED_SHADOWS),this._pluginInput.set(D.SHADOW_ACCUMULATION,null),i?.release(),s&&(this._bindParameters.depth=h(this._bindParameters.depth))}renderShadowAccumulationShadowMap(e,t,s,i,r){const a=this.stage.view.qualitySettings.maximumPixelRatio;this._bindParameters.renderingShadowAnalysisMap=!0;try{s.start(e,i,r,!0,a),this._renderShadowCascades(5,s),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t)}finally{this._bindParameters.renderingShadowAnalysisMap=!1}}_precompileTransparentGeometry(){x(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...ge),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...ge),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...ge)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",u=this.fboCache.acquire(i,r,l,o).acquireColor(le,this.hasFloatBlend?7:0,"oit alpha"),_=h.hasEmission&&(0===e||1!==t);_&&u.acquireColor(me,o,"oit emissive"),s||u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer($),_&&this._rctx.clearBuffer(2,$),a(),u.detachDepth(),h.output=2;const m=this.fboCache.acquire(i,r,s?"oit front hud":"oit front");_&&m.acquireColor(le,o,"oit front emissive"),s?m.acquireDepth(this._hudDepthFormat):m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer(C,s),a(),m.detachDepth();const p=this._pluginsHas.occludedHudElements&&!s,c=p&&0!==h.emissions?me:le;let b;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(b=this.fboCache.acquire(i,r,"oit composite hud"),this._rctx.bindFramebuffer(b.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(0!==h.emissions&&this._framebuffer.ensureEmissionAttachment(),p&&(this._framebuffer.color.acquireColor(c,0,"hud occlusion"),this._rctx.clearBuffer(c-_e,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,u,m,h,p,e,this._fboCache.debugCallback),b?.detachDepth(),s||(_&&(this._bindParameters.emissions=3),p&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(c))),m.release(),u.release(),h.output=d,b}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...fe)||this.plugins.produces(5,...fe)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(D.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(T.OPAQUE,t,e)),this.fboCache.debugCallback?.(T.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(D.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(D.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(D.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(D.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(D.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(D.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(D.VOXEL,e)),this.fboCache.debugCallback?.(D.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;if(this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(T.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(T.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),e.update(e=>this._renderNodes(D.TRANSPARENT_NO_DEPTH,e)),this.fboCache.debugCallback?.(D.TRANSPARENT_NO_DEPTH,e.color.fbo),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){const e=this._rctx.setDrawBuffers([pe,le]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),this._fboCache.debugCallback?.(e,i.fbo),i}_renderInternalNodeCategory(e,t){if(!t)return;const s=t.name;try{this._renderNodes(e,t)}finally{this._pluginInput.set(e,null),t.setName(s)}}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration,this.stage.view.state.stationary),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){const{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=A);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(f(Ne,t.viewMatrix),f(Re,t.projectionMatrix),g(Fe,Ne,Re),g(Fe,s.viewMatrix,Fe),g(Fe,s.projectionMatrix,Fe),this._reprojectionMatrix=Fe):this._reprojectionMatrix=A,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(g(Ge,s.viewMatrix,Ne),P(t,Ge)):P(t,A)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p()],be.prototype,"_inGlobeView",void 0),e([p({readOnly:!0})],be.prototype,"highResolutionAtmosphere",null),e([p()],be.prototype,"_edgeView",void 0),e([p()],be.prototype,"updating",null),be=e([c("esri.views.3d.webgl-engine.lib.Renderer")],be);const fe=[0,1,2,3],ge=[7,6,4,5],Pe=[7,6],Ae=[0,1,2,4,...Pe],Ie=[3,5],we=[2,4,8],Ee=[16,12,14,13],Ce=[4,5,2,3,0,1,...Pe],Se=[4,8,5,11],Te={0:[13],1:[12],2:[13,12],3:[13,12]},De=[0,1,...Pe],Oe=["normals","highlights"],Re=I(),Ne=I(),Fe=I(),Ge=I();function He(e){return t=>e.immediate.schedule(t)}export{be as Renderer};
2
+ import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as u,sync as _}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as f,invert as g,multiply as b,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as A,create as I}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as w}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as E,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as T}from"../../../../geometry/support/Indices.js";import{InternalRenderCategory as S,RenderNodeOutput as D,AllRenderNodeOutputs as R,AllInternalRenderNodeOutputs as N}from"../../webgl.js";import{minNearDistanceInMeters as O}from"../../state/NearFarHeuristic.js";import{debugFlags as H}from"../../support/debugFlags.js";import{FBOCache as F}from"../core/FBOCache.js";import{RenderPassManager as x}from"../core/renderPasses/RenderPassManager.js";import{isColor as y}from"../core/shaderLibrary/ShaderOutput.js";import{RenderNodes as G}from"../effects/RenderNodes.js";import{RenderPluginManager as M}from"../effects/RenderPluginManager.js";import{WeatherFader as v}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as L}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as q,renderHighlightBuffer as j}from"../effects/highlight/Highlight.js";import{OITBlend as B}from"../effects/transparency/OITBlend.js";import{AnimationTimer as V}from"./AnimationTimer.js";import{AnimationTimeStep as k}from"./AnimationTimeStep.js";import{BoundingInfo as W}from"./BoundingInfo.js";import{Compositor as Q}from"./Compositor.js";import{DepthRange as z}from"./DepthRange.js";import{depthRangeFromScene as Y}from"./depthRangeUtils.js";import{MainFramebuffer as K}from"./MainFramebuffer.js";import{NavigationDepthCache as J}from"./NavigationDepthCache.js";import{blendingColorAlphaClear as X}from"./OrderIndependentTransparency.js";import{RenderContext as $,defaultRenderOccludedMask as Z}from"./RenderContext.js";import{RendererBase as ee}from"./RendererBase.js";import{setupFeatureDefaults as te}from"./RenderFeature.js";import{RenderPluginInput as se}from"./RenderPluginInput.js";import{ShadowMap as ie}from"./ShadowMap.js";import re from"./SliceHelper.js";import{MergedRenderer as ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ne}from"../parts/renderUtils.js";import{RendererPerformanceInfo as he,PerformanceCategory as oe}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as de,PixelType as le,ColorAttachment0 as ue,ColorAttachment2 as _e,DrawBufferNone as me}from"../../../webgl/enums.js";const pe=has("disable-feature:async-navigation-3d-depth-readback");let ce=class extends ee{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new x,this._isRendering=!1,this._backgroundColor=E(0,0,0,1),this._sliceHelper=new re,this._shadowAccumulator=null,this._shadowCastOptions=null,this.sceneDepthRange=m(z.Infinite),this._state=m(2),this._hasAnimations=!1,this._animationTimestep=new k,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new se,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of De)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new F(i),this._compositor=new Q(i,s),this._renderStateFeatures=m(te(e.view.qualityProfile));const a=new ie(this._fboCache,e.viewingMode);this._renderContext=new $(this._rctx,a,s),this._framebuffer=new K(this._fboCache,this._bindParameters),this._performanceInfo=new he(this._rctx),this._blit=new U(s),this.navigationDepthCache=new J(this._rctx,this._fboCache,s,()=>this._requestRender(0)),this._nodes=new G(this._renderContext),this._plugins=new M({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new v({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>H.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},u),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;w(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.environmentManager.shadowsAvailable,e=>{this._bindParameters.shadowMap.enabled=e,this._requestRender(1)},l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},_),d(()=>this._bindParameters.clouds.data?.state,()=>r(),_),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},u),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator=null,this._shadowCastOptions=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.navigationDepthCache.destroy(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,W.prune(),ae.prune(),T()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new B(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=te(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this.isFeatureEnabled(e,t)!==s&&(this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender())}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this._nodes.produces(S.AMBIENT_ILLUMINATION)}get hasGlobalIllumination(){return this.stage.renderView?.globalIllumination?.enabled??!1}get hasGlobalIlluminationHighQuality(){const e=this.stage.renderView?.globalIllumination;return this.hasGlobalIllumination&&!0===e?.hasHighQuality}get hasSMAA(){return this.isFeatureEnabled(0)}get _emissions(){const e=this._plugins.emissions;return this._hasTransparentGeometry?e:1===e||3===e?1:0}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}setShadowAccumulator(e){this._shadowAccumulator=e,this._shadowCastOptions&&e.setParameters(this._shadowCastOptions)}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await(import("./edgeRendering/EdgeView.js"));o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Fe(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),_)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView().catch(()=>{}),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&f(this._bindParameters.reprojection.matrix,A)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&(this._shadowCastOptions={...this._shadowCastOptions,...e.shadowCast},this._shadowAccumulator?.setParameters(e.shadowCast))}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}addRenderer(e){this._plugins.add(e)}removeRenderer(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...we),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new V(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,s=!1){try{return this._isRendering=!0,this._render(e,t,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new ne(this._pluginInput.get(D.FINAL),null)}_render(e,t,s){const i=0===t;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:r,contentCamera:a,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.frameRendererTarget=t,this._bindParameters.output=0,this._bindParameters.emissions=this._emissions,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(S.VIEWSHED),this._bindParameters.laserlinesEnabled=this._nodes.produces(S.LASERLINES),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(S.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(S.CUTFILL),this._ensureBindParameters(r,a),this._plugins.sortTestsTransparentOrderedSlots(Ce),this._plugins.prepareRender(),this._hasTransparentGeometry=this._plugins.produces(1,...ge),this._renderOverlay(),r.setGLViewport(this._rctx);const u=this._framebuffer,_=u.initialize(r.fullWidth,r.fullHeight,this._backgroundColor),m=this._needsLastFrameColor;m?(_?.retain(m-1),_?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor?.release(),this._bindParameters.reprojection.lastFrameColor=_):_?.release(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!s,this._precompilePrepasses(),this.performanceInfo.advance(oe.PREPARE);const p=this._computeShadowDepthRange(r);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(r,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p),u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._precompileShaders(i),this._bindParameters.output=0,this._renderOpaque(),this._renderPreTransparent(),this._renderTransparent(),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor)),this._bindParameters.shadowMap.disposeOutput(5),u.update(e=>this._renderNodes(S.CUTFILL_COMPUTATION,e)),this._pluginInput.set(S.FOCUSAREA_MASK,this._renderFocusAreaMask()),u.update(e=>this._renderNodes(S.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(S.VIEWSHED,e)),u.update(e=>this._renderNodes(S.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),u.update(e=>this._renderNodes(S.FOCUSAREA,e)),this._pluginInput.release(S.FOCUSAREA_MASK),u.update(e=>this._renderNodes(S.CUTFILL,e)),this._pluginInput.release(S.GROUND_DEPTH),u.update(e=>this._renderNodes(S.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===t?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(D.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),u.update(e=>this._renderNodes(S.ANTIALIASING,e));const f=this._hasTransparentGeometry?2:1,g=this._bindParameters.emissions;let b;return this._bindParameters.emissions=0,this._hasHUDHighlights&&u.update(e=>this._renderHUD(f,e)),u.update(e=>this._renderNodes(S.HIGHLIGHT,e)),this._hasHUDHighlights||u.update(e=>this._renderHUD(f,e)),this._bindParameters.emissions=g,u.update(e=>this._renderNodes(S.MAGNIFIER,e)),u.update(e=>this._renderNodes(D.FINAL,e)),i&&(this._blit.toFramebuffer(u.color,this._bindParameters),pe||2!==o&&0!==o||this.navigationDepthCache.update(this._bindParameters,u.depth.attachment,this._renderContext.time)),this._bindParameters.reprojection.lastFrameDepth?.release(),this._bindParameters.reprojection.lastFrameEmission?.release(),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth?.release(),this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth,0!==this._emissions&&(this._bindParameters.reprojection.lastFrameEmission?.release(),this._bindParameters.reprojection.lastFrameEmission=u.color.obtainAttachment(de))),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),u.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(b=u.color,b.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new ne(b,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling;const t=this._bindParameters;t.output=0;const s=t.emissions;if(this._precompileOpaqueGeometry(),this._nodes.precompile(S.OPAQUE_ENVIRONMENT,S.GAUSSIAN_SPLAT,S.OPAQUE_OCCLUSION_QUERY,S.VOXEL),this._precompileOpaqueGeometry(),t.output=3,this._plugins.precompile(...be),t.output=0,this._plugins.precompile(...be),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(t,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(t,!1,1),this._precompileTransparentGeometry(),t.hasTransparentEmission&&(t.emissions=3)}this._nodes.precompile(S.FOCUSAREA_MASK),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,t),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(S.TRANSPARENT_ENVIRONMENT,S.VIEWSHED,S.CUTFILL_COMPUTATION,S.CUTFILL,S.LASERLINES,S.FOCUSAREA,S.OCCLUDED,S.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=s,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(S.HIGHLIGHT)),t.highlightMixTexture=null,this._nodes.precompile(D.COMPOSITE,S.MAGNIFIER),this._nodes.precompile(S.TRANSPARENT_NO_DEPTH),this._plugins.precompile(8),t.hasOpaqueEmission&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaMask(){const e=this._nodes.produce(S.FOCUSAREA_MASK,this._pluginInput);return e&&this.performanceInfo.advance(oe.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces(S.OBJECT_AND_LAYER_ID_COLOR))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,S.OBJECT_AND_LAYER_ID_COLOR).acquireDepth(14);return i=this._renderNodes(S.OBJECT_AND_LAYER_ID_COLOR,i),--this._techniques.precompiling,this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e,i=s?this.performanceInfo.elapsedTime:0;if(s||t){let e=0;t?e=this.performanceInfo.totalGPUTimeSampler.last:(this._rctx.gl.finish(),e=this.performanceInfo.elapsedTime);const r=Math.max(i,e);this._animationTimestep.frame(r,s)}}readAccumulatedShadow(e){return this._shadowAccumulator?.readAccumulatedShadow(e[0],e[1])??0}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(C),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,le.UNSIGNED_BYTE,t),r.release()}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?oe.OPAQUE_EDGES:oe.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(oe.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(S.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(S.SHADOWMAP)}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output,i=6!==e;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e),i&&this._renderShadowNodes(t.renderTarget);t.finish(e),this._bindParameters.output=s}_renderShadowNodes(e){this._renderInternalNodeCategory(S.SHADOWMAP,e)}get _needsLastFrameColor(){return+this.hasReflections+ +this.hasGlobalIllumination}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._testsNeedsDepth+ +this._needsShadowHighlight}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(S.AMBIENT_ILLUMINATION,this._renderAmbientIllumination());const t=this._needsDepth;if(t){const s=e.obtainAttachment(ue);this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),e.attachColor(s,ue),s?.release(),this.performanceInfo.advance(oe.DEPTH)}else e.detachDepth();this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._releaseGlobalIlluminationBuffers(),this._bindParameters.ssao=null,this._pluginInput.set(S.AMBIENT_ILLUMINATION,null),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._renderGaussianSplatPrepassDepth(i),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(oe.DEPTH)}_renderGaussianSplatPrepassDepth(e){const t=this._shadowAccumulator;if(!t?.active||!t.requireGeometryDepth)return;const s=this._bindParameters.output;this._bindParameters.output=3,this._renderInternalNodeCategory(S.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=s}_renderGaussianSplatDepthAndNormals(e){const t=this._bindParameters.output;this._bindParameters.output=4,this._renderInternalNodeCategory(S.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=t}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||!!this._shadowAccumulator?.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return z.Zero;const t=Y(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.union(this._nodes.queryDepthRange(S.SHADOWMAP,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=z.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<L)return void(this.sceneDepthRange.value=z.Infinite);const t=e.clone();t.near=O,t.far=1e10;const s=Y(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...R,S.VIEWSHED,S.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){const e=!!this._normalsRequired;if(e?(this._precompilePlugins(4,Pe),this._needsDepth&&this._precompilePlugins(3,Ae)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(S.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator?.active&&(this._nodes.precompile(S.SHADOW_ACCUMULATION),this._precompileAllGeometry(5)),this._shadowAccumulator?.active||e){const t=this._bindParameters.output;this._bindParameters.output=e?4:3,this._nodes.precompile(S.GAUSSIAN_SPLAT_DEPTH),this._bindParameters.output=t}(this.shadowsEnabled||this._shadowAccumulator?.active)&&this._nodes.precompile(S.SHADOWMAP),this.hasAmbientIllumination&&e&&this._nodes.precompile(S.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals");i.acquireDepth(14),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...Pe),this._renderGaussianSplatDepthAndNormals(i);const r=this._nodes.optional("normals",...R,S.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(oe.NORMALS),i}_renderAmbientIllumination(){const e=this._bindParameters,t=this._nodes.produce(S.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),e.ssao=this.hasGlobalIllumination?null:t,e.globalIllumination=this.hasGlobalIllumination?t:null,e.globalIlluminationEnabled=null!=e.globalIllumination,t&&this.performanceInfo.advance(this.hasGlobalIlluminationHighQuality?oe.AMBIENT_ILLUMINATION_HIGH_QUALITY:oe.AMBIENT_ILLUMINATION),t}_releaseGlobalIlluminationBuffers(){const e=this._bindParameters;this.hasGlobalIllumination&&(e.reprojection.lastFrameColor=h(e.reprojection.lastFrameColor)),e.reprojection.lastFrameDepth=n(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=n(e.reprojection.lastFrameEmission),e.globalIllumination=h(e.globalIllumination),e.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...be),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...Ie);this._renderContext.renderOccludedMask=Z}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...Ie),this._renderContext.renderOccludedMask=Z}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Te[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){const e=this._bindParameters.output;this._bindParameters.output=8,this._precompileAllGeometry(8),this._nodes.precompile(S.SHADOWMAP),this._bindParameters.output=e}precompileCutFillDepth(){this._precompilePlugins(9,Se)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e,t){const{camera:s,contentCamera:i}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._renderShadowNodes(t),this._ensureBindParametersCamera(s,i),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=r}renderCutFillDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Se),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,S.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Ae)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...fe),this._nodes.precompile("opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...fe)}_renderTransparentGeometry(){this._plugins.render(...ge),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...be)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle,i=this._bindParameters.emissions;this._bindParameters.emissions=0,this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...we),this._bindParameters.output=2,this._plugins.precompile(...we),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...we)),this._bindParameters.emissions=i,this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(de);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?oe.HUD_OCCLUDED:oe.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>q?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(14);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),j(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(oe.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...N)+this._nodes.optional("highlights",...N)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ee),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e){const t=this._shadowAccumulator;if(!t)return;t.updateDepthRange(e);const s=t.requireGeometryDepth;this._bindParameters.output=0;const i=this._nodes.produce(S.SHADOW_ACCUMULATION,this._pluginInput);t.didAccumulate&&this.performanceInfo.advance(oe.ACCUMULATED_SHADOWS),this._pluginInput.set(S.SHADOW_ACCUMULATION,null),i?.release(),s&&(this._bindParameters.depth=h(this._bindParameters.depth))}renderShadowAccumulationShadowMap(e,t,s,i,r){const a=this.stage.view.qualitySettings.maximumPixelRatio;this._bindParameters.renderingShadowAnalysisMap=!0;try{s.start(e,i,r,!0,a),this._renderShadowCascades(5,s),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t)}finally{this._bindParameters.renderingShadowAnalysisMap=!1}}_precompileTransparentGeometry(){y(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...ge),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...ge),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...ge)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",u=this.fboCache.acquire(i,r,l,o).acquireColor(de,this.hasFloatBlend?7:0,"oit alpha"),_=h.hasEmission&&(0===e||1!==t);_&&u.acquireColor(_e,o,"oit emissive"),s||u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(X),_&&this._rctx.clearBuffer(2,X),a(),u.detachDepth(),h.output=2;const m=this.fboCache.acquire(i,r,s?"oit front hud":"oit front");_&&m.acquireColor(de,o,"oit front emissive"),s?m.acquireDepth(this._hudDepthFormat):m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer(C,s),a(),m.detachDepth();const p=this._pluginsHas.occludedHudElements&&!s,c=p&&0!==h.emissions?_e:de;let f;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(f=this.fboCache.acquire(i,r,"oit composite hud"),this._rctx.bindFramebuffer(f.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(0!==h.emissions&&this._framebuffer.ensureEmissionAttachment(),p&&(this._framebuffer.color.acquireColor(c,0,"hud occlusion"),this._rctx.clearBuffer(c-ue,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,u,m,h,p,e,this._fboCache.debugCallback),f?.detachDepth(),s||(_&&(this._bindParameters.emissions=3),p&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(c))),m.release(),u.release(),h.output=d,f}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...fe)||this.plugins.produces(5,...fe)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(S.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(D.OPAQUE,t,e)),this.fboCache.debugCallback?.(D.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(S.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(S.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(S.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(S.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(S.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(S.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(S.VOXEL,e)),this.fboCache.debugCallback?.(S.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;if(this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(D.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(D.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),e.update(e=>this._renderNodes(S.TRANSPARENT_NO_DEPTH,e)),this.fboCache.debugCallback?.(S.TRANSPARENT_NO_DEPTH,e.color.fbo),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){const e=this._rctx.setDrawBuffers([me,de]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),this._fboCache.debugCallback?.(e,i.fbo),i}_renderInternalNodeCategory(e,t){if(!t)return;const s=t.name;try{this._renderNodes(e,t)}finally{this._pluginInput.set(e,null),t.setName(s)}}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration,this.stage.view.state.stationary),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){const{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=A);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(g(Ne,t.viewMatrix),g(Re,t.projectionMatrix),b(Oe,Ne,Re),b(Oe,s.viewMatrix,Oe),b(Oe,s.projectionMatrix,Oe),this._reprojectionMatrix=Oe):this._reprojectionMatrix=A,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(b(He,s.viewMatrix,Ne),P(t,He)):P(t,A)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p({readOnly:!0})],ce.prototype,"highResolutionAtmosphere",null),e([p()],ce.prototype,"_edgeView",void 0),e([p()],ce.prototype,"updating",null),ce=e([c("esri.views.3d.webgl-engine.lib.Renderer")],ce);const fe=[0,1,2,3],ge=[7,6,4,5],be=[7,6],Pe=[0,1,2,4,...be],Ae=[3,5],Ie=[2,4,8],we=[16,12,14,13],Ee=[4,5,2,3,0,1,...be],Ce=[4,8,5,11],Te={0:[13],1:[12],2:[13,12],3:[13,12]},Se=[0,1,...be],De=["normals","highlights"],Re=I(),Ne=I(),Oe=I(),He=I();function Fe(e){return t=>e.immediate.schedule(t)}export{ce as Renderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{addMany as r,filterInPlace as t}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{someMap as s,everyMap as i}from"../../../../core/MapUtils.js";import n from"../../../../core/PooledArray.js";import{property as o,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{set as d}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{OverlayTarget as c}from"../../terrain/Intersector.js";import{ChangeSet as l,RenderGeometryUpdate as m}from"./ChangeSet.js";import{IntersectorResultRay as g}from"./IntersectorResult.js";import{RendererBase as p}from"./RendererBase.js";import{noBudget as u}from"../../../support/Scheduler.js";let y=class extends p{constructor(e){super(e),this._pending=new _,this._changes=new l,this._sortedRenderers=new n,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return s(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOccluders(){return this.renderers&&s(this.renderers,e=>e.hasOnlyOccluders)}get hasOnlyOccluders(){return i(this.renderers,e=>e.hasOnlyOccluders)}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get _screenToWorldRatio(){return this.rendererContext.screenToWorldRatio}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,u,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=s(this.renderers,e=>{const r=e.produces.get(18);return!!r&&r(10)}),this._hasWater=s(this.renderers,e=>{const r=e.produces.get(19);return!!r&&r(4)})),this.notifyChange("updating"),!0)}addRenderer(){this._sortedRenderers.clear()}removeRenderer(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);switch(s&&this.notifyChange("updating"),r){case 0:this._notifyGraphicVisibilityChanged(e);break;case 1:this._notifyGraphicGeometryChanged(e)}}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),1===r&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=new m;this._changes.updates.push(e),e.renderGeometry=this._ensureValidRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case 4:case 2:return this._notifyGraphicGeometryChanged(e);case 1:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersectRay(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;if(o){const s=n.boundingSphere.center,a=this._effectiveGeometryRadius(n);s[0]-a<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),s[0]+a>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)}i++}return i}*intersectScreenPolygon(e,r,t,s){for(const i of this._geometries.values()){if(!t(i))continue;this._intersectScreenPolygonRenderGeometry(i,r,0,e,s);const n=this.rendererContext.longitudeCyclical;if(n){const t=i.boundingSphere.center,o=this._effectiveGeometryRadius(i);t[0]-o<n.min&&this._intersectScreenPolygonRenderGeometry(i,r,n.range,e,s),t[0]+o>n.max&&this._intersectScreenPolygonRenderGeometry(i,r,-n.range,e,s)}s++,yield}return s}_effectiveGeometryRadius(e){const r=e.boundingSphere.radius;return r||this._screenToWorldRatio*C}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.length=0,this._changes.removes.length=0,r(this._changes.adds,Array.from(this._pending.adds)),r(this._changes.removes,Array.from(this._pending.removes)),t(this._changes.updates,({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible||!e.material.intersectRayDraped)return;let o=0;s+=e.transformation[12],o=e.transformation[13],G[0]=t[0]-s,G[1]=t[1]-o,e.material.intersectRayDraped(e,i,G,(t,s,o,a)=>{f(r,a,n,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)},r,this._screenToWorldRatio)}_intersectScreenPolygonRenderGeometry(e,r,t,s,i){if(!e.visible||!e.material.visible||!e.material.intersectScreenPolygonDraped)return;d(v,t+e.transformation[12],e.transformation[13]);const n=this._screenToWorldRatio;for(const o of r){const r=e.material.intersectScreenPolygonDraped(e,v,s,o,n);if(r)return void R(o.distance,r.primitiveIndex,i,e.material.renderPriority,s,e.layerViewUid,e.graphicUid)}}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(e.boundingSphere.center)),e}get test(){}};e([o({constructOnly:!0})],y.prototype,"drapeSource",void 0),e([o({constructOnly:!0})],y.prototype,"rendererContext",void 0),e([o()],y.prototype,"updating",null),e([o()],y.prototype,"rctx",null),e([o()],y.prototype,"_localOriginFactory",null),e([o({readOnly:!0})],y.prototype,"isEmpty",null),e([o()],y.prototype,"_geometries",void 0),y=e([a("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],y);class _{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function f(e,r,t,s,i,n,o){const a=new c(n,o,r),d=r=>{r.set(5,a,e.distance,e.renderDistance,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.renderDistance||i.results.ground.renderDistance<=i.results.min.renderDistance)&&d(i.results.min),0!==i.options.store&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.renderDistance||i.results.ground.renderDistance>i.results.max.renderDistance)&&d(i.results.max),2===i.options.store){const e=new g(i.ray);d(e),i.results.all.push(e)}}function R(e,r,t,s,i,n,o){i.polygonResults.add(5,new c(n,o,r),e,t,s)}const G=h(),v=h(),C=128;export{y as SortedRenderGeometryRenderer};
2
+ import{__decorate as e}from"tslib";import{addMany as r,filterInPlace as t}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{someMap as i,everyMap as s}from"../../../../core/MapUtils.js";import n from"../../../../core/PooledArray.js";import{property as o,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{set as d}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{OverlayTarget as c}from"../../terrain/Intersector.js";import{ChangeSet as l,RenderGeometryUpdate as g}from"./ChangeSet.js";import{IntersectorResultRay as m}from"./IntersectorResult.js";import{RendererBase as p}from"./RendererBase.js";import{noBudget as u}from"../../../support/Scheduler.js";let y=class extends p{constructor(e){super(e),this._pending=new _,this._changes=new l,this._sortedRenderers=new n,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return i(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOccluders(){return this.renderers&&i(this.renderers,e=>e.hasOnlyOccluders)}get hasOnlyOccluders(){return s(this.renderers,e=>e.hasOnlyOccluders)}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get _screenToWorldRatio(){return this.rendererContext.screenToWorldRatio}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,u,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=i(this.renderers,e=>{const r=e.produces.get(18);return!!r&&r(10)}),this._hasWater=i(this.renderers,e=>{const r=e.produces.get(19);return!!r&&r(4)})),this.notifyChange("updating"),!0)}addRenderer(){this._sortedRenderers.clear()}removeRenderer(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const s of t)this._geometries.set(s.id,s);const i=this._pending.empty;for(const s of t)this._pending.adds.add(s);switch(i&&this.notifyChange("updating"),r){case 0:this._notifyGraphicVisibilityChanged(e);break;case 1:this._notifyGraphicGeometryChanged(e)}}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,i=this._pending.adds;for(const s of e)i.has(s)?(this._pending.removed.add(s),i.delete(s)):this._pending.removed.has(s)||this._pending.removes.add(s),this._geometries.delete(s.id);t&&!this._pending.empty&&this.notifyChange("updating"),1===r&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const i of e){const e=new g;this._changes.updates.push(e),e.renderGeometry=this._ensureValidRenderGeometry(i),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case 4:case 2:return this._notifyGraphicGeometryChanged(e);case 1:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersectRay(e,r,t,i,s){for(const n of this._geometries.values()){if(!i(n))continue;this._intersectRenderGeometry(n,t,r,0,e,s);const o=this.rendererContext.longitudeCyclical;if(o){const i=n.boundingSphere.center,a=this._effectiveGeometryRadius(n);i[0]-a<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,s),i[0]+a>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,s)}s++}return s}*intersectScreenPolygon(e,r,t,i){for(const s of this._geometries.values()){if(!t(s))continue;this._intersectScreenPolygonRenderGeometry(s,r,0,e,i);const n=this.rendererContext.longitudeCyclical;if(n){const t=s.boundingSphere.center,o=this._effectiveGeometryRadius(s);t[0]-o<n.min&&this._intersectScreenPolygonRenderGeometry(s,r,n.range,e,i),t[0]+o>n.max&&this._intersectScreenPolygonRenderGeometry(s,r,-n.range,e,i)}i++,yield}return i}_effectiveGeometryRadius(e){const r=e.boundingSphere.radius;return r||this._screenToWorldRatio*C}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.length=0,this._changes.removes.length=0,r(this._changes.adds,Array.from(this._pending.adds)),r(this._changes.removes,Array.from(this._pending.removes)),t(this._changes.updates,({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,i,s,n){if(!e.visible||!e.material.visible||!e.material.intersectRayDraped)return;let o=0;0===e.type?(i+=e.transformation[12],o=e.transformation[13]):(i+=e.localOrigin.vec3[0],o=e.localOrigin.vec3[1]),v[0]=t[0]-i,v[1]=t[1]-o,e.material.intersectRayDraped(e,s,v,(t,i,o,a)=>{f(r,a,n,e.material.renderPriority,s,e.layerViewUid,e.graphicUid)},r,this._screenToWorldRatio)}_intersectScreenPolygonRenderGeometry(e,r,t,i,s){if(!e.visible||!e.material.visible||!e.material.intersectScreenPolygonDraped)return;0===e.type?d(G,t+e.transformation[12],e.transformation[13]):d(G,t+e.localOrigin.vec3[0],e.localOrigin.vec3[1]);const n=this._screenToWorldRatio;for(const o of r){const r=e.material.intersectScreenPolygonDraped(e,G,i,o,n);if(r)return void R(o.distance,r.primitiveIndex,s,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)}}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return 1===e.type||null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(e.boundingSphere.center)),e}get test(){}};e([o({constructOnly:!0})],y.prototype,"drapeSource",void 0),e([o({constructOnly:!0})],y.prototype,"rendererContext",void 0),e([o()],y.prototype,"updating",null),e([o()],y.prototype,"rctx",null),e([o()],y.prototype,"_localOriginFactory",null),e([o({readOnly:!0})],y.prototype,"isEmpty",null),e([o()],y.prototype,"_geometries",void 0),y=e([a("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],y);class _{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function f(e,r,t,i,s,n,o){const a=new c(n,o,r),d=r=>{r.set(5,a,e.distance,e.renderDistance,e.normal,e.transformation,t,i)};if((null==s.results.min.drapedLayerOrder||t>=s.results.min.drapedLayerOrder)&&(null==s.results.min.renderDistance||s.results.ground.renderDistance<=s.results.min.renderDistance)&&d(s.results.min),0!==s.options.store&&(null==s.results.max.drapedLayerOrder||t<s.results.max.drapedLayerOrder)&&(null==s.results.max.renderDistance||s.results.ground.renderDistance>s.results.max.renderDistance)&&d(s.results.max),2===s.options.store){const e=new m(s.ray);d(e),s.results.all.push(e)}}function R(e,r,t,i,s,n,o){s.polygonResults.add(5,new c(n,o,r),e,t,i)}const v=h(),G=h(),C=128;export{y as SortedRenderGeometryRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{generateUUID as t}from"../../../../core/uuid.js";const o={dash:[4,3],dot:[1,3],"long-dash":[8,3],"short-dash":[4,1],"short-dot":[1,1]},s={dash:o.dash,"dash-dot":[...o.dash,...o.dot],dot:o.dot,"long-dash":o["long-dash"],"long-dash-dot":[...o["long-dash"],...o.dot],"long-dash-dot-dot":[...o["long-dash"],...o.dot,...o.dot],none:null,"short-dash":o["short-dash"],"short-dash-dot":[...o["short-dash"],...o["short-dot"]],"short-dash-dot-dot":[...o["short-dash"],...o["short-dot"],...o["short-dot"]],"short-dot":o["short-dot"],solid:null},d=8;class n{constructor(o,s,d){this.image=o,this.width=s,this.length=d,this.uuid=t()}}function h(t){return null!=t&&"image"in t}function r(t,o){return null==t?t:{pattern:t.slice(),pixelRatio:o}}function l(t){return{pattern:[t,t],pixelRatio:2}}function a(t){switch(t?.type){case"style":return e(t.style);case"image":return new n(t.image,t.width,t.length);case void 0:case null:return null}return null}function e(t){return null!=t?r(s[t],d):null}export{n as ImagePattern,l as createStipplePatternSimple,a as getStipplePatternForLinePattern,e as getStipplePatternForPatternStyle,h as isImagePattern};
2
+ import{generateUUID as t}from"../../../../core/uuid.js";const e={dash:[4,3],dot:[1,3],"long-dash":[8,3],"short-dash":[4,1],"short-dot":[1,1]},s={dash:e.dash,"dash-dot":[...e.dash,...e.dot],dot:e.dot,"long-dash":e["long-dash"],"long-dash-dot":[...e["long-dash"],...e.dot],"long-dash-dot-dot":[...e["long-dash"],...e.dot,...e.dot],none:null,"short-dash":e["short-dash"],"short-dash-dot":[...e["short-dash"],...e["short-dot"]],"short-dash-dot-dot":[...e["short-dash"],...e["short-dot"],...e["short-dot"]],"short-dot":e["short-dot"],solid:null},n=8;class o{constructor(e,s,n){this.image=e,this.width=s,this.length=n,this.uuid=t()}}function d(t){return null!=t&&"image"in t}function r(t,e){return null==t?t:{pattern:t.slice(),pixelRatio:e}}function a(t){return{pattern:[t,t],pixelRatio:2}}function h(t){switch(t?.type){case"style":return l(t.style);case"template":return i(t.normalizedDashTemplate);case"image":return new o(t.image,t.width,t.length);case void 0:case null:return null}return null}function l(t){return null!=t?r(s[t],n):null}function i({dashTemplate:t,hidesLine:e}){return r(e||0===t.length?null:t,n)}function u(t){switch(t?.type){case"style":return"none"===t.style;case"template":return t.normalizedDashTemplate.hidesLine;case"image":case void 0:case null:return!1}return!1}export{o as ImagePattern,a as createStipplePatternSimple,h as getStipplePatternForLinePattern,d as isImagePattern,u as patternHidesLine};