@arcgis/core 5.1.0-next.105 → 5.1.0-next.107

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 (478) hide show
  1. package/analysis/AreaMeasurementAnalysis.d.ts +5 -5
  2. package/analysis/DimensionAnalysis.d.ts +3 -3
  3. package/analysis/DimensionSimpleStyle.d.ts +2 -2
  4. package/analysis/DirectLineMeasurementAnalysis.d.ts +4 -4
  5. package/analysis/DistanceMeasurementAnalysis.d.ts +4 -4
  6. package/analysis/ElevationProfileAnalysis.d.ts +3 -3
  7. package/analysis/LengthDimension.d.ts +2 -2
  8. package/analysis/LineOfSightAnalysis.d.ts +4 -4
  9. package/analysis/ShadowCast/DiscreteOptions.d.ts +7 -3
  10. package/analysis/ShadowCast/MinDurationOptions.d.ts +5 -1
  11. package/analysis/ShadowCast/TotalDurationOptions.d.ts +7 -3
  12. package/analysis/ShadowCast/types.d.ts +1 -1
  13. package/analysis/ShadowCastAnalysis.d.ts +11 -6
  14. package/analysis/SliceAnalysis.d.ts +4 -4
  15. package/analysis/SlicePlane.d.ts +3 -3
  16. package/analysis/Viewshed.d.ts +2 -2
  17. package/analysis/ViewshedAnalysis.d.ts +3 -3
  18. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +1 -1
  19. package/analysis/VolumeMeasurementAnalysis.d.ts +3 -3
  20. package/applications/Components/imageryUtils.d.ts +24 -0
  21. package/applications/Components/layerUtils.d.ts +21 -0
  22. package/applications/Components/layerUtils.js +2 -0
  23. package/applications/Components/templateUtils.d.ts +11 -1
  24. package/applications/Components/templateUtils.js +1 -1
  25. package/arcgisGlobal.d.ts +6 -0
  26. package/assets/components/assets/icon/buttons16.json +1 -0
  27. package/assets/components/assets/icon/buttons24.json +1 -0
  28. package/assets/components/assets/icon/buttons32.json +1 -0
  29. package/assets/components/assets/icon/entityTypes16.json +1 -0
  30. package/assets/components/assets/icon/entityTypes24.json +1 -0
  31. package/assets/components/assets/icon/entityTypes32.json +1 -0
  32. package/assets/esri/core/t9n/Units_ar.json +1 -1
  33. package/assets/esri/core/t9n/Units_bg.json +1 -1
  34. package/assets/esri/core/t9n/Units_bs.json +1 -1
  35. package/assets/esri/core/t9n/Units_ca.json +1 -1
  36. package/assets/esri/core/t9n/Units_cs.json +1 -1
  37. package/assets/esri/core/t9n/Units_da.json +1 -1
  38. package/assets/esri/core/t9n/Units_de.json +1 -1
  39. package/assets/esri/core/t9n/Units_el.json +1 -1
  40. package/assets/esri/core/t9n/Units_es.json +1 -1
  41. package/assets/esri/core/t9n/Units_et.json +1 -1
  42. package/assets/esri/core/t9n/Units_fi.json +1 -1
  43. package/assets/esri/core/t9n/Units_fr.json +1 -1
  44. package/assets/esri/core/t9n/Units_he.json +1 -1
  45. package/assets/esri/core/t9n/Units_hr.json +1 -1
  46. package/assets/esri/core/t9n/Units_hu.json +1 -1
  47. package/assets/esri/core/t9n/Units_id.json +1 -1
  48. package/assets/esri/core/t9n/Units_it.json +1 -1
  49. package/assets/esri/core/t9n/Units_ja.json +1 -1
  50. package/assets/esri/core/t9n/Units_ko.json +1 -1
  51. package/assets/esri/core/t9n/Units_lt.json +1 -1
  52. package/assets/esri/core/t9n/Units_lv.json +1 -1
  53. package/assets/esri/core/t9n/Units_nl.json +1 -1
  54. package/assets/esri/core/t9n/Units_no.json +1 -1
  55. package/assets/esri/core/t9n/Units_pl.json +1 -1
  56. package/assets/esri/core/t9n/Units_pt-BR.json +1 -1
  57. package/assets/esri/core/t9n/Units_pt-PT.json +1 -1
  58. package/assets/esri/core/t9n/Units_ro.json +1 -1
  59. package/assets/esri/core/t9n/Units_ru.json +1 -1
  60. package/assets/esri/core/t9n/Units_sk.json +1 -1
  61. package/assets/esri/core/t9n/Units_sl.json +1 -1
  62. package/assets/esri/core/t9n/Units_sr.json +1 -1
  63. package/assets/esri/core/t9n/Units_sv.json +1 -1
  64. package/assets/esri/core/t9n/Units_th.json +1 -1
  65. package/assets/esri/core/t9n/Units_tr.json +1 -1
  66. package/assets/esri/core/t9n/Units_uk.json +1 -1
  67. package/assets/esri/core/t9n/Units_vi.json +1 -1
  68. package/assets/esri/core/t9n/Units_zh-CN.json +1 -1
  69. package/assets/esri/core/t9n/Units_zh-HK.json +1 -1
  70. package/assets/esri/core/t9n/Units_zh-TW.json +1 -1
  71. package/assets/esri/core/workers/RemoteClient.js +1 -1
  72. package/assets/esri/core/workers/chunks/{6854b28853f5dd195110.js → 01c70c27aa3a955e2928.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{b7a81fd4994eabba1869.js → 0c8e6ccb5a8174718d62.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{a943bd2e6fb7443c2b66.js → 17604cbd4d24158e2c16.js} +1 -1
  75. package/assets/esri/core/workers/chunks/179c9fe4ac83b42e5976.js +1 -0
  76. package/assets/esri/core/workers/chunks/1d1929f98d941179be29.js +2 -0
  77. package/assets/esri/core/workers/chunks/{24247ee93f43fff5e596.js.LICENSE.txt → 1d1929f98d941179be29.js.LICENSE.txt} +1 -3
  78. package/assets/esri/core/workers/chunks/1ebb613bbe09fcf274d8.js +1 -0
  79. package/assets/esri/core/workers/chunks/24b43fb12fc3009fdc30.js +1 -0
  80. package/assets/esri/core/workers/chunks/2b9661700743d1f9717e.js +1 -0
  81. package/assets/esri/core/workers/chunks/2f0a3b22fc46d832e240.js +1 -0
  82. package/assets/esri/core/workers/chunks/{2dced41ff2aa1bd86665.js → 33ec193e6d7a0cb9d8dd.js} +1 -1
  83. package/assets/esri/core/workers/chunks/340f2c996f62f7f5ceae.js +1 -0
  84. package/assets/esri/core/workers/chunks/37c63570c0b4981cd519.js +1 -0
  85. package/assets/esri/core/workers/chunks/{a0e72b107991ba38a9f0.js → 502c3da8c49bf885f51d.js} +1 -1
  86. package/assets/esri/core/workers/chunks/518046d2b95a7590a092.js +1 -0
  87. package/assets/esri/core/workers/chunks/547dc6ccb989bd962661.js +1 -0
  88. package/assets/esri/core/workers/chunks/549d348ca181d06aefb7.js +2 -0
  89. package/assets/esri/core/workers/chunks/{9b89cc85c1b5d561df7c.js → 55334ad3618899cdbf78.js} +2 -2
  90. package/assets/esri/core/workers/chunks/{7485d59d60d61737d662.js → 55b765c72d13b3b911f9.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{1e8d5bfc5f8c2664190c.js → 56d9d3f108ff6e719dd4.js} +1 -1
  92. package/assets/esri/core/workers/chunks/5cdf87e7a59ace38df87.js +1 -0
  93. package/assets/esri/core/workers/chunks/622bdd1b9d5d292ec12b.js +1 -0
  94. package/assets/esri/core/workers/chunks/69c9eb93553b006b640d.js +2 -0
  95. package/assets/esri/core/workers/chunks/6d20d741b8ae1a45b422.js +1 -0
  96. package/assets/esri/core/workers/chunks/702a3ef9e1b3442cbee7.js +1 -0
  97. package/assets/esri/core/workers/chunks/75a7de23c05435ec7649.js +1 -0
  98. package/assets/esri/core/workers/chunks/762e23466308f22d7076.js +1 -0
  99. package/assets/esri/core/workers/chunks/{52219561c144e5cb4442.js → 770611659b38066a6228.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{e90afd914f2ccd4f5374.js → 7ce60331f94ee0a5d674.js} +6 -6
  101. package/assets/esri/core/workers/chunks/825db2ea15308ee6e5dc.js +1 -0
  102. package/assets/esri/core/workers/chunks/8330302096d4312a4393.js +1 -0
  103. package/assets/esri/core/workers/chunks/{7617bd0f3a70dfe61637.js → 8557dd9ef336b23f768f.js} +1 -1
  104. package/assets/esri/core/workers/chunks/885eac78a76184efa1e5.js +1 -0
  105. package/assets/esri/core/workers/chunks/{79dc7045d9a2d43ba8df.js → 890b7a1153b7f65eba9a.js} +1 -1
  106. package/assets/esri/core/workers/chunks/9234a293d61e134f121f.js +1 -0
  107. package/assets/esri/core/workers/chunks/{44636ef119c6a576470b.js → 94eab215bab3e4e0e5b5.js} +1 -1
  108. package/assets/esri/core/workers/chunks/95dee5853c6e89f15ea9.js +1 -0
  109. package/assets/esri/core/workers/chunks/a5b9ae4c93f9af7589f2.js +1 -0
  110. package/assets/esri/core/workers/chunks/{fb415b01f0f1d644832d.js → ac408c62565e2c8b5975.js} +1 -1
  111. package/assets/esri/core/workers/chunks/b3e8ab68fc38306f13c6.js +1 -0
  112. package/assets/esri/core/workers/chunks/b69d1d528e271568cbd8.js +2 -0
  113. package/assets/esri/core/workers/chunks/{0cc74bc3772be51cabc1.js → bbaf8baa3ca6195467e4.js} +1 -1
  114. package/assets/esri/core/workers/chunks/{f7e386ece75afb6e4be5.js → bc249bb667f0564ad093.js} +1 -1
  115. package/assets/esri/core/workers/chunks/c4872cf3b71d00f450e1.js +1 -0
  116. package/assets/esri/core/workers/chunks/c5ab346a226df1894302.js +1 -0
  117. package/assets/esri/core/workers/chunks/{39a8e6c9d710d3faea3c.js → cdb48d198145493f76f3.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{359dbfbfb9acfb18bc6e.js → d4014213c476bf8099af.js} +1 -1
  119. package/assets/esri/core/workers/chunks/da29cf0e64065631a470.js +1 -0
  120. package/assets/esri/core/workers/chunks/ddebc1dc10a2d207389f.js +1 -0
  121. package/assets/esri/core/workers/chunks/e393fd61deb2e7f22ee6.js +1 -0
  122. package/assets/esri/core/workers/chunks/ea2bf7c543cc536400b7.js +30 -0
  123. package/assets/esri/core/workers/chunks/ece30bfd5c49b8d99752.js +1 -0
  124. package/assets/esri/core/workers/chunks/ecf4d07917efc97eb991.js +1 -0
  125. package/assets/esri/core/workers/chunks/ee56290e600cbeb25a00.js +1 -0
  126. package/assets/esri/core/workers/chunks/f52c6efc5a2abf5ac845.js +1 -0
  127. package/assets/esri/core/workers/chunks/fc1fe1f58a65a1694c09.js +1 -0
  128. package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
  129. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  130. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  131. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +84 -1
  132. package/assets/esri/themes/base/widgets/_Sketch.scss +1 -24
  133. package/assets/esri/themes/dark/main.css +1 -1
  134. package/assets/esri/themes/light/main.css +1 -1
  135. package/assets/esri/themes/light/view.css +1 -1
  136. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  137. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  138. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  139. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  140. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  141. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  142. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  143. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  144. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  145. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  146. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  147. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  148. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  149. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  150. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  151. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  152. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  153. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  154. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  155. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  156. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  157. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  158. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  159. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  160. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  161. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  162. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  163. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  164. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  165. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  166. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  167. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  168. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  169. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  170. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  171. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  172. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  173. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  174. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  175. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  176. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  177. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
  178. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
  179. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  180. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  181. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  182. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  183. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  184. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  185. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  186. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  187. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  188. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  189. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  190. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  191. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  192. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  193. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  194. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  195. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  196. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  197. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  198. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  199. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  200. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  201. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  202. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  203. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  204. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  205. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  206. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  207. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  208. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  209. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  210. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  211. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  212. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  213. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  214. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  215. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  216. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  217. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  218. package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
  219. package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
  220. package/chunks/ComponentShader.glsl.js +11 -15
  221. package/chunks/Fog.glsl.js +3 -3
  222. package/chunks/GlowComposition.glsl.js +38 -56
  223. package/chunks/OITDimOpaque.glsl.js +8 -3
  224. package/chunks/SimpleAtmosphere.glsl.js +3 -3
  225. package/chunks/lyr3DWorker.js +1 -1
  226. package/chunks/pe-wasm.js +1 -1
  227. package/config.js +1 -1
  228. package/core/generatorUtils.js +2 -0
  229. package/core/libs/gl-matrix-2/factories/vec2f64.js +1 -1
  230. package/core/libs/gl-matrix-2/math/vec2.js +1 -1
  231. package/core/mathUtils.js +1 -1
  232. package/core/typedArrayUtil.js +1 -1
  233. package/geometry/HeightModelInfo.js +1 -1
  234. package/geometry/geometryEngine.d.ts +2 -2
  235. package/geometry/support/WKIDUnitConversion.js +1 -1
  236. package/geometry/support/buffer/BufferView.js +1 -1
  237. package/geometry/support/vcsData.js +1 -1
  238. package/geometry/support/vcsLookup.js +1 -1
  239. package/identity/IdentityManagerBase.js +1 -1
  240. package/kernel.js +1 -1
  241. package/layers/DimensionLayer.d.ts +5 -5
  242. package/layers/FeatureLayer.d.ts +2 -2
  243. package/layers/GaussianSplatLayer.d.ts +3 -3
  244. package/layers/LineOfSightLayer.d.ts +5 -5
  245. package/layers/ParquetLayer.d.ts +6 -4
  246. package/layers/SubtypeGroupLayer.d.ts +2 -2
  247. package/layers/ViewshedLayer.d.ts +3 -3
  248. package/layers/graphics/sources/ParquetSource.js +1 -1
  249. package/layers/graphics/sources/parquet/FileProvider.js +2 -0
  250. package/layers/graphics/sources/parquet/PortalParquetFileProvider.js +2 -0
  251. package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +2 -0
  252. package/layers/graphics/sources/parquet/UrlsFileProvider.js +2 -0
  253. package/layers/graphics/sources/parquet/createFileProvider.js +2 -0
  254. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  255. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +1 -1
  256. package/layers/raster/datasets/ImageAuxRaster.js +1 -1
  257. package/layers/raster/datasets/MRFRaster.js +1 -1
  258. package/layers/raster/datasets/pixelReader.js +1 -1
  259. package/layers/raster/formats/JpgPlus.js +1 -1
  260. package/layers/raster/formats/RasterCodec.js +1 -1
  261. package/layers/raster/functions/clipUtils.js +1 -1
  262. package/layers/support/AggregateField.d.ts +2 -1
  263. package/layers/support/LayerContingentValuesCache.js +1 -1
  264. package/layers/support/SubtypeSublayer.d.ts +4 -4
  265. package/layers/support/parquetUtils.d.ts +18 -7
  266. package/layers/support/parquetUtils.js +1 -1
  267. package/layers/support/rasterFunctionUtils.d.ts +2 -2
  268. package/libs/parquet/parquet.js +1 -1
  269. package/linkChart/ChronologicalLayoutSettings.d.ts +1 -1
  270. package/networks/CircuitManager.d.ts +3 -3
  271. package/networks/UnitIdentifierManager.d.ts +1 -1
  272. package/networks/UnitIdentifierManager.js +1 -1
  273. package/networks/UtilityNetwork.d.ts +2 -2
  274. package/networks/UtilityNetwork.js +1 -1
  275. package/networks/support/Circuit.d.ts +1 -1
  276. package/networks/support/CircuitLocation.d.ts +1 -1
  277. package/networks/support/CircuitSection.d.ts +1 -1
  278. package/networks/support/Subcircuit.d.ts +1 -1
  279. package/networks/support/TraceJobInfo.js +1 -1
  280. package/networks/support/jsonTypes.d.ts +10 -3
  281. package/package.json +4 -4
  282. package/popup/FieldInfo.d.ts +4 -2
  283. package/popup/support/FieldInfoFormat.d.ts +3 -2
  284. package/rest/featureService/FeatureService.d.ts +1 -1
  285. package/rest/knowledgeGraph/FieldIndex.d.ts +1 -1
  286. package/rest/knowledgeGraph/GraphObjectType.d.ts +2 -2
  287. package/rest/knowledgeGraph/GraphSearch.d.ts +1 -1
  288. package/rest/knowledgeGraph/GraphSearchStreaming.d.ts +1 -1
  289. package/rest/networks/circuits/support/CircuitVerifyResult.js +1 -1
  290. package/rest/networks/circuits/support/ExportCircuitsParameters.d.ts +19 -1
  291. package/rest/networks/circuits/support/ExportCircuitsResult.js +1 -1
  292. package/rest/networks/circuits/support/VerifyCircuitsParameters.d.ts +18 -10
  293. package/rest/networks/circuits/support/VerifyCircuitsParameters.js +1 -1
  294. package/rest/networks/circuits/support/VerifyCircuitsResult.js +1 -1
  295. package/rest/networks/support/TraceParameters.js +1 -1
  296. package/rest/networks/support/TraceResult.js +1 -1
  297. package/rest/networks/trace.js +1 -1
  298. package/rest/networks/unitIdentifiers/support/QueryUnitIdentifiersParameters.js +1 -1
  299. package/rest/support/AreasAndLengthsParameters.d.ts +1 -1
  300. package/rest/support/GeneralizeParameters.d.ts +1 -1
  301. package/rest/support/Query.d.ts +1 -1
  302. package/rest/support/RelationParameters.d.ts +1 -1
  303. package/rest/support/types.d.ts +1 -1
  304. package/support/revision.js +1 -1
  305. package/symbols/CIMSymbol.d.ts +1 -1
  306. package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +1 -0
  307. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  308. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  309. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  310. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  311. package/views/2d/layers/features/sources/strategies/chunks/ParquetSnapshotSourceChunk.js +1 -1
  312. package/views/2d/layers/features/sources/strategies/chunks/ParquetSourceChunk.js +1 -1
  313. package/views/3d/analysis/AreaMeasurementAnalysisView3D.d.ts +1 -0
  314. package/views/3d/analysis/DimensionAnalysisView3D.d.ts +7 -6
  315. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.d.ts +2 -0
  316. package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
  317. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  318. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  319. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  320. package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +2 -1
  321. package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +5 -1
  322. package/views/3d/analysis/SliceAnalysisView3D.d.ts +4 -3
  323. package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
  324. package/views/3d/analysis/Viewshed/ViewshedDrawToolRenderer.js +2 -0
  325. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  326. package/views/3d/analysis/Viewshed/ViewshedInteractionVisuals.js +2 -0
  327. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +2 -0
  328. package/views/3d/analysis/Viewshed/ViewshedPlacementOperation.js +2 -0
  329. package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +2 -0
  330. package/views/3d/analysis/Viewshed/ViewshedPlacementRootPlugin.js +2 -0
  331. package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +2 -0
  332. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  333. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  334. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  335. package/views/3d/analysis/Viewshed/ViewshedTool2.js +1 -1
  336. package/views/3d/analysis/Viewshed/analysisViewRegister.js +1 -1
  337. package/views/3d/analysis/Viewshed/placementUtils.js +2 -0
  338. package/views/3d/analysis/Viewshed/toolLifecycleUtils.js +2 -0
  339. package/views/3d/analysis/Viewshed/viewshedSubToolUtils.js +1 -1
  340. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  341. package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +4 -3
  342. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  343. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  344. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  345. package/views/3d/environment/FoggyWeather.js +1 -1
  346. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  347. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  348. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  349. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  350. package/views/3d/layers/i3s/Intersector.js +1 -1
  351. package/views/3d/layers/support/UVWorkspace.js +2 -0
  352. package/views/3d/layers/support/patternUtils.js +1 -1
  353. package/views/3d/layers/support/uvUtils.js +1 -1
  354. package/views/3d/support/ResourceController.js +1 -1
  355. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  356. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  357. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  358. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  359. package/views/3d/support/meshProcessing.js +1 -1
  360. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  361. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +8 -8
  362. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +13 -9
  363. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +63 -49
  364. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  365. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  366. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  367. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechniqueConfiguration.js +1 -1
  368. package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
  369. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  370. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  371. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  372. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  373. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  374. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  375. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  376. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  377. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
  378. package/views/3d/webgl-engine/materials/PathLayouts.js +2 -0
  379. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  380. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  381. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  382. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  383. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  384. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +2 -3
  385. package/views/PopupView.d.ts +77 -1
  386. package/views/PopupView.js +1 -1
  387. package/views/SceneView.js +1 -1
  388. package/views/draw/DrawTool.d.ts +77 -0
  389. package/views/draw/support/editingSessionUtils.js +1 -1
  390. package/views/draw/support/managers/PluginLifecycleManager.d.ts +10 -0
  391. package/views/interactive/InteractiveToolBase.d.ts +11 -0
  392. package/views/interactive/editGeometry/interfaces.d.ts +8 -0
  393. package/views/interactive/interfaces.d.ts +20 -0
  394. package/views/layers/DimensionLayerView.d.ts +2 -1
  395. package/views/layers/LineOfSightLayerView.d.ts +2 -1
  396. package/views/layers/ViewshedLayerView.d.ts +2 -1
  397. package/views/webgl/capabilities/load.js +1 -1
  398. package/webscene/Slide.js +1 -1
  399. package/widgets/Attachments/types.d.ts +1 -1
  400. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +38 -5
  401. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  402. package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +2 -0
  403. package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
  404. package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
  405. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  406. package/widgets/BatchAttributeForm/css.js +1 -1
  407. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +11 -0
  408. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  409. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +77 -0
  410. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  411. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  412. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  413. package/widgets/BatchAttributeForm/interfaceUtils.js +2 -0
  414. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  415. package/widgets/BatchAttributeForm/types.d.ts +30 -2
  416. package/widgets/BatchAttributeForm.d.ts +52 -1
  417. package/widgets/BatchAttributeForm.js +1 -1
  418. package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +9 -1
  419. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  420. package/widgets/Editor.d.ts +1 -1
  421. package/widgets/FeatureTable/FieldColumn.js +1 -1
  422. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  423. package/widgets/LayerList/LayerListItem.js +1 -1
  424. package/widgets/Sketch/SketchViewModel.d.ts +67 -2
  425. package/widgets/Sketch/SketchViewModel.js +1 -1
  426. package/widgets/Sketch/VisibleElements.d.ts +19 -1
  427. package/widgets/Sketch/VisibleElements.js +1 -1
  428. package/widgets/Sketch/support/OperationHandle.js +1 -1
  429. package/widgets/Sketch/support/PluginManager.d.ts +12 -0
  430. package/widgets/Sketch/support/PluginManager.js +1 -1
  431. package/widgets/Sketch.js +1 -1
  432. package/widgets/TimeSlider.d.ts +3 -3
  433. package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +10 -0
  434. package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
  435. package/widgets/support/ContingentValuesManager.js +1 -1
  436. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +81 -0
  437. package/widgets/support/SelectionToolbar/types.d.ts +4 -0
  438. package/widgets/support/forms/formUtils.js +1 -1
  439. package/assets/esri/core/workers/chunks/11b0d3a825fe50dd1e84.js +0 -1
  440. package/assets/esri/core/workers/chunks/130851b81f04e6a008cd.js +0 -1
  441. package/assets/esri/core/workers/chunks/1a3426276dc82a8a80f2.js +0 -1
  442. package/assets/esri/core/workers/chunks/1c8a21b7b60c0709e6b2.js +0 -1
  443. package/assets/esri/core/workers/chunks/24247ee93f43fff5e596.js +0 -2
  444. package/assets/esri/core/workers/chunks/276cb6a1cdd26d0e1444.js +0 -1
  445. package/assets/esri/core/workers/chunks/2b3a8a53cd68f666676b.js +0 -1
  446. package/assets/esri/core/workers/chunks/2ecb21c402cdd8c82533.js +0 -1
  447. package/assets/esri/core/workers/chunks/2f903bd3a2611e7f0946.js +0 -30
  448. package/assets/esri/core/workers/chunks/2fda38219d778f0447b5.js +0 -1
  449. package/assets/esri/core/workers/chunks/38d7430d2370b69334d7.js +0 -1
  450. package/assets/esri/core/workers/chunks/39d6032d79720935910d.js +0 -1
  451. package/assets/esri/core/workers/chunks/5dafd35801dca4229aed.js +0 -1
  452. package/assets/esri/core/workers/chunks/642be1619c0e76355cb6.js +0 -1
  453. package/assets/esri/core/workers/chunks/6d66dc77af8d112c33c6.js +0 -1
  454. package/assets/esri/core/workers/chunks/7b3642195d6d3ea9b830.js +0 -1
  455. package/assets/esri/core/workers/chunks/7e57029ec958f6423d5d.js +0 -2
  456. package/assets/esri/core/workers/chunks/8042e001545e2782499c.js +0 -1
  457. package/assets/esri/core/workers/chunks/855bf811cd79b97c169a.js +0 -1
  458. package/assets/esri/core/workers/chunks/881234f25c7814de8753.js +0 -1
  459. package/assets/esri/core/workers/chunks/8a7682071941c35f05c1.js +0 -1
  460. package/assets/esri/core/workers/chunks/8fdd57e2a0af647f1e3e.js +0 -1
  461. package/assets/esri/core/workers/chunks/90ea570f6b6ce8ca693b.js +0 -1
  462. package/assets/esri/core/workers/chunks/9373daa677dc767d7cf0.js +0 -1
  463. package/assets/esri/core/workers/chunks/95df6d2ebacc43ac5fa3.js +0 -1
  464. package/assets/esri/core/workers/chunks/a02ebdcb802d128c8eee.js +0 -1
  465. package/assets/esri/core/workers/chunks/adf72d87f0114aeade0e.js +0 -1
  466. package/assets/esri/core/workers/chunks/aec4a4cd7044fdbbbe34.js +0 -1
  467. package/assets/esri/core/workers/chunks/b1a21a4d7d73ad7d0e47.js +0 -1
  468. package/assets/esri/core/workers/chunks/b262478da29470abb72b.js +0 -2
  469. package/assets/esri/core/workers/chunks/b75e090a7e935ff870a3.js +0 -1
  470. package/assets/esri/core/workers/chunks/bacf0c9d5d3e084dea61.js +0 -1
  471. package/assets/esri/core/workers/chunks/c0e4fd6fa1d765275248.js +0 -2
  472. package/assets/esri/core/workers/chunks/cfaa6e205bfc0c94a1b1.js +0 -1
  473. package/assets/esri/core/workers/chunks/d3f08f1a9a250cd8a2c8.js +0 -1
  474. package/assets/esri/core/workers/chunks/dcb7a3ff59677b1cf0f1.js +0 -1
  475. /package/assets/esri/core/workers/chunks/{7e57029ec958f6423d5d.js.LICENSE.txt → 549d348ca181d06aefb7.js.LICENSE.txt} +0 -0
  476. /package/assets/esri/core/workers/chunks/{9b89cc85c1b5d561df7c.js.LICENSE.txt → 55334ad3618899cdbf78.js.LICENSE.txt} +0 -0
  477. /package/assets/esri/core/workers/chunks/{b262478da29470abb72b.js.LICENSE.txt → 69c9eb93553b006b640d.js.LICENSE.txt} +0 -0
  478. /package/assets/esri/core/workers/chunks/{c0e4fd6fa1d765275248.js.LICENSE.txt → b69d1d528e271568cbd8.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{abortMaybe as t}from"../../../../core/maybe.js";import{estimateNumberArrayMemory as s}from"../../../../core/memoryEstimations.js";import{isAbortError as i}from"../../../../core/promiseUtils.js";import{signal as r}from"../../../../core/signal.js";import{Milliseconds as a,now as o}from"../../../../core/time.js";import{exactEquals as n,copy as l,normalize as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as d,exactEquals as _,intersects as c,copy as p}from"../../../../geometry/support/aaBoundingBox.js";import{makeScheduleFunction as f}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as m}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatFadeTexture as g}from"./GaussianSplatFadeTexture.js";import{GaussianSplatOrderTexture as T}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as S}from"./GaussianSplatTextureAtlas.js";import{DepthRange as b}from"../../webgl-engine/lib/DepthRange.js";import{TaskPriority as y}from"../../../support/Scheduler.js";class C{constructor(e,t){this._updating=r(!1),this._useDeterministicSort=!1,this._sortBufferMemory=0,this.visibleGaussians=0,this._visibleTileDepthRange=new b,this._previousVisibleTileDepthRangeEye=u(),this._previousVisibleTileDepthRangeViewForward=u(),this._previousVisibleTileDepthRangeClippingBox=d(),this._latestSortedGaussianTilesVersion=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._previousVisibleTileDepthRangeHasClippingBox=!1,this._bufferCapacity=0,this._requestedLyr3dVisibilityChange=0,this._latestCompletedLyr3dVisibilityChange=0,this._latestUpdatedGaussianTiles=new Array,this._latestSortedGaussianTiles=new Array,this._nextCommittedVisibleGaussianTiles=new Array,this._cameraDirectionNormalized=u(),this._frameTask=null,this._workerHandle=null,this._sortAbortController=null,this._isSorting=!1,this._pendingSortTask=!1,this._scheduledSortStartTimeout=null,this._lastSortStartTime=a(-1/0),this._sortInterval=a(80),this._renderer=e,this._onSortComplete=t,this._orderTexture=new T(this._renderer.renderingContext),this._fadingTexture=new g(this._renderer.renderingContext),this._textureAtlas=new S(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache);const{resourceController:s}=this._renderer.view;this._workerHandle=new m(f(s)),this._frameTask=s.scheduler.registerTask(y.GAUSSIAN_SPLAT_SORTING)}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get fadingTexture(){return this._fadingTexture}get textureAtlasMemory(){return this._textureAtlas.usedMemory}get orderTextureMemory(){return this._orderTexture.usedMemory}get fadingTextureMemory(){return this._fadingTexture.usedMemory}get sortBufferMemory(){return this._sortBufferMemory}get usedMemory(){return this.textureAtlasMemory+this.orderTextureMemory+this.fadingTextureMemory+this.sortBufferMemory}queryVisibleTileDepthRange(e,t){if(0===this.visibleGaussians)return null;const{eye:s,viewForward:i}=e,r=s[0],a=s[1],o=s[2],h=i[0],u=i[1],d=i[2],f=this._visibleTileDepthRange;if(this._previousVisibleTileDepthRangeTilesVersion===this._latestSortedGaussianTilesVersion&&n(this._previousVisibleTileDepthRangeEye,s)&&n(this._previousVisibleTileDepthRangeViewForward,i)&&(null==t?!this._previousVisibleTileDepthRangeHasClippingBox:this._previousVisibleTileDepthRangeHasClippingBox&&_(this._previousVisibleTileDepthRangeClippingBox,t)))return f.near<=f.far?f:null;let m=1/0,g=-1/0;const T=this._latestSortedGaussianTiles;for(let n=0;n<T.length;n++){const e=T[n];if(null!=t){const s=e.boundingBox;if(!c(s,t))continue}const s=h*(e.obbCenterX-r)+u*(e.obbCenterY-a)+d*(e.obbCenterZ-o),i=e.paddedMbsRadius,l=s-i;l<m&&(m=l);const _=s+i;_>g&&(g=_)}const S=m<=g;return S?f.set(m,g):f.set(1/0,-1/0),this._previousVisibleTileDepthRangeTilesVersion=this._latestSortedGaussianTilesVersion,this._previousVisibleTileDepthRangeHasClippingBox=null!=t,l(this._previousVisibleTileDepthRangeEye,s),l(this._previousVisibleTileDepthRangeViewForward,i),null!=t&&p(this._previousVisibleTileDepthRangeClippingBox,t),S?f:null}updateGaussianVisibility(e,t){this._latestUpdatedGaussianTiles=e,this._requestedLyr3dVisibilityChange=t,this.requestSort()}get updating(){return this._updating.value}destroy(){this._sortAbortController=t(this._sortAbortController),this._pendingSortTask=!1,this._updating.value=!1,null!=this._scheduledSortStartTimeout&&(clearTimeout(this._scheduledSortStartTimeout),this._scheduledSortStartTimeout=null),this._frameTask.remove(),this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._orderTexture.destroy(),this._fadingTexture.destroy()}requestSort(){return this._updating.value=!0,!this._pendingSortTask&&(this._pendingSortTask=!0,this._scheduleSortStart(),!0)}_scheduleSortStart(){if(this._isSorting)return;const e=o()-this._lastSortStartTime,t=this._sortInterval-e;t<=0?this._startSortIfRequired():null==this._scheduledSortStartTimeout&&(this._scheduledSortStartTimeout=setTimeout(()=>{this._scheduledSortStartTimeout=null,this._pendingSortTask&&!this._isSorting&&this._scheduleSortStart()},t))}_startSortIfRequired(){if(this._isSorting||!this._pendingSortTask)return;const e=new AbortController;this._sortAbortController=e,this._isSorting=!0,this._pendingSortTask=!1,this._lastSortStartTime=o(),this._sortOnWorker(e.signal).finally(()=>{this._sortAbortController===e&&(this._sortAbortController=null),this._handleSortComplete()})}_handleSortComplete(){this._isSorting=!1,this._pendingSortTask?this._scheduleSortStart():this._updating.value=!1}_clearBuffersAndTextures(){this._atlasIndicesBuffer=void 0,this._packedSortedAtlasIndicesBuffer=void 0,this._distancesBuffer=void 0,this._bufferCapacity=0,this._sortBufferMemory=0,this._orderTexture.clear(),this._textureAtlas.clear()}_computeExpandedCapacity(t,s){let i=Math.max(1,t);for(;i<s;)i=Math.ceil(i*e);return i}_ensureSortBufferCapacities(e){if(this._bufferCapacity<e){const t=this._computeExpandedCapacity(this._bufferCapacity,e);this._atlasIndicesBuffer=new Uint32Array(t),this._packedSortedAtlasIndicesBuffer=new Uint8Array(t*T.bytesPerPackedGaussianIndex),this._distancesBuffer=new Float64Array(t),this._bufferCapacity=t,this._sortBufferMemory=s(this._atlasIndicesBuffer,this._packedSortedAtlasIndicesBuffer,this._distancesBuffer)}}_clearAllBuffersAndTextures(){this._clearBuffersAndTextures(),this._latestSortedGaussianTiles.length=0,this._nextCommittedVisibleGaussianTiles.length=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._workerHandle?.clear()}async _sortOnWorker(e){try{if(0===this._latestUpdatedGaussianTiles.length)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=this._requestedLyr3dVisibilityChange,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);this._useDeterministicSort&&this._latestUpdatedGaussianTiles.sort((e,t)=>e.obb.centerX-t.obb.centerX||e.obb.centerY-t.obb.centerY||e.obb.centerZ-t.obb.centerZ);const t=this._latestUpdatedGaussianTiles,s=t.length,i=this._requestedLyr3dVisibilityChange;let r=0;for(let e=0;e<s;e++)r+=t[e].gaussianCount;this._ensureSortBufferCapacities(r),this._textureAtlas.ensureTextureAtlas(),h(this._cameraDirectionNormalized,this._renderer.camera.ray.direction);const a=this._cameraDirectionNormalized[0],o=this._cameraDirectionNormalized[1],n=this._cameraDirectionNormalized[2];let l=0;const u=this._atlasIndicesBuffer,d=this._distancesBuffer,_=this._renderer.clippingBox,p=this._nextCommittedVisibleGaussianTiles;p.length=0;let f=0;for(let e=0;e<s;e++){const s=t[e],{gaussianAtlasIndices:i,relativePositions:r,obb:h}=s,m=s.gaussianCount;if(null!=_&&!c(s.boundingBox,_))continue;const{centerX:g,centerY:T,centerZ:S}=h;u.set(i,l),p[f++]=s;const b=a*g+o*T+n*S,y=l+m;for(let e=l,t=0;e<y;e++,t+=3){const s=r[t],i=r[t+1],l=r[t+2];d[e]=s*a+i*o+l*n+b}l=y}if(p.length=f,0===l)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=i,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);const m={distances:this._distancesBuffer,atlasIndices:this._atlasIndicesBuffer,packedSortedAtlasIndices:this._packedSortedAtlasIndicesBuffer,numGaussians:l,preciseSort:this._useDeterministicSort},g=await(this._workerHandle?.sort(m,e));if(g&&(this._distancesBuffer=g.distances,this._atlasIndicesBuffer=g.atlasIndices,this._packedSortedAtlasIndicesBuffer=g.packedSortedAtlasIndices),e.aborted)return;const T=async e=>{this._orderTexture.setData(this._packedSortedAtlasIndicesBuffer,l);const t=this._latestSortedGaussianTiles;this._latestSortedGaussianTiles=p,this._nextCommittedVisibleGaussianTiles=t,this._latestSortedGaussianTilesVersion++,this._latestCompletedLyr3dVisibilityChange=i,this.visibleGaussians=l,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),this._renderer.requestRender(1),e.madeProgress()};await this._frameTask.schedule(T,e)}catch(t){if(i(t))return}}set useDeterministicSort(e){this._useDeterministicSort=e}}export{C as GaussianSplatDataStore};
2
+ import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{abortMaybe as t}from"../../../../core/maybe.js";import{estimateNumberArrayMemory as s}from"../../../../core/memoryEstimations.js";import{isAbortError as i}from"../../../../core/promiseUtils.js";import{signal as r}from"../../../../core/signal.js";import{Milliseconds as a,now as o}from"../../../../core/time.js";import{exactEquals as n,copy as l,normalize as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as d,exactEquals as _,intersects as c,copy as p}from"../../../../geometry/support/aaBoundingBox.js";import{makeScheduleFunction as f}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as m}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatFadeTexture as g}from"./GaussianSplatFadeTexture.js";import{GaussianSplatOrderTexture as T}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as b}from"./GaussianSplatTextureAtlas.js";import{DepthRange as S}from"../../webgl-engine/lib/DepthRange.js";import{TaskPriority as y}from"../../../support/Scheduler.js";class C{constructor(e,t){this._updating=r(!1),this._useDeterministicSort=!1,this._sortBufferMemory=0,this.visibleGaussians=0,this._visibleTileDepthRange=new S,this._previousVisibleTileDepthRangeEye=u(),this._previousVisibleTileDepthRangeViewForward=u(),this._previousVisibleTileDepthRangeClippingBox=d(),this._latestSortedGaussianTilesVersion=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._previousVisibleTileDepthRangeHasClippingBox=!1,this._bufferCapacity=0,this._requestedLyr3dVisibilityChange=0,this._latestCompletedLyr3dVisibilityChange=0,this._latestUpdatedGaussianTiles=new Array,this._latestSortedGaussianTiles=new Array,this._nextCommittedVisibleGaussianTiles=new Array,this._cameraDirectionNormalized=u(),this._frameTask=null,this._workerHandle=null,this._sortAbortController=null,this._isSorting=!1,this._pendingSortTask=!1,this._scheduledSortStartTimeout=null,this._lastSortStartTime=a(-1/0),this._sortInterval=a(80),this._renderer=e,this._onSortComplete=t,this._orderTexture=new T(this._renderer.renderingContext),this._fadingTexture=new g(this._renderer.renderingContext),this._textureAtlas=new b(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache);const{resourceController:s}=this._renderer.view;this._workerHandle=new m(f(s)),this._frameTask=s.scheduler.registerTask(y.GAUSSIAN_SPLAT_SORTING)}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get fadingTexture(){return this._fadingTexture}get textureAtlasMemory(){return this._textureAtlas.usedMemory}get orderTextureMemory(){return this._orderTexture.usedMemory}get fadingTextureMemory(){return this._fadingTexture.usedMemory}get sortBufferMemory(){return this._sortBufferMemory}get usedMemory(){return this.textureAtlasMemory+this.orderTextureMemory+this.fadingTextureMemory+this.sortBufferMemory}queryVisibleTileDepthRange(e,t){if(0===this.visibleGaussians)return null;const{eye:s,viewForward:i}=e,r=s[0],a=s[1],o=s[2],h=i[0],u=i[1],d=i[2],f=this._visibleTileDepthRange;if(this._previousVisibleTileDepthRangeTilesVersion===this._latestSortedGaussianTilesVersion&&n(this._previousVisibleTileDepthRangeEye,s)&&n(this._previousVisibleTileDepthRangeViewForward,i)&&(null==t?!this._previousVisibleTileDepthRangeHasClippingBox:this._previousVisibleTileDepthRangeHasClippingBox&&_(this._previousVisibleTileDepthRangeClippingBox,t)))return f.near<=f.far?f:null;let m=1/0,g=-1/0;const T=this._latestSortedGaussianTiles;for(let n=0;n<T.length;n++){const e=T[n];if(null!=t){const s=e.boundingBox;if(!c(s,t))continue}const s=h*(e.obbCenterX-r)+u*(e.obbCenterY-a)+d*(e.obbCenterZ-o),i=e.paddedMbsRadius,l=s-i;l<m&&(m=l);const _=s+i;_>g&&(g=_)}const b=m<=g;return b?f.set(m,g):f.set(1/0,-1/0),this._previousVisibleTileDepthRangeTilesVersion=this._latestSortedGaussianTilesVersion,this._previousVisibleTileDepthRangeHasClippingBox=null!=t,l(this._previousVisibleTileDepthRangeEye,s),l(this._previousVisibleTileDepthRangeViewForward,i),null!=t&&p(this._previousVisibleTileDepthRangeClippingBox,t),b?f:null}updateGaussianVisibility(e,t){this._latestUpdatedGaussianTiles=e,this._requestedLyr3dVisibilityChange=t,this.requestSort()}get updating(){return this._updating.value}destroy(){this._sortAbortController=t(this._sortAbortController),this._pendingSortTask=!1,this._updating.value=!1,null!=this._scheduledSortStartTimeout&&(clearTimeout(this._scheduledSortStartTimeout),this._scheduledSortStartTimeout=null),this._frameTask.remove(),this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._orderTexture.destroy(),this._fadingTexture.destroy()}requestSort(){return this._updating.value=!0,!this._pendingSortTask&&(this._pendingSortTask=!0,this._scheduleSortStart(),!0)}_scheduleSortStart(){if(this._isSorting)return;const e=o()-this._lastSortStartTime,t=this._sortInterval-e;t<=0?this._startSortIfRequired():null==this._scheduledSortStartTimeout&&(this._scheduledSortStartTimeout=setTimeout(()=>{this._scheduledSortStartTimeout=null,this._pendingSortTask&&!this._isSorting&&this._scheduleSortStart()},t))}_startSortIfRequired(){if(this._isSorting||!this._pendingSortTask)return;const e=new AbortController;this._sortAbortController=e,this._isSorting=!0,this._pendingSortTask=!1,this._lastSortStartTime=o(),this._sortOnWorker(e.signal).finally(()=>{this._sortAbortController===e&&(this._sortAbortController=null),this._handleSortComplete()})}_handleSortComplete(){this._isSorting=!1,this._pendingSortTask?this._scheduleSortStart():this._updating.value=!1}_clearBuffersAndTextures(){this._atlasIndicesBuffer=void 0,this._packedSortedAtlasIndicesBuffer=void 0,this._distancesBuffer=void 0,this._bufferCapacity=0,this._sortBufferMemory=0,this._orderTexture.clear(),this._textureAtlas.clear()}_computeExpandedCapacity(t,s){let i=Math.max(1,t);for(;i<s;)i=Math.ceil(i*e);return i}_ensureSortBufferCapacities(e){if(this._bufferCapacity<e){const t=this._computeExpandedCapacity(this._bufferCapacity,e);this._atlasIndicesBuffer=new Uint32Array(t),this._packedSortedAtlasIndicesBuffer=new Uint8Array(t*T.bytesPerPackedGaussianIndex),this._distancesBuffer=new Float64Array(t),this._bufferCapacity=t,this._sortBufferMemory=s(this._atlasIndicesBuffer,this._packedSortedAtlasIndicesBuffer,this._distancesBuffer)}}_clearAllBuffersAndTextures(){this._clearBuffersAndTextures(),this._latestSortedGaussianTiles.length=0,this._nextCommittedVisibleGaussianTiles.length=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._workerHandle?.clear()}async _sortOnWorker(e){try{if(0===this._latestUpdatedGaussianTiles.length)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=this._requestedLyr3dVisibilityChange,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);this._useDeterministicSort&&this._latestUpdatedGaussianTiles.sort((e,t)=>e.obb.centerX-t.obb.centerX||e.obb.centerY-t.obb.centerY||e.obb.centerZ-t.obb.centerZ);const t=this._latestUpdatedGaussianTiles,s=t.length,i=this._requestedLyr3dVisibilityChange;let r=0;for(let e=0;e<s;e++)r+=t[e].gaussianCount;this._ensureSortBufferCapacities(r),this._textureAtlas.ensureTextureAtlas();const a=this._renderer.camera;h(this._cameraDirectionNormalized,a.ray.direction);const o=this._cameraDirectionNormalized[0],n=this._cameraDirectionNormalized[1],l=this._cameraDirectionNormalized[2];let u=0;const d=this._atlasIndicesBuffer,_=this._distancesBuffer,p=this._renderer.clippingBox,f=this._nextCommittedVisibleGaussianTiles;f.length=0;let m=0;const{frustum:g}=a,T=this._renderer.tileCullingRevision,b=g[0],S=g[1],y=g[2],C=g[3],x=g[4],V=g[5];for(let e=0;e<s;e++){const s=t[e],{gaussianAtlasIndices:i,relativePositions:r,obbCenterX:a,obbCenterY:h,obbCenterZ:g,paddedMbsRadius:v}=s,A=s.gaussianCount;if(s.cullingRevision!==T){let e=null==p||c(s.boundingBox,p);if(e){const t=1.5*v;e=b[0]*a+b[1]*h+b[2]*g+b[3]<t&&S[0]*a+S[1]*h+S[2]*g+S[3]<t&&y[0]*a+y[1]*h+y[2]*g+y[3]<t&&C[0]*a+C[1]*h+C[2]*g+C[3]<t&&x[0]*a+x[1]*h+x[2]*g+x[3]<t&&V[0]*a+V[1]*h+V[2]*g+V[3]<t}s.cullingRevision=T,s.cullingVisible=e}if(!s.cullingVisible)continue;d.set(i,u),f[m++]=s;const B=o*a+n*h+l*g,G=u+A;for(let e=u,t=0;e<G;e++,t+=3){const s=r[t],i=r[t+1],a=r[t+2];_[e]=s*o+i*n+a*l+B}u=G}if(f.length=m,0===u)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=i,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);const v={distances:this._distancesBuffer,atlasIndices:this._atlasIndicesBuffer,packedSortedAtlasIndices:this._packedSortedAtlasIndicesBuffer,numGaussians:u,preciseSort:this._useDeterministicSort},A=await(this._workerHandle?.sort(v,e));if(A&&(this._distancesBuffer=A.distances,this._atlasIndicesBuffer=A.atlasIndices,this._packedSortedAtlasIndicesBuffer=A.packedSortedAtlasIndices),e.aborted)return;const B=async e=>{this._orderTexture.setData(this._packedSortedAtlasIndicesBuffer,u);const t=this._latestSortedGaussianTiles;this._latestSortedGaussianTiles=f,this._nextCommittedVisibleGaussianTiles=t,this._latestSortedGaussianTilesVersion++,this._latestCompletedLyr3dVisibilityChange=i,this.visibleGaussians=u,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),this._renderer.requestRender(1),e.madeProgress()};await this._frameTask.schedule(B,e)}catch(t){if(i(t))return}}set useDeterministicSort(e){this._useDeterministicSort=e}}export{C as GaussianSplatDataStore};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{subtract as t,length as i,scale as e,negate as s,dot as n,transformQuatValues as o,set as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as c}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{project as u}from"../../../../geometry/projectionUtils.js";import{intersects as d,contains as p}from"../../../../geometry/support/aaBoundingBox.js";import{fromExtent as f}from"../../../../geometry/support/aaBoundingRect.js";import{create as h}from"../../../../geometry/support/plane.js";import{fromPoints as m}from"../../../../geometry/support/ray.js";import{GaussianSplatTarget as g}from"../../layers/i3s/Intersector.js";import{createTileBVH as y}from"../../layers/support/Tiles3DBVH.js";import{ElevationRange as b}from"../ElevationRange.js";import{IntersectorResult as w}from"../../webgl-engine/lib/IntersectorResult.js";class v{constructor(t){this.layerView=t,this.type=0,this.slicePlaneEnabled=!1,this.isGround=!1,this._ellipsoidLocalRayOrigin=l(),this._ellipsoidLocalRayDir=l(),this.intersectionNormal=l(),this.intersectionRayDir=l(),this.intersectionPlane=h(),this.layerViewUid=t.uid;const i=t.view.viewingMode,e=(t.useEsriCrs?t.fullExtentInLocalViewSpatialReference:t.layer.fullExtent?u(t.layer.fullExtent,t.view.renderSpatialReference):void 0)??t.view.extent,s=f(e);this._bvh=y(i,s)}destroy(){this._bvh.destroy()}addTile(t){this._bvh.addTile(t)}removeTile(t){this._bvh.removeTile(t)}intersect(o,l,u,f,h,y){const{intersectionRayDir:b,intersectionPlane:v,layerViewUid:_,intersectionNormal:j}=this,E=m(u,f);t(b,f,u);const M=1/i(b);e(b,b,M),s(j,b),c(v,b[0],b[1],b[2],-n(b,u));const S=new x,V=new x,k=o.options.store,T=0===k,q=2===k,B=1===k||q,D=q?new Array:null,P=(t,i,e,s,n)=>(t.point=t.point?r(t.point,e,s,n):a(e,s,n),t.dist=i,t.normal=j,t.layerViewUid=_,t),U=u[0],I=u[1],L=u[2],G=b[0],C=b[1],A=b[2],N=this.layerView.clippingBox,O=t=>{const{relativePositions:i,packedRotations:e,packedScales:s,gaussianCount:n,obb:o,maxSplatMbsRadiusSquared:r}=t,a=o.centerX,c=o.centerY,d=o.centerZ;let p=-1;const h=N[0],m=N[1],g=N[2],y=N[3],b=N[4],w=N[5];for(let v=0,R=0;v<n;v++,R+=3){const t=i[R]+a,n=i[R+1]+c,o=i[R+2]+d;if(t<h||n<m||o<g||t>y||n>b||o>w)continue;const _=t-U,j=n-I,E=o-L,k=_*G+j*C+E*A;if(k<0&&k*k>r)continue;const N=k<0?0:k;if(_*_+j*j+E*E-N*N>r)continue;if(T&&null!=S.dist){p<0&&(p=Math.sqrt(r));if(Math.max(k-p,0)*M>=S.dist)continue}const O=this._intersectGaussianEllipsoid(_,j,E,G,C,A,e[v],s[v]);if(O<0)continue;const X=O*M;if(null!=l&&!l(u,f,X))continue;const Y=null==S.dist||X<S.dist,Z=B&&(null==V.dist||X>V.dist);if(!Y&&!Z&&!q)continue;const F=U+G*O,H=I+C*O,Q=L+A*O;if(Y&&P(S,X,F,H,Q),Z&&P(V,X,F,H,Q),q){const t=new x;D.push(P(t,X,F,H,Q))}}},X=t=>{const{relativePositions:i,packedRotations:e,packedScales:s,gaussianCount:n,obb:o,maxSplatMbsRadiusSquared:r}=t,a=o.centerX,c=o.centerY,d=o.centerZ;let p=-1;const h=U-a,m=I-c,g=L-d;for(let y=0,b=0;y<n;y++,b+=3){const t=i[b]-h,n=i[b+1]-m,o=i[b+2]-g,a=t*G+n*C+o*A;if(a<0&&a*a>r)continue;const c=a<0?0:a;if(t*t+n*n+o*o-c*c>r)continue;if(T&&null!=S.dist){p<0&&(p=Math.sqrt(r));if(Math.max(a-p,0)*M>=S.dist)continue}const d=this._intersectGaussianEllipsoid(t,n,o,G,C,A,e[y],s[y]);if(d<0)continue;const w=d*M;if(null!=l&&!l(u,f,w))continue;const v=null==S.dist||w<S.dist,R=B&&(null==V.dist||w>V.dist);if(!v&&!R&&!q)continue;const _=U+G*d,j=I+C*d,E=L+A*d;if(v&&P(S,w,_,j,E),R&&P(V,w,_,j,E),q){const t=new x;D.push(P(t,w,_,j,E))}}},Y=(t,i)=>{const{min:e,max:s}=t.obb.signedDistanceRangePlane(v);if(s<0)return;const n=e*M;if(!(T&&null!=S.dist&&S.dist<n)){if(null!=S.dist&&null!=V.dist){const t=s*M;if(S.dist<n&&V.dist>t)return}i?O(t):X(t)}},Z=t=>{Y(t,!1)},F=t=>{const i=t.boundingBox;d(i,N)&&Y(t,!p(N,i))};this._bvh.forEachTileIntersectingRay(u,f,null!=N?F:Z,y);const H=(t,i)=>{const{layerViewUid:e}=i,s=new g(i.point,e);t.set(0,s,i.dist,i.normal)};if(R(S)){const t=o.results.min;(null==t.distance||S.dist<t.distance)&&H(t,S)}if(R(V)&&B){const t=o.results.max;(null==t.distance||V.dist>t.distance)&&H(t,V)}if(q&&D?.length)for(const t of D){const i=new w(E);H(i,t),o.results.all.push(i)}}_intersectGaussianEllipsoid(t,i,e,s,n,r,l,a){const c=l>>>30,u=1023&l,d=l>>>10&1023,p=l>>>20&1023,f=(u&_)*j*(1-2*(u>>>9&1)),h=(d&_)*j*(1-2*(d>>>9&1)),m=(p&_)*j*(1-2*(p>>>9&1));let g,y,b,w;const v=f*f+h*h+m*m,R=Math.sqrt(Math.max(0,1-v));switch(c){case 0:g=R,y=m,b=h,w=f;break;case 1:g=m,y=R,b=h,w=f;break;case 2:g=m,y=h,b=R,w=f;break;default:g=m,y=h,b=f,w=R}const x=this._ellipsoidLocalRayOrigin;x[0]=-t,x[1]=-i,x[2]=-e,o(x,x,-g,-y,-b,w);const M=this._ellipsoidLocalRayDir;M[0]=s,M[1]=n,M[2]=r,o(M,M,-g,-y,-b,w);const V=S[255&a],k=S[a>>>8&255],T=S[a>>>16],q=x[0]*V,B=x[1]*k,D=x[2]*T,P=q*q+B*B+D*D;if(P<=1)return 0;const U=M[0]*V,I=M[1]*k,L=M[2]*T,G=U*U+I*I+L*L,C=q*U+B*I+D*L;if(C>0)return E;const A=C*C-G*(P-1);return A<0?E:(-C-Math.sqrt(A))/G}getElevationRange(t){return this._bvh.getElevationRangeIntersectingSphere(t)??new b(0,0)}}function R(t){return null!=t.dist&&null!=t.point}class x{constructor(){this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}const _=511,j=Math.SQRT1_2/_,E=-1,M=3,S=(()=>{const t=new Float64Array(256);for(let i=0;i<t.length;i++)t[i]=Math.exp(10-i/16)/M;return t})();export{v as GaussianSplatIntersectionHandler};
2
+ import{subtract as t,length as i,scale as e,negate as n,dot as s,transformQuatValues as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as l}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{project as a}from"../../../../geometry/projectionUtils.js";import{intersects as c,contains as u}from"../../../../geometry/support/aaBoundingBox.js";import{fromExtent as d}from"../../../../geometry/support/aaBoundingRect.js";import{create as p}from"../../../../geometry/support/plane.js";import{fromPoints as f}from"../../../../geometry/support/ray.js";import{GaussianSplatTarget as h}from"../../layers/i3s/Intersector.js";import{createTileBVH as m}from"../../layers/support/Tiles3DBVH.js";import{ElevationRange as y}from"../ElevationRange.js";import{IntersectorResult as g}from"../../webgl-engine/lib/IntersectorResult.js";class w{constructor(t){this.layerView=t,this.type=0,this.slicePlaneEnabled=!1,this.isGround=!1,this._ellipsoidLocalRayOrigin=r(),this._ellipsoidLocalRayDir=r(),this.intersectionNormal=r(),this.intersectionRayDir=r(),this.intersectionPlane=p(),this.layerViewUid=t.uid;const i=t.view.viewingMode,e=(t.useEsriCrs?t.fullExtentInLocalViewSpatialReference:t.layer.fullExtent?a(t.layer.fullExtent,t.view.renderSpatialReference):void 0)??t.view.extent,n=d(e);this._bvh=m(i,n)}destroy(){this._bvh.destroy()}addTile(t){this._bvh.addTile(t)}removeTile(t){this._bvh.removeTile(t)}intersect(o,a,d,p,m,y){const{intersectionRayDir:w,intersectionPlane:R,layerViewUid:x,intersectionNormal:_}=this,j=f(d,p);t(w,p,d);const M=1/i(w);e(w,w,M),n(_,w),l(R,w[0],w[1],w[2],-s(w,d));const E=new v,S=new v,D=o.options.store,V=0===D,k=2===D,q=1===D||k,T=k?new Array:null,B=(t,i,e,n,s,o,l,a)=>{const c=t.point??(t.point=r());c[0]=e,c[1]=n,c[2]=s,t.dist=i,t.normal=_;const u=t.outwardDirection??(t.outwardDirection=r()),d=o*o+l*l+a*a;if(d>0){const t=1/Math.sqrt(d);u[0]=o*t,u[1]=l*t,u[2]=a*t}else u[0]=_[0],u[1]=_[1],u[2]=_[2];return t.layerViewUid=x,t},P=d[0],U=d[1],I=d[2],L=w[0],G=w[1],O=w[2],C=this.layerView.clippingBox,A=t=>{const{relativePositions:i,packedRotations:e,packedOpacityScaledScales:n,gaussianCount:s,obb:o,maxSplatMbsRadiusSquared:r}=t,l=o.centerX,c=o.centerY,u=o.centerZ;let f=-1;const h=C[0],m=C[1],y=C[2],g=C[3],w=C[4],b=C[5];for(let R=0,x=0;R<s;R++,x+=3){const t=i[x]+l,s=i[x+1]+c,o=i[x+2]+u;if(t<h||s<m||o<y||t>g||s>w||o>b)continue;const _=t-P,j=s-U,D=o-I,C=_*L+j*G+D*O;if(C<0&&C*C>r)continue;const A=C<0?0:C;if(_*_+j*j+D*D-A*A>r)continue;if(V&&null!=E.dist){f<0&&(f=Math.sqrt(r));if(Math.max(C-f,0)*M>=E.dist)continue}const N=this._intersectGaussianEllipsoid(_,j,D,L,G,O,e[R],n[R]);if(N<0)continue;const X=N*M;if(null!=a&&!a(d,p,X))continue;const Y=null==E.dist||X<E.dist,Z=q&&(null==S.dist||X>S.dist);if(!Y&&!Z&&!k)continue;const F=L*N,H=G*N,Q=O*N,z=P+F,J=U+H,K=I+Q,W=F-_,$=H-j,tt=Q-D;if(Y&&B(E,X,z,J,K,W,$,tt),Z&&B(S,X,z,J,K,W,$,tt),k){const t=new v;T.push(B(t,X,z,J,K,W,$,tt))}}},N=t=>{const{relativePositions:i,packedRotations:e,packedOpacityScaledScales:n,gaussianCount:s,obb:o,maxSplatMbsRadiusSquared:r}=t,l=o.centerX,c=o.centerY,u=o.centerZ;let f=-1;const h=P-l,m=U-c,y=I-u;for(let g=0,w=0;g<s;g++,w+=3){const t=i[w]-h,s=i[w+1]-m,o=i[w+2]-y,l=t*L+s*G+o*O;if(l<0&&l*l>r)continue;const c=l<0?0:l;if(t*t+s*s+o*o-c*c>r)continue;if(V&&null!=E.dist){f<0&&(f=Math.sqrt(r));if(Math.max(l-f,0)*M>=E.dist)continue}const u=this._intersectGaussianEllipsoid(t,s,o,L,G,O,e[g],n[g]);if(u<0)continue;const b=u*M;if(null!=a&&!a(d,p,b))continue;const R=null==E.dist||b<E.dist,x=q&&(null==S.dist||b>S.dist);if(!R&&!x&&!k)continue;const _=L*u,j=G*u,D=O*u,C=P+_,A=U+j,N=I+D,X=_-t,Y=j-s,Z=D-o;if(R&&B(E,b,C,A,N,X,Y,Z),x&&B(S,b,C,A,N,X,Y,Z),k){const t=new v;T.push(B(t,b,C,A,N,X,Y,Z))}}},X=(t,i)=>{const{min:e,max:n}=t.obb.signedDistanceRangePlane(R);if(n<0)return;const s=e*M;if(!(V&&null!=E.dist&&E.dist<s)){if(null!=E.dist&&null!=S.dist){const t=n*M;if(E.dist<s&&S.dist>t)return}i?A(t):N(t)}},Y=t=>{X(t,!1)},Z=t=>{const i=t.boundingBox;c(i,C)&&X(t,!u(C,i))};this._bvh.forEachTileIntersectingRay(d,p,null!=C?Z:Y,y);const F=(t,i)=>{const{layerViewUid:e}=i,n=new h(i.point,i.outwardDirection,e);t.set(0,n,i.dist,i.normal)};if(b(E)){const t=o.results.min;(null==t.distance||E.dist<t.distance)&&F(t,E)}if(b(S)&&q){const t=o.results.max;(null==t.distance||S.dist>t.distance)&&F(t,S)}if(k&&T?.length)for(const t of T){const i=new g(j);F(i,t),o.results.all.push(i)}}_intersectGaussianEllipsoid(t,i,e,n,s,r,l,a){const c=l>>>30,u=1023&l,d=l>>>10&1023,p=l>>>20&1023,f=(u&R)*x*(1-2*(u>>>9&1)),h=(d&R)*x*(1-2*(d>>>9&1)),m=(p&R)*x*(1-2*(p>>>9&1));let y,g,w,b;const v=f*f+h*h+m*m,j=Math.sqrt(Math.max(0,1-v));switch(c){case 0:y=j,g=m,w=h,b=f;break;case 1:y=m,g=j,w=h,b=f;break;case 2:y=m,g=h,w=j,b=f;break;default:y=m,g=h,w=f,b=j}const E=this._ellipsoidLocalRayOrigin;E[0]=-t,E[1]=-i,E[2]=-e,o(E,E,-y,-g,-w,b);const S=this._ellipsoidLocalRayDir;S[0]=n,S[1]=s,S[2]=r,o(S,S,-y,-g,-w,b);const D=M[255&a],V=M[a>>>8&255],k=M[a>>>16],q=E[0]*D,T=E[1]*V,B=E[2]*k,P=q*q+T*T+B*B;if(P<=1)return 0;const U=S[0]*D,I=S[1]*V,L=S[2]*k,G=U*U+I*I+L*L,O=q*U+T*I+B*L;if(O>0)return _;const C=O*O-G*(P-1);return C<0?_:(-O-Math.sqrt(C))/G}getElevationRange(t){return this._bvh.getElevationRangeIntersectingSphere(t)??new y(0,0)}}function b(t){return null!=t.dist&&null!=t.point}class v{constructor(){this.point=null,this.dist=null,this.normal=null,this.outwardDirection=null,this.layerViewUid=""}}const R=511,x=Math.SQRT1_2/R,_=-1,j=3,M=(()=>{const t=new Float64Array(256);for(let i=0;i<t.length;i++)t[i]=Math.exp(10-i/16)/j;return t})();export{w as GaussianSplatIntersectionHandler};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{reallocGrowthFactor as t}from"../../../../core/arrayUtils.js";import{initialSplatAtlasTextureHeight as e,GaussianSplatAtlasPages as s,splatAtlasTextureWidth as r,elementsPerSplatPage as a}from"./GaussianSplatAtlasPages.js";import{GaussianSplatOrderTexture as i}from"./GaussianSplatOrderTexture.js";import{PixelType as l,SizedPixelFormat as u}from"../../../webgl/enums.js";import{DisposableFramebufferObject as o}from"../../../webgl/FramebufferObject.js";import h from"../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../webgl/TextureDescriptor.js";class c{constructor(t,r,a){this._splatAtlasTextureHeight=e,this.texture=null,this._rctx=t,this._fboCache=a,this.pageAllocator=new s,this._cache=r.newCache("gaussian texture cache",t=>t.dispose())}get usedMemory(){return this.texture?.usedMemory??0}ensureTextureAtlas(){if(this.texture?.hasWebGLTextureObject)return;this.texture=null;const t=this._cache.pop("splatTextureAtlas");if(t)return void(this.texture=t);const e=new p;e.height=this._splatAtlasTextureHeight,e.width=r,e.pixelFormat=36249,e.dataType=l.UNSIGNED_INT,e.internalFormat=u.RGBA32UI,e.samplingMode=9728,e.wrapMode=33071,e.isImmutable=!0,this.texture=new h(this._rctx,e),this._updatePageAllocator()}grow(){if(!this.texture)return this.ensureTextureAtlas(),!1;const e=Math.floor(this._splatAtlasTextureHeight*t),s=Math.min(e,x);if(s<=this._splatAtlasTextureHeight)return!1;if(s*r>this._rctx.parameters.maxPreferredTexturePixels)return!1;const a=new o(this._rctx,this.texture),i=this._fboCache.acquire(r,s,"gaussian splat atlas resize",12);return this._rctx.blitFramebuffer(a,i.fbo,16384,9728,0,0,r,this._splatAtlasTextureHeight,0,0,r,this._splatAtlasTextureHeight),this.texture?.dispose(),this.texture=i.fbo?.detachColorTexture(),a.dispose(),i.dispose(),this._splatAtlasTextureHeight=s,this._updatePageAllocator(),!0}requestPage(){let t=this.pageAllocator.findFirstFreePage();return null===t&&this.grow()&&(t=this.pageAllocator.findFirstFreePage()),null!==t&&this.pageAllocator.allocate(t),t}freePage(t){this.pageAllocator.free(t)}update(t,e,s){this.ensureTextureAtlas(),this.texture.updateData(0,t,e,a,1,s)}_updatePageAllocator(){const t=r*this._splatAtlasTextureHeight/a;this.pageAllocator.pageCount!==t&&this.pageAllocator.resize(t)}clear(){this.texture&&(this._cache.put("splatTextureAtlas",this.texture),this.texture=null)}destroy(){this._cache.destroy(),this.texture?.dispose(),this.texture=null}}const x=2**(8*i.bytesPerPackedGaussianIndex)/r;export{c as GaussianSplatTextureAtlas};
2
+ import{reallocGrowthFactor as t}from"../../../../core/arrayUtils.js";import{initialSplatAtlasTextureHeight as e,GaussianSplatAtlasPages as s,splatAtlasTextureWidth as r,elementsPerSplatPage as a}from"./GaussianSplatAtlasPages.js";import{GaussianSplatOrderTexture as i}from"./GaussianSplatOrderTexture.js";import{PixelType as l,SizedPixelFormat as u}from"../../../webgl/enums.js";import{DisposableFramebufferObject as o}from"../../../webgl/FramebufferObject.js";import h from"../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../webgl/TextureDescriptor.js";class c{constructor(t,r,a){this._splatAtlasTextureHeight=e,this.texture=null,this._rctx=t,this._fboCache=a,this.pageAllocator=new s,this._cache=r.newCache("gaussian texture cache",t=>t.dispose())}get usedMemory(){return this.texture?.usedMemory??0}ensureTextureAtlas(){if(this.texture?.hasWebGLTextureObject)return;this.texture=null;const t=this._cache.pop("splatTextureAtlas");if(t)return void(this.texture=t);const e=new p;e.height=this._splatAtlasTextureHeight,e.width=r,e.pixelFormat=36249,e.dataType=l.UNSIGNED_INT,e.internalFormat=u.RGBA32UI,e.samplingMode=9728,e.wrapMode=33071,e.isImmutable=!0,this.texture=new h(this._rctx,e),this._updatePageAllocator()}grow(){if(!this.texture)return this.ensureTextureAtlas(),!1;const e=Math.floor(this._splatAtlasTextureHeight*t),s=Math.min(e,x);if(s<=this._splatAtlasTextureHeight)return!1;if(s*r>this._rctx.parameters.maxPreferredTexturePixels)return!1;const a=new o(this._rctx,this.texture),i=this._fboCache.acquire(r,s,"gaussian splat atlas resize",12);return this._rctx.blitFramebuffer(a,i.fbo,16384,9728,0,0,r,this._splatAtlasTextureHeight,0,0,r,this._splatAtlasTextureHeight),this.texture=i.fbo?.detachColorTexture(),a.dispose(),i.dispose(),this._splatAtlasTextureHeight=s,this._updatePageAllocator(),!0}requestPage(){let t=this.pageAllocator.findFirstFreePage();return null===t&&this.grow()&&(t=this.pageAllocator.findFirstFreePage()),null!==t&&this.pageAllocator.allocate(t),t}freePage(t){this.pageAllocator.free(t)}update(t,e,s){this.ensureTextureAtlas(),this.texture.updateData(0,t,e,a,1,s)}_updatePageAllocator(){const t=r*this._splatAtlasTextureHeight/a;this.pageAllocator.pageCount!==t&&this.pageAllocator.resize(t)}clear(){this.texture&&(this._cache.put("splatTextureAtlas",this.texture),this.texture=null)}destroy(){this._cache.destroy(),this.texture?.dispose(),this.texture=null}}const x=2**(8*i.bytesPerPackedGaussianIndex)/r;export{c as GaussianSplatTextureAtlas};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as e,diameter as i}from"../../../../geometry/support/aaBoundingBox.js";class o{constructor(o,r,n,a,h,b,c,u,d,m){this.handle=o,this.obb=r,this.gaussianAtlasIndices=n,this.pageIds=a,this.relativePositions=h,this.packedRotations=b,this.packedScales=c,this.gaussianCount=u,this.maxSplatMbsRadiusSquared=d,this.elevationRange=m,this.bvhIntersectionGeneration=0,this.lifecycleState=0,this.fadeDirection=0,this.opacityModifier=0,this.usedMemory=t(this.gaussianAtlasIndices,this.pageIds,this.relativePositions,this.packedRotations,this.packedScales);const l=s();r.getCenter(l),this.obbCenterX=l[0],this.obbCenterY=l[1],this.obbCenterZ=l[2];const f=r.radius??-1;this._mbsRadius=f;const p=f<0?-1:f*f;this._mbsRadiusSquared=p;const g=r.halfSize;this._obbShortestHalfsize=g?Math.min(g[0],g[1],g[2]):0;const S=e();r.toAaBoundingBox(S),this.boundingBox=S;const R=f>=0?f:.5*i(S);this.paddedMbsRadius=R+Math.sqrt(Math.max(0,d))}boundingVolumeIntersectsRay(t,s){if(!this.obb)return!0;const{obbCenterX:e,obbCenterY:i,obbCenterZ:o}=this,r=e-t[0],n=i-t[1],a=o-t[2],h=r*s[0]+n*s[1]+a*s[2],b=r*r+n*n+a*a-h*h;return(this._mbsRadiusSquared<0||b<=this._mbsRadiusSquared)&&this.obb.intersectRay(t,s)}boundingVolumeIntersectsSphere(t){const s=this._mbsRadius;if(s<0)return!0;const e=t.center,i=t.radius,o=s+i,r=this.obbCenterX-e[0];if(r>o)return!1;const n=this.obbCenterY-e[1];if(n>o)return!1;const a=this.obbCenterZ-e[2];if(a>o)return!1;const h=r*r+n*n+a*a;if(h>o*o)return!1;if(h<=(this._obbShortestHalfsize+i)**2)return!0;return Math.sqrt(h)+s<=i||(this.obb?.intersectSphere(t)??!0)}}export{o as GaussianTile};
2
+ import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as i,diameter as e}from"../../../../geometry/support/aaBoundingBox.js";class o{constructor(o,n,r,a,h,c,b,u,d,l){this.handle=o,this.obb=n,this.gaussianAtlasIndices=r,this.pageIds=a,this.relativePositions=h,this.packedRotations=c,this.packedOpacityScaledScales=b,this.gaussianCount=u,this.maxSplatMbsRadiusSquared=d,this.elevationRange=l,this.bvhIntersectionGeneration=0,this.lifecycleState=0,this.cullingRevision=-1,this.cullingVisible=!1,this.fadeDirection=0,this.opacityModifier=0,this.usedMemory=t(this.gaussianAtlasIndices,this.pageIds,this.relativePositions,this.packedRotations,this.packedOpacityScaledScales);const m=s();n.getCenter(m),this.obbCenterX=m[0],this.obbCenterY=m[1],this.obbCenterZ=m[2];const p=n.radius??-1;this._mbsRadius=p;const f=p<0?-1:p*p;this._mbsRadiusSquared=f;const g=n.halfSize;this._obbShortestHalfsize=g?Math.min(g[0],g[1],g[2]):0;const S=i();n.toAaBoundingBox(S),this.boundingBox=S;const R=p>=0?p:.5*e(S);this.paddedMbsRadius=R+Math.sqrt(Math.max(0,d))}boundingVolumeIntersectsRay(t,s){if(!this.obb)return!0;const{obbCenterX:i,obbCenterY:e,obbCenterZ:o}=this,n=i-t[0],r=e-t[1],a=o-t[2],h=n*s[0]+r*s[1]+a*s[2],c=n*n+r*r+a*a-h*h;return(this._mbsRadiusSquared<0||c<=this._mbsRadiusSquared)&&this.obb.intersectRay(t,s)}boundingVolumeIntersectsSphere(t){const s=this._mbsRadius;if(s<0)return!0;const i=t.center,e=t.radius,o=s+e,n=this.obbCenterX-i[0];if(n>o)return!1;const r=this.obbCenterY-i[1];if(r>o)return!1;const a=this.obbCenterZ-i[2];if(a>o)return!1;const h=n*n+r*r+a*a;if(h>o*o)return!1;if(h<=(this._obbShortestHalfsize+e)**2)return!0;return Math.sqrt(h)+s<=e||(this.obb?.intersectSphere(t)??!0)}}export{o as GaussianTile};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- function t(t,o,n){const r=o/3,c=new Uint32Array(n+1),e=new Uint32Array(n+1),s=(t,o)=>{t<o?c[t+1]++:e[o+1]++};for(let x=0;x<r;x++){const o=t[3*x],n=t[3*x+1],r=t[3*x+2];s(o,n),s(n,r),s(r,o)}let f=0,l=0;for(let x=0;x<n;x++){const t=c[x+1],o=e[x+1];c[x+1]=f,e[x+1]=l,f+=t,l+=o}const i=new Uint32Array(6*r),a=c[n],w=(t,o,n)=>{if(t<o){const r=c[t+1]++;i[2*r]=o,i[2*r+1]=n}else{const r=e[o+1]++;i[2*a+2*r]=t,i[2*a+2*r+1]=n}};for(let x=0;x<r;x++){const o=t[3*x],n=t[3*x+1],r=t[3*x+2];w(o,n,x),w(n,r,x),w(r,o,x)}const y=(t,o)=>{const n=2*t,r=o-t;for(let c=1;c<r;c++){const t=i[n+2*c],o=i[n+2*c+1];let r=c-1;for(;r>=0&&i[n+2*r]>t;r--)i[n+2*r+2]=i[n+2*r],i[n+2*r+3]=i[n+2*r+1];i[n+2*r+2]=t,i[n+2*r+3]=o}};for(let x=0;x<n;x++)y(c[x],c[x+1]),y(a+e[x],a+e[x+1]);const A=new Int32Array(3*r),U=(o,n)=>o===t[3*n]?0:o===t[3*n+1]?1:o===t[3*n+2]?2:-1,u=(t,o)=>{const n=U(t,o);A[3*o+n]=-1},p=(t,o,n,r)=>{const c=U(t,o);A[3*o+c]=r;const e=U(n,r);A[3*r+e]=o};for(let x=0;x<n;x++){let t=c[x];const o=c[x+1];let n=e[x];const r=e[x+1];for(;t<o&&n<r;){const o=i[2*t],r=i[2*a+2*n];o===r?(p(x,i[2*t+1],r,i[2*a+2*n+1]),t++,n++):o<r?(u(x,i[2*t+1]),t++):(u(r,i[2*a+2*n+1]),n++)}for(;t<o;)u(x,i[2*t+1]),t++;for(;n<r;){u(i[2*a+2*n],i[2*a+2*n+1]),n++}}return A}export{t as computeNeighbors};
2
+ function t(t,n,o){const r=n/3,e=new Uint32Array(o+1),s=new Uint32Array(o+1),c=(t,n)=>{t<n?e[t+1]++:s[n+1]++};for(let U=0;U<r;U++){const n=t[3*U],o=t[3*U+1],r=t[3*U+2];c(n,o),c(o,r),c(r,n)}let f=0,l=0;for(let U=0;U<o;U++){const t=e[U+1],n=s[U+1];e[U+1]=f,s[U+1]=l,f+=t,l+=n}const i=new Uint32Array(6*r),u=e[o],p=(t,n,o)=>{if(t<n){const r=e[t+1]++;i[2*r]=n,i[2*r+1]=o}else{const r=s[n+1]++;i[2*u+2*r]=t,i[2*u+2*r+1]=o}};for(let U=0;U<r;U++){const n=t[3*U],o=t[3*U+1],r=t[3*U+2];p(n,o,U),p(o,r,U),p(r,n,U)}const a=(t,n)=>{const o=2*t,r=n-t;for(let e=1;e<r;e++){const t=i[o+2*e],n=i[o+2*e+1];let r=e-1;for(;r>=0&&i[o+2*r]>t;r--)i[o+2*r+2]=i[o+2*r],i[o+2*r+3]=i[o+2*r+1];i[o+2*r+2]=t,i[o+2*r+3]=n}};for(let U=0;U<o;U++)a(e[U],e[U+1]),a(u+s[U],u+s[U+1]);const h=new Int32Array(3*r),w=(n,o)=>n===t[3*o]?0:n===t[3*o+1]?1:n===t[3*o+2]?2:-1,y=(t,n)=>{const o=w(t,n);h[3*n+o]=-1},A=(t,n,o,r)=>{const e=w(t,n);h[3*n+e]=r;const s=w(o,r);h[3*r+s]=n};for(let U=0;U<o;U++){let t=e[U];const n=e[U+1];let o=s[U];const r=s[U+1];for(;t<n&&o<r;){const n=i[2*t],r=i[2*u+2*o];n===r?(A(U,i[2*t+1],r,i[2*u+2*o+1]),t++,o++):n<r?(y(U,i[2*t+1]),t++):(y(r,i[2*u+2*o+1]),o++)}for(;t<n;)y(U,i[2*t+1]),t++;for(;o<r;){y(i[2*u+2*o],i[2*u+2*o+1]),o++}}return h}function n(t,n,r){const e=o(t,n,r),s=new Array(n).fill(-1),c=new Array(r).fill(-1);let f=0;const l=[];for(let o=0;o<n;++o)if(-1===s[o]){for(s[o]=f,l.push(o);l.length>0;){const n=3*l.pop();for(let o=0;o<3;++o){const r=t[n+o];if(c[r]===f)continue;c[r]=f;const i=e[r];for(let t=0;t<i.length;++t){const n=i[t];-1===s[n]&&(s[n]=f,l.push(n))}}}f++}return[s,f]}function o(t,n,o){const r=new Array;for(let e=0;e<o;++e)r[e]=[];for(let e=0;e<n;++e)r[t[3*e]].push(e),r[t[3*e+1]].push(e),r[t[3*e+2]].push(e);return r}export{t as computeNeighbors,n as computeVertexConnectedTriangleComponents};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/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";class i extends s{constructor(e,s,r,a,i){super(),this.parameters=e,this.key=i;const n=l(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.hasEmissions=0!==n?3:0,this.materialPass=o(e,r),this._configuration=new t(a),this._initializeMaterialConfiguration(e,s,r)}destroy(){}acquireTechnique(t,s,r,a){const i=this._updateConfiguration(s,r);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=e.sphereDepthInterpolate&&r.spherical,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.vertexNormalRotationType=t.vertexNormalRotationType,r.componentDataType=s.componentDataType,r.emissionSource=l(e,s)}_updateConfiguration(e,t){const s=this._configuration,{identifier:i}=e,o=0===i;s.output=t.output,s.enableOITOffset=t.enableOITOffset,s.hasEmission=t.hasEmission&&o,s.renderOccluded=9===t.slot;const n=this.isIntegratedMesh?c(t)?u(t)?3:2:1:0;s.integratedMeshMode=n,s.pbrMode=3===n?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:l}=this;s.transparent=o&&(1===l||2===l&&e.transparent||4===l)||s.isGroundSlice,s.hasHighlightMixTexture=2===i&&null!=t.highlightMixTexture,s.snowCover=o&&t.snowCover>0,s.vertexDiscardMode=o&&2===l?e.transparent?2:1:0;const h=r(t.output);return s.receiveAmbientOcclusion=h&&this.applySSAO&&!s.renderOccluded&&null!=t.ssao?.getTexture(),s.receiveGlobalIllumination=h&&this.applySSAO&&!s.renderOccluded&&t.globalIlluminationEnabled,s.hasOccludees=h&&t.hasOccludees,s.receiveShadows=h&&t.shadowMap.ready,s.hasShadowHighlights=a(s,t),s.screenSpaceReflections=t.hasScreenSpaceReflections,s.cloudReflections=h&&null!=t.clouds.data?.cubeMap?.colorTexture,s}}function o(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 n(e){return e.hasEmissionTexture||e.hasEmissiveBaseColor}function l(e,t){const s=e.hasEmissionTexture,{emissiveSourceOverride:r}=t,a=1===r,i=2===r;return 2!==t.emissiveOverride&&(n(e)||2!==r)?n(e)?i?s?4:2:a?s?5:7:6:a?7:6:0}function u(e){return null!=e.overlay?.getTexture(3)}function c(e){return null!=e.overlay?.getTexture(1)}export{i as ComponentMaterial,o as computeMaterialPass,l as getEmissionSource};
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 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=h(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.hasEmissions=0!==i?3:0,this.materialPass=n(e,r),this._configuration=new t(a),this._supportsSphereDepthInterpolate=e.sphereDepthInterpolate&&this._configuration.spherical,this._initializeMaterialConfiguration(e,s,r)}destroy(){}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.vertexNormalRotationType=t.vertexNormalRotationType,r.componentDataType=s.componentDataType,r.emissionSource=h(e,s)}_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&&n,s.renderOccluded=9===t.slot;const l=this.isIntegratedMesh?c(t)?u(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:h}=this;s.transparent=n&&(1===h||2===h&&e.transparent||4===h)||s.isGroundSlice,s.hasHighlightMixTexture=2===i&&null!=t.highlightMixTexture,s.snowCover=n&&t.snowCover>0,s.vertexDiscardMode=n&&2===h?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?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 h(e,t){const s=e.hasEmissionTexture,{emissiveSourceOverride:r}=t,a=1===r,o=2===r;return 2!==t.emissiveOverride&&(l(e)||2!==r)?l(e)?o?s?4:2:a?s?5:7:6:a?7:6:0}function u(e){return null!=e.overlay?.getTexture(3)}function c(e){return null!=e.overlay?.getTexture(1)}export{i as ComponentMaterial,n as computeMaterialPass,h as getEmissionSource};
@@ -1,11 +1,11 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{generateUID as e}from"../../../../../core/uid.js";import{TextureBufferNaNSupportConfiguration as t,unpackFloat4x8 as o,unpackHalf2x8 as d,glslType as n,glslDecodeField as i}from"./TextureBackedBufferFields.glsl.js";import{glsl as r}from"../shaderModules/glsl.js";import{assert as a}from"../../lib/Util.js";const c=new t(!0),s=new t(!1);class u{constructor(t){this.moduleId=e(),this.namespace=`_tbb_${this.moduleId}_`;const{itemIndexAttribute:o,bufferUniform:d,layout:n}=t,i=t.fieldFilter??(()=>!0),r=t.enableNaNSupport?c:s;this.TextureBackedBufferModule=(e,t)=>f(this.namespace,e,t,o,d,n,i,r),this.getTextureAttribute=l(this.namespace)}}function f(e,t,c,s,u,f,l,h){const{vertex:$}=t;$.include(o,h),$.include(d,h);const x=`${e}tbbStride`,p=`${e}TextureBackedBufferItemData`,g=`${e}fetchTextureBackedBufferItemData`,b=m(e);for(const o of[x,p,g,b])a(o.length<1024,"Identifiers do not have a valid length");$.constants.add(x,"uint",f.texelStride),$.uniforms.add(u);const I=new Array;for(const o of f.fields.values())l(o.name,c)&&I.push(o);if(0===I.length)return;const B=[];for(let o=0;o<f.texelStride;++o)B.push(!1);for(const o of I)for(let e=0;e<o.numTexels;++e)B[o.startTexel+e]=!0;$.code.add(r`
3
- struct ${p} {`);for(const o of I)$.code.add(r`\t${n(o)} ${o.name};`);$.code.add(r`};`),$.code.add(r`
4
- ${p} ${g}(highp uint itemIndex) {
5
- ${p} itemData;
6
- highp uint index = itemIndex * ${x};
7
- highp uint rowWidth = uint(textureSize(${u.name}, 0).x);
2
+ import{generateUID as e}from"../../../../../core/uid.js";import{TextureBufferNaNSupportConfiguration as t,unpackFloat1x32 as o,unpackHalf1x16 as d,unpackInt1x16 as n,glslType as i,glslDecodeField as r}from"./TextureBackedBufferFields.glsl.js";import{glsl as a}from"../shaderModules/glsl.js";import{assert as c}from"../../lib/Util.js";const s=new t(!0),u=new t(!1);class f{constructor(t){this.moduleId=e(),this.namespace=`_tbb_${this.moduleId}_`;const{itemIndexAttribute:o,bufferUniform:d,layout:n}=t,i=t.fieldFilter??(()=>!0),r=t.enableNaNSupport?s:u;this.TextureBackedBufferModule=(e,t)=>l(this.namespace,e,t,o,d,n,i,r),this.getTextureAttribute=m(this.namespace)}}function l(e,t,s,u,f,l,m,$){const{vertex:x}=t;x.include(o,$),x.include(d,$),x.include(n);const p=`${e}tbbStride`,g=`${e}TextureBackedBufferItemData`,b=`${e}fetchTextureBackedBufferItemData`,I=h(e);for(const o of[p,g,b,I])c(o.length<1024,"Identifiers do not have a valid length");x.constants.add(p,"uint",l.texelStride),x.uniforms.add(f);const B=new Array;for(const o of l.fields.values())m(o.name,s)&&B.push(o);if(0===B.length)return;const w=[];for(let o=0;o<l.texelStride;++o)w.push(!1);for(const o of B)for(let e=0;e<o.numTexels;++e)w[o.startTexel+e]=!0;x.code.add(a`
3
+ struct ${g} {`);for(const o of B)x.code.add(a`\t${i(o)} ${o.name};`);x.code.add(a`};`),x.code.add(a`
4
+ ${g} ${b}(highp uint itemIndex) {
5
+ ${g} itemData;
6
+ highp uint index = itemIndex * ${p};
7
+ highp uint rowWidth = uint(textureSize(${f.name}, 0).x);
8
8
  int coordX = int(index % rowWidth);
9
9
  int coordY = int(index / rowWidth);
10
- `);for(let o=0;o<B.length;++o)!1!==B[o]&&$.code.add(r`lowp uvec4 texel${r.int(o)} = texelFetch(${u.name}, ivec2(coordX + ${r.int(o)}, coordY), 0);`);for(const o of I)$.code.add(r`itemData.${o.name} = ${i(o)};`);$.code.add(r`return itemData;
11
- }`),$.code.add(r`${p} ${b};`),$.main.add(r`${b} = ${g}(${s});`)}function l(e){const t=m(e);return e=>r`${t}.${e}`}function m(e){return`${e}ItemData`}export{u as TextureBackedBufferModule};
10
+ `);for(let o=0;o<w.length;++o)!1!==w[o]&&x.code.add(a`lowp uvec4 texel${a.int(o)} = texelFetch(${f.name}, ivec2(coordX + ${a.int(o)}, coordY), 0);`);for(const o of B)x.code.add(a`itemData.${o.name} = ${r(o)};`);x.code.add(a`return itemData;
11
+ }`),x.code.add(a`${g} ${I};`),x.main.add(a`${I} = ${b}(${u});`)}function m(e){const t=h(e);return e=>a`${t}.${e}`}function h(e){return`${e}ItemData`}export{f as TextureBackedBufferModule};
@@ -1,28 +1,32 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{hasNativeFloat16Array as n}from"../../../../../geometry/support/float16.js";import{FloatBindUniform as e}from"../shaderModules/FloatBindUniform.js";import{glsl as o,If as i}from"../shaderModules/glsl.js";import{ShaderTechniqueConfiguration as u,parameter as s}from"../shaderTechnique/ShaderTechniqueConfiguration.js";function r(t){switch(t.elementType){case"float":switch(t.elementCount){case 1:return o`float`;case 2:return o`vec2`;case 3:return o`vec3`;case 4:return o`vec4`;case 9:return o`mat3`;default:t.elementCount}break;case"int":switch(t.elementCount){case 1:return o`int`;case 2:return o`ivec2`;case 3:return o`ivec3`;case 4:return o`ivec4`;case 9:throw new Error("Invalid element count 9 for type int");default:t.elementCount}break;case"uint":switch(t.elementCount){case 1:return o`uint`;case 2:return o`uvec2`;case 3:return o`uvec3`;case 4:return o`uvec4`;case 9:throw new Error("Invalid element count 9 for type uint");default:t.elementCount}break;default:t.elementType}throw new Error("unsupported field")}const a=new e("const_NaN",()=>NaN,{supportsNaN:!0});class c extends u{constructor(t){super(),this.supportNaN=t}}function p(t,n){const e=n?.supportNaN;e&&(t.uniforms.add(a),t.code.add(o`bool bitsEncodeFloat16NaN(highp uint bits) {
2
+ import{__decorate as t}from"tslib";import{hasNativeFloat16Array as n}from"../../../../../geometry/support/float16.js";import{FloatBindUniform as e}from"../shaderModules/FloatBindUniform.js";import{glsl as i,If as u}from"../shaderModules/glsl.js";import{ShaderTechniqueConfiguration as o,parameter as s}from"../shaderTechnique/ShaderTechniqueConfiguration.js";function a(t){switch(t.elementType){case"float":switch(t.elementCount){case 1:return i`float`;case 2:return i`vec2`;case 3:return i`vec3`;case 4:return i`vec4`;case 9:return i`mat3`;default:t.elementCount}break;case"int":switch(t.elementCount){case 1:return i`int`;case 2:return i`ivec2`;case 3:return i`ivec3`;case 4:return i`ivec4`;case 9:throw new Error("Invalid element count 9 for type int");default:t.elementCount}break;case"uint":switch(t.elementCount){case 1:return i`uint`;case 2:return i`uvec2`;case 3:return i`uvec3`;case 4:return i`uvec4`;case 9:throw new Error("Invalid element count 9 for type uint");default:t.elementCount}break;default:t.elementType}throw new Error("unsupported field")}const r=new e("const_NaN",()=>NaN,{supportsNaN:!0});class c extends o{constructor(t){super(),this.supportNaN=t}}function p(t,n){const e=n?.supportNaN;e&&(t.uniforms.add(r),t.code.add(i`bool bitsEncodeFloat16NaN(highp uint bits) {
3
3
  const highp uint nanExponent = 0x00007c00u;
4
4
  highp uint exponent = bits & nanExponent;
5
5
  highp uint mantissa = bits & 0x000003ffu;
6
6
  return exponent == nanExponent && mantissa != 0u;
7
- }`)),t.code.add(o`
8
- mediump float unpackHalf2x8(highp uint bits0, highp uint bits1) {
7
+ }`)),t.code.add(i`
8
+ mediump float unpackHalf1x16(highp uint bits0, highp uint bits1) {
9
9
  highp uint halfBits = (bits1 << 8u) | bits0;
10
- ${i(e,o`
10
+ ${u(e,i`
11
11
  if (bitsEncodeFloat16NaN(halfBits)) {
12
12
  return const_NaN;
13
13
  }`)}
14
14
  return unpackHalf2x16(halfBits).x;
15
- }`)}function f(t,n){const e=n?.supportNaN;e&&(t.uniforms.add(a),t.code.add(o`bool bitsEncodeFloat32NaN(highp uint bits) {
15
+ }`)}function f(t,n){const e=n?.supportNaN;e&&(t.uniforms.add(r),t.code.add(i`bool bitsEncodeFloat32NaN(highp uint bits) {
16
16
  const highp uint nanExponent = 0x7f800000u;
17
17
  highp uint exponent = bits & nanExponent;
18
18
  highp uint mantissa = bits & 0x007fffffu;
19
19
  return exponent == nanExponent && mantissa != 0u;
20
- }`)),t.code.add(o`
21
- highp float unpackFloat4x8(highp uint bits0, highp uint bits1, highp uint bits2, highp uint bits3) {
20
+ }`)),t.code.add(i`
21
+ highp float unpackFloat1x32(highp uint bits0, highp uint bits1, highp uint bits2, highp uint bits3) {
22
22
  highp uint floatBits = (bits3 << 24u) |(bits2 << 16u) | (bits1 << 8u) | bits0;
23
- ${i(e,o`
23
+ ${u(e,i`
24
24
  if (bitsEncodeFloat32NaN(floatBits)) {
25
25
  return const_NaN;
26
26
  }`)}
27
27
  return uintBitsToFloat(floatBits);
28
- }`)}function l(t){const{fieldType:n}=t;return`${(0,m[n])(b(t))}`}function h(t,n){const e=[];for(let i=0;i<t.length;i+=4){const n=t[i],u=t[i+1],s=t[i+2],r=t[i+3],a=o`unpackFloat4x8(${`${n}, ${u}, ${s}, ${r}`})`;e.push(a)}return e.join(n)}function d(t){return o`vec3(${h(t,",\n\t")})`}function $(t){return o`mat3(${h(t,",\n")})`}t([s()],c.prototype,"supportNaN",void 0);const m={u8:t=>o`${t[0]}`,unorm8:t=>o`float(${t[0]})/255.0`,vec4unorm8:t=>o`vec4(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})/255.0`,f16:n?t=>o`unpackHalf2x8(${`${t[0]}, ${t[1]}`})`:t=>o`unpackFloat4x8(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})`,f32:t=>o`unpackFloat4x8(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})`,vec4u8:t=>o`uvec4(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})`,vec3f32:t=>d(t),mat3f32:t=>$(t)};function b(t){const{startTexel:n,byteOffset:e,texelByteStride:i,byteSize:u}=t;let s=n,r=e%i;const a=new Array;for(let c=0;c<u;++c){const t=o`texel${o.int(s)}.${x[r]}`;a.push(t),++r,r>=i&&(r=0,++s)}return a}const x=["x","y","z","w"];export{c as TextureBufferNaNSupportConfiguration,l as glslDecodeField,r as glslType,f as unpackFloat4x8,p as unpackHalf2x8};
28
+ }`)}function h(t){t.code.add(i`mediump int unpackInt1x16(highp uint bits0, highp uint bits1) {
29
+ highp uint rawBits = (bits1 << 8u) | bits0;
30
+ highp uint signExtendedBits = (rawBits & 0x8000u) != 0u ? (rawBits | 0xffff0000u) : rawBits;
31
+ return int(signExtendedBits);
32
+ }`)}function l(t){const{fieldType:n}=t;return`${(0,x[n])(b(t))}`}function d(t,n){const e=[];for(let u=0;u<t.length;u+=4){const n=t[u],o=t[u+1],s=t[u+2],a=t[u+3],r=i`unpackFloat1x32(${`${n}, ${o}, ${s}, ${a}`})`;e.push(r)}return e.join(n)}function $(t){return i`vec3(${d(t,",\n\t")})`}function m(t){return i`mat3(${d(t,",\n")})`}t([s()],c.prototype,"supportNaN",void 0);const x={u8:t=>i`${t[0]}`,unorm8:t=>i`float(${t[0]})/255.0`,vec4unorm8:t=>i`vec4(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})/255.0`,vec2snorm16:t=>i`max(vec2(unpackInt1x16(${`${t[0]}, ${t[1]}`}), unpackInt1x16(${`${t[2]}, ${t[3]}`}))/32767.0, vec2(-1.0))`,f16:n?t=>i`unpackHalf1x16(${`${t[0]}, ${t[1]}`})`:t=>i`unpackFloat1x32(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})`,f32:t=>i`unpackFloat1x32(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})`,vec4u8:t=>i`uvec4(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})`,vec3f32:t=>$(t),mat3f32:t=>m(t)};function b(t){const{startTexel:n,byteOffset:e,texelByteStride:u,byteSize:o}=t;let s=n,a=e%u;const r=new Array;for(let c=0;c<o;++c){const t=i`texel${i.int(s)}.${g[a]}`;r.push(t),++a,a>=u&&(a=0,++s)}return r}const g=["x","y","z","w"];export{c as TextureBufferNaNSupportConfiguration,l as glslDecodeField,a as glslType,f as unpackFloat1x32,p as unpackHalf1x16,h as unpackInt1x16};
@@ -1,15 +1,17 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{Float2PassUniform as o}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as r}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as a}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as i}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as t}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as l}from"../../shaderModules/FloatsPassUniform.js";import{glsl as v,If as s}from"../../shaderModules/glsl.js";import{VisualVariablePassParameters as c,vvColorNumber as n}from"../../../materials/VisualVariablePassParameters.js";const p=8;function f(e,c){const{attributes:f,vertex:u}=e;f.add("position","vec3"),f.add("profileVertexAndNormal","vec4"),f.add("profileAuxData","vec3"),f.add("profileRight","vec2"),f.add("profileUp","vec2"),u.code.add(v`bool isCapVertex() {
2
+ import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{TextureBackedBufferModule as r}from"../TextureBackedBuffer.glsl.js";import{Float2PassUniform as t}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as o}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as i}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as a}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as l}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as s}from"../../shaderModules/FloatsPassUniform.js";import{glsl as v,If as c}from"../../shaderModules/glsl.js";import{Texture2DUintDrawUniform as n}from"../../shaderModules/Texture2DUintDrawUniform.js";import{getTextureLayout as u}from"../../../materials/PathLayouts.js";import{VisualVariablePassParameters as f,vvColorNumber as p}from"../../../materials/VisualVariablePassParameters.js";const d=8;function m(e,f){const{attributes:m,vertex:x}=e,y=new n("componentTextureBuffer",e=>e.textureBuffer),g=new r({layout:u(f),itemIndexAttribute:"textureElementIndex",bufferUniform:y});e.include(g.TextureBackedBufferModule,f),m.add("textureElementIndex","uint"),m.add("profileVertexAndNormal","vec4"),m.add("profileAuxData","vec3"),x.code.add(v`bool isCapVertex() {
3
3
  return profileAuxData.z == 1.0;
4
- }`),u.uniforms.add(new o("size",e=>e.size));const{hasVVSize:d,hasVVColor:m,hasVVOpacity:x}=c;d?(f.add("sizeFeatureAttribute","float"),u.uniforms.add(new r("vvSizeMinSize",e=>e.vvSize.minSize),new r("vvSizeMaxSize",e=>e.vvSize.maxSize),new r("vvSizeOffset",e=>e.vvSize.offset),new r("vvSizeFactor",e=>e.vvSize.factor),new r("vvSizeFallback",e=>e.vvSize.fallback)),u.code.add(v`vec2 getSize() {
5
- float value = sizeFeatureAttribute;
6
- if (isnan(value)) {
7
- return vvSizeFallback.xz;
8
- }
9
- return size * clamp(vvSizeOffset + value * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).xz;
10
- }`)):u.code.add(v`vec2 getSize(){
4
+ }`),x.uniforms.add(new t("size",e=>e.size));const{hasVVSize:b,hasVVColor:z,hasVVOpacity:h}=f;b?(x.uniforms.add(new o("vvSizeMinSize",e=>e.vvSize.minSize),new o("vvSizeMaxSize",e=>e.vvSize.maxSize),new o("vvSizeOffset",e=>e.vvSize.offset),new o("vvSizeFactor",e=>e.vvSize.factor),new o("vvSizeFallback",e=>e.vvSize.fallback)),x.code.add(v`
5
+ vec2 getSize() {
6
+ float value = ${g.getTextureAttribute("sizeFeatureAttribute")};
7
+ if (isnan(value)) {
8
+ return vvSizeFallback.xz;
9
+ }
10
+ return size * clamp(vvSizeOffset + value * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).xz;
11
+ }
12
+ `)):x.code.add(v`vec2 getSize(){
11
13
  return size;
12
- }`),x?(f.add("opacityFeatureAttribute","float"),u.constants.add("vvOpacityNumber","int",p),u.uniforms.add(new l("vvOpacityValues",p,e=>e.vvOpacity.values),new l("vvOpacityOpacities",p,e=>e.vvOpacity.opacityValues),new t("vvOpacityFallback",e=>e.vvOpacity.fallback,{supportsNaN:!0})),u.code.add(v`
14
+ }`),h?(x.constants.add("vvOpacityNumber","int",d),x.uniforms.add(new s("vvOpacityValues",d,e=>e.vvOpacity.values),new s("vvOpacityOpacities",d,e=>e.vvOpacity.opacityValues),new l("vvOpacityFallback",e=>e.vvOpacity.fallback,{supportsNaN:!0})),x.code.add(v`
13
15
  vec4 applyOpacity(vec4 color) {
14
16
  // if we encounter NaN in the color it means the color is in the fallback case where the symbol color
15
17
  // is not defined and there is no valid color visual variable override. In this case just return a fully
@@ -18,11 +20,11 @@ return size;
18
20
  return vec4(0);
19
21
  }
20
22
 
21
- float value = opacityFeatureAttribute;
23
+ float value = ${g.getTextureAttribute("opacityFeatureAttribute")};
22
24
 
23
25
  if (isnan(value)) {
24
26
  // If there is a color vv then it will already have taken care of applying the fallback
25
- return ${s(m,"color","vec4(color.rgb, vvOpacityFallback)")};
27
+ return ${c(z,"color","vec4(color.rgb, vvOpacityFallback)")};
26
28
  }
27
29
 
28
30
  if (value <= vvOpacityValues[0]) {
@@ -38,42 +40,50 @@ return size;
38
40
 
39
41
  return vec4( color.rgb, vvOpacityOpacities[vvOpacityNumber - 1]);
40
42
  }
41
- `)):u.code.add(v`vec4 applyOpacity(vec4 color){
43
+ `)):x.code.add(v`vec4 applyOpacity(vec4 color){
42
44
  return color;
43
- }`),m?(f.add("colorFeatureAttribute","float"),u.constants.add("vvColorNumber","int",n),u.uniforms.add(new l("vvColorValues",n,e=>e.vvColor.values),new i("vvColorColors",n,e=>e.vvColor.colors),new a("vvColorFallback",e=>e.vvColor.fallback)),u.code.add(v`vec4 getColor() {
44
- float value = colorFeatureAttribute;
45
- if (isnan(value)) {
46
- return applyOpacity(vvColorFallback);
47
- }
48
- if (value <= vvColorValues[0]) {
49
- return applyOpacity(vvColorColors[0]);
50
- }
51
- for (int i = 1; i < vvColorNumber; ++i) {
52
- if (vvColorValues[i] >= value) {
53
- float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]);
54
- return applyOpacity(mix(vvColorColors[i-1], vvColorColors[i], f));
55
- }
56
- }
57
- return applyOpacity(vvColorColors[vvColorNumber - 1]);
58
- }`)):u.code.add(v`vec4 getColor(){
45
+ }`),z?(x.constants.add("vvColorNumber","int",p),x.uniforms.add(new s("vvColorValues",p,e=>e.vvColor.values),new a("vvColorColors",p,e=>e.vvColor.colors),new i("vvColorFallback",e=>e.vvColor.fallback)),x.code.add(v`
46
+ vec4 getColor() {
47
+ float value = ${g.getTextureAttribute("colorFeatureAttribute")};
48
+ if (isnan(value)) {
49
+ return applyOpacity(vvColorFallback);
50
+ }
51
+
52
+ if (value <= vvColorValues[0]) {
53
+ return applyOpacity(vvColorColors[0]);
54
+ }
55
+
56
+ for (int i = 1; i < vvColorNumber; ++i) {
57
+ if (vvColorValues[i] >= value) {
58
+ float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]);
59
+ return applyOpacity(mix(vvColorColors[i-1], vvColorColors[i], f));
60
+ }
61
+ }
62
+
63
+ return applyOpacity(vvColorColors[vvColorNumber - 1]);
64
+ }
65
+ `)):x.code.add(v`vec4 getColor(){
59
66
  return applyOpacity(vec4(1, 1, 1, 1));
60
- }`),u.code.add(v`vec3 decompressAxis(vec2 axis) {
61
- float z = 1.0 - abs(axis.x) - abs(axis.y);
62
- return normalize(vec3(axis + sign(axis) * min(z, 0.0), z));
63
- }
64
- vec3 calculateVPos() {
65
- vec2 size = getSize();
66
- vec3 origin = position;
67
- vec3 right = decompressAxis(profileRight);
68
- vec3 up = decompressAxis(profileUp);
69
- vec2 profileVertex = profileVertexAndNormal.xy * size;`),u.code.add(v`if(isCapVertex()) {
67
+ }`),x.code.add(v`
68
+ vec3 decompressAxis(vec2 axis) {
69
+ float z = 1.0 - abs(axis.x) - abs(axis.y);
70
+ return normalize(vec3(axis + sign(axis) * min(z, 0.0), z));
71
+ }
72
+
73
+ vec3 calculateVPos() {
74
+ vec2 size = getSize();
75
+ vec3 origin = ${g.getTextureAttribute("position")};
76
+ vec3 right = decompressAxis(${g.getTextureAttribute("profileRight")});
77
+ vec3 up = decompressAxis(${g.getTextureAttribute("profileUp")});
78
+ vec2 profileVertex = profileVertexAndNormal.xy * size;
79
+ `),x.code.add(v`if(isCapVertex()) {
70
80
  float positionOffsetAlongProfilePlaneNormal = profileAuxData.x * size[0];
71
81
  vec3 forward = cross(up, right);
72
82
  vec3 offset = right * profileVertex.x + up * profileVertex.y + forward * positionOffsetAlongProfilePlaneNormal;
73
83
  return origin + offset;
74
84
  }
75
85
  vec2 rotationRight = vec2(profileAuxData.x, profileAuxData.y);
76
- float maxDistance = length(rotationRight);`),u.code.add(v`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0);
86
+ float maxDistance = length(rotationRight);`),x.code.add(v`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0);
77
87
  float rx = dot(profileVertex, rotationRight);
78
88
  if (abs(rx) > maxDistance) {
79
89
  vec2 rotationUp = vec2(-rotationRight.y, rotationRight.x);
@@ -82,13 +92,17 @@ profileVertex = rotationRight * maxDistance * sign(rx) + rotationUp * ry;
82
92
  }
83
93
  vec3 offset = right * profileVertex.x + up * profileVertex.y;
84
94
  return origin + offset;
85
- }`),u.code.add(v`vec3 localNormal() {
86
- vec3 right = decompressAxis(profileRight);
87
- vec3 up = decompressAxis(profileUp);
88
- vec3 normal = right * profileVertexAndNormal.z + up * profileVertexAndNormal.w;
89
- if(isCapVertex()) {
90
- vec3 forward = cross(up, right);
91
- normal += forward * profileAuxData.y;
92
- }
93
- return normal;
94
- }`)}class u extends c{constructor(){super(...arguments),this.size=e(1,1)}}export{f as PathVertexPosition,u as PathVertexPositionPassParameters};
95
+ }`),x.code.add(v`
96
+ vec3 localNormal() {
97
+ vec3 right = decompressAxis(${g.getTextureAttribute("profileRight")});
98
+ vec3 up = decompressAxis(${g.getTextureAttribute("profileUp")});
99
+ vec3 normal = right * profileVertexAndNormal.z + up * profileVertexAndNormal.w;
100
+
101
+ if(isCapVertex()) {
102
+ vec3 forward = cross(up, right);
103
+ normal += forward * profileAuxData.y;
104
+ }
105
+
106
+ return normal;
107
+ }
108
+ `)}class x extends f{constructor(){super(...arguments),this.size=e(1,1)}}export{m as PathVertexPosition,x as PathVertexPositionPassParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as t}from"../../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as e}from"../../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as i}from"../../shaders/CompositingTechniqueConfiguration.js";import{ColorAttachment0 as r}from"../../../../webgl/enums.js";class s{constructor(e,r=0){this._techniques=e,this._parameters=new t,this._configuration=new i,this._configuration.mode=r}precompile(){this._techniques.precompile(e,this._configuration)}toFramebuffer(t,e){this.blitTexture(t.getTexture(),e)}blitTexture(t,i,r,s,o=0){const n=this._rctx;n.temporaryBindFramebuffer(r,()=>{const r=this._configuration.mode;this._configuration.mode=s??this._configuration.mode,1!==this._configuration.mode&&2!==this._configuration.mode||(n.setClearColor(0,0,0,1),n.clear(16384)),this._parameters.texture=t,this._parameters.mipmapLevel=o;const a=this._techniques.get(e,this._configuration);n.bindTechnique(a,i,this._parameters),n.screen.draw(),this._configuration.mode=r})}blend(t,i,s,o=1){const n=this._techniques.getCompiled(e,this._configuration);if(!n)return!1;const a=this._rctx;return a.bindFramebuffer(i.fbo),this._parameters.texture=t.getTexture(),this._parameters.opacity=o,a.bindTechnique(n,s,this._parameters),a.setDrawBuffers([r]),a.screen.draw(),!0}get _rctx(){return this._techniques.context.rctx}}export{s as Blit};
2
+ import{a as t}from"../../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as e}from"../../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as i}from"../../shaders/CompositingTechniqueConfiguration.js";import{ColorAttachment0 as r}from"../../../../webgl/enums.js";class s{constructor(e,r=0){this._techniques=e,this._parameters=new t,this._configuration=new i,this._configuration.mode=r}precompile(){this._techniques.precompile(e,this._configuration)}toFramebuffer(t,e){this.blitTexture(t.getTexture(),e)}blitTexture(t,i,r,s,o=0){const n=this._rctx;n.temporaryBindFramebuffer(r,()=>{const r=this._configuration.mode;this._configuration.mode=s??this._configuration.mode,1!==this._configuration.mode&&2!==this._configuration.mode||(n.setClearColor(0,0,0,1),n.clear(16384)),this._parameters.texture=t,this._parameters.mipmapLevel=o;const a=this._techniques.get(e,this._configuration);n.bindTechnique(a,i,this._parameters),n.screen.draw(),this._configuration.mode=r})}blend(t,i,s,o=1){const n=this._techniques.getCompiled(e,this._configuration);if(!n)return!1;const a=this._rctx;return a.bindFramebuffer(i.fbo),this._parameters.texture=t.getTexture(),this._parameters.opacity=o,a.bindTechnique(n,s,this._parameters),a.setDrawBuffers([r]),a.screen.draw(),this._parameters.opacity=1,!0}get _rctx(){return this._techniques.context.rctx}}export{s as Blit};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{smoothstep as t,lerp as s}from"../../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{copy as n,normalize as m,dot as h,scale as p,lerp as c,length as d}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l,fromValues as _}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as g}from"../../../webgl.js";import{heightLimit as f}from"../../../environment/weather.js";import{TransparentEnvironment as P}from"../TransparentEnvironment.js";import{a as w}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as b}from"./FogTechnique.js";import{FogTechniqueConfiguration as v}from"./FogTechniqueConfiguration.js";import{DepthStencilAttachment as y,ColorAttachment1 as F}from"../../../../webgl/enums.js";const j=.95,E=1;let R=class extends P{constructor(e){super(e),this._configuration=new v,this._newParameters=new x,this._oldParameters=new x,this._fadedParameters=new x,this._parameters=this._newParameters,this._passParameters=new w;const t=u(e.view.spatialReference);this._planetRadius=t.radius,this._atmosphereRadius=t.radius+t.atmosphereHeight}initialize(){this.addHandles([a(()=>this.view.environment.atmosphereEnabled,()=>this._updateEnabled(),i),a(()=>this.view.environment.weather,()=>this._updateEnabled(),i),a(()=>this._updateFogParameters(),()=>{},i)]),this.addHandles(a(()=>this._fadeFactor,e=>this._fade(e),i))}_updateEnabled(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){const{_newParameters:t,_oldParameters:s}=this;e>=1?(this._parameters=t,this._oldParameters.copyFrom(this._newParameters)):e<=0?this._parameters=s:(this._fadedParameters.lerp(s,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){const{weather:e,weatherAvailable:t}=this.view.environment,s="foggy"===e.type||"snowy"===e.type||"rainy"===e.type;this._newParameters.strength=t?e.fogOpacity:0,this._newParameters.amount=s?1:0,"foggy"!==e.type&&"snowy"!==e.type||n(this._newParameters.color,A),"rainy"===e.type&&n(this._newParameters.color,C),this._fadeFactor>=1&&this._oldParameters.copyFrom(this._newParameters),this.requestRender(2)}get strength(){return this._parameters.strength}precompile(){this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value}render(e){const t=e.find(({name:e})=>e===g.TRANSPARENT_ENVIRONMENT);if(0===this._parameters.amount)return t;if(this._update(),this._passParameters.amount<=0)return t;this._configuration.hasEmissive=this.bindParameters.hasEmission;const s=this.techniques.getCompiled(b,this._configuration);if(!s)return this.requestRender(1),t;const a=this.renderingContext,i=t.getAttachment(y);return this._passParameters.emission=t.obtainAttachment(F),t.attachDepth(null),a.bindFramebuffer(t.fbo),a.bindTechnique(s,this.bindParameters,this._passParameters),a.screen.draw(),t.attachDepth(i),this._passParameters.emission&&(t.attachColor(this._passParameters.emission,F),this._passParameters.emission=r(this._passParameters.emission)),t}_update(){const e=this.bindParameters.camera;m(T,e.eye);const s=Math.max(0,h(T,this.bindParameters.lighting.mainLight.direction)),r=this._parameters.color;p(q,r,.1),c(this._passParameters.color,q,r,s);const a=d(e.eye);this._passParameters.atmosphereC=a**2-this._atmosphereRadius**2,this._passParameters.amount=(1-t(j*f,E*f,Math.abs(a-this._planetRadius)))*this._parameters.amount,this._passParameters.strength=this._parameters.strength}get test(){return{parameters:this._passParameters}}};R=e([o("esri.views.3d.webgl-engine.effects.fog.Fog")],R);class x{constructor(){this.color=l(),this.strength=0,this.amount=0}copyFrom(e){this.amount=e.amount,this.strength=e.strength,n(this.color,e.color)}lerp(e,t,r){this.amount=s(e.amount,t.amount,r),this.strength=s(e.strength,t.strength,r),c(this.color,e.color,t.color,r)}}const T=l(),q=l(),C=_(.5,.5,.5),A=_(1.5,1.5,1.5);export{R as Fog,x as FogParameters};
2
+ import{__decorate as e}from"tslib";import{smoothstep as t,lerp as s}from"../../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{copy as n,normalize as h,dot as m,scale as p,lerp as c,length as d}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l,fromValues as _}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as g}from"../../../webgl.js";import{heightLimit as f}from"../../../environment/weather.js";import{TransparentEnvironment as P}from"../TransparentEnvironment.js";import{a as w}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as b}from"./FogTechnique.js";import{FogTechniqueConfiguration as v}from"./FogTechniqueConfiguration.js";import{DepthStencilAttachment as y,ColorAttachment1 as j}from"../../../../webgl/enums.js";const F=.95,E=1;let R=class extends P{constructor(e){super(e),this._configuration=new v,this._newParameters=new x,this._oldParameters=new x,this._fadedParameters=new x,this._parameters=this._newParameters,this._passParameters=new w;const t=u(e.view.spatialReference);this._planetRadius=t.radius,this._atmosphereRadius=t.radius+t.atmosphereHeight}initialize(){this.addHandles([a(()=>this.view.environment.atmosphereEnabled,()=>this._updateEnabled(),i),a(()=>this.view.environment.weather,()=>this._updateEnabled(),i),a(()=>this._updateFogParameters(),()=>{},i)]),this.addHandles(a(()=>this._fadeFactor,e=>this._fade(e),i))}_updateEnabled(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){const{_newParameters:t,_oldParameters:s}=this;e>=1?(this._parameters=t,this._oldParameters.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=t?e.fogOpacity:0,this._newParameters.amount=s?1:0,"foggy"!==e.type&&"snowy"!==e.type||n(this._newParameters.color,A),"rainy"===e.type&&n(this._newParameters.color,C),this._fadeFactor>=1&&this._oldParameters.copy(this._newParameters),this.requestRender(2)}get strength(){return this._parameters.strength}precompile(){this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value}render(e){const t=e.find(({name:e})=>e===g.TRANSPARENT_ENVIRONMENT);if(0===this._parameters.amount)return t;if(this._update(),this._passParameters.amount<=0)return t;this._configuration.hasEmissive=this.bindParameters.hasEmission;const s=this.techniques.getCompiled(b,this._configuration);if(!s)return this.requestRender(1),t;const a=this.renderingContext,i=t.getAttachment(y);return this._passParameters.emission=t.obtainAttachment(j),t.attachDepth(null),a.bindFramebuffer(t.fbo),a.bindTechnique(s,this.bindParameters,this._passParameters),a.screen.draw(),t.attachDepth(i),this._passParameters.emission&&(t.attachColor(this._passParameters.emission,j),this._passParameters.emission=r(this._passParameters.emission)),t}_update(){const e=this.bindParameters.camera;h(T,e.eye);const s=Math.max(0,m(T,this.bindParameters.lighting.mainLight.direction)),r=this._parameters.color;p(q,r,.1),c(this._passParameters.color,q,r,s);const a=d(e.eye);this._passParameters.atmosphereC=a**2-this._atmosphereRadius**2,this._passParameters.amount=(1-t(F*f,E*f,Math.abs(a-this._planetRadius)))*this._parameters.amount,this._passParameters.strength=this._parameters.strength}get test(){return{parameters:this._passParameters}}};R=e([o("esri.views.3d.webgl-engine.effects.fog.Fog")],R);class x{constructor(){this.color=l(),this.strength=0,this.amount=0}copy(e){this.amount=e.amount,this.strength=e.strength,n(this.color,e.color)}lerp(e,t,r){this.amount=s(e.amount,t.amount,r),this.strength=s(e.strength,t.strength,r),c(this.color,e.color,t.color,r)}}const T=l(),q=l(),C=_(.5,.5,.5),A=_(1.5,1.5,1.5);export{R as Fog,x as FogParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{releaseMaybe as e}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as h}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getReferenceEllipsoid as l}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as m}from"../../../webgl.js";import{TransparentEnvironment as c}from"../TransparentEnvironment.js";import{a as u}from"../../../../../chunks/GlowBlur.glsl.js";import{GlowBlurTechnique as p}from"./GlowBlurTechnique.js";import{GlowBlurTechniqueConfiguration as _}from"./GlowBlurTechniqueConfiguration.js";import{b as d,a as g,m as b}from"../../../../../chunks/GlowComposition.glsl.js";import{GlowCompositionTechnique as f}from"./GlowCompositionTechnique.js";import{GlowCompositionTechniqueConfiguration as P}from"./GlowCompositionTechniqueConfiguration.js";import{floatBlendReductionFactor as w}from"../../shaders/oitResolution.glsl.js";import{ColorAttachment1 as C,DepthStencilAttachment as T}from"../../../../webgl/enums.js";let v=class extends c{constructor(t){super(t),this.consumes={required:[m.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=m.TRANSPARENT_ENVIRONMENT,this._mode=0,this._intensity=.5,this._scatteringFactors={realistic:new d([32,16,8,4,2,1],1),cartographicMin:new d([.4,.18,.25,.12,.05,0],1),cartographicDefault:new d([1.17,1.08,.78,.4,.26,.11],4),cartographicMax:new d([3.59,3.9,2.46,1.4,.93,.44],13)},this._blurHorizontalConfiguration=new _,this._blurVerticalConfiguration=new _,this._compositionConfiguration=new P,this._compositionParameters=new g,this._blurParameters=new u,this._blurScalePerLod=3.06,this._logicalBlurRadius=.0037;const e=l(t.view.spatialReference);this._atmosphereRadius=e.radius+e.atmosphereHeight,this._blurVerticalConfiguration.glowStage=1}initialize(){this.addHandles([i(()=>this._updateParameters(),()=>{},r)])}_updateParameters(){const t=this.view.environment.lighting.glow;this._mode=null==t?this.view.environment.atmosphereEnabled?0:2:1,t&&(this._intensity=t.intensity),this._compositionParameters.minDisperse.preset=this._preset,this.requestRender(1)}render(t){const i=t.find(({name:t})=>t===m.TRANSPARENT_ENVIRONMENT),r=i.getAttachment(C);if(!r?.attachment)return i;const s=i.getTexture(),o=i.getAttachment(T),a=this.fboCache,{fullWidth:h,fullHeight:l}=this.bindParameters.camera,c=this.renderingContext;if(this._compositionConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionParameters.distanceModifier=this.view.stage.renderView.fog?.strength??0,this._compositionParameters.color=s,this._compositionParameters.emission=r.attachment,this._compositionConfiguration.blurEnabled=2!==this._mode,!this._compositionConfiguration.blurEnabled){const t=this.techniques.getCompiled(f,this._compositionConfiguration);if(!t)return this.requestRender(1),i;const e=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);return this._setupFBO(e,h,l),c.bindTechnique(t,this.bindParameters,this._compositionParameters),c.screen.draw(),e.attachDepth(o),e.attachColor(r,C),e}const u=this.techniques.getCompiled(p,this._blurHorizontalConfiguration),_=this.techniques.getCompiled(p,this._blurVerticalConfiguration),d=this.techniques.getCompiled(f,this._compositionConfiguration);if(!u||!_||!d)return this.requestRender(1),i;const g=this.camera,b=n(g.eye);this._compositionParameters.atmosphereC=b**2-this._atmosphereRadius**2,this._renderGlowMipMap(u,_);const P=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);return P.acquireColor(C,this.bindParameters.useFloatBlend.value?8:5,"emissive glow"),this._setupFBO(P,h,l,!0),c.bindTechnique(d,this.bindParameters,this._compositionParameters),c.screen.draw(),this._compositionParameters.lodTexture=e(this._compositionParameters.lodTexture),P.attachDepth(o),P}_renderGlowMipMap(t,e){const i=this.fboCache,{fullWidth:r,fullHeight:s}=this.camera,o=this.renderingContext,n=5;this._blurParameters.input=this._compositionParameters.emission,this._blurParameters.inputScale=w,this._blurParameters.level=0,this._blurParameters.blurRadius=this._logicalBlurRadius,a(this._blurParameters.size,.5*r,.5*s);let h=Math.floor(this._blurParameters.size[0]),l=Math.floor(this._blurParameters.size[1]);const m=i.acquire(h,l,"glow horizontal",8);for(this._compositionParameters.lodTexture=i.acquire(h,l,"glow mipmap",9);h>1&&l>1&&this._blurParameters.level<n;)this._setupFBO(m,h,l),o.bindTechnique(t,this.bindParameters,this._blurParameters),o.screen.draw(),i.debugCallback?.(`glow horizontal ${this._blurParameters.level}`,m.fbo),this._blurParameters.inputScale=1,this._blurParameters.input=m.getTexture(),this._setupFBO(this._compositionParameters.lodTexture,h,l,!1,this._blurParameters.level),o.bindTechnique(e,this.bindParameters,this._blurParameters),o.screen.draw(),i.debugCallback?.(this._compositionParameters.lodTexture.name,this._compositionParameters.lodTexture.fbo),a(this._blurParameters.size,.5*h,.5*l),h=Math.floor(this._blurParameters.size[0]),l=Math.floor(this._blurParameters.size[1]),this._blurParameters.input=this._compositionParameters.lodTexture.getTexture(),this._blurParameters.blurRadius*=this._blurScalePerLod,++this._blurParameters.level;m.release(),this._compositionParameters.lodTexture.fbo.level=0}get _preset(){return 0===this._mode?this._scatteringFactors.realistic.preset:this._intensity<=.5?b(this._scatteringFactors.cartographicMin.preset,this._scatteringFactors.cartographicDefault.preset,2*this._intensity):b(this._scatteringFactors.cartographicDefault.preset,this._scatteringFactors.cartographicMax.preset,2*(this._intensity-.5))}_setupFBO(t,e,i,r=!1,s=0){t.fbo.level=s;const o=this.renderingContext;o.bindFramebuffer(t.fbo),o.setViewport(0,0,e,i),o.setClearColor(0,0,0,0),o.clear(16384),r&&o.clearBuffer(1,h)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setBlurLodCombination:t=>{this._compositionParameters.dispersionWeight=t},preset:this._preset,setMinDisperse:(t,e)=>{0===this._mode?this._scatteringFactors.realistic.preset[t]=e:(this._scatteringFactors.cartographicMin.preset[t]=e,this._scatteringFactors.cartographicMax.preset[t]=e)},toggleTonemapping:t=>{this._compositionConfiguration.tonemappingEnabled=t,this.requestRender(1)}}}};t([s()],v.prototype,"consumes",void 0),t([s()],v.prototype,"produces",void 0),v=t([o("esri.views.3d.webgl-engine.effects.glow.Glow")],v);export{v as Glow};
2
+ import{__decorate as t}from"tslib";import{releaseMaybe as e}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as h}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getReferenceEllipsoid as l}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as m}from"../../../webgl.js";import{TransparentEnvironment as c}from"../TransparentEnvironment.js";import{a as u}from"../../../../../chunks/GlowBlur.glsl.js";import{GlowBlurTechnique as p}from"./GlowBlurTechnique.js";import{GlowBlurTechniqueConfiguration as _}from"./GlowBlurTechniqueConfiguration.js";import{b as d,a as g,m as b}from"../../../../../chunks/GlowComposition.glsl.js";import{GlowCompositionTechnique as f}from"./GlowCompositionTechnique.js";import{GlowCompositionTechniqueConfiguration as P}from"./GlowCompositionTechniqueConfiguration.js";import{floatBlendReductionFactor as w}from"../../shaders/oitResolution.glsl.js";import{ColorAttachment1 as C,DepthStencilAttachment as T}from"../../../../webgl/enums.js";let v=class extends c{constructor(t){super(t),this.consumes={required:[m.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=m.TRANSPARENT_ENVIRONMENT,this._mode=0,this._intensity=.5,this._scatteringFactors={realistic:new d([32,16,8,4,2,1],1),cartographicMin:new d([.4,.18,.25,.12,.05,0],1),cartographicDefault:new d([1.17,1.08,.78,.4,.26,.11],4),cartographicMax:new d([3.59,3.9,2.46,1.4,.93,.44],13)},this._blurHorizontalConfiguration=new _,this._blurVerticalConfiguration=new _,this._compositionConfiguration=new P,this._compositionParameters=new g,this._blurParameters=new u,this._blurScalePerLod=3.06,this._logicalBlurRadius=.0037;const e=l(t.view.spatialReference);this._atmosphereRadius=e.radius+e.atmosphereHeight,this._blurVerticalConfiguration.glowStage=1}initialize(){this.addHandles([i(()=>this._updateParameters(),()=>{},r)])}_updateParameters(){const t=this.view.environment.lighting.glow;this._mode=null==t?this.view.environment.atmosphereEnabled?0:2:1,t&&(this._intensity=t.intensity),this._compositionParameters.minDisperse.preset=this._preset,this.requestRender(1)}render(t){const i=t.find(({name:t})=>t===m.TRANSPARENT_ENVIRONMENT),r=i.getAttachment(C);if(!r?.attachment)return i;const s=i.getTexture(),o=i.getAttachment(T),a=this.fboCache,{fullWidth:h,fullHeight:l}=this.bindParameters.camera,c=this.renderingContext;if(this._compositionConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionParameters.fogOpacity=this.view.stage.renderView.fog?.strength??0,this._compositionParameters.color=s,this._compositionParameters.emission=r.attachment,this._compositionConfiguration.blurEnabled=2!==this._mode,!this._compositionConfiguration.blurEnabled){const t=this.techniques.getCompiled(f,this._compositionConfiguration);if(!t)return this.requestRender(1),i;const e=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);return this._setupFBO(e,h,l),c.bindTechnique(t,this.bindParameters,this._compositionParameters),c.screen.draw(),e.attachDepth(o),e.attachColor(r,C),e}const u=this.techniques.getCompiled(p,this._blurHorizontalConfiguration),_=this.techniques.getCompiled(p,this._blurVerticalConfiguration),d=this.techniques.getCompiled(f,this._compositionConfiguration);if(!u||!_||!d)return this.requestRender(1),i;const g=this.camera,b=n(g.eye);this._compositionParameters.atmosphereC=b**2-this._atmosphereRadius**2,this._renderGlowMipMap(u,_);const P=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);return P.acquireColor(C,this.bindParameters.useFloatBlend.value?8:5,"emissive glow"),this._setupFBO(P,h,l,!0),c.bindTechnique(d,this.bindParameters,this._compositionParameters),c.screen.draw(),this._compositionParameters.lodTexture=e(this._compositionParameters.lodTexture),P.attachDepth(o),P}_renderGlowMipMap(t,e){const i=this.fboCache,{fullWidth:r,fullHeight:s}=this.camera,o=this.renderingContext,n=5;this._blurParameters.input=this._compositionParameters.emission,this._blurParameters.inputScale=w,this._blurParameters.level=0,this._blurParameters.blurRadius=this._logicalBlurRadius,a(this._blurParameters.size,.5*r,.5*s);let h=Math.floor(this._blurParameters.size[0]),l=Math.floor(this._blurParameters.size[1]);const m=i.acquire(h,l,"glow horizontal",8);for(this._compositionParameters.lodTexture=i.acquire(h,l,"glow mipmap",9);h>1&&l>1&&this._blurParameters.level<n;)this._setupFBO(m,h,l),o.bindTechnique(t,this.bindParameters,this._blurParameters),o.screen.draw(),i.debugCallback?.(`glow horizontal ${this._blurParameters.level}`,m.fbo),this._blurParameters.inputScale=1,this._blurParameters.input=m.getTexture(),this._setupFBO(this._compositionParameters.lodTexture,h,l,!1,this._blurParameters.level),o.bindTechnique(e,this.bindParameters,this._blurParameters),o.screen.draw(),i.debugCallback?.(this._compositionParameters.lodTexture.name,this._compositionParameters.lodTexture.fbo),a(this._blurParameters.size,.5*h,.5*l),h=Math.floor(this._blurParameters.size[0]),l=Math.floor(this._blurParameters.size[1]),this._blurParameters.input=this._compositionParameters.lodTexture.getTexture(),this._blurParameters.blurRadius*=this._blurScalePerLod,++this._blurParameters.level;m.release(),this._compositionParameters.lodTexture.fbo.level=0}get _preset(){return 0===this._mode?this._scatteringFactors.realistic.preset:this._intensity<=.5?b(this._scatteringFactors.cartographicMin.preset,this._scatteringFactors.cartographicDefault.preset,2*this._intensity):b(this._scatteringFactors.cartographicDefault.preset,this._scatteringFactors.cartographicMax.preset,2*(this._intensity-.5))}_setupFBO(t,e,i,r=!1,s=0){t.fbo.level=s;const o=this.renderingContext;o.bindFramebuffer(t.fbo),o.setViewport(0,0,e,i),o.setClearColor(0,0,0,0),o.clear(16384),r&&o.clearBuffer(1,h)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,preset:this._preset,setMinDisperse:(t,e)=>{0===this._mode?this._scatteringFactors.realistic.preset[t]=e:(this._scatteringFactors.cartographicMin.preset[t]=e,this._scatteringFactors.cartographicMax.preset[t]=e)}}}};t([s()],v.prototype,"consumes",void 0),t([s()],v.prototype,"produces",void 0),v=t([o("esri.views.3d.webgl-engine.effects.glow.Glow")],v);export{v as Glow};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as t}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends t{constructor(){super(...arguments),this.useFloatBlend=!0,this.blurEnabled=!1,this.tonemappingEnabled=!0}}e([o()],r.prototype,"useFloatBlend",void 0),e([o()],r.prototype,"blurEnabled",void 0),e([o()],r.prototype,"tonemappingEnabled",void 0);export{r as GlowCompositionTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as r}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class t extends r{constructor(){super(...arguments),this.useFloatBlend=!0,this.blurEnabled=!1}}e([o()],t.prototype,"useFloatBlend",void 0),e([o()],t.prototype,"blurEnabled",void 0);export{t as GlowCompositionTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{nativeArrayMaxSize as r,isFloat16Array as t,isUint16Array as o}from"../../../../core/typedArrayUtil.js";import{getFloat16ArrayConstructor as a}from"../../../../geometry/support/float16.js";function e(e){if(e.length<r)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return t(e)?a().from(e):o(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}export{e as cloneAttributeData};
2
+ import{nativeArrayMaxSize as r,isFloat32Array as t,isFloat16Array as o,isUint16Array as a}from"../../../../core/typedArrayUtil.js";import{getFloat16ArrayConstructor as f}from"../../../../geometry/support/float16.js";function e(e){if(e.length<r)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return o(e)?f().from(e):a(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return t(e)?Float32Array.from(e):Uint32Array.from(e);default:return Float64Array.from(e)}}export{e as cloneAttributeData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as i,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as r,set as o,scale as n,floor as h,subtract as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,set as u,positiveInfinity as c,equals as d}from"../../../../geometry/support/aaBoundingBox.js";import{InternalRenderCategory as _}from"../../webgl.js";import g from"../../webgl/RenderNode.js";import{a as P}from"../../../../chunks/GaussianSplat.glsl.js";import{G as f}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as C}from"../shaders/GaussianSplatCompositionTechnique.js";import{GaussianSplatCompositionTechniqueConfiguration as b}from"../shaders/GaussianSplatCompositionTechniqueConfiguration.js";import{G as S}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as x}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatTechnique as v}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as q}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{ColorAttachment1 as w,DepthStencilAttachment as D,PrimitiveType as R}from"../../../webgl/enums.js";var E;let T=class extends g{static{E=this}constructor(e){super(e),this.produces=_.GAUSSIAN_SPLAT,this._slicePlaneEnabled=!1,this.layerView=null,this._passParameters=new P,this._compositionPassParameters=new f,this._depthCompositionPassParameters=new S,this._compositionConfiguration=new b,this._clipBox=m(),this._previousCameraDirection=p(),this._previousSortRequestCameraDirection=p(),this._sortRequestDirectionEpsilon=.01,this._directionChangeEpsilon=.001,this._configuration=new q(e.view.state.isGlobal),u(this._clipBox,c)}async initialize(){this.addHandles([t(()=>this.view.state.camera,()=>this._onCameraChange()),t(()=>2===this.view.state.mode,()=>this.requestRender(1))])}render(e){const t=e.find(({name:e})=>e===this.produces);if(this._updateConfigurations(),this._handleFading(),!this._data.visibleGaussians||!this._data.orderTexture.texture||!this._data.textureAtlas.texture)return t;const i=t.getAttachment(w);this._compositionConfiguration.hasEmission=null!=i;const s=this.techniques.getCompiled(v,this._configuration),a=this.techniques.getCompiled(C,this._compositionConfiguration),r=this.techniques.getCompiled(x);if(!s||!r||!a)return this.requestRender(1),t;const{fullWidth:o,fullHeight:n}=this.bindParameters.camera;this._prepareParameters(n,o);const h=this.renderingContext,l=this.fboCache,p=l.acquire(o,n,"gaussian color output"),m=t.getAttachment(D);p.attachDepth(m),this._renderGaussianColorAndDepth(p,s);const u=l.acquire(o,n,this.produces);return this._depthCompositionPassParameters.splatDepth=p.getTexture(w),u.attachDepth(t.getAttachment(D)),h.bindFramebuffer(u.fbo),h.bindTechnique(r,this.bindParameters,this._depthCompositionPassParameters),h.screen.draw(),this._compositionPassParameters.color=t.getTexture(),this._compositionPassParameters.splatColor=p.getTexture(),i?(u.acquireColor(w,8,"emissive"),this._compositionPassParameters.emission=t.getTexture(w)):this._compositionPassParameters.emission=null,h.bindFramebuffer(u.fbo),h.bindTechnique(a,this.bindParameters,this._compositionPassParameters),h.screen.draw(),p.release(),u}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}set clippingBox(e){const t=e||c;this._hasSameClipBox(t)||(u(this._clipBox,t),this._data.requestSort(),this.requestRender(1))}get clippingBox(){return this._clippingEnabled?this._clipBox:null}get _clippingEnabled(){return!d(this._clipBox,c,(e,t)=>e===t)}get _isIdle(){return 2===this.view.state.mode}get _data(){return this.layerView.data}get _fadeHelper(){return this.layerView.fadeHelper}_updateConfigurations(){const{idleMinimumOpacity:e,nonIdleMinimumOpacity:t}=this.view.qualitySettings.gaussianSplat;this._configuration.alphaCutoff=this._isIdle?e:t,this._configuration.fadingEnabled=this._fadeHelper.fadingEnabled,this._configuration.receiveShadows=this.bindParameters.shadowMap.ready,this._configuration.hasShadowHighlights=this._configuration.receiveShadows&&this.bindParameters.hasShadowHighlights,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasSlicePlane=this._slicePlaneEnabled&&null!=this.bindParameters.slicePlane}_onCameraChange(){const e=this.view.state.camera.ray.direction;if(!this._directionChanged(e))return;if(r(this._previousCameraDirection,e),!this._shouldRequestSort(e))return;this._data.requestSort()&&r(this._previousSortRequestCameraDirection,e)}_directionChanged(e){return Math.abs(e[0]-this._previousCameraDirection[0])>this._directionChangeEpsilon||Math.abs(e[1]-this._previousCameraDirection[1])>this._directionChangeEpsilon||Math.abs(e[2]-this._previousCameraDirection[2])>this._directionChangeEpsilon}_shouldRequestSort(e){return Math.abs(e[0]-this._previousSortRequestCameraDirection[0])>this._sortRequestDirectionEpsilon||Math.abs(e[1]-this._previousSortRequestCameraDirection[1])>this._sortRequestDirectionEpsilon||Math.abs(e[2]-this._previousSortRequestCameraDirection[2])>this._sortRequestDirectionEpsilon}_prepareParameters(e,t){this._passParameters.splatOrder=this._data.orderTexture.texture,this._passParameters.splatFading=this._data.fadingTexture.texture,this._passParameters.splatAtlas=this._data.textureAtlas.texture;const i=Math.tan(.5*this.camera.fovY),s=i/e*t;a(this._passParameters.tanFov,s,i),this._passParameters.focalLength=e/(2*i);const o=this.view.qualitySettings.gaussianSplat,n=this._isIdle?o.idleMinimumSplatPixelRadius:o.nonIdleMinimumSplatPixelRadius;this._passParameters.minSplatRadius=n*Math.sqrt(t*e)/Math.sqrt(2073600),r(this._passParameters.origin,this.bindParameters.camera.eye),this._prepareHighPrecisionCameraPosition(),this._updateSlicePlaneLocalOrigin(),this._updateClipUniforms()}_updateClipUniforms(){const e=this.clippingBox||c,[t,i,s,a,r,n]=e,[h,l,p]=this.camera.eye,{clipMinCameraRelative:m,clipMaxCameraRelative:u}=this._passParameters;o(m,t-h,i-l,s-p),o(u,a-h,r-l,n-p)}_updateSlicePlaneLocalOrigin(){this._passParameters.slicePlaneLocalOrigin=this.camera.eye}_hasSameClipBox(e){return d(this._clipBox,e,(e,t)=>e===t)}_renderGaussianColorAndDepth(e,t){const i=this.renderingContext;e.acquireColor(w,5,"gaussian depth output"),i.bindFramebuffer(e.fbo),i.setClearColor(0,0,0,0),i.clear(16384),this.renderingContext.bindTechnique(t,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(R.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}_prepareHighPrecisionCameraPosition(){n(this._passParameters.tileCameraPosition,this.camera.eye,1/E.tileSize),h(this._passParameters.tileCameraPosition,this._passParameters.tileCameraPosition),n(this._passParameters.cameraDelta,this._passParameters.tileCameraPosition,E.tileSize),l(this._passParameters.cameraDelta,this.camera.eye,this._passParameters.cameraDelta)}_handleFading(){if(0===this._fadeHelper.numFadingTiles)return void(this._previousFrameStart=null);this._previousFrameStart??=this.view.stage.renderer.renderContext.time;const e=this.view.stage?.renderer.renderContext.time-this._previousFrameStart;this._fadeHelper.updateAllTileFading(e),this._previousFrameStart=this.view.stage.renderer.renderContext.time,this._data.fadingTexture.updateTexture(this._data.textureAtlas.pageAllocator.pageCount)}static{this.tileSize=2.048}};e([i()],T.prototype,"produces",void 0),e([i({constructOnly:!0})],T.prototype,"layerView",void 0),T=E=e([s("esri.views.3d.webgl-engine.lib.GaussianSplatRenderNode")],T);export{T as GaussianSplatRenderNode};
2
+ import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as i,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as r,set as n,scale as o,floor as h,subtract as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as u,set as m,positiveInfinity as c,equals as d}from"../../../../geometry/support/aaBoundingBox.js";import{InternalRenderCategory as _}from"../../webgl.js";import{addWraparound as g}from"../../layers/i3s/I3SUtil.js";import C from"../../webgl/RenderNode.js";import{a as f}from"../../../../chunks/GaussianSplat.glsl.js";import{G as P}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as b}from"../shaders/GaussianSplatCompositionTechnique.js";import{GaussianSplatCompositionTechniqueConfiguration as v}from"../shaders/GaussianSplatCompositionTechniqueConfiguration.js";import{G as S}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as x}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatTechnique as q}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as w}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{ColorAttachment1 as R,DepthStencilAttachment as D,PrimitiveType as E}from"../../../webgl/enums.js";var y;let T=class extends C{static{y=this}constructor(e){super(e),this.produces=_.GAUSSIAN_SPLAT,this._slicePlaneEnabled=!1,this.layerView=null,this._passParameters=new f,this._compositionPassParameters=new P,this._depthCompositionPassParameters=new S,this._compositionConfiguration=new v,this._clipBox=u(),this._previousCameraDirection=p(),this._previousSortRequestCameraDirection=p(),this._tileCullingRevision=0,this._sortRequestDirectionEpsilon=.01,this._directionChangeEpsilon=.001,this._configuration=new w(e.view.state.isGlobal),m(this._clipBox,c)}async initialize(){this.addHandles([t(()=>this.view.state.camera,()=>this._onCameraChange()),t(()=>2===this.view.state.mode,()=>this.requestRender(1))])}render(e){const t=e.find(({name:e})=>e===this.produces);if(this._updateConfigurations(),this._handleFading(),!this._data.visibleGaussians||!this._data.orderTexture.texture||!this._data.textureAtlas.texture)return t;const i=t.getAttachment(R);this._compositionConfiguration.hasEmission=null!=i;const s=this.techniques.getCompiled(q,this._configuration),a=this.techniques.getCompiled(b,this._compositionConfiguration),r=this.techniques.getCompiled(x);if(!s||!r||!a)return this.requestRender(1),t;const{fullWidth:n,fullHeight:o}=this.bindParameters.camera;this._prepareParameters(o,n);const h=this.renderingContext,l=this.fboCache,p=l.acquire(n,o,"gaussian color output"),u=t.getAttachment(D);p.attachDepth(u),this._renderGaussianColorAndDepth(p,s);const m=l.acquire(n,o,this.produces);return this._depthCompositionPassParameters.splatDepth=p.getTexture(R),m.attachDepth(t.getAttachment(D)),h.bindFramebuffer(m.fbo),h.bindTechnique(r,this.bindParameters,this._depthCompositionPassParameters),h.screen.draw(),this._compositionPassParameters.color=t.getTexture(),this._compositionPassParameters.splatColor=p.getTexture(),i?(m.acquireColor(R,8,"emissive"),this._compositionPassParameters.emission=t.getTexture(R)):this._compositionPassParameters.emission=null,h.bindFramebuffer(m.fbo),h.bindTechnique(a,this.bindParameters,this._compositionPassParameters),h.screen.draw(),p.release(),m}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}set clippingBox(e){const t=e||c;this._hasSameClipBox(t)||(m(this._clipBox,t),this._tileCullingRevision=g(this._tileCullingRevision,1),this._data.requestSort(),this.requestRender(1))}get clippingBox(){return this._clippingEnabled?this._clipBox:null}get tileCullingRevision(){return this._tileCullingRevision}get _clippingEnabled(){return!d(this._clipBox,c,(e,t)=>e===t)}get _isIdle(){return 2===this.view.state.mode}get _data(){return this.layerView.data}get _fadeHelper(){return this.layerView.fadeHelper}_updateConfigurations(){const{idleMinimumOpacity:e,nonIdleMinimumOpacity:t}=this.view.qualitySettings.gaussianSplat;this._configuration.alphaCutoff=this._isIdle?e:t,this._configuration.fadingEnabled=this._fadeHelper.fadingEnabled,this._configuration.receiveShadows=this.bindParameters.shadowMap.ready,this._configuration.hasShadowHighlights=this._configuration.receiveShadows&&this.bindParameters.hasShadowHighlights,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasSlicePlane=this._slicePlaneEnabled&&null!=this.bindParameters.slicePlane}_onCameraChange(){this._tileCullingRevision=g(this._tileCullingRevision,1);const e=this.view.state.camera.ray.direction;if(!this._directionChanged(e))return;if(r(this._previousCameraDirection,e),!this._shouldRequestSort(e))return;this._data.requestSort()&&r(this._previousSortRequestCameraDirection,e)}_directionChanged(e){return Math.abs(e[0]-this._previousCameraDirection[0])>this._directionChangeEpsilon||Math.abs(e[1]-this._previousCameraDirection[1])>this._directionChangeEpsilon||Math.abs(e[2]-this._previousCameraDirection[2])>this._directionChangeEpsilon}_shouldRequestSort(e){return Math.abs(e[0]-this._previousSortRequestCameraDirection[0])>this._sortRequestDirectionEpsilon||Math.abs(e[1]-this._previousSortRequestCameraDirection[1])>this._sortRequestDirectionEpsilon||Math.abs(e[2]-this._previousSortRequestCameraDirection[2])>this._sortRequestDirectionEpsilon}_prepareParameters(e,t){this._passParameters.splatOrder=this._data.orderTexture.texture,this._passParameters.splatFading=this._data.fadingTexture.texture,this._passParameters.splatAtlas=this._data.textureAtlas.texture;const i=Math.tan(.5*this.camera.fovY),s=i/e*t;a(this._passParameters.tanFov,s,i),this._passParameters.focalLength=e/(2*i);const n=this.view.qualitySettings.gaussianSplat,o=this._isIdle?n.idleMinimumSplatPixelRadius:n.nonIdleMinimumSplatPixelRadius;this._passParameters.minSplatRadius=o*Math.sqrt(t*e)/Math.sqrt(2073600),r(this._passParameters.origin,this.bindParameters.camera.eye),this._prepareHighPrecisionCameraPosition(),this._updateSlicePlaneLocalOrigin(),this._updateClipUniforms()}_updateClipUniforms(){const e=this.clippingBox||c,[t,i,s,a,r,o]=e,[h,l,p]=this.camera.eye,{clipMinCameraRelative:u,clipMaxCameraRelative:m}=this._passParameters;n(u,t-h,i-l,s-p),n(m,a-h,r-l,o-p)}_updateSlicePlaneLocalOrigin(){this._passParameters.slicePlaneLocalOrigin=this.camera.eye}_hasSameClipBox(e){return d(this._clipBox,e,(e,t)=>e===t)}_renderGaussianColorAndDepth(e,t){const i=this.renderingContext;e.acquireColor(R,5,"gaussian depth output"),i.bindFramebuffer(e.fbo),i.setClearColor(0,0,0,0),i.clear(16384),this.renderingContext.bindTechnique(t,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(E.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}_prepareHighPrecisionCameraPosition(){o(this._passParameters.tileCameraPosition,this.camera.eye,1/y.tileSize),h(this._passParameters.tileCameraPosition,this._passParameters.tileCameraPosition),o(this._passParameters.cameraDelta,this._passParameters.tileCameraPosition,y.tileSize),l(this._passParameters.cameraDelta,this.camera.eye,this._passParameters.cameraDelta)}_handleFading(){if(0===this._fadeHelper.numFadingTiles)return void(this._previousFrameStart=null);this._previousFrameStart??=this.view.stage.renderer.renderContext.time;const e=this.view.stage?.renderer.renderContext.time-this._previousFrameStart;this._fadeHelper.updateAllTileFading(e),this._previousFrameStart=this.view.stage.renderer.renderContext.time,this._data.fadingTexture.updateTexture(this._data.textureAtlas.pageAllocator.pageCount)}static{this.tileSize=2.048}};e([i()],T.prototype,"produces",void 0),e([i({constructOnly:!0})],T.prototype,"layerView",void 0),T=y=e([s("esri.views.3d.webgl-engine.lib.GaussianSplatRenderNode")],T);export{T as GaussianSplatRenderNode};