@arcgis/core 5.1.0-next.30 → 5.1.0-next.31

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 (244) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{dcdddbc02b7d7febc56d.js → 005fe95c3329cfe74219.js} +1 -1
  3. package/assets/esri/core/workers/chunks/00947268b6de12329146.js +1 -0
  4. package/assets/esri/core/workers/chunks/{2563ce0f18eb84a9971a.js → 0337138d3702a1a52ce0.js} +1 -1
  5. package/assets/esri/core/workers/chunks/0554f310066937098099.js +1 -0
  6. package/assets/esri/core/workers/chunks/087403b53f15eb4d375c.js +1 -0
  7. package/assets/esri/core/workers/chunks/0d156e14fc34d0600fd5.js +1 -0
  8. package/assets/esri/core/workers/chunks/{eb4934d3a3b82316c7c6.js → 0d196cf72cd8bef8d91d.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{764d080f77dec5e7a02c.js → 0e7d3f3479fcb366cc6f.js} +1 -1
  10. package/assets/esri/core/workers/chunks/0efe90bd43ab29dab8ae.js +1 -0
  11. package/assets/esri/core/workers/chunks/122ff8d0d428f31fc5d1.js +1 -0
  12. package/assets/esri/core/workers/chunks/{37d943d3f2c40468438c.js → 144acac9bb1aa78f1170.js} +1 -1
  13. package/assets/esri/core/workers/chunks/14e05d37e10ebba8cf10.js +1 -0
  14. package/assets/esri/core/workers/chunks/19722dfef06028ab399b.js +1 -0
  15. package/assets/esri/core/workers/chunks/1ff40e6057916e8482b3.js +1 -0
  16. package/assets/esri/core/workers/chunks/209d8ee81cc3ebb18b27.js +1 -0
  17. package/assets/esri/core/workers/chunks/22aeab5c363645c04806.js +1 -0
  18. package/assets/esri/core/workers/chunks/283ce37403c5e7a76e95.js +1 -0
  19. package/assets/esri/core/workers/chunks/29687aae97dc01f33fa6.js +1 -0
  20. package/assets/esri/core/workers/chunks/2d6165796af522858e56.js +1 -0
  21. package/assets/esri/core/workers/chunks/2f0e850ebea0ffd2708f.js +1 -0
  22. package/assets/esri/core/workers/chunks/34cdcee6d0ea595d7aed.js +1 -0
  23. package/assets/esri/core/workers/chunks/34f2e9d7466abc0919e7.js +1 -0
  24. package/assets/esri/core/workers/chunks/36f91b5c4345a179b8b1.js +1 -0
  25. package/assets/esri/core/workers/chunks/380bb57bccc266d6442a.js +1 -0
  26. package/assets/esri/core/workers/chunks/3b86e8eb553122d3b68d.js +1 -0
  27. package/assets/esri/core/workers/chunks/3b9de873f87f0feeb20b.js +1 -0
  28. package/assets/esri/core/workers/chunks/{f0bb986dce9cf75c890c.js → 3c597d8ef898627b8f93.js} +1 -1
  29. package/assets/esri/core/workers/chunks/3ca7f5cedf3cb747c0cf.js +1 -0
  30. package/assets/esri/core/workers/chunks/3dcb4ee8b862689a141b.js +1 -0
  31. package/assets/esri/core/workers/chunks/{c814abf3e67d9eadbc6b.js → 414a802b6365688d31cb.js} +1 -1
  32. package/assets/esri/core/workers/chunks/446bc8461403ed1ac7b2.js +1 -0
  33. package/assets/esri/core/workers/chunks/{84073653ff50e5d3c47a.js → 4a9596bb70690b673a1b.js} +17 -7
  34. package/assets/esri/core/workers/chunks/4bfc6f8c2d13ca4d2082.js +1 -0
  35. package/assets/esri/core/workers/chunks/4ceba469398ef55de8ea.js +1 -0
  36. package/assets/esri/core/workers/chunks/54c1d31e1efab765ee7a.js +1 -0
  37. package/assets/esri/core/workers/chunks/582d45a41e29005f6c63.js +1 -0
  38. package/assets/esri/core/workers/chunks/586bc903e2c285649bf2.js +1 -0
  39. package/assets/esri/core/workers/chunks/{aa3bdfd00f666c6cc521.js → 5b12865ac53d984d8149.js} +1 -1
  40. package/assets/esri/core/workers/chunks/5e5b358e603b13b4d7d7.js +1 -0
  41. package/assets/esri/core/workers/chunks/5f3b25b30acd7a07f5c0.js +1 -0
  42. package/assets/esri/core/workers/chunks/620965d2e1a9ccf81d43.js +1 -0
  43. package/assets/esri/core/workers/chunks/623bfacf4b9c9a5387cc.js +1 -0
  44. package/assets/esri/core/workers/chunks/63722607fbf8d411188d.js +1 -0
  45. package/assets/esri/core/workers/chunks/64870f555fefa85a5c59.js +1 -0
  46. package/assets/esri/core/workers/chunks/{0df585420c9cec6a7265.js → 666db81085bc97831b18.js} +1 -1
  47. package/assets/esri/core/workers/chunks/67de5225b2c66c9c7bc9.js +1 -0
  48. package/assets/esri/core/workers/chunks/696f645349249f26090c.js +1 -0
  49. package/assets/esri/core/workers/chunks/{57e375d8a8db9fa57193.js → 6e8cfe69617876ee0dac.js} +1 -1
  50. package/assets/esri/core/workers/chunks/6f3f7f785241edacdb8b.js +1 -0
  51. package/assets/esri/core/workers/chunks/{ee6f7c5d3c2f187645ff.js → 7411ca5e1876aaa0228e.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{94563b007647a9c4ad76.js → 75cde632887a95ea20f2.js} +1 -1
  53. package/assets/esri/core/workers/chunks/776a7179d32fe62a37e3.js +1 -0
  54. package/assets/esri/core/workers/chunks/7ddb11a127b9458e9eac.js +1 -0
  55. package/assets/esri/core/workers/chunks/7ebd836b98d14c7d3ecf.js +1 -0
  56. package/assets/esri/core/workers/chunks/80f0810527743833b4b7.js +1 -0
  57. package/assets/esri/core/workers/chunks/828998d33a48be161782.js +1 -0
  58. package/assets/esri/core/workers/chunks/8bd24534ed185afcb124.js +1 -0
  59. package/assets/esri/core/workers/chunks/8d4ddaace906dd09de2c.js +1 -0
  60. package/assets/esri/core/workers/chunks/8e10e4c25869af9da5ba.js +1 -0
  61. package/assets/esri/core/workers/chunks/8eed5b6cac937099102c.js +1 -0
  62. package/assets/esri/core/workers/chunks/{71be4833a260714d3b2c.js → 917474f9dd2039b82e9d.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{c3a0b38abf0a12a466fa.js → 965b8fa54d0cfafd4a70.js} +1 -1
  64. package/assets/esri/core/workers/chunks/9813f25192ea27084754.js +1 -0
  65. package/assets/esri/core/workers/chunks/9a3e5053e95db36f26dc.js +1 -0
  66. package/assets/esri/core/workers/chunks/9cc1b44c5a325a840307.js +1 -0
  67. package/assets/esri/core/workers/chunks/9cd548ea00b641d8e65d.js +1 -0
  68. package/assets/esri/core/workers/chunks/a2d045217a42ecc36308.js +1 -0
  69. package/assets/esri/core/workers/chunks/a52a8254577840a23aba.js +1 -0
  70. package/assets/esri/core/workers/chunks/{1cbe564cfc9eb0723827.js → aa367ca7f8326fd67881.js} +1 -1
  71. package/assets/esri/core/workers/chunks/aa742f847d77bb03ff60.js +1 -0
  72. package/assets/esri/core/workers/chunks/ad9194335902c687bb96.js +1 -0
  73. package/assets/esri/core/workers/chunks/ae72c530d52a6d4461be.js +1 -0
  74. package/assets/esri/core/workers/chunks/af601eb8c938c0720406.js +1 -0
  75. package/assets/esri/core/workers/chunks/b2cf19a28aa5c32a99e3.js +1 -0
  76. package/assets/esri/core/workers/chunks/b2f497339493926d4c9e.js +1 -0
  77. package/assets/esri/core/workers/chunks/b7a3a7f7fb747f9689d7.js +1 -0
  78. package/assets/esri/core/workers/chunks/b81780e5e7cd9a1a010a.js +1 -0
  79. package/assets/esri/core/workers/chunks/bb7e0334f438daa665da.js +1 -0
  80. package/assets/esri/core/workers/chunks/{5690b49f355a5e2083a9.js → c17c3453d014dc73fe0b.js} +1 -1
  81. package/assets/esri/core/workers/chunks/c1be9c4e59925a897a91.js +1 -0
  82. package/assets/esri/core/workers/chunks/{0389ebb63510dd7024de.js → c24ce19ab8580364c703.js} +2 -2
  83. package/assets/esri/core/workers/chunks/c2882a9e67124b7c18be.js +1 -0
  84. package/assets/esri/core/workers/chunks/c6112dcd6b36e256d7b5.js +1 -0
  85. package/assets/esri/core/workers/chunks/c8ae8d1b456ace0b383b.js +1 -0
  86. package/assets/esri/core/workers/chunks/{3a018c78859b5edec4fd.js → ca700e9e1bced9f99899.js} +1 -1
  87. package/assets/esri/core/workers/chunks/cc8e6d1eb90221103023.js +1 -0
  88. package/assets/esri/core/workers/chunks/d0d836502321e7a80e61.js +1 -0
  89. package/assets/esri/core/workers/chunks/d2fa8bd3f4cd3cf6b436.js +1 -0
  90. package/assets/esri/core/workers/chunks/d4b97ca16d79809ed6f2.js +1 -0
  91. package/assets/esri/core/workers/chunks/e00000468fb8ec2b3d43.js +1 -0
  92. package/assets/esri/core/workers/chunks/e0d6292aaa3f8a796de3.js +1 -0
  93. package/assets/esri/core/workers/chunks/ee582bbe7365b678ec54.js +1 -0
  94. package/assets/esri/core/workers/chunks/f4053e4e2d6e678db48a.js +1 -0
  95. package/assets/esri/core/workers/chunks/f5dbda08d7fd4bed1c62.js +1 -0
  96. package/assets/esri/core/workers/chunks/{a7dbd38bc216713044fc.js → fe21b2d31fbf83224e6b.js} +1 -1
  97. package/assets/esri/core/workers/chunks/ff8de370abf661768380.js +1 -0
  98. package/config.js +1 -1
  99. package/core/timeUtils.js +1 -1
  100. package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
  101. package/kernel.js +1 -1
  102. package/layers/VoxelWasmPerSceneView.js +1 -1
  103. package/package.json +2 -2
  104. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  105. package/support/revision.js +1 -1
  106. package/symbols/CIMSymbol.d.ts +3 -3
  107. package/symbols/ExtrudeSymbol3DLayer.d.ts +1 -1
  108. package/symbols/FillSymbol.d.ts +1 -1
  109. package/symbols/FillSymbol3DLayer.d.ts +1 -1
  110. package/symbols/IconSymbol3DLayer.d.ts +1 -1
  111. package/symbols/LabelSymbol3D.d.ts +1 -1
  112. package/symbols/LineSymbol.d.ts +1 -1
  113. package/symbols/LineSymbol3D.d.ts +1 -1
  114. package/symbols/LineSymbol3DLayer.d.ts +1 -1
  115. package/symbols/LineSymbolMarker.d.ts +1 -1
  116. package/symbols/MarkerSymbol.d.ts +1 -1
  117. package/symbols/MeshSymbol3D.d.ts +1 -1
  118. package/symbols/ObjectSymbol3DLayer.d.ts +1 -1
  119. package/symbols/PathSymbol3DLayer.d.ts +1 -1
  120. package/symbols/PictureFillSymbol.d.ts +1 -1
  121. package/symbols/PictureMarkerSymbol.d.ts +1 -1
  122. package/symbols/PointSymbol3D.d.ts +1 -1
  123. package/symbols/PolygonSymbol3D.d.ts +1 -1
  124. package/symbols/SimpleFillSymbol.d.ts +1 -1
  125. package/symbols/SimpleLineSymbol.d.ts +1 -1
  126. package/symbols/SimpleMarkerSymbol.d.ts +1 -1
  127. package/symbols/Symbol.d.ts +1 -1
  128. package/symbols/Symbol3D.d.ts +1 -1
  129. package/symbols/Symbol3DLayer.d.ts +1 -1
  130. package/symbols/TextSymbol.d.ts +1 -1
  131. package/symbols/TextSymbol3DLayer.d.ts +1 -1
  132. package/symbols/WebStyleSymbol.d.ts +1 -1
  133. package/time/TimeExtent.js +1 -1
  134. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
  135. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
  136. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  137. package/views/3d/layers/IntegratedMeshNormals.js +1 -1
  138. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  139. package/views/3d/webgl/RenderNode.js +1 -1
  140. package/views/3d/webgl-engine/collections/Component/ComponentDrawParameters.js +1 -1
  141. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  142. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  143. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  144. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  145. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +13 -3
  146. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +27 -9
  147. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  148. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  149. package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
  150. package/views/3d/webgl-engine/effects/highlight/HighlightBlurTechnique.js +1 -1
  151. package/views/3d/webgl-engine/effects/highlight/HighlightDownsampleTechnique.js +1 -1
  152. package/views/3d/webgl-engine/effects/highlight/HighlightToSingleTechnique.js +1 -1
  153. package/views/3d/webgl-engine/effects/ssao/SSAOBlurTechnique.js +1 -1
  154. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  155. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  156. package/views/3d/webgl-engine/effects/transparency/OITDimTechnique.js +1 -1
  157. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  158. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  159. package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
  160. package/views/3d/webgl.js +1 -1
  161. package/views/draw/DrawTool.js +1 -1
  162. package/views/webgl/RenderingContext.js +1 -1
  163. package/widgets/ElevationProfile/ElevationProfileInteraction.js +1 -1
  164. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  165. package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
  166. package/widgets/Sketch/SketchViewModel.js +1 -1
  167. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  168. package/widgets/TimeSlider.js +1 -1
  169. package/assets/esri/core/workers/chunks/011b31df019b3ce2277e.js +0 -1
  170. package/assets/esri/core/workers/chunks/018859b79f9ce7528ac7.js +0 -1
  171. package/assets/esri/core/workers/chunks/05e5b9082c0a396df7e5.js +0 -1
  172. package/assets/esri/core/workers/chunks/0711c856144cd8700e7e.js +0 -1
  173. package/assets/esri/core/workers/chunks/0ca9953afaea7c7e11e0.js +0 -1
  174. package/assets/esri/core/workers/chunks/1482262d0788ee65ddf7.js +0 -1
  175. package/assets/esri/core/workers/chunks/15d7c9f5a55985ed00b4.js +0 -1
  176. package/assets/esri/core/workers/chunks/16b9ac49d13057b3aff5.js +0 -1
  177. package/assets/esri/core/workers/chunks/172137cc98be03de1436.js +0 -1
  178. package/assets/esri/core/workers/chunks/179b3385c24ad8a05e1d.js +0 -1
  179. package/assets/esri/core/workers/chunks/18a40606e4c39f244ecd.js +0 -1
  180. package/assets/esri/core/workers/chunks/19cb4720e92ac3c0478c.js +0 -1
  181. package/assets/esri/core/workers/chunks/1d697642fb2a6332b7f9.js +0 -1
  182. package/assets/esri/core/workers/chunks/2003dae2d7f6d52ea643.js +0 -1
  183. package/assets/esri/core/workers/chunks/209acb3ad16c99bb506c.js +0 -1
  184. package/assets/esri/core/workers/chunks/2e06baf6469820697f17.js +0 -1
  185. package/assets/esri/core/workers/chunks/2ecfd6edab796194bf88.js +0 -1
  186. package/assets/esri/core/workers/chunks/2f3aeaa25a76ab94b8e5.js +0 -1
  187. package/assets/esri/core/workers/chunks/33de1d899a4fa9ab6ab1.js +0 -1
  188. package/assets/esri/core/workers/chunks/359d3ba9d6e3b1de05d1.js +0 -1
  189. package/assets/esri/core/workers/chunks/36fd18a05ba503e6f3b5.js +0 -1
  190. package/assets/esri/core/workers/chunks/38d5dd4d457428244302.js +0 -1
  191. package/assets/esri/core/workers/chunks/3a8f2f6ac3c3e7e71c00.js +0 -1
  192. package/assets/esri/core/workers/chunks/3ad1edf199e7159f3cc2.js +0 -1
  193. package/assets/esri/core/workers/chunks/452d71789a1b77cff48d.js +0 -1
  194. package/assets/esri/core/workers/chunks/48a56b19bf825f05cc6e.js +0 -1
  195. package/assets/esri/core/workers/chunks/48e66b78274b82478bae.js +0 -1
  196. package/assets/esri/core/workers/chunks/48fb1520cb8c5ce248d9.js +0 -1
  197. package/assets/esri/core/workers/chunks/4e9b3b4b3dcce94c99a5.js +0 -1
  198. package/assets/esri/core/workers/chunks/5028de543cc1b8e60e65.js +0 -1
  199. package/assets/esri/core/workers/chunks/544bfa97837770a8792f.js +0 -1
  200. package/assets/esri/core/workers/chunks/55d4483b1862077e3732.js +0 -1
  201. package/assets/esri/core/workers/chunks/561484ab6ed564e4b90f.js +0 -1
  202. package/assets/esri/core/workers/chunks/592f6bf0283152481f21.js +0 -1
  203. package/assets/esri/core/workers/chunks/5b70ee8122262de5bbdf.js +0 -1
  204. package/assets/esri/core/workers/chunks/6138a528c3820af81bc6.js +0 -1
  205. package/assets/esri/core/workers/chunks/72cd450b24fdfcef6547.js +0 -1
  206. package/assets/esri/core/workers/chunks/75fd96fd9557ac1f8e10.js +0 -1
  207. package/assets/esri/core/workers/chunks/777b0e07f72c42470d36.js +0 -1
  208. package/assets/esri/core/workers/chunks/7b297a2f712361bfae2e.js +0 -1
  209. package/assets/esri/core/workers/chunks/7d274a077bdfa8c485e8.js +0 -1
  210. package/assets/esri/core/workers/chunks/7dd1e93469d0b1d652bc.js +0 -1
  211. package/assets/esri/core/workers/chunks/835a929e37811d0f82cb.js +0 -1
  212. package/assets/esri/core/workers/chunks/843c505148ed728d3c30.js +0 -1
  213. package/assets/esri/core/workers/chunks/8dcc8df5925f66e45b8c.js +0 -1
  214. package/assets/esri/core/workers/chunks/8eae33c4d8932b7a6bc1.js +0 -1
  215. package/assets/esri/core/workers/chunks/91e56959b2fddf1a9743.js +0 -1
  216. package/assets/esri/core/workers/chunks/925980d26d71987ac80c.js +0 -1
  217. package/assets/esri/core/workers/chunks/9bd5c56f879eb935d906.js +0 -1
  218. package/assets/esri/core/workers/chunks/aa9c11f25d95372998a3.js +0 -1
  219. package/assets/esri/core/workers/chunks/aec33bdb355bd04f28ae.js +0 -1
  220. package/assets/esri/core/workers/chunks/af618a1c55c15e17189b.js +0 -1
  221. package/assets/esri/core/workers/chunks/b35ea099334c867bde02.js +0 -1
  222. package/assets/esri/core/workers/chunks/b4254fcb2051c873f2ba.js +0 -1
  223. package/assets/esri/core/workers/chunks/b730131e52f9220db031.js +0 -1
  224. package/assets/esri/core/workers/chunks/b81824d62be92ab595f7.js +0 -1
  225. package/assets/esri/core/workers/chunks/b9d68a5dcb50999d3a90.js +0 -1
  226. package/assets/esri/core/workers/chunks/bae7376b554cac4a8f96.js +0 -1
  227. package/assets/esri/core/workers/chunks/bcd701892ee120e13a18.js +0 -1
  228. package/assets/esri/core/workers/chunks/c1c006c86cf31f934684.js +0 -1
  229. package/assets/esri/core/workers/chunks/cb6a7ca4ba2cf0b5ced7.js +0 -1
  230. package/assets/esri/core/workers/chunks/d70678598f4080adfb39.js +0 -1
  231. package/assets/esri/core/workers/chunks/d72d5031887373d35610.js +0 -1
  232. package/assets/esri/core/workers/chunks/d8896c57a414f2450190.js +0 -1
  233. package/assets/esri/core/workers/chunks/da780342f16e65b55ac8.js +0 -1
  234. package/assets/esri/core/workers/chunks/db005d9419bb718b3962.js +0 -1
  235. package/assets/esri/core/workers/chunks/e063cce778944fe97dd3.js +0 -1
  236. package/assets/esri/core/workers/chunks/e2bdb0e87422e222646e.js +0 -1
  237. package/assets/esri/core/workers/chunks/e4faccd48060349b8da1.js +0 -1
  238. package/assets/esri/core/workers/chunks/ea245d3a6fd601fffd88.js +0 -1
  239. package/assets/esri/core/workers/chunks/efb2a8879011d2d77a81.js +0 -1
  240. package/assets/esri/core/workers/chunks/f6c9742691ccdaed44a2.js +0 -1
  241. package/assets/esri/core/workers/chunks/f82a95c46f0d579d5bf5.js +0 -1
  242. package/assets/esri/core/workers/chunks/fd9ef90e2ebb7fed62b1.js +0 -1
  243. package/assets/esri/core/workers/chunks/feac196493ccd087de35.js +0 -1
  244. /package/assets/esri/core/workers/chunks/{0389ebb63510dd7024de.js.LICENSE.txt → c24ce19ab8580364c703.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{numericSort as t}from"../../../core/arrayUtils.js";import{NestedMap as e}from"../../../core/NestedMap.js";import{fromArray as r}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as o,sub as s,cross as n,len as c,normalize as a,dot as f,add as i,scale as l}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{compressNormal as h}from"../webgl-engine/lib/Normals.js";import{DataType as p}from"../../webgl/enums.js";import{VertexElementDescriptor as u}from"../../webgl/VertexElementDescriptor.js";class g{constructor(t,e){this.data=t,this.indices=e}}function w(w,E,S,U){if(!U||S.some(({name:t})=>"normal"===t)||S.some(({name:t})=>"normalCompressed"===t))return new g(w.slice().buffer,E);const v=S[0].stride,M=v/4,C=new Float32Array(w.buffer,w.byteOffset,w.byteLength/4),F=new Array,L=new Array,N=new e,O=new Array;for(let e=0;e<E.length;e+=3){const f=E[e],i=f*M;o(d,C[i],C[i+1],C[i+2]);const l=E[e+1],h=l*M;o(b,C[h],C[h+1],C[h+2]);const p=E[e+2],u=p*M;o(y,C[u],C[u+1],C[u+2]),s(A,d,b),s(j,d,y);const g=e/3,w=n(m(),A,j);L[g]=.5*c(w),a(w,w),F[g]=w;const x=r([f,l].sort(t)),S=N.get(x[0],x[1])??[];S.push(g),N.set(x[0],x[1],S);const U=r([f,p].sort(t)),v=N.get(U[0],U[1])??[];v.push(g),N.set(U[0],U[1],v);const z=r([l,p].sort(t)),D=N.get(z[0],z[1])??[];D.push(g),N.set(z[0],z[1],D),O.push([x,U,z])}const z=.04,D=w.byteLength/v,H=new Set;for(let t=0;t<E.length;t+=3){const e=t/3;if(H.has(e))continue;const r=F[e],o=[e];H.add(e);const s=Array.from(O[e]),n=new Set;for(n.add(e);s.length>0;){const t=s.pop(),e=N.get(t[0],t[1]);e?.forEach(t=>{if(n.has(t))return;const e=F[t];Math.abs(1-f(r,e))<z&&(o.push(t),H.add(t),s.push(...O[t])),n.add(t)})}if(o.length>1){let t=0;const e=o.reduce((e,r)=>(t+=L[r],i(e,e,l(x,F[r],L[r]))),m());a(e,e),o.forEach(r=>{F[r]=e,L[r]=t})}}const I=v+4;S.forEach(t=>t.stride=I),S.push(new u("normalCompressed",2,p.SHORT,v,I,!0));const R=new Array;for(let t=0;t<E.length;t+=3){const e=t/3,r=E[t],o=R[r]??[];o.push(e),R[r]=o;const s=E[t+1],n=R[s]??[];n.push(e),R[s]=n;const c=E[t+2],a=R[c]??[];a.push(e),R[c]=a}const T=D+R.reduce((t,e)=>t+new Set(e).size-1,0),V=I/4,k=new Float32Array(T*V),q=new(T<256?Uint8Array:T<65536?Uint16Array:Uint32Array)(E);let B=D;const G=.8,J=new Int16Array(k.buffer),K=v/2,P=I/2;for(let t=0;t<D;++t){const e=t*V,r=t*M;for(let t=0;t<M;++t)k[e+t]=C[r+t];const s=(t,e,r=[])=>{const s=F[t];return r.push(t),e.filter(t=>{const e=F[t];return!(Math.abs(1-f(e,s))<G)||(r.push(t),!1)}),1===r.length?s:(r.reduce((t,e)=>i(t,t,l(b,F[e],L[e])),o(d,0,0,0)),a(d,d))},n=R[t],c=s(n.pop(),n);for(h(J,t,c[0],c[1],c[2],P,K);n.length;){const e=B++,o=e*V;for(let t=0;t<M;++t)k[o+t]=C[r+t];const c=n.pop(),a=new Array,f=s(c,n,a);h(J,e,f[0],f[1],f[2],P,K),a.forEach(r=>{for(let o=3*r;o<3*r+3;++o)q[o]===t&&(q[o]=e)})}}const Q=B<T?k.slice(0,B*V).buffer:k.buffer;return new g(Q,q)}const d=m(),b=m(),y=m(),A=m(),j=m(),x=m();export{w as addNormals};
2
+ import{compressNormal as e}from"../webgl-engine/lib/Normals.js";import{DataType as t}from"../../webgl/enums.js";import{VertexElementDescriptor as r}from"../../webgl/VertexElementDescriptor.js";class o{constructor(e,t){this.data=e,this.indices=t}}function n(n,f,a,l){if(!l||a.some(({name:e})=>"normal"===e)||a.some(({name:e})=>"normalCompressed"===e))return new o(n.slice().buffer,f);const h=a[0].stride,d=h/4,g=new Float32Array(n.buffer,n.byteOffset,n.byteLength/4),u=f.length/3,w=n.byteLength/h,{faceNormals:A,faceAreas:m,faceEdges:y,edgeFaces:$,vertexFaces:p,vertexFaceCountAndOffset:v}=s(g,d,w,f,u);c(f,u,A,m,y,$);const x=h+4;a.forEach(e=>e.stride=x),a.push(new r("normalCompressed",2,t.SHORT,h,x,!0));const b=3*u,F=x/4,E=new Float32Array(b*F),U=new(b<256?Uint8Array:b<65536?Uint16Array:Uint32Array)(f);let M=w;const I=new Int16Array(E.buffer),C=h/2,O=x/2;let j=0,q=0;const N=new Array;for(let t=0;t<w;++t){const r=t*F,o=t*d;for(let e=0;e<d;++e)E[r+e]=g[o+e];j=v[2*t+1],q=j+v[2*t];let n=t;for(;j<q;){{const t=p[--q],r=A[3*t],o=A[3*t+1],s=A[3*t+2];N.length=0,N.push(t);for(let e=j;e<q;++e){const t=p[e],n=A[3*t],c=A[3*t+1],f=A[3*t+2];Math.abs(1-(r*n+o*c+s*f))<i&&(N.push(t),e<q-1&&(p[e]=p[--q]))}let c=0,f=0,a=0;if(1===N.length)c=r,f=o,a=s;else{for(let t=0;t<N.length;++t){const e=N[t],r=m[e];c+=A[3*e]*r,f+=A[3*e+1]*r,a+=A[3*e+2]*r}const e=Math.sqrt(c*c+f*f+a*a)||1;c/=e,f/=e,a/=e}e(I,n,c,f,a,O,C)}if(n!==t&&N.forEach(e=>{for(let r=3*e;r<3*e+3;++r)U[r]===t&&(U[r]=n)}),j>=q)break;n=M++;const r=n*F;for(let e=0;e<d;++e)E[r+e]=g[o+e]}}const k=M<b?E.slice(0,M*F).buffer:E.buffer;return new o(k,U)}function s(e,t,r,o,n){const s=new Float32Array(3*n),c=new Float32Array(n),f=new Uint32Array(3*n),a=new Int32Array(2*(3*n)),l=3*n,i=new Uint32Array(l),h=new Uint32Array(2*r);for(let g=0;g<n;++g){const e=3*g;for(let t=0;t<3;++t){++h[2*o[e+t]]}}{let e=0;for(let t=0;t<r;++t){h[2*t+1]=e;e+=h[2*t]}for(let t=0;t<n;++t){const e=3*t;for(let r=0;r<3;++r){i[h[2*o[e+r]+1]++]=t}}for(let t=0;t<r;++t)h[2*t+1]-=h[2*t]}let d=0;{const n=new Uint32Array(2*l*2),i=new Uint32Array(2*r);for(let e=0;e<r;++e){const t=2*h[2*e+1]*2;i[2*e]=t,i[2*e+1]=t}const g=(e,t,r)=>{const o=Math.min(e,t),s=Math.max(e,t),c=e<t?0:1,f=i[2*o],l=i[2*o+1];let h=-1;for(let a=f;a<l;a+=2)if(n[a]===s){h=n[a+1];break}return-1===h&&(h=d++,n[l]=s,n[l+1]=h,i[2*o+1]+=2,a[2*h+(1-c)]=-1),a[2*h+c]=r,h};for(let r=0;r<o.length;r+=3){const n=o[r],a=n*t,l=e[a],i=e[a+1],h=e[a+2],d=o[r+1],u=d*t,w=e[u],A=e[u+1],m=e[u+2],y=o[r+2],$=y*t,p=l-w,v=i-A,x=h-m,b=l-e[$],F=i-e[$+1],E=h-e[$+2],U=v*E-x*F,M=x*b-p*E,I=p*F-v*b,C=Math.sqrt(U*U+M*M+I*I)||1,O=r/3;c[O]=.5*C;const j=1/C;s[3*O]=U*j,s[3*O+1]=M*j,s[3*O+2]=I*j;const q=g(n,d,O),N=g(d,y,O),k=g(y,n,O);f[3*O]=q,f[3*O+1]=N,f[3*O+2]=k}}return{faceNormals:s,faceAreas:c,faceEdges:f,vertexFaces:i,vertexFaceCountAndOffset:h,edgeFaces:a}}function c(e,t,r,o,n,s){const c=new Uint8Array(t),f=new Uint32Array(t),a=new Array,i=new Array;for(let h=0;h<e.length;h+=3){const e=h/3;if(1===c[e])continue;c[e]=1;const t=r[3*e],d=r[3*e+1],g=r[3*e+2];for(i.length=0,i.push(e),a.length=0,a.push(n[3*e],n[3*e+1],n[3*e+2]),f[e]=e+1;a.length>0;){const o=a.pop();for(let h=0;h<2;++h){const u=s[2*o+h];if(-1===u||f[u]===e+1)continue;f[u]=e+1;const w=r[3*u],A=r[3*u+1],m=r[3*u+2];if(Math.abs(1-(t*w+d*A+g*m))<l){i.push(u),c[u]=1;for(let e=0;e<3;++e){const t=n[3*u+e];t!==o&&a.push(t)}}}}if(i.length>1){let e=0,t=0,n=0,s=0;for(let f=0;f<i.length;++f){const c=i[f],a=o[c];e+=a,t+=r[3*c]*a,n+=r[3*c+1]*a,s+=r[3*c+2]*a}const c=Math.sqrt(t*t+n*n+s*s)||1;t/=c,n/=c,s/=c;for(let f=0;f<i.length;++f){const c=i[f];r[3*c]=t,r[3*c+1]=n,r[3*c+2]=s,o[c]=e}}}}function f(e,t,r,o,n,s,c,f,l,i){const h=new Uint32Array(2*o);for(let a=0;a<r;++a){const e=l[2*a],t=l[2*a+1];for(let n=e;n<t;n+=2){const e=i[n],t=i[n+1];t>=o||t<0?console.error(`Invalid edge index ${t} for vertex ${a}`):e>=r||e<0||e<a?console.error(`Invalid vertex ${e} for edge ${t}`):(h[2*t]=a,h[2*t+1]=e)}}for(let d=0;d<t;++d){const t=[e[3*d],e[3*d+1],e[3*d+2]],r=[f[3*d],f[3*d+1],f[3*d+2]];for(const e of t){const t=n[2*e+1];a(s,t,t+n[2*e],1,d)||console.error(`Face ${d} not found in vertexFaces for vertex ${e}`)}for(const e of r){const t=c[2*e],r=c[2*e+1];-1!==t||-1!==r?d!==t&&d!==r&&console.error(`Edge ${e} of face ${d} does not list it as a face`):console.error(`Edge ${e} of face ${d} has no faces`)}}for(let d=0;d<o;++d){const e=c[2*d],t=c[2*d+1];if(-1===e&&-1===t){console.error(`Edge ${d} has no faces`);continue}for(const s of[e,t].filter(e=>-1!==e)){const e=f[3*s],t=f[3*s+1],r=f[3*s+2];d!==e&&d!==t&&d!==r&&console.error(`Edge ${d} not found in edgesPerFace for face ${s}`)}const r=h[2*d],o=h[2*d+1];r===o&&console.error(`Edge ${d} is degenerate with identical vertices ${r}`);const n=Math.min(r,o);a(i,l[2*n]+1,l[2*n+1],2,d)||console.error(`Edge ${d} not found in edgeMap for vertex ${n}`)}for(let d=0;d<r;++d){const r=n[2*d+1],o=n[2*d];for(let n=r;n<r+o;++n){const r=s[n];(r<0||r>=t)&&console.error(`Invalid face ${r} in vertexFaces for vertex ${d}`),a(e,3*r,3*r+3,1,d)||console.error(`Face ${r} in vertexFaces for vertex ${d} does not reference it in indices`)}}}function a(e,t,r,o,n){for(let s=t;s<r;s+=o)if(e[s]===n)return!0;return!1}const l=.04,i=.8;export{n as addNormals,f as checkTopology};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import s from"../../../core/Error.js";import t from"../../../core/Logger.js";import{watch as i,initial as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as r}from"../../../core/accessorSupport/decorators.js";import{cross as l,normalize as n,set as h}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../geometry/projection/projectVectorToVector.js";import{empty as m,expandWithVec3 as p}from"../../../geometry/support/aaBoundingBox.js";import{equals as y}from"../../../geometry/support/spatialReferenceUtils.js";import{LayerView3D as _}from"./LayerView3D.js";import{VoxelGraphic as b}from"./VoxelGraphic.js";import{addLayerViewToWasm as w,getVoxelWasm as V,removeLayerViewFromWasm as f}from"./VoxelWasm.js";import{LayerViewPerformanceInfo as g}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as S}from"./support/PopupSceneLayerView.js";import v from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as W,isInEffectiveScaleRange as T}from"../../support/layerViewUtils.js";const x=d(),L=d();let M=class extends(S(_(v))){constructor(){super(...arguments),this._suspendedHandle=null,this._usedMemory=0,this._futureMemory=0,this.type="voxel-3d",this.slicePlaneEnabled=!1,this._wasmLayerId=-1,this.ignoresMemoryFactor=!0,this._dbgFlags=new Set}get baseUrl(){return this.layer.parsedUrl?.path??""}get wasmLayerId(){return this._wasmLayerId}initialize(){if(this._dbgFlags.add(3),"local"!==this.view.viewingMode)throw new s("voxel:unsupported-viewingMode","Voxel layers support local viewingMode only.",{});if(!!!this.view.stage.renderView.renderingContext.capabilities.colorBufferFloat?.textureFloat)throw new s("voxel:missing-color-buffer-float","Voxel layers require the WebGL2 extension EXT_color_buffer_float",{});const e=this.layer.spatialReference;if(!y(e,this.view.spatialReference))throw W("voxel layer",e.wkid,this.view.spatialReference.wkid);const t=this.layer.currentVariableId,o=this.layer.getVolume(t),r=this.layer.getVariable(t);if(null!=o&&null!=r){const e=o.dimensions[0],s=o.dimensions[1],t=o.zDimension;if(t>1){const i=o.dimensions[t],a=e.size*s.size*i.size;let l=1;switch(r.renderingFormat.type){case"Int16":case"UInt16":l=2;break;case"Int32":case"UInt32":case"Float32":l=4}this._futureMemory=l*a}}const l=w(this).then(e=>{this._wasmLayerId=e,this._suspendedHandle=i(()=>this.suspended,e=>{const s=V(this.view);s&&s.setEnabled(this,!e)},a),this.addHandles([i(()=>this.layer.renderMode,e=>this._pushRenderModeToWasm(e)),i(()=>this.layer.currentVariableId,e=>this._pushCurrentVariableIdToWasm(e)),i(()=>this.layer.getSections(),e=>this._pushSectionsToWasm(e)),i(()=>this.layer.getVariableStyles(),e=>this._pushVariableStylesToWasm(e)),i(()=>this.layer.getVolumeStyles(),e=>this._pushVolumeStylesToWasm(e)),i(()=>this.layer.enableDynamicSections,e=>this._pushEnableDynamicSectionsToWasm(e)),i(()=>this.layer.enableIsosurfaces,e=>this._pushEnableIsosurfacesToWasm(e)),i(()=>this.layer.enableSections,e=>this._pushEnableSectionsToWasm(e)),i(()=>this.layer.enableSlices,e=>this._pushEnableSlicesToWasm(e)),i(()=>[this.layer.timeOffset,this.layer.timeExtent,this.layer.useViewTime],()=>this._updateLayerTimeProperties()),i(()=>this.slicePlaneEnabled,e=>this._pushAnalysisSliceToWasm(e,this.view.slice.plane)),i(()=>this.view.slice.plane,e=>this._pushAnalysisSliceToWasm(this.slicePlaneEnabled,e))])}).catch(e=>{if(f(this),this._wasmLayerId=-1,-1===e)throw new s("voxel:addLayer-failure","The voxel layer description was invalid.",{});if(-2===e)throw new s("voxel:addLayer-failure","The voxel layer web assembly module failed to download.",{})});this.addResolvingPromise(l)}destroy(){f(this),this._suspendedHandle&&(this._suspendedHandle.remove(),this._suspendedHandle=null)}isUpdating(){const e=V(this.view);return!(this._wasmLayerId<0||null==e)&&e.isUpdating(this._wasmLayerId)}updatingFlagChanged(){this.notifyChange("updating")}get usedMemory(){return this._usedMemory}get unloadedMemory(){return this._futureMemory}get performanceInfo(){return new g(this.usedMemory)}get visibleAtCurrentScale(){return T(this.layer.effectiveScaleRange,this.view.scale)}whenGraphicBounds(e,s){const t=e.attributes["Voxel.WorldPosition"];if(t){const e=m(),s=JSON.parse(t);if(u(s,this.view.renderSpatialReference,L,this.view.spatialReference||c.WGS84))return p(e,L),Promise.resolve({boundingBox:e,screenSpaceObjects:[]})}return Promise.reject()}async whenGraphicAttributes(e,s){const t=V(this.view);if(!t)return e;const i=[];for(const a of e)this._isValidVoxelGraphic(a)&&i.push(a);return i.length&&await t.getOtherFieldPopupValues(i,s),e}_isValidVoxelGraphic(e){return e instanceof b}setUsedMemory(e){this._usedMemory=e,this._futureMemory=0}captureFrustum(){const e=V(this.view);e?.captureFrustum()}toggleFullVolumeExtentDraw(){const e=V(this.view);e?.toggleFullVolumeExtentDraw(this)}getLayerTimes(){const e=V(this.view);return e?.getLayerTimes(this)??[]}getCurrentLayerTimeIndex(){const e=V(this.view);return e?.getCurrentLayerTimeIndex(this)??0}dropQueryRenderTarget(){const e=V(this.view);e?.dropQueryRenderTarget()}_pushRenderModeToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushRenderModeToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setRenderMode(this,e)||this._dbg(3,"VoxelLayerView3D._pushRenderModeToWasm() failed!")}_pushSectionsToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setStaticSections(this,e)||this._dbg(3,"VoxelLayerView3D._pushSectionsToWasm() failed!")}_pushCurrentVariableIdToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushCurrentVariableIdToWasm() called!, "+(s?"have WASM":"don't have WASM!!!")),s?.setCurrentVariable(this,e)||this._dbg(3,"VoxelLayerView3D._pushCurrentVariableIdToWasm() failed!")}_pushVariableStylesToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushVariableStylesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setVariableStyles(this,e)||this._dbg(3,"VoxelLayerView3D._pushVariableStylesToWasm() failed!")}_accountForEnableSlices(e,s){const t=null!=s?s:this.layer.enableSlices;for(let i=0;i<e.length;++i){const s=e[i];for(const e of s.slices)e.enabled=e.enabled&&t}}_pushVolumeStylesToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushVolumeStylesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s&&(this._accountForEnableSlices(e,null),s.setVolumeStyles(this,e)||this._dbg(3,"VoxelLayerView3D._pushVolumeStylesToWasm() failed!"))}_pushAnalysisSliceToWasm(e,s){const t=V(this.view);this._dbg(2,"VoxelLayerView3D._pushAnalysisSliceToWasm() called, "+(t?"have WASM":"don't have WASM!!!"));let i=!1;if(t){if(s){const a=s.origin;l(x,s.basis1,s.basis2),n(x,x),i=t.setAnalysisSlice(this,e,a,x)}else h(x,0,0,1),i=t.setAnalysisSlice(this,!1,x,x);i||this._dbg(3,"VoxelLayerView3D._pushAnalysisSliceToWasm() failed!")}}_updateLayerTimeProperties(){const e=V(this.view);this._dbg(2,"VoxelLayerView3D._updateLayerTimeProperties() called, "+(e?"have WASM":"don't have WASM!!!")),e&&e.updateLayerTimeProperties(this)}_pushEnableDynamicSectionsToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushEnableDynamicSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setEnableDynamicSections(this,e)||this._dbg(3,"VoxelLayerView3D._pushEnableDynamicSectionsToWasm() failed!")}_pushEnableSlicesToWasm(e){const s=V(this.view);if(this._dbg(2,"VoxelLayerView3D._pushEnableSlicesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s){const t=this.layer.getVolumeStyles();this._accountForEnableSlices(t,e),s.setVolumeStyles(this,t)||this._dbg(3,"VoxelLayerView3D._pushEnableSlicesToWasm() failed!")}}_pushEnableIsosurfacesToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushEnableIsosurfacesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setEnableIsosurfaces(this,e)||this._dbg(3,"VoxelLayerView3D._pushEnableIsosurfacesToWasm() failed!")}_pushEnableSectionsToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushEnableSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setEnableSections(this,e)||this._dbg(3,"VoxelLayerView3D._pushEnableSectionsToWasm() failed!")}_dbg(e,s){this._dbgFlags.has(e)&&(3===e?t.getLogger(this).error(s):t.getLogger(this).warn(s))}};e([o()],M.prototype,"layer",void 0),e([o()],M.prototype,"baseUrl",null),e([o({type:Boolean})],M.prototype,"slicePlaneEnabled",void 0),e([o({readOnly:!0})],M.prototype,"visibleAtCurrentScale",null),M=e([r("esri.views.3d.layers.VoxelLayerView3D")],M);const A=M;export{A as default};
2
+ import{__decorate as e}from"tslib";import s from"../../../core/Error.js";import t from"../../../core/Logger.js";import{watch as i,initial as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as r}from"../../../core/accessorSupport/decorators.js";import{cross as l,normalize as n,set as h}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../geometry/projection/projectVectorToVector.js";import{empty as m,expandWithVec3 as p}from"../../../geometry/support/aaBoundingBox.js";import{equals as y}from"../../../geometry/support/spatialReferenceUtils.js";import{LayerView3D as _}from"./LayerView3D.js";import{VoxelGraphic as b}from"./VoxelGraphic.js";import{addLayerViewToWasm as w,getVoxelWasm as V,removeLayerViewFromWasm as f}from"./VoxelWasm.js";import{LayerViewPerformanceInfo as g}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as S}from"./support/PopupSceneLayerView.js";import v from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as W,isInEffectiveScaleRange as T}from"../../support/layerViewUtils.js";const x=d(),L=d();let M=class extends(S(_(v))){constructor(){super(...arguments),this.type="voxel-3d",this.ignoresMemoryFactor=!0,this._suspendedHandle=null,this._usedMemory=0,this._futureMemory=0,this.slicePlaneEnabled=!1,this._wasmLayerId=-1,this._dbgFlags=new Set}initialize(){if(this._dbgFlags.add(3),"local"!==this.view.viewingMode)throw new s("voxel:unsupported-viewingMode","Voxel layers support local viewingMode only.",{});if(!!!this.view.stage.renderView.renderingContext.capabilities.colorBufferFloat?.textureFloat)throw new s("voxel:missing-color-buffer-float","Voxel layers require the WebGL2 extension EXT_color_buffer_float",{});const e=this.layer.spatialReference;if(!y(e,this.view.spatialReference))throw W("voxel layer",e.wkid,this.view.spatialReference.wkid);const t=this.layer.currentVariableId,o=this.layer.getVolume(t),r=this.layer.getVariable(t);if(null!=o&&null!=r){const e=o.dimensions[0],s=o.dimensions[1],t=o.zDimension;if(t>1){const i=o.dimensions[t],a=e.size*s.size*i.size;let l=1;switch(r.renderingFormat.type){case"Int16":case"UInt16":l=2;break;case"Int32":case"UInt32":case"Float32":l=4}this._futureMemory=l*a}}const l=w(this).then(e=>{this._wasmLayerId=e,this._suspendedHandle=i(()=>this.suspended,e=>{const s=V(this.view);s&&s.setEnabled(this,!e)},a),this.addHandles([i(()=>this.layer.renderMode,e=>this._pushRenderModeToWasm(e)),i(()=>this.layer.currentVariableId,e=>this._pushCurrentVariableIdToWasm(e)),i(()=>this.layer.getSections(),e=>this._pushSectionsToWasm(e)),i(()=>this.layer.getVariableStyles(),e=>this._pushVariableStylesToWasm(e)),i(()=>this.layer.getVolumeStyles(),e=>this._pushVolumeStylesToWasm(e)),i(()=>this.layer.enableDynamicSections,e=>this._pushEnableDynamicSectionsToWasm(e)),i(()=>this.layer.enableIsosurfaces,e=>this._pushEnableIsosurfacesToWasm(e)),i(()=>this.layer.enableSections,e=>this._pushEnableSectionsToWasm(e)),i(()=>this.layer.enableSlices,e=>this._pushEnableSlicesToWasm(e)),i(()=>[this.layer.timeOffset,this.layer.timeExtent,this.layer.useViewTime],()=>this._updateLayerTimeProperties()),i(()=>this.slicePlaneEnabled,e=>this._pushAnalysisSliceToWasm(e,this.view.slice.plane)),i(()=>this.view.slice.plane,e=>this._pushAnalysisSliceToWasm(this.slicePlaneEnabled,e))])}).catch(e=>{if(f(this),this._wasmLayerId=-1,-1===e)throw new s("voxel:addLayer-failure","The voxel layer description was invalid.",{});if(-2===e)throw new s("voxel:addLayer-failure","The voxel layer web assembly module failed to download.",{})});this.addResolvingPromise(l)}destroy(){f(this),this._suspendedHandle&&(this._suspendedHandle.remove(),this._suspendedHandle=null)}isUpdating(){const e=V(this.view);return!(this._wasmLayerId<0||null==e)&&e.isUpdating(this._wasmLayerId)}updatingFlagChanged(){this.notifyChange("updating")}get usedMemory(){return this._usedMemory}get unloadedMemory(){return this._futureMemory}get performanceInfo(){return new g(this.usedMemory)}get visibleAtCurrentScale(){return T(this.layer.effectiveScaleRange,this.view.scale)}whenGraphicBounds(e,s){const t=e.attributes["Voxel.WorldPosition"];if(t){const e=m(),s=JSON.parse(t);if(u(s,this.view.renderSpatialReference,L,this.view.spatialReference||c.WGS84))return p(e,L),Promise.resolve({boundingBox:e,screenSpaceObjects:[]})}return Promise.reject()}async whenGraphicAttributes(e,s){const t=V(this.view);if(!t)return e;const i=[];for(const a of e)this._isValidVoxelGraphic(a)&&i.push(a);return i.length&&await t.getOtherFieldPopupValues(i,s),e}_isValidVoxelGraphic(e){return e instanceof b}setUsedMemory(e){this._usedMemory=e,this._futureMemory=0}captureFrustum(){const e=V(this.view);e?.captureFrustum()}toggleFullVolumeExtentDraw(){const e=V(this.view);e?.toggleFullVolumeExtentDraw(this)}getLayerTimes(){const e=V(this.view);return e?.getLayerTimes(this)??[]}getCurrentLayerTimeIndex(){const e=V(this.view);return e?.getCurrentLayerTimeIndex(this)??0}dropQueryRenderTarget(){const e=V(this.view);e?.dropQueryRenderTarget()}_pushRenderModeToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushRenderModeToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setRenderMode(this,e)||this._dbg(3,"VoxelLayerView3D._pushRenderModeToWasm() failed!")}_pushSectionsToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setStaticSections(this,e)||this._dbg(3,"VoxelLayerView3D._pushSectionsToWasm() failed!")}_pushCurrentVariableIdToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushCurrentVariableIdToWasm() called!, "+(s?"have WASM":"don't have WASM!!!")),s?.setCurrentVariable(this,e)||this._dbg(3,"VoxelLayerView3D._pushCurrentVariableIdToWasm() failed!")}_pushVariableStylesToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushVariableStylesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setVariableStyles(this,e)||this._dbg(3,"VoxelLayerView3D._pushVariableStylesToWasm() failed!")}_accountForEnableSlices(e,s){const t=null!=s?s:this.layer.enableSlices;for(let i=0;i<e.length;++i){const s=e[i];for(const e of s.slices)e.enabled=e.enabled&&t}}_pushVolumeStylesToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushVolumeStylesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s&&(this._accountForEnableSlices(e,null),s.setVolumeStyles(this,e)||this._dbg(3,"VoxelLayerView3D._pushVolumeStylesToWasm() failed!"))}_pushAnalysisSliceToWasm(e,s){const t=V(this.view);this._dbg(2,"VoxelLayerView3D._pushAnalysisSliceToWasm() called, "+(t?"have WASM":"don't have WASM!!!"));let i=!1;if(t){if(s){const a=s.origin;l(x,s.basis1,s.basis2),n(x,x),i=t.setAnalysisSlice(this,e,a,x)}else h(x,0,0,1),i=t.setAnalysisSlice(this,!1,x,x);i||this._dbg(3,"VoxelLayerView3D._pushAnalysisSliceToWasm() failed!")}}_updateLayerTimeProperties(){const e=V(this.view);this._dbg(2,"VoxelLayerView3D._updateLayerTimeProperties() called, "+(e?"have WASM":"don't have WASM!!!")),e&&e.updateLayerTimeProperties(this)}_pushEnableDynamicSectionsToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushEnableDynamicSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setEnableDynamicSections(this,e)||this._dbg(3,"VoxelLayerView3D._pushEnableDynamicSectionsToWasm() failed!")}_pushEnableSlicesToWasm(e){const s=V(this.view);if(this._dbg(2,"VoxelLayerView3D._pushEnableSlicesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s){const t=this.layer.getVolumeStyles();this._accountForEnableSlices(t,e),s.setVolumeStyles(this,t)||this._dbg(3,"VoxelLayerView3D._pushEnableSlicesToWasm() failed!")}}_pushEnableIsosurfacesToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushEnableIsosurfacesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setEnableIsosurfaces(this,e)||this._dbg(3,"VoxelLayerView3D._pushEnableIsosurfacesToWasm() failed!")}_pushEnableSectionsToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushEnableSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setEnableSections(this,e)||this._dbg(3,"VoxelLayerView3D._pushEnableSectionsToWasm() failed!")}get baseUrl(){return this.layer.parsedUrl?.path??""}get wasmLayerId(){return this._wasmLayerId}_dbg(e,s){this._dbgFlags.has(e)&&(3===e?t.getLogger(this).error(s):t.getLogger(this).warn(s))}};e([o({readOnly:!0})],M.prototype,"visibleAtCurrentScale",null),e([o()],M.prototype,"layer",void 0),e([o()],M.prototype,"baseUrl",null),e([o({type:Boolean})],M.prototype,"slicePlaneEnabled",void 0),M=e([r("esri.views.3d.layers.VoxelLayerView3D")],M);const A=M;export{A as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import r from"../../../core/Accessor.js";import t from"../../../core/Error.js";import{watch as i,initial as s}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{RenderNodeOutput as d}from"../webgl.js";import{getFramebufferDrawBuffers as a}from"../../webgl/RenderingContext.js";let h=class extends r{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=d.COMPOSITE,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([i(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},s)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new t("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,r=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(r),r}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){e.initializeAndBind(),this.gl.drawBuffers(a(e))}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};e([n({constructOnly:!0})],h.prototype,"view",void 0),e([n({constructOnly:!0})],h.prototype,"consumes",void 0),e([n()],h.prototype,"produces",void 0),e([n({readOnly:!0})],h.prototype,"techniques",null),h=e([o("esri.views.3d.webgl.RenderNode")],h);export{h as default};
2
+ import{__decorate as e}from"tslib";import r from"../../../core/Accessor.js";import t from"../../../core/Error.js";import{watch as i,initial as s}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{RenderNodeOutput as d}from"../webgl.js";import{getFramebufferDrawBuffers as a}from"../../webgl/RenderingContext.js";let h=class extends r{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=d.COMPOSITE,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([i(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},s)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new t("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,r=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(r),r}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){e.initializeAndBind(),this.gl.drawBuffers(a(e))}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};e([n({constructOnly:!0})],h.prototype,"view",void 0),e([n({constructOnly:!0})],h.prototype,"consumes",void 0),e([n()],h.prototype,"produces",void 0),e([n({readOnly:!0})],h.prototype,"techniques",null),h=e([o("esri.views.3d.webgl.RenderNode")],h);const u=h;export{u as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{invert as e,transpose as t}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as r}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{ones as s,clone as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{TwoVectorPosition as i}from"../../core/util/TwoVectorPosition.js";import{NoParameters as a}from"../../../../webgl/NoParameters.js";class n extends a{constructor(s,o){super(),this._componentParameters=m;const{transform:a,toMapSpace:n}=s;this.toMapSpace=n;const u=r(a.rotationScale);e(u,u),t(u,u),this.transformNormalGlobalFromModel=u;const l=new i(a.position);this.transformWorldFromModelTL=l.low,this.transformWorldFromModelTH=l.high,this.transformWorldFromModelRS=a.rotationScale,this.useENUForGlobalOverlayUV=s.obb.radius<h,this.baseColor=o.baseColor,this.opacity=o.opacity,this.textureAlphaCutoff=o.textureAlphaCutoff,this.mrrFactors=o.mrrFactors,this.emissiveBaseColor=o.emissiveBaseColor,this.baseColorTexture=o.baseColorTexture,this.metallicRoughnessTexture=o.metallicRoughnessTexture,this.normalTexture=o.normalTexture,this.occlusionTexture=o.occlusionTexture,this.emissionTexture=o.emissionTexture}destroy(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}get texture(){return this.baseColorTexture?.texture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.texture}get textureEmissive(){return this.emissionTexture?.texture}get textureOcclusion(){return this.occlusionTexture?.texture}get textureNormal(){return this.normalTexture?.texture}get componentParameters(){return this._componentParameters}updateComponentParameters(e,t){this._componentParameters=e,this.textureBackedBuffer=t}get castAnyShadows(){return 2!==this.componentParameters.castShadows}}class u{constructor(e,t,r,s,i){this.castShadows=i,this.componentDataType=0,this.externalColor=o(e),this.externalColorMixMode=t,this.emissiveStrength=r,this.emissiveSource=s}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}}class l{constructor(e,t,r,s,o){this.transparent=e,this.opaqueOverride=t,this.emissiveOverride=r,this.emissiveSourceOverride=s,this.castShadows=o,this.componentDataType=1}}const m=new u(s(),1,0,0,0),h=5e4;export{n as ComponentDrawParametersImplementation,u as ComponentParametersUniform,l as ComponentParametersVarying,m as defaultComponentParameters};
2
+ import{invert as e,transpose as t}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as r}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{ones as s,clone as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{VertexPositionDrawParameters as i}from"../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import{TwoVectorPosition as a}from"../../core/util/TwoVectorPosition.js";class n extends i{constructor(s,o){super(),this._componentParameters=u;const{transform:i,toMapSpace:n}=s;this.toMapSpace=n;const l=r(i.rotationScale);e(l,l),t(l,l),this.transformNormalGlobalFromModel=l;const m=new a(i.position);this.transformWorldFromModelTL=m.low,this.transformWorldFromModelTH=m.high,this.transformWorldFromModelRS=i.rotationScale,this.useENUForGlobalOverlayUV=s.obb.radius<h,this.baseColor=o.baseColor,this.opacity=o.opacity,this.textureAlphaCutoff=o.textureAlphaCutoff,this.mrrFactors=o.mrrFactors,this.emissiveBaseColor=o.emissiveBaseColor,this.baseColorTexture=o.baseColorTexture,this.metallicRoughnessTexture=o.metallicRoughnessTexture,this.normalTexture=o.normalTexture,this.occlusionTexture=o.occlusionTexture,this.emissionTexture=o.emissionTexture;const c=new Float32Array(24);c.set(this.transformWorldFromModelTL,0),c.set(this.transformWorldFromModelTH,3),c.set(this.transformWorldFromModelRS,6),c.set(this.transformNormalGlobalFromModel,15),this.transformationFloats=c}destroy(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}setTransformationDrawId(e){this.transformationDrawId=e}get texture(){return this.baseColorTexture?.texture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.texture}get textureEmissive(){return this.emissionTexture?.texture}get textureOcclusion(){return this.occlusionTexture?.texture}get textureNormal(){return this.normalTexture?.texture}get componentParameters(){return this._componentParameters}updateComponentParameters(e,t){this._componentParameters=e,this.textureBackedBuffer=t}get castAnyShadows(){return 2!==this.componentParameters.castShadows}}class l{constructor(e,t,r,s,i){this.castShadows=i,this.componentDataType=0,this.externalColor=o(e),this.externalColorMixMode=t,this.emissiveStrength=r,this.emissiveSource=s}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}}class m{constructor(e,t,r,s,o){this.transparent=e,this.opaqueOverride=t,this.emissiveOverride=r,this.emissiveSourceOverride=s,this.castShadows=o,this.componentDataType=1}}const u=new l(s(),1,0,0,0),h=5e4;export{n as ComponentDrawParametersImplementation,l as ComponentParametersUniform,m as ComponentParametersVarying,u as defaultComponentParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isColorHighlightOrOLID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(e){super(),this.sphericalSR=e,this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.oitPass=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.sphereDepthInterpolate=!1,this.hasModelRotationScale=!0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}e([o({count:10})],s.prototype,"output",void 0),e([o({count:3})],s.prototype,"textureCoordinateType",void 0),e([o({count:2})],s.prototype,"componentDataType",void 0),e([o({count:3})],s.prototype,"cullFace",void 0),e([o({count:3})],s.prototype,"vertexDiscardMode",void 0),e([o({count:3})],s.prototype,"doubleSidedMode",void 0),e([o({count:4})],s.prototype,"alphaDiscardMode",void 0),e([o({count:4})],s.prototype,"integratedMeshMode",void 0),e([o({count:3})],s.prototype,"oitPass",void 0),e([o({count:7})],s.prototype,"pbrMode",void 0),e([o({count:3})],s.prototype,"normalType",void 0),e([o({count:8})],s.prototype,"emissionSource",void 0),e([o({count:3})],s.prototype,"shadeNormals",void 0),e([o()],s.prototype,"hasEmission",void 0),e([o()],s.prototype,"hasVertexColors",void 0),e([o()],s.prototype,"hasSlicePlane",void 0),e([o()],s.prototype,"isGroundSlice",void 0),e([o()],s.prototype,"hasColorTexture",void 0),e([o()],s.prototype,"hasHighlightMixTexture",void 0),e([o()],s.prototype,"receiveAmbientOcclusion",void 0),e([o()],s.prototype,"receiveShadows",void 0),e([o()],s.prototype,"blendingEnabled",void 0),e([o()],s.prototype,"screenSpaceReflections",void 0),e([o()],s.prototype,"hasPolygonOffset",void 0),e([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([o()],s.prototype,"hasOcclusionTexture",void 0),e([o()],s.prototype,"hasNormalTexture",void 0),e([o()],s.prototype,"hasOccludees",void 0),e([o()],s.prototype,"terrainDepthTest",void 0),e([o()],s.prototype,"cullAboveTerrain",void 0),e([o()],s.prototype,"hasNormalTextureTransform",void 0),e([o()],s.prototype,"cloudReflections",void 0),e([o()],s.prototype,"snowCover",void 0),e([o()],s.prototype,"renderOccluded",void 0),e([o()],s.prototype,"sphereDepthInterpolate",void 0),e([o()],s.prototype,"hasModelRotationScale",void 0);export{s as ComponentTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{isColorHighlightOrOLID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(e){super(),this.sphericalSR=e,this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.oitPass=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.sphereDepthInterpolate=!1,this.hasModelRotationScale=!0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}e([o({count:10})],s.prototype,"output",void 0),e([o({count:3})],s.prototype,"textureCoordinateType",void 0),e([o({count:2})],s.prototype,"componentDataType",void 0),e([o({count:3})],s.prototype,"cullFace",void 0),e([o({count:3})],s.prototype,"vertexDiscardMode",void 0),e([o({count:3})],s.prototype,"doubleSidedMode",void 0),e([o({count:4})],s.prototype,"alphaDiscardMode",void 0),e([o({count:4})],s.prototype,"integratedMeshMode",void 0),e([o({count:3})],s.prototype,"oitPass",void 0),e([o({count:7})],s.prototype,"pbrMode",void 0),e([o({count:3})],s.prototype,"normalType",void 0),e([o({count:8})],s.prototype,"emissionSource",void 0),e([o({count:3})],s.prototype,"shadeNormals",void 0),e([o()],s.prototype,"hasEmission",void 0),e([o()],s.prototype,"hasVertexColors",void 0),e([o()],s.prototype,"hasSlicePlane",void 0),e([o()],s.prototype,"isGroundSlice",void 0),e([o()],s.prototype,"hasColorTexture",void 0),e([o()],s.prototype,"hasHighlightMixTexture",void 0),e([o()],s.prototype,"receiveAmbientOcclusion",void 0),e([o()],s.prototype,"receiveShadows",void 0),e([o()],s.prototype,"blendingEnabled",void 0),e([o()],s.prototype,"screenSpaceReflections",void 0),e([o()],s.prototype,"hasPolygonOffset",void 0),e([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([o()],s.prototype,"hasOcclusionTexture",void 0),e([o()],s.prototype,"hasNormalTexture",void 0),e([o()],s.prototype,"hasOccludees",void 0),e([o()],s.prototype,"terrainDepthTest",void 0),e([o()],s.prototype,"cullAboveTerrain",void 0),e([o()],s.prototype,"hasNormalTextureTransform",void 0),e([o()],s.prototype,"cloudReflections",void 0),e([o()],s.prototype,"snowCover",void 0),e([o()],s.prototype,"renderOccluded",void 0),e([o()],s.prototype,"sphereDepthInterpolate",void 0),e([o()],s.prototype,"hasModelRotationScale",void 0);export{s as ComponentTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderPass as s}from"./RenderPass.js";import{VertexNormalPassParameters as e,VertexNormalDrawParameters as i}from"../shaderLibrary/attributes/VertexNormal.glsl.js";class r{constructor(t){const e=t.renderContext.rctx,i=t.techniques;this.opaque=new s(e,i),this.transparent=new s(e,i,1),this.integratedMesh=new s(e,i),this.transparentIntegratedMesh=new s(e,i),this.occludedGround=new s(e,i),this.shadowMap=new s(e,i),this.highlight=new s(e,i),this.highlightIntegratedMesh=new s(e,i),this.highlightShadowMap=new s(e,i),this.viewshedShadowMap=new s(e,i),this.defaultShadowMap=new s(e,i)}}class n extends e{constructor(){super(...arguments),this.slicePlaneLocalOrigin=t(),this.origin=this.slicePlaneLocalOrigin}}class h extends i{}class o extends n{constructor(){super(...arguments),this.identifier=0,this.output=0,this.transparent=!1,this.occludedGround=!1}}class a extends n{constructor(){super(...arguments),this.identifier=1,this.output=3}}class c extends n{constructor(){super(...arguments),this.identifier=2,this.output=8}}class d extends n{constructor(){super(...arguments),this.identifier=3,this.output=6}}export{r as AllRenderPasses,h as DrawParameters,c as HighlightPassParameters,o as MaterialPassParameters,n as PassParameters,a as ShadowMapPassParameters,d as ViewshedShadowMapPassParameters};
2
+ import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderPass as s}from"./RenderPass.js";import{VertexNormalPassParameters as e,VertexNormalDrawParameters as i}from"../shaderLibrary/attributes/VertexNormal.glsl.js";class r{constructor(t,e){const{rctx:i}=t.renderContext,{techniques:r}=t;this.opaque=new s(e,i,r),this.transparent=new s(e,i,r,1),this.integratedMesh=new s(e,i,r),this.transparentIntegratedMesh=new s(e,i,r),this.occludedGround=new s(e,i,r),this.shadowMap=new s(e,i,r),this.highlight=new s(e,i,r),this.highlightIntegratedMesh=new s(e,i,r),this.highlightShadowMap=new s(e,i,r),this.viewshedShadowMap=new s(e,i,r),this.defaultShadowMap=new s(e,i,r)}}class n extends e{constructor(){super(...arguments),this.slicePlaneLocalOrigin=t(),this.origin=this.slicePlaneLocalOrigin}setTransformationTexture(t){this.transformationTexture=t}}class h extends i{}class o extends n{constructor(){super(...arguments),this.identifier=0,this.output=0,this.transparent=!1,this.occludedGround=!1}}class a extends n{constructor(){super(...arguments),this.identifier=1,this.output=3}}class c extends n{constructor(){super(...arguments),this.identifier=2,this.output=8}}class u extends n{constructor(){super(...arguments),this.identifier=3,this.output=6}}export{r as AllRenderPasses,h as DrawParameters,c as HighlightPassParameters,o as MaterialPassParameters,n as PassParameters,a as ShadowMapPassParameters,u as ViewshedShadowMapPassParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{getOrCreateMapValue as e}from"../../../../../core/MapUtils.js";import{DataType as t}from"../../../../webgl/enums.js";class s{constructor(e,t,s=0){this._rctx=e,this._techniques=t,this._sorting=s,this._draws=new Array,this._previouslyBoundDraw=new Map}submitDraw(e,t,s,r,n,a){const o=(s.indexed?s.vao.indexBuffer.indexType:null)??0,h=new i(e,t,s,r,n,o,a);this._draws.push(h)}acquire(t,s){const i=new Map;return this._draws.map(r=>e(i,r.material,()=>r.material.acquireTechnique(this._techniques,t,s,r.geometry.parameters)))}dispatch(e,t,s){const i=this._rctx;this._previouslyBoundDraw.clear();let n=null;const a=this._draws.length,o=t.highlight?.name;for(let h=0;h<a;h++){const a=this._draws[h];if(2===e.identifier){const e=a.highlightName;if(e){if(e!==o)continue}else if(!o||!t.overlay?.hasHighlight(o))continue}const d=s[h];d===n&&0===t.oitPass||(i.bindTechnique(d,t,e),n=d);const{geometryRanges:u,indexType:c,geometry:l,drawParameters:m}=a;i.bindVAO(l.vao),this._previouslyBoundDraw.get(d)!==m&&(d.program.bindDraw(t,e,m),this._previouslyBoundDraw.set(d,m));const g=u.length,{primitiveType:p}=l;for(let e=0;e<g;e+=2){const t=u[e],s=u[e+1];if(0!==c){const e=r.get(c);i.drawElements(p,s,c,t*e)}else i.drawArrays(p,t,s)}}}prepareSubmit(){this._draws.length=0}finishSubmit(){const e=0===this._sorting?1:-1;this._draws.sort((t,s)=>e*(t.depthSquaredHint-s.depthSquaredHint)||t.geometry.vao.usedMemory-s.geometry.vao.usedMemory)}get count(){return this._draws.length}}class i{constructor(e,t,s,i,r,n,a){this.material=e,this.drawParameters=t,this.geometry=s,this.geometryRanges=i,this.depthSquaredHint=r,this.indexType=n,this.highlightName=a}}const r=new Map;r.set(t.UNSIGNED_BYTE,1),r.set(t.UNSIGNED_SHORT,2),r.set(t.UNSIGNED_INT,4);export{s as RenderPass};
2
+ import{getOrCreateMapValue as e}from"../../../../../core/MapUtils.js";import{DataType as t}from"../../../../webgl/enums.js";class r{constructor(e,t,r,s=0){this._owner=e,this._rctx=t,this._techniques=r,this._sorting=s,this._draws=new Array,this._previouslyBoundDraw=new Map}destroy(){this._draws.length=0,this._previouslyBoundDraw.clear()}submitDraw(e,t,r,i,a,n){const o=(r.indexed?r.vao.indexBuffer.indexType:null)??0;this._owner.registerDrawParameters(t);const h=new s(e,t,r,i,a,o,n);this._draws.push(h)}acquire(t,r){const s=new Map;return this._draws.map(i=>e(s,i.material,()=>i.material.acquireTechnique(this._techniques,t,r,i.geometry.parameters)))}dispatch(e,t,r){const s=this._rctx;this._previouslyBoundDraw.clear();let a=null;e.setTransformationTexture(this._owner.drawTransformationTexture);const n=this._draws.length,o=t.highlight?.name;if(0!==n)for(let h=0;h<n;h++){const n=this._draws[h];if(2===e.identifier){const e=n.highlightName;if(e){if(e!==o)continue}else if(!o||!t.overlay?.hasHighlight(o))continue}const d=r[h];d===a&&0===t.oitPass||(s.bindTechnique(d,t,e),a=d);const{geometryRanges:u,indexType:c,geometry:m,drawParameters:l}=n;s.bindVAO(m.vao),this._previouslyBoundDraw.get(d)!==l&&(l.setTransformationDrawId(this._owner.getDrawParametersId(l)),d.program.bindDraw(t,e,l),this._previouslyBoundDraw.set(d,l));const w=u.length,{primitiveType:g}=m;for(let e=0;e<w;e+=2){const t=u[e],r=u[e+1];if(0!==c){const e=i.get(c);s.drawElements(g,r,c,t*e)}else s.drawArrays(g,t,r)}}}prepareSubmit(){this._draws.length=0}finishSubmit(){const e=0===this._sorting?1:-1;this._draws.sort((t,r)=>e*(t.depthSquaredHint-r.depthSquaredHint)||t.geometry.vao.usedMemory-r.geometry.vao.usedMemory)}get count(){return this._draws.length}}class s{constructor(e,t,r,s,i,a,n){this.material=e,this.drawParameters=t,this.geometry=r,this.geometryRanges=s,this.depthSquaredHint=i,this.indexType=a,this.highlightName=n}}const i=new Map;i.set(t.UNSIGNED_BYTE,1),i.set(t.UNSIGNED_SHORT,2),i.set(t.UNSIGNED_INT,4);export{r as RenderPass};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as s}from"tslib";import{subclass as e}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as t,transpose as r,invert as a}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as h,copy as o}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MaterialPassParameters as c,ShadowMapPassParameters as m,HighlightPassParameters as u,ViewshedShadowMapPassParameters as l,AllRenderPasses as p}from"./AllRenderPasses.js";import{TwoVectorPosition as _}from"../util/TwoVectorPosition.js";import{SyncRenderPlugin as d}from"../../effects/RenderPlugin.js";import{DepthRange as P}from"../../lib/DepthRange.js";let f=class extends d{constructor(){super(...arguments),this.produces=new Map([[2,s=>this._produces(s,2)],[4,s=>this._produces(s,4)],[0,s=>this._produces(s,0)],[8,s=>this._produces(s,8)],[10,s=>this._produces(s,10)]]),this._materialPassParameters=new c,this._shadowPassParameters=new m,this._highlightPassParameters=new u,this._viewshedPassParameters=new l,this._systems=new Set}initializeRenderContext(s){this._context=s,this._passes=new p(s)}get rctx(){return this._context.renderContext.rctx}uninitializeRenderContext(){}dispose(){this._context=null,this._systems.clear(),this._passes=null}register(s){this._systems.add(s)}_produces(s,e){return!!this._invoke(s,e,s=>s.count>0)}prepareRender(s){const{_systems:e,_passes:t}=this;if(0!==e.size&&null!=t){for(const s of Object.values(t))s.prepareSubmit();e.forEach(e=>e.submit(t,s.bind));for(const s of Object.values(t))s.finishSubmit();this._context.techniques.frameUpdate()}}acquireTechniques(s){if(0===this._systems.size)return null;const e=3===s.output||4===s.output||5===s.output?this._shadowPassParameters:6===s.output?this._viewshedPassParameters:8===s.output?this._highlightPassParameters:this._materialPassParameters,{bind:t}=s;return this._updateParameters(t.camera,e,t.slot),this._materialPassParameters.output=s.output,this._invoke(s.output,s.bind.slot,(e,t)=>e.acquire(t,s.bind))}render(s,e){this._invoke(s.output,s.bind.slot,(t,r)=>t.dispatch(r,s.bind,e))}_invoke(s,e,t){if(null==this._passes)return null;switch(e){case 2:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.opaque,this._materialPassParameters);case 8:return t(this._passes.highlight,this._highlightPassParameters);case 3:return t(this._passes.shadowMap,this._shadowPassParameters);case 4:return t(this._passes.highlightShadowMap,this._shadowPassParameters);case 5:return t(this._passes.defaultShadowMap,this._shadowPassParameters);case 6:return t(this._passes.viewshedShadowMap,this._viewshedPassParameters)}break;case 4:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.transparent,this._materialPassParameters)}break;case 0:switch(s){case 0:case 1:case 2:case 9:case 7:return t(this._passes.integratedMesh,this._materialPassParameters);case 8:return t(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}break;case 8:if(0===s)return t(this._passes.transparentIntegratedMesh,this._materialPassParameters);break;case 10:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.occludedGround,this._materialPassParameters)}}return null}notifyDirty(){this._context.requestRender()}queryDepthRange(s){const e=new P;return this._systems.forEach(t=>e.union(t.queryDepthRange(s))),e}get hasEmitters(){let s=!1;return this._systems.forEach(e=>s=e.hasEmissions||s),s}_updateParameters(s,e,i){const n=s.viewInverseTransposeMatrix,c=4===i,m=10===i;h(w,n[3],n[7],n[11]),b.set(w),o(e.transformWorldFromViewTH,b.high),o(e.transformWorldFromViewTL,b.low),o(e.slicePlaneLocalOrigin,w),t(e.transformViewFromCameraRelativeRS,s.viewMatrix),0===e.identifier&&(this._materialPassParameters.transparent=c,this._materialPassParameters.occludedGround=m,r(g,e.transformViewFromCameraRelativeRS),a(e.transformNormalViewFromGlobal,g))}hasHighlight(s){for(const e of this._systems)if(e.hasHighlight(s))return!0;return!1}};f=s([e("esri.views.3d.webgl-engine.core.renderPasses.RenderPassManager")],f);const w=n(),g=i(),b=new _;export{f as RenderPassManager};
2
+ import{__decorate as s}from"tslib";import{disposeMaybe as e}from"../../../../../core/maybe.js";import{subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as r,transpose as a,invert as i}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as h,copy as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MaterialPassParameters as d,ShadowMapPassParameters as c,HighlightPassParameters as u,ViewshedShadowMapPassParameters as p,AllRenderPasses as l}from"./AllRenderPasses.js";import{TwoVectorPosition as _}from"../util/TwoVectorPosition.js";import{SyncRenderPlugin as w}from"../../effects/RenderPlugin.js";import{DepthRange as f}from"../../lib/DepthRange.js";import{SizedPixelFormat as P,DataType as g}from"../../../../webgl/enums.js";import x from"../../../../webgl/Texture.js";import{TextureDescriptor as T}from"../../../../webgl/TextureDescriptor.js";let y=class extends w{constructor(){super(...arguments),this.produces=new Map([[2,s=>this._produces(s,2)],[4,s=>this._produces(s,4)],[0,s=>this._produces(s,0)],[8,s=>this._produces(s,8)],[10,s=>this._produces(s,10)]]),this._drawParametersIdMap=new Map,this._drawParametersArray=new Array,this._drawTransformationTexture=null,this._materialPassParameters=new d,this._shadowPassParameters=new c,this._highlightPassParameters=new u,this._viewshedPassParameters=new p,this._systems=new Set}initializeRenderContext(s){this._context=s,this._passes=new l(s,this)}get rctx(){return this._context.renderContext.rctx}uninitializeRenderContext(){}dispose(){this._context=null,this._systems.clear(),this._drawTransformationTexture=e(this._drawTransformationTexture),this._passes?.opaque.destroy(),this._passes?.transparent.destroy(),this._passes?.integratedMesh.destroy(),this._passes?.transparentIntegratedMesh.destroy(),this._passes?.occludedGround.destroy(),this._passes?.shadowMap.destroy(),this._passes?.highlight.destroy(),this._passes?.highlightIntegratedMesh.destroy(),this._passes?.highlightShadowMap.destroy(),this._passes?.viewshedShadowMap.destroy(),this._passes?.defaultShadowMap.destroy(),this._passes=null}register(s){this._systems.add(s)}_produces(s,e){return!!this._invoke(s,e,s=>s.count>0)}prepareRender(s){const{_systems:t,_passes:r}=this;if(0!==t.size&&null!=r){this._drawParametersIdMap.clear(),this._drawParametersArray.length=0,this._drawTransformationTexture=e(this._drawTransformationTexture);for(const s of Object.values(r))s.prepareSubmit();t.forEach(e=>e.submit(r,s.bind)),this._createTransformationTexture();for(const s of Object.values(r))s.finishSubmit();this._context.techniques.frameUpdate()}}acquireTechniques(s){if(0===this._systems.size)return null;const e=3===s.output||4===s.output||5===s.output?this._shadowPassParameters:6===s.output?this._viewshedPassParameters:8===s.output?this._highlightPassParameters:this._materialPassParameters,{bind:t}=s;return this._updateParameters(t.camera,e,t.slot),this._materialPassParameters.output=s.output,this._invoke(s.output,s.bind.slot,(e,t)=>e.acquire(t,s.bind))}render(s,e){this._invoke(s.output,s.bind.slot,(t,r)=>t.dispatch(r,s.bind,e))}_invoke(s,e,t){if(null==this._passes)return null;switch(e){case 2:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.opaque,this._materialPassParameters);case 8:return t(this._passes.highlight,this._highlightPassParameters);case 3:return t(this._passes.shadowMap,this._shadowPassParameters);case 4:return t(this._passes.highlightShadowMap,this._shadowPassParameters);case 5:return t(this._passes.defaultShadowMap,this._shadowPassParameters);case 6:return t(this._passes.viewshedShadowMap,this._viewshedPassParameters)}break;case 4:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.transparent,this._materialPassParameters)}break;case 0:switch(s){case 0:case 1:case 2:case 9:case 7:return t(this._passes.integratedMesh,this._materialPassParameters);case 8:return t(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}break;case 8:if(0===s)return t(this._passes.transparentIntegratedMesh,this._materialPassParameters);break;case 10:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.occludedGround,this._materialPassParameters)}}return null}notifyDirty(){this._context.requestRender()}queryDepthRange(s){const e=new f;return this._systems.forEach(t=>e.union(t.queryDepthRange(s))),e}get hasEmitters(){let s=!1;return this._systems.forEach(e=>s=e.hasEmissions||s),s}_updateParameters(s,e,t){const o=s.viewInverseTransposeMatrix,m=4===t,d=10===t;h(M,o[3],o[7],o[11]),v.set(M),n(e.transformWorldFromViewTH,v.high),n(e.transformWorldFromViewTL,v.low),n(e.slicePlaneLocalOrigin,M),r(e.transformViewFromCameraRelativeRS,s.viewMatrix),0===e.identifier&&(this._materialPassParameters.transparent=m,this._materialPassParameters.occludedGround=d,a(b,e.transformViewFromCameraRelativeRS),i(e.transformNormalViewFromGlobal,b))}hasHighlight(s){for(const e of this._systems)if(e.hasHighlight(s))return!0;return!1}registerDrawParameters(s){this._drawParametersIdMap.has(s)||(this._drawParametersIdMap.set(s,this._drawParametersArray.length),this._drawParametersArray.push(s))}getDrawParametersId(s){const e=this._drawParametersIdMap.get(s);if(null==e)throw new Error("Draw parameters not registered");return e}_createTransformationTexture(){const s=this._drawParametersIdMap.size;if(0===s)return;const e=8,t=3*e,r=2**Math.ceil(Math.log2(s)),a=new Float32Array(r*t),{rctx:i}=this._context.renderContext;for(let o=0;o<s;o++){const s=this._drawParametersArray[o];s.setTransformationDrawId(o);const e=o*t;a.set(s.transformationFloats,e)}if(this._drawTransformationTexture&&this._drawTransformationTexture.descriptor.height>=s)this._drawTransformationTexture.updateData(0,0,0,e,s,a);else{this._drawTransformationTexture?.dispose();const s=new T(e,r);s.internalFormat=P.RGB32F,s.dataType=g.FLOAT,s.hasMipmap=!1,s.isImmutable=!0,s.pixelFormat=6407,s.samplingMode=9728,this._drawTransformationTexture=new x(i,s,a)}}get drawTransformationTexture(){return this._drawTransformationTexture}};y=s([t("esri.views.3d.webgl-engine.core.renderPasses.RenderPassManager")],y);const M=m(),b=o(),v=new _;export{y as RenderPassManager};
@@ -1,7 +1,17 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{create as o}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{NormalAttribute as a}from"./NormalAttribute.glsl.js";import{VertexPositionPassParameters as l,VertexPositionDrawParameters as e}from"./VertexPosition.glsl.js";import{glsl as m,If as s}from"../../shaderModules/glsl.js";import{Matrix3DrawUniform as t}from"../../shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as i}from"../../shaderModules/Matrix3PassUniform.js";function d(o,r){const{vertex:l,varyings:e}=o;switch(r.normalType){case 0:case 1:{o.include(a,r),e.add("vNormalWorld","vec3"),e.add("vNormalView","vec3"),l.uniforms.add(new i("transformNormalViewFromGlobal",o=>o.transformNormalViewFromGlobal));const{hasModelRotationScale:d}=r;d&&l.uniforms.add(new t("transformNormalGlobalFromModel",o=>o.transformNormalGlobalFromModel)),l.code.add(m`
2
+ import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{NormalAttribute as a}from"./NormalAttribute.glsl.js";import{VertexPositionPassParameters as e,VertexPositionDrawParameters as t}from"./VertexPosition.glsl.js";import{glsl as m,If as s}from"../../shaderModules/glsl.js";import{IntegerDrawUniform as l}from"../../shaderModules/IntegerDrawUniform.js";import{Matrix3DrawUniform as n}from"../../shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as i}from"../../shaderModules/Matrix3PassUniform.js";import{Texture2DPassUniform as d}from"../../shaderModules/Texture2DPassUniform.js";function f(r,o){const{vertex:e,varyings:t}=r;switch(o.normalType){case 0:case 1:{r.include(a,o),t.add("vNormalWorld","vec3"),t.add("vNormalView","vec3"),e.uniforms.add(new i("transformNormalViewFromGlobal",r=>r.transformNormalViewFromGlobal));const{hasModelRotationScale:f,useTransformationTexture:c}=o;c?e.uniforms.add(new l("transformationDrawId",r=>r.transformationDrawId),new d("transformationTexture",r=>r.transformationTexture)):f&&e.uniforms.add(new n("transformNormalGlobalFromModel",r=>r.transformNormalGlobalFromModel)),e.code.add(m`
3
+ ${s(f,m`
4
+ mat3 normalModelTransformation() {
5
+ ${s(c,m`
6
+ return mat3(
7
+ texelFetch(transformationTexture, ivec2(5, transformationDrawId), 0).xyz,
8
+ texelFetch(transformationTexture, ivec2(6, transformationDrawId), 0).xyz,
9
+ texelFetch(transformationTexture, ivec2(7, transformationDrawId), 0).xyz
10
+ );`,m`return transformNormalGlobalFromModel;`)}
11
+ }`)}
12
+
3
13
  void forwardNormal() {
4
- vNormalWorld = ${s(d,m`transformNormalGlobalFromModel * `)} normalModel();
14
+ vNormalWorld = ${s(f,m`normalModelTransformation() * `)}normalModel();
5
15
  vNormalView = transformNormalViewFromGlobal * vNormalWorld;
6
16
  }
7
- `);break}case 2:o.vertex.code.add(m`void forwardNormal() {}`);break;default:r.normalType;case 3:}}class n extends l{constructor(){super(...arguments),this.transformNormalViewFromGlobal=o()}}class c extends e{constructor(){super(...arguments),this.transformNormalGlobalFromModel=o(),this.toMapSpace=r()}}export{d as VertexNormal,c as VertexNormalDrawParameters,n as VertexNormalPassParameters};
17
+ `);break}case 2:r.vertex.code.add(m`void forwardNormal() {}`);break;default:o.normalType;case 3:}}class c extends e{constructor(){super(...arguments),this.transformNormalViewFromGlobal=r()}}class u extends t{constructor(){super(...arguments),this.transformNormalGlobalFromModel=r(),this.toMapSpace=o()}}export{f as VertexNormal,u as VertexNormalDrawParameters,c as VertexNormalPassParameters};
@@ -1,29 +1,47 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{DoublePrecision as e}from"../util/DoublePrecision.glsl.js";import{Float3DrawUniform as a}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as t}from"../../shaderModules/Float3PassUniform.js";import{If as i,glsl as m}from"../../shaderModules/glsl.js";import{Matrix3DrawUniform as s}from"../../shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as d}from"../../shaderModules/Matrix3PassUniform.js";import{Matrix4BindUniform as l}from"../../shaderModules/Matrix4BindUniform.js";import{NoParameters as n}from"../../../../../webgl/NoParameters.js";function f(r,o){const{attributes:n,vertex:f,varyings:v,fragment:W}=r;f.include(e),n.add("position","vec3"),v.add("vPositionWorldCameraRelative","vec3"),v.add("vPosition_view","vec3",{invariant:!0}),f.uniforms.add(new t("transformWorldFromViewTH",r=>r.transformWorldFromViewTH),new t("transformWorldFromViewTL",r=>r.transformWorldFromViewTL),new d("transformViewFromCameraRelativeRS",r=>r.transformViewFromCameraRelativeRS),new l("transformProjFromView",r=>r.camera.projectionMatrix),new a("transformWorldFromModelTH",r=>r.transformWorldFromModelTH),new a("transformWorldFromModelTL",r=>r.transformWorldFromModelTL));const{hasModelRotationScale:c}=o;c&&f.uniforms.add(new s("transformWorldFromModelRS",r=>r.transformWorldFromModelRS)),f.code.add(m`
2
+ import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{DoublePrecision as e}from"../util/DoublePrecision.glsl.js";import{Float3DrawUniform as t}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{If as i,glsl as s}from"../../shaderModules/glsl.js";import{IntegerDrawUniform as m}from"../../shaderModules/IntegerDrawUniform.js";import{Matrix3DrawUniform as n}from"../../shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as d}from"../../shaderModules/Matrix3PassUniform.js";import{Matrix4BindUniform as l}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DPassUniform as f}from"../../shaderModules/Texture2DPassUniform.js";import{NoParameters as v}from"../../../../../webgl/NoParameters.js";function c(r,o){const{attributes:v,vertex:c,varyings:w,fragment:u}=r;c.include(e),v.add("position","vec3"),w.add("vPositionWorldCameraRelative","vec3"),w.add("vPosition_view","vec3",{invariant:!0}),c.uniforms.add(new a("transformWorldFromViewTH",r=>r.transformWorldFromViewTH),new a("transformWorldFromViewTL",r=>r.transformWorldFromViewTL),new d("transformViewFromCameraRelativeRS",r=>r.transformViewFromCameraRelativeRS),new l("transformProjFromView",r=>r.camera.projectionMatrix));const{hasModelRotationScale:F,useTransformationTexture:W}=o;W?c.uniforms.add(new m("transformationDrawId",r=>r.transformationDrawId),new f("transformationTexture",r=>r.transformationTexture)):(c.uniforms.add(new t("transformWorldFromModelTH",r=>r.transformWorldFromModelTH),new t("transformWorldFromModelTL",r=>r.transformWorldFromModelTL)),F&&c.uniforms.add(new n("transformWorldFromModelRS",r=>r.transformWorldFromModelRS))),c.code.add(s`
3
+ mat3 modelTransformation() {
4
+ ${i(W,s`
5
+ return mat3(
6
+ texelFetch(transformationTexture, ivec2(2, transformationDrawId), 0).xyz,
7
+ texelFetch(transformationTexture, ivec2(3, transformationDrawId), 0).xyz,
8
+ texelFetch(transformationTexture, ivec2(4, transformationDrawId), 0).xyz
9
+ );`,s`return transformWorldFromModelRS;`)}
10
+ }
11
+
12
+ vec3 originL() {
13
+ return ${i(W,s`texelFetch(transformationTexture, ivec2(0, transformationDrawId), 0).xyz;`,s`transformWorldFromModelTL;`)}
14
+ }
15
+
16
+ vec3 originH() {
17
+ return ${i(W,s`texelFetch(transformationTexture, ivec2(1, transformationDrawId), 0).xyz;`,s`transformWorldFromModelTH;`)};
18
+ }
19
+
3
20
  vec3 positionWorldCameraRelative() {
4
- vec3 rotatedModelPosition = ${i(c,m`transformWorldFromModelRS * `)} position;
21
+
22
+ vec3 rotatedModelPosition = ${i(F,s`modelTransformation() *`)} position;
5
23
 
6
24
  vec3 transform_CameraRelativeFromModel = dpAdd(
7
- transformWorldFromModelTL,
8
- transformWorldFromModelTH,
25
+ originL(),
26
+ originH(),
9
27
  -transformWorldFromViewTL,
10
28
  -transformWorldFromViewTH
11
29
  );
12
30
 
13
31
  return transform_CameraRelativeFromModel + rotatedModelPosition;
14
32
  }
15
- `),f.code.add(m`
33
+ `),c.code.add(s`
16
34
  void forwardPosition(float fOffset) {
17
35
  vPositionWorldCameraRelative = positionWorldCameraRelative();
18
36
  if (fOffset != 0.0) {
19
- vPositionWorldCameraRelative += fOffset * ${o.spherical?m`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:m`vec3(0.0, 0.0, 1.0)`};
37
+ vPositionWorldCameraRelative += fOffset * ${o.spherical?s`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:s`vec3(0.0, 0.0, 1.0)`};
20
38
  }
21
39
 
22
40
  vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
23
41
  gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
24
42
  }
25
- `),W.uniforms.add(new t("transformWorldFromViewTL",r=>r.transformWorldFromViewTL)),f.code.add(m`vec3 positionWorld() {
43
+ `),u.uniforms.add(new a("transformWorldFromViewTL",r=>r.transformWorldFromViewTL)),c.code.add(s`vec3 positionWorld() {
26
44
  return transformWorldFromViewTL + vPositionWorldCameraRelative;
27
- }`),W.code.add(m`vec3 positionWorld() {
45
+ }`),u.code.add(s`vec3 positionWorld() {
28
46
  return transformWorldFromViewTL + vPositionWorldCameraRelative;
29
- }`)}class v extends n{constructor(){super(...arguments),this.transformWorldFromViewTH=o(),this.transformWorldFromViewTL=o(),this.transformViewFromCameraRelativeRS=r()}}class W extends n{constructor(){super(...arguments),this.transformWorldFromModelRS=r(),this.transformWorldFromModelTH=o(),this.transformWorldFromModelTL=o()}}export{f as VertexPosition,W as VertexPositionDrawParameters,v as VertexPositionPassParameters};
47
+ }`)}class w extends v{constructor(){super(...arguments),this.transformWorldFromViewTH=o(),this.transformWorldFromViewTL=o(),this.transformViewFromCameraRelativeRS=r(),this.transformationTexture=null}}class u extends v{constructor(){super(...arguments),this.transformWorldFromModelRS=r(),this.transformWorldFromModelTH=o(),this.transformWorldFromModelTL=o(),this.transformationDrawId=0}}export{c as VertexPosition,u as VertexPositionDrawParameters,w as VertexPositionPassParameters};
@@ -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{DepthRange as o}from"../lib/DepthRange.js";class i{constructor(e){this.context=e,this._renderPlugins=new Array,this._slots=new Array,this._version=n(0);for(let t=0;t<23;++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 o)}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)}))}consumes(e){return this._renderPlugins.some(t=>t.consumes().required.includes(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 hasEmitters(){return this._renderPlugins.some(e=>e.hasEmitters)}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,20,14,15,16];export{i 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{DepthRange as o}from"../lib/DepthRange.js";class i{constructor(e){this.context=e,this._renderPlugins=new Array,this._slots=new Array,this._version=n(0);for(let t=0;t<22;++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 o)}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)}))}consumes(e){return this._renderPlugins.some(t=>t.consumes().required.includes(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 hasEmitters(){return this._renderPlugins.some(e=>e.hasEmitters)}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,20,14,15,16];export{i as RenderPluginManager};
@@ -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 H}from"../../../../webgl/VertexBuffer.js";let j=class extends a{constructor(){super(...arguments),this.produces=l.HIGHLIGHT_COLOR,this.consumes={required:[l.HIGHLIGHT_COLOR,"highlights"]},this._downsampleDrawParameters=new m,this._passParameters=new f,this._highlightBlurDrawParameters=new c,this._grid=new P}initialize(){this.addHandles([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(q(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}=this;if(!r.decorations)return t;if(!i.getCompiled(d))return this.requestRender(1),t;const s=e.find(({name:e})=>"highlights"===e).getTexture();return this._renderHighlightPostprocess(s,t),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)}_renderHighlightPostprocess(e,t){const{fboCache:i,techniques:r,bindParameters:s,_passParameters:o,renderingContext:h}=this,l=r.getCompiled(b),a=r.getCompiled(u),c=r.getCompiled(g);if(!c||!a||!l)return void this.requestRender(1);o.highlightTexture=e;const m=this._prepareAndDownSample(e),{width:p,height:d}=e.descriptor;o.highlightTexture=e;const{camera:f}=s,{fullWidth:w,fullHeight:x,pixelRatio:T,fullViewport:C}=f,_=Math.ceil(w/T),v=Math.ceil(x/T),{_highlightBlurDrawParameters:O}=this,H=this.view.stage.renderView.renderer,{highlights:j}=s;for(let g=0;g<j.length;++g){const{name:e}=j[g];if(!H.hasHighlight(e))continue;o.highlightLevel=g,h.setClearColor(0,0,0,0);const r=i.acquire(p,d,"single highlight",2);h.bindFramebuffer(r.fbo),h.setViewport(0,0,p,d),h.clear(16384),h.bindTechnique(l,s,o),this._renderGrid(m),O.blurInput=r.getTexture(),n(O.blurSize,1/_,0);const u=i.acquire(_,v,"single highlight blur",2);h.unbindTexture(u.fbo?.colorTexture),h.bindFramebuffer(u.fbo),h.setViewport(0,0,_,v),h.clear(16384),h.bindTechnique(a,s,o,O),this._renderGrid(m),r.release(),n(O.blurSize,0,1/v),o.highlightBlurTexture=u.getTexture(),h.bindFramebuffer(t.fbo),h.setViewport4fv(C),h.bindTechnique(c,s,o,O),this._renderGrid(m),u.release()}o.coverageTexture=o.highlightTexture=null}_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,R);t.vao=new x(s,new H(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()],j.prototype,"produces",void 0),e([o()],j.prototype,"consumes",void 0),j=e([h("esri.views.3d.webgl-engine.effects.highlight.Highlight")],j);class P{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}function q(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 R=new Uint8Array([0,1,2,2,1,3]);function I(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{j as Highlight,G as maxHighlightsPerChannel,I 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.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};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as i}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as t}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as o}from"../../../../../chunks/HighlightApply.glsl.js";import{NoVertex as s}from"../../lib/DefaultVertexBufferLayouts.js";import{makePipelineState as l,defaultColorWrite as h,unpremultipliedAlphaToPremultipliedAlpha as p}from"../../../../webgl/renderState.js";let n=class extends t{constructor(e,r){super(e,r,s),this.shader=new i(o,()=>import("./HighlightApply.glsl.js")),this.ignoreUnused=!0}initializePipeline(){return l({blending:p,colorWrite:h})}};n=e([r("esri.views.3d.webgl-engine.effects.highlight.HighlightApplyTechnique")],n);export{n as HighlightApplyTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as i}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as t}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as o}from"../../../../../chunks/HighlightApply.glsl.js";import{NoVertex as s}from"../../lib/DefaultVertexBufferLayouts.js";import{makePipelineState as l,defaultColorWrite as h,unpremultipliedAlphaToPremultipliedAlpha as p}from"../../../../webgl/renderState.js";let c=class extends t{constructor(e,r){super(e,r,s),this.shader=new i(o,()=>import("./HighlightApply.glsl.js"))}initializePipeline(){return l({blending:p,colorWrite:h})}};c=e([r("esri.views.3d.webgl-engine.effects.highlight.HighlightApplyTechnique")],c);export{c as HighlightApplyTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as i}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as t}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as o}from"../../../../../chunks/HighlightBlur.glsl.js";import{NoVertex as s}from"../../lib/DefaultVertexBufferLayouts.js";import{makePipelineState as l,defaultColorWrite as h}from"../../../../webgl/renderState.js";let a=class extends t{constructor(e,r){super(e,r,s),this.shader=new i(o,()=>import("./HighlightBlur.glsl.js")),this.ignoreUnused=!0}initializePipeline(){return l({colorWrite:h})}};a=e([r("esri.views.3d.webgl-engine.effects.highlight.HighlightBlurTechnique")],a);export{a as HighlightBlurTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as i}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as t}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as o}from"../../../../../chunks/HighlightBlur.glsl.js";import{NoVertex as s}from"../../lib/DefaultVertexBufferLayouts.js";import{makePipelineState as l,defaultColorWrite as h}from"../../../../webgl/renderState.js";let a=class extends t{constructor(e,r){super(e,r,s),this.shader=new i(o,()=>import("./HighlightBlur.glsl.js"))}initializePipeline(){return l({colorWrite:h})}};a=e([r("esri.views.3d.webgl-engine.effects.highlight.HighlightBlurTechnique")],a);export{a as HighlightBlurTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as i}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as o}from"../../../../../chunks/HighlightDownsample.glsl.js";import{makePipelineState as t,defaultColorWrite as h}from"../../../../webgl/renderState.js";let l=class extends s{constructor(){super(...arguments),this.shader=new i(o,()=>import("./HighlightDownsample.glsl.js")),this.ignoreUnused=!0}initializePipeline(){return t({colorWrite:h})}};l=e([r("esri.views.3d.webgl-engine.effects.highlight.HighlightDownsampleTechnique")],l);export{l as HighlightDownsampleTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as i}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as s}from"../../../../../chunks/HighlightDownsample.glsl.js";import{makePipelineState as t,defaultColorWrite as l}from"../../../../webgl/renderState.js";let h=class extends o{constructor(){super(...arguments),this.shader=new i(s,()=>import("./HighlightDownsample.glsl.js"))}initializePipeline(){return t({colorWrite:l})}};h=e([r("esri.views.3d.webgl-engine.effects.highlight.HighlightDownsampleTechnique")],h);export{h as HighlightDownsampleTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as i}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as t}from"../../../../../chunks/HighlightToSingle.glsl.js";import{NoVertex as s}from"../../lib/DefaultVertexBufferLayouts.js";import{makePipelineState as l,defaultColorWrite as h}from"../../../../webgl/renderState.js";let n=class extends o{constructor(e,r){super(e,r,s),this.shader=new i(t,()=>import("./HighlightToSingle.glsl.js")),this.ignoreUnused=!0}initializePipeline(){return l({colorWrite:h})}};n=e([r("esri.views.3d.webgl-engine.effects.highlight.HighlightToSingleTechnique")],n);export{n as HighlightToSingleTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as i}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as t}from"../../../../../chunks/HighlightToSingle.glsl.js";import{NoVertex as s}from"../../lib/DefaultVertexBufferLayouts.js";import{makePipelineState as l,defaultColorWrite as h}from"../../../../webgl/renderState.js";let n=class extends o{constructor(e,r){super(e,r,s),this.shader=new i(t,()=>import("./HighlightToSingle.glsl.js"))}initializePipeline(){return l({colorWrite:h})}};n=e([r("esri.views.3d.webgl-engine.effects.highlight.HighlightToSingleTechnique")],n);export{n as HighlightToSingleTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as s}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{S as i}from"../../../../../chunks/SSAOBlur.glsl.js";import{makePipelineState as t,defaultColorWrite as l}from"../../../../webgl/renderState.js";let c=class extends o{constructor(){super(...arguments),this.shader=new s(i,()=>import("./SSAOBlur.glsl.js")),this.ignoreUnused=!0}initializePipeline(){return t({colorWrite:l})}};c=e([r("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],c);export{c as SSAOBlurTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as s}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{S as i}from"../../../../../chunks/SSAOBlur.glsl.js";import{makePipelineState as t,defaultColorWrite as l}from"../../../../webgl/renderState.js";let c=class extends o{constructor(){super(...arguments),this.shader=new s(i,()=>import("./SSAOBlur.glsl.js"))}initializePipeline(){return t({colorWrite:l})}};c=e([r("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],c);export{c as SSAOBlurTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{O as e}from"../../../../../chunks/OITBlend.glsl.js";import{OITBlendTechnique as i}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as t}from"./OITBlendTechniqueConfiguration.js";import{OITDimTechnique as s}from"./OITDimTechnique.js";import{ColorAttachment2 as r,ColorAttachment1 as n,DrawBufferNone as o}from"../../../../webgl/enums.js";class c{constructor(i){this._techniques=i,this._parameters=new e,this._configuration=new t}precompile(e,t,r){this._configuration.hasEmission=e,this._configuration.computeHudOcclusion=this._configuration.frontFaceMask=!1,this._techniques.precompile(i,this._configuration),t&&(this._configuration.computeHudOcclusion=!0,this._techniques.precompile(i,this._configuration)),r&&(this._configuration.frontFaceMask=!0,this._techniques.precompile(i,this._configuration),t&&(this._configuration.computeHudOcclusion=!1,this._techniques.precompile(i,this._configuration))),this._techniques.precompile(s)}blend(e,t,c,u,a,h,m){if(this._configuration.hasEmission=a,this._configuration.computeHudOcclusion=h,this._configuration.frontFaceMask=1===m,this._parameters.colorTexture=t.getTexture(),this._parameters.alphaTexture=t.getTexture(a?r:n),this._parameters.frontFaceTexture=c.getTexture(),a){if(1!==m){const i=this._techniques.get(s);e.bindTechnique(i,u,this._parameters);const t=e.setDrawBuffers([o,n]);e.screen.draw(),e.setDrawBuffers(t)}this._parameters.emissionTexture=t.getTexture(n),this._parameters.emissionFrontFaceTexture=c.getTexture(n)}const f=this._techniques.get(i,this._configuration);e.bindTechnique(f,u,this._parameters),e.screen.draw()}}export{c as OITBlend};
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 r,ColorAttachment1 as n,DrawBufferNone as o}from"../../../../webgl/enums.js";class a{constructor(t){this._techniques=t,this._parameters=new e,this._configuration=new i}precompile(e,i,r){this._configuration.hasEmission=e,this._configuration.computeHudOcclusion=i,this._configuration.frontFaceMask=1===r,this._techniques.precompile(t,this._configuration),e&&1!==r&&this._techniques.precompile(s)}blend(e,i,a,c,u,h,m){if(this._configuration.hasEmission=u,this._configuration.computeHudOcclusion=h,this._configuration.frontFaceMask=1===m,this._parameters.colorTexture=i.getTexture(),this._parameters.alphaTexture=i.getTexture(u?r:n),this._parameters.frontFaceTexture=a.getTexture(),u){if(1!==m){const t=this._techniques.get(s);e.bindTechnique(t,c,this._parameters);const i=e.setDrawBuffers([o,n]);e.screen.draw(),e.setDrawBuffers(i)}this._parameters.emissionTexture=i.getTexture(n),this._parameters.emissionFrontFaceTexture=a.getTexture(n)}const f=this._techniques.get(t,this._configuration);e.bindTechnique(f,c,this._parameters),e.screen.draw()}}export{a as OITBlend};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as s}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../../chunks/OITBlend.glsl.js";import{makePipelineState as t,defaultColorWrite as n,unpremultipliedAlphaToPremultipliedAlpha as l}from"../../../../webgl/renderState.js";let c=class extends o{constructor(){super(...arguments),this.shader=new s(i,()=>import("./OITBlend.glsl.js")),this.ignoreUnused=!0}initializePipeline(){return t({blending:l,colorWrite:n})}};c=e([r("esri.views.3d.webgl-engine.effects.transparency.OITBlendTechnique")],c);export{c as OITBlendTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as s}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../../chunks/OITBlend.glsl.js";import{makePipelineState as t,defaultColorWrite as n,unpremultipliedAlphaToPremultipliedAlpha as l}from"../../../../webgl/renderState.js";let c=class extends o{constructor(){super(...arguments),this.shader=new s(i,()=>import("./OITBlend.glsl.js"))}initializePipeline(){return t({blending:l,colorWrite:n})}};c=e([r("esri.views.3d.webgl-engine.effects.transparency.OITBlendTechnique")],c);export{c as OITBlendTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as i}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as o}from"../../../../../chunks/OITDim.glsl.js";import{makePipelineState as t,defaultColorWrite as n,modulateDestination as c}from"../../../../webgl/renderState.js";let a=class extends s{constructor(){super(...arguments),this.shader=new i(o,()=>import("./OITDim.glsl.js")),this.ignoreUnused=!0}initializePipeline(){return t({blending:c,colorWrite:n})}};a=e([r("esri.views.3d.webgl-engine.effects.transparency.OITDimTechnique")],a);export{a as OITDimTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as i}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as o}from"../../../../../chunks/OITDim.glsl.js";import{makePipelineState as t,defaultColorWrite as n,modulateDestination as c}from"../../../../webgl/renderState.js";let a=class extends s{constructor(){super(...arguments),this.shader=new i(o,()=>import("./OITDim.glsl.js"))}initializePipeline(){return t({blending:c,colorWrite:n})}};a=e([r("esri.views.3d.webgl-engine.effects.transparency.OITDimTechnique")],a);export{a as OITDimTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as s,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{set as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as r,scale as o,floor as n,subtract as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{InternalRenderCategory as p}from"../../webgl.js";import l from"../../webgl/RenderNode.js";import{G as u}from"../../../../chunks/GaussianSplat.glsl.js";import{G as d}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as c}from"../shaders/GaussianSplatCompositionTechnique.js";import{G as _}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as g}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatTechnique as P}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as f}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{DepthStencilAttachment as C,ColorAttachment1 as b,PrimitiveType as v}from"../../../webgl/enums.js";var S;let x=class extends l{static{S=this}constructor(e){super(e),this._slicePlaneEnabled=!1,this.produces=p.GAUSSIAN_SPLAT,this.layerView=null,this._passParameters=new u,this._compositionPassParameters=new d,this._depthCompositionPassParameters=new _,this._previousCameraPosition=m(),this._previousCameraDirection=m(),this._configuration=new f(e.view.state.isGlobal)}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.techniques.precompile(P,this._configuration),this.techniques.precompile(c),this.techniques.precompile(g)}render(e){const t=e.find(({name:e})=>e===p.GAUSSIAN_SPLAT);if(this._handleFading(),!this._data.visibleGaussians||!this._data.orderTexture.texture||!this._data.textureAtlas.texture)return t;const s=this.techniques.getCompiled(P,this._configuration),a=this.techniques.getCompiled(c),i=this.techniques.getCompiled(g);if(!s||!i||!a)return this.requestRender(1),t;const{fullWidth:r,fullHeight:o}=this.bindParameters.camera;this._prepareParameters(o,r);const n=this.renderingContext,h=this.fboCache,m=h.acquire(r,o,"gaussian color output"),l=t.getAttachment(C);m.attachDepth(l),this._renderGaussianColorAndDepth(m,s);const u=h.acquire(r,o,this.produces);return this._depthCompositionPassParameters.splatDepth=m.getTexture(b),u.attachDepth(t.getAttachment(C)),n.bindFramebuffer(u.fbo),n.bindTechnique(i,this.bindParameters,this._depthCompositionPassParameters),n.screen.draw(),this._compositionPassParameters.color=t.getTexture(),this._compositionPassParameters.splatColor=m.getTexture(),n.bindFramebuffer(u.fbo),n.bindTechnique(a,this.bindParameters,this._compositionPassParameters),n.screen.draw(),m.release(),u}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}get _data(){return this.layerView.data}get _fadeHelper(){return this.layerView.fadeHelper}destroy(){super.destroy()}_onCameraChange(){const e=this.view.state.camera.eye,t=this.view.state.camera.ray.direction,s=.001;(Math.abs(e[0]-this._previousCameraPosition[0])>s||Math.abs(e[1]-this._previousCameraPosition[1])>s||Math.abs(e[2]-this._previousCameraPosition[2])>s||Math.abs(t[0]-this._previousCameraDirection[0])>s||Math.abs(t[1]-this._previousCameraDirection[1])>s||Math.abs(t[2]-this._previousCameraDirection[2])>s)&&(r(this._previousCameraPosition,e),r(this._previousCameraDirection,t),this._data.requestSort())}_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 s=Math.tan(.5*this.camera.fovY),a=s/e*t;i(this._passParameters.tanFov,a,s),this._passParameters.focalLength=e/(2*s);const r=this.view.qualitySettings.gaussianSplat.minimumSplatPixelRadius;this._passParameters.minSplatRadius=r*Math.sqrt(t*e)/Math.sqrt(2073600),this._prepareHighPrecisionCameraPosition()}_renderGaussianColorAndDepth(e,t){const s=this.renderingContext;e.acquireColor(b,5,"gaussian depth output"),s.bindFramebuffer(e.fbo),s.setClearColor(0,0,0,0),s.clear(16384),this.renderingContext.bindTechnique(t,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(v.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}_prepareHighPrecisionCameraPosition(){o(this._passParameters.tileCameraPosition,this.camera.eye,1/S.tileSize),n(this._passParameters.tileCameraPosition,this._passParameters.tileCameraPosition),o(this._passParameters.cameraDelta,this._passParameters.tileCameraPosition,S.tileSize),h(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([s()],x.prototype,"produces",void 0),e([s({constructOnly:!0})],x.prototype,"layerView",void 0),x=S=e([a("esri.views.3d.webgl-engine.lib.GaussianSplatRenderNode")],x);export{x as GaussianSplatRenderNode};
2
+ import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as s,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{set as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as r,scale as o,floor as n,subtract as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{InternalRenderCategory as p}from"../../webgl.js";import l from"../../webgl/RenderNode.js";import{G as u}from"../../../../chunks/GaussianSplat.glsl.js";import{G as d}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as c}from"../shaders/GaussianSplatCompositionTechnique.js";import{G as _}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as P}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatTechnique as g}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as f}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{DepthStencilAttachment as C,ColorAttachment1 as b,PrimitiveType as v}from"../../../webgl/enums.js";var x;let S=class extends l{static{x=this}constructor(e){super(e),this.produces=p.PRE_TRANSPARENT,this.consumes={required:[p.PRE_TRANSPARENT]},this._slicePlaneEnabled=!1,this.layerView=null,this._passParameters=new u,this._compositionPassParameters=new d,this._depthCompositionPassParameters=new _,this._previousCameraPosition=m(),this._previousCameraDirection=m(),this._configuration=new f(e.view.state.isGlobal)}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.techniques.precompile(g,this._configuration),this.techniques.precompile(c),this.techniques.precompile(P)}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 s=this.techniques.getCompiled(g,this._configuration),a=this.techniques.getCompiled(c),i=this.techniques.getCompiled(P);if(!s||!i||!a)return this.requestRender(1),t;const{fullWidth:r,fullHeight:o}=this.bindParameters.camera;this._prepareParameters(o,r);const n=this.renderingContext,h=this.fboCache,m=h.acquire(r,o,"gaussian color output"),p=t.getAttachment(C);m.attachDepth(p),this._renderGaussianColorAndDepth(m,s);const l=h.acquire(r,o,this.produces);return this._depthCompositionPassParameters.splatDepth=m.getTexture(b),l.attachDepth(t.getAttachment(C)),n.bindFramebuffer(l.fbo),n.bindTechnique(i,this.bindParameters,this._depthCompositionPassParameters),n.screen.draw(),this._compositionPassParameters.color=t.getTexture(),this._compositionPassParameters.splatColor=m.getTexture(),n.bindFramebuffer(l.fbo),n.bindTechnique(a,this.bindParameters,this._compositionPassParameters),n.screen.draw(),m.release(),l}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}get _data(){return this.layerView.data}get _fadeHelper(){return this.layerView.fadeHelper}destroy(){super.destroy()}_onCameraChange(){const e=this.view.state.camera.eye,t=this.view.state.camera.ray.direction,s=.001;(Math.abs(e[0]-this._previousCameraPosition[0])>s||Math.abs(e[1]-this._previousCameraPosition[1])>s||Math.abs(e[2]-this._previousCameraPosition[2])>s||Math.abs(t[0]-this._previousCameraDirection[0])>s||Math.abs(t[1]-this._previousCameraDirection[1])>s||Math.abs(t[2]-this._previousCameraDirection[2])>s)&&(r(this._previousCameraPosition,e),r(this._previousCameraDirection,t),this._data.requestSort())}_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 s=Math.tan(.5*this.camera.fovY),a=s/e*t;i(this._passParameters.tanFov,a,s),this._passParameters.focalLength=e/(2*s);const r=this.view.qualitySettings.gaussianSplat.minimumSplatPixelRadius;this._passParameters.minSplatRadius=r*Math.sqrt(t*e)/Math.sqrt(2073600),this._prepareHighPrecisionCameraPosition()}_renderGaussianColorAndDepth(e,t){const s=this.renderingContext;e.acquireColor(b,5,"gaussian depth output"),s.bindFramebuffer(e.fbo),s.setClearColor(0,0,0,0),s.clear(16384),this.renderingContext.bindTechnique(t,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(v.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}_prepareHighPrecisionCameraPosition(){o(this._passParameters.tileCameraPosition,this.camera.eye,1/x.tileSize),n(this._passParameters.tileCameraPosition,this._passParameters.tileCameraPosition),o(this._passParameters.cameraDelta,this._passParameters.tileCameraPosition,x.tileSize),h(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([s()],S.prototype,"produces",void 0),e([s()],S.prototype,"consumes",void 0),e([s({constructOnly:!0})],S.prototype,"layerView",void 0),S=x=e([a("esri.views.3d.webgl-engine.lib.GaussianSplatRenderNode")],S);export{S as GaussianSplatRenderNode};