@arcgis/core 4.25.0-next.20220919 → 4.25.0-next.20220921

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 (604) hide show
  1. package/AggregateGraphic.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{9f31ab2247c9defb882c.js → 01ac91fc0bc6b4d4e3c6.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{d26108352874af0b6762.js → 053564e659222e8f0efb.js} +1 -1
  5. package/assets/esri/core/workers/chunks/1c65fd714f637ac1ee8c.js +1 -0
  6. package/assets/esri/core/workers/chunks/{8588cbecb8e808f451fe.js → 249e32af1f2d433fae4c.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{5b16b30ac3166f33e81e.js → 26690f4ec1f3cb8099c2.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{be93b0cef85665446944.js → 274b4cdf6c8d77e8a2e6.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{52dcfd6b8b1dfa864e44.js → 2cae0ec5f60ab42a49aa.js} +1 -1
  10. package/assets/esri/core/workers/chunks/43e4560d65e5ddeeef6f.js +1 -0
  11. package/assets/esri/core/workers/chunks/{f436c86f86236ea7ea04.js → 4641e10e0e8e9d257521.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{7a45333de9ded92619c2.js → 466008f793c2e11e854c.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{c9d655675552dcf6cef7.js → 4a699b41072ee88f0956.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{14ea96e398f4842abe4e.js → 4fdd18f5cdaa0d82ebc1.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{9662da3e1e37f3445186.js → 562b9619b8ee13734813.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{5c1a5615c865c10209c2.js → 5880fa48bad79a7c93ab.js} +1 -1
  17. package/assets/esri/core/workers/chunks/58824250492b89ec24ea.js +1 -0
  18. package/assets/esri/core/workers/chunks/64a6b837f1d5d7ad7619.js +1 -0
  19. package/assets/esri/core/workers/chunks/{421241543afbc9a619ea.js → 64de93865088bbe0398f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{99d56a707039d645622c.js → 6a20d8740ec2a5b2c579.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{8bab21bc6164a593278f.js → 771b92e524802de840ba.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{dbb1bf97c85848bb8ce1.js → 7ce250cc6fbe68aef50d.js} +32 -32
  23. package/assets/esri/core/workers/chunks/{2c4938512dd726a177dd.js → 7fab18074b130b71a648.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{f67357b3c6c591c9da5e.js → 872f1cb3596fb80e387f.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{3ee81834b3217720cb48.js → 8874e69378a27d155f9d.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{31de71018575457155e5.js → 8ee3da8677255b8c8709.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{2e44aee22e70857b893c.js → 93631b10452b0e0189b3.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{cb2dc84d972469445da6.js → 95cd9edca50ea163d50f.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{d31bbb13af45ce8e45dc.js → acf9f753741b677afb44.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{1455944edeba1560eb07.js → afdafa77f5ca1b9e3acc.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{cf3e1ac63580bc495ea6.js → b4da35f1093f3731f9ac.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{09f4296dcb80e3ae4b3d.js → b8eba8c9d5424a7ae5f2.js} +1 -1
  33. package/assets/esri/core/workers/chunks/bb0d86937faf0cd7d16d.js +1 -0
  34. package/assets/esri/core/workers/chunks/bf3e80023e156d5906c7.js +1 -0
  35. package/assets/esri/core/workers/chunks/{8ba83fee56dd4f306d87.js → c2a6ac7046134f725cf3.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{5d3fabe66e1bce1b30fb.js → cc7569489b572b8b3b53.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{fddd4ea487788e003fb1.js → d09f06eb4157a7c2c8ab.js} +1 -1
  38. package/assets/esri/core/workers/chunks/d1be3ab7846e3a555b6c.js +1 -0
  39. package/assets/esri/core/workers/chunks/e064035f959d68e9603f.js +1 -0
  40. package/assets/esri/core/workers/chunks/{d92975e56a1290255252.js → e09df62cf35d636b0975.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{674fa5b93704ef08c9e8.js → e0c763e05feb1c2093ba.js} +1 -1
  42. package/assets/esri/core/workers/chunks/e20e99f8f76f5002437e.js +1 -0
  43. package/assets/esri/core/workers/chunks/{51289d2f5277af4023e9.js → ed33e019bc7775db2e50.js} +1 -1
  44. package/assets/esri/core/workers/chunks/ef95d6ab7b1c032ab4ad.js +1 -0
  45. package/assets/esri/core/workers/chunks/{48aa432e1bf60c68de14.js → f0c4b408a0b88adf6576.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{169f4354a375db5de121.js → ffcbcb928b6cb8c596ad.js} +1 -1
  47. package/assets/esri/t9n/common_ar.json +1 -1
  48. package/assets/esri/t9n/common_bg.json +1 -1
  49. package/assets/esri/t9n/common_bs.json +1 -1
  50. package/assets/esri/t9n/common_ca.json +1 -1
  51. package/assets/esri/t9n/common_cs.json +1 -1
  52. package/assets/esri/t9n/common_da.json +1 -1
  53. package/assets/esri/t9n/common_de.json +1 -1
  54. package/assets/esri/t9n/common_el.json +1 -1
  55. package/assets/esri/t9n/common_es.json +1 -1
  56. package/assets/esri/t9n/common_et.json +1 -1
  57. package/assets/esri/t9n/common_fi.json +1 -1
  58. package/assets/esri/t9n/common_fr.json +1 -1
  59. package/assets/esri/t9n/common_he.json +1 -1
  60. package/assets/esri/t9n/common_hr.json +1 -1
  61. package/assets/esri/t9n/common_hu.json +1 -1
  62. package/assets/esri/t9n/common_id.json +1 -1
  63. package/assets/esri/t9n/common_it.json +1 -1
  64. package/assets/esri/t9n/common_ja.json +1 -1
  65. package/assets/esri/t9n/common_ko.json +1 -1
  66. package/assets/esri/t9n/common_lt.json +1 -1
  67. package/assets/esri/t9n/common_lv.json +1 -1
  68. package/assets/esri/t9n/common_nb.json +1 -1
  69. package/assets/esri/t9n/common_nl.json +1 -1
  70. package/assets/esri/t9n/common_pl.json +1 -1
  71. package/assets/esri/t9n/common_pt-BR.json +1 -1
  72. package/assets/esri/t9n/common_pt-PT.json +1 -1
  73. package/assets/esri/t9n/common_ro.json +1 -1
  74. package/assets/esri/t9n/common_ru.json +1 -1
  75. package/assets/esri/t9n/common_sk.json +1 -1
  76. package/assets/esri/t9n/common_sl.json +1 -1
  77. package/assets/esri/t9n/common_sr.json +1 -1
  78. package/assets/esri/t9n/common_sv.json +1 -1
  79. package/assets/esri/t9n/common_th.json +1 -1
  80. package/assets/esri/t9n/common_tr.json +1 -1
  81. package/assets/esri/t9n/common_uk.json +1 -1
  82. package/assets/esri/t9n/common_vi.json +1 -1
  83. package/assets/esri/t9n/common_zh-CN.json +1 -1
  84. package/assets/esri/t9n/common_zh-HK.json +1 -1
  85. package/assets/esri/t9n/common_zh-TW.json +1 -1
  86. package/assets/esri/themes/base/widgets/_Daylight.scss +1 -0
  87. package/assets/esri/themes/base/widgets/_Directions.scss +1 -2
  88. package/assets/esri/themes/dark/main.css +1 -1
  89. package/assets/esri/themes/light/main.css +1 -1
  90. package/assets/esri/themes/light/view.css +1 -1
  91. package/assets/esri/widgets/Feature/t9n/Feature_ar.json +1 -1
  92. package/assets/esri/widgets/Feature/t9n/Feature_bg.json +1 -1
  93. package/assets/esri/widgets/Feature/t9n/Feature_bs.json +1 -1
  94. package/assets/esri/widgets/Feature/t9n/Feature_ca.json +1 -1
  95. package/assets/esri/widgets/Feature/t9n/Feature_cs.json +1 -1
  96. package/assets/esri/widgets/Feature/t9n/Feature_da.json +1 -1
  97. package/assets/esri/widgets/Feature/t9n/Feature_de.json +1 -1
  98. package/assets/esri/widgets/Feature/t9n/Feature_el.json +1 -1
  99. package/assets/esri/widgets/Feature/t9n/Feature_es.json +1 -1
  100. package/assets/esri/widgets/Feature/t9n/Feature_et.json +1 -1
  101. package/assets/esri/widgets/Feature/t9n/Feature_fi.json +1 -1
  102. package/assets/esri/widgets/Feature/t9n/Feature_fr.json +1 -1
  103. package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
  104. package/assets/esri/widgets/Feature/t9n/Feature_hr.json +1 -1
  105. package/assets/esri/widgets/Feature/t9n/Feature_hu.json +1 -1
  106. package/assets/esri/widgets/Feature/t9n/Feature_id.json +1 -1
  107. package/assets/esri/widgets/Feature/t9n/Feature_it.json +1 -1
  108. package/assets/esri/widgets/Feature/t9n/Feature_ja.json +1 -1
  109. package/assets/esri/widgets/Feature/t9n/Feature_ko.json +1 -1
  110. package/assets/esri/widgets/Feature/t9n/Feature_lt.json +1 -1
  111. package/assets/esri/widgets/Feature/t9n/Feature_lv.json +1 -1
  112. package/assets/esri/widgets/Feature/t9n/Feature_nb.json +1 -1
  113. package/assets/esri/widgets/Feature/t9n/Feature_nl.json +1 -1
  114. package/assets/esri/widgets/Feature/t9n/Feature_pl.json +1 -1
  115. package/assets/esri/widgets/Feature/t9n/Feature_pt-BR.json +1 -1
  116. package/assets/esri/widgets/Feature/t9n/Feature_pt-PT.json +1 -1
  117. package/assets/esri/widgets/Feature/t9n/Feature_ro.json +1 -1
  118. package/assets/esri/widgets/Feature/t9n/Feature_ru.json +1 -1
  119. package/assets/esri/widgets/Feature/t9n/Feature_sk.json +1 -1
  120. package/assets/esri/widgets/Feature/t9n/Feature_sl.json +1 -1
  121. package/assets/esri/widgets/Feature/t9n/Feature_sr.json +1 -1
  122. package/assets/esri/widgets/Feature/t9n/Feature_sv.json +1 -1
  123. package/assets/esri/widgets/Feature/t9n/Feature_th.json +1 -1
  124. package/assets/esri/widgets/Feature/t9n/Feature_tr.json +1 -1
  125. package/assets/esri/widgets/Feature/t9n/Feature_uk.json +1 -1
  126. package/assets/esri/widgets/Feature/t9n/Feature_vi.json +1 -1
  127. package/assets/esri/widgets/Feature/t9n/Feature_zh-CN.json +1 -1
  128. package/assets/esri/widgets/Feature/t9n/Feature_zh-HK.json +1 -1
  129. package/assets/esri/widgets/Feature/t9n/Feature_zh-TW.json +1 -1
  130. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  131. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  132. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  133. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  134. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  135. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  136. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  137. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  138. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  139. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  140. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  141. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  142. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  143. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  144. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  145. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  146. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  147. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  148. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  149. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  150. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  151. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nb.json +1 -1
  152. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  153. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  154. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  155. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  156. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  157. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  158. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  159. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  160. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  161. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  162. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  163. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  164. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  165. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  166. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  167. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  168. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  169. package/assets/esri/widgets/Popup/t9n/Popup_ar.json +1 -1
  170. package/assets/esri/widgets/Popup/t9n/Popup_bg.json +1 -1
  171. package/assets/esri/widgets/Popup/t9n/Popup_bs.json +1 -1
  172. package/assets/esri/widgets/Popup/t9n/Popup_ca.json +1 -1
  173. package/assets/esri/widgets/Popup/t9n/Popup_cs.json +1 -1
  174. package/assets/esri/widgets/Popup/t9n/Popup_da.json +1 -1
  175. package/assets/esri/widgets/Popup/t9n/Popup_de.json +1 -1
  176. package/assets/esri/widgets/Popup/t9n/Popup_el.json +1 -1
  177. package/assets/esri/widgets/Popup/t9n/Popup_es.json +1 -1
  178. package/assets/esri/widgets/Popup/t9n/Popup_et.json +1 -1
  179. package/assets/esri/widgets/Popup/t9n/Popup_fi.json +1 -1
  180. package/assets/esri/widgets/Popup/t9n/Popup_fr.json +1 -1
  181. package/assets/esri/widgets/Popup/t9n/Popup_he.json +1 -1
  182. package/assets/esri/widgets/Popup/t9n/Popup_hr.json +1 -1
  183. package/assets/esri/widgets/Popup/t9n/Popup_hu.json +1 -1
  184. package/assets/esri/widgets/Popup/t9n/Popup_id.json +1 -1
  185. package/assets/esri/widgets/Popup/t9n/Popup_it.json +1 -1
  186. package/assets/esri/widgets/Popup/t9n/Popup_ja.json +1 -1
  187. package/assets/esri/widgets/Popup/t9n/Popup_ko.json +1 -1
  188. package/assets/esri/widgets/Popup/t9n/Popup_lt.json +1 -1
  189. package/assets/esri/widgets/Popup/t9n/Popup_lv.json +1 -1
  190. package/assets/esri/widgets/Popup/t9n/Popup_nb.json +1 -1
  191. package/assets/esri/widgets/Popup/t9n/Popup_nl.json +1 -1
  192. package/assets/esri/widgets/Popup/t9n/Popup_pl.json +1 -1
  193. package/assets/esri/widgets/Popup/t9n/Popup_pt-BR.json +1 -1
  194. package/assets/esri/widgets/Popup/t9n/Popup_pt-PT.json +1 -1
  195. package/assets/esri/widgets/Popup/t9n/Popup_ro.json +1 -1
  196. package/assets/esri/widgets/Popup/t9n/Popup_ru.json +1 -1
  197. package/assets/esri/widgets/Popup/t9n/Popup_sk.json +1 -1
  198. package/assets/esri/widgets/Popup/t9n/Popup_sl.json +1 -1
  199. package/assets/esri/widgets/Popup/t9n/Popup_sr.json +1 -1
  200. package/assets/esri/widgets/Popup/t9n/Popup_sv.json +1 -1
  201. package/assets/esri/widgets/Popup/t9n/Popup_th.json +1 -1
  202. package/assets/esri/widgets/Popup/t9n/Popup_tr.json +1 -1
  203. package/assets/esri/widgets/Popup/t9n/Popup_uk.json +1 -1
  204. package/assets/esri/widgets/Popup/t9n/Popup_vi.json +1 -1
  205. package/assets/esri/widgets/Popup/t9n/Popup_zh-CN.json +1 -1
  206. package/assets/esri/widgets/Popup/t9n/Popup_zh-HK.json +1 -1
  207. package/assets/esri/widgets/Popup/t9n/Popup_zh-TW.json +1 -1
  208. package/assets/esri/widgets/support/t9n/DatePicker_ar.json +1 -1
  209. package/assets/esri/widgets/support/t9n/DatePicker_bg.json +1 -1
  210. package/assets/esri/widgets/support/t9n/DatePicker_bs.json +1 -1
  211. package/assets/esri/widgets/support/t9n/DatePicker_ca.json +1 -1
  212. package/assets/esri/widgets/support/t9n/DatePicker_cs.json +1 -1
  213. package/assets/esri/widgets/support/t9n/DatePicker_da.json +1 -1
  214. package/assets/esri/widgets/support/t9n/DatePicker_de.json +1 -1
  215. package/assets/esri/widgets/support/t9n/DatePicker_el.json +1 -1
  216. package/assets/esri/widgets/support/t9n/DatePicker_es.json +1 -1
  217. package/assets/esri/widgets/support/t9n/DatePicker_et.json +1 -1
  218. package/assets/esri/widgets/support/t9n/DatePicker_fi.json +1 -1
  219. package/assets/esri/widgets/support/t9n/DatePicker_fr.json +1 -1
  220. package/assets/esri/widgets/support/t9n/DatePicker_he.json +1 -1
  221. package/assets/esri/widgets/support/t9n/DatePicker_hr.json +1 -1
  222. package/assets/esri/widgets/support/t9n/DatePicker_hu.json +1 -1
  223. package/assets/esri/widgets/support/t9n/DatePicker_id.json +1 -1
  224. package/assets/esri/widgets/support/t9n/DatePicker_it.json +1 -1
  225. package/assets/esri/widgets/support/t9n/DatePicker_ja.json +1 -1
  226. package/assets/esri/widgets/support/t9n/DatePicker_ko.json +1 -1
  227. package/assets/esri/widgets/support/t9n/DatePicker_lt.json +1 -1
  228. package/assets/esri/widgets/support/t9n/DatePicker_lv.json +1 -1
  229. package/assets/esri/widgets/support/t9n/DatePicker_nb.json +1 -1
  230. package/assets/esri/widgets/support/t9n/DatePicker_nl.json +1 -1
  231. package/assets/esri/widgets/support/t9n/DatePicker_pl.json +1 -1
  232. package/assets/esri/widgets/support/t9n/DatePicker_pt-BR.json +1 -1
  233. package/assets/esri/widgets/support/t9n/DatePicker_pt-PT.json +1 -1
  234. package/assets/esri/widgets/support/t9n/DatePicker_ro.json +1 -1
  235. package/assets/esri/widgets/support/t9n/DatePicker_ru.json +1 -1
  236. package/assets/esri/widgets/support/t9n/DatePicker_sk.json +1 -1
  237. package/assets/esri/widgets/support/t9n/DatePicker_sl.json +1 -1
  238. package/assets/esri/widgets/support/t9n/DatePicker_sr.json +1 -1
  239. package/assets/esri/widgets/support/t9n/DatePicker_sv.json +1 -1
  240. package/assets/esri/widgets/support/t9n/DatePicker_th.json +1 -1
  241. package/assets/esri/widgets/support/t9n/DatePicker_tr.json +1 -1
  242. package/assets/esri/widgets/support/t9n/DatePicker_uk.json +1 -1
  243. package/assets/esri/widgets/support/t9n/DatePicker_vi.json +1 -1
  244. package/assets/esri/widgets/support/t9n/DatePicker_zh-CN.json +1 -1
  245. package/assets/esri/widgets/support/t9n/DatePicker_zh-HK.json +1 -1
  246. package/assets/esri/widgets/support/t9n/DatePicker_zh-TW.json +1 -1
  247. package/assets/esri/widgets/support/t9n/TimePicker_ar.json +1 -1
  248. package/assets/esri/widgets/support/t9n/TimePicker_bg.json +1 -1
  249. package/assets/esri/widgets/support/t9n/TimePicker_bs.json +1 -1
  250. package/assets/esri/widgets/support/t9n/TimePicker_ca.json +1 -1
  251. package/assets/esri/widgets/support/t9n/TimePicker_cs.json +1 -1
  252. package/assets/esri/widgets/support/t9n/TimePicker_da.json +1 -1
  253. package/assets/esri/widgets/support/t9n/TimePicker_de.json +1 -1
  254. package/assets/esri/widgets/support/t9n/TimePicker_el.json +1 -1
  255. package/assets/esri/widgets/support/t9n/TimePicker_es.json +1 -1
  256. package/assets/esri/widgets/support/t9n/TimePicker_et.json +1 -1
  257. package/assets/esri/widgets/support/t9n/TimePicker_fi.json +1 -1
  258. package/assets/esri/widgets/support/t9n/TimePicker_fr.json +1 -1
  259. package/assets/esri/widgets/support/t9n/TimePicker_he.json +1 -1
  260. package/assets/esri/widgets/support/t9n/TimePicker_hr.json +1 -1
  261. package/assets/esri/widgets/support/t9n/TimePicker_hu.json +1 -1
  262. package/assets/esri/widgets/support/t9n/TimePicker_id.json +1 -1
  263. package/assets/esri/widgets/support/t9n/TimePicker_it.json +1 -1
  264. package/assets/esri/widgets/support/t9n/TimePicker_ja.json +1 -1
  265. package/assets/esri/widgets/support/t9n/TimePicker_ko.json +1 -1
  266. package/assets/esri/widgets/support/t9n/TimePicker_lt.json +1 -1
  267. package/assets/esri/widgets/support/t9n/TimePicker_lv.json +1 -1
  268. package/assets/esri/widgets/support/t9n/TimePicker_nb.json +1 -1
  269. package/assets/esri/widgets/support/t9n/TimePicker_nl.json +1 -1
  270. package/assets/esri/widgets/support/t9n/TimePicker_pl.json +1 -1
  271. package/assets/esri/widgets/support/t9n/TimePicker_pt-BR.json +1 -1
  272. package/assets/esri/widgets/support/t9n/TimePicker_pt-PT.json +1 -1
  273. package/assets/esri/widgets/support/t9n/TimePicker_ro.json +1 -1
  274. package/assets/esri/widgets/support/t9n/TimePicker_ru.json +1 -1
  275. package/assets/esri/widgets/support/t9n/TimePicker_sk.json +1 -1
  276. package/assets/esri/widgets/support/t9n/TimePicker_sl.json +1 -1
  277. package/assets/esri/widgets/support/t9n/TimePicker_sr.json +1 -1
  278. package/assets/esri/widgets/support/t9n/TimePicker_sv.json +1 -1
  279. package/assets/esri/widgets/support/t9n/TimePicker_th.json +1 -1
  280. package/assets/esri/widgets/support/t9n/TimePicker_tr.json +1 -1
  281. package/assets/esri/widgets/support/t9n/TimePicker_uk.json +1 -1
  282. package/assets/esri/widgets/support/t9n/TimePicker_vi.json +1 -1
  283. package/assets/esri/widgets/support/t9n/TimePicker_zh-CN.json +1 -1
  284. package/assets/esri/widgets/support/t9n/TimePicker_zh-HK.json +1 -1
  285. package/assets/esri/widgets/support/t9n/TimePicker_zh-TW.json +1 -1
  286. package/chunks/CheckerBoard.glsl.js +3 -3
  287. package/chunks/ColorMaterial.glsl.js +5 -5
  288. package/chunks/ComponentShader.glsl.js +1 -1
  289. package/chunks/Compositing.glsl.js +4 -19
  290. package/chunks/DefaultMaterial.glsl.js +2 -2
  291. package/chunks/HUDCompositing.glsl.js +7 -0
  292. package/chunks/HeatmapDensity.glsl.js +4 -4
  293. package/chunks/ImageMaterial.glsl.js +1 -1
  294. package/chunks/Laserlines.glsl.js +5 -5
  295. package/chunks/LineMarker.glsl.js +1 -1
  296. package/chunks/MeasurementArrow.glsl.js +3 -3
  297. package/chunks/NativeLine.glsl.js +1 -1
  298. package/chunks/OITCompositing.glsl.js +13 -0
  299. package/chunks/OverlayCompositing.glsl.js +8 -0
  300. package/chunks/Path.glsl.js +3 -3
  301. package/chunks/Pattern.glsl.js +1 -1
  302. package/chunks/Precipitation.glsl.js +3 -3
  303. package/chunks/RealisticTree.glsl.js +2 -2
  304. package/chunks/RibbonLine.glsl.js +25 -25
  305. package/chunks/ShadedColorMaterial.glsl.js +1 -1
  306. package/chunks/ShadowHighlight.glsl.js +1 -1
  307. package/chunks/SlicePlaneMaterial.glsl.js +2 -2
  308. package/chunks/Terrain.glsl.js +4 -4
  309. package/chunks/WaterSurface.glsl.js +1 -1
  310. package/chunks/ar.js +1 -1
  311. package/chunks/bg_BG.js +1 -1
  312. package/chunks/boundedPlane.js +1 -1
  313. package/chunks/bs_BA.js +1 -1
  314. package/chunks/ca_ES.js +1 -1
  315. package/chunks/cameraUtilsPlanar.js +1 -1
  316. package/chunks/cameraUtilsSpherical.js +1 -1
  317. package/chunks/cs_CZ.js +1 -1
  318. package/chunks/da_DK.js +1 -1
  319. package/chunks/de_CH.js +1 -1
  320. package/chunks/de_DE.js +1 -1
  321. package/chunks/el_GR.js +1 -1
  322. package/chunks/en_CA.js +1 -1
  323. package/chunks/en_US.js +1 -1
  324. package/chunks/es_ES.js +1 -1
  325. package/chunks/et_EE.js +1 -1
  326. package/chunks/fi_FI.js +1 -1
  327. package/chunks/fr_FR.js +1 -1
  328. package/chunks/he_IL.js +1 -1
  329. package/chunks/hr_HR.js +1 -1
  330. package/chunks/hu_HU.js +1 -1
  331. package/chunks/id_ID.js +1 -1
  332. package/chunks/index.js +1 -1
  333. package/chunks/it_IT.js +1 -1
  334. package/chunks/ja_JP.js +1 -1
  335. package/chunks/ko_KR.js +1 -1
  336. package/chunks/lt_LT.js +1 -1
  337. package/chunks/lv_LV.js +1 -1
  338. package/chunks/mat3.js +1 -1
  339. package/chunks/nb_NO.js +1 -1
  340. package/chunks/nl_NL.js +1 -1
  341. package/chunks/pl_PL.js +1 -1
  342. package/chunks/pt_BR.js +1 -1
  343. package/chunks/pt_PT.js +1 -1
  344. package/chunks/quat.js +1 -1
  345. package/chunks/quat2.js +1 -1
  346. package/chunks/quatf64.js +1 -1
  347. package/chunks/ro_RO.js +1 -1
  348. package/chunks/ru_RU.js +1 -1
  349. package/chunks/sk_SK.js +1 -1
  350. package/chunks/sl_SL.js +1 -1
  351. package/chunks/sphere.js +1 -1
  352. package/chunks/sr_RS.js +1 -1
  353. package/chunks/sv_SE.js +1 -1
  354. package/chunks/th_TH.js +1 -1
  355. package/chunks/tr_TR.js +1 -1
  356. package/chunks/uk_UA.js +1 -1
  357. package/chunks/vec3.js +1 -1
  358. package/chunks/vec3f32.js +1 -1
  359. package/chunks/vec4f64.js +1 -1
  360. package/chunks/vi_VN.js +1 -1
  361. package/chunks/zh_Hans.js +1 -1
  362. package/chunks/zh_Hant.js +1 -1
  363. package/core/VectorStack.js +1 -1
  364. package/core/libs/gl-matrix-2/factories/quatf64.js +1 -1
  365. package/core/libs/gl-matrix-2/factories/vec3f32.js +1 -1
  366. package/core/libs/gl-matrix-2/factories/vec4f64.js +1 -1
  367. package/core/libs/gl-matrix-2/math/mat3.js +1 -1
  368. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  369. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  370. package/core/perspectiveUtils.js +1 -1
  371. package/core/workers/workerFactory.js +1 -1
  372. package/geohash/GeohashTree.js +1 -1
  373. package/geometry/support/MeshTransform.js +1 -1
  374. package/geometry/support/axisAngle.js +1 -1
  375. package/geometry/support/axisAngleDegrees.js +1 -1
  376. package/geometry/support/lineSegment.js +1 -1
  377. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  378. package/geometry/support/meshUtils/exporters/gltf/node.js +1 -1
  379. package/geometry/support/meshUtils/georeference.js +1 -1
  380. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  381. package/geometry/support/meshUtils/projection.js +1 -1
  382. package/geometry/support/meshUtils/rotate.js +1 -1
  383. package/geometry/support/plane.js +1 -1
  384. package/interfaces.d.ts +70 -0
  385. package/layers/VoxelWasmPerSceneView.js +1 -1
  386. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  387. package/layers/graphics/featureConversionUtils.js +1 -1
  388. package/layers/mixins/EditBusLayer.js +1 -1
  389. package/layers/mixins/OperationalLayer.js +1 -1
  390. package/layers/support/AggregateField.js +1 -1
  391. package/layers/support/ControlPointsGeoreference.js +1 -1
  392. package/layers/support/ExportImageServiceParameters.js +1 -1
  393. package/layers/support/OutStatistic.js +1 -1
  394. package/layers/support/VoxelVolume.js +1 -1
  395. package/layers/support/voxelPlaneUtils.js +1 -1
  396. package/package.json +1 -1
  397. package/rest/support/AggregateFeatureSet.js +5 -0
  398. package/support/revision.js +1 -1
  399. package/views/2d/ViewState.js +1 -1
  400. package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
  401. package/views/2d/engine/imagery/RasterVFTile.js +1 -1
  402. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  403. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  404. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  405. package/views/2d/engine/webgl/WGLTile.js +1 -1
  406. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  407. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  408. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  409. package/views/2d/layers/LayerView2D.js +1 -1
  410. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  411. package/views/2d/layers/features/schemaUtils.js +1 -1
  412. package/views/2d/layers/features/support/BinStore.js +1 -1
  413. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  414. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  415. package/views/2d/layers/imagery/ImageryView2D.js +1 -1
  416. package/views/2d/layers/support/DebugOverlay.js +1 -1
  417. package/views/2d/layers/support/ExportStrategy.js +1 -1
  418. package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
  419. package/views/2d/layers/support/clusterUtils.js +1 -1
  420. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  421. package/views/3d/analysis/Dimensioning/DimensioningTool.js +1 -1
  422. package/views/3d/analysis/Dimensioning/LengthDimensionComputation.js +1 -1
  423. package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +1 -1
  424. package/views/3d/analysis/Dimensioning/LengthDimensionVisualization.js +1 -1
  425. package/views/3d/analysis/Dimensioning/lengthDimensionUtils.js +1 -1
  426. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  427. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  428. package/views/3d/analysis/Slice/sliceToolConfig.js +1 -1
  429. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  430. package/views/3d/camera/constraintUtils/distance.js +1 -1
  431. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  432. package/views/3d/environment/CloudsComposition.js +1 -1
  433. package/views/3d/environment/CloudsCompositionParameters.js +1 -1
  434. package/views/3d/environment/CloudsGenerator.js +1 -1
  435. package/views/3d/environment/CloudsPresets.js +1 -1
  436. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  437. package/views/3d/environment/Fog.js +1 -1
  438. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  439. package/views/3d/environment/Precipitation.js +1 -1
  440. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  441. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  442. package/views/3d/environment/weatherUtils.js +1 -1
  443. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  444. package/views/3d/externalRenderers/RenderContext.js +1 -1
  445. package/views/3d/glTF/internal/Resource.js +1 -1
  446. package/views/3d/interactive/Manipulator3D.js +1 -1
  447. package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
  448. package/views/3d/interactive/editingTools/settings.js +1 -1
  449. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  450. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  451. package/views/3d/interactive/manipulatorUtils.js +1 -1
  452. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  453. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  454. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  455. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  456. package/views/3d/layers/I3SMeshView3D.js +1 -1
  457. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  458. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  459. package/views/3d/layers/PointCloudWorker.js +1 -1
  460. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  461. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  462. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  463. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  464. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  465. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  466. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  467. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  468. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  469. package/views/3d/layers/graphics/elevationAlignPointsInFeatures.js +1 -1
  470. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  471. package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
  472. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  473. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  474. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  475. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  476. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  477. package/views/3d/layers/support/I3STreeDebugger.js +1 -1
  478. package/views/3d/layers/support/edgeUtils.js +1 -1
  479. package/views/3d/layers/support/uvUtils.js +1 -1
  480. package/views/3d/state/Frustum.js +1 -1
  481. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  482. package/views/3d/state/controllers/RotateController.js +1 -1
  483. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  484. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  485. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  486. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  487. package/views/3d/state/utils/navigationUtils.js +1 -1
  488. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  489. package/views/3d/support/orientedBoundingBox.js +1 -1
  490. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  491. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  492. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  493. package/views/3d/support/sunUtils.js +1 -1
  494. package/views/3d/terrain/OverlayManager.js +1 -1
  495. package/views/3d/terrain/OverlayRenderer.js +1 -1
  496. package/views/3d/terrain/PatchRenderData.js +1 -1
  497. package/views/3d/terrain/TerrainRenderer.js +1 -1
  498. package/views/3d/terrain/TerrainSurface.js +1 -1
  499. package/views/3d/terrain/Tile.js +1 -1
  500. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  501. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  502. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  503. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  504. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  505. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  506. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
  507. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +6 -6
  508. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +2 -2
  509. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +13 -13
  510. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +1 -1
  511. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +9 -9
  512. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  513. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  514. package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
  515. package/views/3d/webgl-engine/lib/AnimationTimer.js +1 -1
  516. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  517. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  518. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  519. package/views/3d/webgl-engine/lib/GeometryRecord.js +1 -1
  520. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  521. package/views/3d/webgl-engine/lib/Highlight.js +1 -1
  522. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  523. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  524. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
  525. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  526. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  527. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  528. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  529. package/views/3d/webgl-engine/lib/Update.js +5 -0
  530. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  531. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  532. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  533. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  534. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  535. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  536. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  537. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  538. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  539. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  540. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  541. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  542. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  543. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  544. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  545. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  546. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  547. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  548. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  549. package/views/3d/webgl-engine/shaders/Compositing.glsl.js +1 -1
  550. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  551. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  552. package/views/3d/webgl-engine/shaders/HUDCompositing.glsl.js +5 -0
  553. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +5 -0
  554. package/views/3d/webgl-engine/shaders/OITCompositing.glsl.js +5 -0
  555. package/views/3d/webgl-engine/shaders/OITCompositingTechnique.js +5 -0
  556. package/views/3d/webgl-engine/shaders/OverlayCompositing.glsl.js +5 -0
  557. package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +5 -0
  558. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  559. package/views/SceneView.js +1 -1
  560. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  561. package/views/interactive/coordinateHelper.js +1 -1
  562. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  563. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  564. package/views/interactive/snapping/LineSnapper.js +1 -1
  565. package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
  566. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  567. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  568. package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
  569. package/views/interactive/snapping/SnappingManager.js +1 -1
  570. package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
  571. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  572. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  573. package/views/interactive/snapping/featureSources/SnappingCandidateElevationAligner.js +1 -1
  574. package/views/interactive/snapping/featureSources/SnappingResultElevationFilter.js +1 -1
  575. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  576. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  577. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  578. package/views/interactive/snapping/featureSources/snappingResultElevationUtils.js +5 -0
  579. package/views/interactive/snapping/snappingUtils.js +1 -1
  580. package/views/layers/FeatureLayerView.js +1 -1
  581. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  582. package/views/support/Scheduler.js +1 -1
  583. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  584. package/views/support/geometry3dUtils.js +1 -1
  585. package/widgets/Directions/support/resources.js +1 -1
  586. package/widgets/Directions.js +1 -1
  587. package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
  588. package/widgets/ElevationProfile/support/constants.js +1 -1
  589. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  590. package/widgets/Feature/FeatureRelationship.js +1 -1
  591. package/widgets/Legend/LegendViewModel.js +1 -1
  592. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  593. package/widgets/Weather/LabeledSlider.js +1 -1
  594. package/widgets/Weather.js +1 -1
  595. package/assets/esri/core/workers/chunks/0059699bf824f851d51c.js +0 -1
  596. package/assets/esri/core/workers/chunks/01a6005569d0820992a0.js +0 -1
  597. package/assets/esri/core/workers/chunks/2eb547a0be305f2c816c.js +0 -1
  598. package/assets/esri/core/workers/chunks/36dd5654df5c7f00406d.js +0 -1
  599. package/assets/esri/core/workers/chunks/36e0a0d5f86b2b4b88f9.js +0 -1
  600. package/assets/esri/core/workers/chunks/8b8a813f5e6d6551a816.js +0 -1
  601. package/assets/esri/core/workers/chunks/bf84189bd9bf3de81df9.js +0 -1
  602. package/assets/esri/core/workers/chunks/cd7f5c3d328166f28f59.js +0 -1
  603. package/assets/esri/core/workers/chunks/de128d8a643b4297940b.js +0 -1
  604. package/assets/esri/core/workers/chunks/e208d9c34f5db4481441.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t,isNone as e}from"../../../../core/maybe.js";import{c as s,m as i}from"../../../../chunks/mat4.js";import{c as r,b as o,I as a}from"../../../../chunks/mat4f64.js";import{h as n,m as h,i as m,c,s as l}from"../../../../chunks/vec3.js";import{a as d,f as g,c as _}from"../../../../chunks/vec3f64.js";import{c as u,l as b}from"../../../../chunks/sphere.js";import{maxScale as f}from"../../support/mathUtils.js";import{Object3DState as p}from"./basicInterfaces.js";import{ContentObject as v}from"./ContentObject.js";import{ContentObjectType as y}from"./ContentObjectType.js";import{GeometryRecord as j}from"./GeometryRecord.js";import{Object3DStateID as V}from"./Object3DStateID.js";import{assert as S}from"./Util.js";import{addObject3DStateID as A,removeObject3DStateID as T}from"../materials/renderers/utils.js";class x extends v{constructor(t={}){super(),this.type=y.Object,this._geometryRecords=new Array,this._geometries=new Array,this._objectTransformation=r(),this._bvObjectSpace=new L,this._bvWorldSpace=new L,this._bvDirty=!0,this._hasVolatileTransformation=!1,this._visible=!0,this.castShadow=null==t.castShadow||t.castShadow,this.metadata=t.metadata,this.metadata&&this.metadata.isElevationSource&&(this.metadata.lastValidElevationBB=new O);const{geometries:e,materials:s,transformations:i,origins:a}=t;if(Array.isArray(e)){S(s.length===e.length,"Object3D: materials don't match geometries"),S(i.length===e.length,"Object3D: transformations don't match geometries"),this._geometryRecords.length=e.length,this._geometries.length=e.length;for(let t=0;t<e.length;t++)this._geometries[t]=e[t],this._geometryRecords[t]=j.pool.acquire(e[t],s[t],o(i[t]),{highlights:null,occludees:null,visible:this._visible},a&&a[t])}}get geometryRecords(){return this._geometryRecords}get geometries(){return this._geometries}get transformation(){return this._objectTransformation}set transformation(t){s(this._objectTransformation,t),this._invalidateBoundingVolume(),this._emit("objectTransformation",this)}dispose(){this._geometryRecords.length=0,this._geometries.length=0}get parentLayer(){return this._parentLayer}set parentLayer(t){S(null==this._parentLayer||null==t,"Object3D can only be added to a single Layer"),this._parentLayer=t}addGeometry(e,s,i,r,o){i=i||a,this._geometries.push(e);const n=j.pool.acquire(e,s,i,{highlights:null,occludees:null,visible:this._visible},r,o);return this._geometryRecords.push(n),this._hasVolatileTransformation=this._hasVolatileTransformation||t(n.shaderTransformation),this._emit("objectGeometryAdded",{object:this,record:n}),this._invalidateBoundingVolume(),n}removeGeometry(e){const s=this._geometryRecords.splice(e,1)[0];return this._hasVolatileTransformation=t(s.shaderTransformation)?this._geometryRecords.some((e=>t(e.shaderTransformation))):this._hasVolatileTransformation,s.dispose(),this._geometries.splice(e,1),this._emit("objectGeometryRemoved",{object:this,record:s}),this._invalidateBoundingVolume(),s}removeAllGeometries(){for(;this.geometryRecords.length>0;)this.removeGeometry(0)}geometryVertexAttrsUpdated(t){this._emit("vertexAttrsUpdated",{object:this,record:t}),this._invalidateBoundingVolume()}get isVisible(){return this._visible}setVisible(t){if(this._visible!==t){this._visible=t;for(const t of this._geometryRecords)t.instanceParameters.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const t=new V(p.MaskOccludee);for(const e of this._geometryRecords)e.instanceParameters.occludees=A(e.instanceParameters.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const e of this._geometryRecords)e.instanceParameters.occludees=T(e.instanceParameters.occludees,t);this._emit("occlusionChanged",this)}highlight(){const t=new V(p.Highlight);for(const e of this._geometryRecords)e.instanceParameters.highlights=A(e.instanceParameters.highlights,t);return this._emit("highlightChanged",this),t}removeHighlight(t){for(const e of this._geometryRecords)e.instanceParameters.highlights=T(e.instanceParameters.highlights,t);this._emit("highlightChanged",this)}getCombinedStaticTransformation(t,e){return i(e,this.transformation,t.getStaticTransformation())}_getCombinedShaderTransformation(t){return i(r(),this.transformation,t.getShaderTransformation())}hasVolativeTransformation(){return this._hasVolatileTransformation}get boundingVolumeWorldSpace(){return this._validateBoundingVolume(),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._validateBoundingVolume(),this._bvObjectSpace}_validateBoundingVolume(){if(!this._bvDirty&&!this._hasVolatileTransformation)return;this._bvObjectSpace.init(),this._bvWorldSpace.init();for(let e=0;e<this._geometryRecords.length;++e){const s=this._geometries[e],i=this._geometryRecords[e],r=s.boundingInfo;t(r)&&(this._calculateTransformedBoundingVolume(r,this._bvObjectSpace,i.getShaderTransformation()),this._calculateTransformedBoundingVolume(r,this._bvWorldSpace,this._getCombinedShaderTransformation(i)))}n(this._bvObjectSpace.bounds,this._bvObjectSpace.min,this._bvObjectSpace.max,.5),n(this._bvWorldSpace.bounds,this._bvWorldSpace.min,this._bvWorldSpace.max,.5);const s=_(),i=_(),r=f(this.transformation);for(let t=0;t<this._geometryRecords.length;++t){const o=this._geometries[t].boundingInfo;if(e(o))continue;const a=this._geometryRecords[t].getShaderTransformation(),n=f(a);h(s,o.getCenter(),a);const c=m(s,this._bvObjectSpace.bounds),l=o.getBSRadius()*n;this._bvObjectSpace.bounds[3]=Math.max(this._bvObjectSpace.bounds[3],c+l),h(i,s,this.transformation);const d=m(i,this._bvWorldSpace.bounds),g=l*r;this._bvWorldSpace.bounds[3]=Math.max(this._bvWorldSpace.bounds[3],d+g)}this._bvDirty=!1}_calculateTransformedBoundingVolume(t,e,s){const i=t.getBBMin(),r=t.getBBMax(),o=d(i),a=d(r);h(o,o,s),h(a,a,s);for(let n=0;n<3;++n)e.min[n]=Math.min(e.min[n],o[n],a[n]),e.max[n]=Math.max(e.max[n],o[n],a[n]);for(let n=0;n<3;++n){c(o,i),c(a,r),o[n]=r[n],a[n]=i[n],h(o,o,s),h(a,a,s);for(let t=0;t<3;++t)e.min[t]=Math.min(e.min[t],o[t],a[t]),e.max[t]=Math.max(e.max[t],o[t],a[t])}}_invalidateBoundingVolume(){this._bvDirty=!0,t(this._parentLayer)&&this._parentLayer.notifyObjectBBChanged(this,this._bvWorldSpace.bounds)}_emit(e,s){t(this._parentLayer)&&this._parentLayer.events.emit(e,s)}get test(){const t=this;return{hasGeometry:e=>t._geometries.includes(e),getGeometryIndex:e=>t._geometries.indexOf(e)}}}class O{constructor(){this.min=g(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.max=g(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)}isEmpty(){return this.max[0]<this.min[0]&&this.max[1]<this.min[1]&&this.max[2]<this.min[2]}}class L extends O{constructor(){super(...arguments),this.bounds=u()}init(){l(this.min,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),l(this.max,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),b(this.bounds)}}export{x as Object3D};
5
+ import{isSome as t,isNone as e}from"../../../../core/maybe.js";import{c as s,m as i}from"../../../../chunks/mat4.js";import{c as r,b as o,I as a}from"../../../../chunks/mat4f64.js";import{h as n,v as h,i as m,c,s as l}from"../../../../chunks/vec3.js";import{a as d,f as g,c as _}from"../../../../chunks/vec3f64.js";import{c as u,l as b}from"../../../../chunks/sphere.js";import{maxScale as f}from"../../support/mathUtils.js";import{Object3DState as p}from"./basicInterfaces.js";import{ContentObject as v}from"./ContentObject.js";import{ContentObjectType as y}from"./ContentObjectType.js";import{GeometryRecord as j}from"./GeometryRecord.js";import{Object3DStateID as V}from"./Object3DStateID.js";import{assert as S}from"./Util.js";import{addObject3DStateID as A,removeObject3DStateID as T}from"../materials/renderers/utils.js";class x extends v{constructor(t={}){super(),this.type=y.Object,this._geometryRecords=new Array,this._geometries=new Array,this._objectTransformation=r(),this._bvObjectSpace=new L,this._bvWorldSpace=new L,this._bvDirty=!0,this._hasVolatileTransformation=!1,this._visible=!0,this.castShadow=null==t.castShadow||t.castShadow,this.metadata=t.metadata,this.metadata&&this.metadata.isElevationSource&&(this.metadata.lastValidElevationBB=new O);const{geometries:e,materials:s,transformations:i,origins:a}=t;if(Array.isArray(e)){S(s.length===e.length,"Object3D: materials don't match geometries"),S(i.length===e.length,"Object3D: transformations don't match geometries"),this._geometryRecords.length=e.length,this._geometries.length=e.length;for(let t=0;t<e.length;t++)this._geometries[t]=e[t],this._geometryRecords[t]=j.pool.acquire(e[t],s[t],o(i[t]),{highlights:null,occludees:null,visible:this._visible},a&&a[t])}}get geometryRecords(){return this._geometryRecords}get geometries(){return this._geometries}get transformation(){return this._objectTransformation}set transformation(t){s(this._objectTransformation,t),this._invalidateBoundingVolume(),this._emit("objectTransformation",this)}dispose(){this._geometryRecords.length=0,this._geometries.length=0}get parentLayer(){return this._parentLayer}set parentLayer(t){S(null==this._parentLayer||null==t,"Object3D can only be added to a single Layer"),this._parentLayer=t}addGeometry(e,s,i,r,o){i=i||a,this._geometries.push(e);const n=j.pool.acquire(e,s,i,{highlights:null,occludees:null,visible:this._visible},r,o);return this._geometryRecords.push(n),this._hasVolatileTransformation=this._hasVolatileTransformation||t(n.shaderTransformation),this._emit("objectGeometryAdded",{object:this,record:n}),this._invalidateBoundingVolume(),n}removeGeometry(e){const s=this._geometryRecords.splice(e,1)[0];return this._hasVolatileTransformation=t(s.shaderTransformation)?this._geometryRecords.some((e=>t(e.shaderTransformation))):this._hasVolatileTransformation,s.dispose(),this._geometries.splice(e,1),this._emit("objectGeometryRemoved",{object:this,record:s}),this._invalidateBoundingVolume(),s}removeAllGeometries(){for(;this.geometryRecords.length>0;)this.removeGeometry(0)}geometryVertexAttrsUpdated(t){this._emit("vertexAttrsUpdated",{object:this,record:t}),this._invalidateBoundingVolume()}get isVisible(){return this._visible}setVisible(t){if(this._visible!==t){this._visible=t;for(const t of this._geometryRecords)t.instanceParameters.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const t=new V(p.MaskOccludee);for(const e of this._geometryRecords)e.instanceParameters.occludees=A(e.instanceParameters.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const e of this._geometryRecords)e.instanceParameters.occludees=T(e.instanceParameters.occludees,t);this._emit("occlusionChanged",this)}highlight(){const t=new V(p.Highlight);for(const e of this._geometryRecords)e.instanceParameters.highlights=A(e.instanceParameters.highlights,t);return this._emit("highlightChanged",this),t}removeHighlight(t){for(const e of this._geometryRecords)e.instanceParameters.highlights=T(e.instanceParameters.highlights,t);this._emit("highlightChanged",this)}getCombinedStaticTransformation(t,e){return i(e,this.transformation,t.getStaticTransformation())}_getCombinedShaderTransformation(t){return i(r(),this.transformation,t.getShaderTransformation())}hasVolativeTransformation(){return this._hasVolatileTransformation}get boundingVolumeWorldSpace(){return this._validateBoundingVolume(),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._validateBoundingVolume(),this._bvObjectSpace}_validateBoundingVolume(){if(!this._bvDirty&&!this._hasVolatileTransformation)return;this._bvObjectSpace.init(),this._bvWorldSpace.init();for(let e=0;e<this._geometryRecords.length;++e){const s=this._geometries[e],i=this._geometryRecords[e],r=s.boundingInfo;t(r)&&(this._calculateTransformedBoundingVolume(r,this._bvObjectSpace,i.getShaderTransformation()),this._calculateTransformedBoundingVolume(r,this._bvWorldSpace,this._getCombinedShaderTransformation(i)))}n(this._bvObjectSpace.bounds,this._bvObjectSpace.min,this._bvObjectSpace.max,.5),n(this._bvWorldSpace.bounds,this._bvWorldSpace.min,this._bvWorldSpace.max,.5);const s=_(),i=_(),r=f(this.transformation);for(let t=0;t<this._geometryRecords.length;++t){const o=this._geometries[t].boundingInfo;if(e(o))continue;const a=this._geometryRecords[t].getShaderTransformation(),n=f(a);h(s,o.getCenter(),a);const c=m(s,this._bvObjectSpace.bounds),l=o.getBSRadius()*n;this._bvObjectSpace.bounds[3]=Math.max(this._bvObjectSpace.bounds[3],c+l),h(i,s,this.transformation);const d=m(i,this._bvWorldSpace.bounds),g=l*r;this._bvWorldSpace.bounds[3]=Math.max(this._bvWorldSpace.bounds[3],d+g)}this._bvDirty=!1}_calculateTransformedBoundingVolume(t,e,s){const i=t.getBBMin(),r=t.getBBMax(),o=d(i),a=d(r);h(o,o,s),h(a,a,s);for(let n=0;n<3;++n)e.min[n]=Math.min(e.min[n],o[n],a[n]),e.max[n]=Math.max(e.max[n],o[n],a[n]);for(let n=0;n<3;++n){c(o,i),c(a,r),o[n]=r[n],a[n]=i[n],h(o,o,s),h(a,a,s);for(let t=0;t<3;++t)e.min[t]=Math.min(e.min[t],o[t],a[t]),e.max[t]=Math.max(e.max[t],o[t],a[t])}}_invalidateBoundingVolume(){this._bvDirty=!0,t(this._parentLayer)&&this._parentLayer.notifyObjectBBChanged(this,this._bvWorldSpace.bounds)}_emit(e,s){t(this._parentLayer)&&this._parentLayer.events.emit(e,s)}get test(){const t=this;return{hasGeometry:e=>t._geometries.includes(e),getGeometryIndex:e=>t._geometries.indexOf(e)}}}class O{constructor(){this.min=g(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.max=g(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)}isEmpty(){return this.max[0]<this.min[0]&&this.max[1]<this.min[1]&&this.max[2]<this.min[2]}}class L extends O{constructor(){super(...arguments),this.bounds=u()}init(){l(this.min,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),l(this.max,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),b(this.bounds)}}export{x as Object3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Logger.js";import{f as r}from"../../../../chunks/vec4f64.js";import{BufferViewVec4u8 as t}from"../../../../geometry/support/buffer/BufferView.js";class o{constructor(){this.declaredClass="esri.views.3d.webgl-engine.lib.ObjectAndLayerIdRenderHelper",this.colorZero=new t(new ArrayBuffer(4)),this._uidToRenderColor=new Map,this._colorToUID=new Map,this._layerUidToGraphicsUidToObjectId=new Map,this._layerUidToId=new Map}setUidToObjectAndLayerId(e,r,t,o,i=null,d=null){if(!(e&&r&&t&&o))return;this._layerUidToId.set(o,t);let a=this._layerUidToGraphicsUidToObjectId.get(o);a||(a=new Map,this._layerUidToGraphicsUidToObjectId.set(o,a)),a.set(r,{objectId:e,attributeNodeId:i,attributeIndex:d})}getObjectAndLayerIdColor(e){const t=this.getObjectAndLayerIdColorArray(e);return r(t.get(0,1),t.get(0,2),t.get(0,3),255)}getObjectAndLayerIdColorArray(e){if(!e.layerUid||!e.graphicUid)return this.colorZero;let r=this._uidToRenderColor.get(e.layerUid);r||(r=new Map,this._uidToRenderColor.set(e.layerUid,r));let o=r.get(e.graphicUid);if(!o){for(;!o;){const e=Math.floor(16777214*Math.random())+1;this._colorToUID.has(e)||(o=e)}if(o>16777215)throw new Error("Object ID Overflow");r.set(e.graphicUid,o),this._colorToUID.set(o,e)}const i=new ArrayBuffer(4);new DataView(i).setUint32(0,o,!1);return new t(i)}getColorToObjectAndLayerIdMapping(){const r=new Map;for(const[t,o]of this._colorToUID.entries()){const i=this._layerUidToGraphicsUidToObjectId.get(o.layerUid);let d=null;i?(d=i.get(o.graphicUid),d||e.getLogger(this.declaredClass).warn("getColorMapping: no entry found for graphicsId "+o.graphicUid)):e.getLogger(this.declaredClass).warn("getColorMapping: no entry found for layerUid "+o.layerUid);const a=this._layerUidToId.get(o.layerUid);a||e.getLogger(this.declaredClass).warn("no layerId found for uid "+o.layerUid),d&&a&&r.set(t,d.attributeNodeId?{type:"object-and-layer-and-i3s-id",oid:d.objectId,lid:a,attrId:d.attributeNodeId,attrIdx:d.attributeIndex}:{type:"object-and-layer-id",oid:d.objectId,lid:a})}return r}}export{o as ObjectAndLayerIdRenderHelper};
5
+ import e from"../../../../core/Logger.js";import{f as r}from"../../../../chunks/vec4f64.js";import{BufferViewVec4u8 as t}from"../../../../geometry/support/buffer/BufferView.js";class o{constructor(){this.declaredClass="esri.views.3d.webgl-engine.lib.ObjectAndLayerIdRenderHelper",this.colorZero=new t(new ArrayBuffer(4)),this._uidToRenderColor=new Map,this._colorToUID=new Map,this._layerUidToGraphicsUidToObjectId=new Map,this._layerUidToId=new Map}setUidToObjectAndLayerId(e,r,t,o,d=null,i=null,a=null){if(!(e&&r&&t&&o))return;this._layerUidToId.set(o,t);let s=this._layerUidToGraphicsUidToObjectId.get(o);s||(s=new Map,this._layerUidToGraphicsUidToObjectId.set(o,s)),s.set(r,{objectId:e,attributeNodeId:d,attributeIndex:i,subLayerId:a})}getObjectAndLayerIdColor(e){const t=this.getObjectAndLayerIdColorArray(e);return r(t.get(0,1),t.get(0,2),t.get(0,3),255)}getObjectAndLayerIdColorArray(e){if(!e.layerUid||!e.graphicUid)return this.colorZero;let r=this._uidToRenderColor.get(e.layerUid);r||(r=new Map,this._uidToRenderColor.set(e.layerUid,r));let o=r.get(e.graphicUid);if(!o){for(;!o;){const e=Math.floor(16777214*Math.random())+1;this._colorToUID.has(e)||(o=e)}if(o>16777215)throw new Error("Object ID Overflow");r.set(e.graphicUid,o),this._colorToUID.set(o,e)}const d=new ArrayBuffer(4);new DataView(d).setUint32(0,o,!1);return new t(d)}getColorToObjectAndLayerIdMapping(){const r=new Map;for(const[t,o]of this._colorToUID.entries()){const d=this._layerUidToGraphicsUidToObjectId.get(o.layerUid);let i=null;d?(i=d.get(o.graphicUid),i||e.getLogger(this.declaredClass).warn("getColorMapping: no entry found for graphicsId "+o.graphicUid)):e.getLogger(this.declaredClass).warn("getColorMapping: no entry found for layerUid "+o.layerUid);const a=this._layerUidToId.get(o.layerUid);a||e.getLogger(this.declaredClass).warn("no layerId found for uid "+o.layerUid),i&&a&&r.set(t,i.attributeNodeId?{type:"object-and-layer-and-i3s-id",oid:i.objectId,lid:a,attrId:i.attributeNodeId,attrIdx:i.attributeIndex,subLayerId:i.subLayerId}:{type:"object-and-layer-id",oid:i.objectId,lid:a})}return r}}export{o as ObjectAndLayerIdRenderHelper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../../../../core/maybe.js";import{RenderTargetHelper as t}from"./RenderTargetHelper.js";import{TransparencyPassType as r}from"./TransparencyPassType.js";import{AlphaMode as i,CompositingFunction as o}from"../shaders/CompositingTechniqueConfiguration.js";import{ContextType as s}from"../../../webgl/context-util.js";import{TextureSamplingMode as a,SizedPixelFormat as h,PixelFormat as n,PixelType as l,ClearBufferBit as g}from"../../../webgl/enums.js";class T{constructor(e,r){this._rctx=e,this._compositingHelper=r,this._mainColorTarget=0,this._dimensions={width:4,height:4},this._background={type:"color",color:[0,0,0,1]};const i=e.type===s.WEBGL2;this._renderTargetHelper=new t(e);const o=this._renderTargetHelper;this._mainColorTargets=[o.registerColorTarget({name:"mainColorTarget0"}),o.registerColorTarget({name:"mainColorTarget1"})],this.frontFaceTarget=o.registerColorTarget({name:"frontFaceTarget"});const g=e=>o.registerColorTarget({name:e,dataType:l.FLOAT,internalFormat:i?h.RGBA32F:n.RGBA,samplingMode:a.NEAREST});this.colorFloatTarget=g("colorFloatTarget"),this.alphaFloatTarget=g("alphaFloatTarget"),this.mainDepth=o.registerDepthTarget({name:"mainDepth"}),this.linearDepth=o.registerColorTarget({name:"linearDepth",samplingMode:a.NEAREST}),this.terrainLinearDepth=o.registerColorTarget({name:"terrainLinearDepth"}),this.geometryLinearDepth=o.registerColorTarget({name:"geometryLinearDepth"}),this.normal=o.registerColorTarget({name:"normal"}),this.highlight=o.registerColorTarget({name:"highlight",internalFormat:i?h.RGBA4:n.RGBA,dataType:l.UNSIGNED_SHORT_4_4_4_4}),this.hudVisibility=o.registerColorTarget({name:"hudVisibility",internalFormat:i?h.RGBA4:n.RGBA,dataType:l.UNSIGNED_SHORT_4_4_4_4}),this.tmpColor=o.registerColorTarget({name:"tmpColor"}),this.tmpDepth=o.registerDepthTarget({name:"tmpDepth"}),this.hudColor=o.registerColorTarget({name:"hudColor"})}dispose(){this._renderTargetHelper.dispose()}get width(){return this._dimensions.width}get height(){return this._dimensions.height}set background(e){this._background=e}get background(){return this._background}get currentColorTarget(){return this._mainColorTargets[this._mainColorTarget]}get previousColorTarget(){return this._mainColorTargets[1-this._mainColorTarget]}get framebuffer(){return this.getFramebuffer(this.currentColorTarget,this.mainDepth)}getFramebuffer(e,t){return this._renderTargetHelper.getFramebuffer(this._dimensions,e,t)}get colorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.currentColorTarget)}get depthTexture(){return this._renderTargetHelper.getAllocatedDepthTexture(this.mainDepth)}get linearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.linearDepth)}get terrainLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.terrainLinearDepth)}get geometryLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.geometryLinearDepth)}get lastFrameColorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.previousColorTarget)}get normalTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.normal)}get highlightTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.highlight)}get hudVisibilityTexture(){return this._getColorTexture(this.hudVisibility)}get tmpColorTexture(){return this._getColorTexture(this.tmpColor)}get hudColorTexture(){return this._getColorTexture(this.hudColor)}get mainColorTexture(){return this._getColorTexture(this.currentColorTarget)}setupRenderTarget(e){e||(this._mainColorTarget=0,this.disposeTarget(this._mainColorTargets[1])),this._mainColorTarget=0===this._mainColorTarget&&e?1:0}initializeFrame(e){const t=this._rctx;this._dimensions.width=e.fullWidth,this._dimensions.height=e.fullHeight,this.bindTarget(this.currentColorTarget,this.mainDepth),t.setClearStencil(0);const r=this._background.color;t.setClearColor(r[0]*r[3],r[1]*r[3],r[2]*r[3],r[3]),t.clearSafe(g.COLOR_BUFFER_BIT|g.DEPTH_BUFFER_BIT|g.STENCIL_BUFFER_BIT)}composite(t){e(this.colorTexture)&&this._compositingHelper.composite(t,this.colorTexture,i.None)}renderTmpAndCompositeToMain(e,t,r,i=!1){this.renderToTargets(e,this.tmpColor,i?this.tmpDepth:this.mainDepth,p),this._compositingHelper.composite(t,this._getColorTexture(this.tmpColor),r)}renderHUDVisibility(e,t=!1){this.renderToTargets(e,this.hudVisibility,t?this.tmpDepth:this.mainDepth,m)}compositeTransparentTerrainOntoHUDVisibility(e){this.renderToTargets((()=>this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),i.None,1,o.TransparentToHUDVisibility)),this.hudVisibility,this.tmpDepth)}renderOITPass(e,t,i){let o,s;switch(t){case r.Color:o=this.colorFloatTarget,s=[0,0,0,0];break;case r.Alpha:o=this.alphaFloatTarget,s=[1,1,1,1];break;case r.FrontFace:o=this.frontFaceTarget,s=[0,0,0,0]}i?this.renderToTargets(e,o,this.tmpDepth,s,!0,!0):this.renderToTargets(e,o,this.mainDepth,s,!1)}compositeTransparentTerrainOntoMain(e){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),i.PremultipliedAlpha)}compositeOccludedOntoMain(e,t){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),i.PremultipliedAlpha,t)}compositeTransparentOntoOpaque(e,t){t?(this.bindTarget(this.hudColor,this.tmpDepth),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clearSafe(g.COLOR_BUFFER_BIT)):this.bindFramebuffer(),this._compositingHelper.compositeTransparent(e,this._getColorTexture(this.colorFloatTarget),this._getColorTexture(this.alphaFloatTarget),this._getColorTexture(this.frontFaceTarget))}bindFramebuffer(){this._rctx.bindFramebuffer(this.framebuffer)}renderDepthDetached(e){this.bindTarget(this.currentColorTarget),e(),this.bindTarget(this.currentColorTarget,this.mainDepth)}disposeTarget(e){this._renderTargetHelper.disposeTargetResource(e)}renderToFBO(e,t,r=!1,i=!1){const o=this._rctx;let s=0;if(t){const e=1e-13,r=Math.max(e,t[3]);o.setClearColor(t[0],t[1],t[2],r),s|=g.COLOR_BUFFER_BIT}r&&(s|=g.DEPTH_BUFFER_BIT),!1===i?i=0:(!0===i&&(i=255),s|=g.STENCIL_BUFFER_BIT),s&&o.clearSafe(s,i),e(),o.gl.flush(),this.bindTarget(this.currentColorTarget,this.mainDepth)}renderToTargets(e,t,r,i,o=!1,s=!1){const a=this.bindTarget(t,r);return this.renderToFBO(e,i,o,s),a}bindTarget(e,t){const r=this._renderTargetHelper.getFramebuffer(this._dimensions,e,t);return this._rctx.bindFramebuffer(r),r}_getColorTexture(e){return this._renderTargetHelper.getColorTexture(e,this._dimensions)}get gpuMemoryUsage(){let e=0;return this._renderTargetHelper&&(e+=this._renderTargetHelper.gpuMemoryUsage),e}}const p=[0,0,0,0],m=[0,1,0,1];export{T as OffscreenRendering};
5
+ import{isSome as e}from"../../../../core/maybe.js";import{RenderTargetHelper as t}from"./RenderTargetHelper.js";import{TransparencyPassType as r}from"./TransparencyPassType.js";import{AlphaMode as i}from"../shaders/CompositingTechniqueConfiguration.js";import{ContextType as o}from"../../../webgl/context-util.js";import{TextureSamplingMode as s,SizedPixelFormat as a,PixelFormat as h,PixelType as n,ClearBufferBit as l}from"../../../webgl/enums.js";class g{constructor(e,r){this._rctx=e,this._compositingHelper=r,this._mainColorTarget=0,this._dimensions={width:4,height:4},this._background={type:"color",color:[0,0,0,1]};const i=e.type===o.WEBGL2;this._renderTargetHelper=new t(e);const l=this._renderTargetHelper;this._mainColorTargets=[l.registerColorTarget({name:"mainColorTarget0"}),l.registerColorTarget({name:"mainColorTarget1"})],this.frontFaceTarget=l.registerColorTarget({name:"frontFaceTarget"});const g=e=>l.registerColorTarget({name:e,dataType:n.FLOAT,internalFormat:i?a.RGBA32F:h.RGBA,samplingMode:s.NEAREST});this.colorFloatTarget=g("colorFloatTarget"),this.alphaFloatTarget=g("alphaFloatTarget"),this.mainDepth=l.registerDepthTarget({name:"mainDepth"}),this.linearDepth=l.registerColorTarget({name:"linearDepth",samplingMode:s.NEAREST}),this.terrainLinearDepth=l.registerColorTarget({name:"terrainLinearDepth"}),this.geometryLinearDepth=l.registerColorTarget({name:"geometryLinearDepth"}),this.normal=l.registerColorTarget({name:"normal"}),this.highlight=l.registerColorTarget({name:"highlight",internalFormat:i?a.RGBA4:h.RGBA,dataType:n.UNSIGNED_SHORT_4_4_4_4}),this.hudVisibility=l.registerColorTarget({name:"hudVisibility",internalFormat:i?a.RGBA4:h.RGBA,dataType:n.UNSIGNED_SHORT_4_4_4_4}),this.tmpColor=l.registerColorTarget({name:"tmpColor"}),this.tmpDepth=l.registerDepthTarget({name:"tmpDepth"}),this.hudColor=l.registerColorTarget({name:"hudColor"})}dispose(){this._renderTargetHelper.dispose()}get width(){return this._dimensions.width}get height(){return this._dimensions.height}set background(e){this._background=e}get background(){return this._background}get currentColorTarget(){return this._mainColorTargets[this._mainColorTarget]}get previousColorTarget(){return this._mainColorTargets[1-this._mainColorTarget]}get framebuffer(){return this.getFramebuffer(this.currentColorTarget,this.mainDepth)}getFramebuffer(e,t){return this._renderTargetHelper.getFramebuffer(this._dimensions,e,t)}get colorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.currentColorTarget)}get depthTexture(){return this._renderTargetHelper.getAllocatedDepthTexture(this.mainDepth)}get linearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.linearDepth)}get terrainLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.terrainLinearDepth)}get geometryLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.geometryLinearDepth)}get lastFrameColorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.previousColorTarget)}get normalTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.normal)}get highlightTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.highlight)}get hudVisibilityTexture(){return this._getColorTexture(this.hudVisibility)}get tmpColorTexture(){return this._getColorTexture(this.tmpColor)}get hudColorTexture(){return this._getColorTexture(this.hudColor)}get mainColorTexture(){return this._getColorTexture(this.currentColorTarget)}setupRenderTarget(e){e||(this._mainColorTarget=0,this.disposeTarget(this._mainColorTargets[1])),this._mainColorTarget=0===this._mainColorTarget&&e?1:0}initializeFrame(e){const t=this._rctx;this._dimensions.width=e.fullWidth,this._dimensions.height=e.fullHeight,this.bindTarget(this.currentColorTarget,this.mainDepth),t.setClearStencil(0);const r=this._background.color;t.setClearColor(r[0]*r[3],r[1]*r[3],r[2]*r[3],r[3]),t.clearSafe(l.COLOR_BUFFER_BIT|l.DEPTH_BUFFER_BIT|l.STENCIL_BUFFER_BIT)}composite(t){e(this.colorTexture)&&this._compositingHelper.composite(t,this.colorTexture,i.None)}renderTmpAndCompositeToMain(e,t,r,i=!1){this.renderToTargets(e,this.tmpColor,i?this.tmpDepth:this.mainDepth,T),this._compositingHelper.composite(t,this._getColorTexture(this.tmpColor),r)}renderHUDVisibility(e,t=!1){this.renderToTargets(e,this.hudVisibility,t?this.tmpDepth:this.mainDepth,p)}compositeTransparentTerrainOntoHUDVisibility(e){this.renderToTargets((()=>this._compositingHelper.compositeHUD(e,this._getColorTexture(this.tmpColor))),this.hudVisibility,this.tmpDepth)}renderOITPass(e,t,i){let o,s;switch(t){case r.Color:o=this.colorFloatTarget,s=[0,0,0,0];break;case r.Alpha:o=this.alphaFloatTarget,s=[1,1,1,1];break;case r.FrontFace:o=this.frontFaceTarget,s=[0,0,0,0]}i?this.renderToTargets(e,o,this.tmpDepth,s,!0,!0):this.renderToTargets(e,o,this.mainDepth,s,!1)}compositeTransparentTerrainOntoMain(e){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),i.PremultipliedAlpha)}compositeOccludedOntoMain(e,t){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),i.PremultipliedAlpha,t)}compositeTransparentOntoOpaque(e,t){t?(this.bindTarget(this.hudColor,this.tmpDepth),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clearSafe(l.COLOR_BUFFER_BIT)):this.bindFramebuffer(),this._compositingHelper.compositeOIT(e,this._getColorTexture(this.colorFloatTarget),this._getColorTexture(this.alphaFloatTarget),this._getColorTexture(this.frontFaceTarget))}bindFramebuffer(){this._rctx.bindFramebuffer(this.framebuffer)}renderDepthDetached(e){this.bindTarget(this.currentColorTarget),e(),this.bindTarget(this.currentColorTarget,this.mainDepth)}disposeTarget(e){this._renderTargetHelper.disposeTargetResource(e)}renderToFBO(e,t,r=!1,i=!1){const o=this._rctx;let s=0;if(t){const e=1e-13,r=Math.max(e,t[3]);o.setClearColor(t[0],t[1],t[2],r),s|=l.COLOR_BUFFER_BIT}r&&(s|=l.DEPTH_BUFFER_BIT),!1===i?i=0:(!0===i&&(i=255),s|=l.STENCIL_BUFFER_BIT),s&&o.clearSafe(s,i),e(),o.gl.flush(),this.bindTarget(this.currentColorTarget,this.mainDepth)}renderToTargets(e,t,r,i,o=!1,s=!1){const a=this.bindTarget(t,r);return this.renderToFBO(e,i,o,s),a}bindTarget(e,t){const r=this._renderTargetHelper.getFramebuffer(this._dimensions,e,t);return this._rctx.bindFramebuffer(r),r}_getColorTexture(e){return this._renderTargetHelper.getColorTexture(e,this._dimensions)}get gpuMemoryUsage(){let e=0;return this._renderTargetHelper&&(e+=this._renderTargetHelper.gpuMemoryUsage),e}}const T=[0,0,0,0],p=[0,1,0,1];export{g as OffscreenRendering};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{unwrapOr as t,isNone as r,isSome as i}from"../../../../core/maybe.js";import{generateUID as s}from"../../../../core/uid.js";import{c as a}from"../../../../chunks/mat4.js";import{c as n,I as e}from"../../../../chunks/mat4f64.js";import{m as o}from"../../../../chunks/vec3.js";import{c as h}from"../../../../chunks/vec4f64.js";import{maxScale as m}from"../../support/mathUtils.js";import{Object3DState as c}from"./basicInterfaces.js";import{computeAttachmentOriginTriangles as d}from"./geometryDataUtils.js";import{InstanceParameters as f}from"./InstanceParameters.js";import{Object3DStateID as u}from"./Object3DStateID.js";import{VertexAttribute as g}from"./VertexAttribute.js";import{addObject3DStateID as l,removeObject3DStateID as p}from"../materials/renderers/utils.js";class T{constructor(r,i,a={}){this.data=r,this.material=i,this.boundingSphere=h(),this.instanceParameters=new f,this._transformation=n(),this._shaderTransformationDirty=!0,this.layerUid=t(a.layerUid,null),this.graphicUid=t(a.graphicUid,null),this.id=a.id?a.id:s(),this.boundingInfo=t(a.boundingInfo,null),this.calculateShaderTransformation=t(a.calculateShaderTransformation,null),this.castShadow=!!a.castShadow&&a.castShadow}get transformation(){return this._transformation}updateTransformation(t){t(this._transformation),this._shaderTransformationDirty=!0,this.computeBoundingSphere(this._transformation,this.boundingSphere)}shaderTransformationChanged(){this._shaderTransformationDirty=!0}computeBoundingSphere(t,i,s=m(t)){r(this.boundingInfo)||(o(i,this.boundingInfo.getCenter(),t),i[3]=this.boundingInfo.getBSRadius()*s)}get hasShaderTransformation(){return i(this.calculateShaderTransformation)}get primitiveType(){return this.data.primitiveType}getShaderTransformation(){return r(this.calculateShaderTransformation)?t(this.transformation,e):(this._shaderTransformationDirty&&(this._shaderTransformation||(this._shaderTransformation=n()),a(this._shaderTransformation,this.calculateShaderTransformation(t(this.transformation,e))),this._shaderTransformationDirty=!1),this._shaderTransformation)}computeAttachmentOrigin(t){if(this.material.computeAttachmentOrigin)return!!this.material.computeAttachmentOrigin(this,t)&&(i(this._transformation)&&o(t,t,this._transformation),!0);const r=this.indices.get(g.POSITION),s=this.vertexAttributes.get(g.POSITION);return!!d(s,r,t)&&(i(this._transformation)&&o(t,t,this._transformation),!0)}get indices(){return this.data.indices}get vertexAttributes(){return this.data.vertexAttributes}addHighlight(){const t=new u(c.Highlight),r=this.instanceParameters;return r.highlights=l(r.highlights,t),t}removeHighlight(t){const r=this.instanceParameters;r.highlights=p(r.highlights,t)}}class S extends T{}export{T as RenderGeometry,S as ValidatedRenderGeometry};
5
+ import{unwrapOr as t,isNone as r,isSome as i}from"../../../../core/maybe.js";import{generateUID as s}from"../../../../core/uid.js";import{c as a}from"../../../../chunks/mat4.js";import{c as n,I as e}from"../../../../chunks/mat4f64.js";import{v as o}from"../../../../chunks/vec3.js";import{c as h}from"../../../../chunks/vec4f64.js";import{maxScale as m}from"../../support/mathUtils.js";import{Object3DState as c}from"./basicInterfaces.js";import{computeAttachmentOriginTriangles as d}from"./geometryDataUtils.js";import{InstanceParameters as f}from"./InstanceParameters.js";import{Object3DStateID as u}from"./Object3DStateID.js";import{VertexAttribute as g}from"./VertexAttribute.js";import{addObject3DStateID as l,removeObject3DStateID as p}from"../materials/renderers/utils.js";class T{constructor(r,i,a={}){this.data=r,this.material=i,this.boundingSphere=h(),this.instanceParameters=new f,this._transformation=n(),this._shaderTransformationDirty=!0,this.layerUid=t(a.layerUid,null),this.graphicUid=t(a.graphicUid,null),this.id=a.id?a.id:s(),this.boundingInfo=t(a.boundingInfo,null),this.calculateShaderTransformation=t(a.calculateShaderTransformation,null),this.castShadow=!!a.castShadow&&a.castShadow}get transformation(){return this._transformation}updateTransformation(t){t(this._transformation),this._shaderTransformationDirty=!0,this.computeBoundingSphere(this._transformation,this.boundingSphere)}shaderTransformationChanged(){this._shaderTransformationDirty=!0}computeBoundingSphere(t,i,s=m(t)){r(this.boundingInfo)||(o(i,this.boundingInfo.getCenter(),t),i[3]=this.boundingInfo.getBSRadius()*s)}get hasShaderTransformation(){return i(this.calculateShaderTransformation)}get primitiveType(){return this.data.primitiveType}getShaderTransformation(){return r(this.calculateShaderTransformation)?t(this.transformation,e):(this._shaderTransformationDirty&&(this._shaderTransformation||(this._shaderTransformation=n()),a(this._shaderTransformation,this.calculateShaderTransformation(t(this.transformation,e))),this._shaderTransformationDirty=!1),this._shaderTransformation)}computeAttachmentOrigin(t){if(this.material.computeAttachmentOrigin)return!!this.material.computeAttachmentOrigin(this,t)&&(i(this._transformation)&&o(t,t,this._transformation),!0);const r=this.indices.get(g.POSITION),s=this.vertexAttributes.get(g.POSITION);return!!d(s,r,t)&&(i(this._transformation)&&o(t,t,this._transformation),!0)}get indices(){return this.data.indices}get vertexAttributes(){return this.data.vertexAttributes}addHighlight(){const t=new u(c.Highlight),r=this.instanceParameters;return r.highlights=l(r.highlights,t),t}removeHighlight(t){const r=this.instanceParameters;r.highlights=p(r.highlights,t)}}class S extends T{}export{T as RenderGeometry,S as ValidatedRenderGeometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{update as t}from"../../../../core/arrayUtils.js";import s from"../../../../core/Handles.js";import has from"../../../../core/has.js";import{someMap as i}from"../../../../core/MapUtils.js";import{clamp as n}from"../../../../core/mathUtils.js";import{destroyMaybe as a,disposeMaybe as h,isSome as o,isNone as d,applySome as _,unwrap as l}from"../../../../core/maybe.js";import{watch as c,syncAndInitial as m,initial as p,sync as g}from"../../../../core/reactiveUtils.js";import{Milliseconds as u}from"../../../../core/time.js";import{property as f}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as T}from"../../../../core/accessorSupport/decorators/subclass.js";import{h as R,a as b,m as P}from"../../../../chunks/mat4.js";import{I as E,c as A}from"../../../../chunks/mat4f64.js";import{getReferenceEllipsoid as S}from"../../../../geometry/projectionEllipsoid.js";import{a as w}from"../../../../chunks/boundedPlane.js";import{setWeatherFadingParallaxParameters as C,lerpLightingFadingParameters as O}from"../../environment/weatherUtils.js";import{MINIMUM_IDLE_ANIMATION_FPS_TIME as D,MAXIMUM_IDLE_ANIMATION_FPS_TIME as x,MAXIMUM_ANIMATION_LOAD as I}from"../../support/animationUtils.js";import y from"../../support/debugFlags.js";import{RenderPassManager as H}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as L}from"../core/shaderLibrary/ShaderOutput.js";import{HUDTransparentRenderStyle as M}from"../core/shaderLibrary/hud/HUDUniforms.js";import{Decorations as N,RenderRequestType as v,StencilBits as U}from"./basicInterfaces.js";import{BoundingInfo as F}from"./BoundingInfo.js";import{ZERO as j,union as V}from"./depthRange.js";import{depthRangeFromScene as G}from"./depthRangeUtils.js";import{createEmptyDepthTexture as q}from"./glUtil3D.js";import{Highlight as B}from"./Highlight.js";import{RenderOccludedFlag as W}from"./Material.js";import{OffscreenRendering as k}from"./OffscreenRendering.js";import{RenderContext as Q}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as Y}from"./rendererUtils.js";import{RenderPluginManager as X}from"./RenderPluginManager.js";import{RenderSlot as z}from"./RenderSlot.js";import{ShadowAccumulator as J}from"./ShadowAccumulator.js";import{ShadowHighlight as K}from"./ShadowHighlight.js";import{ShadowMap as Z,SnapshotSlot as $}from"./ShadowMap.js";import ee from"./SliceHelper.js";import{SmaaRenderPass as re}from"./SmaaRenderPass.js";import{SSAOHelper as te}from"./SSAOHelper.js";import{TransparencyPassType as se}from"./TransparencyPassType.js";import{EdgeView as ie}from"./edgeRendering/EdgeView.js";import{Transparency as ne}from"./edgeRendering/interfaces.js";import{MergedRenderer as ae}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as he}from"../shaders/CompositingTechniqueConfiguration.js";import{RendererPerformanceInfo as oe,PerformanceCategory as de}from"../statistics/RendererPerformanceInfo.js";import{ClearBufferBit as _e,PixelFormat as le,PixelType as ce}from"../../../webgl/enums.js";const me=.9;let pe=class extends r{constructor(e,r,t,i,n,a,h,o,d){super({}),this._materialRepository=e,this._shaderTechniqueRepository=t,this._rctx=i,this._compositingHelper=n,this._magnifierHelper=a,this._requestRender=h,this._stage=d,this._materialRenderers=new Map,this._needsTransparentPass=!1,this._hasHUDElements=!1,this._hasHighlights=!1,this._hasWater=!1,this._hasOverlayWater=!1,this._content=new Map,this._isRendering=!1,this._fallbackDepthStencilTexture=null,this._sliceHelper=new ee,this._antialiasing=!0,this._oitEnabled=!1,this._multipassTerrain=!0,this._transparentTerrain=!1,this._waterReflectionEnabled=!1,this._hasAnimations=!1,this._animationTimestep=D,this._handles=new s,this._renderHiddenTransparentEdges=()=>{},this._oitUsed=!1,this._smaaPass=new re(this._rctx,t),this._oitEnabled=this._hasOITSupport,this._requestRender(),this._offscreenRendering=new k(this._rctx,this._compositingHelper),this.performanceInfo=new oe(this._rctx),this._shadowMap=new Z(this._rctx,d.viewingMode),this._ssaoHelper=new te(t,this._rctx,(()=>this._requestRender())),this._highlight=new B(t,this._rctx),this._shadowHighlight=new K(this._rctx,d.viewingMode),this._shadowAccumulator=new J(this._rctx,t,d,(e=>{const r=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureCameraBindParameters(e.camera,e.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=r}),((e,r,t)=>{e.shadowMap.start(e.camera,r,t),this._renderShadowCascades(L.Shadow,e.shadowMap),e.camera.setGLViewport(this._rctx),this._ensureCameraBindParameters(e.camera,e.contentCamera)}),(()=>this._requestRender())),this._renderContext=new Q(this._rctx,this._offscreenRendering,this._shadowMap,this._ssaoHelper,this._sliceHelper),this._renderPlugins=new X({renderContext:this._renderContext,shaderTechniqueRepository:t,textureRep:r,materialRep:this._materialRepository,requestRender:this._requestRender,schedule:o}),this.renderPassManager=new H(this._rctx,this._shaderTechniqueRepository),this._renderPlugins.add(this.renderPassManager.slots(),this.renderPassManager),this._handles.add([c((()=>this._stage.state.camera),(()=>this._requestRender()),m),c((()=>y.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(ne.TRANSPARENT):()=>{},this._requestRender()}),p)])}get _bindParameters(){return this._renderContext.bindParameters}get hasWater(){return this._hasWater||this._hasOverlayWater}get hasWaterReflection(){return this.hasWater&&this._waterReflectionEnabled}normalizeCtorArgs(){return{}}dispose(){this._handles.destroy(),this._smaaPass.dispose(),this._materialRenderers.forEach((e=>e.dispose())),this._materialRenderers.clear(),this._edgeView=a(this._edgeView),this._offscreenRendering.dispose(),this._fallbackDepthStencilTexture=h(this._fallbackDepthStencilTexture),this._shadowMap.enabled=!1,this._shadowMap.dispose(),this._ssaoHelper.enabled=!1,this._ssaoHelper.dispose(),this._highlight.dispose(),this._shadowHighlight.dispose(),this._shadowAccumulator.dispose(),F.prune(),this._content.clear()}disposeOffscreenBuffers(){this._offscreenRendering.dispose(),this._shadowMap.dispose(),this._smaaPass.disable(),this._ssaoHelper.disposeOffscreenBuffers()}get updating(){return this._antialiasing&&this._smaaPass.updating||o(this._edgeView)&&this._edgeView.updating||this._shadowAccumulator.running||!this.isCameraFinal}ensureEdgeView(){return d(this._edgeView)&&(this._edgeView=new ie({rctx:this._rctx,renderSR:this._stage.renderSR,viewingMode:this._stage.viewingMode,techniqueRepository:this._shaderTechniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:e=>this._stage.resourceController.schedule(e)}),this._handles.add(c((()=>_(this._edgeView,(e=>e.updating))),(()=>this._requestRender()),g)),this._requestRender()),this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return R(this._bindParameters.ssr.reprojectionMatrix,E)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){return!!this._shadowMap?.enabled}setRenderParameters(e){const{_shadowMap:r,_ssaoHelper:t,_bindParameters:s}=this;if(void 0!==e.screenSpaceReflectionsEnabled&&s.ssr.enabled!==e.screenSpaceReflectionsEnabled&&(s.ssr.enabled=e.screenSpaceReflectionsEnabled,this._requestRender()),void 0!==e.shadowMap&&r.enabled!==e.shadowMap&&(r.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&r.maxCascades!==e.shadowMapMaxCascades&&(r.maxCascades=e.shadowMapMaxCascades,this._requestRender()),o(e.environment)){o(e.environment.weather)&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=e.weatherVisible,this._bindParameters.weatherParameter.lightingFogFading.isWeatherFading=e.isWeatherFading,this._bindParameters.weatherParameter.lightingFogFading.oldWeatherType=e.oldWeatherType,this._renderContext.bindParameters.weather=e.environment.weather,this._renderContext.bindParameters.weatherVisible=e.weatherVisible,this._renderContext.bindParameters.weatherParameter.lightingFogFading.isWeatherFading=e.isWeatherFading,this._renderContext.bindParameters.weatherParameter.lightingFogFading.oldWeatherType=e.oldWeatherType),void 0!==e.environment.lighting.ambientOcclusionEnabled&&t.enabled!==e.environment.lighting.ambientOcclusionEnabled&&(t.enabled=e.environment.lighting.ambientOcclusionEnabled,this._requestRender()),void 0!==e.environment.lighting.waterReflectionEnabled&&this._waterReflectionEnabled!==e.environment.lighting.waterReflectionEnabled&&(this._waterReflectionEnabled=e.environment.lighting.waterReflectionEnabled,this._requestRender());const r="virtual"!==e.environment.lighting.type;s.enableFillLights!==r&&(s.enableFillLights=r,this._requestRender())}e.background&&this._offscreenRendering.background!==e.background&&(this._offscreenRendering.background=e.background,this._requestRender()),void 0!==e.antialiasingEnabled&&this._antialiasing!==e.antialiasingEnabled&&(this._antialiasing=e.antialiasingEnabled,this._requestRender()),void 0!==e.highQualityTransparency&&this._multipassTerrain!==e.highQualityTransparency&&(this._multipassTerrain=e.highQualityTransparency,this._oitEnabled=e.highQualityTransparency&&this._hasOITSupport,this._requestRender()),void 0!==e.defaultHighlightOptions&&(this._highlight.setDefaultOptions(e.defaultHighlightOptions),this._shadowHighlight.setDefaultOptions(e.defaultHighlightOptions),this._requestRender()),void 0!==e.overlays&&this._bindParameters.overlays!==e.overlays&&(this._bindParameters.overlays=e.overlays,this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=l(e.slicePlane),this._requestRender()),void 0!==e.transparentTerrain&&this._transparentTerrain!==e.transparentTerrain&&(this._transparentTerrain=e.transparentTerrain,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlendWorking}modify(e){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:t,updates:s}=e;if(0===r.length&&0===t.length&&0===s.length)return;t.forAll((({id:e})=>this._content.delete(e))),r.forAll((e=>this._content.set(e.id,e)));const n=Y(e);let a=!1;n.forEach(((e,r)=>{let t=this._materialRenderers.get(r);if(!t){if(!(e.adds.length>0))return;t=new ae(this._rctx,this._materialRepository,r),this._materialRenderers.set(r,t)}t.modify(e),t.isEmpty&&(a=!0)})),a&&this._materialRenderers.forEach(((e,r)=>{e.isEmpty&&(this._materialRenderers.delete(r),e.dispose())})),this._hasHighlights=i(this._materialRenderers,(e=>e.hasHighlights)),this._bindParameters.hasOccludees=i(this._materialRenderers,(e=>e.hasOccludees)),this._hasWater=i(this._materialRenderers,(e=>e.hasWater)),this._needsTransparentPass=i(this._materialRenderers,(e=>e.requiresSlot(z.TRANSPARENT_MATERIAL,L.Color))),this._hasHUDElements=i(this._materialRenderers,(e=>e.requiresSlot(z.LINE_CALLOUTS_HUD_DEPTH,L.Color)||e.requiresSlot(z.HUD_MATERIAL,L.Color)||e.requiresSlot(z.LABEL_MATERIAL,L.Color))),this._requestRender()}updateAnimation(e){return this._hasAnimations=!1,this._materialRenderers.forEach((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations=this._renderPlugins.updateAnimation(e)||this._hasAnimations,this._hasAnimations}get animationTimestep(){return this._animationTimestep}updateLightSources(e,r,t,s){s&&this._bindParameters.weatherParameter.lightingFogFading.lightingOld.setFromLighting(this._bindParameters.lighting),this._bindParameters.lighting.noonFactor=r,this._bindParameters.lighting.globalFactor=t,this._bindParameters.lighting.set(e),s&&this._bindParameters.weatherParameter.lightingFogFading.lightingNew.setFromLighting(this._bindParameters.lighting)}render(e,r,t,s){this._isRendering=!0;const{camera:i,contentCamera:n}=t;this.performanceInfo.startFrame(),this._bindParameters.transparencyPassType=se.NONE;const a=this._offscreenRendering;a.setupRenderTarget(this.hasWaterReflection);const h=w(this._sliceHelper.plane);s===N.OFF&&(this._sliceHelper.plane=null),this._rctx.bindFramebuffer(e),i.setGLViewport(this._rctx),this._ensureCameraBindParameters(i,n),this._ensureWeatherParameters(),this._renderPlugins.prepareRender(),this.performanceInfo.advance(de.PREPARE);const _=this._computeDepthRange(i);this._renderShadowMap(e,i,this._bindParameters.lighting.lightingMainDirection,_),this.performanceInfo.advance(de.SHADOW_MAP),a.initializeFrame(i),this._ensureBindParameters(i,n),this._renderLinearDepth(),this.performanceInfo.advance(de.LINEAR_DEPTH),this._accumulateShadows(_,i,n),this.performanceInfo.advance(de.ACCUMULATED_SHADOWS),this._renderNormal(),this.performanceInfo.advance(de.NORMALS),this._renderObjectAndLayerIdColor(r),this.performanceInfo.advance(de.OBJECT_AND_LAYER_ID_COLOR),this._ensureBindParametersSSR(),this._ssaoHelper.computeSSAO(this._bindParameters,a.linearDepthTexture,a.normalTexture),this.performanceInfo.advance(de.SSAO),this._renderContext.output=L.Color,a.bindFramebuffer(),this._renderOpaqueGeometry(),this.performanceInfo.advance(de.OPAQUE);const l=this._multipassTerrain&&this._transparentTerrain;this._renderTerrainLinearDepth(l),this._setMultipassEnabled(l),this._setTerrainCulling(l),this._renderEdges(ne.OPAQUE),this.performanceInfo.advance(de.OPAQUE_EDGES),this._offscreenRendering.bindTarget(this._offscreenRendering.currentColorTarget,this._offscreenRendering.mainDepth),this._renderSlot(z.VOXEL),this.performanceInfo.advance(de.VOXEL),this._renderHiddenTransparentEdges();const c=this._needsTransparentPass||this._renderPlugins.needsTransparentPass;c&&(this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry()),this.performanceInfo.advance(de.TRANSPARENT),this._renderGeometryLinearDepth(l);const m=this._renderHUDVisibility();l||this._renderInternalSlot(z.LINE_CALLOUTS),this.performanceInfo.advance(de.HUD_VISIBILITY),this._renderObjectAndLayerIdColor(r),this.performanceInfo.advance(de.OBJECT_AND_LAYER_ID_COLOR),this._renderEdges(ne.TRANSPARENT,l),this.performanceInfo.advance(de.TRANSPARENT_EDGES),this._renderTransparentTerrain(),this._transparentTerrain&&m&&(l?this._renderLineCallouts(M.Occluded):a.compositeTransparentTerrainOntoHUDVisibility(this._bindParameters),this._renderHUD(M.Occluded,a.framebuffer),this.performanceInfo.advance(de.HUD_OCCLUDED)),this.performanceInfo.advance(de.TRANSPARENT_TERRAIN),this._setTerrainCulling(!1),this._transparentTerrain&&(a.compositeTransparentTerrainOntoMain(this._bindParameters),l&&(this._renderEdges(ne.OPAQUE),this.performanceInfo.advance(de.OPAQUE_EDGES),c&&(this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry()),this.performanceInfo.advance(de.TRANSPARENT),this._renderEdges(ne.TRANSPARENT),this.performanceInfo.advance(de.TRANSPARENT_EDGES))),l&&this._renderLineCallouts(M.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),a.renderToTargets((()=>{this._renderInternalSlot(z.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderSlot(z.POSTPROCESSING_ENVIRONMENT_TRANSPARENT),this._renderSlot(z.LASERLINES)}),a.currentColorTarget,a.mainDepth),this.performanceInfo.advance(de.ENVIRONMENT),this._renderPlugins.needsLaserlineWithContrastControl&&a.renderTmpAndCompositeToMain((()=>this._renderSlot(z.LASERLINES_CONTRAST_CONTROL)),this._bindParameters,he.PremultipliedAlpha),this.performanceInfo.advance(de.LASER_LINE),this._renderOccluded(),this.performanceInfo.advance(de.OCCLUDED);const p=s===N.ON&&this._magnifierHelper.enabled,g=p&&d(e)?this._offscreenRendering.getFramebuffer(this._offscreenRendering.tmpColor,this._offscreenRendering.tmpDepth):e;this._rctx.bindFramebuffer(g);const u=this._offscreenRendering.colorTexture;!this._renderAntiAliasing(u)&&o(u)&&this._compositingHelper.composite(this._bindParameters,u,he.None),this.performanceInfo.advance(de.ANTIALIASING),this._renderHUD(M.NotOccluded,g),this.performanceInfo.advance(de.HUD_NOT_OCCLUDED),this._renderHighlights(g,this._bindParameters),this.performanceInfo.advance(de.HIGHLIGHTS),p&&this._magnifierHelper.render(this._rctx,this._bindParameters),g!==e&&(this._rctx.bindFramebuffer(e),this._compositingHelper.composite(this._bindParameters,this._offscreenRendering.tmpColorTexture,he.None)),this._disposeOITBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=h,this._isRendering=!1,this.onPostRender&&this.onPostRender(),this.performanceInfo.finishFrame()}_renderObjectAndLayerIdColor(e){o(e)&&has("enable-feature:objectAndLayerId-rendering")&&(this._rctx.bindFramebuffer(e),this._offscreenRendering.renderToFBO((()=>this._renderGeometryAndTransparentTerrainPass(L.ObjectAndLayerIdColor)),[0,0,0,0],!0,!0),this._rctx.bindFramebuffer(e),this._offscreenRendering.renderToFBO((()=>{this._bindParameters.renderTransparentlyOccludedHUD=M.NotOccluded,this._renderInternalSlot(z.HUD_MATERIAL)}),null,!0,!0))}finish(e){if(this._hasAnimations||(this._animationTimestep=u(0)),e===v.BACKGROUND){let e=0;this.performanceInfo.gpuSamplingEnabled?e=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.getError();const r=this.performanceInfo.elapsedTime,t=Math.max(r,e),s=n(t/I,x,D);this._animationTimestep=u(this._animationTimestep*me+s*(1-me))}}readDepthPixels(e,r,t){const s=this._offscreenRendering.bindTarget(this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth);if(!this._needsLinearDepth){this._ensureBindParameters(e,e),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const r=_e.COLOR_BUFFER_BIT|_e.DEPTH_BUFFER_BIT|_e.STENCIL_BUFFER_BIT;this._rctx.clearSafe(r),this._renderGeometryAndTransparentTerrainPass(L.Depth)}s.readPixels(r[0],r[1],r[2],r[3],le.RGBA,ce.UNSIGNED_BYTE,t)}readHUDVisibility(e,r,t,s,i){this._offscreenRendering.bindTarget(this._offscreenRendering.hudVisibility).readPixels(e,r,t,s,le.RGBA,ce.UNSIGNED_BYTE,i)}readAccumulatedShadow(e,r){return this._shadowAccumulator.readAccumulatedShadow(e,r)}_setMultipassEnabled(e){this._bindParameters.multipassTerrain.enabled=this._bindParameters.multipassGeometry.enabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_renderSlot(e){this._bindParameters.slot=e,this._renderPlugins.render()}_renderEdges(e,r=!1){const t=this._edgeView;o(t)&&t.shouldRender()&&this._offscreenRendering.renderTmpAndCompositeToMain((()=>t.render(this._bindParameters,e)),this._bindParameters,he.Alpha,r)}_renderShadowMap(e,r,t,s){const i=this._shadowMap;i.enabled&&(i.start(r,t,s),this._shadowHighlight.updateParameters(r,t),this._needsShadowHighlight?(this._renderShadowCascades(L.ShadowHighlight,this._shadowMap,(e=>i.takeCascadeSnapshotTo(e,$.Highlight))),i.clear(),this._renderShadowCascades(L.ShadowExludeHighlight,this._shadowMap,(e=>{i.takeCascadeSnapshotTo(e,$.Default),this._renderGeometryAndTransparentTerrainPass(L.ShadowHighlight)}))):this._renderShadowCascades(L.Shadow),i.finish(e),r.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap,t=(e=>{})){for(const s of r.getCascades())s.camera.setGLViewport(this._rctx),this._ensureCameraBindParameters(s.camera,s.camera),this._renderGeometryAndTransparentTerrainPass(e),t(s)}get _needsLinearDepth(){return this._ssaoHelper.enabled||this._renderPlugins.needsLinearDepth||this._hasWater&&this._waterReflectionEnabled||this._needsShadowHighlight||this._needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?this._offscreenRendering.renderToTargets((()=>this._renderGeometryAndTransparentTerrainPass(L.Depth)),this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.linearDepth),this._bindParameters.linearDepthTexture=this._offscreenRendering.linearDepthTexture}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.output;this._renderContext.output=L.Depth,this._offscreenRendering.renderToTargets((()=>this._renderTransparentTerrain()),this._offscreenRendering.terrainLinearDepth,this._offscreenRendering.tmpDepth,[-1e10,-1e10,-1e10,1],!0,!0),this._renderContext.output=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.terrainLinearDepth);this._bindParameters.multipassTerrain.linearDepthTexture=this._offscreenRendering.terrainLinearDepthTexture}_renderGeometryLinearDepth(e){if(e){const e=this._renderContext.output;this._offscreenRendering.renderToTargets((()=>this._renderGeometryPass(L.Depth)),this._offscreenRendering.geometryLinearDepth,this._offscreenRendering.tmpDepth,[1,1,1,1],!0,!0),this._renderContext.output=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.geometryLinearDepth);this._bindParameters.multipassGeometry.linearDepthTexture=this._offscreenRendering.geometryLinearDepthTexture}get _needsNormal(){return this._ssaoHelper.enabled}_renderNormal(){this._needsNormal?this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(L.Normal)}),this._offscreenRendering.normal,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.normal)}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(e){if(!this._needsDepthRange)return j;const r=G(e,this._content,this._stage.layers);return V(r,this.renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderGeometryAndTransparentTerrainPass(e){this._renderContext.output=e,this._renderGeometryPass(e),this._renderTransparentTerrain()}_renderGeometryPass(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderOpaqueGeometry(){this._renderSlot(z.INTEGRATED_MESH),this._renderSlot(z.OPAQUE_TERRAIN),this._renderInternalSlot(z.OPAQUE_MATERIAL),this._renderSlot(z.OPAQUE_MATERIAL),this._renderSlot(z.POSTPROCESSING_ENVIRONMENT_OPAQUE)}_renderTransparentGeometry(){this._renderInternalSlot(z.TRANSPARENT_MATERIAL),this._renderSlot(z.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){this._renderSlot(z.TRANSPARENT_TERRAIN)}_renderHUDVisibility(){let e=!1;return this._renderContext.offscreenRenderingHelper&&this._renderContext.offscreenRenderingHelper.renderHUDVisibility((()=>{this._bindParameters.hudVisibilityTexture=this._renderContext.offscreenRenderingHelper.hudVisibilityTexture,e=this._renderInternalSlot(z.OCCLUSION_PIXELS)}),this._multipassTerrain&&this._transparentTerrain),e}_renderLineCallouts(e){this._bindParameters.renderTransparentlyOccludedHUD=e,e===M.Occluded?this._offscreenRendering.renderToTargets((()=>this._renderInternalSlot(z.LINE_CALLOUTS)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderInternalSlot(z.LINE_CALLOUTS)}_renderHUD(e,r){this._hasHUDElements&&(this._oitEnabled?(this._renderOrderIndependentTransparency((()=>this._renderHUDElements(e)),!0),this._rctx.bindFramebuffer(r),this._compositingHelper.composite(this._bindParameters,this._offscreenRendering.hudColorTexture,he.PremultipliedAlpha)):e===M.Occluded?this._offscreenRendering.renderToTargets((()=>this._renderHUDElements(M.Occluded)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderHUDElements(e))}_renderHUDElements(e){this._bindParameters.renderTransparentlyOccludedHUD=e,this._renderInternalSlot(z.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(z.HUD_MATERIAL),this._renderInternalSlot(z.LABEL_MATERIAL)}get _needsHighlight(){return this._hasHighlights||this._renderPlugins.needsHighlight}get _needsShadowHighlight(){return this._shadowMap.enabled&&this._shadowHighlight.isVisible&&this._needsHighlight}_renderHighlights(e,r){if(!this._needsHighlight)return void this._offscreenRendering.disposeTarget(this._offscreenRendering.highlight);const t=this._highlight,s=this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(L.Highlight),this._rctx.clearSafe(_e.DEPTH_BUFFER_BIT),this._renderHUDElements(M.Both)}),this._offscreenRendering.highlight,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0);this._bindParameters.highlightColorTexture=s.colorTexture,this._needsShadowHighlight&&this._shadowHighlight.render(r,e),t.render(this._bindParameters,s,e)}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_accumulateShadows(e,r,t){this._needsShadowCast&&this._shadowAccumulator.renderAccumulation(this._offscreenRendering.linearDepthTexture,e,r,t)}_renderOrderIndependentTransparency(e,r){const t=t=>{this._bindParameters.transparencyPassType=t,this._offscreenRendering.renderOITPass((()=>e()),t,r)},s=this._renderContext.output;this._renderContext.output=L.Alpha,t(se.Alpha),this._renderContext.output=L.Color,t(se.Color),t(se.FrontFace),this._offscreenRendering.compositeTransparentOntoOpaque(this._bindParameters,r),this._bindParameters.transparencyPassType=se.NONE,this._renderContext.output=s,this._oitUsed=!0}_disposeOITBuffers(){this._oitUsed||(this._offscreenRendering.disposeTarget(this._offscreenRendering.alphaFloatTarget),this._offscreenRendering.disposeTarget(this._offscreenRendering.colorFloatTarget),this._offscreenRendering.disposeTarget(this._offscreenRendering.frontFaceTarget)),this._oitUsed=!1}_renderOccluded(){let e=0;this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&t.renderOccluded===W.OccludeAndTransparentStencil&&(e|=t.renderOccluded,fe.push(t))}));const r=this._offscreenRendering,t=(t,s,i,n,a)=>{0!=(e&s)&&(r.renderToTargets(i,r.tmpColor,r.mainDepth,[0,0,0,0],n,a),r.compositeOccludedOntoMain(this._bindParameters,t))};0!==fe.length&&(this._renderInternalSlot(z.OCCLUDER_MATERIAL,fe),t(.5,W.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(z.TRANSPARENT_OCCLUDER_MATERIAL,fe)),!1,!1),fe.length=0),this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&(t.renderOccluded===W.OccludeAndTransparent||t.renderOccluded===W.Transparent||t.renderOccluded===W.Opaque)&&(e|=t.renderOccluded,ue.push(t))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const i=e=>{this._renderContext.renderOccludedMask=e,s>W.Occlude&&this._renderSlot(z.OCCLUDED_TERRAIN),this._renderInternalSlot(z.OPAQUE_MATERIAL,ue),this._renderInternalSlot(z.TRANSPARENT_MATERIAL,ue),this._renderInternalSlot(z.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,ue),this._renderContext.resetRenderOccludedMask()};this._renderContext.output=L.Color,t(.5,W.OccludeAndTransparent,(()=>i(W.OccludeAndTransparent)),!0,U.OutlineVisualElementMask),t(.5,W.Transparent,(()=>i(W.Transparent)),!0,U.OutlineVisualElementMask),t(1,W.Opaque,(()=>i(W.Opaque)),!0,U.OutlineVisualElementMask),ue.length=0}_renderAntiAliasing(e){if(this._antialiasing){if(this._smaaPass.enable((()=>this._requestRender()))&&o(e))return this._smaaPass.render(e),!0}else this._smaaPass.disable();return!1}_ensureCameraBindParameters(e,r){this._bindParameters.camera=e,this._bindParameters.contentCamera=r}_ensureBindParameters(e,r){this._ensureCameraBindParameters(e,r);const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.hudVisibilityTexture=t.hudVisibilityTexture,this._bindParameters.mainColorTexture=t.mainColorTexture,this._bindParameters.highlightDepthTexture=t.depthTexture??this._getFallbackDepthTexture()}_ensureBindParametersSSR(){this.hasWaterReflection?(this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=E:(b(Re,this._bindParameters.camera.viewMatrix),b(Te,this._bindParameters.camera.projectionMatrix),P(be,Re,Te),P(be,this._renderContext.lastFrameCamera.viewMatrix,be),P(be,this._renderContext.lastFrameCamera.projectionMatrix,be),this._reprojectionMatrix=be),this._bindParameters.ssr.lastFrameColorTexture=this._offscreenRendering.lastFrameColorTexture):this._bindParameters.ssr.lastFrameColorTexture=null,this._bindParameters.ssr.enabled=this.hasWaterReflection}_ensureWeatherParameters(){C(this._bindParameters.weatherParameter,this._bindParameters.camera.eye,o(this._hasAnimations),S(null).radius),O(this._bindParameters)}_renderInternalSlot(e,r){let t=!1;return this._bindParameters.slot=e,o(r)?r.forEach((e=>{if(!e.shouldRender(this._renderContext))return;const r=this._materialRenderers.get(e);o(r)&&(t=r.render(this._renderContext.output,this._bindParameters)||t)})):this._materialRenderers.forEach(((e,r)=>{r.shouldRender(this._renderContext)&&e.render(this._renderContext.output,this._bindParameters)&&(t=!0)})),t}_getFallbackDepthTexture(){return this._fallbackDepthStencilTexture||(this._fallbackDepthStencilTexture=q(this._rctx)),this._fallbackDepthStencilTexture}get gpuMemoryUsage(){return{offscreen:this._offscreenRendering?.gpuMemoryUsage??0,highlights:(this._highlight?.gpuMemoryUsage??0)+(this._shadowHighlight?.gpuMemoryUsage??0),shadows:this._shadowMap?.gpuMemoryUsage??0,ssao:this._ssaoHelper?.gpuMemoryUsage??0}}get test(){const e=this;return{offscreen:this._offscreenRendering,shadowMap:this._shadowMap,ssao:this._ssaoHelper,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,getFramebufferTexture:r=>{switch(r){case ge.Color:return e._offscreenRendering.colorTexture;case ge.LinearDepth:return e._offscreenRendering.linearDepthTexture;case ge.Normals:return e._offscreenRendering.normalTexture;case ge.ShadowMap:return e._shadowMap.depthTexture;case ge.HudVisibility:return e._offscreenRendering.hudVisibilityTexture;case ge.Highlight:return e._offscreenRendering.highlightTexture}}}}};var ge;e([f()],pe.prototype,"_shadowAccumulator",void 0),e([f()],pe.prototype,"_smaaPass",void 0),e([f()],pe.prototype,"_antialiasing",void 0),e([f()],pe.prototype,"_edgeView",void 0),e([f()],pe.prototype,"updating",null),e([f()],pe.prototype,"isCameraFinal",null),pe=e([T("esri.views.3d.webgl-engine.lib.Renderer")],pe),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.Normals=2]="Normals",e[e.ShadowMap=3]="ShadowMap",e[e.HudVisibility=4]="HudVisibility",e[e.Highlight=5]="Highlight"}(ge||(ge={}));const ue=[],fe=[],Te=A(),Re=A(),be=A();export{ge as FramebufferId,pe as Renderer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{update as t}from"../../../../core/arrayUtils.js";import s from"../../../../core/Handles.js";import has from"../../../../core/has.js";import{someMap as i}from"../../../../core/MapUtils.js";import{clamp as n}from"../../../../core/mathUtils.js";import{destroyMaybe as a,disposeMaybe as h,isSome as o,isNone as d,applySome as _,unwrap as l}from"../../../../core/maybe.js";import{watch as c,syncAndInitial as p,initial as m,sync as g}from"../../../../core/reactiveUtils.js";import{Milliseconds as u}from"../../../../core/time.js";import{property as f}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as T}from"../../../../core/accessorSupport/decorators/subclass.js";import{h as R,a as b,m as P}from"../../../../chunks/mat4.js";import{I as E,c as A}from"../../../../chunks/mat4f64.js";import{a as S}from"../../../../chunks/boundedPlane.js";import{updateWeatherFadingParameters as C,updateLightFading as w}from"../../environment/weatherUtils.js";import{MINIMUM_IDLE_ANIMATION_FPS_TIME as O,MAXIMUM_IDLE_ANIMATION_FPS_TIME as D,MAXIMUM_ANIMATION_LOAD as I}from"../../support/animationUtils.js";import x from"../../support/debugFlags.js";import{RenderPassManager as y}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as H}from"../core/shaderLibrary/ShaderOutput.js";import{HUDTransparentRenderStyle as L}from"../core/shaderLibrary/hud/HUDUniforms.js";import{Decorations as M,RenderRequestType as N,StencilBits as v}from"./basicInterfaces.js";import{BoundingInfo as U}from"./BoundingInfo.js";import{ZERO as j,union as F}from"./depthRange.js";import{depthRangeFromScene as G}from"./depthRangeUtils.js";import{createEmptyDepthTexture as V}from"./glUtil3D.js";import{Highlight as q}from"./Highlight.js";import{RenderOccludedFlag as B}from"./Material.js";import{OffscreenRendering as k}from"./OffscreenRendering.js";import{RenderContext as W}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as Q}from"./rendererUtils.js";import{RenderPluginManager as Y}from"./RenderPluginManager.js";import{RenderSlot as X}from"./RenderSlot.js";import{ShadowAccumulator as z}from"./ShadowAccumulator.js";import{ShadowHighlight as J}from"./ShadowHighlight.js";import{ShadowMap as K,SnapshotSlot as Z}from"./ShadowMap.js";import $ from"./SliceHelper.js";import{SmaaRenderPass as ee}from"./SmaaRenderPass.js";import{SSAOHelper as re}from"./SSAOHelper.js";import{TransparencyPassType as te}from"./TransparencyPassType.js";import{Update as se}from"./Update.js";import{EdgeView as ie}from"./edgeRendering/EdgeView.js";import{Transparency as ne}from"./edgeRendering/interfaces.js";import{MergedRenderer as ae}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as he}from"../shaders/CompositingTechniqueConfiguration.js";import{RendererPerformanceInfo as oe,PerformanceCategory as de}from"../statistics/RendererPerformanceInfo.js";import{RenderState as _e}from"../../../support/RenderState.js";import{ClearBufferBit as le,PixelFormat as ce,PixelType as pe}from"../../../webgl/enums.js";const me=.9;let ge=class extends r{constructor(e,r,t,i,n,a,h,o,d){super({}),this._materialRepository=e,this._shaderTechniqueRepository=t,this._rctx=i,this._compositingHelper=n,this._magnifierHelper=a,this._requestRender=h,this._stage=d,this._materialRenderers=new Map,this._needsTransparentPass=!1,this._hasHUDElements=!1,this._hasHighlights=!1,this._hasWater=!1,this._hasOverlayWater=!1,this._content=new Map,this._isRendering=!1,this._fallbackDepthStencilTexture=null,this._sliceHelper=new $,this._antialiasing=!0,this._oitEnabled=!1,this._multipassTerrain=!0,this._transparentTerrain=!1,this._waterReflectionEnabled=!1,this._hasAnimations=!1,this._animationTimestep=O,this._handles=new s,this._renderHiddenTransparentEdges=()=>{},this._oitUsed=!1,this._smaaPass=new ee(this._rctx,t),this._oitEnabled=this._hasOITSupport,this._requestRender(),this._offscreenRendering=new k(this._rctx,this._compositingHelper),this.performanceInfo=new oe(this._rctx),this._shadowMap=new K(this._rctx,d.viewingMode),this._ssaoHelper=new re(t,this._rctx,(()=>this._requestRender())),this._highlight=new q(t,this._rctx),this._shadowHighlight=new J(this._rctx,d.viewingMode),this._shadowAccumulator=new z(this._rctx,t,d,(e=>{const r=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureCameraBindParameters(e.camera,e.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=r}),((e,r,t)=>{e.shadowMap.start(e.camera,r,t),this._renderShadowCascades(H.Shadow,e.shadowMap),e.camera.setGLViewport(this._rctx),this._ensureCameraBindParameters(e.camera,e.contentCamera)}),(()=>this._requestRender())),this._renderContext=new W(this._rctx,this._offscreenRendering,this._shadowMap,this._ssaoHelper,this._sliceHelper),this._renderPlugins=new Y({renderContext:this._renderContext,shaderTechniqueRepository:t,textureRep:r,materialRep:this._materialRepository,requestRender:this._requestRender,schedule:o}),this.renderPassManager=new y(this._rctx,this._shaderTechniqueRepository),this._renderPlugins.add(this.renderPassManager.slots(),this.renderPassManager),this._handles.add([c((()=>this._stage.state.camera),(()=>this._requestRender()),p),c((()=>x.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(ne.TRANSPARENT):()=>{},this._requestRender()}),m)])}get _bindParameters(){return this._renderContext.bindParameters}get hasWater(){return this._hasWater||this._hasOverlayWater}get hasWaterReflection(){return this.hasWater&&this._waterReflectionEnabled}normalizeCtorArgs(){return{}}dispose(){this._handles.destroy(),this._smaaPass.dispose(),this._materialRenderers.forEach((e=>e.dispose())),this._materialRenderers.clear(),this._edgeView=a(this._edgeView),this._offscreenRendering.dispose(),this._fallbackDepthStencilTexture=h(this._fallbackDepthStencilTexture),this._shadowMap.enabled=!1,this._shadowMap.dispose(),this._ssaoHelper.enabled=!1,this._ssaoHelper.dispose(),this._highlight.dispose(),this._shadowHighlight.dispose(),this._shadowAccumulator.dispose(),U.prune(),this._content.clear()}disposeOffscreenBuffers(){this._offscreenRendering.dispose(),this._shadowMap.dispose(),this._smaaPass.disable(),this._ssaoHelper.disposeOffscreenBuffers()}get updating(){return this._antialiasing&&this._smaaPass.updating||o(this._edgeView)&&this._edgeView.updating||this._shadowAccumulator.running||!this.isCameraFinal}ensureEdgeView(){return d(this._edgeView)&&(this._edgeView=new ie({rctx:this._rctx,renderSR:this._stage.renderSR,viewingMode:this._stage.viewingMode,techniqueRepository:this._shaderTechniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:e=>this._stage.resourceController.schedule(e)}),this._handles.add(c((()=>_(this._edgeView,(e=>e.updating))),(()=>this._requestRender()),g)),this._requestRender()),this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return R(this._bindParameters.ssr.reprojectionMatrix,E)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){return!!this._shadowMap?.enabled}setRenderParameters(e){const{_shadowMap:r,_ssaoHelper:t,_bindParameters:s}=this;if(void 0!==e.screenSpaceReflectionsEnabled&&s.ssr.enabled!==e.screenSpaceReflectionsEnabled&&(s.ssr.enabled=e.screenSpaceReflectionsEnabled,this._requestRender()),void 0!==e.shadowMap&&r.enabled!==e.shadowMap&&(r.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&r.maxCascades!==e.shadowMapMaxCascades&&(r.maxCascades=e.shadowMapMaxCascades,this._requestRender()),o(e.environment)){o(e.environment.weather)&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=e.weatherVisible),void 0!==e.environment.lighting.ambientOcclusionEnabled&&t.enabled!==e.environment.lighting.ambientOcclusionEnabled&&(t.enabled=e.environment.lighting.ambientOcclusionEnabled,this._requestRender()),void 0!==e.environment.lighting.waterReflectionEnabled&&this._waterReflectionEnabled!==e.environment.lighting.waterReflectionEnabled&&(this._waterReflectionEnabled=e.environment.lighting.waterReflectionEnabled,this._requestRender());const r="virtual"!==e.environment.lighting.type;s.enableFillLights!==r&&(s.enableFillLights=r,this._requestRender())}e.background&&this._offscreenRendering.background!==e.background&&(this._offscreenRendering.background=e.background,this._requestRender()),void 0!==e.antialiasingEnabled&&this._antialiasing!==e.antialiasingEnabled&&(this._antialiasing=e.antialiasingEnabled,this._requestRender()),void 0!==e.highQualityTransparency&&this._multipassTerrain!==e.highQualityTransparency&&(this._multipassTerrain=e.highQualityTransparency,this._oitEnabled=e.highQualityTransparency&&this._hasOITSupport,this._requestRender()),void 0!==e.defaultHighlightOptions&&(this._highlight.setDefaultOptions(e.defaultHighlightOptions),this._shadowHighlight.setDefaultOptions(e.defaultHighlightOptions),this._requestRender()),void 0!==e.overlays&&this._bindParameters.overlays!==e.overlays&&(this._bindParameters.overlays=e.overlays,this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=l(e.slicePlane),this._requestRender()),void 0!==e.transparentTerrain&&this._transparentTerrain!==e.transparentTerrain&&(this._transparentTerrain=e.transparentTerrain,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlendWorking}modify(e){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:t,updates:s}=e;if(0===r.length&&0===t.length&&0===s.length)return;t.forAll((({id:e})=>this._content.delete(e))),r.forAll((e=>this._content.set(e.id,e)));const n=Q(e);let a=!1;n.forEach(((e,r)=>{let t=this._materialRenderers.get(r);if(!t){if(!(e.adds.length>0))return;t=new ae(this._rctx,this._materialRepository,r),this._materialRenderers.set(r,t)}t.modify(e),t.isEmpty&&(a=!0)})),a&&this._materialRenderers.forEach(((e,r)=>{e.isEmpty&&(this._materialRenderers.delete(r),e.dispose())})),this._hasHighlights=i(this._materialRenderers,(e=>e.hasHighlights)),this._bindParameters.hasOccludees=i(this._materialRenderers,(e=>e.hasOccludees)),this._hasWater=i(this._materialRenderers,(e=>e.hasWater)),this._needsTransparentPass=i(this._materialRenderers,(e=>e.requiresSlot(X.TRANSPARENT_MATERIAL,H.Color))),this._hasHUDElements=i(this._materialRenderers,(e=>e.requiresSlot(X.LINE_CALLOUTS_HUD_DEPTH,H.Color)||e.requiresSlot(X.HUD_MATERIAL,H.Color)||e.requiresSlot(X.LABEL_MATERIAL,H.Color))),this._requestRender()}updateAnimation(e){return this._hasAnimations=!1,this._materialRenderers.forEach((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations=this._renderPlugins.updateAnimation(e)||this._hasAnimations,this._hasAnimations}get animationTimestep(){return this._animationTimestep}updateLightSources(e,r,t,s){s===se.Faded?(this._bindParameters.oldLighting.copyFrom(this._bindParameters.lighting),this._bindParameters.fadeLighting(0)):this._bindParameters.fadeLighting(1),this._bindParameters.newLighting.noonFactor=r,this._bindParameters.newLighting.globalFactor=t,this._bindParameters.newLighting.set(e)}render(e,r,t,s,i){this._isRendering=!0;const{camera:n,contentCamera:a}=t;this.performanceInfo.startFrame(),this._bindParameters.transparencyPassType=te.NONE;const h=this._offscreenRendering;h.setupRenderTarget(this.hasWaterReflection);const _=S(this._sliceHelper.plane);s===M.OFF&&(this._sliceHelper.plane=null),this._rctx.bindFramebuffer(e),n.setGLViewport(this._rctx),this._ensureCameraBindParameters(n,a),this._ensureFadingBindParameters(t,i),this._renderPlugins.prepareRender(),this.performanceInfo.advance(de.PREPARE);const l=this._computeDepthRange(n);this._renderShadowMap(e,n,this._bindParameters.lighting.mainLight.direction,l),this.performanceInfo.advance(de.SHADOW_MAP),h.initializeFrame(n),this._ensureBindParameters(n,a),this._renderLinearDepth(),this.performanceInfo.advance(de.LINEAR_DEPTH),this._accumulateShadows(l,n,a),this.performanceInfo.advance(de.ACCUMULATED_SHADOWS),this._renderNormal(),this.performanceInfo.advance(de.NORMALS),this._renderObjectAndLayerIdColor(r),this.performanceInfo.advance(de.OBJECT_AND_LAYER_ID_COLOR),this._ensureBindParametersSSR(),this._ssaoHelper.computeSSAO(this._bindParameters,h.linearDepthTexture,h.normalTexture),this.performanceInfo.advance(de.SSAO),this._renderContext.output=H.Color,h.bindFramebuffer(),this._renderOpaqueGeometry(),this.performanceInfo.advance(de.OPAQUE);const c=this._multipassTerrain&&this._transparentTerrain;this._renderTerrainLinearDepth(c),this._setMultipassEnabled(c),this._setTerrainCulling(c),this._renderEdges(ne.OPAQUE),this.performanceInfo.advance(de.OPAQUE_EDGES),this._offscreenRendering.bindTarget(this._offscreenRendering.currentColorTarget,this._offscreenRendering.mainDepth),this._renderSlot(X.VOXEL),this.performanceInfo.advance(de.VOXEL),this._renderHiddenTransparentEdges();const p=this._needsTransparentPass||this._renderPlugins.needsTransparentPass;p&&(this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry()),this.performanceInfo.advance(de.TRANSPARENT),this._renderGeometryLinearDepth(c);const m=this._renderHUDVisibility();c||this._renderInternalSlot(X.LINE_CALLOUTS),this.performanceInfo.advance(de.HUD_VISIBILITY),this._renderObjectAndLayerIdColor(r),this.performanceInfo.advance(de.OBJECT_AND_LAYER_ID_COLOR),this._renderEdges(ne.TRANSPARENT,c),this.performanceInfo.advance(de.TRANSPARENT_EDGES),this._renderTransparentTerrain(),this._transparentTerrain&&m&&(c?this._renderLineCallouts(L.Occluded):h.compositeTransparentTerrainOntoHUDVisibility(this._bindParameters),this._renderHUD(L.Occluded,h.framebuffer),this.performanceInfo.advance(de.HUD_OCCLUDED)),this.performanceInfo.advance(de.TRANSPARENT_TERRAIN),this._setTerrainCulling(!1),this._transparentTerrain&&(h.compositeTransparentTerrainOntoMain(this._bindParameters),c&&(this._renderEdges(ne.OPAQUE),this.performanceInfo.advance(de.OPAQUE_EDGES),p&&(this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry()),this.performanceInfo.advance(de.TRANSPARENT),this._renderEdges(ne.TRANSPARENT),this.performanceInfo.advance(de.TRANSPARENT_EDGES))),c&&this._renderLineCallouts(L.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),h.renderToTargets((()=>{this._renderInternalSlot(X.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderSlot(X.POSTPROCESSING_ENVIRONMENT_TRANSPARENT),this._renderSlot(X.LASERLINES)}),h.currentColorTarget,h.mainDepth),this.performanceInfo.advance(de.ENVIRONMENT),this._renderPlugins.needsLaserlineWithContrastControl&&h.renderTmpAndCompositeToMain((()=>this._renderSlot(X.LASERLINES_CONTRAST_CONTROL)),this._bindParameters,he.PremultipliedAlpha),this.performanceInfo.advance(de.LASER_LINE),this._renderOccluded(),this.performanceInfo.advance(de.OCCLUDED);const g=s===M.ON&&this._magnifierHelper.enabled,u=g&&d(e)?this._offscreenRendering.getFramebuffer(this._offscreenRendering.tmpColor,this._offscreenRendering.tmpDepth):e;this._rctx.bindFramebuffer(u);const f=this._offscreenRendering.colorTexture;!this._renderAntiAliasing(f)&&o(f)&&this._compositingHelper.composite(this._bindParameters,f,he.None),this.performanceInfo.advance(de.ANTIALIASING),this._renderHUD(L.NotOccluded,u),this.performanceInfo.advance(de.HUD_NOT_OCCLUDED),this._renderHighlights(u,this._bindParameters),this.performanceInfo.advance(de.HIGHLIGHTS),g&&this._magnifierHelper.render(this._rctx,this._bindParameters),u!==e&&(this._rctx.bindFramebuffer(e),this._compositingHelper.composite(this._bindParameters,this._offscreenRendering.tmpColorTexture,he.None)),this._disposeOITBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=_,this._isRendering=!1,this.onPostRender&&this.onPostRender(),this.performanceInfo.finishFrame()}_renderObjectAndLayerIdColor(e){o(e)&&has("enable-feature:objectAndLayerId-rendering")&&(this._rctx.bindFramebuffer(e),this._offscreenRendering.renderToFBO((()=>this._renderGeometryAndTransparentTerrainPass(H.ObjectAndLayerIdColor)),[0,0,0,0],!0,!0),this._rctx.bindFramebuffer(e),this._offscreenRendering.renderToFBO((()=>{this._bindParameters.renderTransparentlyOccludedHUD=L.NotOccluded,this._renderInternalSlot(X.HUD_MATERIAL)}),null,!0,!0))}finish(e){if(this._hasAnimations||(this._animationTimestep=u(0)),e===N.BACKGROUND){let e=0;this.performanceInfo.gpuSamplingEnabled?e=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.getError();const r=this.performanceInfo.elapsedTime,t=Math.max(r,e),s=n(t/I,D,O);this._animationTimestep=u(this._animationTimestep*me+s*(1-me))}}readDepthPixels(e,r,t){const s=this._offscreenRendering.bindTarget(this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth);if(!this._needsLinearDepth){this._ensureBindParameters(e,e),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const r=le.COLOR_BUFFER_BIT|le.DEPTH_BUFFER_BIT|le.STENCIL_BUFFER_BIT;this._rctx.clearSafe(r),this._renderGeometryAndTransparentTerrainPass(H.Depth)}s.readPixels(r[0],r[1],r[2],r[3],ce.RGBA,pe.UNSIGNED_BYTE,t)}readHUDVisibility(e,r,t,s,i){this._offscreenRendering.bindTarget(this._offscreenRendering.hudVisibility).readPixels(e,r,t,s,ce.RGBA,pe.UNSIGNED_BYTE,i)}readAccumulatedShadow(e,r){return this._shadowAccumulator.readAccumulatedShadow(e,r)}_setMultipassEnabled(e){this._bindParameters.multipassTerrain.enabled=this._bindParameters.multipassGeometry.enabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_renderSlot(e){this._bindParameters.slot=e,this._renderPlugins.render()}_renderEdges(e,r=!1){const t=this._edgeView;o(t)&&t.shouldRender()&&this._offscreenRendering.renderTmpAndCompositeToMain((()=>t.render(this._bindParameters,e)),this._bindParameters,he.Alpha,r)}_renderShadowMap(e,r,t,s){const i=this._shadowMap;i.enabled&&(i.start(r,t,s),this._shadowHighlight.updateParameters(r,t),this._needsShadowHighlight?(this._renderShadowCascades(H.ShadowHighlight,this._shadowMap,(e=>i.takeCascadeSnapshotTo(e,Z.Highlight))),i.clear(),this._renderShadowCascades(H.ShadowExludeHighlight,this._shadowMap,(e=>{i.takeCascadeSnapshotTo(e,Z.Default),this._renderGeometryAndTransparentTerrainPass(H.ShadowHighlight)}))):this._renderShadowCascades(H.Shadow),i.finish(e),r.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap,t=(e=>{})){for(const s of r.getCascades())s.camera.setGLViewport(this._rctx),this._ensureCameraBindParameters(s.camera,s.camera),this._renderGeometryAndTransparentTerrainPass(e),t(s)}get _needsLinearDepth(){return this._ssaoHelper.enabled||this._renderPlugins.needsLinearDepth||this._hasWater&&this._waterReflectionEnabled||this._needsShadowHighlight||this._needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?this._offscreenRendering.renderToTargets((()=>this._renderGeometryAndTransparentTerrainPass(H.Depth)),this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.linearDepth),this._bindParameters.linearDepthTexture=this._offscreenRendering.linearDepthTexture}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.output;this._renderContext.output=H.Depth,this._offscreenRendering.renderToTargets((()=>this._renderTransparentTerrain()),this._offscreenRendering.terrainLinearDepth,this._offscreenRendering.tmpDepth,[-1e10,-1e10,-1e10,1],!0,!0),this._renderContext.output=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.terrainLinearDepth);this._bindParameters.multipassTerrain.linearDepthTexture=this._offscreenRendering.terrainLinearDepthTexture}_renderGeometryLinearDepth(e){if(e){const e=this._renderContext.output;this._offscreenRendering.renderToTargets((()=>this._renderGeometryPass(H.Depth)),this._offscreenRendering.geometryLinearDepth,this._offscreenRendering.tmpDepth,[1,1,1,1],!0,!0),this._renderContext.output=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.geometryLinearDepth);this._bindParameters.multipassGeometry.linearDepthTexture=this._offscreenRendering.geometryLinearDepthTexture}get _needsNormal(){return this._ssaoHelper.enabled}_renderNormal(){this._needsNormal?this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(H.Normal)}),this._offscreenRendering.normal,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.normal)}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(e){if(!this._needsDepthRange)return j;const r=G(e,this._content,this._stage.layers);return F(r,this.renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderGeometryAndTransparentTerrainPass(e){this._renderContext.output=e,this._renderGeometryPass(e),this._renderTransparentTerrain()}_renderGeometryPass(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderOpaqueGeometry(){this._renderSlot(X.INTEGRATED_MESH),this._renderSlot(X.OPAQUE_TERRAIN),this._renderInternalSlot(X.OPAQUE_MATERIAL),this._renderSlot(X.OPAQUE_MATERIAL),this._renderSlot(X.POSTPROCESSING_ENVIRONMENT_OPAQUE)}_renderTransparentGeometry(){this._renderInternalSlot(X.TRANSPARENT_MATERIAL),this._renderSlot(X.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){this._renderSlot(X.TRANSPARENT_TERRAIN)}_renderHUDVisibility(){let e=!1;return this._renderContext.offscreenRenderingHelper&&this._renderContext.offscreenRenderingHelper.renderHUDVisibility((()=>{this._bindParameters.hudVisibilityTexture=this._renderContext.offscreenRenderingHelper.hudVisibilityTexture,e=this._renderInternalSlot(X.OCCLUSION_PIXELS)}),this._multipassTerrain&&this._transparentTerrain),e}_renderLineCallouts(e){this._bindParameters.renderTransparentlyOccludedHUD=e,e===L.Occluded?this._offscreenRendering.renderToTargets((()=>this._renderInternalSlot(X.LINE_CALLOUTS)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderInternalSlot(X.LINE_CALLOUTS)}_renderHUD(e,r){this._hasHUDElements&&(this._oitEnabled?(this._renderOrderIndependentTransparency((()=>this._renderHUDElements(e)),!0),this._rctx.bindFramebuffer(r),this._compositingHelper.composite(this._bindParameters,this._offscreenRendering.hudColorTexture,he.PremultipliedAlpha)):e===L.Occluded?this._offscreenRendering.renderToTargets((()=>this._renderHUDElements(L.Occluded)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderHUDElements(e))}_renderHUDElements(e){this._bindParameters.renderTransparentlyOccludedHUD=e,this._renderInternalSlot(X.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(X.HUD_MATERIAL),this._renderInternalSlot(X.LABEL_MATERIAL)}get _needsHighlight(){return this._hasHighlights||this._renderPlugins.needsHighlight}get _needsShadowHighlight(){return this._shadowMap.enabled&&this._shadowHighlight.isVisible&&this._needsHighlight}_renderHighlights(e,r){if(!this._needsHighlight)return void this._offscreenRendering.disposeTarget(this._offscreenRendering.highlight);const t=this._highlight,s=this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(H.Highlight),this._rctx.clearSafe(le.DEPTH_BUFFER_BIT),this._renderHUDElements(L.Both)}),this._offscreenRendering.highlight,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0);this._bindParameters.highlightColorTexture=s.colorTexture,this._needsShadowHighlight&&this._shadowHighlight.render(r,e),t.render(this._bindParameters,s,e)}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_accumulateShadows(e,r,t){this._needsShadowCast&&this._shadowAccumulator.renderAccumulation(this._offscreenRendering.linearDepthTexture,e,r,t)}_renderOrderIndependentTransparency(e,r){const t=t=>{this._bindParameters.transparencyPassType=t,this._offscreenRendering.renderOITPass((()=>e()),t,r)},s=this._renderContext.output;this._renderContext.output=H.Alpha,t(te.Alpha),this._renderContext.output=H.Color,t(te.Color),t(te.FrontFace),this._offscreenRendering.compositeTransparentOntoOpaque(this._bindParameters,r),this._bindParameters.transparencyPassType=te.NONE,this._renderContext.output=s,this._oitUsed=!0}_disposeOITBuffers(){this._oitUsed||(this._offscreenRendering.disposeTarget(this._offscreenRendering.alphaFloatTarget),this._offscreenRendering.disposeTarget(this._offscreenRendering.colorFloatTarget),this._offscreenRendering.disposeTarget(this._offscreenRendering.frontFaceTarget)),this._oitUsed=!1}_renderOccluded(){let e=0;this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&t.renderOccluded===B.OccludeAndTransparentStencil&&(e|=t.renderOccluded,Te.push(t))}));const r=this._offscreenRendering,t=(t,s,i,n,a)=>{0!=(e&s)&&(r.renderToTargets(i,r.tmpColor,r.mainDepth,[0,0,0,0],n,a),r.compositeOccludedOntoMain(this._bindParameters,t))};0!==Te.length&&(this._renderInternalSlot(X.OCCLUDER_MATERIAL,Te),t(.5,B.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(X.TRANSPARENT_OCCLUDER_MATERIAL,Te)),!1,!1),Te.length=0),this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&(t.renderOccluded===B.OccludeAndTransparent||t.renderOccluded===B.Transparent||t.renderOccluded===B.Opaque)&&(e|=t.renderOccluded,fe.push(t))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const i=e=>{this._renderContext.renderOccludedMask=e,s>B.Occlude&&this._renderSlot(X.OCCLUDED_TERRAIN),this._renderInternalSlot(X.OPAQUE_MATERIAL,fe),this._renderInternalSlot(X.TRANSPARENT_MATERIAL,fe),this._renderInternalSlot(X.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,fe),this._renderContext.resetRenderOccludedMask()};this._renderContext.output=H.Color,t(.5,B.OccludeAndTransparent,(()=>i(B.OccludeAndTransparent)),!0,v.OutlineVisualElementMask),t(.5,B.Transparent,(()=>i(B.Transparent)),!0,v.OutlineVisualElementMask),t(1,B.Opaque,(()=>i(B.Opaque)),!0,v.OutlineVisualElementMask),fe.length=0}_renderAntiAliasing(e){if(this._antialiasing){if(this._smaaPass.enable((()=>this._requestRender()))&&o(e))return this._smaaPass.render(e),!0}else this._smaaPass.disable();return!1}_ensureCameraBindParameters(e,r){this._bindParameters.camera=e,this._bindParameters.contentCamera=r}_ensureBindParameters(e,r){this._ensureCameraBindParameters(e,r);const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.hudVisibilityTexture=t.hudVisibilityTexture,this._bindParameters.mainColorTexture=t.mainColorTexture,this._bindParameters.highlightDepthTexture=t.depthTexture??this._getFallbackDepthTexture()}_ensureFadingBindParameters(e,r){C(this._bindParameters.cloudsFade,this._bindParameters.camera,e.mode!==_e.IDLE,r),w(this._bindParameters)}_ensureBindParametersSSR(){this.hasWaterReflection?(this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=E:(b(be,this._bindParameters.camera.viewMatrix),b(Re,this._bindParameters.camera.projectionMatrix),P(Pe,be,Re),P(Pe,this._renderContext.lastFrameCamera.viewMatrix,Pe),P(Pe,this._renderContext.lastFrameCamera.projectionMatrix,Pe),this._reprojectionMatrix=Pe),this._bindParameters.ssr.lastFrameColorTexture=this._offscreenRendering.lastFrameColorTexture):this._bindParameters.ssr.lastFrameColorTexture=null,this._bindParameters.ssr.enabled=this.hasWaterReflection}_renderInternalSlot(e,r){let t=!1;return this._bindParameters.slot=e,o(r)?r.forEach((e=>{if(!e.shouldRender(this._renderContext))return;const r=this._materialRenderers.get(e);o(r)&&(t=r.render(this._renderContext.output,this._bindParameters)||t)})):this._materialRenderers.forEach(((e,r)=>{r.shouldRender(this._renderContext)&&e.render(this._renderContext.output,this._bindParameters)&&(t=!0)})),t}_getFallbackDepthTexture(){return this._fallbackDepthStencilTexture||(this._fallbackDepthStencilTexture=V(this._rctx)),this._fallbackDepthStencilTexture}get gpuMemoryUsage(){return{offscreen:this._offscreenRendering?.gpuMemoryUsage??0,highlights:(this._highlight?.gpuMemoryUsage??0)+(this._shadowHighlight?.gpuMemoryUsage??0),shadows:this._shadowMap?.gpuMemoryUsage??0,ssao:this._ssaoHelper?.gpuMemoryUsage??0}}get test(){const e=this;return{offscreen:this._offscreenRendering,shadowMap:this._shadowMap,ssao:this._ssaoHelper,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,getFramebufferTexture:r=>{switch(r){case ue.Color:return e._offscreenRendering.colorTexture;case ue.LinearDepth:return e._offscreenRendering.linearDepthTexture;case ue.Normals:return e._offscreenRendering.normalTexture;case ue.ShadowMap:return e._shadowMap.depthTexture;case ue.HudVisibility:return e._offscreenRendering.hudVisibilityTexture;case ue.Highlight:return e._offscreenRendering.highlightTexture}}}}};var ue;e([f()],ge.prototype,"_shadowAccumulator",void 0),e([f()],ge.prototype,"_smaaPass",void 0),e([f()],ge.prototype,"_antialiasing",void 0),e([f()],ge.prototype,"_edgeView",void 0),e([f()],ge.prototype,"updating",null),e([f()],ge.prototype,"isCameraFinal",null),ge=e([T("esri.views.3d.webgl-engine.lib.Renderer")],ge),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.Normals=2]="Normals",e[e.ShadowMap=3]="ShadowMap",e[e.HudVisibility=4]="HudVisibility",e[e.Highlight=5]="Highlight"}(ue||(ue={}));const fe=[],Te=[],Re=A(),be=A(),Pe=A();export{ue as FramebufferId,ge as Renderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{clamp as t,acosClamped as e,lerp as s}from"../../../../core/mathUtils.js";import{isSome as a,disposeMaybe as r}from"../../../../core/maybe.js";import{c as i}from"../../../../chunks/mat3f64.js";import{v as c,m as h,w as o,a as n,q as _}from"../../../../chunks/mat4.js";import{c as m}from"../../../../chunks/mat4f64.js";import{s as u,j as d,b as p,l,k as f,a as x,h as T,n as g,f as b,c as w}from"../../../../chunks/vec2.js";import{a as S}from"../../../../chunks/vec2f64.js";import{k as M,c as C,o as D,m as E,s as j}from"../../../../chunks/vec3.js";import{c as v}from"../../../../chunks/vec3f64.js";import{s as z,t as R}from"../../../../chunks/vec4.js";import{c as U}from"../../../../chunks/vec4f64.js";import{ViewingMode as F}from"../../../ViewingMode.js";import{Camera as y}from"./Camera.js";import{assert as N,logWithBase as O,verify as A,rayRay2D as k}from"./Util.js";import{TextureType as L,ClearBufferBit as P,PixelFormat as B,PixelType as G,TextureWrapMode as I,TextureSamplingMode as X,TargetType as H,DepthStencilTargetType as q}from"../../../webgl/enums.js";import{FramebufferObject as Y}from"../../../webgl/FramebufferObject.js";import{Texture as V}from"../../../webgl/Texture.js";import{getGpuMemoryUsage as W}from"../../../webgl/Util.js";var J;!function(t){t[t.Highlight=0]="Highlight",t[t.Default=1]="Default"}(J||(J={}));class K{constructor(){this.camera=new y,this.lightMat=m()}}class Q{constructor(t,e){this._rctx=t,this._viewingMode=e,this._enabled=!1,this._snapshots=new Array,this._textureSize=0,this.numCascades=1,this._maxNumCascades=4,this._splitSchemeLambda=0,this._warp=!0,this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=U(),this._cascades=[new K,new K,new K,new K],this._maxTextureSize=Math.min(has("esri-mobile")?2048:8192,this._rctx.parameters.maxTextureSize)}get depthTexture(){return this._depthTexture}get textureSize(){return this._textureSize}get cascadeDistances(){return z(this._usedCascadeDistances,this._cascadeDistances[0],this.numCascades>1?this._cascadeDistances[1]:1/0,this.numCascades>2?this._cascadeDistances[2]:1/0,this.numCascades>3?this._cascadeDistances[3]:1/0)}dispose(){this._discardDepthTexture(),this._discardAllSnapshots()}set maxCascades(e){this._maxNumCascades=t(Math.floor(e),1,4)}get maxCascades(){return this._maxNumCascades}set enabled(t){this._enabled=t,t||(this._discardDepthTexture(),this._discardAllSnapshots())}get enabled(){return this._enabled}get ready(){return this._enabled&&a(this._depthTexture)}getSnapshot(t){return this.enabled?this._snapshots[t]:null}getCascades(){for(let t=0;t<this.numCascades;++t)ut[t]=this._cascades[t];return ut.length=this.numCascades,ut}start(t,e,s){N(this.enabled),this._textureSize=this._computeTextureSize(t.fullWidth,t.fullHeight),this._ensureDepthTexture();const{near:a,far:r}=this._clampNearFar(s);this._computeCascadeDistances(r,a),this._setupMatrices(t,e);const i=t.viewMatrix,c=t.projectionMatrix;for(let h=0;h<this.numCascades;++h)this._constructCascade(h,c,i,e);this._lastOrigin=null,this.clear()}finish(t){N(this.enabled),this._rctx.bindFramebuffer(t)}getShadowMapMatrices(t){if(!this._lastOrigin||!M(t,this._lastOrigin)){this._lastOrigin=this._lastOrigin||v(),C(this._lastOrigin,t);for(let e=0;e<this.numCascades;++e){c(dt,this._cascades[e].lightMat,t);for(let t=0;t<16;++t)pt[16*e+t]=dt[t]}}return pt}takeCascadeSnapshotTo(t,e){N(this.enabled);const s=this._ensureSnapshot(e);this._bindFbo();const a=this._rctx,r=a.bindTexture(s,V.TEXTURE_UNIT_FOR_UPDATES);a.gl.copyTexSubImage2D(L.TEXTURE_2D,0,t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[2],t.camera.viewport[3]),a.bindTexture(r,V.TEXTURE_UNIT_FOR_UPDATES)}clear(){const t=this._rctx;this._bindFbo(),t.setClearColor(1,1,1,1),t.clearSafe(P.COLOR_BUFFER_BIT|P.DEPTH_BUFFER_BIT)}_computeTextureSize(t,e){const s=.5*Math.log(t*t+e*e)*Math.LOG2E,a=.35,r=2**Math.round(s+a);return Math.min(this._maxTextureSize,2*r)}_ensureDepthTexture(){if(a(this._depthTexture)&&this._depthTexture.descriptor.width===this._textureSize)return;this._discardDepthTexture();const t={target:L.TEXTURE_2D,pixelFormat:B.RGBA,dataType:G.UNSIGNED_BYTE,wrapMode:I.CLAMP_TO_EDGE,samplingMode:X.NEAREST,flipped:!0,width:this._textureSize,height:this._textureSize};this._depthTexture=new V(this._rctx,t),this._fbo=new Y(this._rctx,{colorTarget:H.TEXTURE,depthStencilTarget:q.DEPTH_RENDER_BUFFER,width:this._textureSize,height:this._textureSize},this._depthTexture)}_ensureSnapshot(t){let e=this._snapshots[t];if(a(e)&&e.descriptor.width===this._textureSize)return e;this._discardSnapshot(t);const s={target:L.TEXTURE_2D,pixelFormat:B.RGBA,dataType:G.UNSIGNED_BYTE,wrapMode:I.CLAMP_TO_EDGE,samplingMode:X.NEAREST,flipped:!0,width:this._textureSize,height:this._textureSize};return e=new V(this._rctx,s),this._snapshots[t]=e,e}_discardDepthTexture(){this._fbo=r(this._fbo),this._depthTexture=r(this._depthTexture)}_discardSnapshot(t){this._snapshots[t]=r(this._snapshots[t])}_discardAllSnapshots(){for(let t=0;t<this._snapshots.length;++t)this._discardSnapshot(t);this._snapshots.length=0}_bindFbo(){const t=this._rctx;t.unbindTexture(this._depthTexture),t.bindFramebuffer(this._fbo)}_constructCascade(t,e,s,a){const r=this._cascades[t],i=-this._cascadeDistances[t],o=-this._cascadeDistances[t+1],n=(e[10]*i+e[14])/Math.abs(e[11]*i+e[15]),_=(e[10]*o+e[14])/Math.abs(e[11]*o+e[15]);N(n<_);for(let c=0;c<8;++c){z(et,c%4==0||c%4==3?-1:1,c%4==0||c%4==1?-1:1,c<4?n:_,1),R(st[c],et,tt);for(let t=0;t<3;++t)st[c][t]/=st[c][3]}D(mt,st[0]),c(Z,_t,mt),r.camera.viewMatrix=Z;for(let c=0;c<8;++c)E(st[c],st[c],r.camera.viewMatrix);C(at,st[0]),C(rt,st[0]);for(let c=1;c<8;++c)for(let t=0;t<3;++t)at[t]=Math.min(at[t],st[c][t]),rt[t]=Math.max(rt[t],st[c][t]);at[2]-=200,rt[2]+=200,r.camera.near=-rt[2],r.camera.far=-at[2],this._warp?this._constructTrapezoidalProjection(s,a,r):this._constructOrthogonalProjection(r),h(r.lightMat,r.camera.projectionMatrix,r.camera.viewMatrix);const m=this._textureSize/2;r.camera.viewport[0]=t%2==0?0:m,r.camera.viewport[1]=0===Math.floor(t/2)?0:m,r.camera.viewport[2]=m,r.camera.viewport[3]=m}_constructOrthogonalProjection(t){o(t.camera.projectionMatrix,at[0],rt[0],at[1],rt[1],t.camera.near,t.camera.far)}_constructTrapezoidalProjection(t,s,a){const r=1/st[0][3],i=1/st[4][3];N(r<i);let c=r+Math.sqrt(r*i);const h=Math.sin(e(t[2]*s[0]+t[6]*s[1]+t[10]*s[2]));c/=h,Dt(st,c,h,it,ct,ht,ot,nt),Ut(it,ct,ot,nt,a.camera.projectionMatrix),a.camera.projectionMatrix[10]=2/(at[2]-rt[2]),a.camera.projectionMatrix[14]=-(at[2]+rt[2])/(at[2]-rt[2])}_setupMatrices(t,e){h($,t.projectionMatrix,t.viewMatrix),n(tt,$);const s=this._viewingMode===F.Global?t.eye:j(mt,0,0,1);_(_t,[0,0,0],[-e[0],-e[1],-e[2]],s)}_clampNearFar(t){let{near:e,far:s}=t;return e<2&&(e=2),s<2&&(s=2),e>=s&&(e=2,s=4),{near:e,far:s}}_computeCascadeDistances(t,e){this.numCascades=Math.min(1+Math.floor(O(t/e,4)),this._maxNumCascades);const a=(t-e)/this.numCascades,r=(t/e)**(1/this.numCascades);let i=e,c=e;for(let h=0;h<this.numCascades+1;++h)this._cascadeDistances[h]=s(i,c,this._splitSchemeLambda),i*=r,c+=a}get gpuMemoryUsage(){return this._snapshots.reduce(((t,e)=>t+W(e)),this._fbo?.gpuMemoryUsage??0)}get test(){const t=this;return{maxNumCascades:this._maxNumCascades,cascades:this._cascades,textureSize:this._textureSize,set splitSchemeLambda(e){t._splitSchemeLambda=e},get splitSchemeLambda(){return t._splitSchemeLambda},set warp(e){t._warp=e},get warp(){return t._warp}}}}const Z=m(),$=m(),tt=m(),et=U(),st=[];for(let Ft=0;Ft<8;++Ft)st.push(U());const at=v(),rt=v(),it=S(),ct=S(),ht=S(),ot=S(),nt=S(),_t=m(),mt=v(),ut=[],dt=m(),pt=new Float32Array(64),lt=S(),ft=S(),xt=[S(),S(),S(),S()],Tt=S(),gt=S(),bt=S(),wt=S(),St=S(),Mt=S(),Ct=S();function Dt(t,e,s,a,r,i,c,h){u(lt,0,0);for(let u=0;u<4;++u)d(lt,lt,t[u]);p(lt,lt,.25),u(ft,0,0);for(let u=4;u<8;++u)d(ft,ft,t[u]);p(ft,ft,.25),l(xt[0],t[4],t[5],.5),l(xt[1],t[5],t[6],.5),l(xt[2],t[6],t[7],.5),l(xt[3],t[7],t[4],.5);let o=0,n=f(xt[0],lt);for(let u=1;u<4;++u){const t=f(xt[u],lt);t<n&&(n=t,o=u)}x(Tt,xt[o],t[o+4]);const _=Tt[0];let m,S;Tt[0]=-Tt[1],Tt[1]=_,x(gt,ft,lt),T(gt,Tt)<0&&g(Tt,Tt),l(Tt,Tt,gt,s),b(Tt,Tt),m=S=T(x(bt,t[0],lt),Tt);for(let u=1;u<8;++u){const e=T(x(bt,t[u],lt),Tt);e<m?m=e:e>S&&(S=e)}w(a,lt),p(bt,Tt,m-e),d(a,a,bt);let M=-1,C=1,D=0,E=0;for(let u=0;u<8;++u){x(wt,t[u],a),b(wt,wt);const e=Tt[0]*wt[1]-Tt[1]*wt[0];e>0?e>M&&(M=e,D=u):e<C&&(C=e,E=u)}A(M>0,"leftArea"),A(C<0,"rightArea"),p(St,Tt,m),d(St,St,lt),p(Mt,Tt,S),d(Mt,Mt,lt),Ct[0]=-Tt[1],Ct[1]=Tt[0];const j=k(a,t[E],Mt,d(bt,Mt,Ct),1,r),v=k(a,t[D],Mt,bt,1,i),z=k(a,t[D],St,d(bt,St,Ct),1,c),R=k(a,t[E],St,bt,1,h);A(j,"rayRay"),A(v,"rayRay"),A(z,"rayRay"),A(R,"rayRay")}function Et(t,e){return 3*e+t}const jt=S();function vt(t,e){return u(jt,t[e],t[e+3]),jt}const zt=S(),Rt=i();function Ut(t,e,s,a,r){x(zt,s,a),p(zt,zt,.5),Rt[0]=zt[0],Rt[1]=zt[1],Rt[2]=0,Rt[3]=zt[1],Rt[4]=-zt[0],Rt[5]=0,Rt[6]=zt[0]*zt[0]+zt[1]*zt[1],Rt[7]=zt[0]*zt[1]-zt[1]*zt[0],Rt[8]=1,Rt[Et(0,2)]=-T(vt(Rt,0),t),Rt[Et(1,2)]=-T(vt(Rt,1),t);let i=T(vt(Rt,0),s)+Rt[Et(0,2)],c=T(vt(Rt,1),s)+Rt[Et(1,2)],h=T(vt(Rt,0),a)+Rt[Et(0,2)],o=T(vt(Rt,1),a)+Rt[Et(1,2)];i=-(i+h)/(c+o),Rt[Et(0,0)]+=Rt[Et(1,0)]*i,Rt[Et(0,1)]+=Rt[Et(1,1)]*i,Rt[Et(0,2)]+=Rt[Et(1,2)]*i,i=1/(T(vt(Rt,0),s)+Rt[Et(0,2)]),c=1/(T(vt(Rt,1),s)+Rt[Et(1,2)]),Rt[Et(0,0)]*=i,Rt[Et(0,1)]*=i,Rt[Et(0,2)]*=i,Rt[Et(1,0)]*=c,Rt[Et(1,1)]*=c,Rt[Et(1,2)]*=c,Rt[Et(2,0)]=Rt[Et(1,0)],Rt[Et(2,1)]=Rt[Et(1,1)],Rt[Et(2,2)]=Rt[Et(1,2)],Rt[Et(1,2)]+=1,i=T(vt(Rt,1),e)+Rt[Et(1,2)],c=T(vt(Rt,2),e)+Rt[Et(2,2)],h=T(vt(Rt,1),s)+Rt[Et(1,2)],o=T(vt(Rt,2),s)+Rt[Et(2,2)],i=-.5*(i/c+h/o),Rt[Et(1,0)]+=Rt[Et(2,0)]*i,Rt[Et(1,1)]+=Rt[Et(2,1)]*i,Rt[Et(1,2)]+=Rt[Et(2,2)]*i,i=T(vt(Rt,1),e)+Rt[Et(1,2)],c=T(vt(Rt,2),e)+Rt[Et(2,2)],h=-c/i,Rt[Et(1,0)]*=h,Rt[Et(1,1)]*=h,Rt[Et(1,2)]*=h,r[0]=Rt[0],r[1]=Rt[1],r[2]=0,r[3]=Rt[2],r[4]=Rt[3],r[5]=Rt[4],r[6]=0,r[7]=Rt[5],r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=Rt[6],r[13]=Rt[7],r[14]=0,r[15]=Rt[8]}export{Q as ShadowMap,J as SnapshotSlot};
5
+ import has from"../../../../core/has.js";import{clamp as t,acosClamped as e,lerp as s}from"../../../../core/mathUtils.js";import{isSome as a,disposeMaybe as r}from"../../../../core/maybe.js";import{c as i}from"../../../../chunks/mat3f64.js";import{v as c,m as h,w as o,a as n,q as _}from"../../../../chunks/mat4.js";import{c as m}from"../../../../chunks/mat4f64.js";import{s as u,j as d,b as p,l,k as f,a as x,h as T,n as g,f as w,c as b}from"../../../../chunks/vec2.js";import{a as S}from"../../../../chunks/vec2f64.js";import{w as M,c as C,x as D,v as E,s as j}from"../../../../chunks/vec3.js";import{c as v}from"../../../../chunks/vec3f64.js";import{s as z,t as R}from"../../../../chunks/vec4.js";import{c as U}from"../../../../chunks/vec4f64.js";import{ViewingMode as F}from"../../../ViewingMode.js";import{Camera as y}from"./Camera.js";import{assert as N,logWithBase as O,verify as A,rayRay2D as k}from"./Util.js";import{TextureType as L,ClearBufferBit as P,PixelFormat as B,PixelType as G,TextureWrapMode as I,TextureSamplingMode as X,TargetType as H,DepthStencilTargetType as q}from"../../../webgl/enums.js";import{FramebufferObject as Y}from"../../../webgl/FramebufferObject.js";import{Texture as V}from"../../../webgl/Texture.js";import{getGpuMemoryUsage as W}from"../../../webgl/Util.js";var J;!function(t){t[t.Highlight=0]="Highlight",t[t.Default=1]="Default"}(J||(J={}));class K{constructor(){this.camera=new y,this.lightMat=m()}}class Q{constructor(t,e){this._rctx=t,this._viewingMode=e,this._enabled=!1,this._snapshots=new Array,this._textureSize=0,this.numCascades=1,this._maxNumCascades=4,this._splitSchemeLambda=0,this._warp=!0,this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=U(),this._cascades=[new K,new K,new K,new K],this._maxTextureSize=Math.min(has("esri-mobile")?2048:8192,this._rctx.parameters.maxTextureSize)}get depthTexture(){return this._depthTexture}get textureSize(){return this._textureSize}get cascadeDistances(){return z(this._usedCascadeDistances,this._cascadeDistances[0],this.numCascades>1?this._cascadeDistances[1]:1/0,this.numCascades>2?this._cascadeDistances[2]:1/0,this.numCascades>3?this._cascadeDistances[3]:1/0)}dispose(){this._discardDepthTexture(),this._discardAllSnapshots()}set maxCascades(e){this._maxNumCascades=t(Math.floor(e),1,4)}get maxCascades(){return this._maxNumCascades}set enabled(t){this._enabled=t,t||(this._discardDepthTexture(),this._discardAllSnapshots())}get enabled(){return this._enabled}get ready(){return this._enabled&&a(this._depthTexture)}getSnapshot(t){return this.enabled?this._snapshots[t]:null}getCascades(){for(let t=0;t<this.numCascades;++t)ut[t]=this._cascades[t];return ut.length=this.numCascades,ut}start(t,e,s){N(this.enabled),this._textureSize=this._computeTextureSize(t.fullWidth,t.fullHeight),this._ensureDepthTexture();const{near:a,far:r}=this._clampNearFar(s);this._computeCascadeDistances(r,a),this._setupMatrices(t,e);const i=t.viewMatrix,c=t.projectionMatrix;for(let h=0;h<this.numCascades;++h)this._constructCascade(h,c,i,e);this._lastOrigin=null,this.clear()}finish(t){N(this.enabled),this._rctx.bindFramebuffer(t)}getShadowMapMatrices(t){if(!this._lastOrigin||!M(t,this._lastOrigin)){this._lastOrigin=this._lastOrigin||v(),C(this._lastOrigin,t);for(let e=0;e<this.numCascades;++e){c(dt,this._cascades[e].lightMat,t);for(let t=0;t<16;++t)pt[16*e+t]=dt[t]}}return pt}takeCascadeSnapshotTo(t,e){N(this.enabled);const s=this._ensureSnapshot(e);this._bindFbo();const a=this._rctx,r=a.bindTexture(s,V.TEXTURE_UNIT_FOR_UPDATES);a.gl.copyTexSubImage2D(L.TEXTURE_2D,0,t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[2],t.camera.viewport[3]),a.bindTexture(r,V.TEXTURE_UNIT_FOR_UPDATES)}clear(){const t=this._rctx;this._bindFbo(),t.setClearColor(1,1,1,1),t.clearSafe(P.COLOR_BUFFER_BIT|P.DEPTH_BUFFER_BIT)}_computeTextureSize(t,e){const s=.5*Math.log(t*t+e*e)*Math.LOG2E,a=.35,r=2**Math.round(s+a);return Math.min(this._maxTextureSize,2*r)}_ensureDepthTexture(){if(a(this._depthTexture)&&this._depthTexture.descriptor.width===this._textureSize)return;this._discardDepthTexture();const t={target:L.TEXTURE_2D,pixelFormat:B.RGBA,dataType:G.UNSIGNED_BYTE,wrapMode:I.CLAMP_TO_EDGE,samplingMode:X.NEAREST,flipped:!0,width:this._textureSize,height:this._textureSize};this._depthTexture=new V(this._rctx,t),this._fbo=new Y(this._rctx,{colorTarget:H.TEXTURE,depthStencilTarget:q.DEPTH_RENDER_BUFFER,width:this._textureSize,height:this._textureSize},this._depthTexture)}_ensureSnapshot(t){let e=this._snapshots[t];if(a(e)&&e.descriptor.width===this._textureSize)return e;this._discardSnapshot(t);const s={target:L.TEXTURE_2D,pixelFormat:B.RGBA,dataType:G.UNSIGNED_BYTE,wrapMode:I.CLAMP_TO_EDGE,samplingMode:X.NEAREST,flipped:!0,width:this._textureSize,height:this._textureSize};return e=new V(this._rctx,s),this._snapshots[t]=e,e}_discardDepthTexture(){this._fbo=r(this._fbo),this._depthTexture=r(this._depthTexture)}_discardSnapshot(t){this._snapshots[t]=r(this._snapshots[t])}_discardAllSnapshots(){for(let t=0;t<this._snapshots.length;++t)this._discardSnapshot(t);this._snapshots.length=0}_bindFbo(){const t=this._rctx;t.unbindTexture(this._depthTexture),t.bindFramebuffer(this._fbo)}_constructCascade(t,e,s,a){const r=this._cascades[t],i=-this._cascadeDistances[t],o=-this._cascadeDistances[t+1],n=(e[10]*i+e[14])/Math.abs(e[11]*i+e[15]),_=(e[10]*o+e[14])/Math.abs(e[11]*o+e[15]);N(n<_);for(let c=0;c<8;++c){z(et,c%4==0||c%4==3?-1:1,c%4==0||c%4==1?-1:1,c<4?n:_,1),R(st[c],et,tt);for(let t=0;t<3;++t)st[c][t]/=st[c][3]}D(mt,st[0]),c(Z,_t,mt),r.camera.viewMatrix=Z;for(let c=0;c<8;++c)E(st[c],st[c],r.camera.viewMatrix);C(at,st[0]),C(rt,st[0]);for(let c=1;c<8;++c)for(let t=0;t<3;++t)at[t]=Math.min(at[t],st[c][t]),rt[t]=Math.max(rt[t],st[c][t]);at[2]-=200,rt[2]+=200,r.camera.near=-rt[2],r.camera.far=-at[2],this._warp?this._constructTrapezoidalProjection(s,a,r):this._constructOrthogonalProjection(r),h(r.lightMat,r.camera.projectionMatrix,r.camera.viewMatrix);const m=this._textureSize/2;r.camera.viewport[0]=t%2==0?0:m,r.camera.viewport[1]=0===Math.floor(t/2)?0:m,r.camera.viewport[2]=m,r.camera.viewport[3]=m}_constructOrthogonalProjection(t){o(t.camera.projectionMatrix,at[0],rt[0],at[1],rt[1],t.camera.near,t.camera.far)}_constructTrapezoidalProjection(t,s,a){const r=1/st[0][3],i=1/st[4][3];N(r<i);let c=r+Math.sqrt(r*i);const h=Math.sin(e(t[2]*s[0]+t[6]*s[1]+t[10]*s[2]));c/=h,Dt(st,c,h,it,ct,ht,ot,nt),Ut(it,ct,ot,nt,a.camera.projectionMatrix),a.camera.projectionMatrix[10]=2/(at[2]-rt[2]),a.camera.projectionMatrix[14]=-(at[2]+rt[2])/(at[2]-rt[2])}_setupMatrices(t,e){h($,t.projectionMatrix,t.viewMatrix),n(tt,$);const s=this._viewingMode===F.Global?t.eye:j(mt,0,0,1);_(_t,[0,0,0],[-e[0],-e[1],-e[2]],s)}_clampNearFar(t){let{near:e,far:s}=t;return e<2&&(e=2),s<2&&(s=2),e>=s&&(e=2,s=4),{near:e,far:s}}_computeCascadeDistances(t,e){this.numCascades=Math.min(1+Math.floor(O(t/e,4)),this._maxNumCascades);const a=(t-e)/this.numCascades,r=(t/e)**(1/this.numCascades);let i=e,c=e;for(let h=0;h<this.numCascades+1;++h)this._cascadeDistances[h]=s(i,c,this._splitSchemeLambda),i*=r,c+=a}get gpuMemoryUsage(){return this._snapshots.reduce(((t,e)=>t+W(e)),this._fbo?.gpuMemoryUsage??0)}get test(){const t=this;return{maxNumCascades:this._maxNumCascades,cascades:this._cascades,textureSize:this._textureSize,set splitSchemeLambda(e){t._splitSchemeLambda=e},get splitSchemeLambda(){return t._splitSchemeLambda},set warp(e){t._warp=e},get warp(){return t._warp}}}}const Z=m(),$=m(),tt=m(),et=U(),st=[];for(let Ft=0;Ft<8;++Ft)st.push(U());const at=v(),rt=v(),it=S(),ct=S(),ht=S(),ot=S(),nt=S(),_t=m(),mt=v(),ut=[],dt=m(),pt=new Float32Array(64),lt=S(),ft=S(),xt=[S(),S(),S(),S()],Tt=S(),gt=S(),wt=S(),bt=S(),St=S(),Mt=S(),Ct=S();function Dt(t,e,s,a,r,i,c,h){u(lt,0,0);for(let u=0;u<4;++u)d(lt,lt,t[u]);p(lt,lt,.25),u(ft,0,0);for(let u=4;u<8;++u)d(ft,ft,t[u]);p(ft,ft,.25),l(xt[0],t[4],t[5],.5),l(xt[1],t[5],t[6],.5),l(xt[2],t[6],t[7],.5),l(xt[3],t[7],t[4],.5);let o=0,n=f(xt[0],lt);for(let u=1;u<4;++u){const t=f(xt[u],lt);t<n&&(n=t,o=u)}x(Tt,xt[o],t[o+4]);const _=Tt[0];let m,S;Tt[0]=-Tt[1],Tt[1]=_,x(gt,ft,lt),T(gt,Tt)<0&&g(Tt,Tt),l(Tt,Tt,gt,s),w(Tt,Tt),m=S=T(x(wt,t[0],lt),Tt);for(let u=1;u<8;++u){const e=T(x(wt,t[u],lt),Tt);e<m?m=e:e>S&&(S=e)}b(a,lt),p(wt,Tt,m-e),d(a,a,wt);let M=-1,C=1,D=0,E=0;for(let u=0;u<8;++u){x(bt,t[u],a),w(bt,bt);const e=Tt[0]*bt[1]-Tt[1]*bt[0];e>0?e>M&&(M=e,D=u):e<C&&(C=e,E=u)}A(M>0,"leftArea"),A(C<0,"rightArea"),p(St,Tt,m),d(St,St,lt),p(Mt,Tt,S),d(Mt,Mt,lt),Ct[0]=-Tt[1],Ct[1]=Tt[0];const j=k(a,t[E],Mt,d(wt,Mt,Ct),1,r),v=k(a,t[D],Mt,wt,1,i),z=k(a,t[D],St,d(wt,St,Ct),1,c),R=k(a,t[E],St,wt,1,h);A(j,"rayRay"),A(v,"rayRay"),A(z,"rayRay"),A(R,"rayRay")}function Et(t,e){return 3*e+t}const jt=S();function vt(t,e){return u(jt,t[e],t[e+3]),jt}const zt=S(),Rt=i();function Ut(t,e,s,a,r){x(zt,s,a),p(zt,zt,.5),Rt[0]=zt[0],Rt[1]=zt[1],Rt[2]=0,Rt[3]=zt[1],Rt[4]=-zt[0],Rt[5]=0,Rt[6]=zt[0]*zt[0]+zt[1]*zt[1],Rt[7]=zt[0]*zt[1]-zt[1]*zt[0],Rt[8]=1,Rt[Et(0,2)]=-T(vt(Rt,0),t),Rt[Et(1,2)]=-T(vt(Rt,1),t);let i=T(vt(Rt,0),s)+Rt[Et(0,2)],c=T(vt(Rt,1),s)+Rt[Et(1,2)],h=T(vt(Rt,0),a)+Rt[Et(0,2)],o=T(vt(Rt,1),a)+Rt[Et(1,2)];i=-(i+h)/(c+o),Rt[Et(0,0)]+=Rt[Et(1,0)]*i,Rt[Et(0,1)]+=Rt[Et(1,1)]*i,Rt[Et(0,2)]+=Rt[Et(1,2)]*i,i=1/(T(vt(Rt,0),s)+Rt[Et(0,2)]),c=1/(T(vt(Rt,1),s)+Rt[Et(1,2)]),Rt[Et(0,0)]*=i,Rt[Et(0,1)]*=i,Rt[Et(0,2)]*=i,Rt[Et(1,0)]*=c,Rt[Et(1,1)]*=c,Rt[Et(1,2)]*=c,Rt[Et(2,0)]=Rt[Et(1,0)],Rt[Et(2,1)]=Rt[Et(1,1)],Rt[Et(2,2)]=Rt[Et(1,2)],Rt[Et(1,2)]+=1,i=T(vt(Rt,1),e)+Rt[Et(1,2)],c=T(vt(Rt,2),e)+Rt[Et(2,2)],h=T(vt(Rt,1),s)+Rt[Et(1,2)],o=T(vt(Rt,2),s)+Rt[Et(2,2)],i=-.5*(i/c+h/o),Rt[Et(1,0)]+=Rt[Et(2,0)]*i,Rt[Et(1,1)]+=Rt[Et(2,1)]*i,Rt[Et(1,2)]+=Rt[Et(2,2)]*i,i=T(vt(Rt,1),e)+Rt[Et(1,2)],c=T(vt(Rt,2),e)+Rt[Et(2,2)],h=-c/i,Rt[Et(1,0)]*=h,Rt[Et(1,1)]*=h,Rt[Et(1,2)]*=h,r[0]=Rt[0],r[1]=Rt[1],r[2]=0,r[3]=Rt[2],r[4]=Rt[3],r[5]=Rt[4],r[6]=0,r[7]=Rt[5],r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=Rt[6],r[13]=Rt[7],r[14]=0,r[15]=Rt[8]}export{Q as ShadowMap,J as SnapshotSlot};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
+ */
5
+ var e;!function(e){e[e.Immediate=0]="Immediate",e[e.Faded=1]="Faded"}(e||(e={}));export{e as Update};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{unpackFloatRGBA as e}from"../../../../core/floatRGBA.js";import{isSome as t,isNone as r}from"../../../../core/maybe.js";import i from"../../../../core/PooledArray.js";import{m as n,c as s}from"../../../../chunks/mat4.js";import{c as a}from"../../../../chunks/mat4f64.js";import{m as o}from"../../../../chunks/vec3.js";import{l as h}from"../../../../chunks/vec4.js";import{c as f}from"../../../../chunks/vec4f64.js";import{intersectsSphere as _,create as c,copy as l}from"../../../../geometry/support/frustum.js";import{c as u}from"../../../../chunks/sphere.js";import{maxScale as d}from"../../support/mathUtils.js";import{empty as g,union as m,set as p}from"./depthRange.js";import b from"./Octree.js";import{assert as w}from"./Util.js";const R=1e4,B=100,v=500,j=500,C=.1;function A(t,r,i){return e(r,t)*(i[1]-i[0])+i[0]}function M(e,t,r){if(t.size<R)return K.compute(e,t);const i=g();return r.forAll((t=>{t.isVisible&&m(i,O(e,t))})),i}function O(e,r){if(!r.isVisible)return;const i=g(),n=r.getSpatialQueryAccelerator();return t(n)?T(i,e,n):D(i,e,r.objects),i}function T(e,t,r){const i=t.eye,n=t.viewForward,s=t.frustum,a=e=>e.isVisible,o=r.objectCount;if(o<v)p(W,t.near,Math.min(e.near,t.far)),r.forEachInDepthRange(i,n,b.DepthOrder.FRONT_TO_BACK,W,((r,i)=>{S(e,t,r),W.far=e.near,i.setRange(W)}),s,a),p(W,Math.max(e.far,t.near),t.far),r.forEachInDepthRange(i,n,b.DepthOrder.BACK_TO_FRONT,W,((r,i)=>{S(e,t,r),W.near=e.far,i.setRange(W)}),s,a);else{const i=Math.max(Math.min(o,j),Math.ceil(o*C)),h=r.findClosest(n,b.DepthOrder.FRONT_TO_BACK,s,a,i),f=r.findClosest(n,b.DepthOrder.BACK_TO_FRONT,s,a,i);h&&f&&(F(e,t,h.boundingVolumeWorldSpace.bounds),F(e,t,f.boundingVolumeWorldSpace.bounds))}}function D(e,t,r){k.clear(),r.forAll((e=>{e.isVisible&&0!==e.geometryRecords.length&&k.add(e)})),k.empty||(k.sort(t),p(W,t.near,Math.min(e.near,t.far)),k.forEachInDepthRange(W,b.DepthOrder.FRONT_TO_BACK,((r,i)=>{i<e.near&&S(e,t,r)})),p(W,Math.max(e.far,t.near),t.far),k.forEachInDepthRange(W,b.DepthOrder.BACK_TO_FRONT,((t,r,i)=>{e.far=Math.max(e.far,i)})))}function S(e,t,r){if(!r.isVisible)return;if(!_(t.frustum,r.boundingVolumeWorldSpace.bounds))return;const i=r.transformation,s=E;r.geometryRecords.forEach((r=>{n(s,i,r.getShaderTransformation());const a=d(s);y(e,t,r.geometry.boundingInfo,s,a)}))}function y(e,t,i,n,s){if(r(i))return;const a=t.eye,h=t.viewForward;o(V,i.center,n);const f=h[0]*(V[0]-a[0])+h[1]*(V[1]-a[1])+h[2]*(V[2]-a[2]);if(V[3]=i.radius*s,!(f-V[3]>e.near&&f+V[3]<e.far)&&_(t.frustum,V))if(i.radius>B&&i.getChildren()){const r=i.getChildren();for(let i=0;i<8;++i)r[i]&&y(e,t,r[i],n,s)}else U.unionDepthRangeWithAABB(e,t.viewProjectionMatrix,n,i.bbMin,i.bbMax)}function F(e,t,r){const i=t.eye,n=t.viewForward,s=(r[0]-i[0])*n[0]+(r[1]-i[1])*n[1]+(r[2]-i[2])*n[2];e.near=Math.min(e.near,s-r[3]),e.far=Math.max(e.far,s+r[3])}class I{constructor(){this._items=new i({allocator:e=>e||{obj:null,distance:0,near:0,far:0},deallocator:e=>(e.obj=null,e.distance=0,e.near=0,e.far=0,e)})}get length(){return this._items.length}get empty(){return 0===this._items.length}clear(){this._items.clear()}add(e){this._items.pushNew().obj=e}sort(e){const t=e.eye,r=e.viewForward;this._items.forAll((e=>{const i=e.obj.boundingVolumeWorldSpace.bounds,n=(i[0]-t[0])*r[0]+(i[1]-t[1])*r[1]+(i[2]-t[2])*r[2];e.distance=n,e.near=n-i[3],e.far=n+i[3]})),this._items.sort(((e,t)=>e.distance-t.distance))}forEachInDepthRange(e,t,r){if(t===b.DepthOrder.FRONT_TO_BACK)for(let i=0;i<this._items.length;++i){const t=this._items.data[i];t.far<e.near||t.near>e.far||r(t.obj,t.near,t.far)}else for(let i=this._items.length-1;i>=0;--i){const t=this._items.data[i];t.far<e.near||t.near>e.far||r(t.obj,t.near,t.far)}}}class P{constructor(){this._view=a(),this._viewProj=a(),this._frustum=c(),this._geometries=[],this._near=[],this._far=[],this._nearCandidates=[],this._farCandidates=[],this._range={near:0,far:0},this._looseRange={near:0,far:0}}compute(e,t){this._reset(),s(this._view,e.viewMatrix),n(this._viewProj,e.projectionMatrix,this._view),l(this._frustum,e.frustum);const r=this._view,i=r[2],a=r[6],o=r[10],h=r[14],f=this._range;let _=0;if(t.forEach((e=>{if(!e.instanceParameters.visible)return;if(!e.castShadow)return;let t;e.hasShaderTransformation?(e.computeBoundingSphere(e.getShaderTransformation(),V,1),t=V):t=e.boundingSphere;const r=i*t[0]+a*t[1]+o*t[2]+h,n=r-t[3],s=r+t[3];this._geometries[_]=e,this._near[_]=-s,this._far[_]=-n,++_})),0===this._geometries.length)return f;for(let n=0;n<this._geometries.length;++n)this._near[n]>f.far&&(f.far=this._near[n]),this._near[n]>2&&this._far[n]<f.near&&(f.near=this._far[n]);const c=this._looseRange;c.near=Math.max(.5*f.near,2),c.far=2*f.far;let u=0,d=0;for(let n=0;n<this._geometries.length;++n)this._near[n]<f.near&&(this._near[n]>=c.near?f.near=this._near[n]:this._nearCandidates[u++]=n),this._far[n]>f.far&&(this._far[n]<=c.far?f.far=this._far[n]:this._farCandidates[d++]=n);if(0===this._nearCandidates.length&&0===this._farCandidates.length)return f;this._nearCandidates.sort(((e,t)=>this._near[e]<this._near[t]?-1:this._near[e]>this._near[t]?1:0)),this._farCandidates.sort(((e,t)=>this._far[e]<this._far[t]?1:this._far[e]>this._far[t]?-1:0));for(let n=0;n<this._nearCandidates.length;++n){const e=this._nearCandidates[n];if(this._near[e]<f.near){const t=this._geometries[e],r=t.boundingInfo;this._includeNearBoundingInfoRec(r,t.getShaderTransformation())}}for(let n=0;n<this._farCandidates.length;++n){const e=this._farCandidates[n];if(this._far[e]>f.far){const t=this._geometries[e],r=t.boundingInfo;this._includeFarBoundingInfoRec(r,t.getShaderTransformation())}}return f}_reset(){this._geometries.length=0,this._near.length=0,this._far.length=0,this._nearCandidates.length=0,this._farCandidates.length=0,this._range.near=Number.MAX_VALUE,this._range.far=-Number.MAX_VALUE}_includeNearBoundingInfoRec(e,t){if(r(e))return;const i=e.getCenter();o(V,i,t);const n=d(t),s=V[0],a=V[1],h=V[2],f=e.getBSRadius()*n,_=this._frustum;if(_[0][0]*s+_[0][1]*a+_[0][2]*h+_[0][3]>f||_[1][0]*s+_[1][1]*a+_[1][2]*h+_[1][3]>f||_[2][0]*s+_[2][1]*a+_[2][2]*h+_[2][3]>f||_[3][0]*s+_[3][1]*a+_[3][2]*h+_[3][3]>f)return;const c=this._view[2]*s+this._view[6]*a+this._view[10]*h+this._view[14],l=c+f;if(!(-(c-f)<2||-l>=this._range.near))if(-l>this._looseRange.near)this._range.near=-l;else{if(f>B){const r=e.getChildren();if(void 0!==r){for(let e=0;e<8;++e)void 0!==r[e]&&this._includeNearBoundingInfoRec(r[e],t);return}}U.unionDepthRangeWithAABB(this._range,this._viewProj,t,e.getBBMin(),e.getBBMax())}}_includeFarBoundingInfoRec(e,t){if(r(e))return;let i=e.getBSRadius();const n=e.getCenter();o(V,n,t);const s=d(t),a=V[0],h=V[1],f=V[2];i*=s;const _=this._frustum;if(_[0][0]*a+_[0][1]*h+_[0][2]*f+_[0][3]>i||_[1][0]*a+_[1][1]*h+_[1][2]*f+_[1][3]>i||_[2][0]*a+_[2][1]*h+_[2][2]*f+_[2][3]>i||_[3][0]*a+_[3][1]*h+_[3][2]*f+_[3][3]>i)return;const c=this._view[2]*a+this._view[6]*h+this._view[10]*f+this._view[14]-i;if(!(-c<=this._range.far))if(-c<this._looseRange.far)this._range.far=-c;else{if(i>B){const r=e.getChildren();if(void 0!==r){for(let e=0;e<8;++e)void 0!==r[e]&&this._includeFarBoundingInfoRec(r[e],t);return}}U.unionDepthRangeWithAABB(this._range,this._viewProj,t,e.getBBMin(),e.getBBMax())}}}class x{constructor(){this._modelViewProj=a(),this._clipPosition=[f(),f(),f(),f(),f(),f(),f(),f()]}unionDepthRangeWithAABB(e,t,r,i,s){const a=this._modelViewProj;n(a,t,r);let o=!1;for(let n=0;n<8;++n){const e=this._clipPosition[n],t=0===n||3===n||4===n||7===n?i[0]:s[0],r=0===n||1===n||4===n||5===n?i[1]:s[1],o=n<4?i[2]:s[2];e[0]=a[0]*t+a[4]*r+a[8]*o+a[12],e[1]=a[1]*t+a[5]*r+a[9]*o+a[13],e[2]=a[2]*t+a[6]*r+a[10]*o+a[14],e[3]=a[3]*t+a[7]*r+a[11]*o+a[15]}for(let n=0;n<12;++n){const t=this._clipPosition[N[n][0]],r=this._clipPosition[N[n][1]],i=this._clipPosition[N[n][2]],s=this._clipTriangle(t,r,i);let a=!0;for(let e=0;e<s.length;++e){if(s[e][3]>=2){a=!1;break}}if(!a){o=!0;for(let t=0;t<s.length;++t){const r=s[t][3];r<e.near&&(e.near=r),r>e.far&&(e.far=r)}}}return o}_inside(e,t){return 0===t?e[0]>=-e[3]:1===t?e[1]>=-e[3]:2===t?e[0]<=e[3]:3===t?e[1]<=e[3]:void w(!1)}_intersect(e,t,r){let i=0;return 0===r?i=(-e[3]-e[0])/(t[0]-e[0]+t[3]-e[3]):1===r?i=(-e[3]-e[1])/(t[1]-e[1]+t[3]-e[3]):2===r?i=(e[3]-e[0])/(t[0]-e[0]-t[3]+e[3]):3===r&&(i=(e[3]-e[1])/(t[1]-e[1]-t[3]+e[3])),h(f(),e,t,i)}_clipTriangle(e,t,r){let i=[e,t,r];for(let n=0;n<4;++n){const e=i;i=[];for(let t=0;t<e.length;++t){const r=e[t],s=e[(t+1)%e.length];this._inside(s,n)?(this._inside(r,n)||i.push(this._intersect(r,s,n)),i.push(s)):this._inside(r,n)&&i.push(this._intersect(r,s,n))}}return i}}const N=[[0,1,3],[2,3,1],[1,5,2],[6,2,5],[5,4,6],[7,6,4],[4,0,7],[3,7,0],[3,2,7],[6,7,2],[4,5,0],[1,0,5]],V=u(),E=a(),W=g(),k=new I,K=new P,U=new x;export{P as DepthRangeFromRenderGeometries,O as depthRangeFromLayer,M as depthRangeFromScene,A as textureToDepth};
5
+ import{unpackFloatRGBA as e}from"../../../../core/floatRGBA.js";import{isSome as t,isNone as r}from"../../../../core/maybe.js";import i from"../../../../core/PooledArray.js";import{m as n,c as s}from"../../../../chunks/mat4.js";import{c as a}from"../../../../chunks/mat4f64.js";import{v as o}from"../../../../chunks/vec3.js";import{l as h}from"../../../../chunks/vec4.js";import{c as f}from"../../../../chunks/vec4f64.js";import{intersectsSphere as _,create as c,copy as l}from"../../../../geometry/support/frustum.js";import{c as u}from"../../../../chunks/sphere.js";import{maxScale as d}from"../../support/mathUtils.js";import{empty as g,union as m,set as p}from"./depthRange.js";import b from"./Octree.js";import{assert as w}from"./Util.js";const R=1e4,B=100,v=500,j=500,C=.1;function A(t,r,i){return e(r,t)*(i[1]-i[0])+i[0]}function M(e,t,r){if(t.size<R)return K.compute(e,t);const i=g();return r.forAll((t=>{t.isVisible&&m(i,O(e,t))})),i}function O(e,r){if(!r.isVisible)return;const i=g(),n=r.getSpatialQueryAccelerator();return t(n)?T(i,e,n):D(i,e,r.objects),i}function T(e,t,r){const i=t.eye,n=t.viewForward,s=t.frustum,a=e=>e.isVisible,o=r.objectCount;if(o<v)p(W,t.near,Math.min(e.near,t.far)),r.forEachInDepthRange(i,n,b.DepthOrder.FRONT_TO_BACK,W,((r,i)=>{S(e,t,r),W.far=e.near,i.setRange(W)}),s,a),p(W,Math.max(e.far,t.near),t.far),r.forEachInDepthRange(i,n,b.DepthOrder.BACK_TO_FRONT,W,((r,i)=>{S(e,t,r),W.near=e.far,i.setRange(W)}),s,a);else{const i=Math.max(Math.min(o,j),Math.ceil(o*C)),h=r.findClosest(n,b.DepthOrder.FRONT_TO_BACK,s,a,i),f=r.findClosest(n,b.DepthOrder.BACK_TO_FRONT,s,a,i);h&&f&&(F(e,t,h.boundingVolumeWorldSpace.bounds),F(e,t,f.boundingVolumeWorldSpace.bounds))}}function D(e,t,r){k.clear(),r.forAll((e=>{e.isVisible&&0!==e.geometryRecords.length&&k.add(e)})),k.empty||(k.sort(t),p(W,t.near,Math.min(e.near,t.far)),k.forEachInDepthRange(W,b.DepthOrder.FRONT_TO_BACK,((r,i)=>{i<e.near&&S(e,t,r)})),p(W,Math.max(e.far,t.near),t.far),k.forEachInDepthRange(W,b.DepthOrder.BACK_TO_FRONT,((t,r,i)=>{e.far=Math.max(e.far,i)})))}function S(e,t,r){if(!r.isVisible)return;if(!_(t.frustum,r.boundingVolumeWorldSpace.bounds))return;const i=r.transformation,s=E;r.geometryRecords.forEach((r=>{n(s,i,r.getShaderTransformation());const a=d(s);y(e,t,r.geometry.boundingInfo,s,a)}))}function y(e,t,i,n,s){if(r(i))return;const a=t.eye,h=t.viewForward;o(V,i.center,n);const f=h[0]*(V[0]-a[0])+h[1]*(V[1]-a[1])+h[2]*(V[2]-a[2]);if(V[3]=i.radius*s,!(f-V[3]>e.near&&f+V[3]<e.far)&&_(t.frustum,V))if(i.radius>B&&i.getChildren()){const r=i.getChildren();for(let i=0;i<8;++i)r[i]&&y(e,t,r[i],n,s)}else U.unionDepthRangeWithAABB(e,t.viewProjectionMatrix,n,i.bbMin,i.bbMax)}function F(e,t,r){const i=t.eye,n=t.viewForward,s=(r[0]-i[0])*n[0]+(r[1]-i[1])*n[1]+(r[2]-i[2])*n[2];e.near=Math.min(e.near,s-r[3]),e.far=Math.max(e.far,s+r[3])}class I{constructor(){this._items=new i({allocator:e=>e||{obj:null,distance:0,near:0,far:0},deallocator:e=>(e.obj=null,e.distance=0,e.near=0,e.far=0,e)})}get length(){return this._items.length}get empty(){return 0===this._items.length}clear(){this._items.clear()}add(e){this._items.pushNew().obj=e}sort(e){const t=e.eye,r=e.viewForward;this._items.forAll((e=>{const i=e.obj.boundingVolumeWorldSpace.bounds,n=(i[0]-t[0])*r[0]+(i[1]-t[1])*r[1]+(i[2]-t[2])*r[2];e.distance=n,e.near=n-i[3],e.far=n+i[3]})),this._items.sort(((e,t)=>e.distance-t.distance))}forEachInDepthRange(e,t,r){if(t===b.DepthOrder.FRONT_TO_BACK)for(let i=0;i<this._items.length;++i){const t=this._items.data[i];t.far<e.near||t.near>e.far||r(t.obj,t.near,t.far)}else for(let i=this._items.length-1;i>=0;--i){const t=this._items.data[i];t.far<e.near||t.near>e.far||r(t.obj,t.near,t.far)}}}class P{constructor(){this._view=a(),this._viewProj=a(),this._frustum=c(),this._geometries=[],this._near=[],this._far=[],this._nearCandidates=[],this._farCandidates=[],this._range={near:0,far:0},this._looseRange={near:0,far:0}}compute(e,t){this._reset(),s(this._view,e.viewMatrix),n(this._viewProj,e.projectionMatrix,this._view),l(this._frustum,e.frustum);const r=this._view,i=r[2],a=r[6],o=r[10],h=r[14],f=this._range;let _=0;if(t.forEach((e=>{if(!e.instanceParameters.visible)return;if(!e.castShadow)return;let t;e.hasShaderTransformation?(e.computeBoundingSphere(e.getShaderTransformation(),V,1),t=V):t=e.boundingSphere;const r=i*t[0]+a*t[1]+o*t[2]+h,n=r-t[3],s=r+t[3];this._geometries[_]=e,this._near[_]=-s,this._far[_]=-n,++_})),0===this._geometries.length)return f;for(let n=0;n<this._geometries.length;++n)this._near[n]>f.far&&(f.far=this._near[n]),this._near[n]>2&&this._far[n]<f.near&&(f.near=this._far[n]);const c=this._looseRange;c.near=Math.max(.5*f.near,2),c.far=2*f.far;let u=0,d=0;for(let n=0;n<this._geometries.length;++n)this._near[n]<f.near&&(this._near[n]>=c.near?f.near=this._near[n]:this._nearCandidates[u++]=n),this._far[n]>f.far&&(this._far[n]<=c.far?f.far=this._far[n]:this._farCandidates[d++]=n);if(0===this._nearCandidates.length&&0===this._farCandidates.length)return f;this._nearCandidates.sort(((e,t)=>this._near[e]<this._near[t]?-1:this._near[e]>this._near[t]?1:0)),this._farCandidates.sort(((e,t)=>this._far[e]<this._far[t]?1:this._far[e]>this._far[t]?-1:0));for(let n=0;n<this._nearCandidates.length;++n){const e=this._nearCandidates[n];if(this._near[e]<f.near){const t=this._geometries[e],r=t.boundingInfo;this._includeNearBoundingInfoRec(r,t.getShaderTransformation())}}for(let n=0;n<this._farCandidates.length;++n){const e=this._farCandidates[n];if(this._far[e]>f.far){const t=this._geometries[e],r=t.boundingInfo;this._includeFarBoundingInfoRec(r,t.getShaderTransformation())}}return f}_reset(){this._geometries.length=0,this._near.length=0,this._far.length=0,this._nearCandidates.length=0,this._farCandidates.length=0,this._range.near=Number.MAX_VALUE,this._range.far=-Number.MAX_VALUE}_includeNearBoundingInfoRec(e,t){if(r(e))return;const i=e.getCenter();o(V,i,t);const n=d(t),s=V[0],a=V[1],h=V[2],f=e.getBSRadius()*n,_=this._frustum;if(_[0][0]*s+_[0][1]*a+_[0][2]*h+_[0][3]>f||_[1][0]*s+_[1][1]*a+_[1][2]*h+_[1][3]>f||_[2][0]*s+_[2][1]*a+_[2][2]*h+_[2][3]>f||_[3][0]*s+_[3][1]*a+_[3][2]*h+_[3][3]>f)return;const c=this._view[2]*s+this._view[6]*a+this._view[10]*h+this._view[14],l=c+f;if(!(-(c-f)<2||-l>=this._range.near))if(-l>this._looseRange.near)this._range.near=-l;else{if(f>B){const r=e.getChildren();if(void 0!==r){for(let e=0;e<8;++e)void 0!==r[e]&&this._includeNearBoundingInfoRec(r[e],t);return}}U.unionDepthRangeWithAABB(this._range,this._viewProj,t,e.getBBMin(),e.getBBMax())}}_includeFarBoundingInfoRec(e,t){if(r(e))return;let i=e.getBSRadius();const n=e.getCenter();o(V,n,t);const s=d(t),a=V[0],h=V[1],f=V[2];i*=s;const _=this._frustum;if(_[0][0]*a+_[0][1]*h+_[0][2]*f+_[0][3]>i||_[1][0]*a+_[1][1]*h+_[1][2]*f+_[1][3]>i||_[2][0]*a+_[2][1]*h+_[2][2]*f+_[2][3]>i||_[3][0]*a+_[3][1]*h+_[3][2]*f+_[3][3]>i)return;const c=this._view[2]*a+this._view[6]*h+this._view[10]*f+this._view[14]-i;if(!(-c<=this._range.far))if(-c<this._looseRange.far)this._range.far=-c;else{if(i>B){const r=e.getChildren();if(void 0!==r){for(let e=0;e<8;++e)void 0!==r[e]&&this._includeFarBoundingInfoRec(r[e],t);return}}U.unionDepthRangeWithAABB(this._range,this._viewProj,t,e.getBBMin(),e.getBBMax())}}}class x{constructor(){this._modelViewProj=a(),this._clipPosition=[f(),f(),f(),f(),f(),f(),f(),f()]}unionDepthRangeWithAABB(e,t,r,i,s){const a=this._modelViewProj;n(a,t,r);let o=!1;for(let n=0;n<8;++n){const e=this._clipPosition[n],t=0===n||3===n||4===n||7===n?i[0]:s[0],r=0===n||1===n||4===n||5===n?i[1]:s[1],o=n<4?i[2]:s[2];e[0]=a[0]*t+a[4]*r+a[8]*o+a[12],e[1]=a[1]*t+a[5]*r+a[9]*o+a[13],e[2]=a[2]*t+a[6]*r+a[10]*o+a[14],e[3]=a[3]*t+a[7]*r+a[11]*o+a[15]}for(let n=0;n<12;++n){const t=this._clipPosition[N[n][0]],r=this._clipPosition[N[n][1]],i=this._clipPosition[N[n][2]],s=this._clipTriangle(t,r,i);let a=!0;for(let e=0;e<s.length;++e){if(s[e][3]>=2){a=!1;break}}if(!a){o=!0;for(let t=0;t<s.length;++t){const r=s[t][3];r<e.near&&(e.near=r),r>e.far&&(e.far=r)}}}return o}_inside(e,t){return 0===t?e[0]>=-e[3]:1===t?e[1]>=-e[3]:2===t?e[0]<=e[3]:3===t?e[1]<=e[3]:void w(!1)}_intersect(e,t,r){let i=0;return 0===r?i=(-e[3]-e[0])/(t[0]-e[0]+t[3]-e[3]):1===r?i=(-e[3]-e[1])/(t[1]-e[1]+t[3]-e[3]):2===r?i=(e[3]-e[0])/(t[0]-e[0]-t[3]+e[3]):3===r&&(i=(e[3]-e[1])/(t[1]-e[1]-t[3]+e[3])),h(f(),e,t,i)}_clipTriangle(e,t,r){let i=[e,t,r];for(let n=0;n<4;++n){const e=i;i=[];for(let t=0;t<e.length;++t){const r=e[t],s=e[(t+1)%e.length];this._inside(s,n)?(this._inside(r,n)||i.push(this._intersect(r,s,n)),i.push(s)):this._inside(r,n)&&i.push(this._intersect(r,s,n))}}return i}}const N=[[0,1,3],[2,3,1],[1,5,2],[6,2,5],[5,4,6],[7,6,4],[4,0,7],[3,7,0],[3,2,7],[6,7,2],[4,5,0],[1,0,5]],V=u(),E=a(),W=g(),k=new I,K=new P,U=new x;export{P as DepthRangeFromRenderGeometries,O as depthRangeFromLayer,M as depthRangeFromScene,A as textureToDepth};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{releaseMaybe as e}from"../../../../../core/maybe.js";import r from"../../../../../core/PooledArray.js";import{t,c as i}from"../../../../../chunks/mat3.js";import{c as s}from"../../../../../chunks/mat3f32.js";import{s as n}from"../../../../../chunks/vec3.js";import a from"../../../support/debugFlags.js";import{doublePrecisionRequiresObfuscation as o}from"../../core/shaderLibrary/util/DoublePrecision.glsl.js";import{TwoVectorPosition as d}from"../../core/util/TwoVectorPosition.js";import{EdgeDrawParameters as h}from"./EdgeShaderParameters.js";import{EdgeShaderTechnique as l}from"./EdgeShaderTechnique.js";import{EdgeShaderTechniqueConfiguration as c}from"./EdgeShaderTechniqueConfiguration.js";import{Transparency as u}from"./interfaces.js";import{EdgeUtilMode as _}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{PrimitiveType as m}from"../../../../webgl/enums.js";const g=8,f=128,b={type:"uber",hasSlicePlane:!1,strokesTexture:null,legacy:!0,spherical:!0},T={solid:_.SOLID,sketch:_.SKETCH,uber:_.MIXED};class R{constructor(e,t,i){this._rctx=e,this._shaderTechniqueRepository=t,this._configuration=new c,this.refCount=0,this._renderables=new Set,this._sortedRenderables={[u.TRANSPARENT]:{[u.TRANSPARENT]:new r,[u.OPAQUE]:new r},[u.OPAQUE]:{[u.TRANSPARENT]:new r,[u.OPAQUE]:new r}},this._renderablesDirty=!1,this._drawParameters=new h,this._settings={...b,...i},this.key=R.getKey(this._settings.type,this._settings.hasSlicePlane,this._settings.legacy);const s=this._settings.strokesTexture.variants;this.writerSettings={variants:s,reducedPrecision:a.TESTS_DISABLE_OPTIMIZATIONS},this._configuration.legacy=this._settings.legacy,this._configuration.mode=T[this._settings.type],this._configuration.silhouette=!1,this._configuration.antialiasing=!!this._rctx.capabilities.blendMinMax,this._configuration.hasSlicePlane=this._settings.hasSlicePlane,this._configuration.doublePrecisionRequiresObfuscation=o(e),this._configuration.spherical=i.spherical}dispose(){this._technique=e(this._technique)}addRenderable(e){this._renderables.add(e),this._renderablesDirty=!0}removeRenderable(e){this._renderables.delete(e),this._renderablesDirty=!0}setRenderablesDirty(){this._renderablesDirty=!0}forEachRenderable(e,r){this._renderablesDirty&&this._sortRenderables(),this._sortedRenderables[r][u.TRANSPARENT].forAll(e),this._sortedRenderables[r][u.OPAQUE].forAll(e)}updateTechnique(e,r){return this._configuration.hasMultipassTerrain=!!e.multipassTerrain.enabled,this._configuration.cullAboveGround=!!e.multipassTerrain.cullAboveGround,this._configuration.silhouette=r,this._technique=this._shaderTechniqueRepository.releaseAndAcquire(l,this._configuration,this._technique),this._technique}bindRegularEdges(e,r){return this._lastOriginId=null,this._rctx.bindTechnique(this.updateTechnique(r,!1),e,r)}bindSilhouetteEdges(e,r){return this._lastOriginId=null,this._rctx.bindTechnique(this.updateTechnique(r,!0),e,r)}renderRegularEdges(e,r,t,i,s){this._render(e,r,r.regular.vao,t,i,s)}renderSilhouetteEdges(e,r,t,i,s){this._render(e,r,r.silhouette.vao,t,i,s)}_render(e,r,t,i,s,n){n>0&&(this._bindDraw(e,r,i,s),this._rctx.bindVAO(t),this._rctx.capabilities.instancing.drawArraysInstanced(m.TRIANGLE_FAN,0,4,n))}_bindDraw(e,r,s,a){if(this._drawParameters.componentDataTexture=r.components.buffer.textureBuffer.texture,this._drawParameters.strokesTexture=this._settings.strokesTexture,"origin"in r.transform)this._lastOriginId!==r.transform.origin.origin.id&&(e.setUniformMatrix4fv("localView",r.transform.origin.viewMatrix),this._lastOriginId=r.transform.origin.origin.id),e.setUniformMatrix4fv("model",r.transform.modelMatrix),this._drawParameters.slicePlaneLocalOrigin=r.transform.origin.origin.vec3;else{const e=new d(r.transform.position),s=t(A,i(A,r.transform.rotationScale));this._drawParameters.transformWorldFromModelTL=e.low,this._drawParameters.transformWorldFromModelTH=e.high,this._drawParameters.transformWorldFromModelRS=r.transform.rotationScale,this._drawParameters.transformNormalGlobalFromModel=s;const o=a.camera.viewInverseTransposeMatrix;n(this._drawParameters.slicePlaneLocalOrigin,o[3],o[7],o[11])}e.bindDraw(this._drawParameters,a,s)}_sortRenderables(){this._renderablesDirty=!1,this._sortedRenderables[u.TRANSPARENT][u.TRANSPARENT].clear(),this._sortedRenderables[u.TRANSPARENT][u.OPAQUE].clear(),this._sortedRenderables[u.OPAQUE][u.TRANSPARENT].clear(),this._sortedRenderables[u.OPAQUE][u.OPAQUE].clear(),this._renderables.forEach((e=>{e.objectTransparency!==u.INVISIBLE&&e.edgeTransparency!==u.INVISIBLE&&this._sortedRenderables[e.objectTransparency][e.edgeTransparency].push(e)}));const e=(e,r)=>"origin"in e.transform?"origin"in r.transform?e.transform.origin.origin.id<r.transform.origin.origin.id?-1:e.transform.origin.origin.id>r.transform.origin.origin.id?1:0:1:0;this._sortedRenderables[u.TRANSPARENT][u.TRANSPARENT].sort(e),this._sortedRenderables[u.TRANSPARENT][u.OPAQUE].sort(e),this._sortedRenderables[u.OPAQUE][u.TRANSPARENT].sort(e),this._sortedRenderables[u.OPAQUE][u.OPAQUE].sort(e)}static getKey(e,r,t){return`edges-t:${e}:${r}:${t}`}}const A=s();export{f as EXTENSION_LENGTH_OFFSET,R as EdgeRenderer,g as LINE_WIDTH_FRACTION_FACTOR};
5
+ import{releaseMaybe as e}from"../../../../../core/maybe.js";import r from"../../../../../core/PooledArray.js";import{t,e as i}from"../../../../../chunks/mat3.js";import{c as s}from"../../../../../chunks/mat3f32.js";import{s as n}from"../../../../../chunks/vec3.js";import a from"../../../support/debugFlags.js";import{doublePrecisionRequiresObfuscation as o}from"../../core/shaderLibrary/util/DoublePrecision.glsl.js";import{TwoVectorPosition as d}from"../../core/util/TwoVectorPosition.js";import{EdgeDrawParameters as h}from"./EdgeShaderParameters.js";import{EdgeShaderTechnique as l}from"./EdgeShaderTechnique.js";import{EdgeShaderTechniqueConfiguration as c}from"./EdgeShaderTechniqueConfiguration.js";import{Transparency as u}from"./interfaces.js";import{EdgeUtilMode as _}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{PrimitiveType as m}from"../../../../webgl/enums.js";const g=8,f=128,b={type:"uber",hasSlicePlane:!1,strokesTexture:null,legacy:!0,spherical:!0},T={solid:_.SOLID,sketch:_.SKETCH,uber:_.MIXED};class R{constructor(e,t,i){this._rctx=e,this._shaderTechniqueRepository=t,this._configuration=new c,this.refCount=0,this._renderables=new Set,this._sortedRenderables={[u.TRANSPARENT]:{[u.TRANSPARENT]:new r,[u.OPAQUE]:new r},[u.OPAQUE]:{[u.TRANSPARENT]:new r,[u.OPAQUE]:new r}},this._renderablesDirty=!1,this._drawParameters=new h,this._settings={...b,...i},this.key=R.getKey(this._settings.type,this._settings.hasSlicePlane,this._settings.legacy);const s=this._settings.strokesTexture.variants;this.writerSettings={variants:s,reducedPrecision:a.TESTS_DISABLE_OPTIMIZATIONS},this._configuration.legacy=this._settings.legacy,this._configuration.mode=T[this._settings.type],this._configuration.silhouette=!1,this._configuration.antialiasing=!!this._rctx.capabilities.blendMinMax,this._configuration.hasSlicePlane=this._settings.hasSlicePlane,this._configuration.doublePrecisionRequiresObfuscation=o(e),this._configuration.spherical=i.spherical}dispose(){this._technique=e(this._technique)}addRenderable(e){this._renderables.add(e),this._renderablesDirty=!0}removeRenderable(e){this._renderables.delete(e),this._renderablesDirty=!0}setRenderablesDirty(){this._renderablesDirty=!0}forEachRenderable(e,r){this._renderablesDirty&&this._sortRenderables(),this._sortedRenderables[r][u.TRANSPARENT].forAll(e),this._sortedRenderables[r][u.OPAQUE].forAll(e)}updateTechnique(e,r){return this._configuration.hasMultipassTerrain=!!e.multipassTerrain.enabled,this._configuration.cullAboveGround=!!e.multipassTerrain.cullAboveGround,this._configuration.silhouette=r,this._technique=this._shaderTechniqueRepository.releaseAndAcquire(l,this._configuration,this._technique),this._technique}bindRegularEdges(e,r){return this._lastOriginId=null,this._rctx.bindTechnique(this.updateTechnique(r,!1),e,r)}bindSilhouetteEdges(e,r){return this._lastOriginId=null,this._rctx.bindTechnique(this.updateTechnique(r,!0),e,r)}renderRegularEdges(e,r,t,i,s){this._render(e,r,r.regular.vao,t,i,s)}renderSilhouetteEdges(e,r,t,i,s){this._render(e,r,r.silhouette.vao,t,i,s)}_render(e,r,t,i,s,n){n>0&&(this._bindDraw(e,r,i,s),this._rctx.bindVAO(t),this._rctx.capabilities.instancing.drawArraysInstanced(m.TRIANGLE_FAN,0,4,n))}_bindDraw(e,r,s,a){if(this._drawParameters.componentDataTexture=r.components.buffer.textureBuffer.texture,this._drawParameters.strokesTexture=this._settings.strokesTexture,"origin"in r.transform)this._lastOriginId!==r.transform.origin.origin.id&&(e.setUniformMatrix4fv("localView",r.transform.origin.viewMatrix),this._lastOriginId=r.transform.origin.origin.id),e.setUniformMatrix4fv("model",r.transform.modelMatrix),this._drawParameters.slicePlaneLocalOrigin=r.transform.origin.origin.vec3;else{const e=new d(r.transform.position),s=t(A,i(A,r.transform.rotationScale));this._drawParameters.transformWorldFromModelTL=e.low,this._drawParameters.transformWorldFromModelTH=e.high,this._drawParameters.transformWorldFromModelRS=r.transform.rotationScale,this._drawParameters.transformNormalGlobalFromModel=s;const o=a.camera.viewInverseTransposeMatrix;n(this._drawParameters.slicePlaneLocalOrigin,o[3],o[7],o[11])}e.bindDraw(this._drawParameters,a,s)}_sortRenderables(){this._renderablesDirty=!1,this._sortedRenderables[u.TRANSPARENT][u.TRANSPARENT].clear(),this._sortedRenderables[u.TRANSPARENT][u.OPAQUE].clear(),this._sortedRenderables[u.OPAQUE][u.TRANSPARENT].clear(),this._sortedRenderables[u.OPAQUE][u.OPAQUE].clear(),this._renderables.forEach((e=>{e.objectTransparency!==u.INVISIBLE&&e.edgeTransparency!==u.INVISIBLE&&this._sortedRenderables[e.objectTransparency][e.edgeTransparency].push(e)}));const e=(e,r)=>"origin"in e.transform?"origin"in r.transform?e.transform.origin.origin.id<r.transform.origin.origin.id?-1:e.transform.origin.origin.id>r.transform.origin.origin.id?1:0:1:0;this._sortedRenderables[u.TRANSPARENT][u.TRANSPARENT].sort(e),this._sortedRenderables[u.TRANSPARENT][u.OPAQUE].sort(e),this._sortedRenderables[u.OPAQUE][u.TRANSPARENT].sort(e),this._sortedRenderables[u.OPAQUE][u.OPAQUE].sort(e)}static getKey(e,r,t){return`edges-t:${e}:${r}:${t}`}}const A=s();export{f as EXTENSION_LENGTH_OFFSET,R as EdgeRenderer,g as LINE_WIDTH_FRACTION_FACTOR};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as r,binaryIndexOf as s}from"../../../../../core/arrayUtils.js";import o from"../../../../../core/Logger.js";import{clamp as n}from"../../../../../core/mathUtils.js";import{disposeMaybe as i,destroyMaybe as a,isNone as c,isSome as d}from"../../../../../core/maybe.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as u,t as m,c as g}from"../../../../../chunks/mat3.js";import{c as p}from"../../../../../chunks/mat3f64.js";import{c as f}from"../../../../../chunks/mat4f64.js";import{s as _,c as b,y,e as j}from"../../../../../chunks/vec3.js";import{c as O}from"../../../../../chunks/vec3f64.js";import{WatchUpdatingTracking as w}from"../../../../../core/support/WatchUpdatingTracking.js";import{g as v,a as x}from"../../../../../chunks/sphere.js";import{c as R}from"../../../../../chunks/vec33.js";import{ViewingMode as E}from"../../../../ViewingMode.js";import{encodeElevationOffset as T}from"../../collections/Component/Material/shader/ComponentData.glsl.js";import{TwoVectorPosition as C}from"../../core/util/TwoVectorPosition.js";import{GridLocalOriginFactory as M}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as D}from"../localOriginHelper.js";import{LocalOriginManager as P}from"../LocalOriginManager.js";import{Object3D as S}from"../Object3D.js";import{VertexArrayObject as A}from"../VertexArrayObject.js";import{VertexAttribute as B}from"../VertexAttribute.js";import{VertexLayout as k,EdgeShaderAttributeLocations as I,glVertexLayout as U,EdgeInputBufferLayout as L}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as V,SilhouetteEdgeBufferWriter as H}from"./edgeBufferWriters.js";import{EdgeType as N}from"./edgePreprocessing.js";import{EdgeRenderer as z,LINE_WIDTH_FRACTION_FACTOR as W,EXTENSION_LENGTH_OFFSET as q}from"./EdgeRenderer.js";import{EdgePassParameters as G}from"./EdgeShaderParameters.js";import{EdgeWorkerHandle as K}from"./EdgeWorkerHandle.js";import{Transparency as F}from"./interfaces.js";import{generateStrokesTexture as Q}from"./strokes.js";import{determineRendererType as J,determineEdgeTransparency as X,determineObjectTransparency as Y,fillComponenBufferIndices as Z}from"./util.js";import{BufferManager as $}from"../TextureBackedBuffer/BufferManager.js";import{BufferObject as ee}from"../../../../webgl/BufferObject.js";import{Usage as te}from"../../../../webgl/enums.js";let re=class extends t{constructor(e){super(e),this._updatingHandles=new w,this._perObjectData=new Map,this._perObjectDataEvictionCache=new Set,this._renderers=new Map,this._gpuMemoryUsage=0,this._workerAbort=new AbortController,this._tmpModelPosition=O(),this._localOrigins=new P(new M(e.renderSR))}initialize(){this._worker=new K(this.schedule),this._componentColorManager=new $(this.rctx,3);const e=k.createBuffer(4);for(let t=0;t<4;t++)e.sideness.set(t,0,0===t||3===t?0:1),e.sideness.set(t,1,0===t||1===t?0:1);this._verticesBufferObject=ee.createVertex(this.rctx,te.STATIC_DRAW,e.buffer)}destroy(){this.destroyed||(this._perObjectData.forEach((e=>this._discardObjectEntry(e))),this._perObjectData.clear(),this._strokesTexture=i(this._strokesTexture),this._componentColorManager=a(this._componentColorManager),this._workerAbort.abort(),this._worker.destroy(),this._verticesBufferObject=i(this._verticesBufferObject),this._renderers.clear(),this._updatingHandles.destroy())}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(e,t,r,s,o,n,i,a){if(this.hasObject(e))return this.getObjectMemoryUsage(e);let c;const d=new ne(new Promise((e=>c=e)),r.center,r.radius);this._perObjectData.set(e,d);const l=await this._updatingHandles.addPromise(this._addComponentGeometry(t,d,s,o,n,i,a));return this.setNeedsRender(),c(),l}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void o.getLogger(this.declaredClass).warn("Attempt to add an object to a destroyed instance");const n=this._perObjectData.get(e);let i;n?.renderables.length>0&&this._perObjectDataEvictionCache.add(n);const a=e.boundingVolumeWorldSpace.bounds,c=new ne(new Promise((e=>i=e)),v(a),x(a));this._perObjectData.set(e,c);const d=new Array;if(r.mergeGeometries&&e.geometries.length>1&&oe(e))d.push(this._addObjectMergedGeometries(e,c,t,r,s));else for(let o=0;o<e.geometries.length;o++){const n=e.geometryRecords[o];if(!n.material.supportsEdges)continue;const i=e.geometries[o];d.push(this._addGeometry(e,c,i,n,t[0],r,s))}await this._updatingHandles.addPromise(Promise.all(d)),this._perObjectDataEvictionCache.delete(c),this._discardObjectEntry(n),this.setNeedsRender(),i()}_discardObjectEntry(e){e&&(e.renderables.length&&(e.renderables.forEach((e=>this._removeRenderable(e))),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this._perObjectData.has(e)}async updateAllComponentOpacities(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));if(c(r))return;const s=t instanceof Array?e=>t[e]:()=>t;r.renderables.forEach((e=>{const t=e.components.meta.length;for(let r=0;r<t;r++){const t=s(r),o=e.components.meta[r],n=o.index;o.material.opacity=t,e.components.buffer.textureBuffer.setDataElement(n,1,3,255*t)}this._updateTransparency(e)})),this.setNeedsRender()}async getObjectMemoryUsage(e){const t=await this._getObjectEntry(e);return d(t)?t.renderables.reduce(((e,t)=>e+t.statistics.gpuMemoryUsage),0):0}async updateAllComponentMaterials(e,t,r,s){const o=e instanceof S,n=!!r.hasSlicePlane,i=J(t),a=z.getKey(i,n,o),d=await this._updatingHandles.addPromise(this._getObjectEntry(e));c(d)||(d.renderables.forEach((e=>{if(a!==e.rendererKey){const t=this._renderers.get(e.rendererKey),r=this._acquireRenderer(i,n,o);t.removeRenderable(e),--t.refCount,e.rendererKey=a,r.addRenderable(e)}for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];s&&this._updateComponentBuffer(e.components),this._updateTransparency(e)})),this.setNeedsRender())}async updateAllVerticalOffsets(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));c(r)||(r.renderables.forEach((e=>{const r=e.components.meta;for(let s=0;s<r.length;s++)e.components.meta[s].verticalOffset=t?.[s]??0;this._updateComponentBuffer(e.components)})),this.setNeedsRender())}async updateObjectVisibility(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));d(r)&&(r.renderables.forEach((e=>e.visible=t)),this.setNeedsRender())}removeObject(e){const t=this._perObjectData.get(e);t&&(this._perObjectData.delete(e),this._discardObjectEntry(t))}async _getObjectEntry(e){const t=this._perObjectData.get(e);if(!t)throw"no object";return await t.loaded,null==t.loaded?null:t}removeAll(){this._perObjectData.forEach(((e,t)=>this.removeObject(t)))}render(e,t){if(c(this._componentColorManager))return;this._localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=O(),o=new C;let n=0,i=0;if(this._renderers.forEach((r=>{if(0===r.refCount)this._renderers.delete(r.key),r.dispose();else{let s=!0,o=!0;r.forEachRenderable((t=>{t.visible&&(n+=t.statistics.averageEdgeLength,i++,s&&t.regular&&(r.updateTechnique(e,!1),s=!1),o&&t.silhouette&&(r.updateTechnique(e,!0),o=!1))}),t)}})),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),0===i)return;const a=new G(40*n/i,t);_(s,r[3],r[7],r[11]),o.set(s),b(a.transformWorldFromViewTH,o.high),b(a.transformWorldFromViewTL,o.low),u(a.transformViewFromCameraRelativeRS,e.camera.viewMatrix),m(fe,a.transformViewFromCameraRelativeRS),g(a.transformNormalViewFromGlobal,fe),a.transformProjFromView=e.camera.projectionMatrix,this._updateObjectCameraDistances(e),this._renderers.forEach((t=>{this._renderRegularEdges(t,e,a),this._renderSilhouetteEdges(t,e,a)}))}_updateTransparency(e){const t=X(e.components.meta),r=Y(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this._renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){e.getCombinedStaticTransformation(t,r);const s=d(t.origin)?this._localOrigins.register(t.origin):this._localOrigins.acquire(_(this._tmpModelPosition,r[12],r[13],r[14]));return t.origin=s.origin,D(s.origin.vec3,r),s}_updateComponentBuffer(e){const{meta:t,buffer:r}=e,s=new Uint8Array(4);for(let o=0;o<t.length;o++){const e=t[o].material,i=t[o].index,a=n(Math.round(e.size*W),0,255),c=n(e.extensionLength,-q,255-q)+q,d="solid"===e.type?N.SOLID:N.SKETCH,l=255*e.opacity,h=e.color,u=255*h[0],m=255*h[1],g=255*h[2],p=255*h[3];r.textureBuffer.setData(i,0,u,m,g,p),r.textureBuffer.setData(i,1,a,c,d,l),T(t[o].verticalOffset,s),r.textureBuffer.setData(i,2,s[0],s[1],s[2],s[3])}}_createComponentBuffers(e){if(c(this._componentColorManager))return null;const t=new Array,r=this._componentColorManager.getBuffer(e.length);for(let o=0;o<e.length;o++){const s=e[o],n=r.acquireIndex();t.push({index:n,verticalOffset:0,material:s})}const s=new ie(r,t);return this._updateComponentBuffer(s),s}_extractEdges(e,t,r,s,o,n=o.length){return this._worker.process({data:t,indices:o,indicesLength:n,writerSettings:e,skipDeduplicate:r},this._workerAbort.signal,s)}_createRenderable(e,t,r,s,o){const n=d(this._verticesBufferObject)&&e.regular.lodInfo.lengths.length>0?new ae(new A(this.rctx,I,{vertices:U,instances:V.glLayout},{vertices:this._verticesBufferObject,instances:ee.createVertex(this.rctx,te.STATIC_DRAW,e.regular.instancesData.buffer)}),e.regular.lodInfo):null,i=d(this._verticesBufferObject)&&e.silhouette.lodInfo.lengths.length>0?new ae(new A(this.rctx,I,{vertices:U,instances:H.glLayout},{vertices:this._verticesBufferObject,instances:ee.createVertex(this.rctx,te.STATIC_DRAW,e.silhouette.instancesData.buffer)}),e.silhouette.lodInfo):null,a=(d(n)?n.vao.size:0)+(d(i)?i.vao.size:0);return new de(n,i,{gpuMemoryUsage:a,externalMemoryUsage:o,averageEdgeLength:e.averageEdgeLength},r,X(t.meta),Y(t.meta),t,s)}async _addGeometry(e,t,r,s,o,n,i){const a=r.vertexAttributes.get(B.POSITION),c=r.indices.get(B.POSITION),d=f(),l=this._computeModelTransformWithLocalOrigin(e,s,d),h=new pe(a,c,d,l);return this._addPositionData(t,h,r.edgeIndicesLength,o,n,i)}async _addPositionData(e,t,r,s,o,n=!1){if(null==e.loaded)return;const i=this._createComponentBuffers([s]);if(c(i)||r<=0)return;const a=this._acquireRenderer(s.type,!!o.hasSlicePlane,!0),{modelTransform:d,origin:l}=t,h=t.indices,u=t.position,m=u.data.length/u.size,g=L.createBuffer(m);for(let c=0;c<m;c++)g.position.set(c,0,u.data[c*u.size+0]),g.position.set(c,1,u.data[c*u.size+1]),g.position.set(c,2,u.data[c*u.size+2]);Z(i.meta,[0,g.componentIndex.count],g.componentIndex);const p=await this._updatingHandles.addPromise(this._extractEdges(a.writerSettings,g,!1,n,h,r));if(null==e.loaded)return;const f=this._createRenderable(p,i,new ce(d,l),a.key,!1);e.renderables.push(f),a.addRenderable(f),this._gpuMemoryUsage+=f.statistics.gpuMemoryUsage}async _addComponentGeometry(e,t,r,s,o,n,i){if(null==t.loaded)return 0;const a=this._createComponentBuffers(n);if(c(a))return 0;const d=J(n),l=this._acquireRenderer(d,i.hasSlicePlane||!1,!1),h=L.createBuffer(r.count);R(h.position,r),Z(a.meta,o,h.componentIndex,s);const u=!0,m=l.writerSettings,g=await this._updatingHandles.addPromise(this._extractEdges(m,h,u,!1,s));if(null==t.loaded)return 0;const p=this._createRenderable(g,a,e,l.key,!0);return t.renderables.push(p),l.addRenderable(p),p.statistics.gpuMemoryUsage}async _addObjectMergedGeometries(e,t,r,s,o){const n=new Map;let i=0,a=null,c=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f],r=e.geometryRecords[f];if(!r.material.supportsEdges)continue;!a&&r.origin&&(a=r);const s=t.vertexAttributes.get(B.POSITION);c+=s.data.length/s.size,i+=t.edgeIndicesLength}const d=c>=65536?Uint32Array:Uint16Array,l=i?new d(i):null,h=[];let u=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f];if(!e.geometryRecords[f].material.supportsEdges)continue;const r=t.vertexAttributes.get(B.POSITION),s=t.indices.get(B.POSITION);let o=n.get(r.data);if(null==o){o=h.length/3;for(let e=0;e<r.data.length;e+=r.size)h.push(r.data[e+0]),h.push(r.data[e+1]),h.push(r.data[e+2]);n.set(r.data,o)}if(s)for(let e=0;e<t.edgeIndicesLength;e++)l[u++]=o+s[e]}const m=a||e.geometryRecords[0],g=f(),p=this._computeModelTransformWithLocalOrigin(e,m,g);for(let f=0;f<e.geometryRecords.length;f++)e.geometryRecords[f].origin=p.origin;const _=new pe({data:h,size:3},l,g,p);await this._updatingHandles.addPromise(this._addPositionData(t,_,l.length,r[0],s,o))}_acquireRenderer(e,t,r){const s=z.getKey(e,t,r);let o=this._renderers.get(s);return c(this._strokesTexture)&&(this._strokesTexture=Q(this.rctx)),o||(o=new z(this.rctx,this.techniqueRepository,{type:e,hasSlicePlane:t,strokesTexture:this._strokesTexture,legacy:r,spherical:this.viewingMode===E.Global}),this._renderers.set(s,o)),++o.refCount,o}_removeRenderable(e){se(e);const t=this._renderers.get(e.rendererKey);if(t){t.removeRenderable(e),--t.refCount,"origin"in e.transform&&this._localOrigins.release(e.transform.origin),this._gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=O(),o=e=>{y(s,e.center,t);const o=j(s,r),n=e.radius,i=o<-n?1/0:o<n?0:o-n;e.renderables.forEach((e=>e.distanceToCamera=i))};this._perObjectData.forEach(o),this._perObjectDataEvictionCache.forEach(o)}_renderRegularEdges(e,t,r){const s=e.bindRegularEdges(r,t),o=r.transparency,n=t.camera.perScreenPixelRatio;e.forEachRenderable((o=>{if(!he(o)||!o.visible)return;const i=ge(o.regular.lod.lengths,o.distanceToCamera,n);e.renderRegularEdges(s,o,r,t,i)}),o)}_renderSilhouetteEdges(e,t,r){const s=e.bindSilhouetteEdges(r,t),o=r.transparency,n=t.camera.perScreenPixelRatio;e.forEachRenderable((o=>{if(!me(o)||!o.visible)return;const i=ge(o.silhouette.lod.lengths,o.distanceToCamera,n);e.renderSilhouetteEdges(s,o,r,t,i)}),o)}get test(){return{hasRenderedPrimitives:e=>{let t=!1;const r=e.perScreenPixelRatio,s=(e,s)=>e.forEachRenderable((e=>{e.visible&&!t&&(he(e)&&(t=ge(e.regular.lod.lengths,e.distanceToCamera,r)>0),!t&&me(e)&&(t=ge(e.silhouette.lod.lengths,e.distanceToCamera,r)>0))}),s);return this._renderers.forEach((e=>{t||(s(e,F.OPAQUE),s(e,F.TRANSPARENT))})),t}}}};function se(e){d(e.regular)&&(e.regular.vao.vertexBuffers.instances.dispose(),e.regular.vao.dispose(!1),e.regular.vao=null),d(e.silhouette)&&(e.silhouette.vao.vertexBuffers.instances.dispose(),e.silhouette.vao.dispose(!1),e.silhouette.vao=null)}function oe(e){let t=null,s=null;for(let o=0;o<e.geometries.length;o++){const n=e.geometryRecords[o];if(n.material.supportsEdges){if(t){if(!r(t,n.transformation))return!1}else t=n.transformation;if(!s&&d(n.origin))s=n;else if(d(s?.origin)&&d(n.origin)&&s.origin.id!==n.origin.id)return!1}}return!0}e([l({constructOnly:!0})],re.prototype,"rctx",void 0),e([l({constructOnly:!0})],re.prototype,"renderSR",void 0),e([l({constructOnly:!0})],re.prototype,"viewingMode",void 0),e([l({constructOnly:!0})],re.prototype,"techniqueRepository",void 0),e([l({constructOnly:!0})],re.prototype,"setNeedsRender",void 0),e([l({constructOnly:!0})],re.prototype,"schedule",void 0),e([l({readOnly:!0})],re.prototype,"_updatingHandles",void 0),e([l({readOnly:!0})],re.prototype,"updating",null),re=e([h("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],re);class ne{constructor(e,t,r){this.center=t,this.radius=r,this.renderables=new Array,this.loaded=e,this.loaded.then((()=>{null!=this.loaded&&(this.loaded=!0)}))}}class ie{constructor(e,t){this.buffer=e,this.meta=t}}class ae{constructor(e,t){this.vao=e,this.lod=t}}class ce{constructor(e,t){this.modelMatrix=e,this.origin=t}}class de{constructor(e,t,r,s,o,n,i,a){this.regular=e,this.silhouette=t,this.statistics=r,this.transform=s,this.edgeTransparency=o,this.objectTransparency=n,this.components=i,this.rendererKey=a,this.distanceToCamera=0,this.visible=!0}}class le extends de{}function he(e){return d(e.regular)}class ue extends de{}function me(e){return d(e.silhouette)}function ge(e,t,r){const o=t*r,n=s(e,o,!0);return-1===n?o<e[0]?e.length:0:e.length-n}class pe{constructor(e,t,r,s){this.position=e,this.indices=t,this.modelTransform=r,this.origin=s}}const fe=p();export{re as EdgeView,ce as LegacyTransform,le as RegularRenderable,de as Renderable,ue as SilhouetteRenderable};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as r,binaryIndexOf as s}from"../../../../../core/arrayUtils.js";import o from"../../../../../core/Logger.js";import{clamp as n}from"../../../../../core/mathUtils.js";import{disposeMaybe as i,destroyMaybe as a,isNone as c,isSome as d}from"../../../../../core/maybe.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as u,t as m,e as g}from"../../../../../chunks/mat3.js";import{c as p}from"../../../../../chunks/mat3f64.js";import{c as f}from"../../../../../chunks/mat4f64.js";import{s as _,c as b,p as y,e as j}from"../../../../../chunks/vec3.js";import{c as O}from"../../../../../chunks/vec3f64.js";import{WatchUpdatingTracking as w}from"../../../../../core/support/WatchUpdatingTracking.js";import{g as v,a as x}from"../../../../../chunks/sphere.js";import{c as R}from"../../../../../chunks/vec33.js";import{ViewingMode as E}from"../../../../ViewingMode.js";import{encodeElevationOffset as T}from"../../collections/Component/Material/shader/ComponentData.glsl.js";import{TwoVectorPosition as C}from"../../core/util/TwoVectorPosition.js";import{GridLocalOriginFactory as M}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as D}from"../localOriginHelper.js";import{LocalOriginManager as P}from"../LocalOriginManager.js";import{Object3D as S}from"../Object3D.js";import{VertexArrayObject as A}from"../VertexArrayObject.js";import{VertexAttribute as B}from"../VertexAttribute.js";import{VertexLayout as k,EdgeShaderAttributeLocations as I,glVertexLayout as U,EdgeInputBufferLayout as L}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as V,SilhouetteEdgeBufferWriter as H}from"./edgeBufferWriters.js";import{EdgeType as N}from"./edgePreprocessing.js";import{EdgeRenderer as z,LINE_WIDTH_FRACTION_FACTOR as W,EXTENSION_LENGTH_OFFSET as q}from"./EdgeRenderer.js";import{EdgePassParameters as G}from"./EdgeShaderParameters.js";import{EdgeWorkerHandle as K}from"./EdgeWorkerHandle.js";import{Transparency as F}from"./interfaces.js";import{generateStrokesTexture as Q}from"./strokes.js";import{determineRendererType as J,determineEdgeTransparency as X,determineObjectTransparency as Y,fillComponenBufferIndices as Z}from"./util.js";import{BufferManager as $}from"../TextureBackedBuffer/BufferManager.js";import{BufferObject as ee}from"../../../../webgl/BufferObject.js";import{Usage as te}from"../../../../webgl/enums.js";let re=class extends t{constructor(e){super(e),this._updatingHandles=new w,this._perObjectData=new Map,this._perObjectDataEvictionCache=new Set,this._renderers=new Map,this._gpuMemoryUsage=0,this._workerAbort=new AbortController,this._tmpModelPosition=O(),this._localOrigins=new P(new M(e.renderSR))}initialize(){this._worker=new K(this.schedule),this._componentColorManager=new $(this.rctx,3);const e=k.createBuffer(4);for(let t=0;t<4;t++)e.sideness.set(t,0,0===t||3===t?0:1),e.sideness.set(t,1,0===t||1===t?0:1);this._verticesBufferObject=ee.createVertex(this.rctx,te.STATIC_DRAW,e.buffer)}destroy(){this.destroyed||(this._perObjectData.forEach((e=>this._discardObjectEntry(e))),this._perObjectData.clear(),this._strokesTexture=i(this._strokesTexture),this._componentColorManager=a(this._componentColorManager),this._workerAbort.abort(),this._worker.destroy(),this._verticesBufferObject=i(this._verticesBufferObject),this._renderers.clear(),this._updatingHandles.destroy())}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(e,t,r,s,o,n,i,a){if(this.hasObject(e))return this.getObjectMemoryUsage(e);let c;const d=new ne(new Promise((e=>c=e)),r.center,r.radius);this._perObjectData.set(e,d);const l=await this._updatingHandles.addPromise(this._addComponentGeometry(t,d,s,o,n,i,a));return this.setNeedsRender(),c(),l}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void o.getLogger(this.declaredClass).warn("Attempt to add an object to a destroyed instance");const n=this._perObjectData.get(e);let i;n?.renderables.length>0&&this._perObjectDataEvictionCache.add(n);const a=e.boundingVolumeWorldSpace.bounds,c=new ne(new Promise((e=>i=e)),v(a),x(a));this._perObjectData.set(e,c);const d=new Array;if(r.mergeGeometries&&e.geometries.length>1&&oe(e))d.push(this._addObjectMergedGeometries(e,c,t,r,s));else for(let o=0;o<e.geometries.length;o++){const n=e.geometryRecords[o];if(!n.material.supportsEdges)continue;const i=e.geometries[o];d.push(this._addGeometry(e,c,i,n,t[0],r,s))}await this._updatingHandles.addPromise(Promise.all(d)),this._perObjectDataEvictionCache.delete(c),this._discardObjectEntry(n),this.setNeedsRender(),i()}_discardObjectEntry(e){e&&(e.renderables.length&&(e.renderables.forEach((e=>this._removeRenderable(e))),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this._perObjectData.has(e)}async updateAllComponentOpacities(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));if(c(r))return;const s=t instanceof Array?e=>t[e]:()=>t;r.renderables.forEach((e=>{const t=e.components.meta.length;for(let r=0;r<t;r++){const t=s(r),o=e.components.meta[r],n=o.index;o.material.opacity=t,e.components.buffer.textureBuffer.setDataElement(n,1,3,255*t)}this._updateTransparency(e)})),this.setNeedsRender()}async getObjectMemoryUsage(e){const t=await this._getObjectEntry(e);return d(t)?t.renderables.reduce(((e,t)=>e+t.statistics.gpuMemoryUsage),0):0}async updateAllComponentMaterials(e,t,r,s){const o=e instanceof S,n=!!r.hasSlicePlane,i=J(t),a=z.getKey(i,n,o),d=await this._updatingHandles.addPromise(this._getObjectEntry(e));c(d)||(d.renderables.forEach((e=>{if(a!==e.rendererKey){const t=this._renderers.get(e.rendererKey),r=this._acquireRenderer(i,n,o);t.removeRenderable(e),--t.refCount,e.rendererKey=a,r.addRenderable(e)}for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];s&&this._updateComponentBuffer(e.components),this._updateTransparency(e)})),this.setNeedsRender())}async updateAllVerticalOffsets(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));c(r)||(r.renderables.forEach((e=>{const r=e.components.meta;for(let s=0;s<r.length;s++)e.components.meta[s].verticalOffset=t?.[s]??0;this._updateComponentBuffer(e.components)})),this.setNeedsRender())}async updateObjectVisibility(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));d(r)&&(r.renderables.forEach((e=>e.visible=t)),this.setNeedsRender())}removeObject(e){const t=this._perObjectData.get(e);t&&(this._perObjectData.delete(e),this._discardObjectEntry(t))}async _getObjectEntry(e){const t=this._perObjectData.get(e);if(!t)throw"no object";return await t.loaded,null==t.loaded?null:t}removeAll(){this._perObjectData.forEach(((e,t)=>this.removeObject(t)))}render(e,t){if(c(this._componentColorManager))return;this._localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=O(),o=new C;let n=0,i=0;if(this._renderers.forEach((r=>{if(0===r.refCount)this._renderers.delete(r.key),r.dispose();else{let s=!0,o=!0;r.forEachRenderable((t=>{t.visible&&(n+=t.statistics.averageEdgeLength,i++,s&&t.regular&&(r.updateTechnique(e,!1),s=!1),o&&t.silhouette&&(r.updateTechnique(e,!0),o=!1))}),t)}})),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),0===i)return;const a=new G(40*n/i,t);_(s,r[3],r[7],r[11]),o.set(s),b(a.transformWorldFromViewTH,o.high),b(a.transformWorldFromViewTL,o.low),u(a.transformViewFromCameraRelativeRS,e.camera.viewMatrix),m(fe,a.transformViewFromCameraRelativeRS),g(a.transformNormalViewFromGlobal,fe),a.transformProjFromView=e.camera.projectionMatrix,this._updateObjectCameraDistances(e),this._renderers.forEach((t=>{this._renderRegularEdges(t,e,a),this._renderSilhouetteEdges(t,e,a)}))}_updateTransparency(e){const t=X(e.components.meta),r=Y(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this._renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){e.getCombinedStaticTransformation(t,r);const s=d(t.origin)?this._localOrigins.register(t.origin):this._localOrigins.acquire(_(this._tmpModelPosition,r[12],r[13],r[14]));return t.origin=s.origin,D(s.origin.vec3,r),s}_updateComponentBuffer(e){const{meta:t,buffer:r}=e,s=new Uint8Array(4);for(let o=0;o<t.length;o++){const e=t[o].material,i=t[o].index,a=n(Math.round(e.size*W),0,255),c=n(e.extensionLength,-q,255-q)+q,d="solid"===e.type?N.SOLID:N.SKETCH,l=255*e.opacity,h=e.color,u=255*h[0],m=255*h[1],g=255*h[2],p=255*h[3];r.textureBuffer.setData(i,0,u,m,g,p),r.textureBuffer.setData(i,1,a,c,d,l),T(t[o].verticalOffset,s),r.textureBuffer.setData(i,2,s[0],s[1],s[2],s[3])}}_createComponentBuffers(e){if(c(this._componentColorManager))return null;const t=new Array,r=this._componentColorManager.getBuffer(e.length);for(let o=0;o<e.length;o++){const s=e[o],n=r.acquireIndex();t.push({index:n,verticalOffset:0,material:s})}const s=new ie(r,t);return this._updateComponentBuffer(s),s}_extractEdges(e,t,r,s,o,n=o.length){return this._worker.process({data:t,indices:o,indicesLength:n,writerSettings:e,skipDeduplicate:r},this._workerAbort.signal,s)}_createRenderable(e,t,r,s,o){const n=d(this._verticesBufferObject)&&e.regular.lodInfo.lengths.length>0?new ae(new A(this.rctx,I,{vertices:U,instances:V.glLayout},{vertices:this._verticesBufferObject,instances:ee.createVertex(this.rctx,te.STATIC_DRAW,e.regular.instancesData.buffer)}),e.regular.lodInfo):null,i=d(this._verticesBufferObject)&&e.silhouette.lodInfo.lengths.length>0?new ae(new A(this.rctx,I,{vertices:U,instances:H.glLayout},{vertices:this._verticesBufferObject,instances:ee.createVertex(this.rctx,te.STATIC_DRAW,e.silhouette.instancesData.buffer)}),e.silhouette.lodInfo):null,a=(d(n)?n.vao.size:0)+(d(i)?i.vao.size:0);return new de(n,i,{gpuMemoryUsage:a,externalMemoryUsage:o,averageEdgeLength:e.averageEdgeLength},r,X(t.meta),Y(t.meta),t,s)}async _addGeometry(e,t,r,s,o,n,i){const a=r.vertexAttributes.get(B.POSITION),c=r.indices.get(B.POSITION),d=f(),l=this._computeModelTransformWithLocalOrigin(e,s,d),h=new pe(a,c,d,l);return this._addPositionData(t,h,r.edgeIndicesLength,o,n,i)}async _addPositionData(e,t,r,s,o,n=!1){if(null==e.loaded)return;const i=this._createComponentBuffers([s]);if(c(i)||r<=0)return;const a=this._acquireRenderer(s.type,!!o.hasSlicePlane,!0),{modelTransform:d,origin:l}=t,h=t.indices,u=t.position,m=u.data.length/u.size,g=L.createBuffer(m);for(let c=0;c<m;c++)g.position.set(c,0,u.data[c*u.size+0]),g.position.set(c,1,u.data[c*u.size+1]),g.position.set(c,2,u.data[c*u.size+2]);Z(i.meta,[0,g.componentIndex.count],g.componentIndex);const p=await this._updatingHandles.addPromise(this._extractEdges(a.writerSettings,g,!1,n,h,r));if(null==e.loaded)return;const f=this._createRenderable(p,i,new ce(d,l),a.key,!1);e.renderables.push(f),a.addRenderable(f),this._gpuMemoryUsage+=f.statistics.gpuMemoryUsage}async _addComponentGeometry(e,t,r,s,o,n,i){if(null==t.loaded)return 0;const a=this._createComponentBuffers(n);if(c(a))return 0;const d=J(n),l=this._acquireRenderer(d,i.hasSlicePlane||!1,!1),h=L.createBuffer(r.count);R(h.position,r),Z(a.meta,o,h.componentIndex,s);const u=!0,m=l.writerSettings,g=await this._updatingHandles.addPromise(this._extractEdges(m,h,u,!1,s));if(null==t.loaded)return 0;const p=this._createRenderable(g,a,e,l.key,!0);return t.renderables.push(p),l.addRenderable(p),p.statistics.gpuMemoryUsage}async _addObjectMergedGeometries(e,t,r,s,o){const n=new Map;let i=0,a=null,c=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f],r=e.geometryRecords[f];if(!r.material.supportsEdges)continue;!a&&r.origin&&(a=r);const s=t.vertexAttributes.get(B.POSITION);c+=s.data.length/s.size,i+=t.edgeIndicesLength}const d=c>=65536?Uint32Array:Uint16Array,l=i?new d(i):null,h=[];let u=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f];if(!e.geometryRecords[f].material.supportsEdges)continue;const r=t.vertexAttributes.get(B.POSITION),s=t.indices.get(B.POSITION);let o=n.get(r.data);if(null==o){o=h.length/3;for(let e=0;e<r.data.length;e+=r.size)h.push(r.data[e+0]),h.push(r.data[e+1]),h.push(r.data[e+2]);n.set(r.data,o)}if(s)for(let e=0;e<t.edgeIndicesLength;e++)l[u++]=o+s[e]}const m=a||e.geometryRecords[0],g=f(),p=this._computeModelTransformWithLocalOrigin(e,m,g);for(let f=0;f<e.geometryRecords.length;f++)e.geometryRecords[f].origin=p.origin;const _=new pe({data:h,size:3},l,g,p);await this._updatingHandles.addPromise(this._addPositionData(t,_,l.length,r[0],s,o))}_acquireRenderer(e,t,r){const s=z.getKey(e,t,r);let o=this._renderers.get(s);return c(this._strokesTexture)&&(this._strokesTexture=Q(this.rctx)),o||(o=new z(this.rctx,this.techniqueRepository,{type:e,hasSlicePlane:t,strokesTexture:this._strokesTexture,legacy:r,spherical:this.viewingMode===E.Global}),this._renderers.set(s,o)),++o.refCount,o}_removeRenderable(e){se(e);const t=this._renderers.get(e.rendererKey);if(t){t.removeRenderable(e),--t.refCount,"origin"in e.transform&&this._localOrigins.release(e.transform.origin),this._gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=O(),o=e=>{y(s,e.center,t);const o=j(s,r),n=e.radius,i=o<-n?1/0:o<n?0:o-n;e.renderables.forEach((e=>e.distanceToCamera=i))};this._perObjectData.forEach(o),this._perObjectDataEvictionCache.forEach(o)}_renderRegularEdges(e,t,r){const s=e.bindRegularEdges(r,t),o=r.transparency,n=t.camera.perScreenPixelRatio;e.forEachRenderable((o=>{if(!he(o)||!o.visible)return;const i=ge(o.regular.lod.lengths,o.distanceToCamera,n);e.renderRegularEdges(s,o,r,t,i)}),o)}_renderSilhouetteEdges(e,t,r){const s=e.bindSilhouetteEdges(r,t),o=r.transparency,n=t.camera.perScreenPixelRatio;e.forEachRenderable((o=>{if(!me(o)||!o.visible)return;const i=ge(o.silhouette.lod.lengths,o.distanceToCamera,n);e.renderSilhouetteEdges(s,o,r,t,i)}),o)}get test(){return{hasRenderedPrimitives:e=>{let t=!1;const r=e.perScreenPixelRatio,s=(e,s)=>e.forEachRenderable((e=>{e.visible&&!t&&(he(e)&&(t=ge(e.regular.lod.lengths,e.distanceToCamera,r)>0),!t&&me(e)&&(t=ge(e.silhouette.lod.lengths,e.distanceToCamera,r)>0))}),s);return this._renderers.forEach((e=>{t||(s(e,F.OPAQUE),s(e,F.TRANSPARENT))})),t}}}};function se(e){d(e.regular)&&(e.regular.vao.vertexBuffers.instances.dispose(),e.regular.vao.dispose(!1),e.regular.vao=null),d(e.silhouette)&&(e.silhouette.vao.vertexBuffers.instances.dispose(),e.silhouette.vao.dispose(!1),e.silhouette.vao=null)}function oe(e){let t=null,s=null;for(let o=0;o<e.geometries.length;o++){const n=e.geometryRecords[o];if(n.material.supportsEdges){if(t){if(!r(t,n.transformation))return!1}else t=n.transformation;if(!s&&d(n.origin))s=n;else if(d(s?.origin)&&d(n.origin)&&s.origin.id!==n.origin.id)return!1}}return!0}e([l({constructOnly:!0})],re.prototype,"rctx",void 0),e([l({constructOnly:!0})],re.prototype,"renderSR",void 0),e([l({constructOnly:!0})],re.prototype,"viewingMode",void 0),e([l({constructOnly:!0})],re.prototype,"techniqueRepository",void 0),e([l({constructOnly:!0})],re.prototype,"setNeedsRender",void 0),e([l({constructOnly:!0})],re.prototype,"schedule",void 0),e([l({readOnly:!0})],re.prototype,"_updatingHandles",void 0),e([l({readOnly:!0})],re.prototype,"updating",null),re=e([h("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],re);class ne{constructor(e,t,r){this.center=t,this.radius=r,this.renderables=new Array,this.loaded=e,this.loaded.then((()=>{null!=this.loaded&&(this.loaded=!0)}))}}class ie{constructor(e,t){this.buffer=e,this.meta=t}}class ae{constructor(e,t){this.vao=e,this.lod=t}}class ce{constructor(e,t){this.modelMatrix=e,this.origin=t}}class de{constructor(e,t,r,s,o,n,i,a){this.regular=e,this.silhouette=t,this.statistics=r,this.transform=s,this.edgeTransparency=o,this.objectTransparency=n,this.components=i,this.rendererKey=a,this.distanceToCamera=0,this.visible=!0}}class le extends de{}function he(e){return d(e.regular)}class ue extends de{}function me(e){return d(e.silhouette)}function ge(e,t,r){const o=t*r,n=s(e,o,!0);return-1===n?o<e[0]?e.length:0:e.length-n}class pe{constructor(e,t,r,s){this.position=e,this.indices=t,this.modelTransform=r,this.origin=s}}const fe=p();export{re as EdgeView,ce as LegacyTransform,le as RegularRenderable,de as Renderable,ue as SilhouetteRenderable};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{range as e}from"../../../../../core/arrayUtils.js";import{deg2rad as t,acosClamped as n}from"../../../../../core/mathUtils.js";import{forEach as o}from"../../../../../core/typedArrayUtil.js";import{i as r,s,c,e as a,r as i,f as l,b as f,n as g}from"../../../../../chunks/vec3.js";import{c as m}from"../../../../../chunks/vec3f64.js";const p=-1;var u;function h(n,i,l,f=N){const g=n.vertices.position,m=n.vertices.componentIndex,u=t(f.anglePlanar),h=t(f.angleSignificantEdge),V=Math.cos(h),S=Math.cos(u),j=I.edge,x=j.position0,E=j.position1,D=j.faceNormal0,F=j.faceNormal1,L=y(n),U=w(n),b=U.length/4,k=i.allocate(b);let C=0;const H=b,K=l.allocate(H);let M=0,O=0,P=0;const T=e(0,b),q=new Float32Array(b);o(q,((e,t,n)=>{g.getVec(U[4*t+0],x),g.getVec(U[4*t+1],E),n[t]=r(x,E)})),T.sort(((e,t)=>q[t]-q[e]));const z=new Array,B=new Array;for(let e=0;e<b;e++){const t=T[e],n=q[t],o=U[4*t+0],r=U[4*t+1],f=U[4*t+2],h=U[4*t+3],w=h===p;if(g.getVec(o,x),g.getVec(r,E),w)s(D,L[3*f+0],L[3*f+1],L[3*f+2]),c(F,D),j.componentIndex=m.get(o),j.cosAngle=a(D,F);else{if(s(D,L[3*f+0],L[3*f+1],L[3*f+2]),s(F,L[3*h+0],L[3*h+1],L[3*h+2]),j.componentIndex=m.get(o),j.cosAngle=a(D,F),A(j,S))continue;j.cosAngle<-.9999&&c(F,D)}O+=n,P++,w||v(j,V)?(i.write(k,C++,j),z.push(n)):d(j,u)&&(l.write(K,M++,j),B.push(n))}const G=new Float32Array(z.reverse()),J=new Float32Array(B.reverse());return{regular:{instancesData:i.trim(k,C),lodInfo:{lengths:G}},silhouette:{instancesData:l.trim(K,M),lodInfo:{lengths:J}},averageEdgeLength:O/P}}function v(e,t){return e.cosAngle<t}function A(e,t){return e.cosAngle>t}function d(e,t){const o=n(e.cosAngle),r=I.fwd,s=I.ortho;i(r,e.position1,e.position0);return o*(a(l(s,e.faceNormal0,e.faceNormal1),r)>0?-1:1)>t}function w(e){const t=e.faces.length/3,n=e.faces,o=e.neighbors;let r=0;for(let a=0;a<t;a++){const e=o[3*a+0],t=o[3*a+1],s=o[3*a+2],c=n[3*a+0],i=n[3*a+1],l=n[3*a+2];r+=e===p||c<i?1:0,r+=t===p||i<l?1:0,r+=s===p||l<c?1:0}const s=new Int32Array(4*r);let c=0;for(let a=0;a<t;a++){const e=o[3*a+0],t=o[3*a+1],r=o[3*a+2],i=n[3*a+0],l=n[3*a+1],f=n[3*a+2];(e===p||i<l)&&(s[c++]=i,s[c++]=l,s[c++]=a,s[c++]=e),(t===p||l<f)&&(s[c++]=l,s[c++]=f,s[c++]=a,s[c++]=t),(r===p||f<i)&&(s[c++]=f,s[c++]=i,s[c++]=a,s[c++]=r)}return s}function y(e){const t=e.faces.length/3,n=e.vertices.position,o=e.faces,r=V.v0,s=V.v1,c=V.v2,a=new Float32Array(3*t);for(let i=0;i<t;i++){const e=o[3*i+0],t=o[3*i+1],m=o[3*i+2];n.getVec(e,r),n.getVec(t,s),n.getVec(m,c),f(s,s,r),f(c,c,r),l(r,s,c),g(r,r),a[3*i+0]=r[0],a[3*i+1]=r[1],a[3*i+2]=r[2]}return a}!function(e){e[e.SOLID=0]="SOLID",e[e.SKETCH=1]="SKETCH"}(u||(u={}));const I={edge:{position0:m(),position1:m(),faceNormal0:m(),faceNormal1:m(),componentIndex:0,cosAngle:0},ortho:m(),fwd:m()},V={v0:m(),v1:m(),v2:m()},N={anglePlanar:4,angleSignificantEdge:35};export{u as EdgeType,h as extractEdges};
5
+ import{range as e}from"../../../../../core/arrayUtils.js";import{deg2rad as t,acosClamped as n}from"../../../../../core/mathUtils.js";import{forEach as o}from"../../../../../core/typedArrayUtil.js";import{i as r,s,c,e as a,A as i,f as l,b as f,n as g}from"../../../../../chunks/vec3.js";import{c as m}from"../../../../../chunks/vec3f64.js";const p=-1;var u;function h(n,i,l,f=N){const g=n.vertices.position,m=n.vertices.componentIndex,u=t(f.anglePlanar),h=t(f.angleSignificantEdge),V=Math.cos(h),S=Math.cos(u),j=I.edge,x=j.position0,E=j.position1,D=j.faceNormal0,F=j.faceNormal1,L=y(n),U=w(n),b=U.length/4,k=i.allocate(b);let C=0;const H=b,K=l.allocate(H);let M=0,O=0,P=0;const T=e(0,b),q=new Float32Array(b);o(q,((e,t,n)=>{g.getVec(U[4*t+0],x),g.getVec(U[4*t+1],E),n[t]=r(x,E)})),T.sort(((e,t)=>q[t]-q[e]));const z=new Array,B=new Array;for(let e=0;e<b;e++){const t=T[e],n=q[t],o=U[4*t+0],r=U[4*t+1],f=U[4*t+2],h=U[4*t+3],w=h===p;if(g.getVec(o,x),g.getVec(r,E),w)s(D,L[3*f+0],L[3*f+1],L[3*f+2]),c(F,D),j.componentIndex=m.get(o),j.cosAngle=a(D,F);else{if(s(D,L[3*f+0],L[3*f+1],L[3*f+2]),s(F,L[3*h+0],L[3*h+1],L[3*h+2]),j.componentIndex=m.get(o),j.cosAngle=a(D,F),v(j,S))continue;j.cosAngle<-.9999&&c(F,D)}O+=n,P++,w||A(j,V)?(i.write(k,C++,j),z.push(n)):d(j,u)&&(l.write(K,M++,j),B.push(n))}const G=new Float32Array(z.reverse()),J=new Float32Array(B.reverse());return{regular:{instancesData:i.trim(k,C),lodInfo:{lengths:G}},silhouette:{instancesData:l.trim(K,M),lodInfo:{lengths:J}},averageEdgeLength:O/P}}function A(e,t){return e.cosAngle<t}function v(e,t){return e.cosAngle>t}function d(e,t){const o=n(e.cosAngle),r=I.fwd,s=I.ortho;i(r,e.position1,e.position0);return o*(a(l(s,e.faceNormal0,e.faceNormal1),r)>0?-1:1)>t}function w(e){const t=e.faces.length/3,n=e.faces,o=e.neighbors;let r=0;for(let a=0;a<t;a++){const e=o[3*a+0],t=o[3*a+1],s=o[3*a+2],c=n[3*a+0],i=n[3*a+1],l=n[3*a+2];r+=e===p||c<i?1:0,r+=t===p||i<l?1:0,r+=s===p||l<c?1:0}const s=new Int32Array(4*r);let c=0;for(let a=0;a<t;a++){const e=o[3*a+0],t=o[3*a+1],r=o[3*a+2],i=n[3*a+0],l=n[3*a+1],f=n[3*a+2];(e===p||i<l)&&(s[c++]=i,s[c++]=l,s[c++]=a,s[c++]=e),(t===p||l<f)&&(s[c++]=l,s[c++]=f,s[c++]=a,s[c++]=t),(r===p||f<i)&&(s[c++]=f,s[c++]=i,s[c++]=a,s[c++]=r)}return s}function y(e){const t=e.faces.length/3,n=e.vertices.position,o=e.faces,r=V.v0,s=V.v1,c=V.v2,a=new Float32Array(3*t);for(let i=0;i<t;i++){const e=o[3*i+0],t=o[3*i+1],m=o[3*i+2];n.getVec(e,r),n.getVec(t,s),n.getVec(m,c),f(s,s,r),f(c,c,r),l(r,s,c),g(r,r),a[3*i+0]=r[0],a[3*i+1]=r[1],a[3*i+2]=r[2]}return a}!function(e){e[e.SOLID=0]="SOLID",e[e.SKETCH=1]="SKETCH"}(u||(u={}));const I={edge:{position0:m(),position1:m(),faceNormal0:m(),faceNormal1:m(),componentIndex:0,cosAngle:0},ortho:m(),fwd:m()},V={v0:m(),v1:m(),v2:m()},N={anglePlanar:4,angleSignificantEdge:35};export{u as EdgeType,h as extractEdges};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../core/Evented.js";import{f as e,c as s,t as i}from"../../../../../chunks/mat3.js";import{c as a}from"../../../../../chunks/mat3f64.js";import{m as r}from"../../../../../chunks/mat4.js";import{c as o}from"../../../../../chunks/mat4f64.js";import{s as n}from"../../../../../chunks/vec3.js";import{c as h}from"../../../../../chunks/vec3f64.js";import{BufferViewMat4f64 as l,BufferViewVec3f64 as c,BufferViewMat3f as f,BufferViewVec2f as m,BufferViewVec4f64 as g,BufferViewVec4f as d,BufferViewUint8 as _,BufferViewVec4u8 as T}from"../../../../../geometry/support/buffer/BufferView.js";import{scaleFromMatrix as u}from"../../../support/mathUtils.js";import{newLayout as L}from"../../../support/buffer/InterleavedLayout.js";import{assert as A}from"../Util.js";import{VertexAttribute as E}from"../VertexAttribute.js";var O;function F(t){let e=L().mat4f64(E.LOCALTRANSFORM).mat4f64(E.GLOBALTRANSFORM).vec4f64(E.BOUNDINGSPHERE).vec3f64(E.MODELORIGIN).mat3f(E.MODEL).mat3f(E.MODELNORMAL).vec2f(E.MODELSCALEFACTORS);return t.includes("color")&&(e=e.vec4f(E.COLOR)),t.includes("featureAttribute")&&(e=e.vec4f(E.FEATUREATTRIBUTE)),e=e.u8(E.STATE).u8(E.LODLEVEL),t.includes(E.OBJECTANDLAYERIDCOLOR)&&(e=e.vec4u8(E.OBJECTANDLAYERIDCOLOR)),e.alignTo(8),e}!function(t){t[t.ALLOCATED=1]="ALLOCATED",t[t.DEFAULT_ACTIVE=2]="DEFAULT_ACTIVE",t[t.VISIBLE=4]="VISIBLE",t[t.HIGHLIGHT=8]="HIGHLIGHT",t[t.HIGHLIGHT_ACTIVE=16]="HIGHLIGHT_ACTIVE",t[t.REMOVE=32]="REMOVE",t[t.TRANSFORM_CHANGED=64]="TRANSFORM_CHANGED",t[t.ACTIVE=18]="ACTIVE"}(O||(O={}));class v{constructor(t){this.localTransform=t.getField(E.LOCALTRANSFORM,l),this.globalTransform=t.getField(E.GLOBALTRANSFORM,l),this.modelOrigin=t.getField(E.MODELORIGIN,c),this.model=t.getField(E.MODEL,f),this.modelNormal=t.getField(E.MODELNORMAL,f),this.modelScaleFactors=t.getField(E.MODELSCALEFACTORS,m),this.boundingSphere=t.getField(E.BOUNDINGSPHERE,g),this.color=t.getField(E.COLOR,d),this.featureAttribute=t.getField(E.FEATUREATTRIBUTE,d),this.state=t.getField(E.STATE,_),this.lodLevel=t.getField(E.LODLEVEL,_),this.objectAndLayerIdColor=t.getField(E.OBJECTANDLAYERIDCOLOR,T)}}class M extends t{constructor(t,e){super(),this._capacity=0,this._size=0,this._next=0,this._buffer=null,this._view=null,this._layout=F(t),this._shaderTransformation=e}get capacity(){return this._capacity}get size(){return this._size}get buffer(){return this._buffer.buffer}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const t=this._findSlot();return this._view.state.set(t,O.ALLOCATED),this._size++,this.emit("instance-added",{index:t}),t}removeInstance(t){const e=this._view.state;A(t>=0&&t<this._capacity&&e.get(t)&O.ALLOCATED,"invalid instance handle"),this._getStateFlag(t,O.ACTIVE)?this._setStateFlags(t,O.REMOVE):this.freeInstance(t),this.emit("instance-removed",{index:t})}freeInstance(t){const e=this._view.state;A(t>=0&&t<this._capacity&&e.get(t)&O.ALLOCATED,"invalid instance handle"),e.set(t,0),this._size--}setLocalTransform(t,e,s=!0){this._view.localTransform.setMat(t,e),s&&this.updateModelTransform(t)}getLocalTransform(t,e){this._view.localTransform.getMat(t,e)}setGlobalTransform(t,e,s=!0){this._view.globalTransform.setMat(t,e),s&&this.updateModelTransform(t)}getGlobalTransform(t,e){this._view.globalTransform.getMat(t,e)}updateModelTransform(t){const a=this._view,o=C,h=b;a.localTransform.getMat(t,R),a.globalTransform.getMat(t,w);const l=r(w,w,R);n(o,l[12],l[13],l[14]),a.modelOrigin.setVec(t,o),e(h,l),a.model.setMat(t,h);const c=u(C,l);c.sort(),a.modelScaleFactors.set(t,0,c[1]),a.modelScaleFactors.set(t,1,c[2]),s(h,h),i(h,h),a.modelNormal.setMat(t,h),this._setStateFlags(t,O.TRANSFORM_CHANGED),this.emit("instance-transform-changed",{index:t})}getModelTransform(t,e){const s=this._view;s.model.getMat(t,b),s.modelOrigin.getVec(t,C),e[0]=b[0],e[1]=b[1],e[2]=b[2],e[3]=0,e[4]=b[3],e[5]=b[4],e[6]=b[5],e[7]=0,e[8]=b[6],e[9]=b[7],e[10]=b[8],e[11]=0,e[12]=C[0],e[13]=C[1],e[14]=C[2],e[15]=1}applyShaderTransformation(t,e){this._shaderTransformation&&this._shaderTransformation.applyTransform(this,t,e)}getCombinedModelTransform(t,e){return this.getModelTransform(t,e),this._shaderTransformation&&this._shaderTransformation.applyTransform(this,t,e),e}getCombinedLocalTransform(t,e){return this._view.localTransform.getMat(t,e),this._shaderTransformation&&this._shaderTransformation.applyTransform(this,t,e),e}getCombinedMaxScaleFactor(t){let e=this._view.modelScaleFactors.get(t,1);if(this._shaderTransformation){const s=this._shaderTransformation.scaleFactor(C,this,t);e*=Math.max(s[0],s[1],s[2])}return e}getCombinedMedianScaleFactor(t){let e=this._view.modelScaleFactors.get(t,0);if(this._shaderTransformation){const s=this._shaderTransformation.scaleFactor(C,this,t);e*=I(s[0],s[1],s[2])}return e}getModel(t,e){this._view.model.getMat(t,e)}setFeatureAttribute(t,e){this._view.featureAttribute.setVec(t,e)}getFeatureAttribute(t,e){this._view.featureAttribute.getVec(t,e)}setColor(t,e){this._view.color.setVec(t,e)}setObjectAndLayerIdColor(t,e){this._view.objectAndLayerIdColor.setVec(t,e)}getColor(t,e){this._view.color.getVec(t,e)}setVisible(t,e){e!==this.getVisible(t)&&(this._setStateFlag(t,O.VISIBLE,e),this.emit("instance-visibility-changed",{index:t}))}getVisible(t){return this._getStateFlag(t,O.VISIBLE)}setHighlight(t,e){e!==this.getHighlight(t)&&(this._setStateFlag(t,O.HIGHLIGHT,e),this.emit("instance-highlight-changed",{index:t}))}getHighlight(t){return this._getStateFlag(t,O.HIGHLIGHT)}getState(t){return this._view.state.get(t)}getLodLevel(t){return this._view.lodLevel.get(t)}countFlags(t){let e=0;for(let s=0;s<this._capacity;++s){this.getState(s)&t&&++e}return e}_setStateFlags(t,e){const s=this._view.state;e=s.get(t)|e,s.set(t,e)}_clearStateFlags(t,e){const s=this._view.state;e=s.get(t)&~e,s.set(t,e)}_setStateFlag(t,e,s){s?this._setStateFlags(t,e):this._clearStateFlags(t,e)}_getStateFlag(t,e){return!!(this._view.state.get(t)&e)}_grow(){const t=Math.max(S,Math.floor(this._capacity*p)),e=this._layout.createBuffer(t);if(this._buffer){const t=new Uint8Array(this._buffer.buffer);new Uint8Array(e.buffer).set(t)}this._capacity=t,this._buffer=e,this._view=new v(this._buffer)}_findSlot(){const t=this._view.state;let e=this._next;for(;t.get(e)&O.ALLOCATED;)e=e+1===this._capacity?0:e+1;return this._next=e+1===this._capacity?0:e+1,e}}function I(t,e,s){return Math.max(Math.min(t,e),Math.min(Math.max(t,e),s))}const S=1024,p=2,C=h(),b=a(),R=o(),w=o();export{M as InstanceData,v as InstanceDataView,O as StateFlags};
5
+ import t from"../../../../../core/Evented.js";import{f as e,e as s,t as i}from"../../../../../chunks/mat3.js";import{c as a}from"../../../../../chunks/mat3f64.js";import{m as r}from"../../../../../chunks/mat4.js";import{c as o}from"../../../../../chunks/mat4f64.js";import{s as n}from"../../../../../chunks/vec3.js";import{c as h}from"../../../../../chunks/vec3f64.js";import{BufferViewMat4f64 as l,BufferViewVec3f64 as c,BufferViewMat3f as f,BufferViewVec2f as m,BufferViewVec4f64 as g,BufferViewVec4f as d,BufferViewUint8 as _,BufferViewVec4u8 as T}from"../../../../../geometry/support/buffer/BufferView.js";import{scaleFromMatrix as u}from"../../../support/mathUtils.js";import{newLayout as L}from"../../../support/buffer/InterleavedLayout.js";import{assert as A}from"../Util.js";import{VertexAttribute as E}from"../VertexAttribute.js";var O;function F(t){let e=L().mat4f64(E.LOCALTRANSFORM).mat4f64(E.GLOBALTRANSFORM).vec4f64(E.BOUNDINGSPHERE).vec3f64(E.MODELORIGIN).mat3f(E.MODEL).mat3f(E.MODELNORMAL).vec2f(E.MODELSCALEFACTORS);return t.includes("color")&&(e=e.vec4f(E.COLOR)),t.includes("featureAttribute")&&(e=e.vec4f(E.FEATUREATTRIBUTE)),e=e.u8(E.STATE).u8(E.LODLEVEL),t.includes(E.OBJECTANDLAYERIDCOLOR)&&(e=e.vec4u8(E.OBJECTANDLAYERIDCOLOR)),e.alignTo(8),e}!function(t){t[t.ALLOCATED=1]="ALLOCATED",t[t.DEFAULT_ACTIVE=2]="DEFAULT_ACTIVE",t[t.VISIBLE=4]="VISIBLE",t[t.HIGHLIGHT=8]="HIGHLIGHT",t[t.HIGHLIGHT_ACTIVE=16]="HIGHLIGHT_ACTIVE",t[t.REMOVE=32]="REMOVE",t[t.TRANSFORM_CHANGED=64]="TRANSFORM_CHANGED",t[t.ACTIVE=18]="ACTIVE"}(O||(O={}));class v{constructor(t){this.localTransform=t.getField(E.LOCALTRANSFORM,l),this.globalTransform=t.getField(E.GLOBALTRANSFORM,l),this.modelOrigin=t.getField(E.MODELORIGIN,c),this.model=t.getField(E.MODEL,f),this.modelNormal=t.getField(E.MODELNORMAL,f),this.modelScaleFactors=t.getField(E.MODELSCALEFACTORS,m),this.boundingSphere=t.getField(E.BOUNDINGSPHERE,g),this.color=t.getField(E.COLOR,d),this.featureAttribute=t.getField(E.FEATUREATTRIBUTE,d),this.state=t.getField(E.STATE,_),this.lodLevel=t.getField(E.LODLEVEL,_),this.objectAndLayerIdColor=t.getField(E.OBJECTANDLAYERIDCOLOR,T)}}class M extends t{constructor(t,e){super(),this._capacity=0,this._size=0,this._next=0,this._buffer=null,this._view=null,this._layout=F(t),this._shaderTransformation=e}get capacity(){return this._capacity}get size(){return this._size}get buffer(){return this._buffer.buffer}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const t=this._findSlot();return this._view.state.set(t,O.ALLOCATED),this._size++,this.emit("instance-added",{index:t}),t}removeInstance(t){const e=this._view.state;A(t>=0&&t<this._capacity&&e.get(t)&O.ALLOCATED,"invalid instance handle"),this._getStateFlag(t,O.ACTIVE)?this._setStateFlags(t,O.REMOVE):this.freeInstance(t),this.emit("instance-removed",{index:t})}freeInstance(t){const e=this._view.state;A(t>=0&&t<this._capacity&&e.get(t)&O.ALLOCATED,"invalid instance handle"),e.set(t,0),this._size--}setLocalTransform(t,e,s=!0){this._view.localTransform.setMat(t,e),s&&this.updateModelTransform(t)}getLocalTransform(t,e){this._view.localTransform.getMat(t,e)}setGlobalTransform(t,e,s=!0){this._view.globalTransform.setMat(t,e),s&&this.updateModelTransform(t)}getGlobalTransform(t,e){this._view.globalTransform.getMat(t,e)}updateModelTransform(t){const a=this._view,o=C,h=b;a.localTransform.getMat(t,R),a.globalTransform.getMat(t,w);const l=r(w,w,R);n(o,l[12],l[13],l[14]),a.modelOrigin.setVec(t,o),e(h,l),a.model.setMat(t,h);const c=u(C,l);c.sort(),a.modelScaleFactors.set(t,0,c[1]),a.modelScaleFactors.set(t,1,c[2]),s(h,h),i(h,h),a.modelNormal.setMat(t,h),this._setStateFlags(t,O.TRANSFORM_CHANGED),this.emit("instance-transform-changed",{index:t})}getModelTransform(t,e){const s=this._view;s.model.getMat(t,b),s.modelOrigin.getVec(t,C),e[0]=b[0],e[1]=b[1],e[2]=b[2],e[3]=0,e[4]=b[3],e[5]=b[4],e[6]=b[5],e[7]=0,e[8]=b[6],e[9]=b[7],e[10]=b[8],e[11]=0,e[12]=C[0],e[13]=C[1],e[14]=C[2],e[15]=1}applyShaderTransformation(t,e){this._shaderTransformation&&this._shaderTransformation.applyTransform(this,t,e)}getCombinedModelTransform(t,e){return this.getModelTransform(t,e),this._shaderTransformation&&this._shaderTransformation.applyTransform(this,t,e),e}getCombinedLocalTransform(t,e){return this._view.localTransform.getMat(t,e),this._shaderTransformation&&this._shaderTransformation.applyTransform(this,t,e),e}getCombinedMaxScaleFactor(t){let e=this._view.modelScaleFactors.get(t,1);if(this._shaderTransformation){const s=this._shaderTransformation.scaleFactor(C,this,t);e*=Math.max(s[0],s[1],s[2])}return e}getCombinedMedianScaleFactor(t){let e=this._view.modelScaleFactors.get(t,0);if(this._shaderTransformation){const s=this._shaderTransformation.scaleFactor(C,this,t);e*=I(s[0],s[1],s[2])}return e}getModel(t,e){this._view.model.getMat(t,e)}setFeatureAttribute(t,e){this._view.featureAttribute.setVec(t,e)}getFeatureAttribute(t,e){this._view.featureAttribute.getVec(t,e)}setColor(t,e){this._view.color.setVec(t,e)}setObjectAndLayerIdColor(t,e){this._view.objectAndLayerIdColor.setVec(t,e)}getColor(t,e){this._view.color.getVec(t,e)}setVisible(t,e){e!==this.getVisible(t)&&(this._setStateFlag(t,O.VISIBLE,e),this.emit("instance-visibility-changed",{index:t}))}getVisible(t){return this._getStateFlag(t,O.VISIBLE)}setHighlight(t,e){e!==this.getHighlight(t)&&(this._setStateFlag(t,O.HIGHLIGHT,e),this.emit("instance-highlight-changed",{index:t}))}getHighlight(t){return this._getStateFlag(t,O.HIGHLIGHT)}getState(t){return this._view.state.get(t)}getLodLevel(t){return this._view.lodLevel.get(t)}countFlags(t){let e=0;for(let s=0;s<this._capacity;++s){this.getState(s)&t&&++e}return e}_setStateFlags(t,e){const s=this._view.state;e=s.get(t)|e,s.set(t,e)}_clearStateFlags(t,e){const s=this._view.state;e=s.get(t)&~e,s.set(t,e)}_setStateFlag(t,e,s){s?this._setStateFlags(t,e):this._clearStateFlags(t,e)}_getStateFlag(t,e){return!!(this._view.state.get(t)&e)}_grow(){const t=Math.max(S,Math.floor(this._capacity*p)),e=this._layout.createBuffer(t);if(this._buffer){const t=new Uint8Array(this._buffer.buffer);new Uint8Array(e.buffer).set(t)}this._capacity=t,this._buffer=e,this._view=new v(this._buffer)}_findSlot(){const t=this._view.state;let e=this._next;for(;t.get(e)&O.ALLOCATED;)e=e+1===this._capacity?0:e+1;return this._next=e+1===this._capacity?0:e+1,e}}function I(t,e,s){return Math.max(Math.min(t,e),Math.min(Math.max(t,e),s))}const S=1024,p=2,C=h(),b=a(),R=o(),w=o();export{M as InstanceData,v as InstanceDataView,O as StateFlags};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{c as t}from"../../../../../chunks/mat4f64.js";import{m as e}from"../../../../../chunks/vec3.js";import{w as s,c as i}from"../../../../../chunks/sphere.js";import{maxScale as r}from"../../../support/mathUtils.js";import h from"../Octree.js";class n extends h{constructor(e,r){super((t=>s(this._instanceData.view.boundingSphere.getVec(t,this._tmpSphere))),{maximumDepth:25}),this._tmpSphere=i(),this._tmpMat4=t(),this._instanceData=e,this._boundingSphere=r}addInstance(t){const s=this._instanceData.view.boundingSphere,i=this._instanceData.getCombinedModelTransform(t,this._tmpMat4);e(this._tmpSphere,this._boundingSphere.center,i),this._tmpSphere[3]=this._boundingSphere.radius*r(i),s.setVec(t,this._tmpSphere),this.add([t])}removeInstance(t){this.remove([t])}}export{n as InstanceOctree};
5
+ import{c as t}from"../../../../../chunks/mat4f64.js";import{v as e}from"../../../../../chunks/vec3.js";import{w as s,c as i}from"../../../../../chunks/sphere.js";import{maxScale as r}from"../../../support/mathUtils.js";import h from"../Octree.js";class n extends h{constructor(e,r){super((t=>s(this._instanceData.view.boundingSphere.getVec(t,this._tmpSphere))),{maximumDepth:25}),this._tmpSphere=i(),this._tmpMat4=t(),this._instanceData=e,this._boundingSphere=r}addInstance(t){const s=this._instanceData.view.boundingSphere,i=this._instanceData.getCombinedModelTransform(t,this._tmpMat4);e(this._tmpSphere,this._boundingSphere.center,i),this._tmpSphere[3]=this._boundingSphere.radius*r(i),s.setVec(t,this._tmpSphere),this.add([t])}removeInstance(t){this.remove([t])}}export{n as InstanceOctree};