@arcgis/core 4.34.0-next.2 → 4.34.0-next.4

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 (260) hide show
  1. package/Map.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{bf3555f91492a1a3b613.js → 09f76ca9b47b465c934f.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{397b15d46f22718c9f38.js → 0d78fc2c2bc1152f84db.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{ead5d4e271effc04def3.js → 1415d4e2f5f3193be004.js} +1 -1
  6. package/assets/esri/core/workers/chunks/17e43a050fbf8dc87588.js +1 -0
  7. package/assets/esri/core/workers/chunks/{ac2607f1e8cd2e99907c.js → 1bc4cb6366e733a7c7ef.js} +2 -2
  8. package/assets/esri/core/workers/chunks/1ee6e9a88f0676032e91.js +1 -0
  9. package/assets/esri/core/workers/chunks/{ece68a25651ef03fc95d.js → 342f61e784c9364a493b.js} +1 -1
  10. package/assets/esri/core/workers/chunks/3adcf78ed1e7cd82666d.js +1 -0
  11. package/assets/esri/core/workers/chunks/{07e58dff44fcbb3b3539.js → 562800b0af52a38a311b.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{32ee2708edd307954125.js → 7174150bf7595c22f976.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{e77371ddbaf4b2d9be8d.js → 74c0db9e3a62e9839b23.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{aba19485b6cdcb70dac6.js → 8008f5479f4d16964088.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{40f54c4f8ae63c6f3df9.js → a32dcd5bc4680374d30c.js} +1 -1
  16. package/assets/esri/core/workers/chunks/ad4f65d764654c70a117.js +1 -0
  17. package/assets/esri/core/workers/chunks/{d7b640f7a181bd26c7c7.js → bac5e1d50b69f0d94694.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{9ca480eb8b2312381ccf.js → bcadcb709e622f2aaaf9.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{677af0281e4fc9f3bd98.js → c6cd8784a3e222eb2d4a.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{54f4a1131f99468db076.js → d33a5d79f2163ad62b1d.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{e3c1aea34ece8336dae1.js → e9aa1d9ded8a52a40c57.js} +1 -1
  22. package/assets/esri/core/workers/chunks/f2aa8090827086c62dde.js +1 -0
  23. package/assets/esri/core/workers/chunks/fd4c020297badcb81947.js +1 -0
  24. package/assets/esri/core/workers/chunks/{b160dcbea6256e0cf689.js → feaf79b69d2e2a1f2aa2.js} +1 -1
  25. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  26. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  27. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  28. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  29. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  30. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  31. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  32. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  33. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  34. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  35. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  36. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  37. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  38. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  39. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  40. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  41. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  42. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  43. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  44. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  45. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  46. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  47. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  48. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  49. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  50. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  51. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  52. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  53. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  54. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  55. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  56. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  57. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  58. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  59. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  60. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  61. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  62. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  63. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  64. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  65. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  66. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  67. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  68. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  69. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  70. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  71. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  72. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  73. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  74. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  75. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  76. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  77. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  78. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  79. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  80. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  81. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  82. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  83. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  84. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  85. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  86. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  87. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  88. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  89. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  90. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  91. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  92. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  93. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  94. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  95. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  96. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  97. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  98. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  99. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  100. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  101. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  102. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  103. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  104. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  105. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  106. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  107. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  108. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  109. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  110. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  111. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  112. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  113. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  114. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  115. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  116. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  117. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  118. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  119. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  120. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  121. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  122. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  123. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  124. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  125. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  126. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  127. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  128. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  129. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  130. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  131. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  132. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  133. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  134. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  135. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  136. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  137. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  138. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  139. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  140. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  141. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  142. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  143. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  144. package/chunks/Laserlines.glsl.js +2 -2
  145. package/chunks/cameraUtilsSpherical.js +1 -1
  146. package/chunks/sphere.js +1 -1
  147. package/chunks/vec42.js +1 -1
  148. package/config.js +1 -1
  149. package/core/accessorSupport/ensureType.js +1 -1
  150. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  151. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  152. package/effects/FocusArea.js +5 -0
  153. package/{views → effects}/FocusAreaOutline.js +1 -1
  154. package/{views → effects}/FocusAreas.js +1 -1
  155. package/geometry/support/frustum.js +1 -1
  156. package/geometry/support/sphere.js +1 -1
  157. package/interfaces.d.ts +137 -66
  158. package/kernel.js +1 -1
  159. package/layers/VideoLayer.js +1 -1
  160. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  161. package/layers/video/VideoController.js +1 -1
  162. package/networks/support/UNTraceConfiguration.js +1 -1
  163. package/networks/support/typeUtils.js +1 -1
  164. package/package.json +1 -1
  165. package/rest/knowledgeGraph/GraphAddFieldIndexResult.js +5 -0
  166. package/rest/knowledgeGraph/GraphAddNamedTypesResult.js +1 -1
  167. package/rest/knowledgeGraph/GraphAddPropertyResult.js +1 -1
  168. package/rest/knowledgeGraph/GraphDataModelOperationResult.js +5 -0
  169. package/rest/knowledgeGraph/GraphDeleteFieldIndexResult.js +5 -0
  170. package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.js +1 -1
  171. package/rest/knowledgeGraph/GraphDeletePropertyResult.js +1 -1
  172. package/rest/knowledgeGraph/GraphUpdateNamedTypesResult.js +1 -1
  173. package/rest/knowledgeGraph/GraphUpdatePropertyResult.js +1 -1
  174. package/rest/knowledgeGraph/GraphUpdateSearchIndexResult.js +1 -1
  175. package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
  176. package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +1 -1
  177. package/rest/knowledgeGraphService.js +1 -1
  178. package/rest/networks/support/CircuitPath.js +5 -0
  179. package/rest/networks/support/CircuitPathConnectivityElement.js +5 -0
  180. package/rest/networks/support/TraceLocation.js +1 -1
  181. package/rest/networks/support/TraceResult.js +1 -1
  182. package/smartMapping/renderers/pieChart.js +1 -1
  183. package/smartMapping/renderers/predominance.js +1 -1
  184. package/smartMapping/renderers/support/rendererUtils.js +1 -1
  185. package/smartMapping/renderers/support/spikeUtils.d.ts +4 -0
  186. package/support/revision.js +1 -1
  187. package/views/2d/engine/Bitmap.js +1 -1
  188. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  189. package/views/2d/engine/vectorTiles/GlyphMosaic.js +1 -1
  190. package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
  191. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  192. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  193. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  194. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  195. package/views/2d/engine/webgl/Overlay.js +1 -1
  196. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  197. package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
  198. package/views/2d/engine/webgl/brushes/WGLBrushTileDebugInfo.js +1 -1
  199. package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
  200. package/views/2d/engine/webgl/effects/post-processing/Colorize.js +1 -1
  201. package/views/2d/engine/webgl/effects/post-processing/DropShadow.js +1 -1
  202. package/views/2d/engine/webgl/effects/post-processing/Opacity.js +1 -1
  203. package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
  204. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  205. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  206. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
  207. package/views/2d/layers/VideoLayerView2D.js +1 -1
  208. package/views/3d/FocusAreasView.js +1 -1
  209. package/views/3d/camera/constraintUtils/distance.js +1 -1
  210. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  211. package/views/3d/environment/LocalAtmosphere.js +1 -1
  212. package/views/3d/environment/MarsAtmosphere.js +1 -1
  213. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  214. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  215. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  216. package/views/3d/state/NearFarHeuristic.js +1 -1
  217. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  218. package/views/3d/state/utils/navigationUtils.js +1 -1
  219. package/views/3d/support/engineContent/marker.js +1 -1
  220. package/views/3d/support/geometryUtils/sphere.js +1 -1
  221. package/views/3d/support/sunUtils.js +1 -1
  222. package/views/3d/terrain/OverlayManager.js +1 -1
  223. package/views/3d/terrain/OverlayRenderer.js +1 -1
  224. package/views/3d/webgl/RenderCamera.js +1 -1
  225. package/views/3d/webgl/RenderNode.js +1 -1
  226. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  227. package/views/3d/webgl-engine/effects/focusArea/FocusAreaOutlineItem.js +5 -0
  228. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  229. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
  230. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  231. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  232. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  233. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  234. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  235. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  236. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  237. package/views/VideoView.js +1 -1
  238. package/views/support/imageReprojection.js +1 -1
  239. package/views/webgl/RenderingContext.js +1 -1
  240. package/views/webgl/Texture.js +1 -1
  241. package/views/webgl/rasterUtils.js +1 -1
  242. package/widgets/Daylight/DaylightViewModel.js +1 -1
  243. package/widgets/Editor/EditorViewModel.js +1 -1
  244. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  245. package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
  246. package/widgets/Editor/UpdateWorkflow.js +1 -1
  247. package/widgets/Editor/components/Notices.js +1 -1
  248. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  249. package/widgets/Editor/workflowUtils.js +1 -1
  250. package/widgets/Editor.js +1 -1
  251. package/widgets/FeatureTable/FieldColumn.js +1 -1
  252. package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
  253. package/assets/esri/core/workers/chunks/094e8aae6dada24c8115.js +0 -1
  254. package/assets/esri/core/workers/chunks/24327d01cb2c5c55a4b7.js +0 -1
  255. package/assets/esri/core/workers/chunks/62b2d3720693c93a60f2.js +0 -1
  256. package/assets/esri/core/workers/chunks/a0f2df8ca7cd14bfa013.js +0 -1
  257. package/assets/esri/core/workers/chunks/b06cb23048c32940f5de.js +0 -1
  258. package/assets/esri/core/workers/chunks/d3d98ea5b5e56fc60a31.js +0 -1
  259. package/views/FocusArea.js +0 -5
  260. package/views/FocusAreaOutlineItem.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Evented.js";import"../../../core/has.js";import{someMap as t}from"../../../core/MapUtils.js";import{disposeMaybe as s}from"../../../core/maybe.js";import i from"../../../core/PooledArray.js";import{watch as n,on as o,syncAndInitial as a,initial as h}from"../../../core/reactiveUtils.js";import{someSet as l}from"../../../core/SetUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{ortho as u,fromTranslation as p}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{i as g}from"../../../chunks/vec32.js";import{ones as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{DrapeSourceType as m,DrapedRenderGroup as f,DrapeTargetType as y}from"../layers/interfaces.js";import{debugFlags as R}from"../support/debugFlags.js";import{OverlayIndex as b}from"./interfaces.js";import{Overlay as T}from"./Overlay.js";import{OverlayContent as w}from"./OverlayContent.js";import{OverlayRenderTargets as x}from"./OverlayRenderTargets.js";import D from"../webgl/RenderCamera.js";import{ShaderOutput as v}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{OverlayMode as C}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{T as O}from"../../../chunks/TextureOnly.glsl.js";import{SyncRenderPlugin as S}from"../webgl-engine/effects/RenderPlugin.js";import{trackHighlightOptions as E,renderHighlightBuffer as P}from"../webgl-engine/effects/highlight/Highlight.js";import{RenderRequestType as j}from"../webgl-engine/lib/basicInterfaces.js";import{GLMaterialRepository as A}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as M}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderOccludedFlag as W}from"../webgl-engine/lib/Material.js";import{OITPass as I}from"../webgl-engine/lib/OITPass.js";import{RenderContext as q,defaultRenderOccludedMask as L}from"../webgl-engine/lib/RenderContext.js";import{RenderSlot as N}from"../webgl-engine/lib/RenderSlot.js";import{ShadowMap as V}from"../webgl-engine/lib/ShadowMap.js";import{TextureTechnique as F}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as H}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{Update as k}from"../webgl-engine/lib/Update.js";import{UpdatePolicy as G}from"../webgl-engine/lib/UpdatePolicy.js";import{AmbientLight as U}from"../webgl-engine/lighting/Lightsources.js";import{O as B}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as z}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as Y,noBudget as X}from"../../support/Scheduler.js";import{FramebufferBit as K,TextureSamplingMode as J}from"../../webgl/enums.js";import{Texture as Q}from"../../webgl/Texture.js";import{TextureDescriptor as Z}from"../../webgl/TextureDescriptor.js";let $=class extends S{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new B,this.hasHighlights=!1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new i,this._passParameters=new O,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new D,this.events=new r,this.longitudeCyclical=null,this.produces=new Map([[N.DRAPED_MATERIAL,e=>e!==v.Highlight||this.hasHighlights],[N.DRAPED_WATER,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1}initialize(){const e=this._view,r=e.stage,t=r.renderer.fboCache,{waterTextures:s,techniques:i}=r.renderView;this._renderContext=new q(this._rctx,new V(t,e.state.viewingMode),i),this.addHandles([n((()=>s.updating),(()=>this.events.emit("content-changed")),a),n((()=>this.spatialReference),(e=>this._localOriginFactory=new M(e)),a),o((()=>e.allLayerViews),"after-changes",(()=>this._sortedDrapeSourceRenderersDirty=!0)),n((()=>E(e.state.highlights)),(()=>this._sortedDrapeSourceRenderersDirty=!0),h),n((()=>e.state.highlights),(r=>{this._bindParameters.highlights=r,this._bindParameters.highlightOrderMap=e.state.highlightOrderMap}),h),e.resourceController.scheduler.registerTask(Y.OVERLAY_RENDERER,this)]);const{_bindParameters:l,_camera:d}=this;d.near=1,d.far=1e4,d.relativeElevation=null,l.slot=N.DRAPED_MATERIAL,l.mainDepth=null,l.camera=d,l.oitPass=I.NONE,l.updateLighting([new U(_())],0,0,k.Immediate)}destroy(){this._renderers.forEach((e=>e.destroy())),this._renderers.clear(),this._passParameters.texture=s(this._passParameters.texture),this.disposeOverlays()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}get pluginContext(){return this._pluginContext}initializeRenderContext(e){const r=new A(this._view.stage.renderView.textures,this._techniques,(()=>{this.notifyChange("rendersOccludedDraped"),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")}),(()=>this.events.emit("content-changed")));this._pluginContext={...e,materials:r},this._techniques.precompile(z)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||t(this._renderers,(e=>e.updating||e.canCompact))}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const r of this._renderers.values()){const t=r.getMaterialRenderer(e);if(t)return t}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),this._sortedRenderers.map((e=>e.drapeSource.layer)).filter((e=>!!e))}registerDrapeSource(e,r){const t=this._renderers.get(e);null!=t&&t.destroy(),this._renderers.set(e,r),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles(n((()=>e.fullOpacity),(()=>this.events.emit("content-changed"))),e)}removeDrapeSourceRenderer(e){if(null==e)return;const r=this._renderers.get(e);null!=r&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),r.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(){this._renderTargets?.dispose()}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&l(e,(e=>e.drapeTargetType===y.WithoutRasterImage))}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=l(e,(e=>e.drapeSourceType===m.Features)),this._hasDrapedRasterSource=l(e,(e=>e.drapeSourceType===m.RasterImage))):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,r,t=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new x(this._stage.renderer.fboCache),this._overlays=[new T,new T]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r),this._bindParameters.overlayStretch=t}disposeOverlays(){this._overlays=null,this._renderTargets=s(this._renderTargets),this.events.emit("textures-disposed")}getTexture(e){return e===w.ColorNoRasterImage&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource?this._renderTargets?.getTexture(w.Color):this._renderTargets?.getTexture(e)}get running(){return this.updating}runTask(e){this._processDrapeSources(e,(()=>!0))}_processDrapeSources(e,r){let s=!1;for(const[t,i]of this._renderers){if(e.done)break;(t.destroyed||r(t))&&(i.commitChanges()&&(s=!0,e.madeProgress()))}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,s=!0,this._updateSortedDrapeSourceRenderers(),e.madeProgress());for(const t of this._renderers.values())t.compact(e),this.notifyChange("updating");s&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this.events.emit("content-changed"),this.hasHighlights=t(this._renderers,(e=>e.hasHighlights)),this.notifyChange("rendersOccludedDraped"))}compact(e){let r=!1;for(const t of this._renderers.values()){if(e.done)break;r=t.compact(e)||r}return r&&this.notifyChange("updating"),r}hasHighlight(e){return t(this._renderers,(r=>r.hasHighlight(e)))}processSyncDrapeSources(){this._processDrapeSources(X,(e=>e.updatePolicy===G.SYNC))}get isEmpty(){return!R.OVERLAY_DRAW_DEBUG_TEXTURE&&!t(this._renderers,(e=>!e.isEmpty))}get hasWater(){const e=t(this._renderers,(({hasWater:e})=>e));return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}get rendersOccludedDraped(){const e=this._renderContext.renderOccludedMask;this._renderContext.renderOccludedMask=se,++this._techniques.precompiling;const r=this._sortedRenderers.some((({renderer:e})=>e.precompile(this._renderContext)));return--this._techniques.precompiling,this._renderContext.renderOccludedMask=e,r}renders(e){if(R.OVERLAY_DRAW_DEBUG_TEXTURE&&e!==w.Occluded&&e!==w.Highlight)return!0;if(!this._overlays)return!1;const r=this._overlays[b.INNER];for(const i of this._overlays)i.setupGeometryViews(this.longitudeCyclical);if(!r.hasSomeSizedView())return!1;const t=this._renderContext.output;this._renderContext.output=this._renderTargets?.targets.find((r=>r.content===e))?.output??v.Color,++this._techniques.precompiling;const s=this._sortedRenderers.some((({renderer:e})=>e.precompile(this._renderContext)));return--this._techniques.precompiling,this._renderContext.output=t,s}get mode(){return this.isEmpty?C.Disabled:this.hasWater&&this.renders(w.WaterNormal)?C.EnabledWithWater:this._renderTargets?.getTexture(w.Color)?C.Enabled:C.Disabled}updateAnimation(e){let r=!1;return this._renderers.forEach((t=>r=t.updateAnimation(e)||r)),r&&this.parent.requestRender(j.BACKGROUND),r}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return;const r=this._bindParameters;r.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const t of this._renderTargets.targets){if(t.content===w.ColorNoRasterImage&&!this._needsColorWithoutRasterImage)continue;const e=t.output;this._renderContext.output=e,r.slot=e===v.Normal?N.DRAPED_WATER:N.DRAPED_MATERIAL,e===v.Highlight&&(r.highlightMixTexture=r.highlights.length>1?this._rctx.emptyTexture:null),t.content===w.Occluded&&(this._renderContext.renderOccludedMask=se),this._sortedRenderers.forAll((({drapeSource:e,renderer:r})=>{t.content===w.ColorNoRasterImage&&e.drapeSourceType===m.RasterImage||r.precompile(this._renderContext)})),this._renderContext.renderOccludedMask=L,r.highlightMixTexture=null}--this._techniques.precompiling}drawOverlays(e){if(this._overlays&&this._renderTargets){for(const e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;for(const e of this._renderTargets.targets){if(e.content===w.ColorNoRasterImage&&!this._needsColorWithoutRasterImage)continue;const r=this._drawTarget(b.INNER,e),t=this._drawTarget(b.OUTER,e);(r||t)&&e.fbo.generateMipMap()}}}_drawTarget(e,r){const t=this._overlays[e],s=t.canvasGeometries;if(0===s.numViews)return!1;const i=this._view.state.contentPixelRatio;this._screenToWorldRatio=i*t.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:n}=r;if(this.isEmpty||n===v.Normal&&!this.hasWater||!t.hasSomeSizedView())return!1;const{_rctx:o,_camera:a,_renderContext:h,_bindParameters:l}=this;if(a.pixelRatio=t.pixelRatio*i,h.output=n,l.screenToWorldRatio=this._screenToWorldRatio,l.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,l.slot=n===v.Normal?N.DRAPED_WATER:N.DRAPED_MATERIAL,r.content===w.Occluded&&(h.renderOccludedMask=se),!this.renders(r.content))return h.renderOccludedMask=L,!1;const{resolution:d}=t,c=e===b.INNER,u=c?0:d;if(o.setViewport(u,0,d,d),this._bindTargetFBO(r),c)if(r.output!==v.Highlight)o.setClearColor(0,0,0,0),o.clear(K.COLOR);else{const{gl:e}=o;e.clearBufferuiv(e.COLOR,0,[0,0,0,0])}if(R.OVERLAY_DRAW_DEBUG_TEXTURE&&r.content!==w.Occluded&&r.content!==w.Highlight){this._techniques.precompile(F,ie);const r=this._techniques.get(F,ie);for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],t),this._ensureDebugPatternResources(t.resolution,re[e]),o.bindTechnique(r,l,this._passParameters),o.screen.draw()}if(r.output===v.Highlight){const{fboCache:t}=this._stage.renderer,s=this._resolution;this._bindTargetFBO(r),P(o,t,{width:s,height:s},l,(()=>this._renderAllGeometry(e,r)),u)}else this._renderAllGeometry(e,r);return o.bindFramebuffer(null),h.renderOccludedMask=L,!0}_renderAllGeometry(e,r){const t=this._overlays[e],s=t.canvasGeometries;this._sortedRenderers.forAll((({drapeSource:i,renderer:n})=>{if(r.content===w.ColorNoRasterImage&&i.drapeSourceType===m.RasterImage)return;const{fullOpacity:o}=i,a=null!=o&&o<1&&r.output===v.Color&&this._bindTemporaryFBO();for(let e=0;e<s.numViews;e++)this._setViewParameters(s.extents[e],t),n.render(this._renderContext);if(a){this._bindTargetFBO(r),this._overlayParameters.texture=a.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;const t=this._techniques.get(z);this._rctx.bindTechnique(t,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),a.release()}}))}_bindTargetFBO(e){const r=this._resolution,t=2*r;e.fbo.bind(this._rctx,t,r)}_bindTemporaryFBO(){const e=this._resolution,r=2*e,t=this._stage.renderer.fboCache,s=t.acquire(r,e,"overlay tmp");return t.rctx.bindFramebuffer(s.fbo),t.rctx.clear(K.COLOR),s}get _resolution(){return this._overlays?.[b.INNER].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersect(e,r,t,s){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(const{renderer:n}of this._sortedRenderers)i=n.intersect?.(e,r,t,s,i)??i}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers,r=e.length;this._renderers.forEach(((t,s)=>{const i=e.indexOf(s.layer),n=i>=0,o=s.renderGroup??(n?f.MapLayer:f.ViewLayer),a=s.drapeSourcePriorityOffset??0,h=r*o+(n?i:0)+a;this._sortedRenderers.push(new ee(s,t,h))})),this._sortedRenderers.sort(((e,r)=>e.index-r.index))}_setViewParameters(e,r){const t=this._camera;t.viewport=[0,0,r.resolution,r.resolution],u(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),p(t.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,r){if(g(this._passParameters.color,r[0],r[1],r[2]),this._passParameters.texture)return;const t=new Uint8Array(e*e*4);let s=0;for(let n=0;n<e;n++)for(let r=0;r<e;r++){const i=Math.floor(r/10),o=Math.floor(n/10);i<2||o<2||10*i>e-20||10*o>e-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&i&&1&o?1&r^1&n?0:255:1&i^1&o?0:128)}const i=new Z(e);i.samplingMode=J.NEAREST,this._passParameters.texture=new Q(this._rctx,i,t)}get test(){}};e([d()],$.prototype,"hasHighlights",void 0),e([d()],$.prototype,"_sortedDrapeSourceRenderersDirty",void 0),e([d({constructOnly:!0})],$.prototype,"parent",void 0),e([d({readOnly:!0})],$.prototype,"_techniques",null),e([d({type:Boolean,readOnly:!0})],$.prototype,"updating",null),e([d()],$.prototype,"isEmpty",null),e([d({readOnly:!0})],$.prototype,"rendersOccludedDraped",null),$=e([c("esri.views.3d.terrain.OverlayRenderer")],$);class ee{constructor(e,r,t){this.drapeSource=e,this.renderer=r,this.index=t}}const re=[[1,.5,.5],[.5,.5,1]],te=-2,se=W.OccludeAndTransparent,ie=new H;ie.hasAlpha=!0;export{$ as OverlayRenderer,te as drapedZ,se as overlayRenderOccludedFlag};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Evented.js";import"../../../core/has.js";import{someMap as t}from"../../../core/MapUtils.js";import{disposeMaybe as s}from"../../../core/maybe.js";import i from"../../../core/PooledArray.js";import{watch as n,on as o,syncAndInitial as a,initial as h}from"../../../core/reactiveUtils.js";import{someSet as l}from"../../../core/SetUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{ortho as u,fromTranslation as p}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{i as g}from"../../../chunks/vec32.js";import{ones as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{DrapeTargetType as m,DrapeSourceType as f,DrapedRenderGroup as y}from"../layers/interfaces.js";import{debugFlags as R}from"../support/debugFlags.js";import{OverlayIndex as b}from"./interfaces.js";import{Overlay as T}from"./Overlay.js";import{OverlayContent as w}from"./OverlayContent.js";import{OverlayRenderTargets as x}from"./OverlayRenderTargets.js";import D from"../webgl/RenderCamera.js";import{ShaderOutput as v}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{OverlayMode as C}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{T as O}from"../../../chunks/TextureOnly.glsl.js";import{SyncRenderPlugin as S}from"../webgl-engine/effects/RenderPlugin.js";import{trackHighlightOptions as E,renderHighlightBuffer as P}from"../webgl-engine/effects/highlight/Highlight.js";import{RenderRequestType as j}from"../webgl-engine/lib/basicInterfaces.js";import{GLMaterialRepository as A}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as M}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderOccludedFlag as W}from"../webgl-engine/lib/Material.js";import{OITPass as I}from"../webgl-engine/lib/OITPass.js";import{RenderContext as q,defaultRenderOccludedMask as L}from"../webgl-engine/lib/RenderContext.js";import{RenderSlot as N}from"../webgl-engine/lib/RenderSlot.js";import{ShadowMap as V}from"../webgl-engine/lib/ShadowMap.js";import{TextureTechnique as F}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as H}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{Update as k}from"../webgl-engine/lib/Update.js";import{UpdatePolicy as G}from"../webgl-engine/lib/UpdatePolicy.js";import{AmbientLight as U}from"../webgl-engine/lighting/Lightsources.js";import{O as B}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as z}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as Y,noBudget as X}from"../../support/Scheduler.js";import{FramebufferBit as K,TextureSamplingMode as J}from"../../webgl/enums.js";import{Texture as Q}from"../../webgl/Texture.js";import{TextureDescriptor as Z}from"../../webgl/TextureDescriptor.js";let $=class extends S{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new B,this.hasHighlights=!1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new i,this._passParameters=new O,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new D,this.events=new r,this.longitudeCyclical=null,this.produces=new Map([[N.DRAPED_MATERIAL,e=>e!==v.Highlight||this.hasHighlights],[N.DRAPED_WATER,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1}initialize(){const e=this._view,r=e.stage,t=r.renderer.fboCache,{waterTextures:s,techniques:i}=r.renderView;this._renderContext=new q(this._rctx,new V(t,e.state.viewingMode),i),this.addHandles([n((()=>s.updating),(()=>this.events.emit("content-changed")),a),n((()=>this.spatialReference),(e=>this._localOriginFactory=new M(e)),a),o((()=>e.allLayerViews),"after-changes",(()=>this._sortedDrapeSourceRenderersDirty=!0)),n((()=>E(e.state.highlights)),(()=>this._sortedDrapeSourceRenderersDirty=!0),h),n((()=>e.state.highlights),(r=>{this._bindParameters.highlights=r,this._bindParameters.highlightOrderMap=e.state.highlightOrderMap}),h),e.resourceController.scheduler.registerTask(Y.OVERLAY_RENDERER,this)]);const{_bindParameters:l,_camera:d}=this;d.near=1,d.far=1e4,d.relativeElevation=null,l.slot=N.DRAPED_MATERIAL,l.mainDepth=null,l.camera=d,l.oitPass=I.NONE,l.updateLighting([new U(_())],0,0,k.Immediate)}destroy(){this._renderers.forEach((e=>e.destroy())),this._renderers.clear(),this._passParameters.texture=s(this._passParameters.texture),this.disposeOverlays()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}get pluginContext(){return this._pluginContext}initializeRenderContext(e){const r=new A(this._view.stage.renderView.textures,this._techniques,(()=>{this.notifyChange("rendersOccludedDraped"),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")}),(()=>this.events.emit("content-changed")));this._pluginContext={...e,materials:r},this._techniques.precompile(z)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||t(this._renderers,(e=>e.updating||e.canCompact))}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const r of this._renderers.values()){const t=r.getMaterialRenderer(e);if(t)return t}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),this._sortedRenderers.map((e=>e.drapeSource.layer)).filter((e=>!!e))}registerDrapeSource(e,r){const t=this._renderers.get(e);null!=t&&t.destroy(),this._renderers.set(e,r),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles(n((()=>e.fullOpacity),(()=>this.events.emit("content-changed"))),e)}removeDrapeSourceRenderer(e){if(null==e)return;const r=this._renderers.get(e);null!=r&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),r.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(){this._renderTargets?.dispose()}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&l(e,(e=>e.drapeTargetType===m.WithoutRasterImage))}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=l(e,(e=>e.drapeSourceType===f.Features)),this._hasDrapedRasterSource=l(e,(e=>e.drapeSourceType===f.RasterImage))):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,r,t=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new x(this._stage.renderer.fboCache),this._overlays=[new T,new T]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r),this._bindParameters.overlayStretch=t}disposeOverlays(){this._overlays=null,this._renderTargets=s(this._renderTargets),this.events.emit("textures-disposed")}getTexture(e){return e===w.ColorNoRasterImage&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource?this._renderTargets?.getTexture(w.Color):this._renderTargets?.getTexture(e)}get running(){return this.updating}runTask(e){this._processDrapeSources(e,(()=>!0))}_processDrapeSources(e,r){let s=!1;for(const[t,i]of this._renderers){if(e.done)break;(t.destroyed||r(t))&&(i.commitChanges()&&(s=!0,e.madeProgress()))}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,s=!0,this._updateSortedDrapeSourceRenderers(),e.madeProgress());for(const t of this._renderers.values())t.compact(e),this.notifyChange("updating");s&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this.events.emit("content-changed"),this.hasHighlights=t(this._renderers,(e=>e.hasHighlights)),this.notifyChange("rendersOccludedDraped"))}compact(e){let r=!1;for(const t of this._renderers.values()){if(e.done)break;r=t.compact(e)||r}return r&&this.notifyChange("updating"),r}hasHighlight(e){return t(this._renderers,(r=>r.hasHighlight(e)))}processSyncDrapeSources(){this._processDrapeSources(X,(e=>e.updatePolicy===G.SYNC))}get isEmpty(){return!R.OVERLAY_DRAW_DEBUG_TEXTURE&&!t(this._renderers,(e=>!e.isEmpty))}get hasWater(){const e=t(this._renderers,(({hasWater:e})=>e));return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}get rendersOccludedDraped(){const e=this._renderContext.renderOccludedMask;this._renderContext.renderOccludedMask=se,++this._techniques.precompiling;const r=this._sortedRenderers.some((({renderer:e})=>e.precompile(this._renderContext)));return--this._techniques.precompiling,this._renderContext.renderOccludedMask=e,r}renders(e){if(R.OVERLAY_DRAW_DEBUG_TEXTURE&&e!==w.Occluded&&e!==w.Highlight)return!0;if(!this._overlays)return!1;const r=this._overlays[b.INNER];for(const i of this._overlays)i.setupGeometryViews(this.longitudeCyclical);if(!r.hasSomeSizedView())return!1;const t=this._renderContext.output;this._renderContext.output=this._renderTargets?.targets.find((r=>r.content===e))?.output??v.Color,++this._techniques.precompiling;const s=this._sortedRenderers.some((({renderer:e})=>e.precompile(this._renderContext)));return--this._techniques.precompiling,this._renderContext.output=t,s}get mode(){return this.isEmpty?C.Disabled:this.hasWater&&this.renders(w.WaterNormal)?C.EnabledWithWater:this._renderTargets?.getTexture(w.Color)?C.Enabled:C.Disabled}updateAnimation(e){let r=!1;return this._renderers.forEach((t=>r=t.updateAnimation(e)||r)),r&&this.parent.requestRender(j.BACKGROUND),r}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return;const r=this._bindParameters;r.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const t of this._renderTargets.targets){if(t.content===w.ColorNoRasterImage&&!this._needsColorWithoutRasterImage)continue;const e=t.output;this._renderContext.output=e,r.slot=e===v.Normal?N.DRAPED_WATER:N.DRAPED_MATERIAL,e===v.Highlight&&(r.highlightMixTexture=r.highlights.length>1?this._rctx.emptyTexture:null),t.content===w.Occluded&&(this._renderContext.renderOccludedMask=se),this._sortedRenderers.forAll((({drapeSource:e,renderer:r})=>{t.content===w.ColorNoRasterImage&&e.drapeSourceType===f.RasterImage||r.precompile(this._renderContext)})),this._renderContext.renderOccludedMask=L,r.highlightMixTexture=null}--this._techniques.precompiling}drawOverlays(e){if(this._overlays&&this._renderTargets){for(const e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;for(const e of this._renderTargets.targets){if(e.content===w.ColorNoRasterImage&&!this._needsColorWithoutRasterImage)continue;const r=this._drawTarget(b.INNER,e),t=this._drawTarget(b.OUTER,e);(r||t)&&e.fbo.generateMipMap()}}}_drawTarget(e,r){const t=this._overlays[e],s=t.canvasGeometries;if(0===s.numViews)return!1;const i=this._view.state.contentPixelRatio;this._screenToWorldRatio=i*t.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:n}=r;if(this.isEmpty||n===v.Normal&&!this.hasWater||!t.hasSomeSizedView())return!1;const{_rctx:o,_camera:a,_renderContext:h,_bindParameters:l}=this;if(a.pixelRatio=t.pixelRatio*i,h.output=n,l.screenToWorldRatio=this._screenToWorldRatio,l.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,l.slot=n===v.Normal?N.DRAPED_WATER:N.DRAPED_MATERIAL,r.content===w.Occluded&&(h.renderOccludedMask=se),!this.renders(r.content))return h.renderOccludedMask=L,!1;const{resolution:d}=t,c=e===b.INNER,u=c?0:d;if(o.setViewport(u,0,d,d),this._bindTargetFBO(r),c)if(r.output!==v.Highlight)o.setClearColor(0,0,0,0),o.clear(K.COLOR);else{const{gl:e}=o;e.clearBufferuiv(e.COLOR,0,[0,0,0,0])}if(R.OVERLAY_DRAW_DEBUG_TEXTURE&&r.content!==w.Occluded&&r.content!==w.Highlight){this._techniques.precompile(F,ie);const r=this._techniques.get(F,ie);for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],t),this._ensureDebugPatternResources(t.resolution,re[e]),o.bindTechnique(r,l,this._passParameters),o.screen.draw()}if(r.output===v.Highlight){const{fboCache:t}=this._stage.renderer,s=this._resolution;this._bindTargetFBO(r),P(o,t,{width:s,height:s},l,(()=>this._renderAllGeometry(e,r)),u)}else this._renderAllGeometry(e,r);return o.bindFramebuffer(null),h.renderOccludedMask=L,!0}_renderAllGeometry(e,r){const t=this._overlays[e],s=t.canvasGeometries;this._sortedRenderers.forAll((({drapeSource:i,renderer:n})=>{if(r.content===w.ColorNoRasterImage&&i.drapeSourceType===f.RasterImage)return;const{fullOpacity:o}=i,a=null!=o&&o<1&&r.output===v.Color&&this._bindTemporaryFBO();for(let e=0;e<s.numViews;e++)this._setViewParameters(s.extents[e],t),n.render(this._renderContext);if(a){this._bindTargetFBO(r),this._overlayParameters.texture=a.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;const t=this._techniques.get(z);this._rctx.bindTechnique(t,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),a.release()}}))}_bindTargetFBO(e){const r=this._resolution,t=2*r;e.fbo.bind(this._rctx,t,r)}_bindTemporaryFBO(){const e=this._resolution,r=2*e,t=this._stage.renderer.fboCache,s=t.acquire(r,e,"overlay tmp");return t.rctx.bindFramebuffer(s.fbo),t.rctx.clear(K.COLOR),s}get _resolution(){return this._overlays?.[b.INNER].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersect(e,r,t,s){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(const{renderer:n}of this._sortedRenderers)i=n.intersect?.(e,r,t,s,i)??i}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers,r=e.length;this._renderers.forEach(((t,s)=>{const i=e.indexOf(s.layer),n=i>=0,o=s.renderGroup??(n?y.MapLayer:y.ViewLayer),a=s.drapeSourcePriorityOffset??0,h=r*o+(n?i:0)+a;this._sortedRenderers.push(new ee(s,t,h))})),this._sortedRenderers.sort(((e,r)=>e.index-r.index))}_setViewParameters(e,r){const t=this._camera;t.viewport=[0,0,r.resolution,r.resolution],u(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),p(t.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,r){if(g(this._passParameters.color,r[0],r[1],r[2]),this._passParameters.texture)return;const t=new Uint8Array(e*e*4);let s=0;for(let n=0;n<e;n++)for(let r=0;r<e;r++){const i=Math.floor(r/10),o=Math.floor(n/10);i<2||o<2||10*i>e-20||10*o>e-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&i&&1&o?1&r^1&n?0:255:1&i^1&o?0:128)}const i=new Z(e);i.samplingMode=J.NEAREST,this._passParameters.texture=new Q(this._rctx,i,t)}get test(){}};e([d()],$.prototype,"hasHighlights",void 0),e([d()],$.prototype,"_sortedDrapeSourceRenderersDirty",void 0),e([d({constructOnly:!0})],$.prototype,"parent",void 0),e([d({readOnly:!0})],$.prototype,"_techniques",null),e([d({type:Boolean,readOnly:!0})],$.prototype,"updating",null),e([d()],$.prototype,"isEmpty",null),e([d({readOnly:!0})],$.prototype,"rendersOccludedDraped",null),$=e([c("esri.views.3d.terrain.OverlayRenderer")],$);class ee{constructor(e,r,t){this.drapeSource=e,this.renderer=r,this.index=t}}const re=[[1,.5,.5],[.5,.5,1]],te=-2,se=W.OccludeAndTransparent,ie=new H;ie.hasAlpha=!0;export{$ as OverlayRenderer,te as drapedZ,se as overlayRenderOccludedFlag};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import i from"../../../core/Accessor.js";import e from"../../../core/Logger.js";import{lerp as r}from"../../../core/mathUtils.js";import{createScreenPointArray as s,createRenderScreenPointArray3 as o}from"../../../core/screenUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{copy as a,multiply as p,invert as u,transpose as l,frustum as _,equals as c,lookAt as v}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as d,exactEquals as y}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as g}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{d as m,i as f,j as x,c as M,q as D,a as j,e as T,y as R,x as P,g as F,l as V,h as O,n as b,E as C}from"../../../chunks/vec32.js";import{create as S}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{b as I,e as E,a as L,c as H,d as A,t as G}from"../../../chunks/vec42.js";import{fromValues as B,create as U}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as k,copy as z,fromMatrix as W}from"../../../geometry/support/frustum.js";import{create as q}from"../../../geometry/support/ray.js";import{projectPointSignedLength as X}from"../../../geometry/support/vector.js";import{ViewingMode as Y}from"../../ViewingMode.js";import{fovd2fovx as N,fovx2fovd as J,fovd2fovy as K,fovy2fovd as Q}from"../webgl-engine/lib/fov.js";import{PaddingSide as Z}from"../webgl-engine/lib/rendererUtils.js";var $;let tt=$=class extends i{constructor(t){super(t),this._ray=q(),this._viewport=B(0,0,1,1),this._padding=B(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=g(1,1e3),this._viewDirty=!0,this._viewMatrix=w(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=w(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=w(),this._frustumDirty=!0,this._frustum=k(),this._fullViewport=U(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=S(),this._up=S(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return m(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){a(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),f(S(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),f(S(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),f(S(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=I(U(),this._viewport,1/this.pixelRatio),i=this._get("screenViewport");return i&&E(t,i)?i:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=I(U(),this._padding,1/this.pixelRatio),i=this._get("screenPadding");return i&&E(t,i)?i:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[Z.LEFT],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[Z.BOTTOM],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[Z.RIGHT]+this._padding[Z.LEFT]}set fullWidth(t){this.width=t-(this._padding[Z.RIGHT]+this._padding[Z.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[Z.TOP]+this._padding[Z.BOTTOM]}set fullHeight(t){this.height=t-(this._padding[Z.TOP]+this._padding[Z.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[Z.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[Z.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){L(this._padding,t)||(this._viewport[0]+=t[Z.LEFT]-this._padding[Z.LEFT],this._viewport[1]+=t[Z.BOTTOM]-this._padding[Z.BOTTOM],this._viewport[2]-=t[Z.RIGHT]+t[Z.LEFT]-(this._padding[Z.RIGHT]+this._padding[Z.LEFT]),this._viewport[3]-=t[Z.TOP]+t[Z.BOTTOM]-(this._padding[Z.TOP]+this._padding[Z.BOTTOM]),H(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(p(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return u(w(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||w()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return N(this._fov,this.width,this.height)}set fovX(t){this._fov=J(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return K(this._fov,this.width,this.height)}set fovY(t){this._fov=Q(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return x(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(u(this._viewInverseTransposeMatrix,this.viewMatrix),l(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:i,far:e}=this;return 2*i*e/(e+i-t*(e-i))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const t=this.width,i=this.height,e=this.near*Math.tan(this.fovY/2)*2,r=e*this._aspect,s=e/this.rows,o=r/this.columns,n=-r/2+this.column*o,h=n+o,a=-e/2+this.row*s,p=a+s,u=_(w(),n*(1+2*this._padding[Z.LEFT]/t),h*(1+2*this._padding[Z.RIGHT]/t),a*(1+2*this._padding[Z.BOTTOM]/i),p*(1+2*this._padding[Z.TOP]/i),this.near,this.far),l=this._get("projectionMatrix");return l&&c(l,u)?l:u}copyFrom(t){M(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,H(this._viewport,t.viewport),this.notifyChange("_viewport"),H(this._padding,t.padding),this.notifyChange("_padding"),d(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const i=t;return this._viewDirty=i._viewDirty,this._viewDirty||(a(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=i._frustumDirty,this._frustumDirty||(z(this._frustum,t.frustum),this._frustumDirty=!1),i._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(a(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),H(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new $).copyFrom(this)}equals(t){return D(this.eye,t.eye)&&D(this.center,t.center)&&D(this.up,t.up)&&L(this._viewport,t.viewport)&&L(this._padding,t.padding)&&y(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}almostEquals(t){const i=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||A(t.screenPadding,this.screenPadding)>=i||A(this.screenViewport,t.screenViewport)>=i||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;j(st,t.eye,t.center),j(ot,this.eye,this.center);const e=T(st,ot),r=R(st),s=R(ot),o=5e-4;return e*e>=(1-1e-10)*r*s&&P(t.eye,this.eye)<Math.max(r,s)*o*o}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs(X(this.viewForward,m(st,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,i){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(i||1)))}getScreenCenter(t=s()){return t[0]=(this.padding[Z.LEFT]+this.width/2)/this.pixelRatio,t[1]=(this.padding[Z.TOP]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,i=.5,e=.5){return t[0]=this.padding[Z.LEFT]+this.width*i,t[1]=this.padding[Z.BOTTOM]+this.height*e,t[2]=.5,t}setGLViewport(t){const i=this.viewport,e=this.padding;t.setViewport(i[0]-e[3],i[1]-e[2],i[2]+e[1]+e[3],i[3]+e[0]+e[2])}applyProjection(t,i){t!==et&&M(et,t),et[3]=1,G(et,et,this.projectionMatrix);const e=Math.abs(et[3]);F(et,et,1/e);const s=this.fullViewport;i[0]=r(0,s[0]+s[2],.5+.5*et[0]),i[1]=r(0,s[1]+s[3],.5+.5*et[1]),i[2]=.5*(et[2]+1),i[3]=e}unapplyProjection(t,i){const e=this.fullViewport;et[0]=(t[0]/(e[0]+e[2])*2-1)*t[3],et[1]=(t[1]/(e[1]+e[3])*2-1)*t[3],et[2]=(2*t[2]-1)*t[3],et[3]=t[3],null!=this.inverseProjectionMatrix&&(G(et,et,this.inverseProjectionMatrix),i[0]=et[0],i[1]=et[1],i[2]=et[2])}projectToScreen(t,i){return this.projectToRenderScreen(t,nt),this.renderToScreen(nt,i),i}projectToRenderScreen(t,i){if(et[0]=t[0],et[1]=t[1],et[2]=t[2],et[3]=1,G(et,et,this.viewProjectionMatrix),0===et[3])return null;const e=et;F(e,e,1/Math.abs(et[3]));const s=this.fullViewport,o=r(0,s[0]+s[2],.5+.5*e[0]),n=r(0,s[1]+s[3],.5+.5*e[1]);return"x"in i?(i.x=o,i.y=n):(i[0]=o,i[1]=n,i.length>2&&(i[2]=.5*(e[2]+1))),i}unprojectFromScreen(t,i){return this.unprojectFromRenderScreen(this.screenToRender(t,nt),i)}unprojectFromRenderScreen(t,i){if(p(rt,this.projectionMatrix,this.viewMatrix),!u(rt,rt))return null;const e=this.fullViewport;return et[0]=2*(t[0]-e[0])/e[2]-1,et[1]=2*(t[1]-e[1])/e[3]-1,et[2]=2*t[2]-1,et[3]=1,G(et,et,rt),0===et[3]?null:(i[0]=et[0]/et[3],i[1]=et[1]/et[3],i[2]=et[2]/et[3],i)}constrainWindowSize(t,i,e,r){const s=t*this.pixelRatio,o=i*this.pixelRatio,n=Math.max(s-e/2,0),h=Math.max(this.fullHeight-o-r/2,0),a=-Math.min(s-e/2,0),p=-Math.min(this.fullHeight-o-r/2,0),u=e-a- -Math.min(this.fullWidth-s-e/2,0),l=r-p- -Math.min(o-r/2,0);return[Math.round(n),Math.round(h),Math.round(u),Math.round(l)]}computeUp(t){t===Y.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,i){const e=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return i[0]=e,i[1]=r,i}renderToScreen(t,i){const e=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;i[0]=e,i[1]=r}_computeUpGlobal(){m(st,this.center,this.eye);const t=V(this.center);t<1?(f(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(T(st,this.center))>.9999*V(st)*t||(O(this._up,st,this.center),O(this._up,this._up,st),b(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){C(st,this.eye,this.center),Math.abs(st[2])<=.9999&&(F(st,st,st[2]),f(this._up,-st[0],-st[1],1-st[2]),b(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(t,i,r=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?D(t,i)||(M(i,t),this._markViewDirty(),r.length&&this.notifyChange(r)):e.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(W(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(v(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};t([n()],tt.prototype,"_viewport",void 0),t([n()],tt.prototype,"_padding",void 0),t([n()],tt.prototype,"_fov",void 0),t([n()],tt.prototype,"_nearFar",void 0),t([n()],tt.prototype,"_viewDirty",void 0),t([n()],tt.prototype,"_viewMatrix",void 0),t([n()],tt.prototype,"_pixelRatio",void 0),t([n()],tt.prototype,"pixelRatio",null),t([n()],tt.prototype,"row",void 0),t([n()],tt.prototype,"column",void 0),t([n()],tt.prototype,"_rows",void 0),t([n()],tt.prototype,"rows",null),t([n()],tt.prototype,"_columns",void 0),t([n()],tt.prototype,"columns",null),t([n()],tt.prototype,"eye",null),t([n()],tt.prototype,"center",null),t([n()],tt.prototype,"_center",void 0),t([n()],tt.prototype,"up",null),t([n()],tt.prototype,"_up",void 0),t([n()],tt.prototype,"viewMatrix",null),t([n({readOnly:!0})],tt.prototype,"viewForward",null),t([n({readOnly:!0})],tt.prototype,"viewUp",null),t([n({readOnly:!0})],tt.prototype,"viewRight",null),t([n({readOnly:!0})],tt.prototype,"nearFar",null),t([n()],tt.prototype,"near",null),t([n()],tt.prototype,"far",null),t([n()],tt.prototype,"viewport",null),t([n({readOnly:!0})],tt.prototype,"screenViewport",null),t([n({readOnly:!0})],tt.prototype,"screenPadding",null),t([n()],tt.prototype,"x",null),t([n()],tt.prototype,"y",null),t([n()],tt.prototype,"width",null),t([n()],tt.prototype,"height",null),t([n()],tt.prototype,"fullWidth",null),t([n()],tt.prototype,"fullHeight",null),t([n({readOnly:!0})],tt.prototype,"_aspect",null),t([n()],tt.prototype,"padding",null),t([n({readOnly:!0})],tt.prototype,"projectionMatrix",null),t([n({readOnly:!0})],tt.prototype,"inverseProjectionMatrix",null),t([n()],tt.prototype,"fov",null),t([n()],tt.prototype,"fovX",null),t([n()],tt.prototype,"fovY",null),t([n()],tt.prototype,"viewInverseTransposeMatrix",null),t([n({readOnly:!0})],tt.prototype,"_projectionMatrixInternal",null),t([n()],tt.prototype,"relativeElevation",void 0),tt=$=t([h("esri.views.3d.webgl.RenderCamera")],tt);const it=tt,et=U(),rt=w(),st=S(),ot=S(),nt=o();export{it as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import i from"../../../core/Accessor.js";import e from"../../../core/Logger.js";import{lerp as r}from"../../../core/mathUtils.js";import{createScreenPointArray as s,createRenderScreenPointArray3 as o}from"../../../core/screenUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{copy as a,multiply as p,invert as u,transpose as l,frustum as _,equals as c,lookAt as v}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as d,exactEquals as y}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as g}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{d as m,i as f,j as x,c as M,q as D,a as j,e as T,y as R,x as P,g as F,l as V,h as O,n as C,E as b}from"../../../chunks/vec32.js";import{create as S}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{d as I,e as E,a as L,c as H,f as A,t as G}from"../../../chunks/vec42.js";import{fromValues as B,create as U}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as k,copy as z,fromMatrix as W}from"../../../geometry/support/frustum.js";import{create as q}from"../../../geometry/support/ray.js";import{projectPointSignedLength as X}from"../../../geometry/support/vector.js";import{ViewingMode as Y}from"../../ViewingMode.js";import{fovd2fovx as N,fovx2fovd as J,fovd2fovy as K,fovy2fovd as Q}from"../webgl-engine/lib/fov.js";import{PaddingSide as Z}from"../webgl-engine/lib/rendererUtils.js";var $;let tt=$=class extends i{constructor(t){super(t),this._ray=q(),this._viewport=B(0,0,1,1),this._padding=B(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=g(1,1e3),this._viewDirty=!0,this._viewMatrix=w(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=w(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=w(),this._frustumDirty=!0,this._frustum=k(),this._fullViewport=U(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=S(),this._up=S(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return m(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){a(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),f(S(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),f(S(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),f(S(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=I(U(),this._viewport,1/this.pixelRatio),i=this._get("screenViewport");return i&&E(t,i)?i:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=I(U(),this._padding,1/this.pixelRatio),i=this._get("screenPadding");return i&&E(t,i)?i:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[Z.LEFT],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[Z.BOTTOM],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[Z.RIGHT]+this._padding[Z.LEFT]}set fullWidth(t){this.width=t-(this._padding[Z.RIGHT]+this._padding[Z.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[Z.TOP]+this._padding[Z.BOTTOM]}set fullHeight(t){this.height=t-(this._padding[Z.TOP]+this._padding[Z.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[Z.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[Z.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){L(this._padding,t)||(this._viewport[0]+=t[Z.LEFT]-this._padding[Z.LEFT],this._viewport[1]+=t[Z.BOTTOM]-this._padding[Z.BOTTOM],this._viewport[2]-=t[Z.RIGHT]+t[Z.LEFT]-(this._padding[Z.RIGHT]+this._padding[Z.LEFT]),this._viewport[3]-=t[Z.TOP]+t[Z.BOTTOM]-(this._padding[Z.TOP]+this._padding[Z.BOTTOM]),H(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(p(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return u(w(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||w()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return N(this._fov,this.width,this.height)}set fovX(t){this._fov=J(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return K(this._fov,this.width,this.height)}set fovY(t){this._fov=Q(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return x(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(u(this._viewInverseTransposeMatrix,this.viewMatrix),l(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:i,far:e}=this;return 2*i*e/(e+i-t*(e-i))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const t=this.width,i=this.height,e=this.near*Math.tan(this.fovY/2)*2,r=e*this._aspect,s=e/this.rows,o=r/this.columns,n=-r/2+this.column*o,h=n+o,a=-e/2+this.row*s,p=a+s,u=_(w(),n*(1+2*this._padding[Z.LEFT]/t),h*(1+2*this._padding[Z.RIGHT]/t),a*(1+2*this._padding[Z.BOTTOM]/i),p*(1+2*this._padding[Z.TOP]/i),this.near,this.far),l=this._get("projectionMatrix");return l&&c(l,u)?l:u}copyFrom(t){M(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,H(this._viewport,t.viewport),this.notifyChange("_viewport"),H(this._padding,t.padding),this.notifyChange("_padding"),d(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const i=t;return this._viewDirty=i._viewDirty,this._viewDirty||(a(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=i._frustumDirty,this._frustumDirty||(z(this._frustum,t.frustum),this._frustumDirty=!1),i._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(a(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),H(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new $).copyFrom(this)}equals(t){return D(this.eye,t.eye)&&D(this.center,t.center)&&D(this.up,t.up)&&L(this._viewport,t.viewport)&&L(this._padding,t.padding)&&y(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}almostEquals(t){const i=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||A(t.screenPadding,this.screenPadding)>=i||A(this.screenViewport,t.screenViewport)>=i||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;j(st,t.eye,t.center),j(ot,this.eye,this.center);const e=T(st,ot),r=R(st),s=R(ot),o=5e-4;return e*e>=(1-1e-10)*r*s&&P(t.eye,this.eye)<Math.max(r,s)*o*o}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs(X(this.viewForward,m(st,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,i){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(i||1)))}getScreenCenter(t=s()){return t[0]=(this.padding[Z.LEFT]+this.width/2)/this.pixelRatio,t[1]=(this.padding[Z.TOP]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,i=.5,e=.5){return t[0]=this.padding[Z.LEFT]+this.width*i,t[1]=this.padding[Z.BOTTOM]+this.height*e,t[2]=.5,t}setGLViewport(t){const i=this.viewport,e=this.padding;t.setViewport(i[0]-e[3],i[1]-e[2],i[2]+e[1]+e[3],i[3]+e[0]+e[2])}applyProjection(t,i){t!==et&&M(et,t),et[3]=1,G(et,et,this.projectionMatrix);const e=Math.abs(et[3]);F(et,et,1/e);const s=this.fullViewport;i[0]=r(0,s[0]+s[2],.5+.5*et[0]),i[1]=r(0,s[1]+s[3],.5+.5*et[1]),i[2]=.5*(et[2]+1),i[3]=e}unapplyProjection(t,i){const e=this.fullViewport;et[0]=(t[0]/(e[0]+e[2])*2-1)*t[3],et[1]=(t[1]/(e[1]+e[3])*2-1)*t[3],et[2]=(2*t[2]-1)*t[3],et[3]=t[3],null!=this.inverseProjectionMatrix&&(G(et,et,this.inverseProjectionMatrix),i[0]=et[0],i[1]=et[1],i[2]=et[2])}projectToScreen(t,i){return this.projectToRenderScreen(t,nt),this.renderToScreen(nt,i),i}projectToRenderScreen(t,i){if(et[0]=t[0],et[1]=t[1],et[2]=t[2],et[3]=1,G(et,et,this.viewProjectionMatrix),0===et[3])return null;const e=et;F(e,e,1/Math.abs(et[3]));const s=this.fullViewport,o=r(0,s[0]+s[2],.5+.5*e[0]),n=r(0,s[1]+s[3],.5+.5*e[1]);return"x"in i?(i.x=o,i.y=n):(i[0]=o,i[1]=n,i.length>2&&(i[2]=.5*(e[2]+1))),i}unprojectFromScreen(t,i){return this.unprojectFromRenderScreen(this.screenToRender(t,nt),i)}unprojectFromRenderScreen(t,i){if(p(rt,this.projectionMatrix,this.viewMatrix),!u(rt,rt))return null;const e=this.fullViewport;return et[0]=2*(t[0]-e[0])/e[2]-1,et[1]=2*(t[1]-e[1])/e[3]-1,et[2]=2*t[2]-1,et[3]=1,G(et,et,rt),0===et[3]?null:(i[0]=et[0]/et[3],i[1]=et[1]/et[3],i[2]=et[2]/et[3],i)}constrainWindowSize(t,i,e,r){const s=t*this.pixelRatio,o=i*this.pixelRatio,n=Math.max(s-e/2,0),h=Math.max(this.fullHeight-o-r/2,0),a=-Math.min(s-e/2,0),p=-Math.min(this.fullHeight-o-r/2,0),u=e-a- -Math.min(this.fullWidth-s-e/2,0),l=r-p- -Math.min(o-r/2,0);return[Math.round(n),Math.round(h),Math.round(u),Math.round(l)]}computeUp(t){t===Y.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,i){const e=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return i[0]=e,i[1]=r,i}renderToScreen(t,i){const e=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;i[0]=e,i[1]=r}_computeUpGlobal(){m(st,this.center,this.eye);const t=V(this.center);t<1?(f(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(T(st,this.center))>.9999*V(st)*t||(O(this._up,st,this.center),O(this._up,this._up,st),C(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){b(st,this.eye,this.center),Math.abs(st[2])<=.9999&&(F(st,st,st[2]),f(this._up,-st[0],-st[1],1-st[2]),C(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(t,i,r=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?D(t,i)||(M(i,t),this._markViewDirty(),r.length&&this.notifyChange(r)):e.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(W(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(v(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};t([n()],tt.prototype,"_viewport",void 0),t([n()],tt.prototype,"_padding",void 0),t([n()],tt.prototype,"_fov",void 0),t([n()],tt.prototype,"_nearFar",void 0),t([n()],tt.prototype,"_viewDirty",void 0),t([n()],tt.prototype,"_viewMatrix",void 0),t([n()],tt.prototype,"_pixelRatio",void 0),t([n()],tt.prototype,"pixelRatio",null),t([n()],tt.prototype,"row",void 0),t([n()],tt.prototype,"column",void 0),t([n()],tt.prototype,"_rows",void 0),t([n()],tt.prototype,"rows",null),t([n()],tt.prototype,"_columns",void 0),t([n()],tt.prototype,"columns",null),t([n()],tt.prototype,"eye",null),t([n()],tt.prototype,"center",null),t([n()],tt.prototype,"_center",void 0),t([n()],tt.prototype,"up",null),t([n()],tt.prototype,"_up",void 0),t([n()],tt.prototype,"viewMatrix",null),t([n({readOnly:!0})],tt.prototype,"viewForward",null),t([n({readOnly:!0})],tt.prototype,"viewUp",null),t([n({readOnly:!0})],tt.prototype,"viewRight",null),t([n({readOnly:!0})],tt.prototype,"nearFar",null),t([n()],tt.prototype,"near",null),t([n()],tt.prototype,"far",null),t([n()],tt.prototype,"viewport",null),t([n({readOnly:!0})],tt.prototype,"screenViewport",null),t([n({readOnly:!0})],tt.prototype,"screenPadding",null),t([n()],tt.prototype,"x",null),t([n()],tt.prototype,"y",null),t([n()],tt.prototype,"width",null),t([n()],tt.prototype,"height",null),t([n()],tt.prototype,"fullWidth",null),t([n()],tt.prototype,"fullHeight",null),t([n({readOnly:!0})],tt.prototype,"_aspect",null),t([n()],tt.prototype,"padding",null),t([n({readOnly:!0})],tt.prototype,"projectionMatrix",null),t([n({readOnly:!0})],tt.prototype,"inverseProjectionMatrix",null),t([n()],tt.prototype,"fov",null),t([n()],tt.prototype,"fovX",null),t([n()],tt.prototype,"fovY",null),t([n()],tt.prototype,"viewInverseTransposeMatrix",null),t([n({readOnly:!0})],tt.prototype,"_projectionMatrixInternal",null),t([n()],tt.prototype,"relativeElevation",void 0),tt=$=t([h("esri.views.3d.webgl.RenderCamera")],tt);const it=tt,et=U(),rt=w(),st=S(),ot=S(),nt=o();export{it as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import t from"../../../core/Error.js";import{watch as i,initial as s}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{RenderCategory as d}from"../webgl.js";import{RenderRequestType as a}from"../webgl-engine/lib/basicInterfaces.js";let u=class extends r{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=d.COMPOSITE,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([i((()=>this.view.ready),(e=>{e&&this.view.stage?.renderer.addRenderNode(this)}),s)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new t("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,r=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return r.fbo?.initializeAndBind(),r}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){e===a.UPDATE&&this.view.stage?.renderView.requestRender(e),this._dirty=!0}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find((({name:e})=>e===this.produces));try{return this.render(e)}finally{this._frameBuffer=null}}};e([n({constructOnly:!0})],u.prototype,"view",void 0),e([n({constructOnly:!0})],u.prototype,"consumes",void 0),e([n()],u.prototype,"produces",void 0),e([n({readOnly:!0})],u.prototype,"techniques",null),u=e([o("esri.views.3d.webgl.RenderNode")],u);const h=u;export{h as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import t from"../../../core/Error.js";import{watch as i,initial as s}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{RenderCategory as d}from"../webgl.js";import{RenderRequestType as a}from"../webgl-engine/lib/basicInterfaces.js";let u=class extends r{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=d.COMPOSITE,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([i((()=>this.view.ready),(e=>{e&&this.view.stage?.renderer.addRenderNode(this)}),s)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new t("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,r=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return r.fbo?.initializeAndBind(),r}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){e===a.UPDATE&&this.view.stage?.renderView.requestRender(e),this._dirty=!0}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find((({name:e})=>e===this.produces));try{return this.render(e)}finally{this._frameBuffer=null}}};e([n({constructOnly:!0})],u.prototype,"view",void 0),e([n({constructOnly:!0})],u.prototype,"consumes",void 0),e([n()],u.prototype,"produces",void 0),e([n({readOnly:!0})],u.prototype,"techniques",null),u=e([o("esri.views.3d.webgl.RenderNode")],u);export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{ManagedColorAttachment as t}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as r}from"../../webgl/ManagedDepthTexture.js";import a from"../../webgl/ManagedFBO.js";import{ColorFormat as c,isDepthFormat as h,DepthTextureFormats as i,ColorFormats as n,DepthFormat as o}from"./FBOCacheFormats.js";import{FBOPool as s}from"./FBOPool.js";import{DepthStencilAttachment as l,ColorAttachment0 as u}from"../../../webgl/enums.js";import{FramebufferObject as m}from"../../../webgl/FramebufferObject.js";import{Texture as d}from"../../../webgl/Texture.js";class f{constructor(e){this.rctx=e,this._interactive=!1,this._acquired=new Set,this._cache=new s(e.newCache,"FBOCache"),this._depthCache=new s(e.newCache,"DepthAttachmentCache"),this._colorCache=new s(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.()}frameEnd(){const{debugCallback:e}=this;e&&this._acquired.forEach((t=>e(t.name,t.fbo)))}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+t.cachedMemory),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e,this._interactive=e}get interactive(){return this._interactive}acquire(t,r,i,n=c.RGBA8UNORM){const s=w(n,t,r);let d=this._cache.pop(s);const{rctx:f}=this;if(d){d.retain(),d.setName(i);const t=d.getAttachment(l);t&&(t.name=_(i));const r=d.getAttachment(u);r&&(r.name=p(i,0));const{fbo:a}=d;if(!a)throw new e("renderer","attempt to use a none existing framebuffer");f.temporaryBindFramebufferObject(a,(()=>{f.setDrawBuffers([u]),f.unbindTexture(a.colorTexture)}))}else{const e=new m(f),C=(e,a,h)=>{a??=c.RGBA8UNORM;const i=this._acquireColor(a,t,r,h??p(d.name,e-u));return this.rctx.unbindTexture(i.attachment),d.attachColor(i,e),i.release(),d},w=e=>{e??=o.DEPTH24_STENCIL8;const a=this.acquireDepth(e,t,r,_(d.name));return d.attachDepth(a),a.release(),d},b=()=>{this.debugCallback?.(d.name,d.fbo),this._acquired.delete(d);const e=h(n);e&&null!=d?.getAttachment(l)||!e&&null!=d?.getAttachment(u)?(e?(d.fbo?.invalidateAttachments([l]),d.detachAllColors()):(d.fbo?.invalidateAttachments([u]),d.detachAllButColor0()),this._cache.put(d)):d?.dispose()};d=new a(s,i,e,C,w,b),h(n)?d.acquireDepth(n):d.acquireColor(u,n,i)}return this._trackHandle(d)}acquireDepth(e,t,a,c){const h=w(e,t,a);let n=this._depthCache.pop(h);if(n)n.retain(),n.attachment.setShadowFiltering(!1);else{const c=new d(this.rctx,{...i[e],width:t,height:a});n=new r(h,c,(()=>this._depthCache.put(n)))}return n.name=c,n}_acquireColor(e,r,a,c){const h=w(e,r,a),i=this._colorCache.pop(h);if(i)return i.retain(),i.name=c,i;const o=new t(h,new d(this.rctx,{...n[e],width:r,height:a}),(()=>{this._colorCache.put(o)}));return o.name=c,o}_trackHandle(e){return this._acquired.add(e),e}}function p(e,t=0){return`${e}.color${t}`}function _(e){return`${e}.depth`}const C=new a("default","default",null,(()=>C),(()=>C),(()=>{}));function w(e,t,r){return`${t}x${r}:${e}`}C.release=()=>!1;export{f as FBOCache,C as defaultWebGLFBO};
5
+ import e from"../../../../core/Error.js";import{ManagedColorAttachment as t}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as r}from"../../webgl/ManagedDepthTexture.js";import a from"../../webgl/ManagedFBO.js";import{ColorFormat as c,isDepthFormat as h,DepthTextureFormats as i,ColorFormats as o,DepthFormat as n}from"./FBOCacheFormats.js";import{FBOPool as s}from"./FBOPool.js";import{DepthStencilAttachment as l,ColorAttachment0 as u}from"../../../webgl/enums.js";import{FramebufferObject as m}from"../../../webgl/FramebufferObject.js";import{Texture as d}from"../../../webgl/Texture.js";class f{constructor(e){this.rctx=e,this._interactive=!1,this._acquired=new Set,this._cache=new s(e.newCache,"FBOCache"),this._depthCache=new s(e.newCache,"DepthAttachmentCache"),this._colorCache=new s(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.()}frameEnd(){const{debugCallback:e}=this;e&&this._acquired.forEach((t=>e(t.name,t.fbo)))}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+t.cachedMemory),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e,this._interactive=e}get interactive(){return this._interactive}acquire(t,r,i,o=c.RGBA8UNORM){const s=w(o,t,r);let d=this._cache.pop(s);const{rctx:f}=this;if(d){d.retain(),d.setName(i);const t=d.getAttachment(l);t&&(t.name=_(i));const r=d.getAttachment(u);r&&(r.name=p(i,0));const{fbo:a}=d;if(!a)throw new e("renderer","attempt to use a none existing framebuffer");f.temporaryBindFramebufferObject(a,(()=>{f.setDrawBuffers([u]),f.unbindTexture(a.colorTexture)}))}else{const e=new m(f),C=(e,a,h)=>{a??=c.RGBA8UNORM;const i=this._acquireColor(a,t,r,h??p(d.name,e-u));return this.rctx.unbindTexture(i.attachment),d.attachColor(i,e),i.release(),d},w=e=>{e??=n.DEPTH24_STENCIL8;const a=this.acquireDepth(e,t,r,_(d.name));return d.attachDepth(a),a.release(),d},b=()=>{this.debugCallback?.(d.name,d.fbo),this._acquired.delete(d);const e=h(o);e&&null!=d?.getAttachment(l)||!e&&null!=d?.getAttachment(u)?(e?(d.fbo?.invalidateAttachments([l]),d.detachAllColors()):(d.fbo?.invalidateAttachments([u]),d.detachAllButColor0()),this._cache.put(d)):d?.dispose()};d=new a(s,i,e,C,w,b),h(o)?d.acquireDepth(o):d.acquireColor(u,o,i)}return this._trackHandle(d)}acquireDepth(e,t,a,c){const h=w(e,t,a);let o=this._depthCache.pop(h);if(o)o.retain(),o.attachment.setShadowFiltering(!1);else{const c=new d(this.rctx,{...i[e],width:t,height:a});o=new r(h,c,(()=>this._depthCache.put(o)))}return o.name=c,o}_acquireColor(e,r,a,c){const h=w(e,r,a);let i=this._colorCache.pop(h);if(i)i.retain();else{const c=new d(this.rctx,{...o[e],width:r,height:a});i=new t(h,c,(()=>this._colorCache.put(i)))}return i.name=c,i}_trackHandle(e){return this._acquired.add(e),e}}function p(e,t=0){return`${e}.color${t}`}function _(e){return`${e}.depth`}const C=new a("default","default",null,(()=>C),(()=>C),(()=>{}));function w(e,t,r){return`${t}x${r}:${e}`}C.release=()=>!1;export{f as FBOCache,C as defaultWebGLFBO};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../Color.js";import o from"../../../../../core/Accessor.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as s,initial as i}from"../../../../../core/reactiveUtils.js";import{property as n}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{OutlineVisualElement as a}from"../../../interactive/visualElements/OutlineVisualElement.js";import{RenderOccludedFlag as m}from"../../lib/Material.js";let c=class extends o{constructor(e){super(e)}initialize(){this.addHandles([s((()=>this.area.enabled),(()=>this._ensureElement()),i),s((()=>this.area.outline?.color),(e=>this._updateColor(e)),i),s((()=>this.area.geometries),(e=>this._updateGeometries(e)),i)])}destroy(){this.removeAllHandles(),this._outlineElement=r(this._outlineElement)}_ensureElement(){this.area.enabled&&this.area.outline?.color?this._outlineElement??=new a({view:this.view,geometry:this._mergePolygons(this.area.geometries),isDraped:!0,attached:!0,isDecoration:!1,color:t.toUnitRGBA(this.area.outline?.color),renderOccluded:m.OccludeAndTransparent,width:5}):this._outlineElement=r(this._outlineElement)}_updateGeometries(e){this._ensureElement(),this._outlineElement&&(this._outlineElement.geometry=this._mergePolygons(e))}_updateColor(e){this._ensureElement(),this._outlineElement&&e&&(this._outlineElement.color=t.toUnitRGBA(e))}_mergePolygons(e){if(!e||0===e.length)return null;const t=e.at(0).clone();return e.forEach((e=>{t.rings.push(...e.rings)})),t}};e([n({constructOnly:!0})],c.prototype,"view",void 0),e([n({constructOnly:!0})],c.prototype,"area",void 0),c=e([l("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaOutlineItem")],c);export{c as FocusAreaOutlineItem};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{property as i}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{c as s,f as r}from"../../../../../chunks/vec32.js";import{create as a,fromRay as o,getStart as l,getEnd as h}from"../../../../../geometry/support/clipRay.js";import{intersectClipRay as c}from"../../../../../geometry/support/frustum.js";import{copy as d}from"../../../../../geometry/support/lineSegment.js";import{wrap as p}from"../../../../../geometry/support/ray.js";import{ViewingMode as u}from"../../../../ViewingMode.js";import{InternalRenderCategory as m}from"../../../webgl.js";import g from"../../../webgl/RenderNode.js";import{Blit as _}from"../blit/Blit.js";import{LaserlinePathData as P}from"./LaserlinePathData.js";import{LaserlinePathPassParameters as f,LaserlinePathTechnique as b}from"./LaserlinePathTechnique.js";import{LaserlinePathTechniqueConfiguration as E}from"./LaserlinePathTechniqueConfiguration.js";import{LaserlineTechnique as D}from"./LaserlineTechnique.js";import{LaserlineTechniqueConfiguration as q}from"./LaserlineTechniqueConfiguration.js";import{RenderRequestType as T}from"../../lib/basicInterfaces.js";import{updateParameters as L}from"../../materials/internal/MaterialUtil.js";import{BlitMode as V}from"../../shaders/CompositingTechniqueConfiguration.js";import{FramebufferBit as C}from"../../../../webgl/enums.js";let j=class extends g{constructor(e){super(e),this.isDecoration=!0,this.produces=m.LASERLINES,this.consumes={required:[m.LASERLINES,"normals"]},this.requireGeometryDepth=!0,this._configuration=new q,this._pathTechniqueConfiguration=new E,this._heightManifoldEnabled=!1,this._pointDistanceEnabled=!1,this._lineVerticalPlaneEnabled=!1,this._intersectsLineEnabled=!1,this._intersectsLineInfinite=!1,this._pathVerticalPlaneEnabled=!1,this._passParameters=new f;const t=e.view.stage.renderView.techniques,i=new E;i.contrastControlEnabled=e.contrastControlEnabled,t.precompile(b,i)}initialize(){this._passParameters.renderCoordsHelper=this.view.renderCoordsHelper,this._pathTechniqueConfiguration.spherical=this.view.state.viewingMode===u.Global,this._pathTechniqueConfiguration.contrastControlEnabled=this.contrastControlEnabled,this._techniques.precompile(b,this._pathTechniqueConfiguration),this._blit=new _(this._techniques,V.PremultipliedAlpha)}destroy(){this._pathVerticalPlaneData=t(this._pathVerticalPlaneData),this._blit=null}get _techniques(){return this.view.stage.renderView.techniques}get heightManifoldEnabled(){return this._heightManifoldEnabled}set heightManifoldEnabled(e){this._heightManifoldEnabled!==e&&(this._heightManifoldEnabled=e,this.requestRender(T.UPDATE))}get heightManifoldTarget(){return this._passParameters.heightManifoldTarget}set heightManifoldTarget(e){s(this._passParameters.heightManifoldTarget,e),this.requestRender(T.UPDATE)}get pointDistanceEnabled(){return this._pointDistanceEnabled}set pointDistanceEnabled(e){e!==this._pointDistanceEnabled&&(this._pointDistanceEnabled=e,this.requestRender(T.UPDATE))}get pointDistanceTarget(){return this._passParameters.pointDistanceTarget}set pointDistanceTarget(e){s(this._passParameters.pointDistanceTarget,e),this.requestRender(T.UPDATE)}get pointDistanceOrigin(){return this._passParameters.pointDistanceOrigin}set pointDistanceOrigin(e){s(this._passParameters.pointDistanceOrigin,e),this.requestRender(T.UPDATE)}get lineVerticalPlaneEnabled(){return this._lineVerticalPlaneEnabled}set lineVerticalPlaneEnabled(e){e!==this._lineVerticalPlaneEnabled&&(this._lineVerticalPlaneEnabled=e,this.requestRender(T.UPDATE))}get lineVerticalPlaneSegment(){return this._passParameters.lineVerticalPlaneSegment}set lineVerticalPlaneSegment(e){d(e,this._passParameters.lineVerticalPlaneSegment),this.requestRender(T.UPDATE)}get intersectsLineEnabled(){return this._intersectsLineEnabled}set intersectsLineEnabled(e){e!==this._intersectsLineEnabled&&(this._intersectsLineEnabled=e,this.requestRender(T.UPDATE))}get intersectsLineSegment(){return this._passParameters.intersectsLineSegment}set intersectsLineSegment(e){d(e,this._passParameters.intersectsLineSegment),this.requestRender(T.UPDATE)}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){e!==this._intersectsLineInfinite&&(this._intersectsLineInfinite=e,this.requestRender(T.UPDATE))}get pathVerticalPlaneEnabled(){return this._pathVerticalPlaneEnabled}set pathVerticalPlaneEnabled(e){e!==this._pathVerticalPlaneEnabled&&(this._pathVerticalPlaneEnabled=e,null!=this._pathVerticalPlaneData&&this.requestRender(T.UPDATE))}set pathVerticalPlaneVertices(e){null==this._pathVerticalPlaneData&&(this._pathVerticalPlaneData=new P(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.vertices=e,this.pathVerticalPlaneEnabled&&this.requestRender(T.UPDATE)}set pathVerticalPlaneBuffers(e){null==this._pathVerticalPlaneData&&(this._pathVerticalPlaneData=new P(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.buffers=e,this.pathVerticalPlaneEnabled&&this.requestRender(T.UPDATE)}setParameters(e){L(this._passParameters,e)&&this.requestRender(T.UPDATE)}precompile(){this._acquireTechnique()}render(e){const t=e.find((({name:e})=>e===this.produces));if(this.isDecoration&&!this.bindParameters.decorations||null==this._blit)return t;const i=this.renderingContext,n=e.find((({name:e})=>"normals"===e));this._passParameters.normals=n?.getTexture();const s=()=>{(this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled)&&this._renderUnified(),this.pathVerticalPlaneEnabled&&this._renderPath()};if(!this.contrastControlEnabled)return i.bindFramebuffer(t.fbo),s(),t;this._passParameters.colors=t.getTexture();const r=this.fboCache.acquire(t.fbo.width,t.fbo.height,"laser lines");return i.bindFramebuffer(r.fbo),i.setClearColor(0,0,0,0),i.clear(C.COLOR|C.DEPTH),s(),i.unbindTexture(t.getTexture()),this._blit.blend(i,r,t,this.bindParameters)||this.requestRender(T.UPDATE),r.release(),t}_acquireTechnique(){return this._configuration.heightManifoldEnabled=this.heightManifoldEnabled,this._configuration.lineVerticalPlaneEnabled=this.lineVerticalPlaneEnabled,this._configuration.pointDistanceEnabled=this.pointDistanceEnabled,this._configuration.intersectsLineEnabled=this.intersectsLineEnabled,this._configuration.contrastControlEnabled=this.contrastControlEnabled,this._configuration.spherical=this.view.state.viewingMode===u.Global,this._techniques.get(D,this._configuration)}_renderUnified(){if(!this._updatePassParameters())return;const e=this._acquireTechnique();if(e.compiled){const t=this.renderingContext;t.bindTechnique(e,this.bindParameters,this._passParameters),t.screen.draw()}else this.requestRender(T.UPDATE)}_renderPath(){if(null==this._pathVerticalPlaneData)return;const e=this._techniques.get(b,this._pathTechniqueConfiguration);if(e.compiled){const t=this.renderingContext;this._passParameters.origin=this._pathVerticalPlaneData.origin,t.bindTechnique(e,this.bindParameters,this._passParameters),this._pathVerticalPlaneData.draw(t)}else this.requestRender(T.UPDATE)}_updatePassParameters(){if(!this._intersectsLineEnabled)return!0;const e=this.bindParameters.camera,t=this._passParameters;if(this._intersectsLineInfinite){if(o(p(t.intersectsLineSegment.origin,t.intersectsLineSegment.vector),w),w.c0=-Number.MAX_VALUE,!c(e.frustum,w))return!1;l(w,t.lineStartWorld),h(w,t.lineEndWorld)}else s(t.lineStartWorld,t.intersectsLineSegment.origin),r(t.lineEndWorld,t.intersectsLineSegment.origin,t.intersectsLineSegment.vector);return!0}get test(){}};e([i({constructOnly:!0})],j.prototype,"contrastControlEnabled",void 0),e([i()],j.prototype,"isDecoration",void 0),e([i()],j.prototype,"produces",void 0),e([i()],j.prototype,"consumes",void 0),j=e([n("esri.views.3d.webgl-engine.effects.laserlines.LaserLineRenderer")],j);const w=a();export{j as LaserLineRenderer};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{property as i}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{c as s,f as r}from"../../../../../chunks/vec32.js";import{fromRay as a,create as o,getStart as l,getEnd as h}from"../../../../../geometry/support/clipRay.js";import{intersectClipRay as c}from"../../../../../geometry/support/frustum.js";import{copy as d}from"../../../../../geometry/support/lineSegment.js";import{wrap as p}from"../../../../../geometry/support/ray.js";import{ViewingMode as u}from"../../../../ViewingMode.js";import{InternalRenderCategory as m}from"../../../webgl.js";import g from"../../../webgl/RenderNode.js";import{Blit as _}from"../blit/Blit.js";import{LaserlinePathData as P}from"./LaserlinePathData.js";import{LaserlinePathPassParameters as f,LaserlinePathTechnique as b}from"./LaserlinePathTechnique.js";import{LaserlinePathTechniqueConfiguration as E}from"./LaserlinePathTechniqueConfiguration.js";import{LaserlineTechnique as D}from"./LaserlineTechnique.js";import{LaserlineTechniqueConfiguration as q}from"./LaserlineTechniqueConfiguration.js";import{RenderRequestType as T}from"../../lib/basicInterfaces.js";import{updateParameters as L}from"../../materials/internal/MaterialUtil.js";import{BlitMode as V}from"../../shaders/CompositingTechniqueConfiguration.js";import{FramebufferBit as C}from"../../../../webgl/enums.js";let j=class extends g{constructor(e){super(e),this.isDecoration=!0,this.produces=m.LASERLINES,this.consumes={required:[m.LASERLINES,"normals"]},this.requireGeometryDepth=!0,this._configuration=new q,this._pathTechniqueConfiguration=new E,this._heightManifoldEnabled=!1,this._pointDistanceEnabled=!1,this._lineVerticalPlaneEnabled=!1,this._intersectsLineEnabled=!1,this._intersectsLineInfinite=!1,this._pathVerticalPlaneEnabled=!1,this._passParameters=new f;const t=e.view.stage.renderView.techniques,i=new E;i.contrastControlEnabled=e.contrastControlEnabled,t.precompile(b,i)}initialize(){this._passParameters.renderCoordsHelper=this.view.renderCoordsHelper,this._pathTechniqueConfiguration.spherical=this.view.state.viewingMode===u.Global,this._pathTechniqueConfiguration.contrastControlEnabled=this.contrastControlEnabled,this._techniques.precompile(b,this._pathTechniqueConfiguration),this._blit=new _(this._techniques,V.PremultipliedAlpha)}destroy(){this._pathVerticalPlaneData=t(this._pathVerticalPlaneData),this._blit=null}get _techniques(){return this.view.stage.renderView.techniques}get heightManifoldEnabled(){return this._heightManifoldEnabled}set heightManifoldEnabled(e){this._heightManifoldEnabled!==e&&(this._heightManifoldEnabled=e,this.requestRender(T.UPDATE))}get heightManifoldTarget(){return this._passParameters.heightManifoldTarget}set heightManifoldTarget(e){s(this._passParameters.heightManifoldTarget,e),this.requestRender(T.UPDATE)}get pointDistanceEnabled(){return this._pointDistanceEnabled}set pointDistanceEnabled(e){e!==this._pointDistanceEnabled&&(this._pointDistanceEnabled=e,this.requestRender(T.UPDATE))}get pointDistanceTarget(){return this._passParameters.pointDistanceTarget}set pointDistanceTarget(e){s(this._passParameters.pointDistanceTarget,e),this.requestRender(T.UPDATE)}get pointDistanceOrigin(){return this._passParameters.pointDistanceOrigin}set pointDistanceOrigin(e){s(this._passParameters.pointDistanceOrigin,e),this.requestRender(T.UPDATE)}get lineVerticalPlaneEnabled(){return this._lineVerticalPlaneEnabled}set lineVerticalPlaneEnabled(e){e!==this._lineVerticalPlaneEnabled&&(this._lineVerticalPlaneEnabled=e,this.requestRender(T.UPDATE))}get lineVerticalPlaneSegment(){return this._passParameters.lineVerticalPlaneSegment}set lineVerticalPlaneSegment(e){d(e,this._passParameters.lineVerticalPlaneSegment),this.requestRender(T.UPDATE)}get intersectsLineEnabled(){return this._intersectsLineEnabled}set intersectsLineEnabled(e){e!==this._intersectsLineEnabled&&(this._intersectsLineEnabled=e,this.requestRender(T.UPDATE))}get intersectsLineSegment(){return this._passParameters.intersectsLineSegment}set intersectsLineSegment(e){d(e,this._passParameters.intersectsLineSegment),this.requestRender(T.UPDATE)}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){e!==this._intersectsLineInfinite&&(this._intersectsLineInfinite=e,this.requestRender(T.UPDATE))}get pathVerticalPlaneEnabled(){return this._pathVerticalPlaneEnabled}set pathVerticalPlaneEnabled(e){e!==this._pathVerticalPlaneEnabled&&(this._pathVerticalPlaneEnabled=e,null!=this._pathVerticalPlaneData&&this.requestRender(T.UPDATE))}set pathVerticalPlaneVertices(e){null==this._pathVerticalPlaneData&&(this._pathVerticalPlaneData=new P(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.vertices=e,this.pathVerticalPlaneEnabled&&this.requestRender(T.UPDATE)}set pathVerticalPlaneBuffers(e){null==this._pathVerticalPlaneData&&(this._pathVerticalPlaneData=new P(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.buffers=e,this.pathVerticalPlaneEnabled&&this.requestRender(T.UPDATE)}setParameters(e){L(this._passParameters,e)&&this.requestRender(T.UPDATE)}precompile(){this._acquireTechnique()}render(e){const t=e.find((({name:e})=>e===this.produces));if(this.isDecoration&&!this.bindParameters.decorations||null==this._blit)return t;const i=this.renderingContext,n=e.find((({name:e})=>"normals"===e));this._passParameters.normals=n?.getTexture();const s=()=>{(this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled)&&this._renderUnified(),this.pathVerticalPlaneEnabled&&this._renderPath()};if(!this.contrastControlEnabled)return i.bindFramebuffer(t.fbo),s(),t;this._passParameters.colors=t.getTexture();const r=this.fboCache.acquire(t.fbo.width,t.fbo.height,"laser lines");return i.bindFramebuffer(r.fbo),i.setClearColor(0,0,0,0),i.clear(C.COLOR|C.DEPTH),s(),i.unbindTexture(t.getTexture()),this._blit.blend(i,r,t,this.bindParameters)||this.requestRender(T.UPDATE),r.release(),t}_acquireTechnique(){return this._configuration.heightManifoldEnabled=this.heightManifoldEnabled,this._configuration.lineVerticalPlaneEnabled=this.lineVerticalPlaneEnabled,this._configuration.pointDistanceEnabled=this.pointDistanceEnabled,this._configuration.intersectsLineEnabled=this.intersectsLineEnabled,this._configuration.contrastControlEnabled=this.contrastControlEnabled,this._configuration.spherical=this.view.state.viewingMode===u.Global,this._techniques.get(D,this._configuration)}_renderUnified(){if(!this._updatePassParameters())return;const e=this._acquireTechnique();if(e.compiled){const t=this.renderingContext;t.bindTechnique(e,this.bindParameters,this._passParameters),t.screen.draw()}else this.requestRender(T.UPDATE)}_renderPath(){if(null==this._pathVerticalPlaneData)return;const e=this._techniques.get(b,this._pathTechniqueConfiguration);if(e.compiled){const t=this.renderingContext;this._passParameters.origin=this._pathVerticalPlaneData.origin,t.bindTechnique(e,this.bindParameters,this._passParameters),this._pathVerticalPlaneData.draw(t)}else this.requestRender(T.UPDATE)}_updatePassParameters(){if(!this._intersectsLineEnabled)return!0;const e=this.bindParameters.camera,t=this._passParameters;if(this._intersectsLineInfinite){if(a(p(t.intersectsLineSegment.origin,t.intersectsLineSegment.vector),w),w.c0=-Number.MAX_VALUE,!c(e.frustum,w))return!1;l(w,t.lineStartWorld),h(w,t.lineEndWorld)}else s(t.lineStartWorld,t.intersectsLineSegment.origin),r(t.lineEndWorld,t.intersectsLineSegment.origin,t.intersectsLineSegment.vector);return!0}get test(){}};e([i({constructOnly:!0})],j.prototype,"contrastControlEnabled",void 0),e([i()],j.prototype,"isDecoration",void 0),e([i()],j.prototype,"produces",void 0),e([i()],j.prototype,"consumes",void 0),j=e([n("esri.views.3d.webgl-engine.effects.laserlines.LaserLineRenderer")],j);const w=o();export{j as LaserLineRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../../../../chunks/tslib.es6.js";import{parameter as r,ShaderTechniqueConfiguration as t}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class e extends t{constructor(){super(...arguments),this.contrastControlEnabled=!1,this.spherical=!1}}o([r()],e.prototype,"contrastControlEnabled",void 0),o([r()],e.prototype,"spherical",void 0);export{e as LaserlinePathTechniqueConfiguration};
5
+ import{_ as o}from"../../../../../chunks/tslib.es6.js";import{ShaderTechniqueConfiguration as r,parameter as t}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class e extends r{constructor(){super(...arguments),this.contrastControlEnabled=!1,this.spherical=!1}}o([t()],e.prototype,"contrastControlEnabled",void 0),o([t()],e.prototype,"spherical",void 0);export{e as LaserlinePathTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import{clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as t,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{createScreenPointArray as o,createRenderScreenPointArray as m,screenPointObjectToArray as n}from"../../../../../core/screenUtils.js";import{isSVG as h}from"../../../../../core/urlUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import{requestImage as u}from"../../../../../support/requestImageUtils.js";import{InternalRenderCategory as c}from"../../../webgl.js";import _ from"../../../webgl/RenderNode.js";import{MagnifierTechnique as g}from"./MagnifierTechnique.js";import{RenderRequestType as d}from"../../lib/basicInterfaces.js";import{Default3D as f}from"../../lib/DefaultVertexAttributeLocations.js";import{createQuadVAO as T,Layout as v}from"../../lib/glUtil3D.js";import{M as P}from"../../../../../chunks/Magnifier.glsl.js";import{loadMagnifierResources as k}from"../../../../magnifier/resources.js";import{PrimitiveType as b,PixelFormat as y,TextureWrapMode as j}from"../../../../webgl/enums.js";import{Texture as x}from"../../../../webgl/Texture.js";import{TextureDescriptor as R}from"../../../../webgl/TextureDescriptor.js";let S=class extends _{constructor(){super(...arguments),this.produces=c.MAGNIFIER,this.consumes={required:[c.MAGNIFIER]},this._imageSources=null,this._imageLoadTask=null,this._passParameters=new P,this._vao=null,this._magnifier=null,this._tmpScreenPoint=o(),this._tmpRenderPoint=m()}initialize(){this.addHandles([t((()=>this.view.magnifier),(e=>this._update(e)),a)])}_update(e){if(e===this._magnifier)return;this.removeAllHandles(),this._magnifier=e;const s=()=>{const e=this._validMagnifier;e?(this._loadResources(e),this.produces=c.MAGNIFIER):this.produces="disabled",this.requestRender()};this._magnifier&&this.addHandles(t((()=>this._magnifier?.version),s)),s()}get _validMagnifier(){return this._magnifier?.visible&&this._magnifier?.position&&this._magnifier?.size>0?this._magnifier:null}get _factor(){return this._magnifier?.factor||1}destroy(){this._magnifier=null,null!=this._imageLoadTask&&(this._imageLoadTask.task.abort(),this._imageLoadTask=null),this._disposeTextures(),this._vao=i(this._vao)}_disposeTextures(){this._passParameters.mask=i(this._passParameters.mask),this._passParameters.overlay=i(this._passParameters.overlay),this._passParameters.input=i(this._passParameters.input)}precompile(){this._imageSources&&this.techniques.precompile(g)}render(e){const s=this._validMagnifier,i=e.find((({name:e})=>e===c.MAGNIFIER));if(null==s)return i;if(null==this._imageSources)return this.requestRender(d.UPDATE),i;const t=this.renderingContext,a=this.camera.pixelRatio,o=Math.ceil(a*s.size);this._vao??=T(t,v.Pos2,f,0,1);const m=this.techniques.get(g);if(this._ensureTextureResources(t,o),!m.compiled||!this._passParameters.input)return this.requestRender(d.UPDATE),i;const h=Math.ceil(1/this._factor*o),l=this._passParameters.input;l.resize(h,h),n(s.position,this._tmpScreenPoint);const p=this.camera.screenToRender(this._tmpScreenPoint,this._tmpRenderPoint),u=this.camera.fullWidth,_=this.camera.fullHeight,P=.5*h,k=.5*h;p[0]=r(p[0],P,u-P-1),p[1]=r(p[1],k,_-k-1);const y=Math.floor(p[0]-P),j=Math.floor(p[1]-k);t.bindFramebuffer(i.fbo);return m.program.bindTexture("textureInput",l),t.gl.copyTexImage2D(l.descriptor.target,0,l.descriptor.pixelFormat,y,j,h,h,0),this._passParameters.magnifier=s,t.bindTechnique(m,this.bindParameters,this._passParameters),t.bindVAO(this._vao),t.drawArrays(b.TRIANGLE_STRIP,0,4),i}_loadResources(e){const{maskUrl:r,overlayUrl:i}=e;this._imageLoadTask?.maskUrl===r&&this._imageLoadTask?.overlayUrl===i||(this._imageLoadTask?.task.abort(),this._imageLoadTask=this._imageSources=null),this._imageSources||this._imageLoadTask||(this._imageLoadTask={maskUrl:r,overlayUrl:i,task:s((async e=>{const s=null==r||null==i?k(e):null,t=null!=r?u(r,{signal:e}):s.then((e=>e.mask)),a=null!=i?u(i,{signal:e}):s.then((e=>e.overlay));this._imageSources={mask:await t,overlay:await a}}))})}_ensureTextureResources(e,s){null==this._imageSources||this._passParameters.size===s&&this._passParameters.input&&this._passParameters.mask&&this._passParameters.overlay||(this._disposeTextures(),this._imageSources.overlay.width=this._imageSources.mask.width=s,this._imageSources.overlay.height=this._imageSources.mask.height=s,this._passParameters.overlay=new x(e,this._createTextureDescriptor(s,y.RGBA,this._imageSources.overlay),this._imageSources.overlay),this._passParameters.mask=new x(e,this._createTextureDescriptor(s,y.ALPHA,this._imageSources.mask),this._imageSources.mask),this._passParameters.input=new x(e,this._createTextureDescriptor(s,y.RGBA,null)))}_createTextureDescriptor(e,s,r){const i=this.renderingContext,t=new R(e,e);return t.pixelFormat=t.internalFormat=s,t.wrapMode=j.CLAMP_TO_EDGE,t.flipped=!!r,t.preMultiplyAlpha=!(s!==y.RGBA||!r||h(r.src)&&i.driverTest.svgPremultipliesAlpha.result),t}};e([l()],S.prototype,"produces",void 0),e([l()],S.prototype,"consumes",void 0),e([l()],S.prototype,"_imageSources",void 0),e([l()],S.prototype,"_imageLoadTask",void 0),S=e([p("esri.views.3d.webgl-engine.effects.magnifier.Magnifier")],S);export{S as Magnifier};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import{clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as t,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{createScreenPointArray as o,createRenderScreenPointArray as m,screenPointObjectToArray as n}from"../../../../../core/screenUtils.js";import{isSVG as h}from"../../../../../core/urlUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import{requestImage as u}from"../../../../../support/requestImageUtils.js";import{InternalRenderCategory as c}from"../../../webgl.js";import _ from"../../../webgl/RenderNode.js";import{MagnifierTechnique as g}from"./MagnifierTechnique.js";import{RenderRequestType as d}from"../../lib/basicInterfaces.js";import{Default3D as f}from"../../lib/DefaultVertexAttributeLocations.js";import{createQuadVAO as T,Layout as v}from"../../lib/glUtil3D.js";import{M as P}from"../../../../../chunks/Magnifier.glsl.js";import{loadMagnifierResources as k}from"../../../../magnifier/resources.js";import{PrimitiveType as b,PixelFormat as y,TextureWrapMode as j}from"../../../../webgl/enums.js";import{Texture as x}from"../../../../webgl/Texture.js";import{TextureDescriptor as R}from"../../../../webgl/TextureDescriptor.js";let S=class extends _{constructor(){super(...arguments),this.produces=c.MAGNIFIER,this.consumes={required:[c.MAGNIFIER]},this._imageSources=null,this._imageLoadTask=null,this._passParameters=new P,this._vao=null,this._magnifier=null,this._tmpScreenPoint=o(),this._tmpRenderPoint=m()}initialize(){this.addHandles([t((()=>this.view.magnifier),(e=>this._update(e)),a)])}_update(e){if(e===this._magnifier)return;this.removeAllHandles(),this._magnifier=e;const s=()=>{const e=this._validMagnifier;e?(this._loadResources(e),this.produces=c.MAGNIFIER):this.produces="disabled",this.requestRender()};this._magnifier&&this.addHandles(t((()=>this._magnifier?.version),s)),s()}get _validMagnifier(){return this._magnifier?.visible&&this._magnifier?.position&&this._magnifier?.size>0?this._magnifier:null}get _factor(){return this._magnifier?.factor||1}destroy(){this._magnifier=null,null!=this._imageLoadTask&&(this._imageLoadTask.task.abort(),this._imageLoadTask=null),this._disposeTextures(),this._vao=i(this._vao)}_disposeTextures(){this._passParameters.mask=i(this._passParameters.mask),this._passParameters.overlay=i(this._passParameters.overlay),this._passParameters.input=i(this._passParameters.input)}precompile(){this._imageSources&&this.techniques.precompile(g)}render(e){const s=this._validMagnifier,i=e.find((({name:e})=>e===c.MAGNIFIER));if(null==s)return i;if(null==this._imageSources)return this.requestRender(d.UPDATE),i;const t=this.renderingContext,a=this.camera.pixelRatio,o=Math.ceil(a*s.size);this._vao??=T(t,v.Pos2,f,0,1);const m=this.techniques.get(g);if(this._ensureTextureResources(t,o),!m.compiled||!this._passParameters.input)return this.requestRender(d.UPDATE),i;const h=Math.ceil(1/this._factor*o),l=this._passParameters.input;l.resize(h,h),n(s.position,this._tmpScreenPoint);const p=this.camera.screenToRender(this._tmpScreenPoint,this._tmpRenderPoint),u=this.camera.fullWidth,_=this.camera.fullHeight,P=.5*h,k=.5*h;p[0]=r(p[0],P,u-P-1),p[1]=r(p[1],k,_-k-1);const y=Math.floor(p[0]-P),j=Math.floor(p[1]-k);t.bindFramebuffer(i.fbo);return m.program.bindTexture("textureInput",l),t.gl.copyTexImage2D(l.descriptor.target,0,l.descriptor.pixelFormat,y,j,h,h,0),this._passParameters.magnifier=s,t.bindTechnique(m,this.bindParameters,this._passParameters),t.bindVAO(this._vao),t.drawArrays(b.TRIANGLE_STRIP,0,4),i}_loadResources(e){const{maskUrl:r,overlayUrl:i}=e;this._imageLoadTask?.maskUrl===r&&this._imageLoadTask?.overlayUrl===i||(this._imageLoadTask?.task.abort(),this._imageLoadTask=this._imageSources=null),this._imageSources||this._imageLoadTask||(this._imageLoadTask={maskUrl:r,overlayUrl:i,task:s((async e=>{const s=null==r||null==i?k(e):null,t=null!=r?u(r,{signal:e}):s.then((e=>e.mask)),a=null!=i?u(i,{signal:e}):s.then((e=>e.overlay));this._imageSources={mask:await t,overlay:await a}}))})}_ensureTextureResources(e,s){null==this._imageSources||this._passParameters.size===s&&this._passParameters.input&&this._passParameters.mask&&this._passParameters.overlay||(this._disposeTextures(),this._imageSources.overlay.width=this._imageSources.mask.width=s,this._imageSources.overlay.height=this._imageSources.mask.height=s,this._passParameters.overlay=new x(e,this._createTextureDescriptor(s,y.RGBA,this._imageSources.overlay),this._imageSources.overlay),this._passParameters.mask=new x(e,this._createTextureDescriptor(s,y.ALPHA,this._imageSources.mask),this._imageSources.mask),this._passParameters.input=new x(e,this._createTextureDescriptor(s,y.RGBA,null)))}_createTextureDescriptor(e,s,r){const i=this.renderingContext,t=new R(e);return t.pixelFormat=t.internalFormat=s,t.wrapMode=j.CLAMP_TO_EDGE,t.flipped=!!r,t.preMultiplyAlpha=!(s!==y.RGBA||!r||h(r.src)&&i.driverTest.svgPremultipliesAlpha.result),t}};e([l()],S.prototype,"produces",void 0),e([l()],S.prototype,"consumes",void 0),e([l()],S.prototype,"_imageSources",void 0),e([l()],S.prototype,"_imageLoadTask",void 0),S=e([p("esri.views.3d.webgl-engine.effects.magnifier.Magnifier")],S);export{S as Magnifier};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{watch as s,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{requestImage as n}from"../../../../../support/requestImageUtils.js";import{RenderCategory as c,InternalRenderCategory as h}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{ColorFormat as u}from"../../core/FBOCacheFormats.js";import{SMAABlendWeightsTechnique as l}from"./SMAABlendWeightsTechnique.js";import{SMAABlurTechnique as p}from"./SMAABlurTechnique.js";import{SMAAEdgeDetectTechnique as d}from"./SMAAEdgeDetectTechnique.js";import{SMAAPassParameters as f}from"./SMAAPassParameters.js";import{RenderRequestType as T}from"../../lib/basicInterfaces.js";import{PixelFormat as b,TextureSamplingMode as x,FramebufferBit as _,TextureWrapMode as A}from"../../../../webgl/enums.js";import{Texture as g}from"../../../../webgl/Texture.js";import{TextureDescriptor as C}from"../../../../webgl/TextureDescriptor.js";let j=class extends m{constructor(e){super(e),this.produces="disabled",this.consumes={required:[h.ANTIALIASING],optional:[c.COMPOSITE]},this._areaTexture=null,this._searchTexture=null,this._smaaParameters=new f}initialize(){this.addHandles([s((()=>this.isEnabled()),(e=>e?this.enable():this.disable()),i)])}async enable(){if(this.produces=h.ANTIALIASING,this._abortController||this._areaTexture&&this._searchTexture)return;this._abortController=new AbortController;const e=this._abortController.signal;try{const r=await import("./SMAAData.js");await this._loadTextures(r,e),this.requestRender(T.UPDATE)}catch{}this._abortController=null}async _loadTextures(e,r){t(r);const[s,i]=await Promise.allSettled([n(e.areaTexture,{signal:r}),n(e.searchTexure,{signal:r})]);if(t(r),"fulfilled"!==s.status||"fulfilled"!==i.status)return;const a=this.renderingContext;this._areaTexture=w(a,x.LINEAR,b.RGB,s.value),this._searchTexture=w(a,x.NEAREST,b.LUMINANCE,i.value)}disable(){this.produces="disabled"}destroy(){this._searchTexture=r(this._searchTexture),this._areaTexture=r(this._areaTexture)}precompile(){this.techniques.precompile(d),this.techniques.precompile(l),this.techniques.precompile(p)}render(e){const r=e.find((({name:e})=>e===h.ANTIALIASING));if(!this._areaTexture||!this._searchTexture)return this.requestRender(T.UPDATE),r;const t=this.techniques.get(d),s=this.techniques.get(l),i=this.techniques.get(p);if(!t.compiled||!s.compiled||!i.compiled)return this.requestRender(T.UPDATE),r;const a=e.find((({name:e})=>e===c.COMPOSITE));if(!a)return r;const o=a.fbo.width,n=a.fbo.height,m=this.renderingContext;m.setViewport(0,0,o,n);const f=this.fboCache.acquire(o,n,"smaa edges",u.RG8UNORM);m.bindFramebuffer(f.fbo),m.setClearColor(0,0,0,1),m.clear(_.COLOR),this._smaaParameters.color=a.getTexture();const b=this.bindParameters;m.bindTechnique(t,b,this._smaaParameters),m.screen.draw();const x=this.fboCache.acquire(o,n,"smaa blend");return m.bindFramebuffer(x.fbo),m.setClearColor(0,0,1,1),m.clear(_.COLOR),this._smaaParameters.inputTexture=f.getTexture(),this._smaaParameters.areaTexture=this._areaTexture,this._smaaParameters.searchTexture=this._searchTexture,m.bindTechnique(s,b,this._smaaParameters),m.screen.draw(),f.release(),m.bindFramebuffer(r.fbo),m.setClearColor(0,1,0,1),m.clear(_.COLOR),this._smaaParameters.inputTexture=x.getTexture(),m.bindTechnique(i,b,this._smaaParameters),m.screen.draw(),x.release(),r}};function w(e,r,t,s){const i=new C;return i.pixelFormat=t,i.wrapMode=A.CLAMP_TO_EDGE,i.width=s.width,i.height=s.height,i.samplingMode=r,new g(e,i,s)}e([a()],j.prototype,"produces",void 0),e([a()],j.prototype,"consumes",void 0),e([a({constructOnly:!0})],j.prototype,"isEnabled",void 0),e([a()],j.prototype,"_abortController",void 0),j=e([o("esri.views.3d.webgl-engine.effects.smaa.SMAA")],j);export{j as SMAA};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{watch as s,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{requestImage as n}from"../../../../../support/requestImageUtils.js";import{RenderCategory as c,InternalRenderCategory as m}from"../../../webgl.js";import u from"../../../webgl/RenderNode.js";import{ColorFormat as h}from"../../core/FBOCacheFormats.js";import{SMAABlendWeightsTechnique as l}from"./SMAABlendWeightsTechnique.js";import{SMAABlurTechnique as p}from"./SMAABlurTechnique.js";import{SMAAEdgeDetectTechnique as d}from"./SMAAEdgeDetectTechnique.js";import{SMAAPassParameters as f}from"./SMAAPassParameters.js";import{RenderRequestType as T}from"../../lib/basicInterfaces.js";import{PixelFormat as b,TextureSamplingMode as x,FramebufferBit as _,TextureWrapMode as A}from"../../../../webgl/enums.js";import{Texture as g}from"../../../../webgl/Texture.js";import{TextureDescriptor as C}from"../../../../webgl/TextureDescriptor.js";let j=class extends u{constructor(e){super(e),this.produces="disabled",this.consumes={required:[m.ANTIALIASING],optional:[c.COMPOSITE]},this._areaTexture=null,this._searchTexture=null,this._smaaParameters=new f}initialize(){this.addHandles([s((()=>this.isEnabled()),(e=>e?this.enable():this.disable()),i)])}async enable(){if(this.produces=m.ANTIALIASING,this._abortController||this._areaTexture&&this._searchTexture)return;this._abortController=new AbortController;const e=this._abortController.signal;try{const r=await import("./SMAAData.js");await this._loadTextures(r,e),this.requestRender(T.UPDATE)}catch{}this._abortController=null}async _loadTextures(e,r){t(r);const[s,i]=await Promise.allSettled([n(e.areaTexture,{signal:r}),n(e.searchTexure,{signal:r})]);if(t(r),"fulfilled"!==s.status||"fulfilled"!==i.status)return;const a=this.renderingContext;this._areaTexture=w(a,x.LINEAR,b.RGB,s.value),this._searchTexture=w(a,x.NEAREST,b.LUMINANCE,i.value)}disable(){this.produces="disabled"}destroy(){this._searchTexture=r(this._searchTexture),this._areaTexture=r(this._areaTexture)}precompile(){this.techniques.precompile(d),this.techniques.precompile(l),this.techniques.precompile(p)}render(e){const r=e.find((({name:e})=>e===m.ANTIALIASING));if(!this._areaTexture||!this._searchTexture)return this.requestRender(T.UPDATE),r;const t=this.techniques.get(d),s=this.techniques.get(l),i=this.techniques.get(p);if(!t.compiled||!s.compiled||!i.compiled)return this.requestRender(T.UPDATE),r;const a=e.find((({name:e})=>e===c.COMPOSITE));if(!a)return r;const o=a.fbo.width,n=a.fbo.height,u=this.renderingContext;u.setViewport(0,0,o,n);const f=this.fboCache.acquire(o,n,"smaa edges",h.RG8UNORM);u.bindFramebuffer(f.fbo),u.setClearColor(0,0,0,1),u.clear(_.COLOR),this._smaaParameters.color=a.getTexture();const b=this.bindParameters;u.bindTechnique(t,b,this._smaaParameters),u.screen.draw();const x=this.fboCache.acquire(o,n,"smaa blend");return u.bindFramebuffer(x.fbo),u.setClearColor(0,0,1,1),u.clear(_.COLOR),this._smaaParameters.inputTexture=f.getTexture(),this._smaaParameters.areaTexture=this._areaTexture,this._smaaParameters.searchTexture=this._searchTexture,u.bindTechnique(s,b,this._smaaParameters),u.screen.draw(),f.release(),u.bindFramebuffer(r.fbo),u.setClearColor(0,1,0,1),u.clear(_.COLOR),this._smaaParameters.inputTexture=x.getTexture(),u.bindTechnique(i,b,this._smaaParameters),u.screen.draw(),x.release(),r}};function w(e,r,t,s){const i=new C(s.width,s.height);return i.pixelFormat=t,i.wrapMode=A.CLAMP_TO_EDGE,i.samplingMode=r,new g(e,i,s)}e([a()],j.prototype,"produces",void 0),e([a()],j.prototype,"consumes",void 0),e([a({constructOnly:!0})],j.prototype,"isEnabled",void 0),e([a()],j.prototype,"_abortController",void 0),j=e([o("esri.views.3d.webgl-engine.effects.smaa.SMAA")],j);export{j as SMAA};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{watch as t}from"../../../../../core/reactiveUtils.js";import{Milliseconds as i}from"../../../../../core/time.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as n}from"../../../webgl.js";import c from"../../../webgl/RenderNode.js";import{ColorFormat as p}from"../../core/FBOCacheFormats.js";import{distanceFadeEnd as h,distanceFadeStart as u}from"../../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{SSAOBlurTechnique as l}from"./SSAOBlurTechnique.js";import{noiseData as d}from"./SSAONoiseData.js";import{SSAOPassParameters as f,BlurDrawParameters as b}from"./SSAOParameters.js";import{SSAOTechnique as w}from"./SSAOTechnique.js";import{RenderRequestType as T}from"../../lib/basicInterfaces.js";import{g as _}from"../../../../../chunks/SSAO.glsl.js";import{TextureWrapMode as P,PixelFormat as S,DepthStencilAttachment as j,FramebufferBit as g}from"../../../../webgl/enums.js";import{Texture as x}from"../../../../webgl/Texture.js";import{TextureDescriptor as q}from"../../../../webgl/TextureDescriptor.js";const O=2;let A=class extends c{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=n.SSAO,this.isEnabled=()=>!1,this._enableTime=i(0),this._passParameters=new f,this._drawParameters=new b}initialize(){const e=Uint8Array.from(atob(d),(e=>e.charCodeAt(0))),r=new q;r.wrapMode=P.CLAMP_TO_EDGE,r.pixelFormat=S.RGB,r.wrapMode=P.REPEAT,r.hasMipmap=!0,r.width=32,r.height=32,this._passParameters.noiseTexture=new x(this.renderingContext,r,e),this.techniques.precompile(w),this.techniques.precompile(l),this.addHandles(t((()=>this.isEnabled()),(()=>this._enableTime=i(0))))}destroy(){this._passParameters.noiseTexture=s(this._passParameters.noiseTexture)}render(e){const s=e.find((({name:e})=>"normals"===e)),t=s?.getTexture(),o=s?.getTexture(j);if(!t||!o)return;const a=this.techniques.get(w),c=this.techniques.get(l);if(!a.compiled||!c.compiled)return this._enableTime=i(performance.now()),void this.requestRender(T.UPDATE);0===this._enableTime&&(this._enableTime=i(performance.now()));const d=this.renderingContext,f=this.view.qualitySettings.fadeDuration,b=this.bindParameters,P=b.camera,S=P.relativeElevation,x=r((h-S)/(h-u),0,1),q=f>0?Math.min(f,performance.now()-this._enableTime)/f:1,A=q*x;this._passParameters.normalTexture=t,this._passParameters.depthTexture=o,this._passParameters.projScale=1/P.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*C/_(P)**6*A;const R=P.fullViewport[2],v=P.fullViewport[3],y=this.fboCache.acquire(R,v,"ssao input",p.RG8UNORM);d.bindFramebuffer(y.fbo),d.setViewport(0,0,R,v),d.bindTechnique(a,b,this._passParameters,this._drawParameters),d.screen.draw();const E=Math.round(R/O),M=Math.round(v/O),U=this.fboCache.acquire(E,M,"ssao blur",p.R8UNORM);d.bindFramebuffer(U.fbo),this._drawParameters.colorTexture=y.getTexture(),m(this._drawParameters.blurSize,0,O/v),d.bindTechnique(c,b,this._passParameters,this._drawParameters),d.setViewport(0,0,E,M),d.screen.draw(),y.release();const V=this.fboCache.acquire(E,M,n.SSAO,p.R8UNORM);return d.bindFramebuffer(V.fbo),d.setViewport(0,0,R,v),d.setClearColor(1,1,1,0),d.clear(g.COLOR),this._drawParameters.colorTexture=U.getTexture(),m(this._drawParameters.blurSize,O/R,0),d.bindTechnique(c,b,this._passParameters,this._drawParameters),d.setViewport(0,0,E,M),d.screen.draw(),d.setViewport4fv(P.fullViewport),U.release(),q<1&&this.requestRender(T.UPDATE),V}};e([o()],A.prototype,"consumes",void 0),e([o()],A.prototype,"produces",void 0),e([o({constructOnly:!0})],A.prototype,"isEnabled",void 0),A=e([a("esri.views.3d.webgl-engine.effects.ssao.SSAO")],A);const C=.5;export{A as SSAO,O as blurSizePixels};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{watch as t}from"../../../../../core/reactiveUtils.js";import{Milliseconds as i}from"../../../../../core/time.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as n}from"../../../webgl.js";import c from"../../../webgl/RenderNode.js";import{ColorFormat as p}from"../../core/FBOCacheFormats.js";import{distanceFadeEnd as h,distanceFadeStart as u}from"../../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{SSAOBlurTechnique as l}from"./SSAOBlurTechnique.js";import{noiseData as d}from"./SSAONoiseData.js";import{SSAOPassParameters as f,BlurDrawParameters as b}from"./SSAOParameters.js";import{SSAOTechnique as w}from"./SSAOTechnique.js";import{RenderRequestType as T}from"../../lib/basicInterfaces.js";import{g as _}from"../../../../../chunks/SSAO.glsl.js";import{TextureWrapMode as P,PixelFormat as S,DepthStencilAttachment as j,FramebufferBit as g}from"../../../../webgl/enums.js";import{Texture as x}from"../../../../webgl/Texture.js";import{TextureDescriptor as q}from"../../../../webgl/TextureDescriptor.js";const O=2;let A=class extends c{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=n.SSAO,this.isEnabled=()=>!1,this._enableTime=i(0),this._passParameters=new f,this._drawParameters=new b}initialize(){const e=Uint8Array.from(atob(d),(e=>e.charCodeAt(0))),r=new q(32);r.wrapMode=P.CLAMP_TO_EDGE,r.pixelFormat=S.RGB,r.wrapMode=P.REPEAT,r.hasMipmap=!0,this._passParameters.noiseTexture=new x(this.renderingContext,r,e),this.techniques.precompile(w),this.techniques.precompile(l),this.addHandles(t((()=>this.isEnabled()),(()=>this._enableTime=i(0))))}destroy(){this._passParameters.noiseTexture=s(this._passParameters.noiseTexture)}render(e){const s=e.find((({name:e})=>"normals"===e)),t=s?.getTexture(),o=s?.getTexture(j);if(!t||!o)return;const a=this.techniques.get(w),c=this.techniques.get(l);if(!a.compiled||!c.compiled)return this._enableTime=i(performance.now()),void this.requestRender(T.UPDATE);0===this._enableTime&&(this._enableTime=i(performance.now()));const d=this.renderingContext,f=this.view.qualitySettings.fadeDuration,b=this.bindParameters,P=b.camera,S=P.relativeElevation,x=r((h-S)/(h-u),0,1),q=f>0?Math.min(f,performance.now()-this._enableTime)/f:1,A=q*x;this._passParameters.normalTexture=t,this._passParameters.depthTexture=o,this._passParameters.projScale=1/P.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*C/_(P)**6*A;const R=P.fullViewport[2],v=P.fullViewport[3],y=this.fboCache.acquire(R,v,"ssao input",p.RG8UNORM);d.bindFramebuffer(y.fbo),d.setViewport(0,0,R,v),d.bindTechnique(a,b,this._passParameters,this._drawParameters),d.screen.draw();const E=Math.round(R/O),M=Math.round(v/O),U=this.fboCache.acquire(E,M,"ssao blur",p.R8UNORM);d.bindFramebuffer(U.fbo),this._drawParameters.colorTexture=y.getTexture(),m(this._drawParameters.blurSize,0,O/v),d.bindTechnique(c,b,this._passParameters,this._drawParameters),d.setViewport(0,0,E,M),d.screen.draw(),y.release();const V=this.fboCache.acquire(E,M,n.SSAO,p.R8UNORM);return d.bindFramebuffer(V.fbo),d.setViewport(0,0,R,v),d.setClearColor(1,1,1,0),d.clear(g.COLOR),this._drawParameters.colorTexture=U.getTexture(),m(this._drawParameters.blurSize,O/R,0),d.bindTechnique(c,b,this._passParameters,this._drawParameters),d.setViewport(0,0,E,M),d.screen.draw(),d.setViewport4fv(P.fullViewport),U.release(),q<1&&this.requestRender(T.UPDATE),V}};e([o()],A.prototype,"consumes",void 0),e([o()],A.prototype,"produces",void 0),e([o({constructOnly:!0})],A.prototype,"isEnabled",void 0),A=e([a("esri.views.3d.webgl-engine.effects.ssao.SSAO")],A);const C=.5;export{A as SSAO,O as blurSizePixels};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../core/ObjectPool.js";import e from"../../../../core/PooledArray.js";import{c as n,m as o,s as i,g as r,f as s}from"../../../../chunks/vec32.js";import{fromValues as h,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{intersectsSphere as l}from"../../../../geometry/support/frustum.js";import{wrap as d}from"../../../../geometry/support/ray.js";import{e as u,g as c,i as f,c as m,a as _}from"../../../../chunks/sphere.js";import{rayBoxTest as p}from"./Util.js";class b{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new g,this._objectCount=0,e&&(void 0!==e.maximumObjectsPerNode&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),void 0!==e.maximumDepth&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),g.clearPool(),y[0]=null,K.prune(),Q.prune()}add(t){const e=Array.from(t);this._grow(e);const n=g.acquire();for(const o of e)++this._objectCount,this._isDegenerate(o)?this._degenerateObjects.add(o):(n.init(this._root),this._add(o,n));g.release(n)}remove(t,e=null){this._objectCount-=t.length;const n=g.acquire();for(const o of t){const t=e??u(this.objectToBoundingSphere(o),J);C(t[3])?(n.init(this._root),O(o,t,n)):this._degenerateObjects.delete(o)}g.release(n),this._shrink()}update(t,e){if(!C(e[3])&&this._isDegenerate(t))return;const n=q(t);this.remove(n,e),this.add(n)}forEachAlongRay(t,e,n){const o=d(t,e);S(this._root,(t=>{if(!T(o,t))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObject(o,t)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObject(o,t)&&n(t)})),!0}))}forEachAlongRayWithVerticalOffset(t,e,n,o){const i=d(t,e);S(this._root,(t=>{if(!z(i,t,o))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObjectWithOffset(i,t,o)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObjectWithOffset(i,t,o)&&n(t)})),!0}))}forEach(t){S(this._root,(e=>{const n=e.node;return n.terminals.forAll(t),null!==n.residents&&n.residents.forAll(t),!0})),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,o=()=>!0,i=1/0){let h=1/0,a=1/0,d=null;const u=F(t,e),c=r=>{if(--i,!o(r))return;const s=this.objectToBoundingSphere(r);if(!l(n,s))return;const u=v(t,e,_(s)),c=u-s[3],f=u+s[3];c<h&&(h=c,a=f,d=r)};return j(this._root,(o=>{if(i<=0||!l(n,o.bounds))return!1;r(I,u,o.halfSize),s(I,I,_(o.bounds));if(v(t,e,I)>a)return!1;const h=o.node;return h.terminals.forAll((t=>c(t))),null!==h.residents&&h.residents.forAll((t=>c(t))),!0}),t,e),d}forEachInDepthRange(t,e,n,o,i,h,a){let d=-1/0,u=1/0;const c={setRange:t=>{n===b.DepthOrder.FRONT_TO_BACK?(d=Math.max(d,t.near),u=Math.min(u,t.far)):(d=Math.max(d,-t.far),u=Math.min(u,-t.near))}};c.setRange(o);const f=v(e,n,t),m=F(e,n),p=F(e,-n),g=t=>{if(!a(t))return;const o=this.objectToBoundingSphere(t),r=_(o),s=v(e,n,r)-f,m=s-o[3],p=s+o[3];m>u||p<d||!l(h,o)||i(t,c)};j(this._root,(t=>{if(!l(h,t.bounds))return!1;r(I,m,t.halfSize),s(I,I,_(t.bounds));if(v(e,n,I)-f>u)return!1;r(I,p,t.halfSize),s(I,I,_(t.bounds));if(v(e,n,I)-f<d)return!1;const o=t.node;return o.terminals.forAll((t=>g(t))),null!==o.residents&&o.residents.forAll((t=>g(t))),!0}),e,n)}forEachNode(t){S(this._root,(e=>t(e.node,e.bounds,e.halfSize,e.depth)))}forEachNeighbor(t,e){const n=c(e),o=_(e),r=e=>{const r=this.objectToBoundingSphere(e),s=c(r),h=n+s;return!(i(_(r),o)-h*h<=0)||t(e)};let s=!0;const h=t=>{s&&(s=r(t))};S(this._root,(t=>{const e=c(t.bounds),r=n+e;if(i(_(t.bounds),o)-r*r>0)return!1;const a=t.node;return a.terminals.forAll(h),s&&null!==a.residents&&a.residents.forAll(h),s})),s&&this.forEachDegenerateObject(h)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n[3]>0)||f(n,t)}_intersectsObjectWithOffset(t,e,n){const o=this.objectToBoundingSphere(e);return!(o[3]>0)||f(n.applyToBoundingSphere(o),t)}_add(t,e){e.advanceTo(this.objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depth<this._maximumDepth&&this._split(e))}_split(t){const e=t.node.residents;t.node.residents=null;for(let n=0;n<e.length;n++){const o=g.acquire().init(t);this._add(e.at(n),o),g.release(o)}}_grow(t){if(D(t,(t=>this.objectToBoundingSphere(t)),W),C(W[3])&&!this._fitsInsideTree(W))if(N(this._root.node))u(W,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const t=this._rootBoundsForRootAsSubNode(W);this._placingRootViolatesMaxDepth(t)?this._rebuildTree(W,t):this._growRootAsSubNode(t),g.release(t)}}_rebuildTree(t,e){n(_(V),_(e.bounds)),V[3]=e.halfSize,D([t,V],(t=>t),G);const o=g.acquire().init(this._root);this._root.initFrom(null,G,G[3]),this._root.increaseHalfSize(1.25),S(o,(t=>(this.add(t.node.terminals.data),null!==t.node.residents&&this.add(t.node.residents.data),!0))),g.release(o)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return S(this._root,(t=>(n=Math.max(n,t.depth),n+e<=this._maximumDepth))),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let o=-1/0;const i=this._root.bounds,r=this._root.halfSize;for(let h=0;h<3;h++){const t=i[h]-r-(n[h]-e),s=n[h]+e-(i[h]+r),a=Math.max(0,Math.ceil(t/(2*r))),l=Math.max(0,Math.ceil(s/(2*r)))+1,d=2**Math.ceil(Math.log(a+l)*Math.LOG2E);o=Math.max(o,d),U[h].min=a,U[h].max=l}for(let h=0;h<3;h++){let t=U[h].min,e=U[h].max;const n=(o-(t+e))/2;t+=Math.ceil(n),e+=Math.floor(n);const s=i[h]-r-t*r*2;k[h]=s+(e+t)*r}const s=o*r;return k[3]=s*w,g.acquire().initFrom(null,k,s,0)}_growRootAsSubNode(t){const e=this._root.node;n(_(W),_(this._root.bounds)),W[3]=this._root.halfSize,this._root.init(t),t.advanceTo(W,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(-1===t)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,o=0;for(;o<e.length&&null==t;)n=o++,t=e[n];for(;o<e.length;)if(e[o++])return-1;return n}_isDegenerate(t){return!C(this.objectToBoundingSphere(t)[3])}_fitsInsideTree(t){const e=this._root.bounds,n=this._root.halfSize;return t[3]<=n&&t[0]>=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,o=this._nodeToJSON(this._root.node);return{maximumDepth:t,maximumObjectsPerNode:e,objectCount:n,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:o}}}_nodeToJSON(t){const e=t.children.map((t=>t?this._nodeToJSON(t):null)),n=t.residents?.map((t=>this.objectToBoundingSphere(t))),o=t.terminals?.map((t=>this.objectToBoundingSphere(t)));return{children:e,residents:n,terminals:o}}static fromJSON(t){const e=new b((t=>t),{maximumDepth:t.maximumDepth,maximumObjectsPerNode:t.maximumObjectsPerNode});return e._objectCount=t.objectCount,e._root.initFrom(t.root.node,t.root.bounds,t.root.halfSize,t.root.depth),e}}class g{constructor(){this.bounds=m(),this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,o=this.depth){return this.node=null!=t?t:g.createEmptyNode(),e&&u(e,this.bounds),this.halfSize=n,this.depth=o,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*w}advance(t){let e=this.node.children[t];e||(e=g.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=E[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const o=this._childIndex(t);e&&e(this,o),this.advance(o)}}isLeaf(){return null!=this.node.residents}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]<t[0]?1:0)+(e[1]<t[1]?2:0)+(e[2]<t[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new e({shrink:!0}),residents:new e({shrink:!0})}}static{this._pool=new t(g)}static acquire(){return g._pool.acquire()}static release(t){g._pool.release(t)}static clearPool(){g._pool.prune()}}function S(t,e){let n=g.acquire().init(t);const o=[n];for(;0!==o.length;){if(n=o.pop(),e(n)&&!n.isLeaf())for(let t=0;t<n.node.children.length;t++){n.node.children[t]&&o.push(g.acquire().init(n).advance(t))}g.release(n)}}function j(t,e,n,o=b.DepthOrder.FRONT_TO_BACK){let i=g.acquire().init(t);const r=[i];for(R(n,o,X);0!==r.length;){if(i=r.pop(),e(i)&&!i.isLeaf())for(let t=7;t>=0;--t){const e=X[t];i.node.children[e]&&r.push(g.acquire().init(i).advance(e))}g.release(i)}}function O(t,e,n){K.clear();const o=n.advanceTo(e,((t,e)=>{K.push(t.node),K.push(e)}))?n.node.terminals:n.node.residents;if(o.removeUnordered(t),0===o.length)for(let i=K.length-2;i>=0;i-=2){if(!x(K.data[i],K.data[i+1]))break}}function x(t,n){return n>=0&&(t.children[n]=null),!!N(t)&&(null===t.residents&&(t.residents=new e({shrink:!0})),!0)}function T(t,e){return B(_(e.bounds),2*-e.halfSize,L),B(_(e.bounds),2*e.halfSize,H),p(t.origin,t.direction,L,H)}function z(t,e,n){return B(_(e.bounds),2*-e.halfSize,L),B(_(e.bounds),2*e.halfSize,H),n.applyToMinMax(L,H),p(t.origin,t.direction,L,H)}function N(t){if(0!==t.terminals.length)return!1;if(null!==t.residents)return 0===t.residents.length;for(let e=0;e<t.children.length;e++)if(t.children[e])return!1;return!0}function M(t,e){t[0]=Math.min(t[0],e[0]-e[3]),t[1]=Math.min(t[1],e[1]-e[3]),t[2]=Math.min(t[2],e[2]-e[3])}function A(t,e){t[0]=Math.max(t[0],e[0]+e[3]),t[1]=Math.max(t[1],e[1]+e[3]),t[2]=Math.max(t[2],e[2]+e[3])}function B(t,e,n){n[0]=t[0]+e,n[1]=t[1]+e,n[2]=t[2]+e}function D(t,e,n){L[0]=1/0,L[1]=1/0,L[2]=1/0,H[0]=-1/0,H[1]=-1/0,H[2]=-1/0;for(const o of t){const t=e(o);C(t[3])&&(M(L,t),A(H,t))}o(_(n),L,H,.5),n[3]=Math.max(H[0]-L[0],H[1]-L[1],H[2]-L[2])/2}function R(t,e,n){if(!Q.length)for(let o=0;o<8;++o)Q.push({index:0,distance:0});for(let o=0;o<8;++o){const n=E[o];Q.data[o].index=o,Q.data[o].distance=v(t,e,n)}Q.sort(((t,e)=>t.distance-e.distance));for(let o=0;o<8;++o)n[o]=Q.data[o].index}function F(t,e){let n,o=1/0;for(let i=0;i<8;++i){const r=v(t,e,P[i]);r<o&&(o=r,n=P[i])}return n}function v(t,e,n){return e*(t[0]*n[0]+t[1]*n[1]+t[2]*n[2])}function C(t){return!isNaN(t)&&t!==-1/0&&t!==1/0&&t>0}!function(t){var e;(e=t.DepthOrder||(t.DepthOrder={}))[e.FRONT_TO_BACK=1]="FRONT_TO_BACK",e[e.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(b||(b={}));const E=[h(-1,-1,-1),h(1,-1,-1),h(-1,1,-1),h(1,1,-1),h(-1,-1,1),h(1,-1,1),h(-1,1,1),h(1,1,1)],P=[h(-1,-1,-1),h(-1,-1,1),h(-1,1,-1),h(-1,1,1),h(1,-1,-1),h(1,-1,1),h(1,1,-1),h(1,1,1)],w=Math.sqrt(3),y=[null];function q(t){return y[0]=t,y}const k=m(),I=a(),L=a(),H=a(),K=new e,J=m(),W=m(),V=m(),G=m(),U=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],Q=new e,X=[0,0,0,0,0,0,0,0];export{b as default};
5
+ import t from"../../../../core/ObjectPool.js";import e from"../../../../core/PooledArray.js";import{c as n,m as o,s as i,g as r,f as s}from"../../../../chunks/vec32.js";import{fromValues as h,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{intersectsSphere as l}from"../../../../geometry/support/frustum.js";import{wrap as d}from"../../../../geometry/support/ray.js";import{e as u,g as c,k as f,c as m,a as _}from"../../../../chunks/sphere.js";import{rayBoxTest as p}from"./Util.js";class b{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new g,this._objectCount=0,e&&(void 0!==e.maximumObjectsPerNode&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),void 0!==e.maximumDepth&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),g.clearPool(),y[0]=null,K.prune(),Q.prune()}add(t){const e=Array.from(t);this._grow(e);const n=g.acquire();for(const o of e)++this._objectCount,this._isDegenerate(o)?this._degenerateObjects.add(o):(n.init(this._root),this._add(o,n));g.release(n)}remove(t,e=null){this._objectCount-=t.length;const n=g.acquire();for(const o of t){const t=e??u(this.objectToBoundingSphere(o),J);C(t[3])?(n.init(this._root),O(o,t,n)):this._degenerateObjects.delete(o)}g.release(n),this._shrink()}update(t,e){if(!C(e[3])&&this._isDegenerate(t))return;const n=k(t);this.remove(n,e),this.add(n)}forEachAlongRay(t,e,n){const o=d(t,e);S(this._root,(t=>{if(!T(o,t))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObject(o,t)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObject(o,t)&&n(t)})),!0}))}forEachAlongRayWithVerticalOffset(t,e,n,o){const i=d(t,e);S(this._root,(t=>{if(!z(i,t,o))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObjectWithOffset(i,t,o)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObjectWithOffset(i,t,o)&&n(t)})),!0}))}forEach(t){S(this._root,(e=>{const n=e.node;return n.terminals.forAll(t),null!==n.residents&&n.residents.forAll(t),!0})),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,o=()=>!0,i=1/0){let h=1/0,a=1/0,d=null;const u=F(t,e),c=r=>{if(--i,!o(r))return;const s=this.objectToBoundingSphere(r);if(!l(n,s))return;const u=v(t,e,_(s)),c=u-s[3],f=u+s[3];c<h&&(h=c,a=f,d=r)};return j(this._root,(o=>{if(i<=0||!l(n,o.bounds))return!1;r(I,u,o.halfSize),s(I,I,_(o.bounds));if(v(t,e,I)>a)return!1;const h=o.node;return h.terminals.forAll((t=>c(t))),null!==h.residents&&h.residents.forAll((t=>c(t))),!0}),t,e),d}forEachInDepthRange(t,e,n,o,i,h,a){let d=-1/0,u=1/0;const c={setRange:t=>{n===b.DepthOrder.FRONT_TO_BACK?(d=Math.max(d,t.near),u=Math.min(u,t.far)):(d=Math.max(d,-t.far),u=Math.min(u,-t.near))}};c.setRange(o);const f=v(e,n,t),m=F(e,n),p=F(e,-n),g=t=>{if(!a(t))return;const o=this.objectToBoundingSphere(t),r=_(o),s=v(e,n,r)-f,m=s-o[3],p=s+o[3];m>u||p<d||!l(h,o)||i(t,c)};j(this._root,(t=>{if(!l(h,t.bounds))return!1;r(I,m,t.halfSize),s(I,I,_(t.bounds));if(v(e,n,I)-f>u)return!1;r(I,p,t.halfSize),s(I,I,_(t.bounds));if(v(e,n,I)-f<d)return!1;const o=t.node;return o.terminals.forAll((t=>g(t))),null!==o.residents&&o.residents.forAll((t=>g(t))),!0}),e,n)}forEachNode(t){S(this._root,(e=>t(e.node,e.bounds,e.halfSize,e.depth)))}forEachNeighbor(t,e){const n=c(e),o=_(e),r=e=>{const r=this.objectToBoundingSphere(e),s=c(r),h=n+s;return!(i(_(r),o)-h*h<=0)||t(e)};let s=!0;const h=t=>{s&&(s=r(t))};S(this._root,(t=>{const e=c(t.bounds),r=n+e;if(i(_(t.bounds),o)-r*r>0)return!1;const a=t.node;return a.terminals.forAll(h),s&&null!==a.residents&&a.residents.forAll(h),s})),s&&this.forEachDegenerateObject(h)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n[3]>0)||f(n,t)}_intersectsObjectWithOffset(t,e,n){const o=this.objectToBoundingSphere(e);return!(o[3]>0)||f(n.applyToBoundingSphere(o),t)}_add(t,e){e.advanceTo(this.objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depth<this._maximumDepth&&this._split(e))}_split(t){const e=t.node.residents;t.node.residents=null;for(let n=0;n<e.length;n++){const o=g.acquire().init(t);this._add(e.at(n),o),g.release(o)}}_grow(t){if(D(t,(t=>this.objectToBoundingSphere(t)),W),C(W[3])&&!this._fitsInsideTree(W))if(N(this._root.node))u(W,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const t=this._rootBoundsForRootAsSubNode(W);this._placingRootViolatesMaxDepth(t)?this._rebuildTree(W,t):this._growRootAsSubNode(t),g.release(t)}}_rebuildTree(t,e){n(_(V),_(e.bounds)),V[3]=e.halfSize,D([t,V],(t=>t),G);const o=g.acquire().init(this._root);this._root.initFrom(null,G,G[3]),this._root.increaseHalfSize(1.25),S(o,(t=>(this.add(t.node.terminals.data),null!==t.node.residents&&this.add(t.node.residents.data),!0))),g.release(o)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return S(this._root,(t=>(n=Math.max(n,t.depth),n+e<=this._maximumDepth))),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let o=-1/0;const i=this._root.bounds,r=this._root.halfSize;for(let h=0;h<3;h++){const t=i[h]-r-(n[h]-e),s=n[h]+e-(i[h]+r),a=Math.max(0,Math.ceil(t/(2*r))),l=Math.max(0,Math.ceil(s/(2*r)))+1,d=2**Math.ceil(Math.log(a+l)*Math.LOG2E);o=Math.max(o,d),U[h].min=a,U[h].max=l}for(let h=0;h<3;h++){let t=U[h].min,e=U[h].max;const n=(o-(t+e))/2;t+=Math.ceil(n),e+=Math.floor(n);const s=i[h]-r-t*r*2;q[h]=s+(e+t)*r}const s=o*r;return q[3]=s*w,g.acquire().initFrom(null,q,s,0)}_growRootAsSubNode(t){const e=this._root.node;n(_(W),_(this._root.bounds)),W[3]=this._root.halfSize,this._root.init(t),t.advanceTo(W,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(-1===t)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,o=0;for(;o<e.length&&null==t;)n=o++,t=e[n];for(;o<e.length;)if(e[o++])return-1;return n}_isDegenerate(t){return!C(this.objectToBoundingSphere(t)[3])}_fitsInsideTree(t){const e=this._root.bounds,n=this._root.halfSize;return t[3]<=n&&t[0]>=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,o=this._nodeToJSON(this._root.node);return{maximumDepth:t,maximumObjectsPerNode:e,objectCount:n,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:o}}}_nodeToJSON(t){const e=t.children.map((t=>t?this._nodeToJSON(t):null)),n=t.residents?.map((t=>this.objectToBoundingSphere(t))),o=t.terminals?.map((t=>this.objectToBoundingSphere(t)));return{children:e,residents:n,terminals:o}}static fromJSON(t){const e=new b((t=>t),{maximumDepth:t.maximumDepth,maximumObjectsPerNode:t.maximumObjectsPerNode});return e._objectCount=t.objectCount,e._root.initFrom(t.root.node,t.root.bounds,t.root.halfSize,t.root.depth),e}}class g{constructor(){this.bounds=m(),this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,o=this.depth){return this.node=null!=t?t:g.createEmptyNode(),e&&u(e,this.bounds),this.halfSize=n,this.depth=o,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*w}advance(t){let e=this.node.children[t];e||(e=g.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=E[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const o=this._childIndex(t);e&&e(this,o),this.advance(o)}}isLeaf(){return null!=this.node.residents}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]<t[0]?1:0)+(e[1]<t[1]?2:0)+(e[2]<t[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new e({shrink:!0}),residents:new e({shrink:!0})}}static{this._pool=new t(g)}static acquire(){return g._pool.acquire()}static release(t){g._pool.release(t)}static clearPool(){g._pool.prune()}}function S(t,e){let n=g.acquire().init(t);const o=[n];for(;0!==o.length;){if(n=o.pop(),e(n)&&!n.isLeaf())for(let t=0;t<n.node.children.length;t++){n.node.children[t]&&o.push(g.acquire().init(n).advance(t))}g.release(n)}}function j(t,e,n,o=b.DepthOrder.FRONT_TO_BACK){let i=g.acquire().init(t);const r=[i];for(R(n,o,X);0!==r.length;){if(i=r.pop(),e(i)&&!i.isLeaf())for(let t=7;t>=0;--t){const e=X[t];i.node.children[e]&&r.push(g.acquire().init(i).advance(e))}g.release(i)}}function O(t,e,n){K.clear();const o=n.advanceTo(e,((t,e)=>{K.push(t.node),K.push(e)}))?n.node.terminals:n.node.residents;if(o.removeUnordered(t),0===o.length)for(let i=K.length-2;i>=0;i-=2){if(!x(K.data[i],K.data[i+1]))break}}function x(t,n){return n>=0&&(t.children[n]=null),!!N(t)&&(null===t.residents&&(t.residents=new e({shrink:!0})),!0)}function T(t,e){return B(_(e.bounds),2*-e.halfSize,L),B(_(e.bounds),2*e.halfSize,H),p(t.origin,t.direction,L,H)}function z(t,e,n){return B(_(e.bounds),2*-e.halfSize,L),B(_(e.bounds),2*e.halfSize,H),n.applyToMinMax(L,H),p(t.origin,t.direction,L,H)}function N(t){if(0!==t.terminals.length)return!1;if(null!==t.residents)return 0===t.residents.length;for(let e=0;e<t.children.length;e++)if(t.children[e])return!1;return!0}function M(t,e){t[0]=Math.min(t[0],e[0]-e[3]),t[1]=Math.min(t[1],e[1]-e[3]),t[2]=Math.min(t[2],e[2]-e[3])}function A(t,e){t[0]=Math.max(t[0],e[0]+e[3]),t[1]=Math.max(t[1],e[1]+e[3]),t[2]=Math.max(t[2],e[2]+e[3])}function B(t,e,n){n[0]=t[0]+e,n[1]=t[1]+e,n[2]=t[2]+e}function D(t,e,n){L[0]=1/0,L[1]=1/0,L[2]=1/0,H[0]=-1/0,H[1]=-1/0,H[2]=-1/0;for(const o of t){const t=e(o);C(t[3])&&(M(L,t),A(H,t))}o(_(n),L,H,.5),n[3]=Math.max(H[0]-L[0],H[1]-L[1],H[2]-L[2])/2}function R(t,e,n){if(!Q.length)for(let o=0;o<8;++o)Q.push({index:0,distance:0});for(let o=0;o<8;++o){const n=E[o];Q.data[o].index=o,Q.data[o].distance=v(t,e,n)}Q.sort(((t,e)=>t.distance-e.distance));for(let o=0;o<8;++o)n[o]=Q.data[o].index}function F(t,e){let n,o=1/0;for(let i=0;i<8;++i){const r=v(t,e,P[i]);r<o&&(o=r,n=P[i])}return n}function v(t,e,n){return e*(t[0]*n[0]+t[1]*n[1]+t[2]*n[2])}function C(t){return!isNaN(t)&&t!==-1/0&&t!==1/0&&t>0}!function(t){var e;(e=t.DepthOrder||(t.DepthOrder={}))[e.FRONT_TO_BACK=1]="FRONT_TO_BACK",e[e.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(b||(b={}));const E=[h(-1,-1,-1),h(1,-1,-1),h(-1,1,-1),h(1,1,-1),h(-1,-1,1),h(1,-1,1),h(-1,1,1),h(1,1,1)],P=[h(-1,-1,-1),h(-1,-1,1),h(-1,1,-1),h(-1,1,1),h(1,-1,-1),h(1,-1,1),h(1,1,-1),h(1,1,1)],w=Math.sqrt(3),y=[null];function k(t){return y[0]=t,y}const q=m(),I=a(),L=a(),H=a(),K=new e,J=m(),W=m(),V=m(),G=m(),U=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],Q=new e,X=[0,0,0,0,0,0,0,0];export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as a,e as n,g as o,f as l,c,l as p,j as h,t as f}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as T}from"../../../../geometry/support/float16.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{create as E,distance2 as _,fromPoints as A,closestLineSegmentPoint as R}from"../../../../geometry/support/lineSegment.js";import{create as g,fromPoints as S,signedDistance as O,getNormal as I}from"../../../../geometry/support/plane.js";import{newLayout as v}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as P,isColorOrColorEmission as N,isDepth as L,isColorEmissionHighlightOIDOrDepth as b,is2DGeometryOutput as C,ShaderOutput as U}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as y}from"../effects/geometry/olidUtils.js";import j from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as F}from"../lib/Material.js";import{RenderSlot as w}from"../lib/RenderSlot.js";import{isTranslationMatrix as M}from"../lib/Util.js";import{VertexAttribute as B}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as J}from"./internal/bufferWriterUtils.js";import{LineMarkerAnchor as z}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as H}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as G,RibbonLineTechnique as k}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Z,CapType as V}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";var Y;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(Y||(Y={}));class q extends D{constructor(e){super(e,Q),this._configuration=new Z,this.vertexAttributeLocations=G,this.produces=new Map([[w.OPAQUE_MATERIAL,e=>P(e)||N(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>L(e)],[w.OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL,e=>N(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>N(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.DRAPED_MATERIAL,e=>C(e)]])}getConfiguration(e,t){super.getConfiguration(e,t,this._configuration),this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===w.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==U.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&te(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===F.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&N(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=W||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>W}intersectDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=e.get(B.SIZE);let l=this.parameters.width;if(this.parameters.vvSize){const r=e.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(r)?l*=this.parameters.vvSize.fallback[0]:l*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const c=s[0],p=s[1],h=(l/2+4)*r;let f=Number.MAX_VALUE,m=0;const u=e.get(B.POSITION).data,T=ee(this.parameters,e)?u.length-2:u.length-5;for(let d=0;d<T;d+=3){const e=u[d],r=u[d+1],i=(d+3)%u.length,s=c-e,a=p-r,n=u[i]-e,o=u[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),h=n*l-s,T=o*l-a,E=h*h+T*T;E<f&&(f=E,m=d/3)}f<h*h&&a(n.distance,n.normal,m)}intersect(r,f,m,u,T,E){const{options:g,camera:v,rayBegin:P,rayEnd:N}=m;if(!g.selectionMode||!r.visible||!v)return;if(!M(f))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const L=r.attributes,b=L.get(B.POSITION).data;let C=this.parameters.width;if(this.parameters.vvSize){const e=L.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(C*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else L.has(B.SIZE)&&(C*=L.get(B.SIZE).data[0]);const U=ne;i(U,m.point);const y=C*v.pixelRatio/2+4*v.pixelRatio;s(de[0],U[0]-y,U[1]+y,0),s(de[1],U[0]+y,U[1]+y,0),s(de[2],U[0]+y,U[1]-y,0),s(de[3],U[0]-y,U[1]-y,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(de[e],Ee[e]))return;S(v.eye,Ee[0],Ee[1],_e),S(v.eye,Ee[1],Ee[2],Ae),S(v.eye,Ee[2],Ee[3],Re),S(v.eye,Ee[3],Ee[0],ge);let j=Number.MAX_VALUE,D=0;const F=ee(this.parameters,L)?b.length-2:b.length-5;for(let e=0;e<F;e+=3){re[0]=b[e]+f[12],re[1]=b[e+1]+f[13],re[2]=b[e+2]+f[14];const t=(e+3)%b.length;if(ie[0]=b[t]+f[12],ie[1]=b[t+1]+f[13],ie[2]=b[t+2]+f[14],O(_e,re)<0&&O(_e,ie)<0||O(Ae,re)<0&&O(Ae,ie)<0||O(Re,re)<0&&O(Re,ie)<0||O(ge,re)<0&&O(ge,ie)<0)continue;if(v.projectToRenderScreen(re,oe),v.projectToRenderScreen(ie,le),oe[2]<0&&le[2]>0){a(se,re,ie);const e=v.frustum,t=-O(e[d.NEAR],re)/n(se,I(e[d.NEAR]));o(se,se,t),l(re,re,se),v.projectToRenderScreen(re,oe)}else if(oe[2]>0&&le[2]<0){a(se,ie,re);const e=v.frustum,t=-O(e[d.NEAR],ie)/n(se,I(e[d.NEAR]));o(se,se,t),l(ie,ie,se),v.projectToRenderScreen(ie,le)}else if(oe[2]<0&&le[2]<0)continue;oe[2]=0,le[2]=0;const r=_(A(oe,le,he),U);r<j&&(j=r,c(ce,re),c(pe,ie),D=e/3)}if(j<y*y){let e=Number.MAX_VALUE;if(R(A(ce,pe,he),A(P,N,fe),ae)){a(ae,ae,P);const t=p(ae);o(ae,ae,1/t),e=t/h(P,N)}E(e,ae,D)}}get _layout(){const e=v().vec3f(B.POSITION).vec4f16(B.PREVIOUSDELTA).vec4f16(B.NEXTDELTA).f32(B.U0).vec2f16(B.LINEPARAMETERS);return this.parameters.vvSize?e.f32(B.SIZEFEATUREATTRIBUTE):e.f16(B.SIZE),this.parameters.vvColor?e.f16(B.COLORFEATUREATTRIBUTE):e.vec4u8(B.COLOR,{glNormalized:!0}),this.parameters.vvOpacity&&e.f16(B.OPACITYFEATUREATTRIBUTE),y()&&e.vec4u8(B.OLIDCOLOR),e}createBufferWriter(){return new K(this._layout,this.parameters)}createGLMaterial(e){return new X(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class X extends j{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(k,e)}}class Q extends x{constructor(){super(...arguments),this.width=0,this.color=u,this.join="miter",this.cap=V.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class K{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=H+r}}_isClosed(e){return ee(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(B.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a,n){const o=r.get(B.POSITION),l=o.indices,p=o.data.length/3,m=r.get(B.DISTANCETOSTART)?.data;l&&l.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const u=this.vertexBufferLayout.fields.has(B.SIZEFEATUREATTRIBUTE),d=(u?r.get(B.SIZEFEATUREATTRIBUTE)?.data[0]:r.get(B.SIZE)?.data[0])??1;let E=[1,1,1,1],_=0;const A=this.vertexBufferLayout.fields.has(B.COLORFEATUREATTRIBUTE);A?_=r.get(B.COLORFEATUREATTRIBUTE).data[0]:r.has(B.COLOR)&&(E=r.get(B.COLOR).data);const R=this.vertexBufferLayout.fields.has(B.OPACITYFEATUREATTRIBUTE),g=R?r.get(B.OPACITYFEATUREATTRIBUTE).data[0]:0,S=new Float32Array(a.buffer),O=T(a.buffer),I=new Uint8Array(a.buffer),v=this.vertexBufferLayout.stride/4;let P=n*v;const N=P;let L=0;const b=m?(e,t,r)=>L=m[r]:(e,t,r)=>L+=h(e,t),C=S.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,U=4/C,j=(e,t,r,s,a,n,o)=>{S[P++]=t[0],S[P++]=t[1],S[P++]=t[2],J(e,t,O,P*C),P+=U,J(r,t,O,P*C),P+=U,S[P++]=o;let l=P*C;if(O[l++]=s,O[l++]=a,u?(P=Math.ceil(l/C),S[P]=d,l+=C):O[l++]=d,A)O[l++]=_;else{const e=Math.min(4*n,E.length-4),t=l/C*4;l+=C,I[t]=255*E[e],I[t+1]=255*E[e+1],I[t+2]=255*E[e+2],I[t+3]=255*E[e+3]}R&&(O[l++]=g);let c=l/C*4;y()&&i&&(I[c++]=i[0],I[c++]=i[1],I[c++]=i[2],I[c++]=i[3]),P=Math.ceil(.25*c)};P+=v,s(ue,o.data[0],o.data[1],o.data[2]),e&&f(ue,ue,e);const D=this._isClosed(r);if(D){const t=o.data.length-3;s(me,o.data[t],o.data[t+1],o.data[t+2]),e&&f(me,me,e)}else s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),j(ue,ue,Te,1,Y.LEFT_CAP_START,0,0),j(ue,ue,Te,1,Y.RIGHT_CAP_START,0,0),c(me,ue),c(ue,Te);const F=D?0:1,w=D?p:p-1;for(let h=F;h<w;h++){const t=(h+1)%p*3;s(Te,o.data[t],o.data[t+1],o.data[t+2]),e&&f(Te,Te,e),b(me,ue,h),j(me,ue,Te,0,Y.LEFT_JOIN_END,h,L),j(me,ue,Te,0,Y.RIGHT_JOIN_END,h,L);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);j(me,ue,Te,t,Y.LEFT_JOIN_END,h,L),j(me,ue,Te,t,Y.RIGHT_JOIN_END,h,L)}j(me,ue,Te,1,Y.LEFT_JOIN_START,h,L),j(me,ue,Te,1,Y.RIGHT_JOIN_START,h,L),c(me,ue),c(ue,Te)}D?(s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),L=b(me,ue,w),j(me,ue,Te,0,Y.LEFT_JOIN_END,F,L),j(me,ue,Te,0,Y.RIGHT_JOIN_END,F,L)):(L=b(me,ue,w),j(me,ue,ue,0,Y.LEFT_CAP_END,w,L),j(me,ue,ue,0,Y.RIGHT_CAP_END,w,L)),$(S,N+v,S,N,v);return P=$(S,P-v,S,P,v),this._parameters.wireframe&&this._addWireframeVertices(a,N,P,v),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=$(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function $(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function ee(e,t){if(!e.isClosed)return!1;return t.get(B.POSITION).indices.length>2}function te(e){return e.anchor===z.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const re=m(),ie=m(),se=m(),ae=m(),ne=m(),oe=r(),le=r(),ce=m(),pe=m(),he=E(),fe=E(),me=m(),ue=m(),Te=m(),de=[r(),r(),r(),r()],Ee=[m(),m(),m(),m()],_e=g(),Ae=g(),Re=g(),ge=g();export{Q as Parameters,q as RibbonLineMaterial};
5
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as a,e as n,g as o,f as l,c,l as p,j as h,t as f}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as T}from"../../../../geometry/support/float16.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{distance2 as E,fromPoints as _,create as A,closestLineSegmentPoint as R}from"../../../../geometry/support/lineSegment.js";import{fromPoints as g,create as S,signedDistance as O,getNormal as I}from"../../../../geometry/support/plane.js";import{newLayout as v}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as P,isColorOrColorEmission as N,isDepth as L,isColorEmissionHighlightOIDOrDepth as b,is2DGeometryOutput as C,ShaderOutput as U}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as y}from"../effects/geometry/olidUtils.js";import j from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as F}from"../lib/Material.js";import{RenderSlot as w}from"../lib/RenderSlot.js";import{isTranslationMatrix as M}from"../lib/Util.js";import{VertexAttribute as B}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as J}from"./internal/bufferWriterUtils.js";import{LineMarkerAnchor as z}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as H}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as G,RibbonLineTechnique as k}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Z,CapType as V}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";var Y;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(Y||(Y={}));class q extends D{constructor(e){super(e,Q),this._configuration=new Z,this.vertexAttributeLocations=G,this.produces=new Map([[w.OPAQUE_MATERIAL,e=>P(e)||N(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>L(e)],[w.OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL,e=>N(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>N(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.DRAPED_MATERIAL,e=>C(e)]])}getConfiguration(e,t){super.getConfiguration(e,t,this._configuration),this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===w.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==U.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&te(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===F.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&N(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=W||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>W}intersectDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=e.get(B.SIZE);let l=this.parameters.width;if(this.parameters.vvSize){const r=e.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(r)?l*=this.parameters.vvSize.fallback[0]:l*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const c=s[0],p=s[1],h=(l/2+4)*r;let f=Number.MAX_VALUE,m=0;const u=e.get(B.POSITION).data,T=ee(this.parameters,e)?u.length-2:u.length-5;for(let d=0;d<T;d+=3){const e=u[d],r=u[d+1],i=(d+3)%u.length,s=c-e,a=p-r,n=u[i]-e,o=u[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),h=n*l-s,T=o*l-a,E=h*h+T*T;E<f&&(f=E,m=d/3)}f<h*h&&a(n.distance,n.normal,m)}intersect(r,f,m,u,T,A){const{options:S,camera:v,rayBegin:P,rayEnd:N}=m;if(!S.selectionMode||!r.visible||!v)return;if(!M(f))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const L=r.attributes,b=L.get(B.POSITION).data;let C=this.parameters.width;if(this.parameters.vvSize){const e=L.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(C*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else L.has(B.SIZE)&&(C*=L.get(B.SIZE).data[0]);const U=ne;i(U,m.point);const y=C*v.pixelRatio/2+4*v.pixelRatio;s(de[0],U[0]-y,U[1]+y,0),s(de[1],U[0]+y,U[1]+y,0),s(de[2],U[0]+y,U[1]-y,0),s(de[3],U[0]-y,U[1]-y,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(de[e],Ee[e]))return;g(v.eye,Ee[0],Ee[1],_e),g(v.eye,Ee[1],Ee[2],Ae),g(v.eye,Ee[2],Ee[3],Re),g(v.eye,Ee[3],Ee[0],ge);let j=Number.MAX_VALUE,D=0;const F=ee(this.parameters,L)?b.length-2:b.length-5;for(let e=0;e<F;e+=3){re[0]=b[e]+f[12],re[1]=b[e+1]+f[13],re[2]=b[e+2]+f[14];const t=(e+3)%b.length;if(ie[0]=b[t]+f[12],ie[1]=b[t+1]+f[13],ie[2]=b[t+2]+f[14],O(_e,re)<0&&O(_e,ie)<0||O(Ae,re)<0&&O(Ae,ie)<0||O(Re,re)<0&&O(Re,ie)<0||O(ge,re)<0&&O(ge,ie)<0)continue;if(v.projectToRenderScreen(re,oe),v.projectToRenderScreen(ie,le),oe[2]<0&&le[2]>0){a(se,re,ie);const e=v.frustum,t=-O(e[d.NEAR],re)/n(se,I(e[d.NEAR]));o(se,se,t),l(re,re,se),v.projectToRenderScreen(re,oe)}else if(oe[2]>0&&le[2]<0){a(se,ie,re);const e=v.frustum,t=-O(e[d.NEAR],ie)/n(se,I(e[d.NEAR]));o(se,se,t),l(ie,ie,se),v.projectToRenderScreen(ie,le)}else if(oe[2]<0&&le[2]<0)continue;oe[2]=0,le[2]=0;const r=E(_(oe,le,he),U);r<j&&(j=r,c(ce,re),c(pe,ie),D=e/3)}if(j<y*y){let e=Number.MAX_VALUE;if(R(_(ce,pe,he),_(P,N,fe),ae)){a(ae,ae,P);const t=p(ae);o(ae,ae,1/t),e=t/h(P,N)}A(e,ae,D)}}get _layout(){const e=v().vec3f(B.POSITION).vec4f16(B.PREVIOUSDELTA).vec4f16(B.NEXTDELTA).f32(B.U0).vec2f16(B.LINEPARAMETERS);return this.parameters.vvSize?e.f32(B.SIZEFEATUREATTRIBUTE):e.f16(B.SIZE),this.parameters.vvColor?e.f16(B.COLORFEATUREATTRIBUTE):e.vec4u8(B.COLOR,{glNormalized:!0}),this.parameters.vvOpacity&&e.f16(B.OPACITYFEATUREATTRIBUTE),y()&&e.vec4u8(B.OLIDCOLOR),e}createBufferWriter(){return new K(this._layout,this.parameters)}createGLMaterial(e){return new X(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class X extends j{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(k,e)}}class Q extends x{constructor(){super(...arguments),this.width=0,this.color=u,this.join="miter",this.cap=V.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class K{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=H+r}}_isClosed(e){return ee(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(B.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a,n){const o=r.get(B.POSITION),l=o.indices,p=o.data.length/3,m=r.get(B.DISTANCETOSTART)?.data;l&&l.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const u=this.vertexBufferLayout.fields.has(B.SIZEFEATUREATTRIBUTE),d=(u?r.get(B.SIZEFEATUREATTRIBUTE)?.data[0]:r.get(B.SIZE)?.data[0])??1;let E=[1,1,1,1],_=0;const A=this.vertexBufferLayout.fields.has(B.COLORFEATUREATTRIBUTE);A?_=r.get(B.COLORFEATUREATTRIBUTE).data[0]:r.has(B.COLOR)&&(E=r.get(B.COLOR).data);const R=this.vertexBufferLayout.fields.has(B.OPACITYFEATUREATTRIBUTE),g=R?r.get(B.OPACITYFEATUREATTRIBUTE).data[0]:0,S=new Float32Array(a.buffer),O=T(a.buffer),I=new Uint8Array(a.buffer),v=this.vertexBufferLayout.stride/4;let P=n*v;const N=P;let L=0;const b=m?(e,t,r)=>L=m[r]:(e,t,r)=>L+=h(e,t),C=S.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,U=4/C,j=(e,t,r,s,a,n,o)=>{S[P++]=t[0],S[P++]=t[1],S[P++]=t[2],J(e,t,O,P*C),P+=U,J(r,t,O,P*C),P+=U,S[P++]=o;let l=P*C;if(O[l++]=s,O[l++]=a,u?(P=Math.ceil(l/C),S[P]=d,l+=C):O[l++]=d,A)O[l++]=_;else{const e=Math.min(4*n,E.length-4),t=l/C*4;l+=C,I[t]=255*E[e],I[t+1]=255*E[e+1],I[t+2]=255*E[e+2],I[t+3]=255*E[e+3]}R&&(O[l++]=g);let c=l/C*4;y()&&i&&(I[c++]=i[0],I[c++]=i[1],I[c++]=i[2],I[c++]=i[3]),P=Math.ceil(.25*c)};P+=v,s(ue,o.data[0],o.data[1],o.data[2]),e&&f(ue,ue,e);const D=this._isClosed(r);if(D){const t=o.data.length-3;s(me,o.data[t],o.data[t+1],o.data[t+2]),e&&f(me,me,e)}else s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),j(ue,ue,Te,1,Y.LEFT_CAP_START,0,0),j(ue,ue,Te,1,Y.RIGHT_CAP_START,0,0),c(me,ue),c(ue,Te);const F=D?0:1,w=D?p:p-1;for(let h=F;h<w;h++){const t=(h+1)%p*3;s(Te,o.data[t],o.data[t+1],o.data[t+2]),e&&f(Te,Te,e),b(me,ue,h),j(me,ue,Te,0,Y.LEFT_JOIN_END,h,L),j(me,ue,Te,0,Y.RIGHT_JOIN_END,h,L);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);j(me,ue,Te,t,Y.LEFT_JOIN_END,h,L),j(me,ue,Te,t,Y.RIGHT_JOIN_END,h,L)}j(me,ue,Te,1,Y.LEFT_JOIN_START,h,L),j(me,ue,Te,1,Y.RIGHT_JOIN_START,h,L),c(me,ue),c(ue,Te)}D?(s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),L=b(me,ue,w),j(me,ue,Te,0,Y.LEFT_JOIN_END,F,L),j(me,ue,Te,0,Y.RIGHT_JOIN_END,F,L)):(L=b(me,ue,w),j(me,ue,ue,0,Y.LEFT_CAP_END,w,L),j(me,ue,ue,0,Y.RIGHT_CAP_END,w,L)),$(S,N+v,S,N,v);return P=$(S,P-v,S,P,v),this._parameters.wireframe&&this._addWireframeVertices(a,N,P,v),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=$(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function $(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function ee(e,t){if(!e.isClosed)return!1;return t.get(B.POSITION).indices.length>2}function te(e){return e.anchor===z.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const re=m(),ie=m(),se=m(),ae=m(),ne=m(),oe=r(),le=r(),ce=m(),pe=m(),he=A(),fe=A(),me=m(),ue=m(),Te=m(),de=[r(),r(),r(),r()],Ee=[m(),m(),m(),m()],_e=S(),Ae=S(),Re=S(),ge=S();export{Q as Parameters,q as RibbonLineMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{packFloatRGBA as t}from"../../../../core/floatRGBA.js";import{ProceduralTextureRepository as e}from"./ProceduralTextureRepository.js";import{PixelFormat as r,TextureWrapMode as o}from"../../../webgl/enums.js";import{Texture as n}from"../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../webgl/TextureDescriptor.js";function u(t,u){return new e((e=>{const{encodedData:u,textureSize:c}=a(e),f=new i;return f.internalFormat=r.RGBA,f.width=c,f.height=1,f.wrapMode=o.REPEAT,new n(t,f,u)}),(t=>`${t.pattern.join(",")}-r${t.pixelRatio}`),u)}function a(e){const r=c(e),o=1/e.pixelRatio,n=f(e),i=s(e),u=(Math.floor(.5*(i-1))+.5)*o,a=[];let l=1;for(const t of r){for(let e=0;e<t;e++){const r=l*(Math.min(e,t-1-e)+.5)*o/u*.5+.5;a.push(r)}l=-l}const p=Math.round(r[0]/2),m=[...a.slice(p),...a.slice(0,p)],d=new Uint8Array(4*n);let x=0;for(const c of m)t(c,d,x),x+=4;return{encodedData:d,textureSize:n}}function c(t){return t.pattern.map((e=>Math.round(e*t.pixelRatio)))}function f(t){if(null==t)return 1;const e=c(t);return Math.floor(e.reduce(((t,e)=>t+e)))}function s(t){return c(t).reduce(((t,e)=>Math.max(t,e)))}export{s as computeLongestPattern,f as computeTextureSize,u as createStippleTextureRepository};
5
+ import{packFloatRGBA as t}from"../../../../core/floatRGBA.js";import{ProceduralTextureRepository as e}from"./ProceduralTextureRepository.js";import{PixelFormat as r,TextureWrapMode as o}from"../../../webgl/enums.js";import{Texture as n}from"../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../webgl/TextureDescriptor.js";function u(t,u){return new e((e=>{const{encodedData:u,textureSize:c}=a(e),f=new i(c,1);return f.internalFormat=r.RGBA,f.wrapMode=o.REPEAT,new n(t,f,u)}),(t=>`${t.pattern.join(",")}-r${t.pixelRatio}`),u)}function a(e){const r=c(e),o=1/e.pixelRatio,n=f(e),i=s(e),u=(Math.floor(.5*(i-1))+.5)*o,a=[];let l=1;for(const t of r){for(let e=0;e<t;e++){const r=l*(Math.min(e,t-1-e)+.5)*o/u*.5+.5;a.push(r)}l=-l}const p=Math.round(r[0]/2),m=[...a.slice(p),...a.slice(0,p)],x=new Uint8Array(4*n);let d=0;for(const c of m)t(c,x,d),d+=4;return{encodedData:x,textureSize:n}}function c(t){return t.pattern.map((e=>Math.round(e*t.pixelRatio)))}function f(t){if(null==t)return 1;const e=c(t);return Math.floor(e.reduce(((t,e)=>t+e)))}function s(t){return c(t).reduce(((t,e)=>Math.max(t,e)))}export{s as computeLongestPattern,f as computeTextureSize,u as createStippleTextureRepository};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import{parameter as e,ShaderTechniqueConfiguration as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";var i;!function(t){t[t.None=0]="None",t[t.Alpha=1]="Alpha",t[t.PremultipliedAlpha=2]="PremultipliedAlpha",t[t.Depth=3]="Depth",t[t.COUNT=4]="COUNT"}(i||(i={}));class r extends o{constructor(){super(...arguments),this.blitMode=i.None,this.hasOpacityFactor=!1}}t([e({count:i.COUNT})],r.prototype,"blitMode",void 0),t([e()],r.prototype,"hasOpacityFactor",void 0);export{i as BlitMode,r as CompositingTechniqueConfiguration};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{ShaderTechniqueConfiguration as e,parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";var i;!function(t){t[t.None=0]="None",t[t.Alpha=1]="Alpha",t[t.PremultipliedAlpha=2]="PremultipliedAlpha",t[t.Depth=3]="Depth",t[t.COUNT=4]="COUNT"}(i||(i={}));class r extends e{constructor(){super(...arguments),this.blitMode=i.None,this.hasOpacityFactor=!1}}t([o({count:i.COUNT})],r.prototype,"blitMode",void 0),t([o()],r.prototype,"hasOpacityFactor",void 0);export{i as BlitMode,r as CompositingTechniqueConfiguration};