@arcgis/core 5.1.0-next.65 → 5.1.0-next.66

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 (481) hide show
  1. package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +11 -1
  2. package/applications/KnowledgeStudio/generalSdkInternalAccess.js +1 -1
  3. package/applications/WebEditor/drawToolZSnapping.d.ts +17 -0
  4. package/applications/WebEditor/drawToolZSnapping.js +2 -0
  5. package/arcade/Dictionary.js +1 -1
  6. package/arcade/Feature.js +1 -1
  7. package/arcade/Pixel.js +1 -1
  8. package/arcade/Voxel.js +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/01be1315c60810651783.js +1 -0
  11. package/assets/esri/core/workers/chunks/02e8fc598ee09cf1b678.js +1 -0
  12. package/assets/esri/core/workers/chunks/0d650b0d090a425c9c18.js +1 -0
  13. package/assets/esri/core/workers/chunks/0e90e9ea1ad587eb3495.js +1 -0
  14. package/assets/esri/core/workers/chunks/0f196ec93925dfefc69a.js +1 -0
  15. package/assets/esri/core/workers/chunks/12294f8c32c34788b6de.js +1 -0
  16. package/assets/esri/core/workers/chunks/13a8346abe5509167578.js +1 -0
  17. package/assets/esri/core/workers/chunks/1515824f11ef5ab95378.js +1 -0
  18. package/assets/esri/core/workers/chunks/151c2766a4cacc6adbd6.js +1 -0
  19. package/assets/esri/core/workers/chunks/155f57fe9886ef322e2a.js +1 -0
  20. package/assets/esri/core/workers/chunks/170f4d83555d238e365b.js +1 -0
  21. package/assets/esri/core/workers/chunks/171cca726a763c770469.js +1 -0
  22. package/assets/esri/core/workers/chunks/17445fd8048966617d49.js +1 -0
  23. package/assets/esri/core/workers/chunks/1761dc5799850ca7b66c.js +1 -0
  24. package/assets/esri/core/workers/chunks/17d54e77001ccb48a258.js +1 -0
  25. package/assets/esri/core/workers/chunks/19afacc9a741038e4bfb.js +1 -0
  26. package/assets/esri/core/workers/chunks/1d8777266fb1c5cfca55.js +1 -0
  27. package/assets/esri/core/workers/chunks/1f16bc8c02d8c4b2f693.js +1 -0
  28. package/assets/esri/core/workers/chunks/1f76c06af4682c85bc21.js +1 -0
  29. package/assets/esri/core/workers/chunks/{9eef3cd5f519c8ae88c0.js → 205e957ffd7e95f530f7.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{fa6e1ad099b43a6f5501.js → 21a8e2a11ffacc226e2b.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{811b378fa5bf8a4d3d66.js → 224461c1d9755966d0b6.js} +1 -1
  32. package/assets/esri/core/workers/chunks/27262083d37fe623ca9c.js +1 -0
  33. package/assets/esri/core/workers/chunks/2a3145a595d19391bb8a.js +1 -0
  34. package/assets/esri/core/workers/chunks/2a65bbe6c63c384cbf5f.js +1 -0
  35. package/assets/esri/core/workers/chunks/2fa69ca3ba8c442dd7d6.js +1 -0
  36. package/assets/esri/core/workers/chunks/314140e2e9b813191907.js +1 -0
  37. package/assets/esri/core/workers/chunks/32e22d6eee9fed1f70b0.js +1 -0
  38. package/assets/esri/core/workers/chunks/{af40e2e6eaf3d2226812.js → 3464a38e758c687a28d4.js} +1 -1
  39. package/assets/esri/core/workers/chunks/38816f95e801f1c5bbad.js +1 -0
  40. package/assets/esri/core/workers/chunks/3f8e8f83ebda07d29ca8.js +1 -0
  41. package/assets/esri/core/workers/chunks/41396724040180d2537f.js +1 -0
  42. package/assets/esri/core/workers/chunks/{66baacbef23291eab853.js → 413d2fa54508e6f42c74.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{32e9e92bbbd000fbbaf7.js → 4141a3a93732996601e8.js} +2 -2
  44. package/assets/esri/core/workers/chunks/41e59d75ccb51a238739.js +1 -0
  45. package/assets/esri/core/workers/chunks/44016e1176629c36bc11.js +1 -0
  46. package/assets/esri/core/workers/chunks/468c70e5fdb61dfaad80.js +1 -0
  47. package/assets/esri/core/workers/chunks/4d069a0ebadb9c53b550.js +1 -0
  48. package/assets/esri/core/workers/chunks/4e7b084f7104deea1ddb.js +1 -0
  49. package/assets/esri/core/workers/chunks/{9c72127de7afcbaafbaf.js → 51852ef71ac04954fdae.js} +1 -1
  50. package/assets/esri/core/workers/chunks/549a51dedcc49f366e53.js +1 -0
  51. package/assets/esri/core/workers/chunks/{42e084704dea6e4135b6.js → 54c0306082d30d59cba2.js} +1 -1
  52. package/assets/esri/core/workers/chunks/56036327e721f9c42b33.js +1 -0
  53. package/assets/esri/core/workers/chunks/57cdd5d4ae073d5ca725.js +1 -0
  54. package/assets/esri/core/workers/chunks/5b9257c5359fa05f4f28.js +1 -0
  55. package/assets/esri/core/workers/chunks/5d574079f0e96e883aab.js +1 -0
  56. package/assets/esri/core/workers/chunks/5d967bcf71c05ddb1ab6.js +1 -0
  57. package/assets/esri/core/workers/chunks/5fccb372b4d5ee2f64cc.js +1 -0
  58. package/assets/esri/core/workers/chunks/61778185d702da468b00.js +1 -0
  59. package/assets/esri/core/workers/chunks/61794a861a9209b72622.js +1 -0
  60. package/assets/esri/core/workers/chunks/61b49cdaf288f36f9288.js +1 -0
  61. package/assets/esri/core/workers/chunks/{8ea67b502f9355dab7e9.js → 621ea864e2774f160d1c.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{9d289cee96e7c7fe1029.js → 62a2da0ffc67f98445c1.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{254898b41cabe313b6ce.js → 62d96b012c2d6f601863.js} +1 -1
  64. package/assets/esri/core/workers/chunks/644dd906bee3ef465ec0.js +1 -0
  65. package/assets/esri/core/workers/chunks/66692d6edc1bd96645e2.js +1 -0
  66. package/assets/esri/core/workers/chunks/679086351352756b33c9.js +1 -0
  67. package/assets/esri/core/workers/chunks/681e97ebbf9c69c410c6.js +1 -0
  68. package/assets/esri/core/workers/chunks/69520cad347947b09f21.js +1 -0
  69. package/assets/esri/core/workers/chunks/{c86b15f6a18880f921cd.js → 6a567755b67c06d16f21.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{fdf4c1f202cfddf0f226.js → 6d11ec355e5474b2968b.js} +1 -1
  71. package/assets/esri/core/workers/chunks/6e7bb6d3e739527116a4.js +1 -0
  72. package/assets/esri/core/workers/chunks/751f3cfb000045ac78bb.js +1 -0
  73. package/assets/esri/core/workers/chunks/{64ad6130de549083caba.js → 789357e0f79823f145dd.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{b6d94cbd1c5adad2f247.js → 78fbfc03d9b827c3f767.js} +1 -1
  75. package/assets/esri/core/workers/chunks/79df97e3f5975b42dc4d.js +1 -0
  76. package/assets/esri/core/workers/chunks/{25e4568a3ff76f48ac5e.js → 7a56c836c89a8b978800.js} +1 -1
  77. package/assets/esri/core/workers/chunks/7e9b790fe01b89acdf6d.js +1 -0
  78. package/assets/esri/core/workers/chunks/7fb9a5bc22d7581f1d20.js +1 -0
  79. package/assets/esri/core/workers/chunks/{5c1abb46b9937a050c32.js → 7ffcd308087c35adda04.js} +1 -1
  80. package/assets/esri/core/workers/chunks/84eb889b9cce35dac2e5.js +1 -0
  81. package/assets/esri/core/workers/chunks/891d97d0da6361d63679.js +1 -0
  82. package/assets/esri/core/workers/chunks/8a0f254d45d00b293479.js +1 -0
  83. package/assets/esri/core/workers/chunks/8ede12f54b215c52cf3c.js +1 -0
  84. package/assets/esri/core/workers/chunks/8fed6becd107d2ed9bbd.js +1 -0
  85. package/assets/esri/core/workers/chunks/90cef6f96df7dc27db39.js +1 -0
  86. package/assets/esri/core/workers/chunks/921c30b7f4dfc3e018d9.js +1 -0
  87. package/assets/esri/core/workers/chunks/927773ed23b1fc245bf7.js +1 -0
  88. package/assets/esri/core/workers/chunks/{b056b4c79bcd542dd1d2.js → 9622a83b29acb768fcb5.js} +1 -1
  89. package/assets/esri/core/workers/chunks/97062996e1e4196cfa7c.js +1 -0
  90. package/assets/esri/core/workers/chunks/97210bcb5e3cf3ac961b.js +1 -0
  91. package/assets/esri/core/workers/chunks/{f550fc8c078ebd47d7a3.js → 97e15e66e55d9149fd48.js} +1 -1
  92. package/assets/esri/core/workers/chunks/9c819ebdc98ed8b6afcf.js +1 -0
  93. package/assets/esri/core/workers/chunks/9dfd00972c12a4adc15d.js +1 -0
  94. package/assets/esri/core/workers/chunks/9fab410b9fa668dc498b.js +1 -0
  95. package/assets/esri/core/workers/chunks/a118de5a163ae42bee60.js +1 -0
  96. package/assets/esri/core/workers/chunks/a4b6fdbc995be03d2afb.js +1 -0
  97. package/assets/esri/core/workers/chunks/a59db907ec1e31002100.js +1 -0
  98. package/assets/esri/core/workers/chunks/a5b395e518e4c5fc95d0.js +1414 -0
  99. package/assets/esri/core/workers/chunks/a5d9dbb1fef8c4465943.js +1 -0
  100. package/assets/esri/core/workers/chunks/{62c2757f5dc4aaca2df8.js → a73e8b80760dc88f926f.js} +1 -1
  101. package/assets/esri/core/workers/chunks/a96692514dcaa50340dd.js +1 -0
  102. package/assets/esri/core/workers/chunks/b4fb4484fa39eede1f62.js +1 -0
  103. package/assets/esri/core/workers/chunks/b50a42a9f96515beb929.js +1 -0
  104. package/assets/esri/core/workers/chunks/b8bf3e8b8b870f69f231.js +1 -0
  105. package/assets/esri/core/workers/chunks/b8e85b7d5eed6e7c79b5.js +1 -0
  106. package/assets/esri/core/workers/chunks/{fd629a3ab558adf52617.js → bc2c7cb99e227ddbd3a6.js} +1 -1
  107. package/assets/esri/core/workers/chunks/bc85bb82cfcbc216fa31.js +1 -0
  108. package/assets/esri/core/workers/chunks/{4eca871ca51a59f6540a.js → bcb8a25438c66815e37a.js} +1 -1
  109. package/assets/esri/core/workers/chunks/be1e4c3ec53fc92a26f1.js +1 -0
  110. package/assets/esri/core/workers/chunks/be4d13088a557b7de4b1.js +1 -0
  111. package/assets/esri/core/workers/chunks/bf758d57091fa534c1f8.js +1 -0
  112. package/assets/esri/core/workers/chunks/bfd516c37fb717e14d71.js +1 -0
  113. package/assets/esri/core/workers/chunks/c22945637a40355fbe61.js +1 -0
  114. package/assets/esri/core/workers/chunks/c25a58d9f94aaa96957d.js +1 -0
  115. package/assets/esri/core/workers/chunks/c4e936879c6cb25cf586.js +1 -0
  116. package/assets/esri/core/workers/chunks/c6a43f748dbf8bac4bb5.js +1 -0
  117. package/assets/esri/core/workers/chunks/cb9185ed31109781fe59.js +1 -0
  118. package/assets/esri/core/workers/chunks/d21fdd67477800101f3b.js +1 -0
  119. package/assets/esri/core/workers/chunks/d264aed5dbe09e34040f.js +1 -0
  120. package/assets/esri/core/workers/chunks/d315098b038a96084ff5.js +1 -0
  121. package/assets/esri/core/workers/chunks/d4465fd3319d0b6a26cc.js +1 -0
  122. package/assets/esri/core/workers/chunks/{13eb0162d95b4d27389c.js → d598d08dbf2796742e8c.js} +1 -1
  123. package/assets/esri/core/workers/chunks/d5c7ebfd5c2ca635a7a8.js +1 -0
  124. package/assets/esri/core/workers/chunks/{d4368e281c12fa7c17c5.js → d635f97b7b82a37482d6.js} +1 -1
  125. package/assets/esri/core/workers/chunks/d7b92bd9198dd3b27eb5.js +1 -0
  126. package/assets/esri/core/workers/chunks/d83ac66478a419e08af6.js +1 -0
  127. package/assets/esri/core/workers/chunks/d8dde0d1759e009b8373.js +1 -0
  128. package/assets/esri/core/workers/chunks/d94dfb2ce31e59b3306b.js +1 -0
  129. package/assets/esri/core/workers/chunks/{0f3b8a08f843a080af0d.js → deddf6ae4498a3d0d0e5.js} +1 -1
  130. package/assets/esri/core/workers/chunks/{45f1e682668cffc00b44.js → e0df7554b1679168663d.js} +1 -1
  131. package/assets/esri/core/workers/chunks/e0fcb5fa0e9f21fde2b6.js +1 -0
  132. package/assets/esri/core/workers/chunks/e305ced975d885c28e7e.js +1 -0
  133. package/assets/esri/core/workers/chunks/e3c60b7df2740e600066.js +1 -0
  134. package/assets/esri/core/workers/chunks/e611cd03eee4fae7c413.js +1 -0
  135. package/assets/esri/core/workers/chunks/e64a92b6f4075616f40f.js +1 -0
  136. package/assets/esri/core/workers/chunks/e78b442417f6a903b9b1.js +1 -0
  137. package/assets/esri/core/workers/chunks/{ba72989749543122a6fe.js → e9f2b573f482718306e6.js} +1 -1
  138. package/assets/esri/core/workers/chunks/ea6d3b7c7d720aa7bc94.js +1 -0
  139. package/assets/esri/core/workers/chunks/eab1b45ab5a802e29f8c.js +1 -0
  140. package/assets/esri/core/workers/chunks/eb7392799a01c2a8497a.js +1 -0
  141. package/assets/esri/core/workers/chunks/{c17c3453d014dc73fe0b.js → ef013a77950c1902de11.js} +1 -1
  142. package/assets/esri/core/workers/chunks/ef0fe4e1a9e960a74c60.js +1 -0
  143. package/assets/esri/core/workers/chunks/efbbcf467b2a27a92b85.js +1 -0
  144. package/assets/esri/core/workers/chunks/f201edf9b68717a6106d.js +1 -0
  145. package/assets/esri/core/workers/chunks/f43a63094190d2074cd0.js +1 -0
  146. package/assets/esri/core/workers/chunks/f59f1db572be1f19887f.js +1 -0
  147. package/assets/esri/core/workers/chunks/{dc07dc1cd30edc0c4193.js → f62e42659b406435573d.js} +1 -1
  148. package/assets/esri/core/workers/chunks/fa160a2a5dc9f5a7c34b.js +1 -0
  149. package/assets/esri/core/workers/chunks/fa7ae035472540999721.js +1 -0
  150. package/assets/esri/core/workers/chunks/fe3b42eadcdd9ba54f05.js +1 -0
  151. package/assets/esri/core/workers/chunks/fee31d9297648219375d.js +1 -0
  152. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ar.json +1 -1
  153. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bg.json +1 -1
  154. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bs.json +1 -1
  155. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ca.json +1 -1
  156. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_cs.json +1 -1
  157. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_da.json +1 -1
  158. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_de.json +1 -1
  159. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_el.json +1 -1
  160. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_es.json +1 -1
  161. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_et.json +1 -1
  162. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fi.json +1 -1
  163. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fr.json +1 -1
  164. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_he.json +1 -1
  165. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hr.json +1 -1
  166. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hu.json +1 -1
  167. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_id.json +1 -1
  168. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_it.json +1 -1
  169. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ja.json +1 -1
  170. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ko.json +1 -1
  171. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lt.json +1 -1
  172. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lv.json +1 -1
  173. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_nl.json +1 -1
  174. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_no.json +1 -1
  175. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pl.json +1 -1
  176. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-BR.json +1 -1
  177. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-PT.json +1 -1
  178. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ro.json +1 -1
  179. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ru.json +1 -1
  180. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sk.json +1 -1
  181. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sl.json +1 -1
  182. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sr.json +1 -1
  183. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sv.json +1 -1
  184. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_th.json +1 -1
  185. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_tr.json +1 -1
  186. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_uk.json +1 -1
  187. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_vi.json +1 -1
  188. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-CN.json +1 -1
  189. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-HK.json +1 -1
  190. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-TW.json +1 -1
  191. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  192. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  193. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  194. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  195. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  196. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  197. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  198. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  199. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  200. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  201. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  202. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  203. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  204. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  205. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  206. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  207. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  208. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  209. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  210. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  211. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  212. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  213. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  214. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  215. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  216. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  217. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  218. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  219. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  220. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  221. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  222. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  223. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  224. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  225. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  226. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  227. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  228. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  229. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  230. package/chunks/ComponentShader.glsl.js +1 -1
  231. package/chunks/DefaultMaterial.glsl.js +1 -1
  232. package/chunks/GaussianSplat.glsl.js +14 -2
  233. package/chunks/OITDim.glsl.js +3 -2
  234. package/chunks/Path.glsl.js +1 -1
  235. package/chunks/RealisticTree.glsl.js +1 -1
  236. package/chunks/ShadowCastAccumulate.glsl.js +2 -2
  237. package/chunks/ShadowHighlight.glsl.js +3 -3
  238. package/chunks/ShadowHighlightBuffer.glsl.js +1 -1
  239. package/chunks/Terrain.glsl.js +1 -1
  240. package/chunks/Water.glsl.js +1 -1
  241. package/config.js +1 -1
  242. package/core/timeUtils.js +1 -1
  243. package/core/workers/Connection.js +1 -1
  244. package/form/elements/FieldElement.d.ts +2 -2
  245. package/form/elements/inputs/DateTimeOffsetPickerInput.d.ts +1 -1
  246. package/form/elements/inputs/DateTimeOffsetPickerInput.js +1 -1
  247. package/form/elements/inputs/Input.d.ts +1 -1
  248. package/form/elements/inputs/inputUtils.js +1 -1
  249. package/form/elements/inputs.js +1 -1
  250. package/geometry/support/spatialReferenceUtils.js +1 -1
  251. package/interfaces.d.ts +4 -2
  252. package/intl.js +1 -1
  253. package/kernel.js +1 -1
  254. package/layers/FeatureLayer.d.ts +7 -0
  255. package/layers/FeatureLayer.js +1 -1
  256. package/layers/SubtypeGroupLayer.js +1 -1
  257. package/layers/VoxelWasmPerSceneView.js +1 -1
  258. package/layers/graphics/data/AttributesBuilder.js +1 -1
  259. package/layers/support/SymbolLayerDrawing.d.ts +15 -0
  260. package/layers/support/SymbolLayerDrawing.js +2 -0
  261. package/networks/support/jsonTypes.d.ts +36 -11
  262. package/package.json +4 -4
  263. package/popup/Feature.d.ts +14 -4
  264. package/popup/Features.d.ts +81 -215
  265. package/popup/Features.js +1 -1
  266. package/popup/support/FeatureAbilities.d.ts +45 -9
  267. package/popup/types.d.ts +0 -67
  268. package/smartMapping/statistics/support/utils.js +1 -1
  269. package/smartMapping/support/adapters/support/utils.js +1 -1
  270. package/support/basemapDefinitions.js +1 -1
  271. package/support/revision.js +1 -1
  272. package/symbols/cim/cimAnalyzer.js +1 -1
  273. package/symbols/cim/types.d.ts +6 -0
  274. package/views/2d/engine/Stage.js +1 -1
  275. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  276. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  277. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  278. package/views/2d/engine/webgl/Painter.js +1 -1
  279. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  280. package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
  281. package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
  282. package/views/2d/engine/webgl/effects/highlight/HighlightSurfaces.js +1 -1
  283. package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
  284. package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
  285. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  286. package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
  287. package/views/2d/engine/webgl/shaderGraph/techniques/bloom/BloomTechnique.js +1 -1
  288. package/views/2d/engine/webgl/shaderGraph/techniques/blur/BlurTechnique.js +1 -1
  289. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  290. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  291. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  292. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
  293. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  294. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  295. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  296. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BaseRasterProcessorTechnique.js +1 -1
  297. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
  298. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  299. package/views/2d/layers/BaseLayerViewGL2D.d.ts +1 -1
  300. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  301. package/views/2d/layers/features/FeatureContainer.js +1 -1
  302. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  303. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  304. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  305. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  306. package/views/2d/layers/support/DisplayGL.js +1 -1
  307. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  308. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  309. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  310. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  311. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  312. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  313. package/views/3d/terrain/support/MultiSizeFramebuffer.js +1 -1
  314. package/views/3d/webgl/ManagedFBO.js +1 -1
  315. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  316. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  317. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +18 -5
  318. package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +2 -2
  319. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +2 -2
  320. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js +1 -1
  321. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  322. package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
  323. package/views/3d/webgl-engine/effects/clouds/NoiseTextureAtlas.js +1 -1
  324. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  325. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  326. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  327. package/views/3d/webgl-engine/effects/transparency/OITDim.glsl.js +1 -1
  328. package/views/3d/webgl-engine/effects/transparency/OITDimTechniqueConfiguration.js +2 -0
  329. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  330. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  331. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  332. package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
  333. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  334. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  335. package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
  336. package/views/draw/DrawTool.js +1 -1
  337. package/views/draw/support/InteractiveHandle.js +1 -1
  338. package/views/draw/support/Reshape.js +1 -1
  339. package/views/draw/support/drawUtils.js +1 -1
  340. package/views/draw/support/reshapeTooltipUtils.js +1 -1
  341. package/views/draw/support/types.d.ts +9 -1
  342. package/views/layers/FeatureLikeLayerView.js +1 -1
  343. package/views/support/imageReprojection.js +1 -1
  344. package/views/webgl/FramebufferObject.js +1 -1
  345. package/views/webgl/RenderingContext.js +1 -1
  346. package/views/webgl/Texture.js +1 -1
  347. package/views/webgl/testFloatBufferBlend.js +1 -1
  348. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  349. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  350. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  351. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  352. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  353. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  354. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  355. package/widgets/Editor/UpdateWorkflow.js +1 -1
  356. package/widgets/Editor/Workflow.js +1 -1
  357. package/widgets/Feature/FeatureViewModel.d.ts +14 -4
  358. package/widgets/Feature/FeatureViewModel.js +1 -1
  359. package/widgets/FeatureForm/FieldInput.js +1 -1
  360. package/widgets/Features/FeaturesViewModel.d.ts +16 -5
  361. package/widgets/Features/FeaturesViewModel.js +1 -1
  362. package/widgets/Features.js +1 -1
  363. package/widgets/Popup/PopupViewModel.d.ts +2 -1
  364. package/widgets/Popup/PopupViewModel.js +1 -1
  365. package/widgets/Popup.d.ts +13 -4
  366. package/widgets/Popup.js +1 -1
  367. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  368. package/assets/esri/core/workers/chunks/02aaeaa988e9e7d65a7f.js +0 -1
  369. package/assets/esri/core/workers/chunks/05c8d2c0362af4511d86.js +0 -1
  370. package/assets/esri/core/workers/chunks/06868e4f52de9d918255.js +0 -1
  371. package/assets/esri/core/workers/chunks/06c0b93e276cfc1fb7ac.js +0 -1
  372. package/assets/esri/core/workers/chunks/0888baa99c9007ad63bc.js +0 -1
  373. package/assets/esri/core/workers/chunks/0de66f13e84830a654fb.js +0 -1
  374. package/assets/esri/core/workers/chunks/0f597c690e5c60fe944b.js +0 -1
  375. package/assets/esri/core/workers/chunks/0f8736242544f9e9a57a.js +0 -1
  376. package/assets/esri/core/workers/chunks/0ff12fe9e358100668d9.js +0 -1
  377. package/assets/esri/core/workers/chunks/11a8541f3909f9ffb000.js +0 -1
  378. package/assets/esri/core/workers/chunks/13a009229c96ecb7b04f.js +0 -1
  379. package/assets/esri/core/workers/chunks/185f59f90070d5d6ac94.js +0 -1
  380. package/assets/esri/core/workers/chunks/190bc75254bc0542a6be.js +0 -1
  381. package/assets/esri/core/workers/chunks/1af247c86d1c4ae8fef3.js +0 -1
  382. package/assets/esri/core/workers/chunks/2339465190c9d5ede25f.js +0 -1
  383. package/assets/esri/core/workers/chunks/23eb204d3cb818adea32.js +0 -1
  384. package/assets/esri/core/workers/chunks/241ef4a1bea20b49d812.js +0 -1
  385. package/assets/esri/core/workers/chunks/2669a7195f1de21a9cf3.js +0 -1
  386. package/assets/esri/core/workers/chunks/2a2d5f9ea42cb2eee9c6.js +0 -1
  387. package/assets/esri/core/workers/chunks/2a7e7a497823e9f05aa3.js +0 -1
  388. package/assets/esri/core/workers/chunks/31e0bfc2cab055aebf9a.js +0 -1
  389. package/assets/esri/core/workers/chunks/32360a55d1836b2a737e.js +0 -1
  390. package/assets/esri/core/workers/chunks/330da3828eefd8d72d3f.js +0 -1
  391. package/assets/esri/core/workers/chunks/34acecd7a314fed12335.js +0 -1
  392. package/assets/esri/core/workers/chunks/34fe4570eef9e73839b8.js +0 -1
  393. package/assets/esri/core/workers/chunks/368b4c0a5eecbb06feac.js +0 -1
  394. package/assets/esri/core/workers/chunks/37729578a7c4cf15eded.js +0 -1
  395. package/assets/esri/core/workers/chunks/3af1e2f0b3d30c58d0c2.js +0 -1
  396. package/assets/esri/core/workers/chunks/3c155efd5768003a91eb.js +0 -1
  397. package/assets/esri/core/workers/chunks/3d4bb59ab2f644f4d675.js +0 -1
  398. package/assets/esri/core/workers/chunks/3f0d9fdd8c37605dd85d.js +0 -1
  399. package/assets/esri/core/workers/chunks/48eca6f51112ba80bd3b.js +0 -1
  400. package/assets/esri/core/workers/chunks/4b5737021a149aa786af.js +0 -1
  401. package/assets/esri/core/workers/chunks/55214e1d9f3d98fa7ed9.js +0 -1
  402. package/assets/esri/core/workers/chunks/55a0b69cf034ac32fc25.js +0 -1
  403. package/assets/esri/core/workers/chunks/576a1784e93c5406e657.js +0 -1
  404. package/assets/esri/core/workers/chunks/59289867cce97da74e39.js +0 -1
  405. package/assets/esri/core/workers/chunks/5a6d6082c5bcb1a80eda.js +0 -1
  406. package/assets/esri/core/workers/chunks/5a9620cb66c8e64e4668.js +0 -1
  407. package/assets/esri/core/workers/chunks/5eeb6d3a7b815d41621e.js +0 -1
  408. package/assets/esri/core/workers/chunks/5f06a57b4f7d7de16bbf.js +0 -1
  409. package/assets/esri/core/workers/chunks/5f2e246ffcbdedea4de5.js +0 -1
  410. package/assets/esri/core/workers/chunks/5ff41f43e57be0557541.js +0 -1414
  411. package/assets/esri/core/workers/chunks/6b32b3f98872771ff81e.js +0 -1
  412. package/assets/esri/core/workers/chunks/6be9d00839002f24fafd.js +0 -1
  413. package/assets/esri/core/workers/chunks/6c886f19875291d02407.js +0 -1
  414. package/assets/esri/core/workers/chunks/77f6659e400064d38130.js +0 -1
  415. package/assets/esri/core/workers/chunks/78c7eace6ec3fa5c7413.js +0 -1
  416. package/assets/esri/core/workers/chunks/7cee28575fd57430cf02.js +0 -1
  417. package/assets/esri/core/workers/chunks/82e0691995d821137d5f.js +0 -1
  418. package/assets/esri/core/workers/chunks/8435b6bf356959009b76.js +0 -1
  419. package/assets/esri/core/workers/chunks/8677865189081e0b83bc.js +0 -1
  420. package/assets/esri/core/workers/chunks/86f1aa2c108f5224d8b5.js +0 -1
  421. package/assets/esri/core/workers/chunks/86f70bd786d6d57fde69.js +0 -1
  422. package/assets/esri/core/workers/chunks/8878ab87ef7961fafae8.js +0 -1
  423. package/assets/esri/core/workers/chunks/8a893f23827769d42092.js +0 -1
  424. package/assets/esri/core/workers/chunks/8d1d0c3f0532aa98487d.js +0 -1
  425. package/assets/esri/core/workers/chunks/8e68b4628e9616356c34.js +0 -1
  426. package/assets/esri/core/workers/chunks/8edae79554843dd77ada.js +0 -1
  427. package/assets/esri/core/workers/chunks/9032c040b214b5af775b.js +0 -1
  428. package/assets/esri/core/workers/chunks/909ef35fa33be2b6da41.js +0 -1
  429. package/assets/esri/core/workers/chunks/90b7acc70adba193b215.js +0 -1
  430. package/assets/esri/core/workers/chunks/91718795fc4ca6516ac7.js +0 -1
  431. package/assets/esri/core/workers/chunks/92d4e962284e13ba2fc5.js +0 -1
  432. package/assets/esri/core/workers/chunks/94f80c46ccf5e19038b8.js +0 -1
  433. package/assets/esri/core/workers/chunks/979c2f52b6d6e1e8241b.js +0 -1
  434. package/assets/esri/core/workers/chunks/97f10efb0fe05bedcebd.js +0 -1
  435. package/assets/esri/core/workers/chunks/98f5bf1b91f3696b2fce.js +0 -1
  436. package/assets/esri/core/workers/chunks/9c52d4b54dfdb69dee29.js +0 -1
  437. package/assets/esri/core/workers/chunks/9de8149ae0a0726a4ab2.js +0 -1
  438. package/assets/esri/core/workers/chunks/9def5d17b94e5db71883.js +0 -1
  439. package/assets/esri/core/workers/chunks/9f272445c285ee9abb7b.js +0 -1
  440. package/assets/esri/core/workers/chunks/a10be7eb05a007fff1ed.js +0 -1
  441. package/assets/esri/core/workers/chunks/a32c87b89567a9fd1efc.js +0 -1
  442. package/assets/esri/core/workers/chunks/a3b29eca5807978fb2a3.js +0 -1
  443. package/assets/esri/core/workers/chunks/a446dff865332268625a.js +0 -1
  444. package/assets/esri/core/workers/chunks/a5bf2718c02a0e645013.js +0 -1
  445. package/assets/esri/core/workers/chunks/a6d166058e3025bb280e.js +0 -1
  446. package/assets/esri/core/workers/chunks/a8e111a5cfd6151d5dbb.js +0 -1
  447. package/assets/esri/core/workers/chunks/aed45f7e7eee154a21b8.js +0 -1
  448. package/assets/esri/core/workers/chunks/af3bd661b355eed3da21.js +0 -1
  449. package/assets/esri/core/workers/chunks/b0f2ce61d3cad413898e.js +0 -1
  450. package/assets/esri/core/workers/chunks/b2b77598048818c957b7.js +0 -1
  451. package/assets/esri/core/workers/chunks/b744b950999b92393e37.js +0 -1
  452. package/assets/esri/core/workers/chunks/b75165880704efccc47c.js +0 -1
  453. package/assets/esri/core/workers/chunks/ba9e107edc2027238be3.js +0 -1
  454. package/assets/esri/core/workers/chunks/bc3b22dc08c147b8d425.js +0 -1
  455. package/assets/esri/core/workers/chunks/c08e9914deb1dc62bc0f.js +0 -1
  456. package/assets/esri/core/workers/chunks/c0bb53d8d58ad18334d3.js +0 -1
  457. package/assets/esri/core/workers/chunks/c0d453f93af2d4a6ce64.js +0 -1
  458. package/assets/esri/core/workers/chunks/c9a42d86185a0ad35dd1.js +0 -1
  459. package/assets/esri/core/workers/chunks/cbb50415f7de8746ee1a.js +0 -1
  460. package/assets/esri/core/workers/chunks/d23dd7da45a7aa341540.js +0 -1
  461. package/assets/esri/core/workers/chunks/d2801df3fa44dee15ec8.js +0 -1
  462. package/assets/esri/core/workers/chunks/d53b31c9056f82831bc0.js +0 -1
  463. package/assets/esri/core/workers/chunks/d626e08d23330d84413b.js +0 -1
  464. package/assets/esri/core/workers/chunks/d9d69cf2496ebe76eade.js +0 -1
  465. package/assets/esri/core/workers/chunks/db6e03fe8dd316f5005f.js +0 -1
  466. package/assets/esri/core/workers/chunks/de79645e559a2d1ffa67.js +0 -1
  467. package/assets/esri/core/workers/chunks/e2779965db231fb666a5.js +0 -1
  468. package/assets/esri/core/workers/chunks/e4e2f059c52674dcae5b.js +0 -1
  469. package/assets/esri/core/workers/chunks/e622a23034f055de8b55.js +0 -1
  470. package/assets/esri/core/workers/chunks/ec21311584e4fb13e510.js +0 -1
  471. package/assets/esri/core/workers/chunks/ec9d5dcf2a0a11c85341.js +0 -1
  472. package/assets/esri/core/workers/chunks/eca45cd479f7fd28ca6e.js +0 -1
  473. package/assets/esri/core/workers/chunks/efdd75896ca53eb6242f.js +0 -1
  474. package/assets/esri/core/workers/chunks/f1c348cf2a1e35da9b20.js +0 -1
  475. package/assets/esri/core/workers/chunks/f4053e4e2d6e678db48a.js +0 -1
  476. package/assets/esri/core/workers/chunks/f4d577ff61da7964e08a.js +0 -1
  477. package/assets/esri/core/workers/chunks/f7da652f8dab57677cc3.js +0 -1
  478. package/assets/esri/core/workers/chunks/fe92f54e45fd21ccd75f.js +0 -1
  479. package/assets/esri/core/workers/chunks/fee1d873127dca02459f.js +0 -1
  480. package/assets/esri/core/workers/chunks/ff31936236dd9b1acb24.js +0 -1
  481. /package/assets/esri/core/workers/chunks/{32e9e92bbbd000fbbaf7.js.LICENSE.txt → 4141a3a93732996601e8.js.LICENSE.txt} +0 -0
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{create as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Float4BindUniform as e}from"../../shaderModules/Float4BindUniform.js";import{glsl as o}from"../../shaderModules/glsl.js";import{IntegerBindUniform as s}from"../../shaderModules/IntegerBindUniform.js";import{Matrix4sDrawUniform as i}from"../../shaderModules/Matrix4sDrawUniform.js";import{Matrix4sPassUniform as t}from"../../shaderModules/Matrix4sPassUniform.js";import{NoParameters as r}from"../../../../../webgl/NoParameters.js";class d extends r{constructor(){super(...arguments),this.origin=a()}}function c(a){a.fragment.uniforms.add(new t("shadowMapMatrix",(a,e)=>e.shadowMap.getShadowMapMatrices(a.origin),4)),l(a)}function n(a){a.fragment.uniforms.add(new i("shadowMapMatrix",(a,e)=>e.shadowMap.getShadowMapMatrices(a.origin),4)),l(a)}function l(a){const{fragment:i}=a;i.uniforms.add(new e("cascadeDistances",a=>a.shadowMap.cascadeDistances),new s("numCascades",a=>a.shadowMap.numCascades)),i.code.add(o`const vec3 invalidShadowmapUVZ = vec3(0.0, 0.0, -1.0);
2
+ import{create as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Float4BindUniform as e}from"../../shaderModules/Float4BindUniform.js";import{glsl as o}from"../../shaderModules/glsl.js";import{IntegerBindUniform as s}from"../../shaderModules/IntegerBindUniform.js";import{Matrix4sDrawUniform as i}from"../../shaderModules/Matrix4sDrawUniform.js";import{Matrix4sPassUniform as t}from"../../shaderModules/Matrix4sPassUniform.js";import{NoParameters as r}from"../../../../../webgl/NoParameters.js";class d extends r{constructor(){super(...arguments),this.origin=a()}}function c(a){a.uniforms.add(new t("shadowMapMatrix",(a,e)=>e.shadowMap.getShadowMapMatrices(a.origin),4)),a.include(l)}function n(a){a.uniforms.add(new i("shadowMapMatrix",(a,e)=>e.shadowMap.getShadowMapMatrices(a.origin),4)),a.include(l)}function l(a){a.uniforms.add(new e("cascadeDistances",a=>a.shadowMap.cascadeDistances),new s("numCascades",a=>a.shadowMap.numCascades)),a.code.add(p)}const p=o`const vec3 invalidShadowmapUVZ = vec3(0.0, 0.0, -1.0);
3
3
  vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
4
4
  vec4 lv = mat * vec4(_vpos, 1.0);
5
5
  lv.xy /= lv.w;
@@ -21,4 +21,4 @@ return invalidShadowmapUVZ;
21
21
  }
22
22
  vec2 uvShadow = cascadeCoordinates(i, shadowMapSize, lvpos);
23
23
  return vec3(uvShadow, lvpos.z);
24
- }`)}export{d as ReadShadowMapOrigin,n as calculateUVZShadowDraw,c as calculateUVZShadowPass};
24
+ }`;export{d as ReadShadowMapOrigin,n as calculateUVZShadowDraw,c as calculateUVZShadowPass};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{invert as e,translate as r}from"../../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ReadDepth as a}from"../output/ReadDepth.glsl.js";import{calculateUVZShadowPass as o,calculateUVZShadowDraw as i}from"./calculateUVZShadow.glsl.js";import{CameraSpace as l}from"../util/CameraSpace.glsl.js";import{glsl as c}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as n}from"../../shaderModules/Matrix4BindUniform.js";function p(e){e.include(o),s(e)}function d(e){e.include(i),s(e)}function s(t){t.fragment.include(a),t.include(l),t.fragment.uniforms.add(new n("inverseViewMatrix",({camera:t})=>e(u,r(u,t.viewMatrix,t.center)))).code.add(c`vec3 calculateUVZShadowAndPixelPosFromDepth(
2
+ import{invert as e,translate as r}from"../../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ReadDepth as a}from"../output/ReadDepth.glsl.js";import{calculateUVZShadowPass as o,calculateUVZShadowDraw as i}from"./calculateUVZShadow.glsl.js";import{CameraSpace as l}from"../util/CameraSpace.glsl.js";import{glsl as c}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as n}from"../../shaderModules/Matrix4BindUniform.js";function p(e){e.fragment.include(o),s(e)}function d(e){e.fragment.include(i),s(e)}function s(t){t.fragment.include(a),t.include(l),t.fragment.uniforms.add(new n("inverseViewMatrix",({camera:t})=>e(u,r(u,t.viewMatrix,t.center)))).code.add(c`vec3 calculateUVZShadowAndPixelPosFromDepth(
3
3
  in vec2 _uv,
4
4
  ivec2 shadowMapSize,
5
5
  in sampler2D _depthMap,
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{removeUnordered as e}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{sort as t}from"../../../../core/heapSort.js";import{isPromiseLike as r,createAbortError as s}from"../../../../core/promiseUtils.js";import{signal as n}from"../../../../core/signal.js";import{someEmissions as o}from"./emissive/emissions.js";import{DepthRange as i}from"../lib/DepthRange.js";class h{constructor(e){this.context=e,this._renderPlugins=new Array,this._slots=new Array,this._version=n(0);for(let t=0;t<21;++t)this._slots[t]=[]}destroy(){this._renderPlugins.forEach(e=>e.destroy()),this._renderPlugins.length=0}get plugins(){return this._renderPlugins}add(e,t){const n=()=>{if(t?.aborted)throw e.uninitializeRenderContext(),s();this._renderPlugins.push(e),e.produces.forEach((t,r)=>this._slots[r].push(e)),this.context.requestRender(),this._version.value++},o=e.initializeRenderContext(this.context,t);if(r(o))return o.then(n);n()}remove(t){e(this._renderPlugins,t),t.uninitializeRenderContext();for(let e=0;e<this._slots.length;++e)this._slots[e]=this._slots[e].filter(e=>e!==t);this.context.requestRender(),this._version.value++}sortTestsTransparentOrderedSlots(e){if("test"!==process.env.NODE_ENV)return;if(this._renderPlugins.some(e=>0!==e.testsTransparentRenderOrder))for(const r of e){const e=this._slots[r];t(e,0,e.length,(e,t)=>(e.testsTransparentRenderOrder??0)-(t.testsTransparentRenderOrder??0))}}prepareRender(){this._renderPlugins.forEach(e=>{e.prepareRender&&e.prepareRender(this.context.renderContext)})}updateAnimation(e){let t=!1;return this._renderPlugins.forEach(r=>t=r.updateAnimation?.(e)||t),t}precompile(...e){++this.context.techniques.precompiling;const t=this.context.renderContext.bind.slot;for(const r of e)this.context.renderContext.bind.slot=r,this._forEachRender(()=>{});this.context.renderContext.bind.slot=t,--this.context.techniques.precompiling}render(...e){for(const t of e)this.context.renderContext.bind.slot=t,this._forEachRender((e,t)=>e.render(this.context.renderContext,t))}_forEachRender(e){const t=this.context.renderContext.bind.slot,r=this.context.renderContext.output;this._slots[t].forEach(s=>{const n=s.produces.get(t);if(!n?.(r)||s.isDecoration&&!this.context.renderContext.bind.decorations)return;const o=s.acquireTechniques(this.context.renderContext);o&&e(s,o)})}queryDepthRange(e){return this._renderPlugins.reduce((t,r)=>t.union(r.queryDepthRange?.(e)),new i)}get updating(){return this._version.value>=0&&this._renderPlugins.some(e=>e.readyToRun)}produces(e,...t){return t.some(t=>this._slots[t].some(r=>{const s=r.produces.get(t);return!!s&&s(e)}))}hasHighlight(e){return d.some(t=>this._slots[t].some(t=>t.hasHighlight(e)))}get hasDecorations(){return this._renderPlugins.some(e=>e.isDecoration)}get hasOccludees(){return this._renderPlugins.some(e=>e.hasOccludees)}get hasEmissions(){return o(this._renderPlugins)}get renderOccludedFlags(){return this._renderPlugins.reduce((e,t)=>e|(t.renderOccludedFlags??0),0)}get usedMemory(){return this._renderPlugins.reduce((e,t)=>t.material?e:e+(t.usedMemory??0),0)}get test(){}}const d=[2,4,19,13,14,15];export{h as RenderPluginManager};
2
+ import{removeUnordered as e}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{sort as t}from"../../../../core/heapSort.js";import{isPromiseLike as r,createAbortError as s}from"../../../../core/promiseUtils.js";import{signal as n}from"../../../../core/signal.js";import{someEmissions as o}from"./emissive/emissions.js";import{DepthRange as i}from"../lib/DepthRange.js";class h{constructor(e){this.context=e,this._renderPlugins=new Array,this._slots=new Array,this._version=n(0);for(let t=0;t<21;++t)this._slots[t]=[]}destroy(){this._renderPlugins.forEach(e=>e.destroy()),this._renderPlugins.length=0}get plugins(){return this._renderPlugins}add(e,t){const n=()=>{if(t?.aborted)throw e.uninitializeRenderContext(),s();this._renderPlugins.push(e),e.produces.forEach((t,r)=>this._slots[r].push(e)),this.context.requestRender(),this._version.value++},o=e.initializeRenderContext(this.context,t);if(r(o))return o.then(n);n()}remove(t){e(this._renderPlugins,t),t.uninitializeRenderContext();for(let e=0;e<this._slots.length;++e)this._slots[e]=this._slots[e].filter(e=>e!==t);this.context.requestRender(),this._version.value++}sortTestsTransparentOrderedSlots(e){if("test"!==process.env.NODE_ENV)return;if(this._renderPlugins.some(e=>0!==e.testsTransparentRenderOrder))for(const r of e){const e=this._slots[r];t(e,0,e.length,(e,t)=>(e.testsTransparentRenderOrder??0)-(t.testsTransparentRenderOrder??0))}}prepareRender(){this._renderPlugins.forEach(e=>e.prepareRender?.(this.context.renderContext))}updateAnimation(e){let t=!1;return this._renderPlugins.forEach(r=>t=r.updateAnimation?.(e)||t),t}precompile(...e){++this.context.techniques.precompiling;const t=this.context.renderContext.bind.slot;for(const r of e)this.context.renderContext.bind.slot=r,this._forEachRender(()=>{});this.context.renderContext.bind.slot=t,--this.context.techniques.precompiling}render(...e){for(const t of e)this.context.renderContext.bind.slot=t,this._forEachRender((e,t)=>e.render(this.context.renderContext,t))}_forEachRender(e){const t=this.context.renderContext.bind.slot,r=this.context.renderContext.output;this._slots[t].forEach(s=>{const n=s.produces.get(t);if(!n?.(r)||s.isDecoration&&!this.context.renderContext.bind.decorations)return;const o=s.acquireTechniques(this.context.renderContext);o&&e(s,o)})}queryDepthRange(e){return this._renderPlugins.reduce((t,r)=>t.union(r.queryDepthRange?.(e)),new i)}get updating(){return this._version.value>=0&&this._renderPlugins.some(e=>e.readyToRun)}produces(e,...t){return t.some(t=>this._slots[t].some(r=>{const s=r.produces.get(t);return!!s&&s(e)}))}hasHighlight(e){return d.some(t=>this._slots[t].some(t=>t.hasHighlight(e)))}get hasDecorations(){return this._renderPlugins.some(e=>e.isDecoration)}get hasOccludees(){return this._renderPlugins.some(e=>e.hasOccludees)}get hasEmissions(){return o(this._renderPlugins)}get renderOccludedFlags(){return this._renderPlugins.reduce((e,t)=>e|(t.renderOccludedFlags??0),0)}get usedMemory(){return this._renderPlugins.reduce((e,t)=>t.material?e:e+(t.usedMemory??0),0)}get test(){}}const d=[2,4,19,13,14,15];export{h as RenderPluginManager};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import{lerp as s}from"../../../../../core/mathUtils.js";import{destroyMaybe as i,disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as o,initial as a}from"../../../../../core/reactiveUtils.js";import{signal as h}from"../../../../../core/signal.js";import{property as n,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as c}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{targetTo as u}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{equals as p,copy as m,set as f}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{clone as _,ZEROS as g,zeros as x}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as y}from"../../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{zeros as b}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../../../geometry/ellipsoidUtils.js";import{C as v,c as S}from"../../../../../chunks/Clouds.glsl.js";import{cloudPresets as w}from"./CloudsPresets.js";import{CloudsTechnique as C}from"./CloudsTechnique.js";import{CloudsTechniqueConfiguration as P}from"./CloudsTechniqueConfiguration.js";import{NoiseTextureAtlas as j}from"./NoiseTextureAtlas.js";import{TaskPriority as z}from"../../../../support/Scheduler.js";import{Yield as I}from"../../../../support/Yield.js";import{ColorAttachment0 as M}from"../../../../webgl/enums.js";import{FramebufferObject as H}from"../../../../webgl/FramebufferObject.js";import{TextureDescriptor as q}from"../../../../webgl/TextureDescriptor.js";let R=class extends e{constructor(t){super(t),this._state=h(0),this._passParameters=new v,this._weatherTileCount=128,this._sliceIndex=0,this._tileIndex=0,this._tilesPerSlice=1,this.coverage=s(w.default.coverage[0],w.default.coverage[1],.5),this.density=s(w.default.density[0],w.default.density[1],.5),this.absorption=s(w.default.absorption[0],w.default.absorption[1],.5),this.cloudSize=s(w.default.cloudSize[0],w.default.cloudSize[1],.5),this.detailSize=s(w.default.detailSize[0],w.default.detailSize[1],.5),this.smoothness=s(w.default.smoothness[0],w.default.smoothness[1],.5),this.cloudHeight=s(w.default.cloudHeight[0],w.default.cloudHeight[1],.5),this.raymarchingSteps=w.default.raymarchingSteps,this._viewMatrix=d(),this._dirty=!0,this.readyToRun=!0,this._configuration=new P}initialize(){const t=T(this.view.spatialReference);this._passParameters.cloudRadius=.5*t.radius;const e=()=>this.setDirty();this.addHandles([this.view.resourceController.scheduler.registerTask(z.CLOUDS_GENERATOR,this),o(()=>this.coverage,e,a),o(()=>this.density,e,a),o(()=>this.absorption,e,a),o(()=>this.cloudSize,e,a),o(()=>this.detailSize,e,a),o(()=>this.smoothness,e,a),o(()=>this.cloudHeight,e,a),o(()=>this.raymarchingSteps,e,a)]);const s=_(this._computeWeatherTile());let i=0;this.addHandles(o(()=>{const t=this._computeWeatherTile();return p(s,t)||(++i,m(s,t)),i},e))}destroy(){this.destroyCubeMap(),this._passParameters.noiseTexture=i(this._passParameters.noiseTexture)}_precompile(){this._configuration.steps=this.raymarchingSteps,this._configuration.writeTextureChannels=1-this.parameters.readChannels,this.context.techniques.precompile(C,this._configuration)}_acquireTechnique(){switch(this.raymarchingSteps){case 0:this._tilesPerSlice=1;break;case 1:this._tilesPerSlice=4;break;case 3:case 2:this._tilesPerSlice=8;break;default:this.raymarchingSteps}return this._configuration.steps=this.raymarchingSteps,this._configuration.writeTextureChannels=1-this.parameters.readChannels,this.context.techniques.getCompiled(C,this._configuration)}_computeWeatherTile(){const{camera:t,environment:e}=this.view,{latitude:s,longitude:i}=t.position;if(null==s||null==i)return g;f(D,(s+90)/180,(i+180)/360);const r=Math.floor(this._weatherTileCount*Math.abs(2*D[0]-1));D[0]=Math.floor(2*this._weatherTileCount*D[0]),D[1]=Math.floor(4*(this._weatherTileCount-r)*D[1]);let o=0,a=0;if("virtual"!==e?.lighting?.type&&null!=e?.lighting?.date){const t=new Date(e.lighting.date);t.setUTCHours(e.lighting.date.getUTCHours()+(e.lighting.displayUTCOffset??0)),o=31*t.getUTCMonth()+t.getUTCDate(),a=t.getUTCFullYear()}return D[0]=(D[0]+o)%(2*this._weatherTileCount),D[1]=(D[1]+a%100)%(4*this._weatherTileCount),D}get state(){return this._state.value}set state(t){this._state.value=t}get usedMemory(){return(this._fbo?.usedMemory??0)+(this._passParameters.noiseTexture?.textureAtlas?.usedMemory??0)}_ensureNoiseTexture(){return this._passParameters.noiseTexture??=new j({context:this.context}),this._passParameters.noiseTexture}_ensureFrameBufferCube(t){const e=this.context.rctx;if(null==this._fbo){const s=new q(t,t/2);s.target=35866,s.depth=6,s.wrapMode=33071,this._fbo=new H(e,s),this.parameters.data=this,this.parameters.absorption=this.absorption,this.parameters.coverage=this.coverage}return e.unbindTexture(this._fbo.colorTexture),this._fbo}get cubeMap(){return this._fbo}get parameters(){return this.context.bind.clouds}destroyCubeMap(){this._fbo=r(this._fbo),this.parameters.data=null}applyPreset(t,e){const i=t.median,r=t=>{const r=s(t[0],t[1],i);return e<.5?s(t[0],r,2*e):s(r,t[1],2*(e-.5))};this.coverage=r(t.coverage),this.density=r(t.density),this.absorption=r(t.absorption),this.cloudSize=r(t.cloudSize),this.detailSize=r(t.detailSize),this.smoothness=r(t.smoothness),this.cloudHeight=r(t.cloudHeight),this.raymarchingSteps=t.raymarchingSteps}setDirty(){this._dirty=this.readyToRun=!0,this._precompile()}runTask(t){if(3===this.state)return I;this._dirty&&(this._sliceIndex=this._tileIndex=0,this.state=1,this._passParameters.absorption=this.absorption,this._passParameters.density=this.density,this._passParameters.cloudSize=this.cloudSize,this._passParameters.detailSize=this.detailSize,this._passParameters.smoothness=this.smoothness,this._passParameters.cloudHeight=this.cloudHeight,this._passParameters.coverage=this.coverage,this._ensureNoiseTexture().updateWeatherMap(this._computeWeatherTile()),this._dirty=!1);const e=this._acquireTechnique();if(!this._ensureNoiseTexture().textureAtlas||!e)return I;const s=U[this._sliceIndex],i=O[this._sliceIndex];u(this._viewMatrix,k,s,i),c(this._passParameters.viewMatrix,this._viewMatrix);const r=this.context.rctx,o=r.getViewport(),a=S/this._tilesPerSlice,h=this._tileIndex*a;r.setViewport(0,h,S,a);const n=this._ensureFrameBufferCube(S);r.bindFramebuffer(n),this._passParameters.lastSlice=5===this._sliceIndex,r.bindTechnique(e,this.context.bind,this._passParameters);const l=35866;return n.setColorTextureTarget(l,M,this._sliceIndex),r.screen.draw(),r.gl.flush(),r.setViewport(o.x,o.y,o.width,o.height),this.requestRender(),++this._tileIndex,5===this._sliceIndex&&this._tileIndex===this._tilesPerSlice?(this._sliceIndex=this._tileIndex=0,this.state=2,this.readyToRun=!1):this._tileIndex===this._tilesPerSlice&&(++this._sliceIndex,this._tileIndex=0),t.madeProgress(),I}};t([n({constructOnly:!0})],R.prototype,"context",void 0),t([n({constructOnly:!0})],R.prototype,"view",void 0),t([n({constructOnly:!0})],R.prototype,"requestRender",void 0),t([n()],R.prototype,"coverage",void 0),t([n()],R.prototype,"density",void 0),t([n()],R.prototype,"absorption",void 0),t([n()],R.prototype,"cloudSize",void 0),t([n()],R.prototype,"detailSize",void 0),t([n()],R.prototype,"smoothness",void 0),t([n()],R.prototype,"cloudHeight",void 0),t([n()],R.prototype,"raymarchingSteps",void 0),t([n()],R.prototype,"readyToRun",void 0),R=t([l("esri.views.3d.webgl-engine.effects.clouds.CloudsRenderer")],R);const U=[y(1,0,0),y(-1,0,0),y(0,1,0),y(0,-1,0),y(0,0,1),y(0,0,1)],O=[y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,1,0),y(0,1,0)],k=b(),D=x();export{R as CloudsRenderer};
2
+ import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import{lerp as s}from"../../../../../core/mathUtils.js";import{destroyMaybe as i,disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as o,initial as a}from"../../../../../core/reactiveUtils.js";import{signal as h}from"../../../../../core/signal.js";import{property as n,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as c}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{targetTo as u}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{equals as p,copy as m,set as f}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{clone as _,ZEROS as g,zeros as x}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as y}from"../../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{zeros as b}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../../../geometry/ellipsoidUtils.js";import{C as v,c as S}from"../../../../../chunks/Clouds.glsl.js";import{cloudPresets as w}from"./CloudsPresets.js";import{CloudsTechnique as C}from"./CloudsTechnique.js";import{CloudsTechniqueConfiguration as P}from"./CloudsTechniqueConfiguration.js";import{NoiseTextureAtlas as j}from"./NoiseTextureAtlas.js";import{TaskPriority as z}from"../../../../support/Scheduler.js";import{Yield as I}from"../../../../support/Yield.js";import{ColorAttachment0 as M}from"../../../../webgl/enums.js";import{DisposableFramebufferObject as H}from"../../../../webgl/FramebufferObject.js";import{TextureDescriptor as q}from"../../../../webgl/TextureDescriptor.js";let R=class extends e{constructor(t){super(t),this._state=h(0),this._passParameters=new v,this._weatherTileCount=128,this._sliceIndex=0,this._tileIndex=0,this._tilesPerSlice=1,this.coverage=s(w.default.coverage[0],w.default.coverage[1],.5),this.density=s(w.default.density[0],w.default.density[1],.5),this.absorption=s(w.default.absorption[0],w.default.absorption[1],.5),this.cloudSize=s(w.default.cloudSize[0],w.default.cloudSize[1],.5),this.detailSize=s(w.default.detailSize[0],w.default.detailSize[1],.5),this.smoothness=s(w.default.smoothness[0],w.default.smoothness[1],.5),this.cloudHeight=s(w.default.cloudHeight[0],w.default.cloudHeight[1],.5),this.raymarchingSteps=w.default.raymarchingSteps,this._viewMatrix=d(),this._dirty=!0,this.readyToRun=!0,this._configuration=new P}initialize(){const t=T(this.view.spatialReference);this._passParameters.cloudRadius=.5*t.radius;const e=()=>this.setDirty();this.addHandles([this.view.resourceController.scheduler.registerTask(z.CLOUDS_GENERATOR,this),o(()=>this.coverage,e,a),o(()=>this.density,e,a),o(()=>this.absorption,e,a),o(()=>this.cloudSize,e,a),o(()=>this.detailSize,e,a),o(()=>this.smoothness,e,a),o(()=>this.cloudHeight,e,a),o(()=>this.raymarchingSteps,e,a)]);const s=_(this._computeWeatherTile());let i=0;this.addHandles(o(()=>{const t=this._computeWeatherTile();return p(s,t)||(++i,m(s,t)),i},e))}destroy(){this.destroyCubeMap(),this._passParameters.noiseTexture=i(this._passParameters.noiseTexture)}_precompile(){this._configuration.steps=this.raymarchingSteps,this._configuration.writeTextureChannels=1-this.parameters.readChannels,this.context.techniques.precompile(C,this._configuration)}_acquireTechnique(){switch(this.raymarchingSteps){case 0:this._tilesPerSlice=1;break;case 1:this._tilesPerSlice=4;break;case 3:case 2:this._tilesPerSlice=8;break;default:this.raymarchingSteps}return this._configuration.steps=this.raymarchingSteps,this._configuration.writeTextureChannels=1-this.parameters.readChannels,this.context.techniques.getCompiled(C,this._configuration)}_computeWeatherTile(){const{camera:t,environment:e}=this.view,{latitude:s,longitude:i}=t.position;if(null==s||null==i)return g;f(D,(s+90)/180,(i+180)/360);const r=Math.floor(this._weatherTileCount*Math.abs(2*D[0]-1));D[0]=Math.floor(2*this._weatherTileCount*D[0]),D[1]=Math.floor(4*(this._weatherTileCount-r)*D[1]);let o=0,a=0;if("virtual"!==e?.lighting?.type&&null!=e?.lighting?.date){const t=new Date(e.lighting.date);t.setUTCHours(e.lighting.date.getUTCHours()+(e.lighting.displayUTCOffset??0)),o=31*t.getUTCMonth()+t.getUTCDate(),a=t.getUTCFullYear()}return D[0]=(D[0]+o)%(2*this._weatherTileCount),D[1]=(D[1]+a%100)%(4*this._weatherTileCount),D}get state(){return this._state.value}set state(t){this._state.value=t}get usedMemory(){return(this._fbo?.usedMemory??0)+(this._passParameters.noiseTexture?.textureAtlas?.usedMemory??0)}_ensureNoiseTexture(){return this._passParameters.noiseTexture??=new j({context:this.context}),this._passParameters.noiseTexture}_ensureFrameBufferCube(t){const e=this.context.rctx;if(null==this._fbo){const s=new q(t,t/2);s.target=35866,s.depth=6,s.wrapMode=33071,this._fbo=new H(e,s),this.parameters.data=this,this.parameters.absorption=this.absorption,this.parameters.coverage=this.coverage}return e.unbindTexture(this._fbo.colorTexture),this._fbo}get cubeMap(){return this._fbo}get parameters(){return this.context.bind.clouds}destroyCubeMap(){this._fbo=r(this._fbo),this.parameters.data=null}applyPreset(t,e){const i=t.median,r=t=>{const r=s(t[0],t[1],i);return e<.5?s(t[0],r,2*e):s(r,t[1],2*(e-.5))};this.coverage=r(t.coverage),this.density=r(t.density),this.absorption=r(t.absorption),this.cloudSize=r(t.cloudSize),this.detailSize=r(t.detailSize),this.smoothness=r(t.smoothness),this.cloudHeight=r(t.cloudHeight),this.raymarchingSteps=t.raymarchingSteps}setDirty(){this._dirty=this.readyToRun=!0,this._precompile()}runTask(t){if(3===this.state)return I;this._dirty&&(this._sliceIndex=this._tileIndex=0,this.state=1,this._passParameters.absorption=this.absorption,this._passParameters.density=this.density,this._passParameters.cloudSize=this.cloudSize,this._passParameters.detailSize=this.detailSize,this._passParameters.smoothness=this.smoothness,this._passParameters.cloudHeight=this.cloudHeight,this._passParameters.coverage=this.coverage,this._ensureNoiseTexture().updateWeatherMap(this._computeWeatherTile()),this._dirty=!1);const e=this._acquireTechnique();if(!this._ensureNoiseTexture().textureAtlas||!e)return I;const s=U[this._sliceIndex],i=O[this._sliceIndex];u(this._viewMatrix,k,s,i),c(this._passParameters.viewMatrix,this._viewMatrix);const r=this.context.rctx,o=r.getViewport(),a=S/this._tilesPerSlice,h=this._tileIndex*a;r.setViewport(0,h,S,a);const n=this._ensureFrameBufferCube(S);r.bindFramebuffer(n),this._passParameters.lastSlice=5===this._sliceIndex,r.bindTechnique(e,this.context.bind,this._passParameters);const l=35866;return n.setColorTextureTarget(l,M,this._sliceIndex),r.screen.draw(),r.gl.flush(),r.setViewport(o.x,o.y,o.width,o.height),this.requestRender(),++this._tileIndex,5===this._sliceIndex&&this._tileIndex===this._tilesPerSlice?(this._sliceIndex=this._tileIndex=0,this.state=2,this.readyToRun=!1):this._tileIndex===this._tilesPerSlice&&(++this._sliceIndex,this._tileIndex=0),t.madeProgress(),I}};t([n({constructOnly:!0})],R.prototype,"context",void 0),t([n({constructOnly:!0})],R.prototype,"view",void 0),t([n({constructOnly:!0})],R.prototype,"requestRender",void 0),t([n()],R.prototype,"coverage",void 0),t([n()],R.prototype,"density",void 0),t([n()],R.prototype,"absorption",void 0),t([n()],R.prototype,"cloudSize",void 0),t([n()],R.prototype,"detailSize",void 0),t([n()],R.prototype,"smoothness",void 0),t([n()],R.prototype,"cloudHeight",void 0),t([n()],R.prototype,"raymarchingSteps",void 0),t([n()],R.prototype,"readyToRun",void 0),R=t([l("esri.views.3d.webgl-engine.effects.clouds.CloudsRenderer")],R);const U=[y(1,0,0),y(-1,0,0),y(0,1,0),y(0,-1,0),y(0,0,1),y(0,0,1)],O=[y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,1,0),y(0,1,0)],k=b(),D=x();export{R as CloudsRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import{equals as i,copy as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{N as c}from"../../../../../chunks/NoiseTextureAtlas.glsl.js";import{NoiseTextureAtlasTechniqueConfiguration as a}from"./NoiseTextureAtlasConfiguration.js";import{atlasSize as u}from"./NoiseTextureAtlasDimensions.js";import{NoiseTextureAtlasTechnique as h}from"./NoiseTextureAtlasTechnique.js";import{FramebufferObject as m}from"../../../../webgl/FramebufferObject.js";import{TextureDescriptor as p}from"../../../../webgl/TextureDescriptor.js";let f=class extends e{constructor(t){super(t),this._passParameters=new c,this._configuration=new a,this._fbo=new m(t.context.rctx,new p(u)),t.context.techniques.precompile(h,this._configuration)}get textureAtlas(){if(this._texture)return this._texture;const t=this.context.techniques.getCompiled(h,this._configuration);return t&&(this._texture=this._render(t)),this._texture}updateWeatherMap(t){i(this._passParameters.weatherTile,t)||(n(this._passParameters.weatherTile,t),this._configuration.mode=this._texture?1:0,this._texture=null,this.context.techniques.precompile(h,this._configuration))}destroy(){this._fbo=r(this._fbo)}_render(t){if(!this._fbo)return null;const e=this.context.rctx,r=e.getViewport();return e.setViewport(0,0,u,u),e.bindFramebuffer(this._fbo),e.bindTechnique(t,this.context.bind,this._passParameters),e.screen.draw(),e.setViewport(r.x,r.y,r.width,r.height),this._fbo.colorTexture}};t([o({constructOnly:!0})],f.prototype,"context",void 0),f=t([s("esri.views.3d.webgl-engine.effects.clouds.NoiseTextureAtlas")],f);export{f as NoiseTextureAtlas};
2
+ import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import{equals as i,copy as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{N as c}from"../../../../../chunks/NoiseTextureAtlas.glsl.js";import{NoiseTextureAtlasTechniqueConfiguration as a}from"./NoiseTextureAtlasConfiguration.js";import{atlasSize as u}from"./NoiseTextureAtlasDimensions.js";import{NoiseTextureAtlasTechnique as h}from"./NoiseTextureAtlasTechnique.js";import{DisposableFramebufferObject as m}from"../../../../webgl/FramebufferObject.js";import{TextureDescriptor as p}from"../../../../webgl/TextureDescriptor.js";let f=class extends e{constructor(t){super(t),this._passParameters=new c,this._configuration=new a,this._fbo=new m(t.context.rctx,new p(u)),t.context.techniques.precompile(h,this._configuration)}get textureAtlas(){if(this._texture)return this._texture;const t=this.context.techniques.getCompiled(h,this._configuration);return t&&(this._texture=this._render(t)),this._texture}updateWeatherMap(t){i(this._passParameters.weatherTile,t)||(n(this._passParameters.weatherTile,t),this._configuration.mode=this._texture?1:0,this._texture=null,this.context.techniques.precompile(h,this._configuration))}destroy(){this._fbo=r(this._fbo)}_render(t){if(!this._fbo)return null;const e=this.context.rctx,r=e.getViewport();return e.setViewport(0,0,u,u),e.bindFramebuffer(this._fbo),e.bindTechnique(t,this.context.bind,this._passParameters),e.screen.draw(),e.setViewport(r.x,r.y,r.width,r.height),this._fbo.colorTexture}};t([o({constructOnly:!0})],f.prototype,"context",void 0),f=t([s("esri.views.3d.webgl-engine.effects.clouds.NoiseTextureAtlas")],f);export{f as NoiseTextureAtlas};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../../core/maybe.js";import{property as r,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeOutput as i}from"../../../webgl.js";import s from"../../../webgl/RenderNode.js";import{If as a,glsl as c}from"../../core/shaderModules/glsl.js";import{Pos2Locations as l}from"../../lib/DefaultVertexBufferLayouts.js";import{floatBlendReductionFactor as u}from"../../shaders/oitResolution.glsl.js";import{checkWebGLError as h}from"../../../../webgl/checkWebGLError.js";import{ColorAttachment0 as p,SizedPixelFormat as d,DataType as f}from"../../../../webgl/enums.js";let m=class extends s{constructor(e){super(e),this.destroyedCB=null,this.produces=i.FINAL,this.consumes={required:[i.FINAL]},this.clearColor=n,this._focusedFBOType=7,this._programs=new Map}destroy(){this._programs.clear(),this.destroyedCB()}render(e){const t=e.find(({name:e})=>e===i.FINAL);if(!this._focusedTexture)return t;const r=this.renderingContext;r.bindFramebuffer(t.fbo),r.setClearColor(0,0,0,0),r.clear(16384);const o=this._focusedTexture.attachment,n=[v(o)],s=this._ensureProgram(r,!1,n);return r.useProgram(s),r.bindTexture(o,0),s.setUniform1i("colorTex0",0),s.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&s.setUniform2fv("nearFar",this.camera.nearFar),r.screen.draw(),t}getDownscaledFBO(e,t,r,o,n){t&&(o=e.width,n=e.height);const i="linear depth"===r||r.includes("shadow"),s="overlay highlight"===r||"highlights"===r||"highlight mix"===r,a="highlight coverage"===r,c=e.colorTexture?.descriptor,l=c?.internalFormat,u=[],d=new Array,f=new Array;e.colorAttachments.forEach((t,r)=>{const o=e.getColorTexture(t);if(o){const e=v(o);u.push(e);const{descriptor:t}=o;"float"!==e||t.hasMipmap||t.isImmutable||(o.generateMipmap(),d[r]=!0)}if(r>0){const r=e.getColorTexture(t)?.descriptor.internalFormat;return void f.push(F(r))}f.push(i?0:s?1:a?2:F(l))});const m=this.renderingContext,{depthStencilTexture:g}=e,x=this._ensureProgram(m,null!=g,u),T=this.fboCache.acquire(o,n,"fbo visualizer");m.useProgram(x),m.bindFramebuffer(T.fbo);const b=[];e.colorAttachments.forEach((t,r)=>{const o=`colorTex${r.toFixed()}`;m.bindTexture(e.getColorTexture(t),r),x.setUniform1i(o,r),r>0&&T.acquireColor(p+r,5,"fbo visualizer"),b.push(t)});const C=g?.descriptor.linearFilterDepth??!1;if(g){const t=e.colorAttachments.length;g.setShadowFiltering(!1),m.bindTexture(g,t),x.setUniform1i("depthTex",t);const r=p+t;r>p&&T.acquireColor(r,5,"fbo visualizer"),b.push(r)}m.gl.drawBuffers(b),h(m.gl);const R=m.getViewport();return m.setViewport(0,0,o,n),m.setClearColor(0,0,0,0),m.clear(16384),m.setBlendingEnabled(!0),m.setBlendFunction(1,771),x.setUniform1iv("inputTypes",f.length>0?f:[7]),x.setUniform2fv("nearFar",this.camera.nearFar),m.screen.draw(),h(m.gl),m.bindFramebuffer(null),m.setViewport(R.x,R.y,R.width,R.height),t&&(this._focusedTexture?.release(),this._focusedTexture=T.getAttachment(p),this._focusedTexture?.retain(),this._focusedFBOType=f[0]),e.colorAttachments.forEach((t,r)=>{if(d[r]){const r=e.getColorTexture(t);r?.clearMipmap()}}),g&&g.setShadowFiltering(C),T}clearFocusedFBO(){this._focusedTexture=t(this._focusedTexture)}getPreviewContent(e,t,r,o){const n=this.renderingContext,i=o.includes("\ndepth"),s=this.fboCache.acquire(e,t,"fbo visualizer");n.bindFramebuffer(s?.fbo);const a=n.getViewport();n.setViewport(0,0,e,t),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(16384),n.setBlendingEnabled(!0),n.setBlendFunction(1,771);const c=r.attachment,l=this._ensureProgram(n,!1,[v(c)]);n.useProgram(l),n.bindTexture(c,0),l.setUniform1i("colorTex0",0),l.setUniform1iv("inputTypes",[i||c.descriptor.internalFormat!==d.RGBA16F?7:5]),n.screen.draw();const u=new ImageData(new Uint8ClampedArray(e*t*4),e,t);return n.gl.readPixels(0,0,e,t,6408,f.UNSIGNED_BYTE,new Uint8Array(u.data.buffer)),h(n.gl),n.bindFramebuffer(null),n.setViewport(a.x,a.y,a.width,a.height),s?.release(),u}_ensureProgram(e,t,r){const o=x({hasDepthAttachment:t,colorSamplerTypes:r}),n=this._programs.get(o);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",s=e=>{let t="";for(let r=0;r<e.length;++r){const o=e[r];t+=`layout(location = ${c.int(r)}) out vec4 fragColor${c.int(r)};\n uniform ${g(o)} colorTex${c.int(r)};`}return t},h=e=>e.reduce((e,t,r)=>e+`{\n int inputType = inputTypes[${r}];\n if (inputType == ${3..toFixed()}) {\n fragColor${r} = vec4(vec3(texture(colorTex${r}, uv).r), 1.0);\n } else if (inputType == ${4..toFixed()}) {\n fragColor${r} = vec4(texture(colorTex${r}, uv).rg, 0.0, 1.0);\n } else if (inputType == ${(0).toFixed()}) {\n float depth = 1.0 - ((-linearDepthFromTexture(colorTex${r}, uv) - nearFar[0]) / (nearFar[1] - nearFar[0]));\n fragColor${r} = vec4(vec3(depth), depth >= 0.999 ? 0.0 : 1.0);\n } else if (inputType == ${5..toFixed()}) {\n // Divide F16 by floatBlendOutputScale to get similar previews as in the OIT8 pipeline\n fragColor${r} = vec4(texture(colorTex${r}, uv).rgb, 1.0) / ${u.toFixed(1)};\n } else if (inputType == ${1..toFixed()}) {\n fragColor${r} = vec4(texture(colorTex${r}, uv)) * 255.0;\n fragColor${r} = vec4(fragColor${r}.rgb / fragColor${r}.a, fragColor${r}.a);\n } else if(inputType == ${2..toFixed()}) {\n vec2 texDim = vec2(textureSize(colorTex${r}, 0));\n ivec2 iuv = ivec2(uv*texDim);\n uvec2 hh = uvec2(texelFetch(colorTex${r},iuv,0).rg);\n fragColor${r} = vec4(\n ((hh & uvec2(0x55u)) != uvec2(0u)) ? 1.0 : 0.0,\n ((hh & uvec2(0xaau)) != uvec2(0u)) ? 1.0 : 0.0,\n 0.0,\n 1.0);\n } else {\n fragColor${r} = vec4(texture(colorTex${r}, uv));\n }\n }`,""),p=r.length,d=`#version 300 es\n precision highp float;\n precision highp usampler2D;\n\n in vec2 uv;\n ${s(r)}\n ${a(t,`layout(location = ${c.int(p)}) out vec4 fragDepth;\n uniform sampler2D depthTex;`)}\n\n uniform int inputTypes[${r.length||1}];\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaToFloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaToFloat(depth));\n }\n\n ${"float"===r[0]?"float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }":"float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);\n }"}\n\n void main() {\n ${h(r)}\n ${a(t,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n }`,f=e.programCache.get(i,d,l);return this._programs.set(o,f),f}};function g(e){switch(e){case"float":return"sampler2D";case"uint":return"usampler2D";case"int":return"isampler2D"}}function v(e){if(!e)return"float";const{internalFormat:t}=e.descriptor;switch(t){case d.R8I:case d.R16I:case d.R32I:case d.RG8I:case d.RG16I:case d.RG32I:case d.RGB8I:case d.RGB16I:case d.RGB32I:case d.RGBA8I:case d.RGBA16I:case d.RGBA32I:return"int";case d.R8UI:case d.R16UI:case d.R32UI:case d.RG8UI:case d.RG16UI:case d.RG32UI:case d.RGB8UI:case d.RGB16UI:case d.RGB32UI:case d.RGBA8UI:case d.RGBA16UI:case d.RGBA32UI:return"uint";default:return"float"}}function x(e){const{hasDepthAttachment:t,colorSamplerTypes:r}=e;return`${t?"Depth":""}${r.reduceRight((e,t)=>e+`|C${t}`,"")}`}function F(e){switch(e){case d.R16F:case d.R32F:case d.R8:return 3;case d.RG8:return 4;case d.RGBA16F:return 5;case d.RG8UI:return 6;default:return 7}}e([r()],m.prototype,"destroyedCB",void 0),e([r()],m.prototype,"produces",void 0),e([r()],m.prototype,"consumes",void 0),e([r()],m.prototype,"clearColor",void 0),m=e([o("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],m);export{m as RenderNodeVisualizerNode};
2
+ import{__decorate as e}from"tslib";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{property as t,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeOutput as i}from"../../../webgl.js";import s from"../../../webgl/RenderNode.js";import{If as a,glsl as c}from"../../core/shaderModules/glsl.js";import{Pos2Locations as u}from"../../lib/DefaultVertexBufferLayouts.js";import{floatBlendReductionFactor as l}from"../../shaders/oitResolution.glsl.js";import{checkWebGLError as h}from"../../../../webgl/checkWebGLError.js";import{ColorAttachment0 as p,SizedPixelFormat as f,DataType as d}from"../../../../webgl/enums.js";let m=class extends s{constructor(e){super(e),this.destroyedCB=null,this.produces=i.FINAL,this.consumes={required:[i.FINAL]},this.clearColor=n,this._focusedFBOType=7,this._programs=new Map}destroy(){this._programs.clear(),this.destroyedCB()}render(e){const r=e.find(({name:e})=>e===i.FINAL);if(!this._focusedTexture)return r;const t=this.renderingContext,o=t.boundFramebuffer;t.bindFramebuffer(r.fbo),t.setClearColor(0,0,0,0),t.clear(16384);const n=this._focusedTexture.attachment,s=[v(n)],a=this._ensureProgram(t,!1,s);return t.useProgram(a),t.bindTexture(n,0),a.setUniform1i("colorTex0",0),a.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&a.setUniform2fv("nearFar",this.camera.nearFar),t.screen.draw(),t.bindFramebuffer(o),r}getDownscaledFBO(e,r,t,o,n){r&&(o=e.width,n=e.height);const i="linear depth"===t||t.includes("shadow"),s="overlay highlight"===t||"highlights"===t||"highlight mix"===t,a="highlight coverage"===t,c=e.colorTexture?.descriptor,u=c?.internalFormat,l=[],f=new Array,d=new Array;e.colorAttachments.forEach((r,t)=>{const o=e.getColorTexture(r);if(o){const e=v(o);l.push(e);const{descriptor:r}=o;"float"!==e||r.hasMipmap||r.isImmutable||(o.generateMipmap(),f[t]=!0)}if(t>0){const t=e.getColorTexture(r)?.descriptor.internalFormat;return void d.push(F(t))}d.push(i?0:s?1:a?2:F(u))});const m=this.renderingContext,{depthStencilTexture:g}=e,x=this._ensureProgram(m,null!=g,l),T=this.fboCache.acquire(o,n,"fbo visualizer");m.useProgram(x);const b=m.boundFramebuffer;m.bindFramebuffer(T.fbo);const C=[];e.colorAttachments.forEach((r,t)=>{const o=`colorTex${t.toFixed()}`;m.bindTexture(e.getColorTexture(r),t),x.setUniform1i(o,t),t>0&&T.acquireColor(p+t,5,"fbo visualizer"),C.push(r)});const R=g?.descriptor.linearFilterDepth??!1;if(g){const r=e.colorAttachments.length;g.setShadowFiltering(!1),m.bindTexture(g,r),x.setUniform1i("depthTex",r);const t=p+r;t>p&&T.acquireColor(t,5,"fbo visualizer"),C.push(t)}m.gl.drawBuffers(C),h(m.gl);const $=m.getViewport();return m.setViewport(0,0,o,n),m.setClearColor(0,0,0,0),m.clear(16384),m.setBlendingEnabled(!0),m.setBlendFunction(1,771),x.setUniform1iv("inputTypes",d.length>0?d:[7]),x.setUniform2fv("nearFar",this.camera.nearFar),m.screen.draw(),h(m.gl),m.bindFramebuffer(b),m.setViewport($.x,$.y,$.width,$.height),r&&(this._focusedTexture?.release(),this._focusedTexture=T.getAttachment(p),this._focusedTexture?.retain(),this._focusedFBOType=d[0]),e.colorAttachments.forEach((r,t)=>{if(f[t]){const t=e.getColorTexture(r);t?.clearMipmap()}}),g&&g.setShadowFiltering(R),T}clearFocusedFBO(){this._focusedTexture=r(this._focusedTexture)}getPreviewContent(e,r,t,o){const n=this.renderingContext,i=o.includes("\ndepth"),s=this.fboCache.acquire(e,r,"fbo visualizer"),a=n.boundFramebuffer;n.bindFramebuffer(s?.fbo);const c=n.getViewport();n.setViewport(0,0,e,r),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(16384),n.setBlendingEnabled(!0),n.setBlendFunction(1,771);const u=t.attachment,l=this._ensureProgram(n,!1,[v(u)]);n.useProgram(l),n.bindTexture(u,0),l.setUniform1i("colorTex0",0),l.setUniform1iv("inputTypes",[i||u.descriptor.internalFormat!==f.RGBA16F?7:5]),n.screen.draw();const p=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,6408,d.UNSIGNED_BYTE,new Uint8Array(p.data.buffer)),h(n.gl),n.bindFramebuffer(a),n.setViewport(c.x,c.y,c.width,c.height),s?.release(),p}_ensureProgram(e,r,t){const o=x({hasDepthAttachment:r,colorSamplerTypes:t}),n=this._programs.get(o);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",s=e=>{let r="";for(let t=0;t<e.length;++t){const o=e[t];r+=`layout(location = ${c.int(t)}) out vec4 fragColor${c.int(t)};\n uniform ${g(o)} colorTex${c.int(t)};`}return r},h=e=>e.reduce((e,r,t)=>e+`{\n int inputType = inputTypes[${t}];\n if (inputType == ${3..toFixed()}) {\n fragColor${t} = vec4(vec3(texture(colorTex${t}, uv).r), 1.0);\n } else if (inputType == ${4..toFixed()}) {\n fragColor${t} = vec4(texture(colorTex${t}, uv).rg, 0.0, 1.0);\n } else if (inputType == ${(0).toFixed()}) {\n float depth = 1.0 - ((-linearDepthFromTexture(colorTex${t}, uv) - nearFar[0]) / (nearFar[1] - nearFar[0]));\n fragColor${t} = vec4(vec3(depth), depth >= 0.999 ? 0.0 : 1.0);\n } else if (inputType == ${5..toFixed()}) {\n // Divide F16 by floatBlendOutputScale to get similar previews as in the OIT8 pipeline\n fragColor${t} = vec4(texture(colorTex${t}, uv).rgb, 1.0) / ${l.toFixed(1)};\n } else if (inputType == ${1..toFixed()}) {\n fragColor${t} = vec4(texture(colorTex${t}, uv)) * 255.0;\n fragColor${t} = vec4(fragColor${t}.rgb / fragColor${t}.a, fragColor${t}.a);\n } else if(inputType == ${2..toFixed()}) {\n vec2 texDim = vec2(textureSize(colorTex${t}, 0));\n ivec2 iuv = ivec2(uv*texDim);\n uvec2 hh = uvec2(texelFetch(colorTex${t},iuv,0).rg);\n fragColor${t} = vec4(\n ((hh & uvec2(0x55u)) != uvec2(0u)) ? 1.0 : 0.0,\n ((hh & uvec2(0xaau)) != uvec2(0u)) ? 1.0 : 0.0,\n 0.0,\n 1.0);\n } else {\n fragColor${t} = vec4(texture(colorTex${t}, uv));\n }\n }`,""),p=t.length,f=`#version 300 es\n precision highp float;\n precision highp usampler2D;\n\n in vec2 uv;\n ${s(t)}\n ${a(r,`layout(location = ${c.int(p)}) out vec4 fragDepth;\n uniform sampler2D depthTex;`)}\n\n uniform int inputTypes[${t.length||1}];\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaToFloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaToFloat(depth));\n }\n\n ${"float"===t[0]?"float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }":"float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);\n }"}\n\n void main() {\n ${h(t)}\n ${a(r,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n }`,d=e.programCache.get(i,f,u);return this._programs.set(o,d),d}};function g(e){switch(e){case"float":return"sampler2D";case"uint":return"usampler2D";case"int":return"isampler2D"}}function v(e){if(!e)return"float";const{internalFormat:r}=e.descriptor;switch(r){case f.R8I:case f.R16I:case f.R32I:case f.RG8I:case f.RG16I:case f.RG32I:case f.RGB8I:case f.RGB16I:case f.RGB32I:case f.RGBA8I:case f.RGBA16I:case f.RGBA32I:return"int";case f.R8UI:case f.R16UI:case f.R32UI:case f.RG8UI:case f.RG16UI:case f.RG32UI:case f.RGB8UI:case f.RGB16UI:case f.RGB32UI:case f.RGBA8UI:case f.RGBA16UI:case f.RGBA32UI:return"uint";default:return"float"}}function x(e){const{hasDepthAttachment:r,colorSamplerTypes:t}=e;return`${r?"Depth":""}${t.reduceRight((e,r)=>e+`|C${r}`,"")}`}function F(e){switch(e){case f.R16F:case f.R32F:case f.R8:return 3;case f.RG8:return 4;case f.RGBA16F:return 5;case f.RG8UI:return 6;default:return 7}}e([t()],m.prototype,"destroyedCB",void 0),e([t()],m.prototype,"produces",void 0),e([t()],m.prototype,"consumes",void 0),e([t()],m.prototype,"clearColor",void 0),m=e([o("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],m);export{m as RenderNodeVisualizerNode};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{releaseMaybe as t,disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as l}from"../../../webgl.js";import a from"../../../webgl/RenderNode.js";import{HighlightApplyTechnique as g}from"./HighlightApplyTechnique.js";import{H as c}from"../../../../../chunks/HighlightBlur.glsl.js";import{HighlightBlurTechnique as u}from"./HighlightBlurTechnique.js";import{H as m,g as p}from"../../../../../chunks/HighlightDownsample.glsl.js";import{HighlightDownsampleTechnique as d}from"./HighlightDownsampleTechnique.js";import{HighlightPassParameters as f}from"./HighlightPassParameters.js";import{HighlightToSingleTechnique as b}from"./HighlightToSingleTechnique.js";import{NoVertex as w}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as x}from"../../lib/VertexArrayObject.js";import{BufferObject as T}from"../../../../webgl/BufferObject.js";import{PrimitiveType as C,DataType as _}from"../../../../webgl/enums.js";import v from"../../../../webgl/Texture.js";import{TextureDescriptor as O}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as j}from"../../../../webgl/VertexBuffer.js";let H=class extends a{constructor(){super(...arguments),this.produces=l.HIGHLIGHT_COLOR,this.consumes={required:[l.HIGHLIGHT_COLOR,"highlights"]},this._downsampleDrawParameters=new m,this._passParameters=new f,this._highlightBlurDrawParameters=new c,this._grid=new q}initialize(){this.addHandles([r(()=>this._updateOptionsTexture(),()=>{},s)])}destroy(){this._grid.coverage=t(this._grid.coverage),this._grid.vao=i(this._grid.vao),this._passParameters.highlightOptionsTexture=t(this._passParameters.highlightOptionsTexture)}_updateOptionsTexture(){if(null==this._passParameters.highlightOptionsTexture){const e=new O(16,2);e.internalFormat=6408,e.samplingMode=9728,this._passParameters.highlightOptionsTexture=new v(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(P(this.view.state.highlights)),this.requestRender(1)}precompile(){this.bindParameters.decorations&&(this.techniques.precompile(d),this.techniques.precompile(b),this.techniques.precompile(u),this.techniques.precompile(g))}render(e){const t=e.find(({name:e})=>e===l.HIGHLIGHT_COLOR),{techniques:i,bindParameters:r,fboCache:s,_passParameters:o,renderingContext:h}=this;if(!r.decorations)return t;const a=i.getCompiled(d),c=i.getCompiled(b),m=i.getCompiled(u),p=i.getCompiled(g);if(!(a&&p&&m&&c))return this.requestRender(1),t;const f=e.find(({name:e})=>"highlights"===e).getTexture();o.highlightTexture=f;const w=this._prepareAndDownSample(f),{width:x,height:T}=f.descriptor;o.highlightTexture=f;const{camera:C}=r,{fullWidth:_,fullHeight:v,pixelRatio:O,fullViewport:j}=C,H=Math.ceil(_/O),q=Math.ceil(v/O),{_highlightBlurDrawParameters:P}=this,D=this.view.stage.renderView.renderer,{highlights:y}=r;for(let l=0;l<y.length;++l){const{name:e}=y[l];if(!D.hasHighlight(e))continue;o.highlightLevel=l,h.setClearColor(0,0,0,0);const i=s.acquire(x,T,"single highlight",2);h.bindFramebuffer(i.fbo),h.setViewport(0,0,x,T),h.clear(16384),h.bindTechnique(c,r,o),this._renderGrid(w),P.blurInput=i.getTexture(),n(P.blurSize,1/H,0);const a=s.acquire(H,q,"single highlight blur",2);h.unbindTexture(a.fbo?.colorTexture),h.bindFramebuffer(a.fbo),h.setViewport(0,0,H,q),h.clear(16384),h.bindTechnique(m,r,o,P),this._renderGrid(w),i.release(),n(P.blurSize,0,1/q),o.highlightBlurTexture=a.getTexture(),h.bindFramebuffer(t.fbo),h.setViewport4fv(j),h.bindTechnique(p,r,o,P),this._renderGrid(w),a.release()}return o.coverageTexture=o.highlightTexture=null,t}_prepareAndDownSample(e){this._gridUpdateResources(e);const t=this.techniques.get(d),i=this._gridComputeCoverage(t,e),{horizontalCellCount:r,verticalCellCount:s}=i,o=this._passParameters;return o.horizontalCellCount=r,o.verticalCellCount=s,o.coverageTexture=i.coverage?.getTexture(),i}_renderGrid(e){const t=e.verticalCellCount*e.horizontalCellCount;this.renderingContext.bindVAO(e.vao),this.renderingContext.drawElementsInstanced(C.TRIANGLES,6,_.UNSIGNED_BYTE,0,t)}_gridUpdateResources(e){const t=this._grid,{width:i,height:r}=e.descriptor;if(t.horizontalCellCount=Math.ceil(i/p),t.verticalCellCount=Math.ceil(r/p),t.vao)return;const s=this.renderingContext,o=T.createIndex(s,35044,I);t.vao=new x(s,new j(s,w),o)}_gridComputeCoverage(e,t){const i=this.renderingContext,r=this._grid,s=t.descriptor,o=Math.ceil(s.width/p),h=Math.ceil(s.height/p);this._downsampleDrawParameters.input=t;const{highlights:n}=this.bindParameters;r.coverage?.release();const l=this.fboCache.acquire(o,h,"highlight coverage",n.length>G?3:1);return r.coverage=l,i.bindFramebuffer(l.fbo),i.bindTechnique(e,this.bindParameters,this._passParameters,this._downsampleDrawParameters),i.setViewport(0,0,o,h),i.screen.draw(),r}get test(){}};e([o()],H.prototype,"produces",void 0),e([o()],H.prototype,"consumes",void 0),H=e([h("esri.views.3d.webgl-engine.effects.highlight.Highlight")],H);class q{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}function P(e){const t=new Uint8Array(128);let i=0;for(const r of e){const e=4*i,s=4*i+64;++i;const{color:o}=r,h=r.haloColor??o;t[e+0]=o.r,t[e+1]=o.g,t[e+2]=o.b,t[e+3]=r.fillOpacity*o.a*255,t[s+0]=h.r,t[s+1]=h.g,t[s+2]=h.b,t[s+3]=r.haloOpacity*h.a*255}return t}let D=0;function y(e){let t=0;for(const r of e){const{name:e}=r;t+=e.length;const{color:i,fillOpacity:s,haloColor:o,haloOpacity:h}=r;t+=i.r+i.g+i.b+i.a+s,t+=o?o.r+o.g+o.b+o.a+h:0}const i=e.at(0);if(i){const{shadowOpacity:e,shadowDifference:r,shadowColor:s}=i;t+=e+r+s.r+s.g+s.b+s.a}return D+++(t>=0?0:1)}const I=new Uint8Array([0,1,2,2,1,3]);function R(e,t,i,r,s,o,h=0){const{highlights:l}=s,a=l.length>1?t.acquire(i,r,"highlight mix",l.length>G?3:1):null,{gl:g}=e;if(a){const t=e.getBoundFramebufferObject();e.bindFramebuffer(a.fbo),g.clearBufferuiv(g.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}const c=a?.getTexture();s.highlightMixTexture=c,n(s.highlightMixOrigin,h,0),l.forEach((t,n)=>{if(n>0){const t=v.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(c,t),e.setActiveTexture(t),g.copyTexSubImage2D(3553,0,0,0,h,0,i,r),e.bindTexture(null,t)}e.clear(256),s.highlightLevel=n,o()}),s.highlightLevel=null,s.highlightMixTexture=null,a?.release()}const G=4;export{H as Highlight,G as maxHighlightsPerChannel,R as renderHighlightBuffer,y as trackHighlightOptions};
2
+ import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{releaseMaybe as t,disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as l}from"../../../webgl.js";import a from"../../../webgl/RenderNode.js";import{HighlightApplyTechnique as g}from"./HighlightApplyTechnique.js";import{H as c}from"../../../../../chunks/HighlightBlur.glsl.js";import{HighlightBlurTechnique as u}from"./HighlightBlurTechnique.js";import{H as m,g as p}from"../../../../../chunks/HighlightDownsample.glsl.js";import{HighlightDownsampleTechnique as d}from"./HighlightDownsampleTechnique.js";import{HighlightPassParameters as f}from"./HighlightPassParameters.js";import{HighlightToSingleTechnique as b}from"./HighlightToSingleTechnique.js";import{NoVertex as w}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as x}from"../../lib/VertexArrayObject.js";import{BufferObject as T}from"../../../../webgl/BufferObject.js";import{PrimitiveType as C,DataType as _}from"../../../../webgl/enums.js";import v from"../../../../webgl/Texture.js";import{TextureDescriptor as O}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as j}from"../../../../webgl/VertexBuffer.js";let H=class extends a{constructor(){super(...arguments),this.produces=l.HIGHLIGHT_COLOR,this.consumes={required:[l.HIGHLIGHT_COLOR,"highlights"]},this._downsampleDrawParameters=new m,this._passParameters=new f,this._highlightBlurDrawParameters=new c,this._grid=new q}initialize(){this.addHandles([r(()=>this._updateOptionsTexture(),()=>{},s)])}destroy(){this._grid.coverage=t(this._grid.coverage),this._grid.vao=i(this._grid.vao),this._passParameters.highlightOptionsTexture=t(this._passParameters.highlightOptionsTexture)}_updateOptionsTexture(){if(null==this._passParameters.highlightOptionsTexture){const e=new O(16,2);e.internalFormat=6408,e.samplingMode=9728,this._passParameters.highlightOptionsTexture=new v(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(P(this.view.state.highlights)),this.requestRender(1)}precompile(){this.bindParameters.decorations&&(this.techniques.precompile(d),this.techniques.precompile(b),this.techniques.precompile(u),this.techniques.precompile(g))}render(e){const t=e.find(({name:e})=>e===l.HIGHLIGHT_COLOR),{techniques:i,bindParameters:r,fboCache:s,_passParameters:o,renderingContext:h}=this;if(!r.decorations)return t;const a=i.getCompiled(d),c=i.getCompiled(b),m=i.getCompiled(u),p=i.getCompiled(g);if(!(a&&p&&m&&c))return this.requestRender(1),t;const f=e.find(({name:e})=>"highlights"===e).getTexture();o.highlightTexture=f;const w=this._prepareAndDownSample(f),{width:x,height:T}=f.descriptor;o.highlightTexture=f;const{camera:C}=r,{fullWidth:_,fullHeight:v,pixelRatio:O,fullViewport:j}=C,H=Math.ceil(_/O),q=Math.ceil(v/O),{_highlightBlurDrawParameters:P}=this,D=this.view.stage.renderView.renderer,{highlights:y}=r;for(let l=0;l<y.length;++l){const{name:e}=y[l];if(!D.hasHighlight(e))continue;o.highlightLevel=l,h.setClearColor(0,0,0,0);const i=s.acquire(x,T,"single highlight",2);h.bindFramebuffer(i.fbo),h.setViewport(0,0,x,T),h.clear(16384),h.bindTechnique(c,r,o),this._renderGrid(w),P.blurInput=i.getTexture(),n(P.blurSize,1/H,0);const a=s.acquire(H,q,"single highlight blur",2);h.unbindTexture(a.fbo?.colorTexture),h.bindFramebuffer(a.fbo),h.setViewport(0,0,H,q),h.clear(16384),h.bindTechnique(m,r,o,P),this._renderGrid(w),i.release(),n(P.blurSize,0,1/q),o.highlightBlurTexture=a.getTexture(),h.bindFramebuffer(t.fbo),h.setViewport4fv(j),h.bindTechnique(p,r,o,P),this._renderGrid(w),a.release()}return o.coverageTexture=o.highlightTexture=null,t}_prepareAndDownSample(e){this._gridUpdateResources(e);const t=this.techniques.get(d),i=this._gridComputeCoverage(t,e),{horizontalCellCount:r,verticalCellCount:s}=i,o=this._passParameters;return o.horizontalCellCount=r,o.verticalCellCount=s,o.coverageTexture=i.coverage?.getTexture(),i}_renderGrid(e){const t=e.verticalCellCount*e.horizontalCellCount;this.renderingContext.bindVAO(e.vao),this.renderingContext.drawElementsInstanced(C.TRIANGLES,6,_.UNSIGNED_BYTE,0,t)}_gridUpdateResources(e){const t=this._grid,{width:i,height:r}=e.descriptor;if(t.horizontalCellCount=Math.ceil(i/p),t.verticalCellCount=Math.ceil(r/p),t.vao)return;const s=this.renderingContext,o=T.createIndex(s,35044,I);t.vao=new x(s,new j(s,w),o)}_gridComputeCoverage(e,t){const i=this.renderingContext,r=this._grid,s=t.descriptor,o=Math.ceil(s.width/p),h=Math.ceil(s.height/p);this._downsampleDrawParameters.input=t;const{highlights:n}=this.bindParameters;r.coverage?.release();const l=this.fboCache.acquire(o,h,"highlight coverage",n.length>G?3:1);return r.coverage=l,i.bindFramebuffer(l.fbo),i.bindTechnique(e,this.bindParameters,this._passParameters,this._downsampleDrawParameters),i.setViewport(0,0,o,h),i.screen.draw(),r}get test(){}};e([o()],H.prototype,"produces",void 0),e([o()],H.prototype,"consumes",void 0),H=e([h("esri.views.3d.webgl-engine.effects.highlight.Highlight")],H);class q{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}function P(e){const t=new Uint8Array(128);let i=0;for(const r of e){const e=4*i,s=4*i+64;++i;const{color:o}=r,h=r.haloColor??o;t[e+0]=o.r,t[e+1]=o.g,t[e+2]=o.b,t[e+3]=r.fillOpacity*o.a*255,t[s+0]=h.r,t[s+1]=h.g,t[s+2]=h.b,t[s+3]=r.haloOpacity*h.a*255}return t}let D=0;function y(e){let t=0;for(const r of e){const{name:e}=r;t+=e.length;const{color:i,fillOpacity:s,haloColor:o,haloOpacity:h}=r;t+=i.r+i.g+i.b+i.a+s,t+=o?o.r+o.g+o.b+o.a+h:0}const i=e.at(0);if(i){const{shadowOpacity:e,shadowDifference:r,shadowColor:s}=i;t+=e+r+s.r+s.g+s.b+s.a}return D+++(t>=0?0:1)}const I=new Uint8Array([0,1,2,2,1,3]);function R(e,t,i,r,s,o,h=0){const{highlights:l}=s,a=l.length>1?t.acquire(i,r,"highlight mix",l.length>G?3:1):null,{gl:g}=e;if(a){const t=e.boundFramebuffer;e.bindFramebuffer(a.fbo),g.clearBufferuiv(g.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}const c=a?.getTexture();s.highlightMixTexture=c,n(s.highlightMixOrigin,h,0),l.forEach((t,n)=>{if(n>0){const t=v.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(c,t),e.setActiveTexture(t),g.copyTexSubImage2D(3553,0,0,0,h,0,i,r),e.bindTexture(null,t)}e.clear(256),s.highlightLevel=n,o()}),s.highlightLevel=null,s.highlightMixTexture=null,a?.release()}const G=4;export{H as Highlight,G as maxHighlightsPerChannel,R as renderHighlightBuffer,y as trackHighlightOptions};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{O as e}from"../../../../../chunks/OITBlend.glsl.js";import{OITBlendTechnique as t}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as i}from"./OITBlendTechniqueConfiguration.js";import{OITDimTechnique as s}from"./OITDimTechnique.js";import{ColorAttachment2 as n,ColorAttachment1 as r,DrawBufferNone as o}from"../../../../webgl/enums.js";class a{constructor(t){this._techniques=t,this._parameters=new e,this._configuration=new i}precompile({useFloatBlend:e,hasEmission:i,emissions:n},r,o){this._configuration.useFloatBlend=e.value,this._configuration.hasEmission=i,this._configuration.computeHudOcclusion=r,this._configuration.frontFaceMask=1===o,this._techniques.precompile(t,this._configuration),0!==n&&2!==n&&1!==o&&this._techniques.precompile(s)}blend(e,i,a,u,c,h,m){if(this._configuration.useFloatBlend=u.useFloatBlend.value,this._configuration.hasEmission=c,this._configuration.computeHudOcclusion=h,this._configuration.frontFaceMask=1===m,this._parameters.colorTexture=i.getTexture(),this._parameters.alphaTexture=i.getTexture(c?n:r),this._parameters.frontFaceTexture=a.getTexture(),c){if(1!==m&&2!==u.emissions){const t=this._techniques.get(s);e.bindTechnique(t,u,this._parameters);const i=e.setDrawBuffers([o,r]);e.screen.draw(),e.setDrawBuffers(i)}this._parameters.emissionTexture=i.getTexture(r),this._parameters.emissionFrontFaceTexture=a.getTexture(r)}const f=this._techniques.get(t,this._configuration);e.bindTechnique(f,u,this._parameters),e.screen.draw()}}export{a as OITBlend};
2
+ import{O as e}from"../../../../../chunks/OITBlend.glsl.js";import{OITBlendTechnique as i}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as t}from"./OITBlendTechniqueConfiguration.js";import{OITDimTechnique as s}from"./OITDimTechnique.js";import{OITDimTechniqueConfiguration as n}from"./OITDimTechniqueConfiguration.js";import{ColorAttachment2 as o,ColorAttachment1 as r,DrawBufferNone as a}from"../../../../webgl/enums.js";class u{constructor(i){this._techniques=i,this._parameters=new e,this._configuration=new t,this._dimConfiguration=new n}precompile({useFloatBlend:e,hasEmission:t,emissions:n},o,r){this._configuration.useFloatBlend=e.value,this._configuration.hasEmission=t,this._configuration.computeHudOcclusion=o,this._configuration.frontFaceMask=1===r,this._techniques.precompile(i,this._configuration),0!==n&&2!==n&&1!==r&&(this._dimConfiguration.useFloatBlend=e.value,this._techniques.precompile(s,this._dimConfiguration))}blend(e,t,n,u,c,h,m){if(this._configuration.useFloatBlend=u.useFloatBlend.value,this._configuration.hasEmission=c,this._configuration.computeHudOcclusion=h,this._configuration.frontFaceMask=1===m,this._parameters.colorTexture=t.getTexture(),this._parameters.alphaTexture=t.getTexture(c?o:r),this._parameters.frontFaceTexture=n.getTexture(),c){if(this._dimConfiguration.useFloatBlend=u.useFloatBlend.value,1!==m&&2!==u.emissions){const i=this._techniques.get(s,this._dimConfiguration);e.bindTechnique(i,u,this._parameters);const t=e.setDrawBuffers([a,r]);e.screen.draw(),e.setDrawBuffers(t)}this._parameters.emissionTexture=t.getTexture(r),this._parameters.emissionFrontFaceTexture=n.getTexture(r)}const f=this._techniques.get(i,this._configuration);e.bindTechnique(f,u,this._parameters),e.screen.draw()}}export{u as OITBlend};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/util/EmissionDimming.glsl.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{O as OITDimPassParameters,b as build}from"../../../../../chunks/OITDim.glsl.js";
2
+ import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/util/EmissionDimming.glsl.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../shaders/oitResolution.glsl.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{O as OITDimPassParameters,b as build}from"../../../../../chunks/OITDim.glsl.js";
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as r}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class t extends r{constructor(){super(...arguments),this.useFloatBlend=!0}}e([o()],t.prototype,"useFloatBlend",void 0);export{t as OITDimTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{disposeMaybe as e}from"../../../../core/maybe.js";import{watch as r}from"../../../../core/reactiveUtils.js";import{property as a,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{createQuadVAO as s}from"./glUtil3D.js";import{SortedRenderGeometryRenderer as o}from"./SortedRenderGeometryRenderer.js";import{HeatmapPassParameters as n,HeatmapTechnique as h}from"../shaders/HeatmapTechnique.js";import{HeatmapTechniqueConfiguration as m}from"../shaders/HeatmapTechniqueConfiguration.js";import{PixelType as p}from"../../../webgl/enums.js";import{FramebufferObject as l}from"../../../webgl/FramebufferObject.js";import c from"../../../webgl/Texture.js";import{TextureDescriptor as d}from"../../../webgl/TextureDescriptor.js";let u=class extends o{constructor(t){super(t),this.pixelRatio=1,this._colorRampData=new Uint8ClampedArray(4),this.type="draped-heatmap",this._heatmapParameters=new n,this._configuration=new m;const e=new d;e.pixelFormat=t.pixelFormat,e.internalFormat=t.internalFormat,e.dataType=t.dataType,e.samplingMode=t.samplingMode,e.wrapMode=33071;const r=t.rendererContext.rctx;this._densityMap=new l(r,e),this._vao=s(r),this._configuration.usesHalfFloat=t.dataType!==p.FLOAT,t.rendererContext.pluginContext.techniques.precompile(h,this._configuration)}initialize(){const t=this._colorRampData,e=new d(t.length/4,1);e.wrapMode=33071,this._colorRamp=new c(this.rctx,e,t),this._heatmapParameters.densityMap=this._densityMap.colorTexture,this.addHandles(r(()=>[this.colorRampData,this.minDensity,this.maxDensity,this.fieldTotal,this.pixelRatio,this.searchRadius],()=>this.rendererContext.notifyContentChanged()))}destroy(){this._densityMap=e(this._densityMap),this._vao=e(this._vao),this._colorRamp=e(this._colorRamp)}get searchRadius(){return this._heatmapParameters.searchRadius}set searchRadius(t){t!==this._heatmapParameters.searchRadius&&(this._heatmapParameters.searchRadius=t,this.notifyChange("searchRadius"))}get minDensity(){return this._heatmapParameters.minDensity}set minDensity(t){t!==this._heatmapParameters.minDensity&&(this._heatmapParameters.minDensity=t,this.notifyChange("minDensity"))}get maxDensity(){return this._heatmapParameters.maxDensity}set maxDensity(t){t!==this._heatmapParameters.maxDensity&&(this._heatmapParameters.maxDensity=t,this.notifyChange("maxDensity"))}get fieldTotal(){return this._heatmapParameters.fieldTotal}set fieldTotal(t){this._heatmapParameters.fieldTotal=t,this.notifyChange("fieldTotal")}get colorRampData(){return this._colorRampData}set colorRampData(t){const{colorRamp:e}=this._heatmapParameters;if(null!=e&&t!==this._colorRampData){const r=e.descriptor.width,a=t.length/4;a!==r&&e.resize(a,1),e.setData(t)}this._colorRampData=t}get _colorRamp(){return this._heatmapParameters.colorRamp}set _colorRamp(t){this._heatmapParameters.colorRamp=t}get hasHighlights(){return!1}get hasWater(){return!1}render(t){const e=this.sortedRenderers;if(0===e.length)return;const r=this.rctx.getBoundFramebufferObject(),a=this.rctx.getViewport(),{pixelRatio:i}=this,s=Math.ceil(a.width*i),o=Math.ceil(a.height*i);this._densityMap.resize(s,o),this.rctx.bindFramebuffer(this._densityMap),this.rctx.setViewport(0,0,s,o),this.rctx.clear(16384);let n=!1;if(e.forAll(e=>{const r=e.acquireTechniques(t);r&&(e.render(t,r),n=!0)}),this.rctx.bindFramebuffer(r),this.rctx.setViewport(a.x,a.y,a.width,a.height),!n)return;this.rctx.bindVAO(this._vao);const m=this.rendererContext.pluginContext.techniques.get(h,this._configuration);this.rctx.bindTechnique(m,t.bind,this._heatmapParameters),this.rctx.drawArrays(m.primitiveType,0,this._vao.vertexCount("geometry"))}};t([a()],u.prototype,"searchRadius",null),t([a()],u.prototype,"minDensity",null),t([a()],u.prototype,"maxDensity",null),t([a()],u.prototype,"fieldTotal",null),t([a()],u.prototype,"pixelRatio",void 0),t([a()],u.prototype,"colorRampData",null),t([a({constructOnly:!0})],u.prototype,"dataType",void 0),t([a({constructOnly:!0})],u.prototype,"samplingMode",void 0),t([a({constructOnly:!0})],u.prototype,"pixelFormat",void 0),t([a({constructOnly:!0})],u.prototype,"internalFormat",void 0),t([a()],u.prototype,"_colorRampData",void 0),u=t([i("esri.views.3d.webgl-engine.lib.DrapedHeatmapRenderer")],u);export{u as DrapedHeatmapRenderer};
2
+ import{__decorate as t}from"tslib";import{disposeMaybe as e}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{createQuadVAO as a}from"./glUtil3D.js";import{SortedRenderGeometryRenderer as o}from"./SortedRenderGeometryRenderer.js";import{HeatmapPassParameters as n,HeatmapTechnique as p}from"../shaders/HeatmapTechnique.js";import{HeatmapTechniqueConfiguration as h}from"../shaders/HeatmapTechniqueConfiguration.js";import{PixelType as m}from"../../../webgl/enums.js";import{DisposableFramebufferObject as l}from"../../../webgl/FramebufferObject.js";import c from"../../../webgl/Texture.js";import{TextureDescriptor as d}from"../../../webgl/TextureDescriptor.js";let u=class extends o{constructor(t){super(t),this.pixelRatio=1,this._colorRampData=new Uint8ClampedArray(4),this.type="draped-heatmap",this._passParameters=new n,this._configuration=new h;const e=new d;e.pixelFormat=t.pixelFormat,e.internalFormat=t.internalFormat,e.dataType=t.dataType,e.samplingMode=t.samplingMode,e.wrapMode=33071;const s=t.rendererContext.rctx;this._densityMap=new l(s,e),this._vao=a(s),this._configuration.usesHalfFloat=t.dataType!==m.FLOAT,t.rendererContext.pluginContext.techniques.precompile(p,this._configuration)}initialize(){const t=this._colorRampData,e=new d(t.length/4,1);e.wrapMode=33071,this._colorRamp=new c(this.rctx,e,t),this._passParameters.densityMap=this._densityMap.colorTexture,this.addHandles(s(()=>[this.colorRampData,this.minDensity,this.maxDensity,this.fieldTotal,this.pixelRatio,this.searchRadius],()=>this.rendererContext.notifyContentChanged()))}destroy(){this._densityMap=e(this._densityMap),this._vao=e(this._vao),this._colorRamp=e(this._colorRamp)}get searchRadius(){return this._passParameters.searchRadius}set searchRadius(t){t!==this._passParameters.searchRadius&&(this._passParameters.searchRadius=t,this.notifyChange("searchRadius"))}get minDensity(){return this._passParameters.minDensity}set minDensity(t){t!==this._passParameters.minDensity&&(this._passParameters.minDensity=t,this.notifyChange("minDensity"))}get maxDensity(){return this._passParameters.maxDensity}set maxDensity(t){t!==this._passParameters.maxDensity&&(this._passParameters.maxDensity=t,this.notifyChange("maxDensity"))}get fieldTotal(){return this._passParameters.fieldTotal}set fieldTotal(t){this._passParameters.fieldTotal=t,this.notifyChange("fieldTotal")}get colorRampData(){return this._colorRampData}set colorRampData(t){const{colorRamp:e}=this._passParameters;if(null!=e&&t!==this._colorRampData){const s=e.descriptor.width,r=t.length/4;r!==s&&e.resize(r,1),e.setData(t)}this._colorRampData=t}get _colorRamp(){return this._passParameters.colorRamp}set _colorRamp(t){this._passParameters.colorRamp=t}get hasHighlights(){return!1}get hasWater(){return!1}render(t){const e=this.sortedRenderers;if(0===e.length)return;const s=this.rctx.boundFramebuffer,r=this.rctx.getViewport(),{pixelRatio:i}=this,a=Math.ceil(r.width*i),o=Math.ceil(r.height*i);this._densityMap.resize(a,o),this.rctx.bindFramebuffer(this._densityMap),this.rctx.setViewport(0,0,a,o),this.rctx.clear(16384);let n=!1;if(e.forAll(e=>{const s=e.acquireTechniques(t);s&&(e.render(t,s),n=!0)}),this.rctx.bindFramebuffer(s),this.rctx.setViewport(r.x,r.y,r.width,r.height),!n)return;this.rctx.bindVAO(this._vao);const h=this.rendererContext.pluginContext.techniques.get(p,this._configuration);this.rctx.bindTechnique(h,t.bind,this._passParameters),this.rctx.drawArrays(h.primitiveType,0,this._vao.vertexCount("geometry"))}};t([r()],u.prototype,"searchRadius",null),t([r()],u.prototype,"minDensity",null),t([r()],u.prototype,"maxDensity",null),t([r()],u.prototype,"fieldTotal",null),t([r()],u.prototype,"pixelRatio",void 0),t([r()],u.prototype,"colorRampData",null),t([r({constructOnly:!0})],u.prototype,"dataType",void 0),t([r({constructOnly:!0})],u.prototype,"samplingMode",void 0),t([r({constructOnly:!0})],u.prototype,"pixelFormat",void 0),t([r({constructOnly:!0})],u.prototype,"internalFormat",void 0),t([r()],u.prototype,"_colorRampData",void 0),u=t([i("esri.views.3d.webgl-engine.lib.DrapedHeatmapRenderer")],u);export{u as DrapedHeatmapRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as i,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as r,set as o,scale as n,floor as h,subtract as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,set as c,positiveInfinity as u,equals as d}from"../../../../geometry/support/aaBoundingBox.js";import{InternalRenderCategory as _}from"../../webgl.js";import g from"../../webgl/RenderNode.js";import{G as P}from"../../../../chunks/GaussianSplat.glsl.js";import{G as f}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as C}from"../shaders/GaussianSplatCompositionTechnique.js";import{GaussianSplatCompositionTechniqueConfiguration as b}from"../shaders/GaussianSplatCompositionTechniqueConfiguration.js";import{G as x}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as S}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatTechnique as q}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as v}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{ColorAttachment1 as E,DepthStencilAttachment as R,PrimitiveType as T}from"../../../webgl/enums.js";var D;let w=class extends g{static{D=this}constructor(e){super(e),this.produces=_.PRE_TRANSPARENT,this.consumes={required:[_.PRE_TRANSPARENT]},this._slicePlaneEnabled=!1,this.layerView=null,this._passParameters=new P,this._compositionPassParameters=new f,this._depthCompositionPassParameters=new x,this._compositionConfiguration=new b,this._clipBox=m(),this._previousCameraDirection=p(),this._previousSortRequestCameraDirection=p(),this._sortRequestDirectionEpsilon=.01,this._directionChangeEpsilon=.001,this._configuration=new v(e.view.state.isGlobal),c(this._clipBox,u)}async initialize(){this.addHandles([t(()=>this.view.state.camera,()=>this._onCameraChange())])}precompile(){this._configuration.alphaCutoff=this.view.qualitySettings.gaussianSplat.minimumOpacity,this._configuration.terrainDepthTest=this.bindParameters.terrainDepthTest,this._configuration.fadingEnabled=this._fadeHelper.fadingEnabled,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasSlicePlane=this._slicePlaneEnabled&&null!=this.bindParameters.slicePlane,this.techniques.precompile(q,this._configuration),this._compositionConfiguration.hasEmission=this.bindParameters.hasEmission,this.techniques.precompile(C,this._compositionConfiguration),this.techniques.precompile(S)}render(e){const t=e.find(({name:e})=>e===this.produces);if(this._handleFading(),!this._data.visibleGaussians||!this._data.orderTexture.texture||!this._data.textureAtlas.texture)return t;const i=t.getAttachment(E);this._compositionConfiguration.hasEmission=null!=i;const s=this.techniques.getCompiled(q,this._configuration),a=this.techniques.getCompiled(C,this._compositionConfiguration),r=this.techniques.getCompiled(S);if(!s||!r||!a)return this.requestRender(1),t;const{fullWidth:o,fullHeight:n}=this.bindParameters.camera;this._prepareParameters(n,o);const h=this.renderingContext,l=this.fboCache,p=l.acquire(o,n,"gaussian color output"),m=t.getAttachment(R);p.attachDepth(m),this._renderGaussianColorAndDepth(p,s);const c=l.acquire(o,n,this.produces);return this._depthCompositionPassParameters.splatDepth=p.getTexture(E),c.attachDepth(t.getAttachment(R)),h.bindFramebuffer(c.fbo),h.bindTechnique(r,this.bindParameters,this._depthCompositionPassParameters),h.screen.draw(),this._compositionPassParameters.color=t.getTexture(),this._compositionPassParameters.splatColor=p.getTexture(),i?(c.acquireColor(E,8,"emissive"),this._compositionPassParameters.emission=t.getTexture(E)):this._compositionPassParameters.emission=null,h.bindFramebuffer(c.fbo),h.bindTechnique(a,this.bindParameters,this._compositionPassParameters),h.screen.draw(),p.release(),c}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}set clippingBox(e){const t=e||u;this._hasSameClipBox(t)||(c(this._clipBox,t),this._data.requestSort(),this.requestRender(1))}get clippingBox(){return this._clippingEnabled?this._clipBox:null}get _clippingEnabled(){return!d(this._clipBox,u,(e,t)=>e===t)}get _data(){return this.layerView.data}get _fadeHelper(){return this.layerView.fadeHelper}destroy(){super.destroy()}_onCameraChange(){const e=this.view.state.camera.ray.direction;if(!this._directionChanged(e))return;if(r(this._previousCameraDirection,e),!this._shouldRequestSort(e))return;this._data.requestSort()&&r(this._previousSortRequestCameraDirection,e)}_directionChanged(e){return Math.abs(e[0]-this._previousCameraDirection[0])>this._directionChangeEpsilon||Math.abs(e[1]-this._previousCameraDirection[1])>this._directionChangeEpsilon||Math.abs(e[2]-this._previousCameraDirection[2])>this._directionChangeEpsilon}_shouldRequestSort(e){return Math.abs(e[0]-this._previousSortRequestCameraDirection[0])>this._sortRequestDirectionEpsilon||Math.abs(e[1]-this._previousSortRequestCameraDirection[1])>this._sortRequestDirectionEpsilon||Math.abs(e[2]-this._previousSortRequestCameraDirection[2])>this._sortRequestDirectionEpsilon}_prepareParameters(e,t){this._passParameters.splatOrder=this._data.orderTexture.texture,this._passParameters.splatFading=this._data.fadingTexture.texture,this._passParameters.splatAtlas=this._data.textureAtlas.texture;const i=Math.tan(.5*this.camera.fovY),s=i/e*t;a(this._passParameters.tanFov,s,i),this._passParameters.focalLength=e/(2*i);const r=this.view.qualitySettings.gaussianSplat.minimumSplatPixelRadius;this._passParameters.minSplatRadius=r*Math.sqrt(t*e)/Math.sqrt(2073600),this._prepareHighPrecisionCameraPosition(),this._updateSlicePlaneLocalOrigin(),this._updateClipUniforms()}_updateClipUniforms(){if(this._clippingEnabled){const[e,t,i,s,a,r]=this._clipBox,[n,h,l]=this.camera.eye;o(this._passParameters.clipMinCameraRelative,e-n,t-h,i-l),o(this._passParameters.clipMaxCameraRelative,s-n,a-h,r-l)}}_updateSlicePlaneLocalOrigin(){this._passParameters.slicePlaneLocalOrigin=this.camera.eye}_hasSameClipBox(e){return d(this._clipBox,e,(e,t)=>e===t)}_renderGaussianColorAndDepth(e,t){const i=this.renderingContext;e.acquireColor(E,5,"gaussian depth output"),i.bindFramebuffer(e.fbo),i.setClearColor(0,0,0,0),i.clear(16384),this.renderingContext.bindTechnique(t,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(T.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}_prepareHighPrecisionCameraPosition(){n(this._passParameters.tileCameraPosition,this.camera.eye,1/D.tileSize),h(this._passParameters.tileCameraPosition,this._passParameters.tileCameraPosition),n(this._passParameters.cameraDelta,this._passParameters.tileCameraPosition,D.tileSize),l(this._passParameters.cameraDelta,this.camera.eye,this._passParameters.cameraDelta)}_handleFading(){if(0===this._fadeHelper.numFadingTiles)return void(this._previousFrameStart=null);this._previousFrameStart??=this.view.stage.renderer.renderContext.time;const e=this.view.stage?.renderer.renderContext.time-this._previousFrameStart;this._fadeHelper.updateAllTileFading(e),this._previousFrameStart=this.view.stage.renderer.renderContext.time,this._data.fadingTexture.updateTexture(this._data.textureAtlas.pageAllocator.pageCount)}static{this.tileSize=2.048}};e([i()],w.prototype,"produces",void 0),e([i()],w.prototype,"consumes",void 0),e([i({constructOnly:!0})],w.prototype,"layerView",void 0),w=D=e([s("esri.views.3d.webgl-engine.lib.GaussianSplatRenderNode")],w);export{w as GaussianSplatRenderNode};
2
+ import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as i,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as r,set as o,scale as n,floor as h,subtract as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,set as c,positiveInfinity as u,equals as d}from"../../../../geometry/support/aaBoundingBox.js";import{InternalRenderCategory as _}from"../../webgl.js";import g from"../../webgl/RenderNode.js";import{G as f}from"../../../../chunks/GaussianSplat.glsl.js";import{G as P}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as C}from"../shaders/GaussianSplatCompositionTechnique.js";import{GaussianSplatCompositionTechniqueConfiguration as b}from"../shaders/GaussianSplatCompositionTechniqueConfiguration.js";import{G as S}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as v}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatTechnique as x}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as q}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{ColorAttachment1 as w,DepthStencilAttachment as E,PrimitiveType as R}from"../../../webgl/enums.js";var T;let D=class extends g{static{T=this}constructor(e){super(e),this.produces=_.PRE_TRANSPARENT,this.consumes={required:[_.PRE_TRANSPARENT]},this._slicePlaneEnabled=!1,this.layerView=null,this._passParameters=new f,this._compositionPassParameters=new P,this._depthCompositionPassParameters=new S,this._compositionConfiguration=new b,this._clipBox=m(),this._previousCameraDirection=p(),this._previousSortRequestCameraDirection=p(),this._sortRequestDirectionEpsilon=.01,this._directionChangeEpsilon=.001,this._configuration=new q(e.view.state.isGlobal),c(this._clipBox,u)}async initialize(){this.addHandles([t(()=>this.view.state.camera,()=>this._onCameraChange()),t(()=>2===this.view.state.mode,()=>this.requestRender(1))])}precompile(){this._updateTechniqueConfiguration(),this.techniques.precompile(x,this._configuration),this._compositionConfiguration.hasEmission=this.bindParameters.hasEmission,this.techniques.precompile(C,this._compositionConfiguration),this.techniques.precompile(v)}render(e){const t=e.find(({name:e})=>e===this.produces);if(this._handleFading(),!this._data.visibleGaussians||!this._data.orderTexture.texture||!this._data.textureAtlas.texture)return t;const i=t.getAttachment(w);this._compositionConfiguration.hasEmission=null!=i;const s=this.techniques.getCompiled(x,this._configuration),a=this.techniques.getCompiled(C,this._compositionConfiguration),r=this.techniques.getCompiled(v);if(!s||!r||!a)return this.requestRender(1),t;const{fullWidth:o,fullHeight:n}=this.bindParameters.camera;this._prepareParameters(n,o);const h=this.renderingContext,l=this.fboCache,p=l.acquire(o,n,"gaussian color output"),m=t.getAttachment(E);p.attachDepth(m),this._renderGaussianColorAndDepth(p,s);const c=l.acquire(o,n,this.produces);return this._depthCompositionPassParameters.splatDepth=p.getTexture(w),c.attachDepth(t.getAttachment(E)),h.bindFramebuffer(c.fbo),h.bindTechnique(r,this.bindParameters,this._depthCompositionPassParameters),h.screen.draw(),this._compositionPassParameters.color=t.getTexture(),this._compositionPassParameters.splatColor=p.getTexture(),i?(c.acquireColor(w,8,"emissive"),this._compositionPassParameters.emission=t.getTexture(w)):this._compositionPassParameters.emission=null,h.bindFramebuffer(c.fbo),h.bindTechnique(a,this.bindParameters,this._compositionPassParameters),h.screen.draw(),p.release(),c}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}set clippingBox(e){const t=e||u;this._hasSameClipBox(t)||(c(this._clipBox,t),this._data.requestSort(),this.requestRender(1))}get clippingBox(){return this._clippingEnabled?this._clipBox:null}get _clippingEnabled(){return!d(this._clipBox,u,(e,t)=>e===t)}get _fragmentShadowsEnabled(){return 2===this.view.state.mode}get _data(){return this.layerView.data}get _fadeHelper(){return this.layerView.fadeHelper}_updateTechniqueConfiguration(){this._configuration.alphaCutoff=this.view.qualitySettings.gaussianSplat.minimumOpacity,this._configuration.terrainDepthTest=this.bindParameters.terrainDepthTest,this._configuration.fadingEnabled=this._fadeHelper.fadingEnabled,this._configuration.receiveShadows=this.bindParameters.shadowMap.ready,this._configuration.fragmentShadows=this._configuration.receiveShadows&&this._fragmentShadowsEnabled,this._configuration.hasShadowHighlights=this._configuration.fragmentShadows&&this.bindParameters.hasShadowHighlights,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasSlicePlane=this._slicePlaneEnabled&&null!=this.bindParameters.slicePlane}destroy(){super.destroy()}_onCameraChange(){const e=this.view.state.camera.ray.direction;if(!this._directionChanged(e))return;if(r(this._previousCameraDirection,e),!this._shouldRequestSort(e))return;this._data.requestSort()&&r(this._previousSortRequestCameraDirection,e)}_directionChanged(e){return Math.abs(e[0]-this._previousCameraDirection[0])>this._directionChangeEpsilon||Math.abs(e[1]-this._previousCameraDirection[1])>this._directionChangeEpsilon||Math.abs(e[2]-this._previousCameraDirection[2])>this._directionChangeEpsilon}_shouldRequestSort(e){return Math.abs(e[0]-this._previousSortRequestCameraDirection[0])>this._sortRequestDirectionEpsilon||Math.abs(e[1]-this._previousSortRequestCameraDirection[1])>this._sortRequestDirectionEpsilon||Math.abs(e[2]-this._previousSortRequestCameraDirection[2])>this._sortRequestDirectionEpsilon}_prepareParameters(e,t){this._passParameters.splatOrder=this._data.orderTexture.texture,this._passParameters.splatFading=this._data.fadingTexture.texture,this._passParameters.splatAtlas=this._data.textureAtlas.texture;const i=Math.tan(.5*this.camera.fovY),s=i/e*t;a(this._passParameters.tanFov,s,i),this._passParameters.focalLength=e/(2*i);const o=this.view.qualitySettings.gaussianSplat.minimumSplatPixelRadius;this._passParameters.minSplatRadius=o*Math.sqrt(t*e)/Math.sqrt(2073600),r(this._passParameters.origin,this.bindParameters.camera.eye),this._prepareHighPrecisionCameraPosition(),this._updateSlicePlaneLocalOrigin(),this._updateClipUniforms()}_updateClipUniforms(){if(this._clippingEnabled){const[e,t,i,s,a,r]=this._clipBox,[n,h,l]=this.camera.eye;o(this._passParameters.clipMinCameraRelative,e-n,t-h,i-l),o(this._passParameters.clipMaxCameraRelative,s-n,a-h,r-l)}}_updateSlicePlaneLocalOrigin(){this._passParameters.slicePlaneLocalOrigin=this.camera.eye}_hasSameClipBox(e){return d(this._clipBox,e,(e,t)=>e===t)}_renderGaussianColorAndDepth(e,t){const i=this.renderingContext;e.acquireColor(w,5,"gaussian depth output"),i.bindFramebuffer(e.fbo),i.setClearColor(0,0,0,0),i.clear(16384),this.renderingContext.bindTechnique(t,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(R.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}_prepareHighPrecisionCameraPosition(){n(this._passParameters.tileCameraPosition,this.camera.eye,1/T.tileSize),h(this._passParameters.tileCameraPosition,this._passParameters.tileCameraPosition),n(this._passParameters.cameraDelta,this._passParameters.tileCameraPosition,T.tileSize),l(this._passParameters.cameraDelta,this.camera.eye,this._passParameters.cameraDelta)}_handleFading(){if(0===this._fadeHelper.numFadingTiles)return void(this._previousFrameStart=null);this._previousFrameStart??=this.view.stage.renderer.renderContext.time;const e=this.view.stage?.renderer.renderContext.time-this._previousFrameStart;this._fadeHelper.updateAllTileFading(e),this._previousFrameStart=this.view.stage.renderer.renderContext.time,this._data.fadingTexture.updateTexture(this._data.textureAtlas.pageAllocator.pageCount)}static{this.tileSize=2.048}};e([i()],D.prototype,"produces",void 0),e([i()],D.prototype,"consumes",void 0),e([i({constructOnly:!0})],D.prototype,"layerView",void 0),D=T=e([s("esri.views.3d.webgl-engine.lib.GaussianSplatRenderNode")],D);export{D as GaussianSplatRenderNode};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as r,abortMaybe as i,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as _,sync as u}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as b,invert as f,multiply as g,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as T,create as E}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as w}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as A,ZEROS as I}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as C}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as D,InternalRenderCategory as R,AllRenderNodeOutputs as S,AllInternalRenderNodeOutputs as O}from"../../webgl.js";import{minNearDistanceInMeters as F}from"../../state/NearFarHeuristic.js";import{debugFlags as x}from"../../support/debugFlags.js";import"../../webgl/ManagedDepthAttachment.js";import{FBOCache as y}from"../core/FBOCache.js";import{RenderPassManager as N}from"../core/renderPasses/RenderPassManager.js";import{isColor as H}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as G}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{hasOit8Bit as v,hasEmissive8Bit as M}from"../effects/fboFormatUtils.js";import{RenderNodes as q}from"../effects/RenderNodes.js";import{RenderPluginManager as L}from"../effects/RenderPluginManager.js";import{WeatherFader as j}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as B}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as V,renderHighlightBuffer as k}from"../effects/highlight/Highlight.js";import{OITBlend as W}from"../effects/transparency/OITBlend.js";import{AnimationTimer as z}from"./AnimationTimer.js";import{AnimationTimeStep as Q}from"./AnimationTimeStep.js";import{BoundingInfo as Y}from"./BoundingInfo.js";import{Compositor as $}from"./Compositor.js";import{DepthRange as J}from"./DepthRange.js";import{depthRangeFromScene as K}from"./depthRangeUtils.js";import{MainFramebuffer as Z}from"./MainFramebuffer.js";import{RenderContext as X,defaultRenderOccludedMask as ee}from"./RenderContext.js";import{RendererBase as te}from"./RendererBase.js";import{setupFeatureDefaults as se}from"./RenderFeature.js";import{RenderPluginInput as re}from"./RenderPluginInput.js";import{ShadowAccumulator as ie}from"./ShadowAccumulator.js";import{ShadowMap as ae}from"./ShadowMap.js";import ne from"./SliceHelper.js";import{MergedRenderer as he}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as oe}from"../parts/renderUtils.js";import{RendererPerformanceInfo as de,PerformanceCategory as le}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as _e,PixelType as ue,ColorAttachment2 as me,ColorAttachment0 as pe}from"../../../webgl/enums.js";let ce=class extends te{constructor(e,t,s,r,i){super({stage:e}),this._techniques=s,this._rctx=r,this._requestRender=i,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new N,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new ne,this.sceneDepthRange=m(J.Infinite),this._state=m(2),this._hasGlobalIlluminationFlag=!!has("global-illumination"),this._hasOit8Bit=v(),this._hasEmissive8Bit=M(),this._hasAnimations=!1,this._animationTimestep=new Q,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new re,this._hasTransparentGeometry=!1,this._oitCallouts=!1,this._releaseNodeInputs=e=>{for(const t of Re)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new y(r),this._compositor=new $(r,s),this._renderStateFeatures=m(se(e.view.qualityProfile));const a=new ae(this._fboCache,e.viewingMode);this._renderContext=new X(this._rctx,a,s),this._framebuffer=new Z(this._fboCache,this._bindParameters),this._performanceInfo=new de(this._rctx),this._blit=new U(s),this._shadowAccumulator=new ie(this.fboCache,s,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,s,r)=>{const i=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,s,r,!0,i),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},i),this._nodes=new q(this._renderContext),this._plugins=new L({renderContext:this._renderContext,techniques:s,materials:t,requestRender:i,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new j({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>i(),l),d(()=>x.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},i()},_),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():I;w(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),i()},l),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=G,l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},u),d(()=>this._bindParameters.clouds.data?.state,()=>i(),u),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,i()},_),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=r(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=i(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,Y.prune(),he.prune(),C()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new W(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=se(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this._renderStateFeatures.mutate(r=>r.set(t,e,s)),this._requestRender()}get _highQualityTransparency(){return this.isFeatureEnabled(1)}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(5),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,19,13,14,15)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,13,14,15)}get hasAmbientIllumination(){return this.isFeatureEnabled(4)&&!this._inGlobeView}get _hasGlobalIllumination(){return this.hasAmbientIllumination&&this._hasGlobalIlluminationFlag}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmissions(){return this._hasEmissive8Bit||this.hasFloatBlend?this._plugins.hasEmissions:0}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(10)}get oitEnabled(){return this.hasFloatBlend||this._hasOit8Bit}get highResolutionAtmosphere(){return this.isFeatureEnabled(3)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:ye(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),u)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.reprojection.matrix,T)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){void 0!==e.shadowMap&&this._bindParameters.shadowMap.enabled!==e.shadowMap&&(this._bindParameters.shadowMap.enabled=e.shadowMap,this._requestRender()),e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,10)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,14),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...we),has.water=this._plugins.produces(4,20),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new z(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?r(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,s,r=!1){try{return this._isRendering=!0,this._render(e,t,s,r)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new oe(this._pluginInput.get(D.FINAL),null)}_render(e,t,s,r){const i=0===s;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:a,contentCamera:o,mode:d,alignPixelEnabled:l}=e;this._state.value=d,this._renderContext.time=t,this._bindParameters.output=0,this._bindParameters.emissions=this._hasEmissions,this._bindParameters.alignPixelEnabled=l,this._bindParameters.decorations=!r,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const _=!r||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=_?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(R.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(R.CUTFILL_COLOR),this._renderOverlay(),a.setGLViewport(this._rctx);const u=this._framebuffer,m=u.initialize(a.fullWidth,a.fullHeight,this._backgroundColor);this.hasReflections?(m?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor=m):m?.release(),this._ensureBindParameters(a,o,t),this._plugins.sortTestsTransparentOrderedSlots(Ie),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!r,this._plugins.prepareRender(),this._hasTransparentGeometry=this._plugins.produces(0,...fe),this._precompilePrepasses(),this.performanceInfo.advance(le.PREPARE);const p=this._computeShadowDepthRange(a);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(a,o,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p,!i),this._oitCallouts=this._hasTransparentGeometry&&this.oitEnabled,u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._precompileShaders(),this._bindParameters.output=0;this._bindParameters.hasOpaqueEmissions||0===this._bindParameters.emissions?(this._renderOpaque(),this._renderPretransparent()):(this._bindParameters.emissions=0,this._renderOpaque(),this._renderPretransparent(),this._bindParameters.emissions=2),this._renderTransparent(),this._bindParameters.reprojection.lastFrameColor=n(this._bindParameters.reprojection.lastFrameColor),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._bindParameters.shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),u.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(R.VIEWSHED,e)),u.update(e=>this._renderNodes(R.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),u.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),u.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),this._pluginInput.release(R.GROUND_DEPTH),u.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===s?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(D.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),this._hasGlobalIllumination&&this._hasEmissions&&(this._bindParameters.reprojection.lastFrameEmission=u.color.obtainAttachment(_e)),u.update(e=>this._renderNodes(R.ANTIALIASING,e));const b=this._hasPhotoshopTerrain||!this._hasTransparentGeometry?1:2;let f;return this._bindParameters.emissions=0,this._hasHUDHighlights&&u.update(e=>this._renderHUD(b,e)),u.update(e=>this._renderNodes(R.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||u.update(e=>this._renderHUD(b,e)),this._bindParameters.emissions=this._hasEmissions,u.update(e=>this._renderNodes(R.MAGNIFIER,e)),u.update(e=>this._renderNodes(D.FINAL,e)),i&&this._blit.toFramebuffer(this._rctx,u.color,this._bindParameters),this._hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),u.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(f=u.color,f.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new oe(f,c)}_precompileShaders(){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const e=this._bindParameters.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(e,R.OPAQUE_ENVIRONMENT,R.PRE_TRANSPARENT);2===this._bindParameters.emissions&&(this._bindParameters.emissions=0,this._precompileOpaqueGeometry(),this._bindParameters.emissions=2);const t=this._bindParameters;if(t.terrainDepthTest=t.cullAboveTerrain=this._needsTerrainDepth,this._bindParameters.output=3,this._plugins.precompile(...ge),this._bindParameters.output=0,this._plugins.precompile(...ge),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(this._bindParameters,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(this._bindParameters,!1,1)}this._hasTransparentGeometry&&(this._precompileTransparentGeometry(),this._hasPhotoshopTerrain&&(t.cullAboveTerrain=!1,this._precompileTransparentGeometry(),t.cullAboveTerrain=this._needsTerrainDepth)),this._nodes.precompile(e,R.FOCUSAREA);const s=this._hasPhotoshopTerrain&&!this._needsTerrainDepth;this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,s,e),this._oitCallouts||this._plugins.precompile(16),t.terrainDepthTest=t.cullAboveTerrain=!1,this._nodes.precompile(e,R.TRANSPARENT_ENVIRONMENT,R.VIEWSHED,R.CUTFILL_COMPUTATION,R.CUTFILL_COLOR,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=this._hasEmissions,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(14,13)}),t.highlightLevel=null,this._nodes.precompile(e,R.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(e,D.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(9),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(le.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let r=this.fboCache.acquire(t,s,"olid");return r.acquireDepth(13),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(le.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e;if(s||t){const e=s?this.performanceInfo.elapsedTime:0;let r=0;t?r=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const i=Math.max(e,r);this._animationTimestep.frame(i,s)}}readMainDepth(e,t){const{mainDepth:s,camera:r}=this._bindParameters;if(!s)return;const i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(i.fbo),r.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(I),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),i.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,ue.UNSIGNED_BYTE,t),i.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:r}=this._framebuffer.size,i=this.fboCache.acquire(s,r,"edges"),a=this._bindParameters.geometryDepth,n=()=>t.render(this._bindParameters,e);this._renderToTargets(n,i,a??this._framebuffer.depth,I),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(1===e?le.OPAQUE_EDGES:le.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(le.OVERLAY)}_renderShadowMap(e,t,s,r){if(!this.shadowsEnabled)return;const i=this._bindParameters.shadowMap;if(i.start(e,s,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,i),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(R.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,i.disposeOutput(6),i.clear(),this._renderShadowCascades(7,i)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(le.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(R.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e);t.finish(e),this._bindParameters.output=s}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this._hasGlobalIllumination+ +this._shadowAccumulator.accumulating+ +this._testsNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements&&this.oitEnabled||this._hasPhotoshopTerrain}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(R.AMBIENT_ILLUMINATION,this._hasGlobalIlluminationFlag?this._renderGlobalIllumination():this._renderSSAO());const t=this._needsDepth;t?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),this.performanceInfo.advance(le.DEPTH)):e.detachDepth(),this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquire(t,s,"geometry",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=r.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),r.release(),this.performanceInfo.advance(le.DEPTH)}_renderTerrainDepth(){if(this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,!this._needsTerrainDepth)return;const e=this._bindParameters.output;this._bindParameters.output=3;const{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquire(t,s,"terrain",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this._renderTransparentGround(),this._bindParameters.terrainDepth=r.obtainDepthTexture(),r.release(),this._bindParameters.output=e}_renderGeometryDepth(){if(this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),!this._needsTerrainDepth)return;const e=this._bindParameters.output,{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquire(t,s,"geometry",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(3),this._bindParameters.output=e,this._bindParameters.geometryDepth=r.obtainDepthTexture(),r.release()}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return J.Zero;const t=K(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=J.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<B)return void(this.sceneDepthRange.value=J.Infinite);const t=e.clone();t.near=F,t.far=1e10;const s=K(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...S,R.VIEWSHED,R.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){this._normalsRequired?(this._precompilePlugins(4,Pe),this._needsDepth&&this._precompilePlugins(3,Te)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(this._bindParameters.hasEmission,R.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&this._precompileAllGeometry(5),this.hasAmbientIllumination&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,R.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquire(t,s,"normals",5);r.acquireDepth(13),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(I,!0,!0),this._bindParameters.output=4,this._plugins.render(...Pe);const i=this._nodes.optional("normals",...S,R.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(le.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(this.hasAmbientIllumination&&e)return this._bindParameters.ssao=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(le.AMBIENT_ILLUMINATION),this._bindParameters.ssao}_renderGlobalIllumination(){if(!this.hasAmbientIllumination)return void this._releaseGlobalIlluminationBuffers();const e=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIllumination=e,this.performanceInfo.advance(le.AMBIENT_ILLUMINATION),e}_releaseGlobalIlluminationBuffers(){this._bindParameters.reprojection.lastFrameDepth=h(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=h(this._bindParameters.reprojection.lastFrameEmission),this._bindParameters.globalIllumination=h(this._bindParameters.globalIllumination)}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...ge),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...Ee);this._renderContext.renderOccludedMask=ee}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(10),this.renderSlots(e,...Ee),this._renderContext.renderOccludedMask=ee}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ce[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(17),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(15)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillOrthographicReferenceDepth(){this._precompilePlugins(9,De)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e){const{camera:t,contentCamera:s}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,s),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=r}renderCutFillOrthographicReferenceDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...De),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=r}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,R.GROUND_DEPTH,13);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Te)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...be),this._nodes.precompile(this._bindParameters.hasEmission,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...be)}_renderTransparentGeometry(){this._plugins.render(...fe),this._oitCallouts&&this._plugins.render(16)}get _hasPhotoshopTerrain(){return this._plugins.produces(0,6)}get _needsTerrainDepth(){return this._highQualityTransparency&&this._hasPhotoshopTerrain}_renderPhotoshopTerrain(){if(!this._hasPhotoshopTerrain)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,"transparent terrain"),r=()=>this._plugins.render(6);return this._renderToTargets(r,s,this._framebuffer.depth,I),this.performanceInfo.advance(le.TRANSPARENT_TERRAIN),s}_renderTransparentGround(){this._plugins.render(...ge)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(16),{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquireDepth(this._hudDepthFormat,t,s,"line callouts");this._renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(16)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this.oitEnabled?(this._bindParameters.output=1,this._plugins.precompile(...we),this._bindParameters.output=2,this._plugins.precompile(...we),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1)):(this._bindParameters.output=0,this._plugins.precompile(...we)),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...we)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;if(this.oitEnabled){const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const r=!!t.getTexture(_e);this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),r),s.release()}else if(this._bindParameters.output=0,0===e){const t=()=>this._renderHUDElements(e),{width:s,height:r}=this._framebuffer.size,i=this.fboCache.acquireDepth(this._hudDepthFormat,s,r,"hud");this._renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(this._hudDepthFormat),this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(256),this._renderHUDElements(e),t.detachDepth();return this.performanceInfo.advance(0===e?le.HUD_OCCLUDED:le.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:r,height:i}=this._framebuffer.size,{highlights:a}=s,n=a.length>V?3:1,h=e.acquire(r,i,"highlights",n);h.acquireDepth(13);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),k(t,e,r,i,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(le.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...O)+this._nodes.optional("highlights",...O)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ae),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t){this._shadowAccumulator.updateDepthRange(e),this._bindParameters.output=0,this._shadowAccumulator.accumulating&&this._bindParameters.depth&&(this._shadowAccumulator.renderAccumulation(this._bindParameters,t)&&this.performanceInfo.advance(le.ACCUMULATED_SHADOWS),this._bindParameters.depth=h(this._bindParameters.depth))}_precompileTransparentGeometry(){this.oitEnabled&&H(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...fe),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=2,this._plugins.precompile(...fe),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=0):this._plugins.precompile(...fe)}_renderOIT(e,t=2){const s=1===e,{width:r,height:i}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",_=this.fboCache.acquire(r,i,l,o),u=h.hasEmission&&(0===e||1!==t);u&&_.acquireColor(_e,o,"oit emissive");const m=u?me:_e;_.acquireColor(m,this.hasFloatBlend?7:0,"oit alpha"),s||_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer([0,0,0,1]),u&&this._rctx.clearBuffer(1,I),a(),_.detachDepth(),h.output=2;const p=this.fboCache.acquire(r,i,s?"oit hud front":"oit front");u&&p.acquireColor(_e,o,"oit emissive front"),s?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(I,s),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!s;let b;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(b=this.fboCache.acquire(r,i,"oit hud composite"),this._rctx.bindFramebuffer(b.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(m,0,"hud occlusion"),this._rctx.clearBuffer(m-pe,I)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,_,p,h,u,c,e),b?.detachDepth(),s||c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(m)),p.release(),_.release(),h.output=d,b}get _hudDepthFormat(){return this.isFeatureEnabled(8)?13:12}get _needsOpaquePass(){return this.plugins.produces(0,...be)||this.plugins.produces(5,...be)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(R.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;this._renderTerrainDepth(),t.update(t=>this._renderNodes(D.OPAQUE,t,e)),this.fboCache.debugCallback?.(D.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPretransparent(){this._framebuffer.update(e=>this._renderNodes(R.PRE_TRANSPARENT,e)),this.fboCache.debugCallback?.(R.PRE_TRANSPARENT,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;2===this._bindParameters.emissions&&e.ensureEmissionAttachment(),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry()),e.update(e=>this._renderNodes(D.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(D.TRANSPARENT,e.color.fbo),this._renderGeometryDepth(),this._needsTerrainDepth||this._oitCallouts||this._plugins.render(16),this._renderEdges(0);const t=this._renderPhotoshopTerrain(),s=t?.getTexture();s&&this._renderHUD(0,e.color),this._bindParameters.cullAboveTerrain=!1,s&&(e.bind(),this._compositor.compositePreMultipliedAlpha(this._bindParameters,s),t?.release(),this._needsTerrainDepth&&(this._renderEdges(1),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry(),this.performanceInfo.advance(le.TRANSPARENT)),this._renderEdges(0))),this._bindParameters.ssao=n(this._bindParameters.ssao),this._needsTerrainDepth&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(le.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(9),this.performanceInfo.advance(le.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){const r=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(r,t.fbo);const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),i}_ensureBindParameters(e,t,s){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(s),this._ensureBindParametersScreenSpaceReflections(s),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(e){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,e,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(e){const{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){const{reprojection:e,camera:t}=this._bindParameters;if(!(this.hasReflections||this._hasGlobalIllumination))return void(this._reprojectionMatrix=T);const{lastFrameCamera:s}=e,r=!s.equals(t);if(r?(f(Oe,t.viewMatrix),f(Se,t.projectionMatrix),g(Fe,Oe,Se),g(Fe,s.viewMatrix,Fe),g(Fe,s.projectionMatrix,Fe),this._reprojectionMatrix=Fe):this._reprojectionMatrix=T,this._hasGlobalIllumination){const{viewMatrix:t}=e;r?(g(xe,s.viewMatrix,Oe),P(t,xe)):P(t,T)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,r){this._bindParameters.updateLighting(e,t,s,r),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}_renderToTargets(e,t,s,r,i=!1,a=!1){t.attachDepth(s),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(r,i,a),e(),t.detachDepth()}get test(){}};e([p()],ce.prototype,"_inGlobeView",void 0),e([p({readOnly:!0})],ce.prototype,"hasAmbientIllumination",null),e([p({readOnly:!0})],ce.prototype,"highResolutionAtmosphere",null),e([p()],ce.prototype,"_edgeView",void 0),e([p()],ce.prototype,"updating",null),ce=e([c("esri.views.3d.webgl-engine.lib.Renderer")],ce);const be=[0,1,2,3],fe=[8,7,4,5],ge=[6,8,7],Pe=[0,1,2,4,...ge],Te=[3,5],Ee=[2,4,9],we=[17,13,15,14],Ae=[4,5,2,3,0,1,...ge],Ie=[4,9,5,12],Ce={0:[14],1:[13],2:[14,13],3:[14,13]},De=[0,1,...ge],Re=["normals","highlights"],Se=E(),Oe=E(),Fe=E(),xe=E();function ye(e){return t=>e.immediate.schedule(t)}export{ce as Renderer};
2
+ import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as r,abortMaybe as i,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as _,sync as u}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as b,invert as f,multiply as g,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as T,create as E}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as w}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as A,ZEROS as I}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as C}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as D,InternalRenderCategory as R,AllRenderNodeOutputs as S,AllInternalRenderNodeOutputs as O}from"../../webgl.js";import{minNearDistanceInMeters as F}from"../../state/NearFarHeuristic.js";import{debugFlags as x}from"../../support/debugFlags.js";import"../../webgl/ManagedDepthAttachment.js";import{FBOCache as y}from"../core/FBOCache.js";import{RenderPassManager as N}from"../core/renderPasses/RenderPassManager.js";import{isColor as H}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as G}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{hasOit8Bit as v,hasEmissive8Bit as M}from"../effects/fboFormatUtils.js";import{RenderNodes as q}from"../effects/RenderNodes.js";import{RenderPluginManager as L}from"../effects/RenderPluginManager.js";import{WeatherFader as j}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as B}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as V,renderHighlightBuffer as k}from"../effects/highlight/Highlight.js";import{OITBlend as W}from"../effects/transparency/OITBlend.js";import{AnimationTimer as z}from"./AnimationTimer.js";import{AnimationTimeStep as Q}from"./AnimationTimeStep.js";import{BoundingInfo as Y}from"./BoundingInfo.js";import{Compositor as $}from"./Compositor.js";import{DepthRange as J}from"./DepthRange.js";import{depthRangeFromScene as K}from"./depthRangeUtils.js";import{MainFramebuffer as Z}from"./MainFramebuffer.js";import{RenderContext as X,defaultRenderOccludedMask as ee}from"./RenderContext.js";import{RendererBase as te}from"./RendererBase.js";import{setupFeatureDefaults as se}from"./RenderFeature.js";import{RenderPluginInput as re}from"./RenderPluginInput.js";import{ShadowAccumulator as ie}from"./ShadowAccumulator.js";import{ShadowMap as ae}from"./ShadowMap.js";import ne from"./SliceHelper.js";import{MergedRenderer as he}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as oe}from"../parts/renderUtils.js";import{RendererPerformanceInfo as de,PerformanceCategory as le}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as _e,PixelType as ue,ColorAttachment2 as me,ColorAttachment0 as pe}from"../../../webgl/enums.js";let ce=class extends te{constructor(e,t,s,r,i){super({stage:e}),this._techniques=s,this._rctx=r,this._requestRender=i,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new N,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new ne,this.sceneDepthRange=m(J.Infinite),this._state=m(2),this._hasGlobalIlluminationFlag=!!has("global-illumination"),this._hasOit8Bit=v(),this._hasEmissive8Bit=M(),this._hasAnimations=!1,this._animationTimestep=new Q,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new re,this._hasTransparentGeometry=!1,this._oitCallouts=!1,this._releaseNodeInputs=e=>{for(const t of Re)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new y(r),this._compositor=new $(r,s),this._renderStateFeatures=m(se(e.view.qualityProfile));const a=new ae(this._fboCache,e.viewingMode);this._renderContext=new X(this._rctx,a,s),this._framebuffer=new Z(this._fboCache,this._bindParameters),this._performanceInfo=new de(this._rctx),this._blit=new U(s),this._shadowAccumulator=new ie(this.fboCache,s,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,s,r)=>{const i=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,s,r,!0,i),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},i),this._nodes=new q(this._renderContext),this._plugins=new L({renderContext:this._renderContext,techniques:s,materials:t,requestRender:i,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new j({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>i(),l),d(()=>x.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},i()},_),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():I;w(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),i()},l),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=G,l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},u),d(()=>this._bindParameters.clouds.data?.state,()=>i(),u),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,i()},_),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=r(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=i(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,Y.prune(),he.prune(),C()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new W(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=se(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this._renderStateFeatures.mutate(r=>r.set(t,e,s)),this._requestRender()}get _highQualityTransparency(){return this.isFeatureEnabled(1)}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(5),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,19,13,14,15)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,13,14,15)}get hasAmbientIllumination(){return this.isFeatureEnabled(4)&&!this._inGlobeView}get _hasGlobalIllumination(){return this.hasAmbientIllumination&&this._hasGlobalIlluminationFlag}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmissions(){return this._hasEmissive8Bit||this.hasFloatBlend?this._plugins.hasEmissions:0}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(10)}get oitEnabled(){return this.hasFloatBlend||this._hasOit8Bit}get highResolutionAtmosphere(){return this.isFeatureEnabled(3)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:ye(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),u)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.reprojection.matrix,T)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){void 0!==e.shadowMap&&this._bindParameters.shadowMap.enabled!==e.shadowMap&&(this._bindParameters.shadowMap.enabled=e.shadowMap,this._requestRender()),e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,10)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,14),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...we),has.water=this._plugins.produces(4,20),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new z(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?r(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,s,r=!1){try{return this._isRendering=!0,this._render(e,t,s,r)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new oe(this._pluginInput.get(D.FINAL),null)}_render(e,t,s,r){const i=0===s;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:a,contentCamera:o,mode:d,alignPixelEnabled:l}=e;this._state.value=d,this._renderContext.time=t,this._bindParameters.output=0,this._bindParameters.emissions=this._hasEmissions,this._bindParameters.alignPixelEnabled=l,this._bindParameters.decorations=!r,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const _=!r||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=_?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(R.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(R.CUTFILL_COLOR),this._renderOverlay(),a.setGLViewport(this._rctx);const u=this._framebuffer,m=u.initialize(a.fullWidth,a.fullHeight,this._backgroundColor);this.hasReflections?(m?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor=m):m?.release(),this._ensureBindParameters(a,o,t),this._plugins.sortTestsTransparentOrderedSlots(Ie),this._plugins.prepareRender(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!r,this._hasTransparentGeometry=this._plugins.produces(0,...fe),this._precompilePrepasses(),this.performanceInfo.advance(le.PREPARE);const p=this._computeShadowDepthRange(a);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(a,o,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p,!i),this._oitCallouts=this._hasTransparentGeometry&&this.oitEnabled,u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._precompileShaders(),this._bindParameters.output=0;this._bindParameters.hasOpaqueEmissions||0===this._bindParameters.emissions?(this._renderOpaque(),this._renderPretransparent()):(this._bindParameters.emissions=0,this._renderOpaque(),this._renderPretransparent(),this._bindParameters.emissions=2),this._renderTransparent(),this._bindParameters.reprojection.lastFrameColor=n(this._bindParameters.reprojection.lastFrameColor),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._bindParameters.shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),u.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(R.VIEWSHED,e)),u.update(e=>this._renderNodes(R.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),u.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),u.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),this._pluginInput.release(R.GROUND_DEPTH),u.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===s?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(D.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),this._hasGlobalIllumination&&this._hasEmissions&&(this._bindParameters.reprojection.lastFrameEmission=u.color.obtainAttachment(_e)),u.update(e=>this._renderNodes(R.ANTIALIASING,e));const b=this._hasPhotoshopTerrain||!this._hasTransparentGeometry?1:2;let f;return this._bindParameters.emissions=0,this._hasHUDHighlights&&u.update(e=>this._renderHUD(b,e)),u.update(e=>this._renderNodes(R.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||u.update(e=>this._renderHUD(b,e)),this._bindParameters.emissions=this._hasEmissions,u.update(e=>this._renderNodes(R.MAGNIFIER,e)),u.update(e=>this._renderNodes(D.FINAL,e)),i&&this._blit.toFramebuffer(this._rctx,u.color,this._bindParameters),this._hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),u.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(f=u.color,f.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new oe(f,c)}_precompileShaders(){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const e=this._bindParameters.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(e,R.OPAQUE_ENVIRONMENT,R.PRE_TRANSPARENT);2===this._bindParameters.emissions&&(this._bindParameters.emissions=0,this._precompileOpaqueGeometry(),this._bindParameters.emissions=2);const t=this._bindParameters;if(t.terrainDepthTest=t.cullAboveTerrain=this._needsTerrainDepth,this._bindParameters.output=3,this._plugins.precompile(...ge),this._bindParameters.output=0,this._plugins.precompile(...ge),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(this._bindParameters,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(this._bindParameters,!1,1)}this._hasTransparentGeometry&&(this._precompileTransparentGeometry(),this._hasPhotoshopTerrain&&(t.cullAboveTerrain=!1,this._precompileTransparentGeometry(),t.cullAboveTerrain=this._needsTerrainDepth)),this._nodes.precompile(e,R.FOCUSAREA);const s=this._hasPhotoshopTerrain&&!this._needsTerrainDepth;this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,s,e),this._oitCallouts||this._plugins.precompile(16),t.terrainDepthTest=t.cullAboveTerrain=!1,this._nodes.precompile(e,R.TRANSPARENT_ENVIRONMENT,R.VIEWSHED,R.CUTFILL_COMPUTATION,R.CUTFILL_COLOR,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=this._hasEmissions,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(14,13)}),t.highlightLevel=null,this._nodes.precompile(e,R.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(e,D.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(9),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(le.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let r=this.fboCache.acquire(t,s,"olid");return r.acquireDepth(13),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(le.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e;if(s||t){const e=s?this.performanceInfo.elapsedTime:0;let r=0;t?r=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const i=Math.max(e,r);this._animationTimestep.frame(i,s)}}readMainDepth(e,t){const{mainDepth:s,camera:r}=this._bindParameters;if(!s)return;const i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(i.fbo),r.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(I),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),i.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,ue.UNSIGNED_BYTE,t),i.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:r}=this._framebuffer.size,i=this.fboCache.acquire(s,r,"edges"),a=this._bindParameters.geometryDepth,n=()=>t.render(this._bindParameters,e);this._renderToTargets(n,i,a??this._framebuffer.depth,I),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(1===e?le.OPAQUE_EDGES:le.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(le.OVERLAY)}_renderShadowMap(e,t,s,r){if(!this.shadowsEnabled)return;const i=this._bindParameters.shadowMap;if(i.start(e,s,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,i),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(R.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,i.disposeOutput(6),i.clear(),this._renderShadowCascades(7,i)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(le.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(R.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e);t.finish(e),this._bindParameters.output=s}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this._hasGlobalIllumination+ +this._shadowAccumulator.accumulating+ +this._testsNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements&&this.oitEnabled||this._hasPhotoshopTerrain}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(R.AMBIENT_ILLUMINATION,this._hasGlobalIlluminationFlag?this._renderGlobalIllumination():this._renderSSAO());const t=this._needsDepth;t?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),this.performanceInfo.advance(le.DEPTH)):e.detachDepth(),this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquire(t,s,"geometry",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=r.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),r.release(),this.performanceInfo.advance(le.DEPTH)}_renderTerrainDepth(){if(this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,!this._needsTerrainDepth)return;const e=this._bindParameters.output;this._bindParameters.output=3;const{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquire(t,s,"terrain",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this._renderTransparentGround(),this._bindParameters.terrainDepth=r.obtainDepthTexture(),r.release(),this._bindParameters.output=e}_renderGeometryDepth(){if(this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),!this._needsTerrainDepth)return;const e=this._bindParameters.output,{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquire(t,s,"geometry",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(3),this._bindParameters.output=e,this._bindParameters.geometryDepth=r.obtainDepthTexture(),r.release()}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return J.Zero;const t=K(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=J.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<B)return void(this.sceneDepthRange.value=J.Infinite);const t=e.clone();t.near=F,t.far=1e10;const s=K(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...S,R.VIEWSHED,R.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){this._normalsRequired?(this._precompilePlugins(4,Pe),this._needsDepth&&this._precompilePlugins(3,Te)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(this._bindParameters.hasEmission,R.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&this._precompileAllGeometry(5),this.hasAmbientIllumination&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,R.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquire(t,s,"normals",5);r.acquireDepth(13),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(I,!0,!0),this._bindParameters.output=4,this._plugins.render(...Pe);const i=this._nodes.optional("normals",...S,R.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(le.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(this.hasAmbientIllumination&&e)return this._bindParameters.ssao=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(le.AMBIENT_ILLUMINATION),this._bindParameters.ssao}_renderGlobalIllumination(){if(!this.hasAmbientIllumination)return void this._releaseGlobalIlluminationBuffers();const e=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIllumination=e,this.performanceInfo.advance(le.AMBIENT_ILLUMINATION),e}_releaseGlobalIlluminationBuffers(){this._bindParameters.reprojection.lastFrameDepth=h(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=h(this._bindParameters.reprojection.lastFrameEmission),this._bindParameters.globalIllumination=h(this._bindParameters.globalIllumination)}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...ge),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...Ee);this._renderContext.renderOccludedMask=ee}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(10),this.renderSlots(e,...Ee),this._renderContext.renderOccludedMask=ee}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ce[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(17),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(15)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillOrthographicReferenceDepth(){this._precompilePlugins(9,De)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e){const{camera:t,contentCamera:s}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,s),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=r}renderCutFillOrthographicReferenceDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...De),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=r}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,R.GROUND_DEPTH,13);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Te)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...be),this._nodes.precompile(this._bindParameters.hasEmission,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...be)}_renderTransparentGeometry(){this._plugins.render(...fe),this._oitCallouts&&this._plugins.render(16)}get _hasPhotoshopTerrain(){return this._plugins.produces(0,6)}get _needsTerrainDepth(){return this._highQualityTransparency&&this._hasPhotoshopTerrain}_renderPhotoshopTerrain(){if(!this._hasPhotoshopTerrain)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,"transparent terrain"),r=()=>this._plugins.render(6);return this._renderToTargets(r,s,this._framebuffer.depth,I),this.performanceInfo.advance(le.TRANSPARENT_TERRAIN),s}_renderTransparentGround(){this._plugins.render(...ge)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(16),{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquireDepth(this._hudDepthFormat,t,s,"line callouts");this._renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(16)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this.oitEnabled?(this._bindParameters.output=1,this._plugins.precompile(...we),this._bindParameters.output=2,this._plugins.precompile(...we),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1)):(this._bindParameters.output=0,this._plugins.precompile(...we)),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...we)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;if(this.oitEnabled){const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const r=!!t.getTexture(_e);this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),r),s.release()}else if(this._bindParameters.output=0,0===e){const t=()=>this._renderHUDElements(e),{width:s,height:r}=this._framebuffer.size,i=this.fboCache.acquireDepth(this._hudDepthFormat,s,r,"hud");this._renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(this._hudDepthFormat),this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(256),this._renderHUDElements(e),t.detachDepth();return this.performanceInfo.advance(0===e?le.HUD_OCCLUDED:le.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:r,height:i}=this._framebuffer.size,{highlights:a}=s,n=a.length>V?3:1,h=e.acquire(r,i,"highlights",n);h.acquireDepth(13);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),k(t,e,r,i,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(le.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...O)+this._nodes.optional("highlights",...O)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ae),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t){this._shadowAccumulator.updateDepthRange(e),this._bindParameters.output=0,this._shadowAccumulator.accumulating&&this._bindParameters.depth&&(this._shadowAccumulator.renderAccumulation(this._bindParameters,t)&&this.performanceInfo.advance(le.ACCUMULATED_SHADOWS),this._bindParameters.depth=h(this._bindParameters.depth))}_precompileTransparentGeometry(){this.oitEnabled&&H(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...fe),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=2,this._plugins.precompile(...fe),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=0):this._plugins.precompile(...fe)}_renderOIT(e,t=2){const s=1===e,{width:r,height:i}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",_=this.fboCache.acquire(r,i,l,o),u=h.hasEmission&&(0===e||1!==t);u&&_.acquireColor(_e,o,"oit emissive");const m=u?me:_e;_.acquireColor(m,this.hasFloatBlend?7:0,"oit alpha"),s||_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer([0,0,0,1]),u&&this._rctx.clearBuffer(1,I),a(),_.detachDepth(),h.output=2;const p=this.fboCache.acquire(r,i,s?"oit hud front":"oit front");u&&p.acquireColor(_e,o,"oit emissive front"),s?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(I,s),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!s;let b;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(b=this.fboCache.acquire(r,i,"oit hud composite"),this._rctx.bindFramebuffer(b.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(m,0,"hud occlusion"),this._rctx.clearBuffer(m-pe,I)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,_,p,h,u,c,e),b?.detachDepth(),s||c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(m)),p.release(),_.release(),h.output=d,b}get _hudDepthFormat(){return this.isFeatureEnabled(8)?13:12}get _needsOpaquePass(){return this.plugins.produces(0,...be)||this.plugins.produces(5,...be)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(R.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;this._renderTerrainDepth(),t.update(t=>this._renderNodes(D.OPAQUE,t,e)),this.fboCache.debugCallback?.(D.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPretransparent(){this._framebuffer.update(e=>this._renderNodes(R.PRE_TRANSPARENT,e)),this.fboCache.debugCallback?.(R.PRE_TRANSPARENT,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;2===this._bindParameters.emissions&&e.ensureEmissionAttachment(),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry()),e.update(e=>this._renderNodes(D.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(D.TRANSPARENT,e.color.fbo),this._renderGeometryDepth(),this._needsTerrainDepth||this._oitCallouts||this._plugins.render(16),this._renderEdges(0);const t=this._renderPhotoshopTerrain(),s=t?.getTexture();s&&this._renderHUD(0,e.color),this._bindParameters.cullAboveTerrain=!1,s&&(e.bind(),this._compositor.compositePreMultipliedAlpha(this._bindParameters,s),t?.release(),this._needsTerrainDepth&&(this._renderEdges(1),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry(),this.performanceInfo.advance(le.TRANSPARENT)),this._renderEdges(0))),this._bindParameters.ssao=n(this._bindParameters.ssao),this._needsTerrainDepth&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(le.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(9),this.performanceInfo.advance(le.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){const r=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(r,t.fbo);const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),i}_ensureBindParameters(e,t,s){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(s),this._ensureBindParametersScreenSpaceReflections(s),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(e){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,e,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(e){const{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){const{reprojection:e,camera:t}=this._bindParameters;if(!(this.hasReflections||this._hasGlobalIllumination))return void(this._reprojectionMatrix=T);const{lastFrameCamera:s}=e,r=!s.equals(t);if(r?(f(Oe,t.viewMatrix),f(Se,t.projectionMatrix),g(Fe,Oe,Se),g(Fe,s.viewMatrix,Fe),g(Fe,s.projectionMatrix,Fe),this._reprojectionMatrix=Fe):this._reprojectionMatrix=T,this._hasGlobalIllumination){const{viewMatrix:t}=e;r?(g(xe,s.viewMatrix,Oe),P(t,xe)):P(t,T)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,r){this._bindParameters.updateLighting(e,t,s,r),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}_renderToTargets(e,t,s,r,i=!1,a=!1){t.attachDepth(s),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(r,i,a),e(),t.detachDepth()}get test(){}};e([p()],ce.prototype,"_inGlobeView",void 0),e([p({readOnly:!0})],ce.prototype,"hasAmbientIllumination",null),e([p({readOnly:!0})],ce.prototype,"highResolutionAtmosphere",null),e([p()],ce.prototype,"_edgeView",void 0),e([p()],ce.prototype,"updating",null),ce=e([c("esri.views.3d.webgl-engine.lib.Renderer")],ce);const be=[0,1,2,3],fe=[8,7,4,5],ge=[6,8,7],Pe=[0,1,2,4,...ge],Te=[3,5],Ee=[2,4,9],we=[17,13,15,14],Ae=[4,5,2,3,0,1,...ge],Ie=[4,9,5,12],Ce={0:[14],1:[13],2:[14,13],3:[14,13]},De=[0,1,...ge],Re=["normals","highlights"],Se=E(),Oe=E(),Fe=E(),xe=E();function ye(e){return t=>e.immediate.schedule(t)}export{ce as Renderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{normalize as t,sub as r,dot as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isOITColor as f}from"../core/shaderLibrary/ShaderOutput.js";const s=2,c=1,e=O(-1),u=O(1),i=e,a=new Array;a[0]=null,a[1]=u,a[2]=e,a[3]={factor:0,units:-2*s},a[4]=O(-3);const l=a.map(t=>p(i,t));function m({output:t,enableOITOffset:r,polygonOffset:n}){return f(t)&&r?l[n]:a[n]}function p(t,r){return r?{factor:t.factor+r.factor,units:t.units+r.units}:t}function O(t){return{factor:c*t,units:s*t}}function b(o,f,s,c){const e=m(f);if(!e)return o;const u=x*e.units,i=t(y,r(y,c,s));return(t,r,f)=>{const s=(r?1-Math.abs(n(i,r)):0)*e.factor*g+u;return o(t+s,r,f)}}a[1]=u;const g=5e-5,x=5e-6,y=o();function d(t){const r=m(t)??{factor:0,units:0};return{factor:r.factor+e.factor*t.polygonOffsetIndex,units:r.units+e.units*t.polygonOffsetIndex}}export{d as getRibbonLineLayerPolygonOffset,b as intersectWithPolygonOffset,m as polygonOffset};
2
+ import{normalize as t,sub as r,dot as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isOITColor as f}from"../core/shaderLibrary/ShaderOutput.js";const s=2,c=1,e=O(-1),u=O(1),i=e,a=new Array;a[0]=null,a[1]=u,a[2]=e,a[3]=O(-2),a[4]=O(-3);const l=a.map(t=>p(i,t));function m({output:t,enableOITOffset:r,polygonOffset:n}){return f(t)&&r?l[n]:a[n]}function p(t,r){return r?{factor:t.factor+r.factor,units:t.units+r.units}:t}function O(t){return{factor:c*t,units:s*t}}function b(o,f,s,c){const e=m(f);if(!e)return o;const u=x*e.units,i=t(y,r(y,c,s));return(t,r,f)=>{const s=(r?1-Math.abs(n(i,r)):0)*e.factor*g+u;return o(t+s,r,f)}}a[1]=u;const g=5e-5,x=5e-6,y=o();function d(t){const r=m(t)??{factor:0,units:0};return{factor:r.factor+e.factor*t.polygonOffsetIndex,units:r.units+e.units*t.polygonOffsetIndex}}export{d as getRibbonLineLayerPolygonOffset,b as intersectWithPolygonOffset,m as polygonOffset};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/util/ComputeCovariance.glsl.js";import"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import"../core/shaderLibrary/util/RgbNormalizedDepthEncoding.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Texture2DUintPassUniform.js";import"./GaussianSplatTechniqueConfiguration.js";import"../../../webgl/ShaderBuilder.js";export{G as GaussianSplatPassParameters,b as build}from"../../../../chunks/GaussianSplat.glsl.js";
2
+ import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/util/ComputeCovariance.glsl.js";import"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import"../core/shaderLibrary/util/RgbNormalizedDepthEncoding.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Texture2DUintPassUniform.js";import"./GaussianSplatTechniqueConfiguration.js";import"../../../webgl/ShaderBuilder.js";export{G as GaussianSplatPassParameters,b as build}from"../../../../chunks/GaussianSplat.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{SliceConfiguration as t}from"../core/shaderLibrary/Slice.glsl.js";import{parameter as i}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class o extends t{constructor(e){super(),this.spherical=e,this.alphaCutoff=1,this.fadingEnabled=!1,this.clippingEnabled=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.pbrMode=0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0}}function r(e){switch(e){case 2:return.005;case 0:return.05;default:return.01}}e([i({count:3})],o.prototype,"alphaCutoff",void 0),e([i()],o.prototype,"fadingEnabled",void 0),e([i()],o.prototype,"clippingEnabled",void 0),e([i()],o.prototype,"terrainDepthTest",void 0),e([i()],o.prototype,"cullAboveTerrain",void 0),e([i()],o.prototype,"receiveAmbientOcclusion",void 0),e([i()],o.prototype,"receiveGlobalIllumination",void 0);export{o as GaussianSplatTechniqueConfiguration,r as getGaussianSplatAlphaCutoffValue};
2
+ import{__decorate as t}from"tslib";import{SliceConfiguration as e}from"../core/shaderLibrary/Slice.glsl.js";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class i extends e{constructor(t){super(),this.spherical=t,this.alphaCutoff=1,this.fadingEnabled=!1,this.clippingEnabled=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.fragmentShadows=!1,this.output=0,this.hasEmission=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.pbrMode=0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0}}function r(t){switch(t){case 2:return.005;case 0:return.05;default:return.01}}t([o({count:3})],i.prototype,"alphaCutoff",void 0),t([o()],i.prototype,"fadingEnabled",void 0),t([o()],i.prototype,"clippingEnabled",void 0),t([o()],i.prototype,"receiveShadows",void 0),t([o()],i.prototype,"hasShadowHighlights",void 0),t([o()],i.prototype,"fragmentShadows",void 0),t([o({count:12})],i.prototype,"output",void 0),t([o()],i.prototype,"terrainDepthTest",void 0),t([o()],i.prototype,"cullAboveTerrain",void 0),t([o()],i.prototype,"receiveAmbientOcclusion",void 0),t([o()],i.prototype,"receiveGlobalIllumination",void 0);export{i as GaussianSplatTechniqueConfiguration,r as getGaussianSplatAlphaCutoffValue};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/ShadowmapFiltering.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DBindUniform.js";import"../../../webgl/ShaderBuilder.js";export{S as ShadowCastMaxSamples,b as build}from"../../../../chunks/ShadowCastAccumulate.glsl.js";
2
+ import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DBindUniform.js";import"../../../webgl/ShaderBuilder.js";export{S as ShadowCastMaxSamples,b as build}from"../../../../chunks/ShadowCastAccumulate.glsl.js";