@arcgis/core 5.1.0-next.104 → 5.1.0-next.106

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 (461) hide show
  1. package/analysis/AreaMeasurementAnalysis.d.ts +5 -5
  2. package/analysis/DimensionAnalysis.d.ts +3 -3
  3. package/analysis/DimensionSimpleStyle.d.ts +2 -2
  4. package/analysis/DirectLineMeasurementAnalysis.d.ts +4 -4
  5. package/analysis/DistanceMeasurementAnalysis.d.ts +4 -4
  6. package/analysis/ElevationProfileAnalysis.d.ts +3 -3
  7. package/analysis/LengthDimension.d.ts +2 -2
  8. package/analysis/LineOfSightAnalysis.d.ts +4 -4
  9. package/analysis/ShadowCast/DiscreteOptions.d.ts +7 -3
  10. package/analysis/ShadowCast/MinDurationOptions.d.ts +5 -1
  11. package/analysis/ShadowCast/TotalDurationOptions.d.ts +7 -3
  12. package/analysis/ShadowCast/types.d.ts +1 -1
  13. package/analysis/ShadowCastAnalysis.d.ts +90 -66
  14. package/analysis/SliceAnalysis.d.ts +4 -4
  15. package/analysis/SlicePlane.d.ts +3 -3
  16. package/analysis/Viewshed.d.ts +2 -2
  17. package/analysis/ViewshedAnalysis.d.ts +3 -3
  18. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +1 -1
  19. package/analysis/VolumeMeasurementAnalysis.d.ts +3 -3
  20. package/applications/Components/imageryUtils.d.ts +24 -0
  21. package/applications/Components/layerUtils.d.ts +21 -0
  22. package/applications/Components/layerUtils.js +2 -0
  23. package/applications/Components/templateUtils.d.ts +11 -1
  24. package/applications/Components/templateUtils.js +1 -1
  25. package/arcgisGlobal.d.ts +1 -0
  26. package/assets/components/assets/icon/buttons16.json +1 -0
  27. package/assets/components/assets/icon/buttons24.json +1 -0
  28. package/assets/components/assets/icon/buttons32.json +1 -0
  29. package/assets/components/assets/icon/entityTypes16.json +1 -0
  30. package/assets/components/assets/icon/entityTypes24.json +1 -0
  31. package/assets/components/assets/icon/entityTypes32.json +1 -0
  32. package/assets/esri/core/t9n/Units.json +1 -1
  33. package/assets/esri/core/t9n/Units_ar.json +1 -1
  34. package/assets/esri/core/t9n/Units_bg.json +1 -1
  35. package/assets/esri/core/t9n/Units_bs.json +1 -1
  36. package/assets/esri/core/t9n/Units_ca.json +1 -1
  37. package/assets/esri/core/t9n/Units_cs.json +1 -1
  38. package/assets/esri/core/t9n/Units_da.json +1 -1
  39. package/assets/esri/core/t9n/Units_de.json +1 -1
  40. package/assets/esri/core/t9n/Units_el.json +1 -1
  41. package/assets/esri/core/t9n/Units_en.json +1 -1
  42. package/assets/esri/core/t9n/Units_es.json +1 -1
  43. package/assets/esri/core/t9n/Units_et.json +1 -1
  44. package/assets/esri/core/t9n/Units_fi.json +1 -1
  45. package/assets/esri/core/t9n/Units_fr.json +1 -1
  46. package/assets/esri/core/t9n/Units_he.json +1 -1
  47. package/assets/esri/core/t9n/Units_hr.json +1 -1
  48. package/assets/esri/core/t9n/Units_hu.json +1 -1
  49. package/assets/esri/core/t9n/Units_id.json +1 -1
  50. package/assets/esri/core/t9n/Units_it.json +1 -1
  51. package/assets/esri/core/t9n/Units_ja.json +1 -1
  52. package/assets/esri/core/t9n/Units_ko.json +1 -1
  53. package/assets/esri/core/t9n/Units_lt.json +1 -1
  54. package/assets/esri/core/t9n/Units_lv.json +1 -1
  55. package/assets/esri/core/t9n/Units_nl.json +1 -1
  56. package/assets/esri/core/t9n/Units_no.json +1 -1
  57. package/assets/esri/core/t9n/Units_pl.json +1 -1
  58. package/assets/esri/core/t9n/Units_pt-BR.json +1 -1
  59. package/assets/esri/core/t9n/Units_pt-PT.json +1 -1
  60. package/assets/esri/core/t9n/Units_ro.json +1 -1
  61. package/assets/esri/core/t9n/Units_ru.json +1 -1
  62. package/assets/esri/core/t9n/Units_sk.json +1 -1
  63. package/assets/esri/core/t9n/Units_sl.json +1 -1
  64. package/assets/esri/core/t9n/Units_sr.json +1 -1
  65. package/assets/esri/core/t9n/Units_sv.json +1 -1
  66. package/assets/esri/core/t9n/Units_th.json +1 -1
  67. package/assets/esri/core/t9n/Units_tr.json +1 -1
  68. package/assets/esri/core/t9n/Units_uk.json +1 -1
  69. package/assets/esri/core/t9n/Units_vi.json +1 -1
  70. package/assets/esri/core/t9n/Units_zh-CN.json +1 -1
  71. package/assets/esri/core/t9n/Units_zh-HK.json +1 -1
  72. package/assets/esri/core/t9n/Units_zh-TW.json +1 -1
  73. package/assets/esri/core/workers/RemoteClient.js +1 -1
  74. package/assets/esri/core/workers/chunks/01c70c27aa3a955e2928.js +262 -0
  75. package/assets/esri/core/workers/chunks/{7d571845292b1b7769c2.js → 065dd2fdc834146423c7.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{f5bd0a4f82df5e942b70.js → 093f27e4e4781870b431.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{2a5f6a8d282f2c391591.js → 15920af0c4f46773b06e.js} +1 -1
  78. package/assets/esri/core/workers/chunks/179c9fe4ac83b42e5976.js +1 -0
  79. package/assets/esri/core/workers/chunks/1d1929f98d941179be29.js +2 -0
  80. package/assets/esri/core/workers/chunks/{24247ee93f43fff5e596.js.LICENSE.txt → 1d1929f98d941179be29.js.LICENSE.txt} +1 -3
  81. package/assets/esri/core/workers/chunks/1ebb613bbe09fcf274d8.js +1 -0
  82. package/assets/esri/core/workers/chunks/24b43fb12fc3009fdc30.js +1 -0
  83. package/assets/esri/core/workers/chunks/2b9661700743d1f9717e.js +1 -0
  84. package/assets/esri/core/workers/chunks/2f0a3b22fc46d832e240.js +1 -0
  85. package/assets/esri/core/workers/chunks/340f2c996f62f7f5ceae.js +1 -0
  86. package/assets/esri/core/workers/chunks/466c250537415f12eb59.js +1 -0
  87. package/assets/esri/core/workers/chunks/549d348ca181d06aefb7.js +2 -0
  88. package/assets/esri/core/workers/chunks/{0cb8bc6dbbbe3b212712.js → 558606a1af22e4a0d536.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{7485d59d60d61737d662.js → 55b765c72d13b3b911f9.js} +1 -1
  90. package/assets/esri/core/workers/chunks/5cdf87e7a59ace38df87.js +1 -0
  91. package/assets/esri/core/workers/chunks/622bdd1b9d5d292ec12b.js +1 -0
  92. package/assets/esri/core/workers/chunks/{bff0c4094c14cb97b18f.js → 63ea4191d441efd2f146.js} +1 -1
  93. package/assets/esri/core/workers/chunks/69c9eb93553b006b640d.js +2 -0
  94. package/assets/esri/core/workers/chunks/6d20d741b8ae1a45b422.js +1 -0
  95. package/assets/esri/core/workers/chunks/{b63cbf6c2c9ec1b02b9a.js → 6e21675bbd7a44070771.js} +1 -1
  96. package/assets/esri/core/workers/chunks/702a3ef9e1b3442cbee7.js +1 -0
  97. package/assets/esri/core/workers/chunks/762e23466308f22d7076.js +1 -0
  98. package/assets/esri/core/workers/chunks/{52219561c144e5cb4442.js → 770611659b38066a6228.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{c476f4979048e558baa7.js → 7ce60331f94ee0a5d674.js} +57 -75
  100. package/assets/esri/core/workers/chunks/7e02e5c6979090fe3ea7.js +1 -0
  101. package/assets/esri/core/workers/chunks/825db2ea15308ee6e5dc.js +1 -0
  102. package/assets/esri/core/workers/chunks/{bf2c202dec5ab7bc770b.js → 829a0583b8a228c65379.js} +1 -1
  103. package/assets/esri/core/workers/chunks/8330302096d4312a4393.js +1 -0
  104. package/assets/esri/core/workers/chunks/885eac78a76184efa1e5.js +1 -0
  105. package/assets/esri/core/workers/chunks/{79dc7045d9a2d43ba8df.js → 890b7a1153b7f65eba9a.js} +1 -1
  106. package/assets/esri/core/workers/chunks/8a1751187a20b6578875.js +1 -0
  107. package/assets/esri/core/workers/chunks/{d610f517fb3c6cb24365.js → 8ade869fa9bae446266a.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{44636ef119c6a576470b.js → 94eab215bab3e4e0e5b5.js} +1 -1
  109. package/assets/esri/core/workers/chunks/95dee5853c6e89f15ea9.js +1 -0
  110. package/assets/esri/core/workers/chunks/a5b9ae4c93f9af7589f2.js +1 -0
  111. package/assets/esri/core/workers/chunks/{95798e3de3419fdda6ac.js → a8ae00e06f98e04aee8e.js} +1 -1
  112. package/assets/esri/core/workers/chunks/aaad0d3e82ed917d3886.js +1 -0
  113. package/assets/esri/core/workers/chunks/b3e8ab68fc38306f13c6.js +1 -0
  114. package/assets/esri/core/workers/chunks/b7a81fd4994eabba1869.js +640 -0
  115. package/assets/esri/core/workers/chunks/{9542ef3f6c2bc7c14d85.js → b9850fe7dcdaed0c327c.js} +1 -1
  116. package/assets/esri/core/workers/chunks/{f7e386ece75afb6e4be5.js → bc249bb667f0564ad093.js} +1 -1
  117. package/assets/esri/core/workers/chunks/bd59cb5abc67e46f1b2c.js +2 -0
  118. package/assets/esri/core/workers/chunks/{f3a9100518b044e79501.js → be817be7c81fb630122f.js} +1 -1
  119. package/assets/esri/core/workers/chunks/{3c9482764c9e4f8bcbb0.js → c187bc997bad61b6c6e9.js} +1 -1
  120. package/assets/esri/core/workers/chunks/c4872cf3b71d00f450e1.js +1 -0
  121. package/assets/esri/core/workers/chunks/c5ab346a226df1894302.js +1 -0
  122. package/assets/esri/core/workers/chunks/{ce0c7070eeb723a718e7.js → d859c046a3ea42530bff.js} +1 -1
  123. package/assets/esri/core/workers/chunks/da29cf0e64065631a470.js +1 -0
  124. package/assets/esri/core/workers/chunks/{bb04aff0b4947408592c.js → dcba6c766eee8b90381a.js} +1 -1
  125. package/assets/esri/core/workers/chunks/ddebc1dc10a2d207389f.js +1 -0
  126. package/assets/esri/core/workers/chunks/e393fd61deb2e7f22ee6.js +1 -0
  127. package/assets/esri/core/workers/chunks/ea2bf7c543cc536400b7.js +30 -0
  128. package/assets/esri/core/workers/chunks/ece30bfd5c49b8d99752.js +1 -0
  129. package/assets/esri/core/workers/chunks/ecf4d07917efc97eb991.js +1 -0
  130. package/assets/esri/core/workers/chunks/ee56290e600cbeb25a00.js +1 -0
  131. package/assets/esri/core/workers/chunks/f52c6efc5a2abf5ac845.js +1 -0
  132. package/assets/esri/core/workers/chunks/{5cffc7b49966201eccdb.js → f75295cdd5e84eb97d5a.js} +1 -1
  133. package/assets/esri/core/workers/chunks/f7fe17a22390a24d6df8.js +2 -0
  134. package/assets/esri/core/workers/chunks/f9324420f2c6ac240f63.js +1 -0
  135. package/assets/esri/core/workers/chunks/{855bf811cd79b97c169a.js → fae2c8f053927559fff0.js} +1 -1
  136. package/assets/esri/core/workers/chunks/{64e268ebac0b62076f81.js → fbb23db01f3cf629d32e.js} +1 -1
  137. package/assets/esri/core/workers/chunks/fc1fe1f58a65a1694c09.js +1 -0
  138. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +84 -1
  139. package/assets/esri/themes/dark/main.css +1 -1
  140. package/assets/esri/themes/light/main.css +1 -1
  141. package/assets/esri/themes/light/view.css +1 -1
  142. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  143. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  144. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  145. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  146. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  147. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  148. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  149. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  150. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  151. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  152. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  153. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  154. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  155. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  156. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  157. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  158. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  159. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  160. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  161. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  162. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  163. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  164. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  165. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  166. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  167. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  168. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  169. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  170. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  171. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  172. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  173. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  174. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  175. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  176. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  177. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  178. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  179. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  180. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  181. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  182. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  183. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  184. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  185. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  186. package/chunks/ChapmanAtmosphere.glsl.js +14 -19
  187. package/chunks/ComponentShader.glsl.js +11 -15
  188. package/chunks/Compositing.glsl.js +4 -4
  189. package/chunks/GaussianSplatShadow.glsl.js +7 -7
  190. package/chunks/GlobalIllumination.glsl.js +27 -50
  191. package/chunks/GlobalIlluminationBlur.glsl.js +16 -11
  192. package/chunks/Terrain.glsl.js +1 -1
  193. package/config.js +1 -1
  194. package/core/ReactiveSet.js +1 -1
  195. package/core/generatorUtils.js +2 -0
  196. package/core/libs/gl-matrix-2/factories/vec2f64.js +1 -1
  197. package/core/libs/gl-matrix-2/math/vec2.js +1 -1
  198. package/core/mathUtils.js +1 -1
  199. package/core/typedArrayUtil.js +1 -1
  200. package/geometry/HeightModelInfo.js +1 -1
  201. package/geometry/geometryEngine.d.ts +2 -2
  202. package/geometry/support/buffer/BufferView.js +1 -1
  203. package/geometry/support/vcsData.js +1 -1
  204. package/geometry/support/vcsLookup.js +1 -1
  205. package/kernel.js +1 -1
  206. package/layers/DimensionLayer.d.ts +5 -5
  207. package/layers/FeatureLayer.d.ts +2 -2
  208. package/layers/GaussianSplatLayer.d.ts +3 -3
  209. package/layers/LineOfSightLayer.d.ts +5 -5
  210. package/layers/ParquetLayer.d.ts +6 -4
  211. package/layers/SubtypeGroupLayer.d.ts +2 -2
  212. package/layers/VideoLayer.js +1 -1
  213. package/layers/ViewshedLayer.d.ts +3 -3
  214. package/layers/graphics/sources/ParquetSource.js +1 -1
  215. package/layers/graphics/sources/parquet/FileProvider.js +2 -0
  216. package/layers/graphics/sources/parquet/PortalParquetFileProvider.js +2 -0
  217. package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +2 -0
  218. package/layers/graphics/sources/parquet/UrlsFileProvider.js +2 -0
  219. package/layers/graphics/sources/parquet/createFileProvider.js +2 -0
  220. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  221. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  222. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +2 -2
  223. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  224. package/layers/knowledgeGraph/layerUtils.js +1 -1
  225. package/layers/orientedImagery/core/utils.js +1 -1
  226. package/layers/raster/datasets/ImageAuxRaster.js +1 -1
  227. package/layers/raster/datasets/pixelReader.js +1 -1
  228. package/layers/raster/formats/JpgPlus.js +1 -1
  229. package/layers/raster/formats/RasterCodec.js +1 -1
  230. package/layers/raster/functions/clipUtils.js +1 -1
  231. package/layers/support/AggregateField.d.ts +2 -1
  232. package/layers/support/LayerContingentValuesCache.js +1 -1
  233. package/layers/support/SubtypeSublayer.d.ts +4 -4
  234. package/layers/support/parquetUtils.d.ts +18 -7
  235. package/layers/support/parquetUtils.js +1 -1
  236. package/layers/support/rasterFunctionUtils.d.ts +2 -2
  237. package/layers/video/VideoController.js +1 -1
  238. package/libs/parquet/parquet.js +1 -1
  239. package/linkChart/ChronologicalLayoutSettings.d.ts +1 -1
  240. package/networks/CircuitManager.d.ts +3 -3
  241. package/networks/UnitIdentifierManager.d.ts +1 -1
  242. package/networks/UnitIdentifierManager.js +1 -1
  243. package/networks/UtilityNetwork.d.ts +2 -2
  244. package/networks/UtilityNetwork.js +1 -1
  245. package/networks/support/Circuit.d.ts +1 -1
  246. package/networks/support/CircuitLocation.d.ts +1 -1
  247. package/networks/support/CircuitSection.d.ts +1 -1
  248. package/networks/support/Subcircuit.d.ts +1 -1
  249. package/networks/support/TraceJobInfo.js +1 -1
  250. package/networks/support/jsonTypes.d.ts +10 -3
  251. package/package.json +3 -3
  252. package/popup/FieldInfo.d.ts +4 -2
  253. package/popup/support/FieldInfoFormat.d.ts +3 -2
  254. package/rest/featureService/FeatureService.d.ts +1 -1
  255. package/rest/knowledgeGraph/FieldIndex.d.ts +1 -1
  256. package/rest/knowledgeGraph/GraphObjectType.d.ts +2 -2
  257. package/rest/knowledgeGraph/GraphSearch.d.ts +1 -1
  258. package/rest/knowledgeGraph/GraphSearchStreaming.d.ts +1 -1
  259. package/rest/networks/circuits/support/ExportCircuitsParameters.d.ts +19 -1
  260. package/rest/networks/circuits/support/ExportCircuitsResult.js +1 -1
  261. package/rest/networks/circuits/support/VerifyCircuitsParameters.d.ts +18 -10
  262. package/rest/networks/circuits/support/VerifyCircuitsParameters.js +1 -1
  263. package/rest/networks/support/TraceParameters.js +1 -1
  264. package/rest/networks/support/TraceResult.js +1 -1
  265. package/rest/networks/trace.js +1 -1
  266. package/rest/networks/unitIdentifiers/support/QueryUnitIdentifiersParameters.js +1 -1
  267. package/rest/support/AreasAndLengthsParameters.d.ts +1 -1
  268. package/rest/support/GeneralizeParameters.d.ts +1 -1
  269. package/rest/support/Query.d.ts +1 -1
  270. package/rest/support/RelationParameters.d.ts +1 -1
  271. package/rest/support/types.d.ts +1 -1
  272. package/support/revision.js +1 -1
  273. package/symbols/CIMSymbol.d.ts +1 -1
  274. package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +1 -0
  275. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  276. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  277. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  278. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  279. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  280. package/views/2d/layers/features/sources/strategies/chunks/ParquetSnapshotSourceChunk.js +1 -1
  281. package/views/2d/layers/features/sources/strategies/chunks/ParquetSourceChunk.js +1 -1
  282. package/views/3d/analysis/AreaMeasurementAnalysisView3D.d.ts +1 -0
  283. package/views/3d/analysis/DimensionAnalysisView3D.d.ts +7 -6
  284. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.d.ts +2 -0
  285. package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +2 -1
  286. package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +14 -6
  287. package/views/3d/analysis/SliceAnalysisView3D.d.ts +4 -3
  288. package/views/3d/analysis/Viewshed/ViewshedDrawToolRenderer.js +2 -0
  289. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  290. package/views/3d/analysis/Viewshed/ViewshedInteractionVisuals.js +2 -0
  291. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +2 -0
  292. package/views/3d/analysis/Viewshed/ViewshedPlacementOperation.js +2 -0
  293. package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +2 -0
  294. package/views/3d/analysis/Viewshed/ViewshedPlacementRootPlugin.js +2 -0
  295. package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +2 -0
  296. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  297. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  298. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  299. package/views/3d/analysis/Viewshed/ViewshedTool2.js +1 -1
  300. package/views/3d/analysis/Viewshed/analysisViewRegister.js +1 -1
  301. package/views/3d/analysis/Viewshed/placementUtils.js +2 -0
  302. package/views/3d/analysis/Viewshed/toolLifecycleUtils.js +2 -0
  303. package/views/3d/analysis/Viewshed/viewshedSubToolUtils.js +1 -1
  304. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  305. package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +4 -3
  306. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  307. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  308. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  309. package/views/3d/layers/FlowSubView3D.js +1 -1
  310. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  311. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  312. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  313. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  314. package/views/3d/layers/support/UVWorkspace.js +2 -0
  315. package/views/3d/layers/support/patternUtils.js +1 -1
  316. package/views/3d/layers/support/uvUtils.js +1 -1
  317. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  318. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  319. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  320. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  321. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  322. package/views/3d/support/meshProcessing.js +1 -1
  323. package/views/3d/terrain/TerrainRenderer.js +1 -1
  324. package/views/3d/terrain/TileCompositor.js +1 -1
  325. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  326. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  327. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +8 -8
  328. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +13 -9
  329. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +63 -49
  330. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  331. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.glsl.js +1 -1
  332. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
  333. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphereTechnique.js +1 -1
  334. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  335. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  336. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  337. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  338. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlur.glsl.js +1 -1
  339. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +1 -1
  340. package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
  341. package/views/3d/webgl-engine/lib/Compositor.js +1 -1
  342. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  343. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  344. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  345. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  346. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  347. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  348. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  349. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  350. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  351. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  352. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
  353. package/views/3d/webgl-engine/materials/PathLayouts.js +2 -0
  354. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  355. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  356. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  357. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  358. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  359. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  360. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  361. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  362. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  363. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  364. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  365. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  366. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  367. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  368. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  369. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  370. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +2 -3
  371. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  372. package/views/3d/webgl-engine/shaders/ditherNoise.glsl.js +1 -1
  373. package/views/PopupView.d.ts +77 -1
  374. package/views/PopupView.js +1 -1
  375. package/views/layers/DimensionLayerView.d.ts +2 -1
  376. package/views/layers/FeatureLikeLayerView.js +1 -1
  377. package/views/layers/LineOfSightLayerView.d.ts +2 -1
  378. package/views/layers/ViewshedLayerView.d.ts +2 -1
  379. package/webscene/Slide.js +1 -1
  380. package/widgets/Attachments/types.d.ts +1 -1
  381. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +38 -5
  382. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  383. package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +2 -0
  384. package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
  385. package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
  386. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  387. package/widgets/BatchAttributeForm/css.js +1 -1
  388. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +11 -0
  389. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  390. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +77 -0
  391. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  392. package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +1 -1
  393. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  394. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  395. package/widgets/BatchAttributeForm/interfaceUtils.js +2 -0
  396. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  397. package/widgets/BatchAttributeForm/types.d.ts +30 -2
  398. package/widgets/BatchAttributeForm.d.ts +52 -1
  399. package/widgets/BatchAttributeForm.js +1 -1
  400. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  401. package/widgets/Editor.d.ts +1 -1
  402. package/widgets/FeatureTable/FieldColumn.js +1 -1
  403. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  404. package/widgets/LayerList/LayerListItem.js +1 -1
  405. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  406. package/widgets/OrientedImageryViewer.js +1 -1
  407. package/widgets/TableList/TableListViewModel.js +1 -1
  408. package/widgets/TimeSlider.d.ts +3 -3
  409. package/widgets/Track/TrackViewModel.d.ts +1 -0
  410. package/widgets/Track/TrackViewModel.js +1 -1
  411. package/widgets/Track.js +1 -1
  412. package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +10 -0
  413. package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
  414. package/widgets/support/ContingentValuesManager.js +1 -1
  415. package/widgets/support/GeolocationPositioning.d.ts +1 -0
  416. package/widgets/support/GeolocationPositioning.js +1 -1
  417. package/widgets/support/forms/formUtils.js +1 -1
  418. package/assets/esri/core/workers/chunks/037b36d415ae27e987f9.js +0 -1
  419. package/assets/esri/core/workers/chunks/11b0d3a825fe50dd1e84.js +0 -1
  420. package/assets/esri/core/workers/chunks/1a3426276dc82a8a80f2.js +0 -1
  421. package/assets/esri/core/workers/chunks/1c83e61fd9a4f8fc8372.js +0 -1
  422. package/assets/esri/core/workers/chunks/1cb0c4fc315bbc2bd00b.js +0 -1
  423. package/assets/esri/core/workers/chunks/24247ee93f43fff5e596.js +0 -2
  424. package/assets/esri/core/workers/chunks/276cb6a1cdd26d0e1444.js +0 -1
  425. package/assets/esri/core/workers/chunks/29b00d07d3e1d095c590.js +0 -2
  426. package/assets/esri/core/workers/chunks/2f903bd3a2611e7f0946.js +0 -30
  427. package/assets/esri/core/workers/chunks/2fda38219d778f0447b5.js +0 -1
  428. package/assets/esri/core/workers/chunks/35fdd62277fd06468a29.js +0 -2
  429. package/assets/esri/core/workers/chunks/38d7430d2370b69334d7.js +0 -1
  430. package/assets/esri/core/workers/chunks/39d6032d79720935910d.js +0 -1
  431. package/assets/esri/core/workers/chunks/40caf5e09e4382d81104.js +0 -640
  432. package/assets/esri/core/workers/chunks/4213aa844900fcf95287.js +0 -1
  433. package/assets/esri/core/workers/chunks/594e1f633527749d92d7.js +0 -1
  434. package/assets/esri/core/workers/chunks/5dafd35801dca4229aed.js +0 -1
  435. package/assets/esri/core/workers/chunks/642be1619c0e76355cb6.js +0 -1
  436. package/assets/esri/core/workers/chunks/6d66dc77af8d112c33c6.js +0 -1
  437. package/assets/esri/core/workers/chunks/7b3642195d6d3ea9b830.js +0 -1
  438. package/assets/esri/core/workers/chunks/7e57029ec958f6423d5d.js +0 -2
  439. package/assets/esri/core/workers/chunks/8042e001545e2782499c.js +0 -1
  440. package/assets/esri/core/workers/chunks/881234f25c7814de8753.js +0 -1
  441. package/assets/esri/core/workers/chunks/8a7682071941c35f05c1.js +0 -1
  442. package/assets/esri/core/workers/chunks/8e986167d4a393ee41ea.js +0 -1
  443. package/assets/esri/core/workers/chunks/8fdd57e2a0af647f1e3e.js +0 -1
  444. package/assets/esri/core/workers/chunks/90ea570f6b6ce8ca693b.js +0 -1
  445. package/assets/esri/core/workers/chunks/9373daa677dc767d7cf0.js +0 -1
  446. package/assets/esri/core/workers/chunks/95df6d2ebacc43ac5fa3.js +0 -1
  447. package/assets/esri/core/workers/chunks/a02ebdcb802d128c8eee.js +0 -1
  448. package/assets/esri/core/workers/chunks/adf72d87f0114aeade0e.js +0 -1
  449. package/assets/esri/core/workers/chunks/b1a21a4d7d73ad7d0e47.js +0 -1
  450. package/assets/esri/core/workers/chunks/b75e090a7e935ff870a3.js +0 -1
  451. package/assets/esri/core/workers/chunks/bacf0c9d5d3e084dea61.js +0 -1
  452. package/assets/esri/core/workers/chunks/c0e4fd6fa1d765275248.js +0 -2
  453. package/assets/esri/core/workers/chunks/cc8d55d1830d7542c3f5.js +0 -262
  454. package/assets/esri/core/workers/chunks/cf3c0bee919bb509cd4f.js +0 -1
  455. package/assets/esri/core/workers/chunks/cfaa6e205bfc0c94a1b1.js +0 -1
  456. package/assets/esri/core/workers/chunks/dcb7a3ff59677b1cf0f1.js +0 -1
  457. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphereTechniqueConfiguration.js +0 -2
  458. /package/assets/esri/core/workers/chunks/{7e57029ec958f6423d5d.js.LICENSE.txt → 549d348ca181d06aefb7.js.LICENSE.txt} +0 -0
  459. /package/assets/esri/core/workers/chunks/{29b00d07d3e1d095c590.js.LICENSE.txt → 69c9eb93553b006b640d.js.LICENSE.txt} +0 -0
  460. /package/assets/esri/core/workers/chunks/{35fdd62277fd06468a29.js.LICENSE.txt → bd59cb5abc67e46f1b2c.js.LICENSE.txt} +0 -0
  461. /package/assets/esri/core/workers/chunks/{c0e4fd6fa1d765275248.js.LICENSE.txt → f7fe17a22390a24d6df8.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{abortMaybe as t}from"../../../../core/maybe.js";import{estimateNumberArrayMemory as s}from"../../../../core/memoryEstimations.js";import{isAbortError as i}from"../../../../core/promiseUtils.js";import{signal as r}from"../../../../core/signal.js";import{Milliseconds as a,now as o}from"../../../../core/time.js";import{exactEquals as n,copy as l,normalize as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as d,exactEquals as _,intersects as c,copy as p}from"../../../../geometry/support/aaBoundingBox.js";import{makeScheduleFunction as f}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as m}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatFadeTexture as g}from"./GaussianSplatFadeTexture.js";import{GaussianSplatOrderTexture as T}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as S}from"./GaussianSplatTextureAtlas.js";import{DepthRange as b}from"../../webgl-engine/lib/DepthRange.js";import{TaskPriority as y}from"../../../support/Scheduler.js";class C{constructor(e,t){this._updating=r(!1),this._useDeterministicSort=!1,this._sortBufferMemory=0,this.visibleGaussians=0,this._visibleTileDepthRange=new b,this._previousVisibleTileDepthRangeEye=u(),this._previousVisibleTileDepthRangeViewForward=u(),this._previousVisibleTileDepthRangeClippingBox=d(),this._latestSortedGaussianTilesVersion=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._previousVisibleTileDepthRangeHasClippingBox=!1,this._bufferCapacity=0,this._requestedLyr3dVisibilityChange=0,this._latestCompletedLyr3dVisibilityChange=0,this._latestUpdatedGaussianTiles=new Array,this._latestSortedGaussianTiles=new Array,this._nextCommittedVisibleGaussianTiles=new Array,this._cameraDirectionNormalized=u(),this._frameTask=null,this._workerHandle=null,this._sortAbortController=null,this._isSorting=!1,this._pendingSortTask=!1,this._scheduledSortStartTimeout=null,this._lastSortStartTime=a(-1/0),this._sortInterval=a(80),this._renderer=e,this._onSortComplete=t,this._orderTexture=new T(this._renderer.renderingContext),this._fadingTexture=new g(this._renderer.renderingContext),this._textureAtlas=new S(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache);const{resourceController:s}=this._renderer.view;this._workerHandle=new m(f(s)),this._frameTask=s.scheduler.registerTask(y.GAUSSIAN_SPLAT_SORTING)}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get fadingTexture(){return this._fadingTexture}get textureAtlasMemory(){return this._textureAtlas.usedMemory}get orderTextureMemory(){return this._orderTexture.usedMemory}get fadingTextureMemory(){return this._fadingTexture.usedMemory}get sortBufferMemory(){return this._sortBufferMemory}get usedMemory(){return this.textureAtlasMemory+this.orderTextureMemory+this.fadingTextureMemory+this.sortBufferMemory}queryVisibleTileDepthRange(e,t){if(0===this.visibleGaussians)return null;const{eye:s,viewForward:i}=e,r=s[0],a=s[1],o=s[2],h=i[0],u=i[1],d=i[2],f=this._visibleTileDepthRange;if(this._previousVisibleTileDepthRangeTilesVersion===this._latestSortedGaussianTilesVersion&&n(this._previousVisibleTileDepthRangeEye,s)&&n(this._previousVisibleTileDepthRangeViewForward,i)&&(null==t?!this._previousVisibleTileDepthRangeHasClippingBox:this._previousVisibleTileDepthRangeHasClippingBox&&_(this._previousVisibleTileDepthRangeClippingBox,t)))return f.near<=f.far?f:null;let m=1/0,g=-1/0;const T=this._latestSortedGaussianTiles;for(let n=0;n<T.length;n++){const e=T[n];if(null!=t){const s=e.boundingBox;if(!c(s,t))continue}const s=h*(e.obbCenterX-r)+u*(e.obbCenterY-a)+d*(e.obbCenterZ-o),i=e.paddedMbsRadius,l=s-i;l<m&&(m=l);const _=s+i;_>g&&(g=_)}const S=m<=g;return S?f.set(m,g):f.set(1/0,-1/0),this._previousVisibleTileDepthRangeTilesVersion=this._latestSortedGaussianTilesVersion,this._previousVisibleTileDepthRangeHasClippingBox=null!=t,l(this._previousVisibleTileDepthRangeEye,s),l(this._previousVisibleTileDepthRangeViewForward,i),null!=t&&p(this._previousVisibleTileDepthRangeClippingBox,t),S?f:null}updateGaussianVisibility(e,t){this._latestUpdatedGaussianTiles=e,this._requestedLyr3dVisibilityChange=t,this.requestSort()}get updating(){return this._updating.value}destroy(){this._sortAbortController=t(this._sortAbortController),this._pendingSortTask=!1,this._updating.value=!1,null!=this._scheduledSortStartTimeout&&(clearTimeout(this._scheduledSortStartTimeout),this._scheduledSortStartTimeout=null),this._frameTask.remove(),this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._orderTexture.destroy(),this._fadingTexture.destroy()}requestSort(){return this._updating.value=!0,!this._pendingSortTask&&(this._pendingSortTask=!0,this._scheduleSortStart(),!0)}_scheduleSortStart(){if(this._isSorting)return;const e=o()-this._lastSortStartTime,t=this._sortInterval-e;t<=0?this._startSortIfRequired():null==this._scheduledSortStartTimeout&&(this._scheduledSortStartTimeout=setTimeout(()=>{this._scheduledSortStartTimeout=null,this._pendingSortTask&&!this._isSorting&&this._scheduleSortStart()},t))}_startSortIfRequired(){if(this._isSorting||!this._pendingSortTask)return;const e=new AbortController;this._sortAbortController=e,this._isSorting=!0,this._pendingSortTask=!1,this._lastSortStartTime=o(),this._sortOnWorker(e.signal).finally(()=>{this._sortAbortController===e&&(this._sortAbortController=null),this._handleSortComplete()})}_handleSortComplete(){this._isSorting=!1,this._pendingSortTask?this._scheduleSortStart():this._updating.value=!1}_clearBuffersAndTextures(){this._atlasIndicesBuffer=void 0,this._packedSortedAtlasIndicesBuffer=void 0,this._distancesBuffer=void 0,this._bufferCapacity=0,this._sortBufferMemory=0,this._orderTexture.clear(),this._textureAtlas.clear()}_computeExpandedCapacity(t,s){let i=Math.max(1,t);for(;i<s;)i=Math.ceil(i*e);return i}_ensureSortBufferCapacities(e){if(this._bufferCapacity<e){const t=this._computeExpandedCapacity(this._bufferCapacity,e);this._atlasIndicesBuffer=new Uint32Array(t),this._packedSortedAtlasIndicesBuffer=new Uint8Array(t*T.bytesPerPackedGaussianIndex),this._distancesBuffer=new Float64Array(t),this._bufferCapacity=t,this._sortBufferMemory=s(this._atlasIndicesBuffer,this._packedSortedAtlasIndicesBuffer,this._distancesBuffer)}}_clearAllBuffersAndTextures(){this._clearBuffersAndTextures(),this._latestSortedGaussianTiles.length=0,this._nextCommittedVisibleGaussianTiles.length=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._workerHandle?.clear()}async _sortOnWorker(e){try{if(0===this._latestUpdatedGaussianTiles.length)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=this._requestedLyr3dVisibilityChange,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);this._useDeterministicSort&&this._latestUpdatedGaussianTiles.sort((e,t)=>e.obb.centerX-t.obb.centerX||e.obb.centerY-t.obb.centerY||e.obb.centerZ-t.obb.centerZ);const t=this._latestUpdatedGaussianTiles,s=t.length,i=this._requestedLyr3dVisibilityChange;let r=0;for(let e=0;e<s;e++)r+=t[e].gaussianCount;this._ensureSortBufferCapacities(r),this._textureAtlas.ensureTextureAtlas(),h(this._cameraDirectionNormalized,this._renderer.camera.ray.direction);const a=this._cameraDirectionNormalized[0],o=this._cameraDirectionNormalized[1],n=this._cameraDirectionNormalized[2];let l=0;const u=this._atlasIndicesBuffer,d=this._distancesBuffer,_=this._renderer.clippingBox,p=this._nextCommittedVisibleGaussianTiles;p.length=0;let f=0;for(let e=0;e<s;e++){const s=t[e],{gaussianAtlasIndices:i,relativePositions:r,obb:h}=s,m=s.gaussianCount;if(null!=_&&!c(s.boundingBox,_))continue;const{centerX:g,centerY:T,centerZ:S}=h;u.set(i,l),p[f++]=s;const b=a*g+o*T+n*S,y=l+m;for(let e=l,t=0;e<y;e++,t+=3){const s=r[t],i=r[t+1],l=r[t+2];d[e]=s*a+i*o+l*n+b}l=y}if(p.length=f,0===l)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=i,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);const m={distances:this._distancesBuffer,atlasIndices:this._atlasIndicesBuffer,packedSortedAtlasIndices:this._packedSortedAtlasIndicesBuffer,numGaussians:l,preciseSort:this._useDeterministicSort},g=await(this._workerHandle?.sort(m,e));if(g&&(this._distancesBuffer=g.distances,this._atlasIndicesBuffer=g.atlasIndices,this._packedSortedAtlasIndicesBuffer=g.packedSortedAtlasIndices),e.aborted)return;const T=async e=>{this._orderTexture.setData(this._packedSortedAtlasIndicesBuffer,l);const t=this._latestSortedGaussianTiles;this._latestSortedGaussianTiles=p,this._nextCommittedVisibleGaussianTiles=t,this._latestSortedGaussianTilesVersion++,this._latestCompletedLyr3dVisibilityChange=i,this.visibleGaussians=l,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),this._renderer.requestRender(1),e.madeProgress()};await this._frameTask.schedule(T,e)}catch(t){if(i(t))return}}set useDeterministicSort(e){this._useDeterministicSort=e}}export{C as GaussianSplatDataStore};
2
+ import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{abortMaybe as t}from"../../../../core/maybe.js";import{estimateNumberArrayMemory as s}from"../../../../core/memoryEstimations.js";import{isAbortError as i}from"../../../../core/promiseUtils.js";import{signal as r}from"../../../../core/signal.js";import{Milliseconds as a,now as o}from"../../../../core/time.js";import{exactEquals as n,copy as l,normalize as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as d,exactEquals as _,intersects as c,copy as p}from"../../../../geometry/support/aaBoundingBox.js";import{makeScheduleFunction as f}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as m}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatFadeTexture as g}from"./GaussianSplatFadeTexture.js";import{GaussianSplatOrderTexture as T}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as b}from"./GaussianSplatTextureAtlas.js";import{DepthRange as S}from"../../webgl-engine/lib/DepthRange.js";import{TaskPriority as y}from"../../../support/Scheduler.js";class C{constructor(e,t){this._updating=r(!1),this._useDeterministicSort=!1,this._sortBufferMemory=0,this.visibleGaussians=0,this._visibleTileDepthRange=new S,this._previousVisibleTileDepthRangeEye=u(),this._previousVisibleTileDepthRangeViewForward=u(),this._previousVisibleTileDepthRangeClippingBox=d(),this._latestSortedGaussianTilesVersion=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._previousVisibleTileDepthRangeHasClippingBox=!1,this._bufferCapacity=0,this._requestedLyr3dVisibilityChange=0,this._latestCompletedLyr3dVisibilityChange=0,this._latestUpdatedGaussianTiles=new Array,this._latestSortedGaussianTiles=new Array,this._nextCommittedVisibleGaussianTiles=new Array,this._cameraDirectionNormalized=u(),this._frameTask=null,this._workerHandle=null,this._sortAbortController=null,this._isSorting=!1,this._pendingSortTask=!1,this._scheduledSortStartTimeout=null,this._lastSortStartTime=a(-1/0),this._sortInterval=a(80),this._renderer=e,this._onSortComplete=t,this._orderTexture=new T(this._renderer.renderingContext),this._fadingTexture=new g(this._renderer.renderingContext),this._textureAtlas=new b(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache);const{resourceController:s}=this._renderer.view;this._workerHandle=new m(f(s)),this._frameTask=s.scheduler.registerTask(y.GAUSSIAN_SPLAT_SORTING)}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get fadingTexture(){return this._fadingTexture}get textureAtlasMemory(){return this._textureAtlas.usedMemory}get orderTextureMemory(){return this._orderTexture.usedMemory}get fadingTextureMemory(){return this._fadingTexture.usedMemory}get sortBufferMemory(){return this._sortBufferMemory}get usedMemory(){return this.textureAtlasMemory+this.orderTextureMemory+this.fadingTextureMemory+this.sortBufferMemory}queryVisibleTileDepthRange(e,t){if(0===this.visibleGaussians)return null;const{eye:s,viewForward:i}=e,r=s[0],a=s[1],o=s[2],h=i[0],u=i[1],d=i[2],f=this._visibleTileDepthRange;if(this._previousVisibleTileDepthRangeTilesVersion===this._latestSortedGaussianTilesVersion&&n(this._previousVisibleTileDepthRangeEye,s)&&n(this._previousVisibleTileDepthRangeViewForward,i)&&(null==t?!this._previousVisibleTileDepthRangeHasClippingBox:this._previousVisibleTileDepthRangeHasClippingBox&&_(this._previousVisibleTileDepthRangeClippingBox,t)))return f.near<=f.far?f:null;let m=1/0,g=-1/0;const T=this._latestSortedGaussianTiles;for(let n=0;n<T.length;n++){const e=T[n];if(null!=t){const s=e.boundingBox;if(!c(s,t))continue}const s=h*(e.obbCenterX-r)+u*(e.obbCenterY-a)+d*(e.obbCenterZ-o),i=e.paddedMbsRadius,l=s-i;l<m&&(m=l);const _=s+i;_>g&&(g=_)}const b=m<=g;return b?f.set(m,g):f.set(1/0,-1/0),this._previousVisibleTileDepthRangeTilesVersion=this._latestSortedGaussianTilesVersion,this._previousVisibleTileDepthRangeHasClippingBox=null!=t,l(this._previousVisibleTileDepthRangeEye,s),l(this._previousVisibleTileDepthRangeViewForward,i),null!=t&&p(this._previousVisibleTileDepthRangeClippingBox,t),b?f:null}updateGaussianVisibility(e,t){this._latestUpdatedGaussianTiles=e,this._requestedLyr3dVisibilityChange=t,this.requestSort()}get updating(){return this._updating.value}destroy(){this._sortAbortController=t(this._sortAbortController),this._pendingSortTask=!1,this._updating.value=!1,null!=this._scheduledSortStartTimeout&&(clearTimeout(this._scheduledSortStartTimeout),this._scheduledSortStartTimeout=null),this._frameTask.remove(),this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._orderTexture.destroy(),this._fadingTexture.destroy()}requestSort(){return this._updating.value=!0,!this._pendingSortTask&&(this._pendingSortTask=!0,this._scheduleSortStart(),!0)}_scheduleSortStart(){if(this._isSorting)return;const e=o()-this._lastSortStartTime,t=this._sortInterval-e;t<=0?this._startSortIfRequired():null==this._scheduledSortStartTimeout&&(this._scheduledSortStartTimeout=setTimeout(()=>{this._scheduledSortStartTimeout=null,this._pendingSortTask&&!this._isSorting&&this._scheduleSortStart()},t))}_startSortIfRequired(){if(this._isSorting||!this._pendingSortTask)return;const e=new AbortController;this._sortAbortController=e,this._isSorting=!0,this._pendingSortTask=!1,this._lastSortStartTime=o(),this._sortOnWorker(e.signal).finally(()=>{this._sortAbortController===e&&(this._sortAbortController=null),this._handleSortComplete()})}_handleSortComplete(){this._isSorting=!1,this._pendingSortTask?this._scheduleSortStart():this._updating.value=!1}_clearBuffersAndTextures(){this._atlasIndicesBuffer=void 0,this._packedSortedAtlasIndicesBuffer=void 0,this._distancesBuffer=void 0,this._bufferCapacity=0,this._sortBufferMemory=0,this._orderTexture.clear(),this._textureAtlas.clear()}_computeExpandedCapacity(t,s){let i=Math.max(1,t);for(;i<s;)i=Math.ceil(i*e);return i}_ensureSortBufferCapacities(e){if(this._bufferCapacity<e){const t=this._computeExpandedCapacity(this._bufferCapacity,e);this._atlasIndicesBuffer=new Uint32Array(t),this._packedSortedAtlasIndicesBuffer=new Uint8Array(t*T.bytesPerPackedGaussianIndex),this._distancesBuffer=new Float64Array(t),this._bufferCapacity=t,this._sortBufferMemory=s(this._atlasIndicesBuffer,this._packedSortedAtlasIndicesBuffer,this._distancesBuffer)}}_clearAllBuffersAndTextures(){this._clearBuffersAndTextures(),this._latestSortedGaussianTiles.length=0,this._nextCommittedVisibleGaussianTiles.length=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._workerHandle?.clear()}async _sortOnWorker(e){try{if(0===this._latestUpdatedGaussianTiles.length)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=this._requestedLyr3dVisibilityChange,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);this._useDeterministicSort&&this._latestUpdatedGaussianTiles.sort((e,t)=>e.obb.centerX-t.obb.centerX||e.obb.centerY-t.obb.centerY||e.obb.centerZ-t.obb.centerZ);const t=this._latestUpdatedGaussianTiles,s=t.length,i=this._requestedLyr3dVisibilityChange;let r=0;for(let e=0;e<s;e++)r+=t[e].gaussianCount;this._ensureSortBufferCapacities(r),this._textureAtlas.ensureTextureAtlas();const a=this._renderer.camera;h(this._cameraDirectionNormalized,a.ray.direction);const o=this._cameraDirectionNormalized[0],n=this._cameraDirectionNormalized[1],l=this._cameraDirectionNormalized[2];let u=0;const d=this._atlasIndicesBuffer,_=this._distancesBuffer,p=this._renderer.clippingBox,f=this._nextCommittedVisibleGaussianTiles;f.length=0;let m=0;const{frustum:g}=a,T=this._renderer.tileCullingRevision,b=g[0],S=g[1],y=g[2],C=g[3],x=g[4],V=g[5];for(let e=0;e<s;e++){const s=t[e],{gaussianAtlasIndices:i,relativePositions:r,obbCenterX:a,obbCenterY:h,obbCenterZ:g,paddedMbsRadius:v}=s,A=s.gaussianCount;if(s.cullingRevision!==T){let e=null==p||c(s.boundingBox,p);if(e){const t=1.5*v;e=b[0]*a+b[1]*h+b[2]*g+b[3]<t&&S[0]*a+S[1]*h+S[2]*g+S[3]<t&&y[0]*a+y[1]*h+y[2]*g+y[3]<t&&C[0]*a+C[1]*h+C[2]*g+C[3]<t&&x[0]*a+x[1]*h+x[2]*g+x[3]<t&&V[0]*a+V[1]*h+V[2]*g+V[3]<t}s.cullingRevision=T,s.cullingVisible=e}if(!s.cullingVisible)continue;d.set(i,u),f[m++]=s;const B=o*a+n*h+l*g,G=u+A;for(let e=u,t=0;e<G;e++,t+=3){const s=r[t],i=r[t+1],a=r[t+2];_[e]=s*o+i*n+a*l+B}u=G}if(f.length=m,0===u)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=i,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);const v={distances:this._distancesBuffer,atlasIndices:this._atlasIndicesBuffer,packedSortedAtlasIndices:this._packedSortedAtlasIndicesBuffer,numGaussians:u,preciseSort:this._useDeterministicSort},A=await(this._workerHandle?.sort(v,e));if(A&&(this._distancesBuffer=A.distances,this._atlasIndicesBuffer=A.atlasIndices,this._packedSortedAtlasIndicesBuffer=A.packedSortedAtlasIndices),e.aborted)return;const B=async e=>{this._orderTexture.setData(this._packedSortedAtlasIndicesBuffer,u);const t=this._latestSortedGaussianTiles;this._latestSortedGaussianTiles=f,this._nextCommittedVisibleGaussianTiles=t,this._latestSortedGaussianTilesVersion++,this._latestCompletedLyr3dVisibilityChange=i,this.visibleGaussians=u,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),this._renderer.requestRender(1),e.madeProgress()};await this._frameTask.schedule(B,e)}catch(t){if(i(t))return}}set useDeterministicSort(e){this._useDeterministicSort=e}}export{C as GaussianSplatDataStore};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{subtract as t,length as i,scale as e,negate as s,dot as n,transformQuatValues as o,set as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as c}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{project as u}from"../../../../geometry/projectionUtils.js";import{intersects as d,contains as p}from"../../../../geometry/support/aaBoundingBox.js";import{fromExtent as f}from"../../../../geometry/support/aaBoundingRect.js";import{create as h}from"../../../../geometry/support/plane.js";import{fromPoints as m}from"../../../../geometry/support/ray.js";import{GaussianSplatTarget as g}from"../../layers/i3s/Intersector.js";import{createTileBVH as y}from"../../layers/support/Tiles3DBVH.js";import{ElevationRange as b}from"../ElevationRange.js";import{IntersectorResult as w}from"../../webgl-engine/lib/IntersectorResult.js";class v{constructor(t){this.layerView=t,this.type=0,this.slicePlaneEnabled=!1,this.isGround=!1,this._ellipsoidLocalRayOrigin=l(),this._ellipsoidLocalRayDir=l(),this.intersectionNormal=l(),this.intersectionRayDir=l(),this.intersectionPlane=h(),this.layerViewUid=t.uid;const i=t.view.viewingMode,e=(t.useEsriCrs?t.fullExtentInLocalViewSpatialReference:t.layer.fullExtent?u(t.layer.fullExtent,t.view.renderSpatialReference):void 0)??t.view.extent,s=f(e);this._bvh=y(i,s)}destroy(){this._bvh.destroy()}addTile(t){this._bvh.addTile(t)}removeTile(t){this._bvh.removeTile(t)}intersect(o,l,u,f,h,y){const{intersectionRayDir:b,intersectionPlane:v,layerViewUid:_,intersectionNormal:j}=this,E=m(u,f);t(b,f,u);const M=1/i(b);e(b,b,M),s(j,b),c(v,b[0],b[1],b[2],-n(b,u));const S=new x,V=new x,k=o.options.store,T=0===k,q=2===k,B=1===k||q,D=q?new Array:null,P=(t,i,e,s,n)=>(t.point=t.point?r(t.point,e,s,n):a(e,s,n),t.dist=i,t.normal=j,t.layerViewUid=_,t),U=u[0],I=u[1],L=u[2],G=b[0],C=b[1],A=b[2],N=this.layerView.clippingBox,O=t=>{const{relativePositions:i,packedRotations:e,packedScales:s,gaussianCount:n,obb:o,maxSplatMbsRadiusSquared:r}=t,a=o.centerX,c=o.centerY,d=o.centerZ;let p=-1;const h=N[0],m=N[1],g=N[2],y=N[3],b=N[4],w=N[5];for(let v=0,R=0;v<n;v++,R+=3){const t=i[R]+a,n=i[R+1]+c,o=i[R+2]+d;if(t<h||n<m||o<g||t>y||n>b||o>w)continue;const _=t-U,j=n-I,E=o-L,k=_*G+j*C+E*A;if(k<0&&k*k>r)continue;const N=k<0?0:k;if(_*_+j*j+E*E-N*N>r)continue;if(T&&null!=S.dist){p<0&&(p=Math.sqrt(r));if(Math.max(k-p,0)*M>=S.dist)continue}const O=this._intersectGaussianEllipsoid(_,j,E,G,C,A,e[v],s[v]);if(O<0)continue;const X=O*M;if(null!=l&&!l(u,f,X))continue;const Y=null==S.dist||X<S.dist,Z=B&&(null==V.dist||X>V.dist);if(!Y&&!Z&&!q)continue;const F=U+G*O,H=I+C*O,Q=L+A*O;if(Y&&P(S,X,F,H,Q),Z&&P(V,X,F,H,Q),q){const t=new x;D.push(P(t,X,F,H,Q))}}},X=t=>{const{relativePositions:i,packedRotations:e,packedScales:s,gaussianCount:n,obb:o,maxSplatMbsRadiusSquared:r}=t,a=o.centerX,c=o.centerY,d=o.centerZ;let p=-1;const h=U-a,m=I-c,g=L-d;for(let y=0,b=0;y<n;y++,b+=3){const t=i[b]-h,n=i[b+1]-m,o=i[b+2]-g,a=t*G+n*C+o*A;if(a<0&&a*a>r)continue;const c=a<0?0:a;if(t*t+n*n+o*o-c*c>r)continue;if(T&&null!=S.dist){p<0&&(p=Math.sqrt(r));if(Math.max(a-p,0)*M>=S.dist)continue}const d=this._intersectGaussianEllipsoid(t,n,o,G,C,A,e[y],s[y]);if(d<0)continue;const w=d*M;if(null!=l&&!l(u,f,w))continue;const v=null==S.dist||w<S.dist,R=B&&(null==V.dist||w>V.dist);if(!v&&!R&&!q)continue;const _=U+G*d,j=I+C*d,E=L+A*d;if(v&&P(S,w,_,j,E),R&&P(V,w,_,j,E),q){const t=new x;D.push(P(t,w,_,j,E))}}},Y=(t,i)=>{const{min:e,max:s}=t.obb.signedDistanceRangePlane(v);if(s<0)return;const n=e*M;if(!(T&&null!=S.dist&&S.dist<n)){if(null!=S.dist&&null!=V.dist){const t=s*M;if(S.dist<n&&V.dist>t)return}i?O(t):X(t)}},Z=t=>{Y(t,!1)},F=t=>{const i=t.boundingBox;d(i,N)&&Y(t,!p(N,i))};this._bvh.forEachTileIntersectingRay(u,f,null!=N?F:Z,y);const H=(t,i)=>{const{layerViewUid:e}=i,s=new g(i.point,e);t.set(0,s,i.dist,i.normal)};if(R(S)){const t=o.results.min;(null==t.distance||S.dist<t.distance)&&H(t,S)}if(R(V)&&B){const t=o.results.max;(null==t.distance||V.dist>t.distance)&&H(t,V)}if(q&&D?.length)for(const t of D){const i=new w(E);H(i,t),o.results.all.push(i)}}_intersectGaussianEllipsoid(t,i,e,s,n,r,l,a){const c=l>>>30,u=1023&l,d=l>>>10&1023,p=l>>>20&1023,f=(u&_)*j*(1-2*(u>>>9&1)),h=(d&_)*j*(1-2*(d>>>9&1)),m=(p&_)*j*(1-2*(p>>>9&1));let g,y,b,w;const v=f*f+h*h+m*m,R=Math.sqrt(Math.max(0,1-v));switch(c){case 0:g=R,y=m,b=h,w=f;break;case 1:g=m,y=R,b=h,w=f;break;case 2:g=m,y=h,b=R,w=f;break;default:g=m,y=h,b=f,w=R}const x=this._ellipsoidLocalRayOrigin;x[0]=-t,x[1]=-i,x[2]=-e,o(x,x,-g,-y,-b,w);const M=this._ellipsoidLocalRayDir;M[0]=s,M[1]=n,M[2]=r,o(M,M,-g,-y,-b,w);const V=S[255&a],k=S[a>>>8&255],T=S[a>>>16],q=x[0]*V,B=x[1]*k,D=x[2]*T,P=q*q+B*B+D*D;if(P<=1)return 0;const U=M[0]*V,I=M[1]*k,L=M[2]*T,G=U*U+I*I+L*L,C=q*U+B*I+D*L;if(C>0)return E;const A=C*C-G*(P-1);return A<0?E:(-C-Math.sqrt(A))/G}getElevationRange(t){return this._bvh.getElevationRangeIntersectingSphere(t)??new b(0,0)}}function R(t){return null!=t.dist&&null!=t.point}class x{constructor(){this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}const _=511,j=Math.SQRT1_2/_,E=-1,M=3,S=(()=>{const t=new Float64Array(256);for(let i=0;i<t.length;i++)t[i]=Math.exp(10-i/16)/M;return t})();export{v as GaussianSplatIntersectionHandler};
2
+ import{subtract as t,length as i,scale as e,negate as s,dot as n,transformQuatValues as o,set as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as c}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{project as u}from"../../../../geometry/projectionUtils.js";import{intersects as d,contains as p}from"../../../../geometry/support/aaBoundingBox.js";import{fromExtent as f}from"../../../../geometry/support/aaBoundingRect.js";import{create as h}from"../../../../geometry/support/plane.js";import{fromPoints as m}from"../../../../geometry/support/ray.js";import{GaussianSplatTarget as y}from"../../layers/i3s/Intersector.js";import{createTileBVH as g}from"../../layers/support/Tiles3DBVH.js";import{ElevationRange as b}from"../ElevationRange.js";import{IntersectorResult as w}from"../../webgl-engine/lib/IntersectorResult.js";class v{constructor(t){this.layerView=t,this.type=0,this.slicePlaneEnabled=!1,this.isGround=!1,this._ellipsoidLocalRayOrigin=l(),this._ellipsoidLocalRayDir=l(),this.intersectionNormal=l(),this.intersectionRayDir=l(),this.intersectionPlane=h(),this.layerViewUid=t.uid;const i=t.view.viewingMode,e=(t.useEsriCrs?t.fullExtentInLocalViewSpatialReference:t.layer.fullExtent?u(t.layer.fullExtent,t.view.renderSpatialReference):void 0)??t.view.extent,s=f(e);this._bvh=g(i,s)}destroy(){this._bvh.destroy()}addTile(t){this._bvh.addTile(t)}removeTile(t){this._bvh.removeTile(t)}intersect(o,l,u,f,h,g){const{intersectionRayDir:b,intersectionPlane:v,layerViewUid:_,intersectionNormal:j}=this,E=m(u,f);t(b,f,u);const M=1/i(b);e(b,b,M),s(j,b),c(v,b[0],b[1],b[2],-n(b,u));const S=new x,V=new x,k=o.options.store,T=0===k,q=2===k,B=1===k||q,D=q?new Array:null,P=(t,i,e,s,n)=>(t.point=t.point?r(t.point,e,s,n):a(e,s,n),t.dist=i,t.normal=j,t.layerViewUid=_,t),U=u[0],I=u[1],L=u[2],G=b[0],O=b[1],C=b[2],A=this.layerView.clippingBox,N=t=>{const{relativePositions:i,packedRotations:e,packedOpacityScaledScales:s,gaussianCount:n,obb:o,maxSplatMbsRadiusSquared:r}=t,a=o.centerX,c=o.centerY,d=o.centerZ;let p=-1;const h=A[0],m=A[1],y=A[2],g=A[3],b=A[4],w=A[5];for(let v=0,R=0;v<n;v++,R+=3){const t=i[R]+a,n=i[R+1]+c,o=i[R+2]+d;if(t<h||n<m||o<y||t>g||n>b||o>w)continue;const _=t-U,j=n-I,E=o-L,k=_*G+j*O+E*C;if(k<0&&k*k>r)continue;const A=k<0?0:k;if(_*_+j*j+E*E-A*A>r)continue;if(T&&null!=S.dist){p<0&&(p=Math.sqrt(r));if(Math.max(k-p,0)*M>=S.dist)continue}const N=this._intersectGaussianEllipsoid(_,j,E,G,O,C,e[v],s[v]);if(N<0)continue;const X=N*M;if(null!=l&&!l(u,f,X))continue;const Y=null==S.dist||X<S.dist,Z=B&&(null==V.dist||X>V.dist);if(!Y&&!Z&&!q)continue;const F=U+G*N,H=I+O*N,Q=L+C*N;if(Y&&P(S,X,F,H,Q),Z&&P(V,X,F,H,Q),q){const t=new x;D.push(P(t,X,F,H,Q))}}},X=t=>{const{relativePositions:i,packedRotations:e,packedOpacityScaledScales:s,gaussianCount:n,obb:o,maxSplatMbsRadiusSquared:r}=t,a=o.centerX,c=o.centerY,d=o.centerZ;let p=-1;const h=U-a,m=I-c,y=L-d;for(let g=0,b=0;g<n;g++,b+=3){const t=i[b]-h,n=i[b+1]-m,o=i[b+2]-y,a=t*G+n*O+o*C;if(a<0&&a*a>r)continue;const c=a<0?0:a;if(t*t+n*n+o*o-c*c>r)continue;if(T&&null!=S.dist){p<0&&(p=Math.sqrt(r));if(Math.max(a-p,0)*M>=S.dist)continue}const d=this._intersectGaussianEllipsoid(t,n,o,G,O,C,e[g],s[g]);if(d<0)continue;const w=d*M;if(null!=l&&!l(u,f,w))continue;const v=null==S.dist||w<S.dist,R=B&&(null==V.dist||w>V.dist);if(!v&&!R&&!q)continue;const _=U+G*d,j=I+O*d,E=L+C*d;if(v&&P(S,w,_,j,E),R&&P(V,w,_,j,E),q){const t=new x;D.push(P(t,w,_,j,E))}}},Y=(t,i)=>{const{min:e,max:s}=t.obb.signedDistanceRangePlane(v);if(s<0)return;const n=e*M;if(!(T&&null!=S.dist&&S.dist<n)){if(null!=S.dist&&null!=V.dist){const t=s*M;if(S.dist<n&&V.dist>t)return}i?N(t):X(t)}},Z=t=>{Y(t,!1)},F=t=>{const i=t.boundingBox;d(i,A)&&Y(t,!p(A,i))};this._bvh.forEachTileIntersectingRay(u,f,null!=A?F:Z,g);const H=(t,i)=>{const{layerViewUid:e}=i,s=new y(i.point,e);t.set(0,s,i.dist,i.normal)};if(R(S)){const t=o.results.min;(null==t.distance||S.dist<t.distance)&&H(t,S)}if(R(V)&&B){const t=o.results.max;(null==t.distance||V.dist>t.distance)&&H(t,V)}if(q&&D?.length)for(const t of D){const i=new w(E);H(i,t),o.results.all.push(i)}}_intersectGaussianEllipsoid(t,i,e,s,n,r,l,a){const c=l>>>30,u=1023&l,d=l>>>10&1023,p=l>>>20&1023,f=(u&_)*j*(1-2*(u>>>9&1)),h=(d&_)*j*(1-2*(d>>>9&1)),m=(p&_)*j*(1-2*(p>>>9&1));let y,g,b,w;const v=f*f+h*h+m*m,R=Math.sqrt(Math.max(0,1-v));switch(c){case 0:y=R,g=m,b=h,w=f;break;case 1:y=m,g=R,b=h,w=f;break;case 2:y=m,g=h,b=R,w=f;break;default:y=m,g=h,b=f,w=R}const x=this._ellipsoidLocalRayOrigin;x[0]=-t,x[1]=-i,x[2]=-e,o(x,x,-y,-g,-b,w);const M=this._ellipsoidLocalRayDir;M[0]=s,M[1]=n,M[2]=r,o(M,M,-y,-g,-b,w);const V=S[255&a],k=S[a>>>8&255],T=S[a>>>16],q=x[0]*V,B=x[1]*k,D=x[2]*T,P=q*q+B*B+D*D;if(P<=1)return 0;const U=M[0]*V,I=M[1]*k,L=M[2]*T,G=U*U+I*I+L*L,O=q*U+B*I+D*L;if(O>0)return E;const C=O*O-G*(P-1);return C<0?E:(-O-Math.sqrt(C))/G}getElevationRange(t){return this._bvh.getElevationRangeIntersectingSphere(t)??new b(0,0)}}function R(t){return null!=t.dist&&null!=t.point}class x{constructor(){this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}const _=511,j=Math.SQRT1_2/_,E=-1,M=3,S=(()=>{const t=new Float64Array(256);for(let i=0;i<t.length;i++)t[i]=Math.exp(10-i/16)/M;return t})();export{v as GaussianSplatIntersectionHandler};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{reallocGrowthFactor as t}from"../../../../core/arrayUtils.js";import{initialSplatAtlasTextureHeight as e,GaussianSplatAtlasPages as s,splatAtlasTextureWidth as r,elementsPerSplatPage as a}from"./GaussianSplatAtlasPages.js";import{GaussianSplatOrderTexture as i}from"./GaussianSplatOrderTexture.js";import{PixelType as l,SizedPixelFormat as u}from"../../../webgl/enums.js";import{DisposableFramebufferObject as o}from"../../../webgl/FramebufferObject.js";import h from"../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../webgl/TextureDescriptor.js";class c{constructor(t,r,a){this._splatAtlasTextureHeight=e,this.texture=null,this._rctx=t,this._fboCache=a,this.pageAllocator=new s,this._cache=r.newCache("gaussian texture cache",t=>t.dispose())}get usedMemory(){return this.texture?.usedMemory??0}ensureTextureAtlas(){if(this.texture?.hasWebGLTextureObject)return;this.texture=null;const t=this._cache.pop("splatTextureAtlas");if(t)return void(this.texture=t);const e=new p;e.height=this._splatAtlasTextureHeight,e.width=r,e.pixelFormat=36249,e.dataType=l.UNSIGNED_INT,e.internalFormat=u.RGBA32UI,e.samplingMode=9728,e.wrapMode=33071,e.isImmutable=!0,this.texture=new h(this._rctx,e),this._updatePageAllocator()}grow(){if(!this.texture)return this.ensureTextureAtlas(),!1;const e=Math.floor(this._splatAtlasTextureHeight*t),s=Math.min(e,x);if(s<=this._splatAtlasTextureHeight)return!1;if(s*r>this._rctx.parameters.maxPreferredTexturePixels)return!1;const a=new o(this._rctx,this.texture),i=this._fboCache.acquire(r,s,"gaussian splat atlas resize",12);return this._rctx.blitFramebuffer(a,i.fbo,16384,9728,0,0,r,this._splatAtlasTextureHeight,0,0,r,this._splatAtlasTextureHeight),this.texture?.dispose(),this.texture=i.fbo?.detachColorTexture(),a.dispose(),i.dispose(),this._splatAtlasTextureHeight=s,this._updatePageAllocator(),!0}requestPage(){let t=this.pageAllocator.findFirstFreePage();return null===t&&this.grow()&&(t=this.pageAllocator.findFirstFreePage()),null!==t&&this.pageAllocator.allocate(t),t}freePage(t){this.pageAllocator.free(t)}update(t,e,s){this.ensureTextureAtlas(),this.texture.updateData(0,t,e,a,1,s)}_updatePageAllocator(){const t=r*this._splatAtlasTextureHeight/a;this.pageAllocator.pageCount!==t&&this.pageAllocator.resize(t)}clear(){this.texture&&(this._cache.put("splatTextureAtlas",this.texture),this.texture=null)}destroy(){this._cache.destroy(),this.texture?.dispose(),this.texture=null}}const x=2**(8*i.bytesPerPackedGaussianIndex)/r;export{c as GaussianSplatTextureAtlas};
2
+ import{reallocGrowthFactor as t}from"../../../../core/arrayUtils.js";import{initialSplatAtlasTextureHeight as e,GaussianSplatAtlasPages as s,splatAtlasTextureWidth as r,elementsPerSplatPage as a}from"./GaussianSplatAtlasPages.js";import{GaussianSplatOrderTexture as i}from"./GaussianSplatOrderTexture.js";import{PixelType as l,SizedPixelFormat as u}from"../../../webgl/enums.js";import{DisposableFramebufferObject as o}from"../../../webgl/FramebufferObject.js";import h from"../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../webgl/TextureDescriptor.js";class c{constructor(t,r,a){this._splatAtlasTextureHeight=e,this.texture=null,this._rctx=t,this._fboCache=a,this.pageAllocator=new s,this._cache=r.newCache("gaussian texture cache",t=>t.dispose())}get usedMemory(){return this.texture?.usedMemory??0}ensureTextureAtlas(){if(this.texture?.hasWebGLTextureObject)return;this.texture=null;const t=this._cache.pop("splatTextureAtlas");if(t)return void(this.texture=t);const e=new p;e.height=this._splatAtlasTextureHeight,e.width=r,e.pixelFormat=36249,e.dataType=l.UNSIGNED_INT,e.internalFormat=u.RGBA32UI,e.samplingMode=9728,e.wrapMode=33071,e.isImmutable=!0,this.texture=new h(this._rctx,e),this._updatePageAllocator()}grow(){if(!this.texture)return this.ensureTextureAtlas(),!1;const e=Math.floor(this._splatAtlasTextureHeight*t),s=Math.min(e,x);if(s<=this._splatAtlasTextureHeight)return!1;if(s*r>this._rctx.parameters.maxPreferredTexturePixels)return!1;const a=new o(this._rctx,this.texture),i=this._fboCache.acquire(r,s,"gaussian splat atlas resize",12);return this._rctx.blitFramebuffer(a,i.fbo,16384,9728,0,0,r,this._splatAtlasTextureHeight,0,0,r,this._splatAtlasTextureHeight),this.texture=i.fbo?.detachColorTexture(),a.dispose(),i.dispose(),this._splatAtlasTextureHeight=s,this._updatePageAllocator(),!0}requestPage(){let t=this.pageAllocator.findFirstFreePage();return null===t&&this.grow()&&(t=this.pageAllocator.findFirstFreePage()),null!==t&&this.pageAllocator.allocate(t),t}freePage(t){this.pageAllocator.free(t)}update(t,e,s){this.ensureTextureAtlas(),this.texture.updateData(0,t,e,a,1,s)}_updatePageAllocator(){const t=r*this._splatAtlasTextureHeight/a;this.pageAllocator.pageCount!==t&&this.pageAllocator.resize(t)}clear(){this.texture&&(this._cache.put("splatTextureAtlas",this.texture),this.texture=null)}destroy(){this._cache.destroy(),this.texture?.dispose(),this.texture=null}}const x=2**(8*i.bytesPerPackedGaussianIndex)/r;export{c as GaussianSplatTextureAtlas};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as e,diameter as i}from"../../../../geometry/support/aaBoundingBox.js";class o{constructor(o,r,n,a,h,b,c,u,d,m){this.handle=o,this.obb=r,this.gaussianAtlasIndices=n,this.pageIds=a,this.relativePositions=h,this.packedRotations=b,this.packedScales=c,this.gaussianCount=u,this.maxSplatMbsRadiusSquared=d,this.elevationRange=m,this.bvhIntersectionGeneration=0,this.lifecycleState=0,this.fadeDirection=0,this.opacityModifier=0,this.usedMemory=t(this.gaussianAtlasIndices,this.pageIds,this.relativePositions,this.packedRotations,this.packedScales);const l=s();r.getCenter(l),this.obbCenterX=l[0],this.obbCenterY=l[1],this.obbCenterZ=l[2];const f=r.radius??-1;this._mbsRadius=f;const p=f<0?-1:f*f;this._mbsRadiusSquared=p;const g=r.halfSize;this._obbShortestHalfsize=g?Math.min(g[0],g[1],g[2]):0;const S=e();r.toAaBoundingBox(S),this.boundingBox=S;const R=f>=0?f:.5*i(S);this.paddedMbsRadius=R+Math.sqrt(Math.max(0,d))}boundingVolumeIntersectsRay(t,s){if(!this.obb)return!0;const{obbCenterX:e,obbCenterY:i,obbCenterZ:o}=this,r=e-t[0],n=i-t[1],a=o-t[2],h=r*s[0]+n*s[1]+a*s[2],b=r*r+n*n+a*a-h*h;return(this._mbsRadiusSquared<0||b<=this._mbsRadiusSquared)&&this.obb.intersectRay(t,s)}boundingVolumeIntersectsSphere(t){const s=this._mbsRadius;if(s<0)return!0;const e=t.center,i=t.radius,o=s+i,r=this.obbCenterX-e[0];if(r>o)return!1;const n=this.obbCenterY-e[1];if(n>o)return!1;const a=this.obbCenterZ-e[2];if(a>o)return!1;const h=r*r+n*n+a*a;if(h>o*o)return!1;if(h<=(this._obbShortestHalfsize+i)**2)return!0;return Math.sqrt(h)+s<=i||(this.obb?.intersectSphere(t)??!0)}}export{o as GaussianTile};
2
+ import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as i,diameter as e}from"../../../../geometry/support/aaBoundingBox.js";class o{constructor(o,n,r,a,h,c,b,u,d,l){this.handle=o,this.obb=n,this.gaussianAtlasIndices=r,this.pageIds=a,this.relativePositions=h,this.packedRotations=c,this.packedOpacityScaledScales=b,this.gaussianCount=u,this.maxSplatMbsRadiusSquared=d,this.elevationRange=l,this.bvhIntersectionGeneration=0,this.lifecycleState=0,this.cullingRevision=-1,this.cullingVisible=!1,this.fadeDirection=0,this.opacityModifier=0,this.usedMemory=t(this.gaussianAtlasIndices,this.pageIds,this.relativePositions,this.packedRotations,this.packedOpacityScaledScales);const m=s();n.getCenter(m),this.obbCenterX=m[0],this.obbCenterY=m[1],this.obbCenterZ=m[2];const p=n.radius??-1;this._mbsRadius=p;const f=p<0?-1:p*p;this._mbsRadiusSquared=f;const g=n.halfSize;this._obbShortestHalfsize=g?Math.min(g[0],g[1],g[2]):0;const S=i();n.toAaBoundingBox(S),this.boundingBox=S;const R=p>=0?p:.5*e(S);this.paddedMbsRadius=R+Math.sqrt(Math.max(0,d))}boundingVolumeIntersectsRay(t,s){if(!this.obb)return!0;const{obbCenterX:i,obbCenterY:e,obbCenterZ:o}=this,n=i-t[0],r=e-t[1],a=o-t[2],h=n*s[0]+r*s[1]+a*s[2],c=n*n+r*r+a*a-h*h;return(this._mbsRadiusSquared<0||c<=this._mbsRadiusSquared)&&this.obb.intersectRay(t,s)}boundingVolumeIntersectsSphere(t){const s=this._mbsRadius;if(s<0)return!0;const i=t.center,e=t.radius,o=s+e,n=this.obbCenterX-i[0];if(n>o)return!1;const r=this.obbCenterY-i[1];if(r>o)return!1;const a=this.obbCenterZ-i[2];if(a>o)return!1;const h=n*n+r*r+a*a;if(h>o*o)return!1;if(h<=(this._obbShortestHalfsize+e)**2)return!0;return Math.sqrt(h)+s<=e||(this.obb?.intersectSphere(t)??!0)}}export{o as GaussianTile};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- function t(t,o,n){const r=o/3,c=new Uint32Array(n+1),e=new Uint32Array(n+1),s=(t,o)=>{t<o?c[t+1]++:e[o+1]++};for(let x=0;x<r;x++){const o=t[3*x],n=t[3*x+1],r=t[3*x+2];s(o,n),s(n,r),s(r,o)}let f=0,l=0;for(let x=0;x<n;x++){const t=c[x+1],o=e[x+1];c[x+1]=f,e[x+1]=l,f+=t,l+=o}const i=new Uint32Array(6*r),a=c[n],w=(t,o,n)=>{if(t<o){const r=c[t+1]++;i[2*r]=o,i[2*r+1]=n}else{const r=e[o+1]++;i[2*a+2*r]=t,i[2*a+2*r+1]=n}};for(let x=0;x<r;x++){const o=t[3*x],n=t[3*x+1],r=t[3*x+2];w(o,n,x),w(n,r,x),w(r,o,x)}const y=(t,o)=>{const n=2*t,r=o-t;for(let c=1;c<r;c++){const t=i[n+2*c],o=i[n+2*c+1];let r=c-1;for(;r>=0&&i[n+2*r]>t;r--)i[n+2*r+2]=i[n+2*r],i[n+2*r+3]=i[n+2*r+1];i[n+2*r+2]=t,i[n+2*r+3]=o}};for(let x=0;x<n;x++)y(c[x],c[x+1]),y(a+e[x],a+e[x+1]);const A=new Int32Array(3*r),U=(o,n)=>o===t[3*n]?0:o===t[3*n+1]?1:o===t[3*n+2]?2:-1,u=(t,o)=>{const n=U(t,o);A[3*o+n]=-1},p=(t,o,n,r)=>{const c=U(t,o);A[3*o+c]=r;const e=U(n,r);A[3*r+e]=o};for(let x=0;x<n;x++){let t=c[x];const o=c[x+1];let n=e[x];const r=e[x+1];for(;t<o&&n<r;){const o=i[2*t],r=i[2*a+2*n];o===r?(p(x,i[2*t+1],r,i[2*a+2*n+1]),t++,n++):o<r?(u(x,i[2*t+1]),t++):(u(r,i[2*a+2*n+1]),n++)}for(;t<o;)u(x,i[2*t+1]),t++;for(;n<r;){u(i[2*a+2*n],i[2*a+2*n+1]),n++}}return A}export{t as computeNeighbors};
2
+ function t(t,n,o){const r=n/3,e=new Uint32Array(o+1),s=new Uint32Array(o+1),c=(t,n)=>{t<n?e[t+1]++:s[n+1]++};for(let U=0;U<r;U++){const n=t[3*U],o=t[3*U+1],r=t[3*U+2];c(n,o),c(o,r),c(r,n)}let f=0,l=0;for(let U=0;U<o;U++){const t=e[U+1],n=s[U+1];e[U+1]=f,s[U+1]=l,f+=t,l+=n}const i=new Uint32Array(6*r),u=e[o],p=(t,n,o)=>{if(t<n){const r=e[t+1]++;i[2*r]=n,i[2*r+1]=o}else{const r=s[n+1]++;i[2*u+2*r]=t,i[2*u+2*r+1]=o}};for(let U=0;U<r;U++){const n=t[3*U],o=t[3*U+1],r=t[3*U+2];p(n,o,U),p(o,r,U),p(r,n,U)}const a=(t,n)=>{const o=2*t,r=n-t;for(let e=1;e<r;e++){const t=i[o+2*e],n=i[o+2*e+1];let r=e-1;for(;r>=0&&i[o+2*r]>t;r--)i[o+2*r+2]=i[o+2*r],i[o+2*r+3]=i[o+2*r+1];i[o+2*r+2]=t,i[o+2*r+3]=n}};for(let U=0;U<o;U++)a(e[U],e[U+1]),a(u+s[U],u+s[U+1]);const h=new Int32Array(3*r),w=(n,o)=>n===t[3*o]?0:n===t[3*o+1]?1:n===t[3*o+2]?2:-1,y=(t,n)=>{const o=w(t,n);h[3*n+o]=-1},A=(t,n,o,r)=>{const e=w(t,n);h[3*n+e]=r;const s=w(o,r);h[3*r+s]=n};for(let U=0;U<o;U++){let t=e[U];const n=e[U+1];let o=s[U];const r=s[U+1];for(;t<n&&o<r;){const n=i[2*t],r=i[2*u+2*o];n===r?(A(U,i[2*t+1],r,i[2*u+2*o+1]),t++,o++):n<r?(y(U,i[2*t+1]),t++):(y(r,i[2*u+2*o+1]),o++)}for(;t<n;)y(U,i[2*t+1]),t++;for(;o<r;){y(i[2*u+2*o],i[2*u+2*o+1]),o++}}return h}function n(t,n,r){const e=o(t,n,r),s=new Array(n).fill(-1),c=new Array(r).fill(-1);let f=0;const l=[];for(let o=0;o<n;++o)if(-1===s[o]){for(s[o]=f,l.push(o);l.length>0;){const n=3*l.pop();for(let o=0;o<3;++o){const r=t[n+o];if(c[r]===f)continue;c[r]=f;const i=e[r];for(let t=0;t<i.length;++t){const n=i[t];-1===s[n]&&(s[n]=f,l.push(n))}}}f++}return[s,f]}function o(t,n,o){const r=new Array;for(let e=0;e<o;++e)r[e]=[];for(let e=0;e<n;++e)r[t[3*e]].push(e),r[t[3*e+1]].push(e),r[t[3*e+2]].push(e);return r}export{t as computeNeighbors,n as computeVertexConnectedTriangleComponents};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{MemCachePool as i}from"../../../core/MemCachePool.js";import r from"../../../core/ObjectPool.js";import{watch as s,sync as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../../core/accessorSupport/decorators.js";import{subtract as o,set as c,dot as d}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as h,fromValues as u,create as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as g,ZEROS as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as p,set as m}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as y}from"../../../geometry/support/buffer/BufferView.js";import{overlayRenderOccludedFlag as b}from"./OverlayRenderer.js";import{PatchRenderData as x}from"./PatchRenderData.js";import{TerrainAttributesCache as T}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as R}from"./terrainUtils.js";import{TileRenderer as v}from"./TileRenderer.js";import{IteratorPreorder as P,fallsWithinLayerView as w,sortTiles as O,compareTiles as S}from"./tileUtils.js";import{getOverlayContentForOutputTerrain as D}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as B}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as E}from"../webgl-engine/lib/Attribute.js";import{IntersectorResult as F}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as j,MeshIntersectionOptions as q,intersectTriangles as C}from"../webgl-engine/lib/RayIntersections.js";import{TriangleIntersectionData as A}from"../webgl-engine/lib/TriangleIntersectionData.js";import{terrainId as M,getVerticalOffsetTerrain as G}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as I}from"../webgl-engine/materials/DrawParameters.js";import{hasShadowHighlights as U}from"../webgl-engine/shaders/ReceiveShadowsConfiguration.js";import{a as k}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as N}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as L}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as V}from"../../webgl/enums.js";const H=7,z=10,Q=200,W=p();let Z=class extends B{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return 1===this._stage.viewingMode}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}get renderOccludedFlags(){return this._overlayRenderer.renderOccludedFlags}constructor(e,t,s,n,a){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=s,this._compressionTracker=n,this.type=7,this.isGround=!0,this._passParameters=new k,this._drawParameters=new I,this._renderDataPool=new r(()=>new x),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new P,this._castShadows=!1,this._inViewshed=!1,this._cutFillEnabled=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.produces=new Map([[1,()=>1===this._desiredSlot],[7,()=>7===this._desiredSlot],[9,()=>this._produces()&&this.renderOccludedFlags===b]]),this._tileSize=256,this._configuration=new L(1===t.viewingMode),this._tileTextureCache=new i((e,t)=>a.newCache(e,t),"TileTexture"),this.tileGeometryCache=new T(a)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(s(()=>this._overlayRenderer.renderOccludedFlags,()=>this.setNeedsRender(),n))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setDirty()}set visible(e){this._set("visible",!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get layerViewUid(){return M}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,null!=this._tileRenderer&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,32)}reuseTextureFromParent(e){const{parent:t}=e;if(!this._canReuseTextureFromParent(t,e))return!1;const i=g(1&e.lij[2]?.5:0,1&e.lij[1]?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,i)??!1}_canReuseTextureFromParent(e,t){if(!e)return!1;const{layerInfo:i,surface:r}=t;for(let s=0;s<i[1].length;s++){const i=r.layerViewByIndex(s,1);if(w(e,i)!==w(t,i))return!1}return!0}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,32===t?0:2),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const i of e.layerInfo[0])i.pendingUpdates&=-9;e.resetPendingUpdate(8);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=z-H,i=Math.max(0,Math.floor((e.level-t)/H)*H);if(this._isGlobal&&0===i)return h;for(;e.parent&&e.level>i;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new v(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=t(this._tileRenderer)}intersect(e,t,i,r){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&0!==this.transparency)return;const s=J,n=K;o(s,r,i),c(n,1/s[0],1/s[1],1/s[2]);const a=e.results.min,l=e.results.max,h=e.results.ground,u=0===e.options.store,_=!!e.results.ground.target,g=G(e.verticalOffset),f=e.tolerance;let p,b=u&&null!=a.distance?a.distance:1/0;const x=e.options,T=x.normalRequired||!x.backfacesTerrain,R=new q(f,!1,T),v=c=>{const _=c.renderData;if(!_?.vao)return;const v=_.geometry;m(W,v.boundingBox);const P=_.localOrigin;null!=g&&(g.localOrigin=P,g.applyToAabb(W));const w=W;if(X[0]=i[0]-P[0],X[1]=i[1]-P[1],X[2]=i[2]-P[2],!j(w,X,n,f,b))return;const O=(e,t,i)=>{e.set(this.type,c,t,i),b=u&&null!=a.distance?a.distance:1/0},S=(n,o,c)=>{if((!T||null!=o)&&n>=0&&(x.backfacesTerrain||d(o,s)<0)&&(x.invisibleTerrain||!x.selectionMode||null==t||t(i,r,n))){if((null==h.distance||n<h.distance)&&O(h,n,o),x.isFiltered)return;2===x.store&&(null==p?(p=new F(e.ray),O(p,n,o),e.results.all.push(p)):n<p.distance&&O(p,n,o)),(null==a.distance||n<a.distance)&&O(a,n,o),0!==x.store&&(null==l.distance||n>l.distance)&&O(l,n,o)}},D=Y;o(D,r,P);const{indices:B,indexCount:q}=v,M=v.vertexAttributes,G=M.getField("position",y),I=new E(G.typedBuffer,3,M.stride/4),U=q/3;if(!g&&U>Q){const e=c.renderData;e.intersectionData??=new A(B,U,I),e.intersectionData.intersectRay(X,D,R,S)}else C(X,D,0,U,B,I,g,R,S)},P=this._rootTiles;if(null!=P){(()=>{const t=this._tileIterator;t.reset(P);const r=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||r&&e.intersectsClippingArea)||null==g&&!e.intersectsRay(i,s,f,b)||_&&this._useStencilForTile(e)?t.skipSubtree():v(e)})()}}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._visiblePatchesByOrigin.values())for(const i of t)null!=i.renderData?.textureReference&&e.queriesForTile(i);e.process(),t.madeProgress()}}get _desiredSlot(){if(!this._produces())return null;switch(this.transparency){case 0:return 1;case 1:case 2:return 7;case 3:case 4:return null}}acquireTechniques(e){const{shadowMap:t,viewshedEnabled:i,cutFillComputationEnabled:r,slot:s,hasEmission:n,useFloatBlend:a}=e.bind,l=!!has("enable-feature:terrain-shadows")&&t.enabled;if(l!==this._castShadows&&(this._castShadows=l,this._patchesByOriginDirty=!0),this._inViewshed!==i&&(this._inViewshed=i,this._patchesByOriginDirty=!0),this._cutFillEnabled!==r&&(this._cutFillEnabled=r,this._patchesByOriginDirty=!0),3===this.transparency)return null;if(9===s){if(0===(e.renderOccludedMask&b))return null}else if(s!==this._desiredSlot)return null;const o=this._configuration;switch(o.screenSpaceReflections=o.cloudReflections=o.receiveShadows=o.hasShadowHighlights=o.receiveAmbientOcclusion=o.renderOccluded=o.hasHighlightMixTexture=o.hasEmission=!1,o.overlayMode=this._overlayRenderer.mode,o.useFloatBlend=a.value,e.output){case 0:case 1:case 2:{const i=e.bind;o.screenSpaceReflections=i.hasScreenSpaceReflections,o.cloudReflections=null!=i.clouds.data;const r=9===s;return o.receiveShadows=t.ready&&!r,o.hasShadowHighlights=U(o,e.bind),o.renderOccluded=r,o.receiveAmbientOcclusion=!r&&null!=i.ssao,o.receiveGlobalIllumination=!r&&i.globalIlluminationEnabled,o.hasEmission=n,this._acquireTechnique(e.output)}case 5:case 7:return this._castShadows?this._acquireTechnique(5):null;case 8:return this._inViewshed?this._acquireTechnique(8):null;case 9:return this._cutFillEnabled?this._acquireTechnique(9):null;case 3:case 4:return this._acquireTechnique(e.output);case 11:return this._acquireTechnique(11);case 10:return o.hasHighlightMixTexture=null!=e.bind.highlightMixTexture,this._overlayRenderer.hasHighlights?this._acquireTechnique(10):null}return null}render(e,t){switch(this._updatePatchGroups(),t.useStencil=!1,this._passParameters.overlayContent=D(e.output,e.bind),e.output){case 0:case 1:case 2:return this._renderMaterialPass(e,t);case 3:case 4:case 11:return this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);case 10:{const i=e.bind.highlight?.name;i&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(i)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 5:case 7:case 8:case 9:return this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const t=this._tileRenderer;let i;if(null!=e){const t=e.toUnitRGBA();i=u(t[0]||0,t[1]||0,t[2]||0)}t.setBackground(i),this._allTiles.forAll(e=>t.updateTileTexture(e,0)),this._configuration.tileBlendInput=t.backgroundIsGrid?2:null!=t.backgroundColor?1:0,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const i of e)O(i,t);e.sort((e,t)=>S(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this.notifyChange("visibleTiles"),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),i=e.renderData;if(!i){this._numTilesCulled++;continue}const r=i.localOrigin;if(this._castShadows||this._inViewshed||this._cutFillEnabled){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let s=this._visiblePatchesByOrigin.get(r);s||(s=[],this._visiblePatchesByOrigin.set(r,s)),s.push(e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,i){const{rctx:r,bind:s}=e;r.bindTechnique(t,s,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;i.forEach(i=>{this._drawParameters.origin=i[0].renderData.localOrigin,t.program.bindDraw(s,this._passParameters,this._drawParameters);for(let r=0;r<i.length;r++)this._renderPatch(e,t,i[r],V.TRIANGLES,n,null===this._passParameters.overlayContent)}),r.bindVAO(null)}_renderMaterialPass(e,t){const{rctx:i,bind:r}=e,s=i.bindTechnique(t,r,this._passParameters);this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const n=9===r.slot;n&&(s.bindTexture("tex",i.emptyTexture),s.setUniform3fv("textureOpacities",h),s.setUniform4fv("texOffsetAndScale",f));const a=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:h;1===this._configuration.tileBlendInput&&s.setUniform3fv("backgroundColor",a);const l=this._stencilEnabledLayerExtents.length>0,o=this.wireframe?V.LINES:V.TRIANGLES;this._configuration.textureFadingEnabled&&s.bindTexture("texNext",i.emptyTexture);const c=this._visiblePatchesByOrigin;for(const d of c.values()){const i=d[0].renderData.localOrigin;this._drawParameters.origin=i,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const r of d){const i=r.renderData,a=i.textureReference;if(null!=a){if(!n){s.setUniform4fv("texOffsetAndScale",a.offsetAndScale),s.bindTexture("tex",a.texture.texture);const e=i.textureFadeFactor,t=e<1?i.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(s.setUniform1f("fadeFactor",e),s.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),s.setUniform3fv("nextTexOpacities",t.opacities),s.bindTexture("texNext",t.texture.texture)):s.setUniform1f("fadeFactor",1),i.textureIsFading&&this.setNeedsRender(2),s.setUniform3fv("textureOpacities",a.opacities)}this._renderPatch(e,t,r,o,l),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}i.bindVAO(null)}_renderPatch(e,t,i,r,s,n=!1){const a=i.renderData,l=a.vao,o=l?.indexBuffer;if(!l||null==o)return void(R&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const c=t.program;n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(c,a.overlay);const{rctx:d,bind:h}=e;s&&(t.useStencil=this._useStencilForTile(i),d.setPipelineState(t.getPipeline(h)));const u=a.geometry.indexCount;d.bindVAO(l),c.assertCompatibleVertexAttributeLocations(l),d.drawElements(r,u,o.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(N,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([a({readOnly:!0})],Z.prototype,"visibleTiles",null),e([a({readOnly:!0})],Z.prototype,"_isGlobal",null),e([a()],Z.prototype,"renderOccludedFlags",null),e([a({value:!1})],Z.prototype,"renderingDisabled",null),e([a({value:!0})],Z.prototype,"visible",null),e([a()],Z.prototype,"renderPatchBorders",null),e([a()],Z.prototype,"wireframe",null),Z=e([l("esri.views.3d.terrain.TerrainRenderer")],Z);const J=_(),K=_(),X=_(),Y=_();export{Z as TerrainRenderer};
2
+ import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{MemCachePool as i}from"../../../core/MemCachePool.js";import r from"../../../core/ObjectPool.js";import{watch as s,sync as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../../core/accessorSupport/decorators.js";import{subtract as o,set as c,dot as h}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as d,fromValues as u,create as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as g,ZEROS as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as p,set as m}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as y}from"../../../geometry/support/buffer/BufferView.js";import{overlayRenderOccludedFlag as b}from"./OverlayRenderer.js";import{PatchRenderData as x}from"./PatchRenderData.js";import{TerrainAttributesCache as T}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as R}from"./terrainUtils.js";import{TileRenderer as v}from"./TileRenderer.js";import{IteratorPreorder as P,fallsWithinLayerView as w,sortTiles as O,compareTiles as S}from"./tileUtils.js";import{getOverlayContentForOutputTerrain as D}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as B}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as E}from"../webgl-engine/lib/Attribute.js";import{IntersectorResult as F}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as j,MeshIntersectionOptions as q,intersectTriangles as C}from"../webgl-engine/lib/RayIntersections.js";import{TriangleIntersectionData as A}from"../webgl-engine/lib/TriangleIntersectionData.js";import{terrainId as M,getVerticalOffsetTerrain as G}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as I}from"../webgl-engine/materials/DrawParameters.js";import{hasShadowHighlights as U}from"../webgl-engine/shaders/ReceiveShadowsConfiguration.js";import{a as k}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as N}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as L}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as V}from"../../webgl/enums.js";const H=7,z=10,Q=200,W=p();let Z=class extends B{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return 1===this._stage.viewingMode}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}get renderOccludedFlags(){return this._overlayRenderer.renderOccludedFlags}constructor(e,t,s,n,a){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=s,this._compressionTracker=n,this.type=7,this.isGround=!0,this._passParameters=new k,this._drawParameters=new I,this._renderDataPool=new r(()=>new x),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new P,this._castShadows=!1,this._inViewshed=!1,this._cutFillEnabled=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.produces=new Map([[1,()=>1===this._desiredSlot],[7,()=>7===this._desiredSlot],[9,()=>this._produces()&&this.renderOccludedFlags===b]]),this._tileSize=256,this._configuration=new L(1===t.viewingMode),this._tileTextureCache=new i((e,t)=>a.newCache(e,t),"TileTexture"),this.tileGeometryCache=new T(a)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(s(()=>this._overlayRenderer.renderOccludedFlags,()=>this.setNeedsRender(),n))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setDirty()}set visible(e){this._set("visible",!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get layerViewUid(){return M}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,null!=this._tileRenderer&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,32)}reuseTextureFromParent(e){const{parent:t}=e;if(!this._canReuseTextureFromParent(t,e))return!1;const i=g(1&e.lij[2]?.5:0,1&e.lij[1]?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,i)??!1}_canReuseTextureFromParent(e,t){if(!e)return!1;const{layerInfo:i,surface:r}=t;for(let s=0;s<i[1].length;s++){const i=r.layerViewByIndex(s,1);if(w(e,i)!==w(t,i))return!1}return!0}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,32===t?0:2),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const i of e.layerInfo[0])i.pendingUpdates&=-9;e.resetPendingUpdate(8);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=z-H,i=Math.max(0,Math.floor((e.level-t)/H)*H);if(this._isGlobal&&0===i)return d;for(;e.parent&&e.level>i;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new v(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=t(this._tileRenderer)}intersect(e,t,i,r){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&0!==this.transparency)return;const s=J,n=K;o(s,r,i),c(n,1/s[0],1/s[1],1/s[2]);const a=e.results.min,l=e.results.max,d=e.results.ground,u=0===e.options.store,_=!!e.results.ground.target,g=G(e.verticalOffset),f=e.tolerance;let p,b=u&&null!=a.distance?a.distance:1/0;const x=e.options,T=x.normalRequired||!x.backfacesTerrain,R=new q(f,!1,T),v=c=>{const _=c.renderData;if(!_?.vao)return;const v=_.geometry;m(W,v.boundingBox);const P=_.localOrigin;null!=g&&(g.localOrigin=P,g.applyToAabb(W));const w=W;if(X[0]=i[0]-P[0],X[1]=i[1]-P[1],X[2]=i[2]-P[2],!j(w,X,n,f,b))return;const O=(e,t,i)=>{e.set(this.type,c,t,i),b=u&&null!=a.distance?a.distance:1/0},S=(n,o,c)=>{if((!T||null!=o)&&n>=0&&(x.backfacesTerrain||h(o,s)<0)&&(x.invisibleTerrain||!x.selectionMode||null==t||t(i,r,n))){if((null==d.distance||n<d.distance)&&O(d,n,o),x.isFiltered)return;2===x.store&&(null==p?(p=new F(e.ray),O(p,n,o),e.results.all.push(p)):n<p.distance&&O(p,n,o)),(null==a.distance||n<a.distance)&&O(a,n,o),0!==x.store&&(null==l.distance||n>l.distance)&&O(l,n,o)}},D=Y;o(D,r,P);const{indices:B,indexCount:q}=v,M=v.vertexAttributes,G=M.getField("position",y),I=new E(G.typedBuffer,3,M.stride/4),U=q/3;if(!g&&U>Q){const e=c.renderData;e.intersectionData??=new A(B,U,I),e.intersectionData.intersectRay(X,D,R,S)}else C(X,D,0,U,B,I,g,R,S)},P=this._rootTiles;if(null!=P){(()=>{const t=this._tileIterator;t.reset(P);const r=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||r&&e.intersectsClippingArea)||null==g&&!e.intersectsRay(i,s,f,b)||_&&this._useStencilForTile(e)?t.skipSubtree():v(e)})()}}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._visiblePatchesByOrigin.values())for(const i of t)null!=i.renderData?.textureReference&&e.queriesForTile(i);e.process(),t.madeProgress()}}get _desiredSlot(){if(!this._produces())return null;switch(this.transparency){case 0:return 1;case 1:case 2:return 7;case 3:case 4:return null}}acquireTechniques(e){const{shadowMap:t,viewshedEnabled:i,cutFillComputationEnabled:r,slot:s,hasEmission:n,useFloatBlend:a}=e.bind,l=!!has("enable-feature:terrain-shadows")&&t.enabled;if(l!==this._castShadows&&(this._castShadows=l,this._patchesByOriginDirty=!0),this._inViewshed!==i&&(this._inViewshed=i,this._patchesByOriginDirty=!0),this._cutFillEnabled!==r&&(this._cutFillEnabled=r,this._patchesByOriginDirty=!0),3===this.transparency)return null;if(9===s){if(0===(e.renderOccludedMask&b))return null}else if(s!==this._desiredSlot)return null;const o=this._configuration;switch(o.screenSpaceReflections=o.cloudReflections=o.receiveShadows=o.hasShadowHighlights=o.receiveAmbientOcclusion=o.renderOccluded=o.hasHighlightMixTexture=o.hasEmission=!1,o.overlayMode=this._overlayRenderer.mode,o.useFloatBlend=a.value,e.output){case 0:case 1:case 2:{const i=e.bind;o.screenSpaceReflections=i.hasScreenSpaceReflections,o.cloudReflections=null!=i.clouds.data;const r=9===s;return o.receiveShadows=t.ready&&!r,o.hasShadowHighlights=U(o,e.bind),o.renderOccluded=r,o.receiveAmbientOcclusion=!r&&null!=i.ssao,o.receiveGlobalIllumination=!r&&i.globalIlluminationEnabled,o.hasEmission=n,this._acquireTechnique(e.output)}case 5:case 7:return this._castShadows?this._acquireTechnique(5):null;case 8:return this._inViewshed?this._acquireTechnique(8):null;case 9:return this._cutFillEnabled?this._acquireTechnique(9):null;case 3:case 4:return this._acquireTechnique(e.output);case 11:return this._acquireTechnique(11);case 10:return o.hasHighlightMixTexture=null!=e.bind.highlightMixTexture,this._overlayRenderer.hasHighlights?this._acquireTechnique(10):null}return null}render(e,t){switch(this._updatePatchGroups(),this._passParameters.useStencil=!1,this._passParameters.overlayContent=D(e.output,e.bind),e.output){case 0:case 1:case 2:return this._renderMaterialPass(e,t);case 3:case 4:case 11:return this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);case 10:{const i=e.bind.highlight?.name;i&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(i)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 5:case 7:case 8:case 9:return this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const t=this._tileRenderer;let i;if(null!=e){const t=e.toUnitRGBA();i=u(t[0]||0,t[1]||0,t[2]||0)}t.setBackground(i),this._allTiles.forAll(e=>t.updateTileTexture(e,0)),this._configuration.tileBlendInput=t.backgroundIsGrid?2:null!=t.backgroundColor?1:0,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const i of e)O(i,t);e.sort((e,t)=>S(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this.notifyChange("visibleTiles"),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),i=e.renderData;if(!i){this._numTilesCulled++;continue}const r=i.localOrigin;if(this._castShadows||this._inViewshed||this._cutFillEnabled){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let s=this._visiblePatchesByOrigin.get(r);s||(s=[],this._visiblePatchesByOrigin.set(r,s)),s.push(e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,i){const{rctx:r,bind:s}=e;r.bindTechnique(t,s,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;i.forEach(i=>{this._drawParameters.origin=i[0].renderData.localOrigin,t.program.bindDraw(s,this._passParameters,this._drawParameters);for(let r=0;r<i.length;r++)this._renderPatch(e,t,i[r],V.TRIANGLES,n,null===this._passParameters.overlayContent)}),r.bindVAO(null)}_renderMaterialPass(e,t){const{rctx:i,bind:r}=e,s=i.bindTechnique(t,r,this._passParameters);this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const n=9===r.slot;n&&(s.bindTexture("tex",i.emptyTexture),s.setUniform3fv("textureOpacities",d),s.setUniform4fv("texOffsetAndScale",f));const a=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:d;1===this._configuration.tileBlendInput&&s.setUniform3fv("backgroundColor",a);const l=this._stencilEnabledLayerExtents.length>0,o=this.wireframe?V.LINES:V.TRIANGLES;this._configuration.textureFadingEnabled&&s.bindTexture("texNext",i.emptyTexture);const c=this._visiblePatchesByOrigin;for(const h of c.values()){const i=h[0].renderData.localOrigin;this._drawParameters.origin=i,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const r of h){const i=r.renderData,a=i.textureReference;if(null!=a){if(!n){s.setUniform4fv("texOffsetAndScale",a.offsetAndScale),s.bindTexture("tex",a.texture.texture);const e=i.textureFadeFactor,t=e<1?i.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(s.setUniform1f("fadeFactor",e),s.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),s.setUniform3fv("nextTexOpacities",t.opacities),s.bindTexture("texNext",t.texture.texture)):s.setUniform1f("fadeFactor",1),i.textureIsFading&&this.setNeedsRender(2),s.setUniform3fv("textureOpacities",a.opacities)}this._renderPatch(e,t,r,o,l),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}i.bindVAO(null)}_renderPatch(e,t,i,r,s,n=!1){const a=i.renderData,l=a.vao,o=l?.indexBuffer;if(!l||null==o)return void(R&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const c=t.program;n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(c,a.overlay);const{rctx:h,bind:d}=e;s&&(this._passParameters.useStencil=this._useStencilForTile(i),h.setPipelineState(t.getPipeline(d,this._passParameters)));const u=a.geometry.indexCount;h.bindVAO(l),c.assertCompatibleVertexAttributeLocations(l),h.drawElements(r,u,o.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(N,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([a({readOnly:!0})],Z.prototype,"visibleTiles",null),e([a({readOnly:!0})],Z.prototype,"_isGlobal",null),e([a()],Z.prototype,"renderOccludedFlags",null),e([a({value:!1})],Z.prototype,"renderingDisabled",null),e([a({value:!0})],Z.prototype,"visible",null),e([a()],Z.prototype,"renderPatchBorders",null),e([a()],Z.prototype,"wireframe",null),Z=e([l("esri.views.3d.terrain.TerrainRenderer")],Z);const J=_(),K=_(),X=_(),Y=_();export{Z as TerrainRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../core/Logger.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{ZEROS as r}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{VectorTileRendererHelper3D as i}from"../../2d/engine/vectorTiles/VectorTileRendererHelper3D.js";import{BlendLayersTechnique as s}from"./BlendLayersTechnique.js";import{BlendLayersTechniqueConfiguration as n}from"./BlendLayersTechniqueConfiguration.js";import{RasterColorizerTechnique as o}from"./RasterColorizerTechnique.js";import{RasterColorizerTechniqueConfiguration as a}from"./RasterColorizerTechniqueConfiguration.js";import{MultiSizeFramebuffer as h}from"./support/MultiSizeFramebuffer.js";import{BindParameters as c}from"../webgl-engine/lib/BindParameters.js";import{createQuadVAO as l}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as u}from"../../webgl/enums.js";import d from"../../webgl/Texture.js";const _=()=>e.getLogger("esri.views.3d.terrain");class f{constructor(e,t){this._rctx=e,this._techniques=t,this._fbos=[],this._vectorTileHelper=new i,this._blendConfiguration=new n,this._current=0,this._lastUsedIds=new Array,this._lastCreatedBufferId=0,this._onHoldIds=new Array,this._vao=l(this._rctx,1),this._bindParameters=new c(e,null)}dispose(){this._bindParameters.destroy(),this._fbos.forEach(t),this._fbos=null,this._vtFBO=t(this._vtFBO),this._vao=t(this._vao),this._vectorTileHelper=t(this._vectorTileHelper)}updateHeading(e){this._vectorTileHelper?.updateHeading(e)}_acquireBlendTechnique(e,t,r,i=!1,n=0){return this._blendConfiguration.output=t,this._blendConfiguration.blendMode=e,this._blendConfiguration.applyBaseOpacity=r,this._blendConfiguration.premultipliedAlphaSource=i,this._blendConfiguration.background=n,this._techniques.precompile(s,this._blendConfiguration),this._techniques.get(s,this._blendConfiguration)}drawBackground(e,t){const r=this._acquireBlendTechnique(0,t?2:3,!1,!1,1),i=this._rctx.bindTechnique(r,this._bindParameters,e);this._render(i)}_render(e){this._rctx.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),this._rctx.drawArrays(u.TRIANGLE_STRIP,0,this._vao.vertexCount("geometry"))}drawGroup(e,t,r,i,s=!0){1===t&&(e.fboTexture=this._fbos[this.getLastOnHoldId()].get(r).colorTexture??this._rctx.emptyTexture),e.texture=this.currentFBO(r).colorTexture,this.closeGroup(r);const n=e.baseOpacity<1,o=this._acquireBlendTechnique(i,t,n,s),a=this._rctx.bindTechnique(o,this._bindParameters,e);this._render(a)}drawImageData(e,t,r,i,s=!1){if(null==e.texture)return;const n=e.baseOpacity<1;e.fboTexture=(4===t||0===i&&!n&&!s?null:this.switch(r).colorTexture)??this._rctx.emptyTexture;const o=this._acquireBlendTechnique(i,t,n,s),a=this._rctx.bindTechnique(o,this._bindParameters,e);this._render(a)}drawRasterData(e,t,r,i,s){const n=s.sourceLayerInfo.data;if(!n.source)return;if(s.tile.surface.layerViewByIndex(s.layerIndex,1).ensureSymbolizerParameters(n),!n.bind(this._rctx))return;const o=e.baseOpacity<1;e.fboTexture=(0!==i||o?this.switch(r).colorTexture:null)??this._rctx.emptyTexture;const a=this._acquireRasterTechnique(n,t,i,o);if(!a)return;n.opacity=e.opacity;const h=n.getUniforms(this._rctx);h.scale=s.scale,h.offset=s.offset,h.backgroundColor=e.backgroundColor,h.fboTexture=e.fboTexture,h.baseOpacity=e.baseOpacity;const c=this._rctx.bindTechnique(a,this._bindParameters,h);this._render(c)}_acquireRasterTechnique(e,t,r,i){if(!this._rctx.capabilities.colorBufferFloat)return null;const s=e.symbolizerParameters,n=["stretch","lut","hillshade"].indexOf(s.type);return this._rasterConfiguration??=new a,this._rasterConfiguration.output=t,this._rasterConfiguration.blendMode=r,this._rasterConfiguration.applyBaseOpacity=i,this._rasterConfiguration.colorizerType=n,this._rasterConfiguration.applyColormap=!!s.colormap,this._rasterConfiguration.requireBilinearWithNN=e.isBilinearWithStretchColorRamp,this._rasterConfiguration.stretchType=e.hasStretchTypeNone()?0:1,this._techniques.precompile(o,this._rasterConfiguration),this._techniques.get(o,this._rasterConfiguration)}drawVectorData(e,t,i,s,n,o,a,c){const l=this._rctx,u=n.sourceLayerInfo.data,d=n.tile.surface.layerViewByIndex(n.layerIndex,1),f=e.baseOpacity<1,p=f||e.opacity<1||0!==s||1!==t,b=p,m=this._acquireBlendTechnique(s,t,f,b);l.setPipelineState(m.getPipeline(this._bindParameters));let g=null,x=null;p?(x=this.currentFBO(i),null==this._vtFBO&&(this._vtFBO=new h(this._rctx)),g=this._vtFBO.get(i),l.bindFramebuffer(g),this._clearCurrentFBO()):c&&l.clear(256);try{this._vectorTileHelper.renderBackground(l,n.sourceLod,d.painter,d.layer.styleRepository,d.schemaHelper,Math.round(1/n.scale),n.offset,a,o,d.contentZoom),u&&this._vectorTileHelper.renderContent(l,n.sourceLod,u,n.vtlNeighborInfos,d.painter,d.layer.styleRepository,d.schemaHelper,Math.round(1/n.scale),n.offset,a,o,d.contentZoom)}catch(T){_().warnOnce("A render call containing vector tiles did not resolve correctly.",T)}return!g||(l.bindFramebuffer(x),e.texture=g.colorTexture,e.offset=r,e.scale=1,this.drawImageData(e,t,i,s,b),c)}copyFBOToTexture(e){const t=this._rctx,r=t.bindTexture(e.texture,d.TEXTURE_UNIT_FOR_UPDATES),i=e.descriptor;t.gl.copyTexImage2D(3553,0,i.pixelFormat,0,0,i.width,i.height,0),e.generateMipmap(),t.bindTexture(r,d.TEXTURE_UNIT_FOR_UPDATES)}_clearCurrentFBO(){this._rctx.setStencilWriteMask(255),this._rctx.setClearColor(0,0,0,0),this._rctx.setClearDepth(1),this._rctx.setClearStencil(0),this._rctx.clear(17664)}_initFBO(e,t,r){this._rctx.bindFramebuffer(e),r&&(this._rctx.setViewport(0,0,t,t),this._clearCurrentFBO())}ensureBuffer(e){this._lastUsedIds.length=0,this._lastUsedIds.push(1),this._lastCreatedBufferId=1,this._onHoldIds.length=0,this.bind(e)}bind(e,t=0,r=!0){if(this._current=t,t>=this._fbos.length)for(let i=this._fbos.length;i<=t;i++)this._fbos.push(new h(this._rctx));this._initFBO(this._fbos[t].get(e),e,r)}_bindNextFreeBuffer(e){this._lastUsedIds.length>0?this.bind(e,this._lastUsedIds.pop()):(this._lastCreatedBufferId++,this.bind(e,this._lastCreatedBufferId))}openGroup(e){this._onHoldIds.push(this._current),this._bindNextFreeBuffer(e)}switch(e){const t=this.currentFBO(e),r=this._current;return this._bindNextFreeBuffer(e),this._lastUsedIds.push(r),t}getLastOnHoldId(){return this._onHoldIds[this._onHoldIds.length-1]}closeGroup(e){const t=this._current;this._bindNextFreeBuffer(e),this._lastUsedIds.push(t),this._lastUsedIds.push(this._onHoldIds.pop())}unbind(){this._rctx.bindFramebuffer(null)}currentFBO(e){return this._fbos[this._current].get(e)}}export{f as TileCompositor};
2
+ import e from"../../../core/Logger.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{ZEROS as r}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{VectorTileRendererHelper3D as i}from"../../2d/engine/vectorTiles/VectorTileRendererHelper3D.js";import{BlendLayersTechnique as s}from"./BlendLayersTechnique.js";import{BlendLayersTechniqueConfiguration as n}from"./BlendLayersTechniqueConfiguration.js";import{RasterColorizerTechnique as o}from"./RasterColorizerTechnique.js";import{RasterColorizerTechniqueConfiguration as a}from"./RasterColorizerTechniqueConfiguration.js";import{MultiSizeFramebuffer as h}from"./support/MultiSizeFramebuffer.js";import{BindParameters as c}from"../webgl-engine/lib/BindParameters.js";import{createQuadVAO as l}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as u}from"../../webgl/enums.js";import d from"../../webgl/Texture.js";const _=()=>e.getLogger("esri.views.3d.terrain");class f{constructor(e,t){this._rctx=e,this._techniques=t,this._fbos=[],this._vectorTileHelper=new i,this._blendConfiguration=new n,this._current=0,this._lastUsedIds=new Array,this._lastCreatedBufferId=0,this._onHoldIds=new Array,this._vao=l(this._rctx,1),this._bindParameters=new c(e,null)}dispose(){this._bindParameters.destroy(),this._fbos.forEach(t),this._fbos=null,this._vtFBO=t(this._vtFBO),this._vao=t(this._vao),this._vectorTileHelper=t(this._vectorTileHelper)}updateHeading(e){this._vectorTileHelper?.updateHeading(e)}_acquireBlendTechnique(e,t,r,i=!1,n=0){return this._blendConfiguration.output=t,this._blendConfiguration.blendMode=e,this._blendConfiguration.applyBaseOpacity=r,this._blendConfiguration.premultipliedAlphaSource=i,this._blendConfiguration.background=n,this._techniques.precompile(s,this._blendConfiguration),this._techniques.get(s,this._blendConfiguration)}drawBackground(e,t){const r=this._acquireBlendTechnique(0,t?2:3,!1,!1,1),i=this._rctx.bindTechnique(r,this._bindParameters,e);this._render(i)}_render(e){this._rctx.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),this._rctx.drawArrays(u.TRIANGLE_STRIP,0,this._vao.vertexCount("geometry"))}drawGroup(e,t,r,i,s=!0){1===t&&(e.fboTexture=this._fbos[this.getLastOnHoldId()].get(r).colorTexture??this._rctx.emptyTexture),e.texture=this.currentFBO(r).colorTexture,this.closeGroup(r);const n=e.baseOpacity<1,o=this._acquireBlendTechnique(i,t,n,s),a=this._rctx.bindTechnique(o,this._bindParameters,e);this._render(a)}drawImageData(e,t,r,i,s=!1){if(null==e.texture)return;const n=e.baseOpacity<1;e.fboTexture=(4===t||0===i&&!n&&!s?null:this.switch(r).colorTexture)??this._rctx.emptyTexture;const o=this._acquireBlendTechnique(i,t,n,s),a=this._rctx.bindTechnique(o,this._bindParameters,e);this._render(a)}drawRasterData(e,t,r,i,s){const n=s.sourceLayerInfo.data;if(!n.source)return;if(s.tile.surface.layerViewByIndex(s.layerIndex,1).ensureSymbolizerParameters(n),!n.bind(this._rctx))return;const o=e.baseOpacity<1;e.fboTexture=(0!==i||o?this.switch(r).colorTexture:null)??this._rctx.emptyTexture;const a=this._acquireRasterTechnique(n,t,i,o);if(!a)return;n.opacity=e.opacity;const h=n.getUniforms(this._rctx);h.scale=s.scale,h.offset=s.offset,h.backgroundColor=e.backgroundColor,h.fboTexture=e.fboTexture,h.baseOpacity=e.baseOpacity;const c=this._rctx.bindTechnique(a,this._bindParameters,h);this._render(c)}_acquireRasterTechnique(e,t,r,i){if(!this._rctx.capabilities.colorBufferFloat)return null;const s=e.symbolizerParameters,n=["stretch","lut","hillshade"].indexOf(s.type);return this._rasterConfiguration??=new a,this._rasterConfiguration.output=t,this._rasterConfiguration.blendMode=r,this._rasterConfiguration.applyBaseOpacity=i,this._rasterConfiguration.colorizerType=n,this._rasterConfiguration.applyColormap=!!s.colormap,this._rasterConfiguration.requireBilinearWithNN=e.isBilinearWithStretchColorRamp,this._rasterConfiguration.stretchType=e.hasStretchTypeNone()?0:1,this._techniques.precompile(o,this._rasterConfiguration),this._techniques.get(o,this._rasterConfiguration)}drawVectorData(e,t,i,s,n,o,a,c){const l=this._rctx,u=n.sourceLayerInfo.data,d=n.tile.surface.layerViewByIndex(n.layerIndex,1),f=e.baseOpacity<1,p=f||e.opacity<1||0!==s||1!==t,b=p,m=this._acquireBlendTechnique(s,t,f,b);l.setPipelineState(m.getPipeline(this._bindParameters,e));let g=null,x=null;p?(x=this.currentFBO(i),null==this._vtFBO&&(this._vtFBO=new h(this._rctx)),g=this._vtFBO.get(i),l.bindFramebuffer(g),this._clearCurrentFBO()):c&&l.clear(256);try{this._vectorTileHelper.renderBackground(l,n.sourceLod,d.painter,d.layer.styleRepository,d.schemaHelper,Math.round(1/n.scale),n.offset,a,o,d.contentZoom),u&&this._vectorTileHelper.renderContent(l,n.sourceLod,u,n.vtlNeighborInfos,d.painter,d.layer.styleRepository,d.schemaHelper,Math.round(1/n.scale),n.offset,a,o,d.contentZoom)}catch(T){_().warnOnce("A render call containing vector tiles did not resolve correctly.",T)}return!g||(l.bindFramebuffer(x),e.texture=g.colorTexture,e.offset=r,e.scale=1,this.drawImageData(e,t,i,s,b),c)}copyFBOToTexture(e){const t=this._rctx,r=t.bindTexture(e.texture,d.TEXTURE_UNIT_FOR_UPDATES),i=e.descriptor;t.gl.copyTexImage2D(3553,0,i.pixelFormat,0,0,i.width,i.height,0),e.generateMipmap(),t.bindTexture(r,d.TEXTURE_UNIT_FOR_UPDATES)}_clearCurrentFBO(){this._rctx.setStencilWriteMask(255),this._rctx.setClearColor(0,0,0,0),this._rctx.setClearDepth(1),this._rctx.setClearStencil(0),this._rctx.clear(17664)}_initFBO(e,t,r){this._rctx.bindFramebuffer(e),r&&(this._rctx.setViewport(0,0,t,t),this._clearCurrentFBO())}ensureBuffer(e){this._lastUsedIds.length=0,this._lastUsedIds.push(1),this._lastCreatedBufferId=1,this._onHoldIds.length=0,this.bind(e)}bind(e,t=0,r=!0){if(this._current=t,t>=this._fbos.length)for(let i=this._fbos.length;i<=t;i++)this._fbos.push(new h(this._rctx));this._initFBO(this._fbos[t].get(e),e,r)}_bindNextFreeBuffer(e){this._lastUsedIds.length>0?this.bind(e,this._lastUsedIds.pop()):(this._lastCreatedBufferId++,this.bind(e,this._lastCreatedBufferId))}openGroup(e){this._onHoldIds.push(this._current),this._bindNextFreeBuffer(e)}switch(e){const t=this.currentFBO(e),r=this._current;return this._bindNextFreeBuffer(e),this._lastUsedIds.push(r),t}getLastOnHoldId(){return this._onHoldIds[this._onHoldIds.length-1]}closeGroup(e){const t=this._current;this._bindNextFreeBuffer(e),this._lastUsedIds.push(t),this._lastUsedIds.push(this._onHoldIds.pop())}unbind(){this._rctx.bindFramebuffer(null)}currentFBO(e){return this._fbos[this._current].get(e)}}export{f as TileCompositor};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{ComponentTechnique as e}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as t}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as s}from"../../../core/material/MaterialBase.js";import{isColor as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{hasShadowHighlights as a}from"../../../shaders/ReceiveShadowsConfiguration.js";class i extends s{constructor(e,s,r,a,i){super(),this.parameters=e,this.key=i;const n=l(e,r);this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this.hasEmissions=0!==n?3:0,this.materialPass=o(e,r),this._configuration=new t(a),this._initializeMaterialConfiguration(e,s,r)}destroy(){}acquireTechnique(t,s,r,a){const i=this._updateConfiguration(s,r);return t.get(e,i,a.layout)}_initializeMaterialConfiguration(e,t,s){const r=this._configuration;r.hasMetallicRoughnessTexture=e.hasMetallicRoughnessTexture,r.hasOcclusionTexture=e.hasOcclusionTexture,r.hasNormalTexture=e.hasNormalTexture,r.sphereDepthInterpolate=e.sphereDepthInterpolate&&r.spherical,r.ellipsoidMode=e.ellipsoidMode,r.doubleSidedMode=e.doubleSided?1:0,r.hasColorTexture=e.hasBaseColorTexture,r.cullFace=e.cullFace,r.alphaDiscardMode=e.alphaDiscardMode,r.hasVertexColors=t.hasVertexColors,r.textureCoordinateType=t.textureCoordinateType,r.shadeNormals=t.shadeNormals,r.normalType=t.hasNormals?1:2,r.polygonOffset=e.polygonOffset,r.vertexPositionRotationType=t.vertexPositionRotationType,r.vertexNormalRotationType=t.vertexNormalRotationType,r.componentDataType=s.componentDataType,r.emissionSource=l(e,s)}_updateConfiguration(e,t){const s=this._configuration,{identifier:i}=e,o=0===i;s.output=t.output,s.enableOITOffset=t.enableOITOffset,s.hasEmission=t.hasEmission&&o,s.renderOccluded=9===t.slot;const n=this.isIntegratedMesh?c(t)?u(t)?3:2:1:0;s.integratedMeshMode=n,s.pbrMode=3===n?4:this.usePBR?this.hasParametersFromSource?0!==s.shadeNormals&&this.isIntegratedMesh?0:2:1:0,s.hasSlicePlane=null!=t.slicePlane&&this.slicePlaneEnabled,s.isGroundSlice=s.hasSlicePlane&&this.isGround;const{materialPass:l}=this;s.transparent=o&&(1===l||2===l&&e.transparent||4===l)||s.isGroundSlice,s.hasHighlightMixTexture=2===i&&null!=t.highlightMixTexture,s.snowCover=o&&t.snowCover>0,s.vertexDiscardMode=o&&2===l?e.transparent?2:1:0;const h=r(t.output);return s.receiveAmbientOcclusion=h&&this.applySSAO&&!s.renderOccluded&&null!=t.ssao?.getTexture(),s.receiveGlobalIllumination=h&&this.applySSAO&&!s.renderOccluded&&t.globalIlluminationEnabled,s.hasOccludees=h&&t.hasOccludees,s.receiveShadows=h&&t.shadowMap.ready,s.hasShadowHighlights=a(s,t),s.screenSpaceReflections=t.hasScreenSpaceReflections,s.cloudReflections=h&&null!=t.clouds.data?.cubeMap?.colorTexture,s}}function o(e,t){const{alphaDiscardMode:s,isIntegratedMesh:r,slicePlaneEnabled:a}=e,{transparent:i,opaqueOverride:o}=t,n=e.isObjectTransparent,l=e.hasBaseColorTransparency;if(r)return n||a?4:3;if(n)return 1;if(0===o)return 0;if(l||0===s||3===s)return 1;switch(i){case 2:return 0;case 0:return 1;case 1:return 2}}function n(e){return e.hasEmissionTexture||e.hasEmissiveBaseColor}function l(e,t){const s=e.hasEmissionTexture,{emissiveSourceOverride:r}=t,a=1===r,i=2===r;return 2!==t.emissiveOverride&&(n(e)||2!==r)?n(e)?i?s?4:2:a?s?5:7:6:a?7:6:0}function u(e){return null!=e.overlay?.getTexture(3)}function c(e){return null!=e.overlay?.getTexture(1)}export{i as ComponentMaterial,o as computeMaterialPass,l as getEmissionSource};
2
+ import{ComponentTechnique as e}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as t}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as s}from"../../../core/material/MaterialBase.js";import{isColor as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{hasShadowHighlights as a}from"../../../shaders/ReceiveShadowsConfiguration.js";import{isSphereDepthInterpolateActive as o}from"../../../shaders/SphereDepthInterpolate.glsl.js";class i extends s{constructor(e,s,r,a,o){super(),this.parameters=e,this.key=o;const i=h(e,r);this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this.hasEmissions=0!==i?3:0,this.materialPass=n(e,r),this._configuration=new t(a),this._supportsSphereDepthInterpolate=e.sphereDepthInterpolate&&this._configuration.spherical,this._initializeMaterialConfiguration(e,s,r)}destroy(){}acquireTechnique(t,s,r,a){const i=this._updateConfiguration(s,r);if(this._supportsSphereDepthInterpolate&&t.precompiling>0){i.sphereDepthInterpolate=!1;const s=t.get(e,i,a.layout);i.sphereDepthInterpolate=!0;const n=t.get(e,i,a.layout);return o(r.camera,i)?n:s}return t.get(e,i,a.layout)}_initializeMaterialConfiguration(e,t,s){const r=this._configuration;r.hasMetallicRoughnessTexture=e.hasMetallicRoughnessTexture,r.hasOcclusionTexture=e.hasOcclusionTexture,r.hasNormalTexture=e.hasNormalTexture,r.sphereDepthInterpolate=!1,r.ellipsoidMode=e.ellipsoidMode,r.doubleSidedMode=e.doubleSided?1:0,r.hasColorTexture=e.hasBaseColorTexture,r.cullFace=e.cullFace,r.alphaDiscardMode=e.alphaDiscardMode,r.hasVertexColors=t.hasVertexColors,r.textureCoordinateType=t.textureCoordinateType,r.shadeNormals=t.shadeNormals,r.normalType=t.hasNormals?1:2,r.polygonOffset=e.polygonOffset,r.vertexPositionRotationType=t.vertexPositionRotationType,r.vertexNormalRotationType=t.vertexNormalRotationType,r.componentDataType=s.componentDataType,r.emissionSource=h(e,s)}_updateConfiguration(e,t){const s=this._configuration,{identifier:i}=e,n=0===i;s.output=t.output,s.enableOITOffset=t.enableOITOffset,s.sphereDepthInterpolate=this._supportsSphereDepthInterpolate&&o(t.camera,s),s.hasEmission=t.hasEmission&&n,s.renderOccluded=9===t.slot;const l=this.isIntegratedMesh?c(t)?u(t)?3:2:1:0;s.integratedMeshMode=l,s.pbrMode=3===l?4:this.usePBR?this.hasParametersFromSource?0!==s.shadeNormals&&this.isIntegratedMesh?0:2:1:0,s.hasSlicePlane=null!=t.slicePlane&&this.slicePlaneEnabled,s.isGroundSlice=s.hasSlicePlane&&this.isGround;const{materialPass:h}=this;s.transparent=n&&(1===h||2===h&&e.transparent||4===h)||s.isGroundSlice,s.hasHighlightMixTexture=2===i&&null!=t.highlightMixTexture,s.snowCover=n&&t.snowCover>0,s.vertexDiscardMode=n&&2===h?e.transparent?2:1:0;const p=r(t.output);return s.receiveAmbientOcclusion=p&&this.applySSAO&&!s.renderOccluded&&null!=t.ssao?.getTexture(),s.receiveGlobalIllumination=p&&this.applySSAO&&!s.renderOccluded&&t.globalIlluminationEnabled,s.hasOccludees=p&&t.hasOccludees,s.receiveShadows=p&&t.shadowMap.ready,s.hasShadowHighlights=a(s,t),s.screenSpaceReflections=t.hasScreenSpaceReflections,s.cloudReflections=p&&null!=t.clouds.data?.cubeMap?.colorTexture,s}}function n(e,t){const{alphaDiscardMode:s,isIntegratedMesh:r,slicePlaneEnabled:a}=e,{transparent:o,opaqueOverride:i}=t,n=e.isObjectTransparent,l=e.hasBaseColorTransparency;if(r)return n||a?4:3;if(n)return 1;if(0===i)return 0;if(l||0===s||3===s)return 1;switch(o){case 2:return 0;case 0:return 1;case 1:return 2}}function l(e){return e.hasEmissionTexture||e.hasEmissiveBaseColor}function h(e,t){const s=e.hasEmissionTexture,{emissiveSourceOverride:r}=t,a=1===r,o=2===r;return 2!==t.emissiveOverride&&(l(e)||2!==r)?l(e)?o?s?4:2:a?s?5:7:6:a?7:6:0}function u(e){return null!=e.overlay?.getTexture(3)}function c(e){return null!=e.overlay?.getTexture(1)}export{i as ComponentMaterial,n as computeMaterialPass,h as getEmissionSource};
@@ -1,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{C as t}from"../../../../../../chunks/ComponentShader.glsl.js";import{isOITColor as i,isOITFrontFace as o}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as n}from"../../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../../../core/shaderTechnique/ShaderTechnique.js";import{depthTest as s,blending as a}from"../../../lib/OrderIndependentTransparency.js";import{stencilBaseAllZeros as p,stencilWriteMaskOn as d,replaceBitWhenDepthTestPasses as m}from"../../../lib/StencilUtils.js";import{IndexGlLayout as u}from"../../../materials/DefaultLayouts.js";import{polygonOffset as c}from"../../../materials/PolygonOffset.js";import{makePipelineState as h,defaultColorWrite as f,defaultDepthWrite as g,premultipliedAlpha as b,cullingParams as j}from"../../../../../webgl/renderState.js";let P=class extends l{constructor(e,r,i){super(e,r,i.concat(u)),this.shader=new n(t,()=>import("./ComponentShader.glsl.js")),this.ignoreUnused=!0}getPipeline(e){return e.camera.aboveGround||null==this._belowGroundPipeline?super.getPipeline(e):this._belowGroundPipeline}initializePipeline(e){return this._belowGroundPipeline=0===e.integratedMeshMode?null:this._makePipeline(e,!0),this._makePipeline(e,!1)}_makePipeline(e,r){const{integratedMeshMode:t,output:n,transparent:l,cullFace:u,hasOccludees:P,renderOccluded:S}=e,w=0!==t,T=!i(n),O=o(n);let _=j(u);return r&&_&&(_={..._,mode:2304}),h({blending:S?b:l?a(n):null,culling:_,depthTest:S?null:s(n),depthWrite:S||!T&&!O?null:g,colorWrite:f,stencilWrite:!S&&w||P?d:null,stencilTest:w?m(1):P?p:null,polygonOffset:c(e)})}};P=e([r("esri.views.3d.webgl-engine.collections.Component.Material.ComponentTechnique")],P);export{P as ComponentTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../../core/accessorSupport/decorators.js";import{C as t}from"../../../../../../chunks/ComponentShader.glsl.js";import{isOITColor as i,isOITFrontFace as o}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as n}from"../../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../../../core/shaderTechnique/ShaderTechnique.js";import{depthTest as s,blending as a}from"../../../lib/OrderIndependentTransparency.js";import{stencilBaseAllZeros as p,stencilWriteMaskOn as d,replaceBitWhenDepthTestPasses as m}from"../../../lib/StencilUtils.js";import{IndexGlLayout as u}from"../../../materials/DefaultLayouts.js";import{polygonOffset as c}from"../../../materials/PolygonOffset.js";import{makePipelineState as h,defaultColorWrite as f,defaultDepthWrite as g,premultipliedAlpha as b,cullingParams as j}from"../../../../../webgl/renderState.js";let P=class extends l{constructor(e,r,i){super(e,r,i.concat(u)),this.shader=new n(t,()=>import("./ComponentShader.glsl.js")),this.ignoreUnused=!0}getPipeline(e,r){return e.camera.aboveGround||null==this._belowGroundPipeline?super.getPipeline(e,r):this._belowGroundPipeline}initializePipeline(e){return this._belowGroundPipeline=0===e.integratedMeshMode?null:this._makePipeline(e,!0),this._makePipeline(e,!1)}_makePipeline(e,r){const{integratedMeshMode:t,output:n,transparent:l,cullFace:u,hasOccludees:P,renderOccluded:S}=e,w=0!==t,T=!i(n),O=o(n);let _=j(u);return r&&_&&(_={..._,mode:2304}),h({blending:S?b:l?a(n):null,culling:_,depthTest:S?null:s(n),depthWrite:S||!T&&!O?null:g,colorWrite:f,stencilWrite:!S&&w||P?d:null,stencilTest:w?m(1):P?p:null,polygonOffset:c(e)})}};P=e([r("esri.views.3d.webgl-engine.collections.Component.Material.ComponentTechnique")],P);export{P as ComponentTechnique};
@@ -1,11 +1,11 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{generateUID as e}from"../../../../../core/uid.js";import{TextureBufferNaNSupportConfiguration as t,unpackFloat4x8 as o,unpackHalf2x8 as d,glslType as n,glslDecodeField as i}from"./TextureBackedBufferFields.glsl.js";import{glsl as r}from"../shaderModules/glsl.js";import{assert as a}from"../../lib/Util.js";const c=new t(!0),s=new t(!1);class u{constructor(t){this.moduleId=e(),this.namespace=`_tbb_${this.moduleId}_`;const{itemIndexAttribute:o,bufferUniform:d,layout:n}=t,i=t.fieldFilter??(()=>!0),r=t.enableNaNSupport?c:s;this.TextureBackedBufferModule=(e,t)=>f(this.namespace,e,t,o,d,n,i,r),this.getTextureAttribute=l(this.namespace)}}function f(e,t,c,s,u,f,l,h){const{vertex:$}=t;$.include(o,h),$.include(d,h);const x=`${e}tbbStride`,p=`${e}TextureBackedBufferItemData`,g=`${e}fetchTextureBackedBufferItemData`,b=m(e);for(const o of[x,p,g,b])a(o.length<1024,"Identifiers do not have a valid length");$.constants.add(x,"uint",f.texelStride),$.uniforms.add(u);const I=new Array;for(const o of f.fields.values())l(o.name,c)&&I.push(o);if(0===I.length)return;const B=[];for(let o=0;o<f.texelStride;++o)B.push(!1);for(const o of I)for(let e=0;e<o.numTexels;++e)B[o.startTexel+e]=!0;$.code.add(r`
3
- struct ${p} {`);for(const o of I)$.code.add(r`\t${n(o)} ${o.name};`);$.code.add(r`};`),$.code.add(r`
4
- ${p} ${g}(highp uint itemIndex) {
5
- ${p} itemData;
6
- highp uint index = itemIndex * ${x};
7
- highp uint rowWidth = uint(textureSize(${u.name}, 0).x);
2
+ import{generateUID as e}from"../../../../../core/uid.js";import{TextureBufferNaNSupportConfiguration as t,unpackFloat1x32 as o,unpackHalf1x16 as d,unpackInt1x16 as n,glslType as i,glslDecodeField as r}from"./TextureBackedBufferFields.glsl.js";import{glsl as a}from"../shaderModules/glsl.js";import{assert as c}from"../../lib/Util.js";const s=new t(!0),u=new t(!1);class f{constructor(t){this.moduleId=e(),this.namespace=`_tbb_${this.moduleId}_`;const{itemIndexAttribute:o,bufferUniform:d,layout:n}=t,i=t.fieldFilter??(()=>!0),r=t.enableNaNSupport?s:u;this.TextureBackedBufferModule=(e,t)=>l(this.namespace,e,t,o,d,n,i,r),this.getTextureAttribute=m(this.namespace)}}function l(e,t,s,u,f,l,m,$){const{vertex:x}=t;x.include(o,$),x.include(d,$),x.include(n);const p=`${e}tbbStride`,g=`${e}TextureBackedBufferItemData`,b=`${e}fetchTextureBackedBufferItemData`,I=h(e);for(const o of[p,g,b,I])c(o.length<1024,"Identifiers do not have a valid length");x.constants.add(p,"uint",l.texelStride),x.uniforms.add(f);const B=new Array;for(const o of l.fields.values())m(o.name,s)&&B.push(o);if(0===B.length)return;const w=[];for(let o=0;o<l.texelStride;++o)w.push(!1);for(const o of B)for(let e=0;e<o.numTexels;++e)w[o.startTexel+e]=!0;x.code.add(a`
3
+ struct ${g} {`);for(const o of B)x.code.add(a`\t${i(o)} ${o.name};`);x.code.add(a`};`),x.code.add(a`
4
+ ${g} ${b}(highp uint itemIndex) {
5
+ ${g} itemData;
6
+ highp uint index = itemIndex * ${p};
7
+ highp uint rowWidth = uint(textureSize(${f.name}, 0).x);
8
8
  int coordX = int(index % rowWidth);
9
9
  int coordY = int(index / rowWidth);
10
- `);for(let o=0;o<B.length;++o)!1!==B[o]&&$.code.add(r`lowp uvec4 texel${r.int(o)} = texelFetch(${u.name}, ivec2(coordX + ${r.int(o)}, coordY), 0);`);for(const o of I)$.code.add(r`itemData.${o.name} = ${i(o)};`);$.code.add(r`return itemData;
11
- }`),$.code.add(r`${p} ${b};`),$.main.add(r`${b} = ${g}(${s});`)}function l(e){const t=m(e);return e=>r`${t}.${e}`}function m(e){return`${e}ItemData`}export{u as TextureBackedBufferModule};
10
+ `);for(let o=0;o<w.length;++o)!1!==w[o]&&x.code.add(a`lowp uvec4 texel${a.int(o)} = texelFetch(${f.name}, ivec2(coordX + ${a.int(o)}, coordY), 0);`);for(const o of B)x.code.add(a`itemData.${o.name} = ${r(o)};`);x.code.add(a`return itemData;
11
+ }`),x.code.add(a`${g} ${I};`),x.main.add(a`${I} = ${b}(${u});`)}function m(e){const t=h(e);return e=>a`${t}.${e}`}function h(e){return`${e}ItemData`}export{f as TextureBackedBufferModule};
@@ -1,28 +1,32 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{hasNativeFloat16Array as n}from"../../../../../geometry/support/float16.js";import{FloatBindUniform as e}from"../shaderModules/FloatBindUniform.js";import{glsl as o,If as i}from"../shaderModules/glsl.js";import{ShaderTechniqueConfiguration as u,parameter as s}from"../shaderTechnique/ShaderTechniqueConfiguration.js";function r(t){switch(t.elementType){case"float":switch(t.elementCount){case 1:return o`float`;case 2:return o`vec2`;case 3:return o`vec3`;case 4:return o`vec4`;case 9:return o`mat3`;default:t.elementCount}break;case"int":switch(t.elementCount){case 1:return o`int`;case 2:return o`ivec2`;case 3:return o`ivec3`;case 4:return o`ivec4`;case 9:throw new Error("Invalid element count 9 for type int");default:t.elementCount}break;case"uint":switch(t.elementCount){case 1:return o`uint`;case 2:return o`uvec2`;case 3:return o`uvec3`;case 4:return o`uvec4`;case 9:throw new Error("Invalid element count 9 for type uint");default:t.elementCount}break;default:t.elementType}throw new Error("unsupported field")}const a=new e("const_NaN",()=>NaN,{supportsNaN:!0});class c extends u{constructor(t){super(),this.supportNaN=t}}function p(t,n){const e=n?.supportNaN;e&&(t.uniforms.add(a),t.code.add(o`bool bitsEncodeFloat16NaN(highp uint bits) {
2
+ import{__decorate as t}from"tslib";import{hasNativeFloat16Array as n}from"../../../../../geometry/support/float16.js";import{FloatBindUniform as e}from"../shaderModules/FloatBindUniform.js";import{glsl as i,If as u}from"../shaderModules/glsl.js";import{ShaderTechniqueConfiguration as o,parameter as s}from"../shaderTechnique/ShaderTechniqueConfiguration.js";function a(t){switch(t.elementType){case"float":switch(t.elementCount){case 1:return i`float`;case 2:return i`vec2`;case 3:return i`vec3`;case 4:return i`vec4`;case 9:return i`mat3`;default:t.elementCount}break;case"int":switch(t.elementCount){case 1:return i`int`;case 2:return i`ivec2`;case 3:return i`ivec3`;case 4:return i`ivec4`;case 9:throw new Error("Invalid element count 9 for type int");default:t.elementCount}break;case"uint":switch(t.elementCount){case 1:return i`uint`;case 2:return i`uvec2`;case 3:return i`uvec3`;case 4:return i`uvec4`;case 9:throw new Error("Invalid element count 9 for type uint");default:t.elementCount}break;default:t.elementType}throw new Error("unsupported field")}const r=new e("const_NaN",()=>NaN,{supportsNaN:!0});class c extends o{constructor(t){super(),this.supportNaN=t}}function p(t,n){const e=n?.supportNaN;e&&(t.uniforms.add(r),t.code.add(i`bool bitsEncodeFloat16NaN(highp uint bits) {
3
3
  const highp uint nanExponent = 0x00007c00u;
4
4
  highp uint exponent = bits & nanExponent;
5
5
  highp uint mantissa = bits & 0x000003ffu;
6
6
  return exponent == nanExponent && mantissa != 0u;
7
- }`)),t.code.add(o`
8
- mediump float unpackHalf2x8(highp uint bits0, highp uint bits1) {
7
+ }`)),t.code.add(i`
8
+ mediump float unpackHalf1x16(highp uint bits0, highp uint bits1) {
9
9
  highp uint halfBits = (bits1 << 8u) | bits0;
10
- ${i(e,o`
10
+ ${u(e,i`
11
11
  if (bitsEncodeFloat16NaN(halfBits)) {
12
12
  return const_NaN;
13
13
  }`)}
14
14
  return unpackHalf2x16(halfBits).x;
15
- }`)}function f(t,n){const e=n?.supportNaN;e&&(t.uniforms.add(a),t.code.add(o`bool bitsEncodeFloat32NaN(highp uint bits) {
15
+ }`)}function f(t,n){const e=n?.supportNaN;e&&(t.uniforms.add(r),t.code.add(i`bool bitsEncodeFloat32NaN(highp uint bits) {
16
16
  const highp uint nanExponent = 0x7f800000u;
17
17
  highp uint exponent = bits & nanExponent;
18
18
  highp uint mantissa = bits & 0x007fffffu;
19
19
  return exponent == nanExponent && mantissa != 0u;
20
- }`)),t.code.add(o`
21
- highp float unpackFloat4x8(highp uint bits0, highp uint bits1, highp uint bits2, highp uint bits3) {
20
+ }`)),t.code.add(i`
21
+ highp float unpackFloat1x32(highp uint bits0, highp uint bits1, highp uint bits2, highp uint bits3) {
22
22
  highp uint floatBits = (bits3 << 24u) |(bits2 << 16u) | (bits1 << 8u) | bits0;
23
- ${i(e,o`
23
+ ${u(e,i`
24
24
  if (bitsEncodeFloat32NaN(floatBits)) {
25
25
  return const_NaN;
26
26
  }`)}
27
27
  return uintBitsToFloat(floatBits);
28
- }`)}function l(t){const{fieldType:n}=t;return`${(0,m[n])(b(t))}`}function h(t,n){const e=[];for(let i=0;i<t.length;i+=4){const n=t[i],u=t[i+1],s=t[i+2],r=t[i+3],a=o`unpackFloat4x8(${`${n}, ${u}, ${s}, ${r}`})`;e.push(a)}return e.join(n)}function d(t){return o`vec3(${h(t,",\n\t")})`}function $(t){return o`mat3(${h(t,",\n")})`}t([s()],c.prototype,"supportNaN",void 0);const m={u8:t=>o`${t[0]}`,unorm8:t=>o`float(${t[0]})/255.0`,vec4unorm8:t=>o`vec4(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})/255.0`,f16:n?t=>o`unpackHalf2x8(${`${t[0]}, ${t[1]}`})`:t=>o`unpackFloat4x8(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})`,f32:t=>o`unpackFloat4x8(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})`,vec4u8:t=>o`uvec4(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})`,vec3f32:t=>d(t),mat3f32:t=>$(t)};function b(t){const{startTexel:n,byteOffset:e,texelByteStride:i,byteSize:u}=t;let s=n,r=e%i;const a=new Array;for(let c=0;c<u;++c){const t=o`texel${o.int(s)}.${x[r]}`;a.push(t),++r,r>=i&&(r=0,++s)}return a}const x=["x","y","z","w"];export{c as TextureBufferNaNSupportConfiguration,l as glslDecodeField,r as glslType,f as unpackFloat4x8,p as unpackHalf2x8};
28
+ }`)}function h(t){t.code.add(i`mediump int unpackInt1x16(highp uint bits0, highp uint bits1) {
29
+ highp uint rawBits = (bits1 << 8u) | bits0;
30
+ highp uint signExtendedBits = (rawBits & 0x8000u) != 0u ? (rawBits | 0xffff0000u) : rawBits;
31
+ return int(signExtendedBits);
32
+ }`)}function l(t){const{fieldType:n}=t;return`${(0,x[n])(b(t))}`}function d(t,n){const e=[];for(let u=0;u<t.length;u+=4){const n=t[u],o=t[u+1],s=t[u+2],a=t[u+3],r=i`unpackFloat1x32(${`${n}, ${o}, ${s}, ${a}`})`;e.push(r)}return e.join(n)}function $(t){return i`vec3(${d(t,",\n\t")})`}function m(t){return i`mat3(${d(t,",\n")})`}t([s()],c.prototype,"supportNaN",void 0);const x={u8:t=>i`${t[0]}`,unorm8:t=>i`float(${t[0]})/255.0`,vec4unorm8:t=>i`vec4(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})/255.0`,vec2snorm16:t=>i`max(vec2(unpackInt1x16(${`${t[0]}, ${t[1]}`}), unpackInt1x16(${`${t[2]}, ${t[3]}`}))/32767.0, vec2(-1.0))`,f16:n?t=>i`unpackHalf1x16(${`${t[0]}, ${t[1]}`})`:t=>i`unpackFloat1x32(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})`,f32:t=>i`unpackFloat1x32(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})`,vec4u8:t=>i`uvec4(${`${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}`})`,vec3f32:t=>$(t),mat3f32:t=>m(t)};function b(t){const{startTexel:n,byteOffset:e,texelByteStride:u,byteSize:o}=t;let s=n,a=e%u;const r=new Array;for(let c=0;c<o;++c){const t=i`texel${i.int(s)}.${g[a]}`;r.push(t),++a,a>=u&&(a=0,++s)}return r}const g=["x","y","z","w"];export{c as TextureBufferNaNSupportConfiguration,l as glslDecodeField,a as glslType,f as unpackFloat1x32,p as unpackHalf1x16,h as unpackInt1x16};
@@ -1,15 +1,17 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{Float2PassUniform as o}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as r}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as a}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as i}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as t}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as l}from"../../shaderModules/FloatsPassUniform.js";import{glsl as v,If as s}from"../../shaderModules/glsl.js";import{VisualVariablePassParameters as c,vvColorNumber as n}from"../../../materials/VisualVariablePassParameters.js";const p=8;function f(e,c){const{attributes:f,vertex:u}=e;f.add("position","vec3"),f.add("profileVertexAndNormal","vec4"),f.add("profileAuxData","vec3"),f.add("profileRight","vec2"),f.add("profileUp","vec2"),u.code.add(v`bool isCapVertex() {
2
+ import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{TextureBackedBufferModule as r}from"../TextureBackedBuffer.glsl.js";import{Float2PassUniform as t}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as o}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as i}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as a}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as l}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as s}from"../../shaderModules/FloatsPassUniform.js";import{glsl as v,If as c}from"../../shaderModules/glsl.js";import{Texture2DUintDrawUniform as n}from"../../shaderModules/Texture2DUintDrawUniform.js";import{getTextureLayout as u}from"../../../materials/PathLayouts.js";import{VisualVariablePassParameters as f,vvColorNumber as p}from"../../../materials/VisualVariablePassParameters.js";const d=8;function m(e,f){const{attributes:m,vertex:x}=e,y=new n("componentTextureBuffer",e=>e.textureBuffer),g=new r({layout:u(f),itemIndexAttribute:"textureElementIndex",bufferUniform:y});e.include(g.TextureBackedBufferModule,f),m.add("textureElementIndex","uint"),m.add("profileVertexAndNormal","vec4"),m.add("profileAuxData","vec3"),x.code.add(v`bool isCapVertex() {
3
3
  return profileAuxData.z == 1.0;
4
- }`),u.uniforms.add(new o("size",e=>e.size));const{hasVVSize:d,hasVVColor:m,hasVVOpacity:x}=c;d?(f.add("sizeFeatureAttribute","float"),u.uniforms.add(new r("vvSizeMinSize",e=>e.vvSize.minSize),new r("vvSizeMaxSize",e=>e.vvSize.maxSize),new r("vvSizeOffset",e=>e.vvSize.offset),new r("vvSizeFactor",e=>e.vvSize.factor),new r("vvSizeFallback",e=>e.vvSize.fallback)),u.code.add(v`vec2 getSize() {
5
- float value = sizeFeatureAttribute;
6
- if (isnan(value)) {
7
- return vvSizeFallback.xz;
8
- }
9
- return size * clamp(vvSizeOffset + value * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).xz;
10
- }`)):u.code.add(v`vec2 getSize(){
4
+ }`),x.uniforms.add(new t("size",e=>e.size));const{hasVVSize:b,hasVVColor:z,hasVVOpacity:h}=f;b?(x.uniforms.add(new o("vvSizeMinSize",e=>e.vvSize.minSize),new o("vvSizeMaxSize",e=>e.vvSize.maxSize),new o("vvSizeOffset",e=>e.vvSize.offset),new o("vvSizeFactor",e=>e.vvSize.factor),new o("vvSizeFallback",e=>e.vvSize.fallback)),x.code.add(v`
5
+ vec2 getSize() {
6
+ float value = ${g.getTextureAttribute("sizeFeatureAttribute")};
7
+ if (isnan(value)) {
8
+ return vvSizeFallback.xz;
9
+ }
10
+ return size * clamp(vvSizeOffset + value * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).xz;
11
+ }
12
+ `)):x.code.add(v`vec2 getSize(){
11
13
  return size;
12
- }`),x?(f.add("opacityFeatureAttribute","float"),u.constants.add("vvOpacityNumber","int",p),u.uniforms.add(new l("vvOpacityValues",p,e=>e.vvOpacity.values),new l("vvOpacityOpacities",p,e=>e.vvOpacity.opacityValues),new t("vvOpacityFallback",e=>e.vvOpacity.fallback,{supportsNaN:!0})),u.code.add(v`
14
+ }`),h?(x.constants.add("vvOpacityNumber","int",d),x.uniforms.add(new s("vvOpacityValues",d,e=>e.vvOpacity.values),new s("vvOpacityOpacities",d,e=>e.vvOpacity.opacityValues),new l("vvOpacityFallback",e=>e.vvOpacity.fallback,{supportsNaN:!0})),x.code.add(v`
13
15
  vec4 applyOpacity(vec4 color) {
14
16
  // if we encounter NaN in the color it means the color is in the fallback case where the symbol color
15
17
  // is not defined and there is no valid color visual variable override. In this case just return a fully
@@ -18,11 +20,11 @@ return size;
18
20
  return vec4(0);
19
21
  }
20
22
 
21
- float value = opacityFeatureAttribute;
23
+ float value = ${g.getTextureAttribute("opacityFeatureAttribute")};
22
24
 
23
25
  if (isnan(value)) {
24
26
  // If there is a color vv then it will already have taken care of applying the fallback
25
- return ${s(m,"color","vec4(color.rgb, vvOpacityFallback)")};
27
+ return ${c(z,"color","vec4(color.rgb, vvOpacityFallback)")};
26
28
  }
27
29
 
28
30
  if (value <= vvOpacityValues[0]) {
@@ -38,42 +40,50 @@ return size;
38
40
 
39
41
  return vec4( color.rgb, vvOpacityOpacities[vvOpacityNumber - 1]);
40
42
  }
41
- `)):u.code.add(v`vec4 applyOpacity(vec4 color){
43
+ `)):x.code.add(v`vec4 applyOpacity(vec4 color){
42
44
  return color;
43
- }`),m?(f.add("colorFeatureAttribute","float"),u.constants.add("vvColorNumber","int",n),u.uniforms.add(new l("vvColorValues",n,e=>e.vvColor.values),new i("vvColorColors",n,e=>e.vvColor.colors),new a("vvColorFallback",e=>e.vvColor.fallback)),u.code.add(v`vec4 getColor() {
44
- float value = colorFeatureAttribute;
45
- if (isnan(value)) {
46
- return applyOpacity(vvColorFallback);
47
- }
48
- if (value <= vvColorValues[0]) {
49
- return applyOpacity(vvColorColors[0]);
50
- }
51
- for (int i = 1; i < vvColorNumber; ++i) {
52
- if (vvColorValues[i] >= value) {
53
- float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]);
54
- return applyOpacity(mix(vvColorColors[i-1], vvColorColors[i], f));
55
- }
56
- }
57
- return applyOpacity(vvColorColors[vvColorNumber - 1]);
58
- }`)):u.code.add(v`vec4 getColor(){
45
+ }`),z?(x.constants.add("vvColorNumber","int",p),x.uniforms.add(new s("vvColorValues",p,e=>e.vvColor.values),new a("vvColorColors",p,e=>e.vvColor.colors),new i("vvColorFallback",e=>e.vvColor.fallback)),x.code.add(v`
46
+ vec4 getColor() {
47
+ float value = ${g.getTextureAttribute("colorFeatureAttribute")};
48
+ if (isnan(value)) {
49
+ return applyOpacity(vvColorFallback);
50
+ }
51
+
52
+ if (value <= vvColorValues[0]) {
53
+ return applyOpacity(vvColorColors[0]);
54
+ }
55
+
56
+ for (int i = 1; i < vvColorNumber; ++i) {
57
+ if (vvColorValues[i] >= value) {
58
+ float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]);
59
+ return applyOpacity(mix(vvColorColors[i-1], vvColorColors[i], f));
60
+ }
61
+ }
62
+
63
+ return applyOpacity(vvColorColors[vvColorNumber - 1]);
64
+ }
65
+ `)):x.code.add(v`vec4 getColor(){
59
66
  return applyOpacity(vec4(1, 1, 1, 1));
60
- }`),u.code.add(v`vec3 decompressAxis(vec2 axis) {
61
- float z = 1.0 - abs(axis.x) - abs(axis.y);
62
- return normalize(vec3(axis + sign(axis) * min(z, 0.0), z));
63
- }
64
- vec3 calculateVPos() {
65
- vec2 size = getSize();
66
- vec3 origin = position;
67
- vec3 right = decompressAxis(profileRight);
68
- vec3 up = decompressAxis(profileUp);
69
- vec2 profileVertex = profileVertexAndNormal.xy * size;`),u.code.add(v`if(isCapVertex()) {
67
+ }`),x.code.add(v`
68
+ vec3 decompressAxis(vec2 axis) {
69
+ float z = 1.0 - abs(axis.x) - abs(axis.y);
70
+ return normalize(vec3(axis + sign(axis) * min(z, 0.0), z));
71
+ }
72
+
73
+ vec3 calculateVPos() {
74
+ vec2 size = getSize();
75
+ vec3 origin = ${g.getTextureAttribute("position")};
76
+ vec3 right = decompressAxis(${g.getTextureAttribute("profileRight")});
77
+ vec3 up = decompressAxis(${g.getTextureAttribute("profileUp")});
78
+ vec2 profileVertex = profileVertexAndNormal.xy * size;
79
+ `),x.code.add(v`if(isCapVertex()) {
70
80
  float positionOffsetAlongProfilePlaneNormal = profileAuxData.x * size[0];
71
81
  vec3 forward = cross(up, right);
72
82
  vec3 offset = right * profileVertex.x + up * profileVertex.y + forward * positionOffsetAlongProfilePlaneNormal;
73
83
  return origin + offset;
74
84
  }
75
85
  vec2 rotationRight = vec2(profileAuxData.x, profileAuxData.y);
76
- float maxDistance = length(rotationRight);`),u.code.add(v`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0);
86
+ float maxDistance = length(rotationRight);`),x.code.add(v`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0);
77
87
  float rx = dot(profileVertex, rotationRight);
78
88
  if (abs(rx) > maxDistance) {
79
89
  vec2 rotationUp = vec2(-rotationRight.y, rotationRight.x);
@@ -82,13 +92,17 @@ profileVertex = rotationRight * maxDistance * sign(rx) + rotationUp * ry;
82
92
  }
83
93
  vec3 offset = right * profileVertex.x + up * profileVertex.y;
84
94
  return origin + offset;
85
- }`),u.code.add(v`vec3 localNormal() {
86
- vec3 right = decompressAxis(profileRight);
87
- vec3 up = decompressAxis(profileUp);
88
- vec3 normal = right * profileVertexAndNormal.z + up * profileVertexAndNormal.w;
89
- if(isCapVertex()) {
90
- vec3 forward = cross(up, right);
91
- normal += forward * profileAuxData.y;
92
- }
93
- return normal;
94
- }`)}class u extends c{constructor(){super(...arguments),this.size=e(1,1)}}export{f as PathVertexPosition,u as PathVertexPositionPassParameters};
95
+ }`),x.code.add(v`
96
+ vec3 localNormal() {
97
+ vec3 right = decompressAxis(${g.getTextureAttribute("profileRight")});
98
+ vec3 up = decompressAxis(${g.getTextureAttribute("profileUp")});
99
+ vec3 normal = right * profileVertexAndNormal.z + up * profileVertexAndNormal.w;
100
+
101
+ if(isCapVertex()) {
102
+ vec3 forward = cross(up, right);
103
+ normal += forward * profileAuxData.y;
104
+ }
105
+
106
+ return normal;
107
+ }
108
+ `)}class x extends f{constructor(){super(...arguments),this.size=e(1,1)}}export{m as PathVertexPosition,x as PathVertexPositionPassParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import i from"../../../../../core/Accessor.js";import t from"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{Pos2 as s}from"../../lib/DefaultVertexBufferLayouts.js";import{Program as o}from"../../lib/Program.js";import{PrimitiveType as n}from"../../../../webgl/enums.js";import{makePipelineState as a,defaultColorWrite as h,premultipliedAlpha as l}from"../../../../webgl/renderState.js";import{fromLayout as c}from"../../../../webgl/VertexAttributeLocations.js";const u=()=>t.getLogger("esri.views.3d.webgl.ShaderTechnique");let d=class extends i{constructor(e,i,t){super({}),this._context=e,this._configuration=i,this.primitiveType=n.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=i.key,this.locations=c(t??s),this._pipeline=this.initializePipeline(i),this.reload=async t=>{if(t&&await this.shader.reload(),!this.key.equals(i.key))return void u().warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);const r=this.shader.get().build(i);r.debugName=this.declaredClass,this._program=new o(e.rctx,r,this.locations),this._pipeline=this.initializePipeline(i)}}initialize(){const e=this.shader.get().build(this._configuration);e.debugName=this.declaredClass,this._program=new o(this._context.rctx,e,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,i){return this._pipeline}initializePipeline(e){return a({blending:l,colorWrite:h})}};d=e([r("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],d);export{d as ShaderTechnique};
2
+ import{__decorate as e}from"tslib";import i from"../../../../../core/Accessor.js";import t from"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{Pos2 as s}from"../../lib/DefaultVertexBufferLayouts.js";import{Program as o}from"../../lib/Program.js";import{PrimitiveType as n}from"../../../../webgl/enums.js";import{makePipelineState as a,defaultColorWrite as h,premultipliedAlpha as l}from"../../../../webgl/renderState.js";import{fromLayout as c}from"../../../../webgl/VertexAttributeLocations.js";const u=()=>t.getLogger("esri.views.3d.webgl.ShaderTechnique");let d=class extends i{constructor(e,i,t){super({}),this._context=e,this._configuration=i,this.primitiveType=n.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=i.key,this.locations=c(t??s),this._pipeline=this.initializePipeline(i),this.reload=async t=>{if(t&&await this.shader.reload(),!this.key.equals(i.key))return void u().warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);const r=this.shader.get().build(i);r.debugName=this.declaredClass,this._program=new o(e.rctx,r,this.locations),this._pipeline=this.initializePipeline(i)}}initialize(){const e=this.shader.get().build(this._configuration);e.debugName=this.declaredClass,this._program=new o(this._context.rctx,e,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,i,t){return this._pipeline}initializePipeline(e){return a({blending:l,colorWrite:h})}};d=e([r("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],d);export{d as ShaderTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../core/shaderModules/Float2PassUniform.js";import"../../core/shaderModules/Float3BindUniform.js";import"../../core/shaderModules/Float3PassUniform.js";import"../../core/shaderModules/Float4PassUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/FloatsPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"./ChapmanApproximation.glsl.js";import"./ChapmanRaymarching.glsl.js";import"../../shaders/ScreenSpacePassAtmosphere.glsl.js";import"../../shaders/SphereIntersect.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/ChapmanAtmosphere.glsl.js";
2
+ import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../core/shaderModules/BooleanPassUniform.js";import"../../core/shaderModules/Float2PassUniform.js";import"../../core/shaderModules/Float3BindUniform.js";import"../../core/shaderModules/Float3PassUniform.js";import"../../core/shaderModules/Float4PassUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/FloatsPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"./ChapmanApproximation.glsl.js";import"./ChapmanRaymarching.glsl.js";import"../../shaders/ScreenSpacePassAtmosphere.glsl.js";import"../../shaders/SphereIntersect.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/ChapmanAtmosphere.glsl.js";