@arcgis/core 4.28.0-next.20230713 → 4.28.0-next.20230715

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 (273) hide show
  1. package/Basemap.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{0b28b5eec6dc67be8ce9.js → 0121bfc81b794745e024.js} +1 -1
  4. package/assets/esri/core/workers/chunks/067d3d45caeaaba18d81.js +1 -0
  5. package/assets/esri/core/workers/chunks/080a13dc08a8db498ffa.js +1 -0
  6. package/assets/esri/core/workers/chunks/0dccbc6c2559fdc0c2ad.js +1 -0
  7. package/assets/esri/core/workers/chunks/{c912466351e37db68b6c.js → 14ab33573bb02d6c6b1a.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{c4b066760e9aa85b7607.js → 1b948f8429d8f9b1bbfb.js} +1 -1
  9. package/assets/esri/core/workers/chunks/204ed2ebd2d3da659791.js +1 -0
  10. package/assets/esri/core/workers/chunks/{5d5d4a4fdf5ca8d7837f.js → 239d4176ff2d5142b7f1.js} +1 -1
  11. package/assets/esri/core/workers/chunks/23bb98aaa20b180ee680.js +1 -0
  12. package/assets/esri/core/workers/chunks/27cf3ef9566d5226b0df.js +1 -0
  13. package/assets/esri/core/workers/chunks/{1c86f80d73dee1a4d9b7.js → 2f1695e4807a534e1743.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{60b422009f58d7bbb8c4.js → 3164b862a6b3f654fade.js} +1 -1
  15. package/assets/esri/core/workers/chunks/35f60625ada14eb801fd.js +1 -0
  16. package/assets/esri/core/workers/chunks/{4e4e62462deec25e82ce.js → 3a04bf1cdce263fe2191.js} +1 -1
  17. package/assets/esri/core/workers/chunks/41011207b6cc5eb6232f.js +1 -0
  18. package/assets/esri/core/workers/chunks/{8d50449c029c73136204.js → 432e3558db53574d21b4.js} +1 -1
  19. package/assets/esri/core/workers/chunks/4767f69b81d36dde9550.js +1 -0
  20. package/assets/esri/core/workers/chunks/{08ee2bd914867fd2cbd5.js → 490629c6f9fee501c9cd.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{044b15794b6403792f04.js → 4f079d0e69189c1d8bd9.js} +1 -1
  22. package/assets/esri/core/workers/chunks/4f1f4cc82fea0d1f79ec.js +1 -0
  23. package/assets/esri/core/workers/chunks/503a393327df755d8843.js +1 -0
  24. package/assets/esri/core/workers/chunks/50e05f479c7d414fc06b.js +1 -0
  25. package/assets/esri/core/workers/chunks/{3835a76c017431f19422.js → 51da3c5c50b153ce6bc7.js} +1 -1
  26. package/assets/esri/core/workers/chunks/54b97ca5f2164b941f5b.js +1 -0
  27. package/assets/esri/core/workers/chunks/5a3fb63dab89cf3418f7.js +1 -0
  28. package/assets/esri/core/workers/chunks/5ceaf1f05b219034a10c.js +1 -0
  29. package/assets/esri/core/workers/chunks/70aabffaaa0a1da8e609.js +1 -0
  30. package/assets/esri/core/workers/chunks/78cb95d1594a0cb0dd7a.js +1 -0
  31. package/assets/esri/core/workers/chunks/7f391ae5e0ea7812baca.js +1 -0
  32. package/assets/esri/core/workers/chunks/{1d2b8b937bbda91a6549.js → 82dfbc175b52c7a10475.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{036cd65514eab1749363.js → 8467d05626a3a72462c9.js} +1 -1
  34. package/assets/esri/core/workers/chunks/9038b1317f1252e31f09.js +1 -0
  35. package/assets/esri/core/workers/chunks/929ddc4d9975ed893767.js +1 -0
  36. package/assets/esri/core/workers/chunks/{e86dcc239c6a57000afc.js → 94633cc9cfb089ef010e.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{2f5f398374ff77fb17f0.js → 975eef6d20c17a0ed07b.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{8913bddc76b82cb24664.js → 98cf4e744e8f2c3fc536.js} +1 -1
  39. package/assets/esri/core/workers/chunks/a00414550fa21c5662f3.js +1 -0
  40. package/assets/esri/core/workers/chunks/a3a1d4f32e518e97d071.js +1 -0
  41. package/assets/esri/core/workers/chunks/{4e2029c8cc8a5afe5759.js → a5348f117dacdcae99ee.js} +1 -1
  42. package/assets/esri/core/workers/chunks/b0f0a3178d88fa600a11.js +1 -0
  43. package/assets/esri/core/workers/chunks/b4446ce010bc4a5aa917.js +1 -0
  44. package/assets/esri/core/workers/chunks/b8a45b28a915a423d09d.js +1 -0
  45. package/assets/esri/core/workers/chunks/{fb97d39b25b0b009d2f0.js → bd9e6f38c9ec4195322a.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{30deb5a8e9a82186991d.js → c15c4bd52d4472ed50bc.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{55109f141c9f120833f6.js → c3d773c93efb41088c54.js} +1 -1
  48. package/assets/esri/core/workers/chunks/c518410b1214ffc58017.js +1 -0
  49. package/assets/esri/core/workers/chunks/d55faafe2ac914a3ebd1.js +1 -0
  50. package/assets/esri/core/workers/chunks/d5fd4780d57173f3e303.js +1 -0
  51. package/assets/esri/core/workers/chunks/da01e520a1ae0048e73e.js +1 -0
  52. package/assets/esri/core/workers/chunks/dd7603c9e5fd178c88f7.js +1 -0
  53. package/assets/esri/core/workers/chunks/ddcf58937924ab5a3d76.js +1 -0
  54. package/assets/esri/core/workers/chunks/e03a0f52d438f53a3057.js +1 -0
  55. package/assets/esri/core/workers/chunks/e433440fecd0114cb23d.js +1 -0
  56. package/assets/esri/core/workers/chunks/ea1560129e426980a4e2.js +1 -0
  57. package/assets/esri/core/workers/chunks/f73e2143f8d053aef092.js +1 -0
  58. package/assets/esri/core/workers/chunks/{0a0af540f4fe64c3d292.js → fa14238f1c308a74f843.js} +1 -1
  59. package/assets/esri/themes/base/widgets/_ElevationProfile.scss +3 -0
  60. package/assets/esri/themes/dark/main.css +1 -1
  61. package/assets/esri/themes/light/main.css +1 -1
  62. package/assets/esri/themes/light/view.css +1 -1
  63. package/chunks/RibbonLine.glsl.js +57 -72
  64. package/chunks/ar.js +1 -1
  65. package/chunks/ar2.js +1 -1
  66. package/chunks/bg_BG.js +1 -1
  67. package/chunks/bg_BG2.js +1 -1
  68. package/chunks/bs_BA.js +1 -1
  69. package/chunks/bs_BA2.js +1 -1
  70. package/chunks/ca_ES.js +1 -1
  71. package/chunks/ca_ES2.js +1 -1
  72. package/chunks/chartUtilsAm5.js +1 -1
  73. package/chunks/cs_CZ.js +1 -1
  74. package/chunks/cs_CZ2.js +1 -1
  75. package/chunks/da_DK.js +1 -1
  76. package/chunks/da_DK2.js +1 -1
  77. package/chunks/de_CH.js +1 -1
  78. package/chunks/de_CH2.js +1 -1
  79. package/chunks/de_DE.js +1 -1
  80. package/chunks/de_DE2.js +1 -1
  81. package/chunks/el_GR.js +1 -1
  82. package/chunks/el_GR2.js +1 -1
  83. package/chunks/en_CA.js +1 -1
  84. package/chunks/en_CA2.js +1 -1
  85. package/chunks/en_US.js +1 -1
  86. package/chunks/en_US2.js +1 -1
  87. package/chunks/es_ES.js +1 -1
  88. package/chunks/es_ES2.js +1 -1
  89. package/chunks/et_EE.js +1 -1
  90. package/chunks/et_EE2.js +1 -1
  91. package/chunks/fi_FI.js +1 -1
  92. package/chunks/fi_FI2.js +1 -1
  93. package/chunks/fr_FR.js +1 -1
  94. package/chunks/fr_FR2.js +1 -1
  95. package/chunks/he_IL.js +1 -1
  96. package/chunks/he_IL2.js +1 -1
  97. package/chunks/hr_HR.js +1 -1
  98. package/chunks/hr_HR2.js +1 -1
  99. package/chunks/hu_HU.js +1 -1
  100. package/chunks/hu_HU2.js +1 -1
  101. package/chunks/id_ID.js +1 -1
  102. package/chunks/id_ID2.js +1 -1
  103. package/chunks/it_IT.js +1 -1
  104. package/chunks/it_IT2.js +1 -1
  105. package/chunks/ja_JP.js +1 -1
  106. package/chunks/ja_JP2.js +1 -1
  107. package/chunks/ko_KR.js +1 -1
  108. package/chunks/ko_KR2.js +1 -1
  109. package/chunks/lt_LT.js +1 -1
  110. package/chunks/lt_LT2.js +1 -1
  111. package/chunks/lv_LV.js +1 -1
  112. package/chunks/lv_LV2.js +1 -1
  113. package/chunks/nb_NO.js +1 -1
  114. package/chunks/nb_NO2.js +1 -1
  115. package/chunks/nl_NL.js +1 -1
  116. package/chunks/nl_NL2.js +1 -1
  117. package/chunks/pl_PL.js +1 -1
  118. package/chunks/pl_PL2.js +1 -1
  119. package/chunks/pt_BR.js +1 -1
  120. package/chunks/pt_BR2.js +1 -1
  121. package/chunks/pt_PT.js +1 -1
  122. package/chunks/pt_PT2.js +1 -1
  123. package/chunks/ro_RO.js +1 -1
  124. package/chunks/ro_RO2.js +1 -1
  125. package/chunks/ru_RU.js +1 -1
  126. package/chunks/ru_RU2.js +1 -1
  127. package/chunks/sk_SK.js +1 -1
  128. package/chunks/sk_SK2.js +1 -1
  129. package/chunks/sl_SL.js +1 -1
  130. package/chunks/sl_SL2.js +1 -1
  131. package/chunks/sr_RS.js +1 -1
  132. package/chunks/sr_RS2.js +1 -1
  133. package/chunks/sv_SE.js +1 -1
  134. package/chunks/sv_SE2.js +1 -1
  135. package/chunks/th_TH.js +1 -1
  136. package/chunks/th_TH2.js +1 -1
  137. package/chunks/tr_TR.js +1 -1
  138. package/chunks/tr_TR2.js +1 -1
  139. package/chunks/uk_UA.js +1 -1
  140. package/chunks/uk_UA2.js +1 -1
  141. package/chunks/vi_VN.js +1 -1
  142. package/chunks/vi_VN2.js +1 -1
  143. package/chunks/zh_Hans.js +1 -1
  144. package/chunks/zh_Hans2.js +1 -1
  145. package/chunks/zh_Hant.js +1 -1
  146. package/chunks/zh_Hant2.js +1 -1
  147. package/config.js +1 -1
  148. package/core/colorUtils.js +1 -1
  149. package/core/image/apng.js +1 -1
  150. package/core/image/gif.js +1 -1
  151. package/core/urlUtils.js +1 -1
  152. package/core/workers/WorkerOwner.js +1 -1
  153. package/core/workers/staticWorkerMessages.js +5 -0
  154. package/geometry/projection.js +1 -1
  155. package/interfaces.d.ts +42 -2
  156. package/kernel.js +1 -1
  157. package/layers/support/ImageElement.js +1 -1
  158. package/layers/video/VideoController.js +1 -1
  159. package/package.json +1 -1
  160. package/portal/Portal.js +1 -1
  161. package/support/BasemapStyle.js +5 -0
  162. package/support/basemapUtils.js +1 -1
  163. package/support/revision.js +1 -1
  164. package/symbols/support/previewSymbol2D.js +1 -1
  165. package/views/2d/GoToManager.js +5 -0
  166. package/views/2d/engine/Stage.js +1 -1
  167. package/views/2d/engine/webgl/Overlay.js +1 -1
  168. package/views/2d/engine/webgl/animatedFormats/utils.js +1 -1
  169. package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
  170. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  171. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  172. package/views/2d/layers/MediaLayerView2D.js +1 -1
  173. package/views/2d/layers/TileLayerView2D.js +1 -1
  174. package/views/2d/support/engineHelpers.js +1 -1
  175. package/views/2d/support/screenshotUtils.js +5 -0
  176. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  177. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  178. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  179. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  180. package/views/3d/analysis/Dimension/LengthDimensionVisualization.js +1 -1
  181. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  182. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  183. package/views/3d/analysis/Dimension/settings.js +1 -1
  184. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  185. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  186. package/views/3d/analysis/LineOfSight/LineOfSightToolConfiguration.js +1 -1
  187. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  188. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  189. package/views/3d/analysis/Slice/settings.js +1 -1
  190. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  191. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  192. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  193. package/views/3d/interactive/editingTools/lineGraphicVisualElementUtils.js +1 -1
  194. package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
  195. package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
  196. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  197. package/views/3d/interactive/editingTools/originGraphicVisualElementUtils.js +1 -1
  198. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  199. package/views/3d/interactive/editingTools/settings.js +1 -1
  200. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  201. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  202. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  203. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  204. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  205. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  206. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  207. package/views/3d/terrain/TerrainRenderer.js +1 -1
  208. package/views/3d/terrain/TerrainSurface.js +1 -1
  209. package/views/3d/terrain/Tile.js +1 -1
  210. package/views/3d/terrain/TileRenderer.js +1 -1
  211. package/views/3d/terrain/TileTexture.js +1 -1
  212. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +12 -13
  213. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  214. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  215. package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
  216. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  217. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  218. package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
  219. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  220. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  221. package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
  222. package/views/MapView.js +1 -1
  223. package/views/Theme.js +5 -0
  224. package/views/View.js +1 -1
  225. package/views/interactive/SegmentLabels.js +1 -1
  226. package/views/support/colorUtils.js +1 -1
  227. package/views/webgl/Texture.js +1 -1
  228. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  229. package/widgets/Attachments.js +1 -1
  230. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  231. package/widgets/ElevationProfile/support/InputRepresentation3D.js +1 -1
  232. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  233. package/widgets/Feature/FeatureMedia/chartCommon.js +1 -1
  234. package/widgets/Feature/FeatureMedia.js +1 -1
  235. package/widgets/support/chartUtils.js +1 -1
  236. package/widgets/support/chartUtilsAm5.js +1 -1
  237. package/assets/esri/core/workers/chunks/05f3374114bce72d3560.js +0 -1
  238. package/assets/esri/core/workers/chunks/10028df973ef7f9531c8.js +0 -1
  239. package/assets/esri/core/workers/chunks/1cbb03eec9dc23ef043b.js +0 -1
  240. package/assets/esri/core/workers/chunks/289061552a2a64bebd76.js +0 -1
  241. package/assets/esri/core/workers/chunks/308eeeaec591b4eea1de.js +0 -1
  242. package/assets/esri/core/workers/chunks/3155c750fc5a4e04a785.js +0 -1
  243. package/assets/esri/core/workers/chunks/346f67995b327bca8ee0.js +0 -1
  244. package/assets/esri/core/workers/chunks/3736e17dd6461f74cfaf.js +0 -1
  245. package/assets/esri/core/workers/chunks/37e60f9ca86f9d4bf4ea.js +0 -1
  246. package/assets/esri/core/workers/chunks/3a0b45ecc48e23a3a5d5.js +0 -1
  247. package/assets/esri/core/workers/chunks/417377c8e76944f428a7.js +0 -1
  248. package/assets/esri/core/workers/chunks/498dca81073e1fb477b9.js +0 -1
  249. package/assets/esri/core/workers/chunks/536962375ce4f1394481.js +0 -1
  250. package/assets/esri/core/workers/chunks/64bb4093c019a02d5309.js +0 -1
  251. package/assets/esri/core/workers/chunks/69de4733173ee2dee6e1.js +0 -1
  252. package/assets/esri/core/workers/chunks/6dcffe6683a798a42c78.js +0 -1
  253. package/assets/esri/core/workers/chunks/7a898d167029ee11a680.js +0 -1
  254. package/assets/esri/core/workers/chunks/7a973d70e6bc42d804ee.js +0 -1
  255. package/assets/esri/core/workers/chunks/7d9d2629af373c84624f.js +0 -1
  256. package/assets/esri/core/workers/chunks/885cb0da78e6853b23a4.js +0 -1
  257. package/assets/esri/core/workers/chunks/8e28862296972e9e6f82.js +0 -1
  258. package/assets/esri/core/workers/chunks/928431e1c449c6054547.js +0 -1
  259. package/assets/esri/core/workers/chunks/afdf30439d71a7cc19ae.js +0 -1
  260. package/assets/esri/core/workers/chunks/b1fa1571fd98d3b8dffe.js +0 -1
  261. package/assets/esri/core/workers/chunks/b20167d9163d0ee74b65.js +0 -1
  262. package/assets/esri/core/workers/chunks/b2a0e3e1dfccda7ed12e.js +0 -1
  263. package/assets/esri/core/workers/chunks/c09db831248054600e16.js +0 -1
  264. package/assets/esri/core/workers/chunks/dcccc9760998271254b5.js +0 -1
  265. package/assets/esri/core/workers/chunks/ddea45acae89759e57fa.js +0 -1
  266. package/assets/esri/core/workers/chunks/e039108eb3a592f6d8e3.js +0 -1
  267. package/assets/esri/core/workers/chunks/e70314ac10cc1f8f9f86.js +0 -1
  268. package/assets/esri/core/workers/chunks/f2d399b394a1a9156214.js +0 -1
  269. package/assets/esri/core/workers/chunks/f74d4e1eecec06f84ee2.js +0 -1
  270. package/assets/esri/core/workers/chunks/fb7eff7f76386f81d57b.js +0 -1
  271. package/assets/esri/core/workers/chunks/fe277d33b5b8a11c76df.js +0 -1
  272. package/core/analysisThemeUtils.js +0 -5
  273. package/views/support/createScreenshotPlan.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.28/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e,releaseMaybe as t}from"../../../core/maybe.js";import{s as r,j as s}from"../../../chunks/vec2.js";import{Z as o}from"../../../chunks/vec2f64.js";import{isBaseLayer as a,isGroupLayer as i}from"../../../layers/support/layerUtils.js";import{ImageWithType as n}from"../support/StreamDataLoader.js";import{BlendLayersPassParameters as u}from"./BlendLayersTechnique.js";import{TextureUpdate as c}from"./interfaces.js";import{NeighborIndex as l}from"./ITile.js";import{LayerClass as p}from"./LayerClass.js";import{isBlendableLayerView as h,isVectorTileLayerView as d,isVectorTileRenderInfo as m,isImageryTileRenderInfo as _,isRasterTileRenderInfo as f,isTextureTileRenderInfo as T,isVectorTilePerLayerInfo as y}from"./terrainUtils.js";import{ActivationTime as g}from"./TextureFader.js";import{TextureReference as b}from"./TextureReference.js";import{TileCompositor as x}from"./TileCompositor.js";import{TileRenderInfo as w}from"./TileRenderInfo.js";import I from"./TileTexture.js";import{TileUpdate as k}from"./TileUpdate.js";import{blendModeFromString as A}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{BaseOpacityMode as P,BlendLayersOutput as R}from"../webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js";import{createColorTexture as E,createEmptyTexture as M}from"../webgl-engine/lib/glUtil3D.js";import{TextureSamplingMode as D,TextureWrapMode as O,PixelFormat as j}from"../../webgl/enums.js";import{Texture as L}from"../../webgl/Texture.js";import{TextureDescriptor as N}from"../../webgl/TextureDescriptor.js";class C{constructor(e,t,r,s){this.start=e,this.end=t,this.blendMode=r,this.opacity=s}}class S{constructor(e,t,r){this._rctx=e,this.tileSize=t,this._techniqueRepository=r,this._passParameters=new u,this._backgroundTexture=null,this._backgroundColor=null,this._backgroundDirty=!1,this._maxAnisotropy=this._rctx.parameters.maxMaxAnisotropy,this._composition=new x(this._rctx,this._techniqueRepository),this._blackTex=new I(E(this._rctx,[0,0,0,1])),this._ensureBackgroundTexture(this.tileSize)}dispose(){this._composition=e(this._composition),this._backgroundTexture=t(this._backgroundTexture),this._blackTex=t(this._blackTex)}get backgroundIsGrid(){return null==this._backgroundColor}get backgroundColor(){return this._backgroundColor}updateTileTexture(e,t){if(!e.renderData)return;const r=e.surface,s=r.baseOpacity;let o=0,n=0,u=this.tileSize,c=!1;const l=r.view.state.contentPixelRatio;let m=!1;H.clear(),X.length=0;const _=e.layerInfo[p.MAP];let f=_.length,T=0,y=null;for(;T<_.length;T++){const t=r.layerViewByIndex(T,p.MAP),g=t.layer.opacity;q[T]=g;const b=t.fullOpacity;if(v[T]=b,a(t.layer)&&f>=_.length&&(f=T),h(t)){z[T]=t.layer.blendMode;let e="normal"!==t.layer.blendMode;if(i(t.layer.parent)){const r=B(t.layer.parent);null!=r&&""!==r&&(e=G(t.layer.parent)||e)}e&&(m=e,c=!1)}if(0===g&&!m){_[T].pendingUpdates&=~(k.TEXTURE_NOFADING&k.TEXTURE_FADING);continue}++n;const x=U(e,T);if(x){if(_[T].pendingUpdates&=~(k.TEXTURE_NOFADING&k.TEXTURE_FADING),i(t.layer.parent)){const e=B(t.layer.parent);null!=e&&""!==e&&F(t.layer.parent,T)}d(t)?u=Math.max(u,this.tileSize*l):1===s&&1===b&&(t.isOpaque||this._dataToTexture(x)&&x.sourceLayerInfo.data.descriptor.isOpaque)&&(c=!0),++o,null===y&&(y=T)}}const g=u/this.tileSize;0!==o&&null!==y?1===o&&!m&&this._useLayerTexture(e,y,f,v[y])||this._composeMapLayers(e,t,T-1,f,q,z,u,g,!c||m,H,m):this._useBackgroundTexture(e,n)}_ensureBackgroundTexture(e){return null==this._backgroundTexture&&(this._backgroundTexture=this._buildTexture(e,!1),this._backgroundDirty=!0),this._backgroundDirty&&(this._composition.bind(e),this._passParameters.offset=o,this._passParameters.scale=1,this._passParameters.opacity=1,null!=this.backgroundColor&&(this._passParameters.backgroundColor=this.backgroundColor),this._composition.drawBackground(this._passParameters,null!=this.backgroundColor),this._composition.copyFBOToTexture(this._backgroundTexture),this._composition.unbind(),this._backgroundDirty=!1),this._backgroundTexture}_useBackgroundTexture(e,t){const r=this._ensureBackgroundTexture(this.tileSize);let s=g.Immediate;(e.surface.view.layerViewManager.updating||t>0)&&(s=g.Delayed);const o=e.renderData;null==o.textureReference&&(s=g.Immediate),o.setTextureReference(new b(r,c.FADING,W,e.surface.baseOpacity,0,1),s)}_useLayerTexture(e,t,r,s){const o=t<r,a=o?1:e.surface.baseOpacity,i=o?e.surface.baseOpacity:1,n=U(e,t);return!!this._dataToTexture(n)&&(e.renderData.setTextureReference(new b(n.sourceLayerInfo.data,c.FADING,n,a,i,s)),!0)}_composeMapLayers(e,t,r,s,a,i,n,u,c,l,p){this._composition.ensureBuffer(n);const h=e.surface.baseOpacity;let d=!1,f=D.LINEAR_MIPMAP_LINEAR,T=!1,y=0;for(let b=r;b>=0;b--){const t=U(e,b);if(!t||0===a[b]&&!p)continue;const r=b<s&&h<1&&!d;r&&(d=!0),this._passParameters.baseOpacity=r?h:1;const g=this._passParameters.baseOpacity<1?P.Required:P.NotRequired;let x=!1;l.forEach((e=>{e.start===b&&(X.push(e),this._composition.openGroup(n),x=!0)}));const w=0===y,I=x?R.GroupBackgroundComposite:c&&w?this.backgroundIsGrid?R.GridComposite:R.ColorComposite:R.Composite,k=A[i[b]];for(m(t)?(this._passParameters.opacity=a[b],T=this._composition.drawVectorData(this._passParameters,I,n,k,g,t,u,this.tileSize,T)):_(t)?(this._passParameters.opacity=a[b],this._composition.drawImageryTileData(this._passParameters,I,n,k,g,t),this._hasNearestInterpolation(t)&&(f=D.NEAREST)):this._dataToTexture(t)&&(this._passParameters.texture=t.sourceLayerInfo.data.texture,this._passParameters.offset=t.offset,this._passParameters.scale=t.scale,this._passParameters.opacity=a[b],this._composition.drawRasterData(this._passParameters,I,n,k,g));X.length>0&&X[X.length-1].end===b;){const e=X.pop();this._passParameters.opacity=e.opacity,this._passParameters.offset=o,this._passParameters.scale=1;const t=c&&w?this.backgroundIsGrid?R.GridComposite:R.ColorComposite:R.Composite;this._composition.drawGroup(this._passParameters,t,n,A[e.blendMode],g)}y++}const g=e.renderData,x=p||d&&h<1,w=g.ensureTexture(n,x,(()=>this._buildTexture(n,x,f)));this._composition.copyFBOToTexture(w),this._composition.unbind(),g.setTextureReference(new b(w,t,W,d?1:h,0,1))}_hasNearestInterpolation(e){const t=e.sourceLayerInfo.data;return!!t.source&&"nearest"===t.interpolation}_dataToTexture(e){if(f(e)){const t=e.sourceLayerInfo;t.data=this._buildTexture(t.data,!0),e.tile.setMemoryDirty()}return T(e)}setBackground(e){this._backgroundColor!==e&&(this._backgroundColor=e,this._backgroundDirty=!0)}_buildTexture(e,t,r=D.LINEAR_MIPMAP_LINEAR){if(null==e)return null;const s=new N;s.wrapMode=O.CLAMP_TO_EDGE,s.samplingMode=r,s.maxAnisotropy=this._maxAnisotropy,s.preMultiplyAlpha=!0,s.flipped=!0,s.hasMipmap=!0,t||(s.pixelFormat=j.RGB);const o=this._rctx;let a;if("number"==typeof e)s.width=s.height=e,a=new I(new L(o,s));else if(e instanceof n)s.isOpaque=e.isOpaque,s.isOpaque&&(s.pixelFormat=j.RGB),a=new I(new L(o,s,e.image)),e.release();else try{s.width=e.width,s.height=e.height,a=new I(new L(o,s,e))}catch(u){a=new I(M(o)),console.warn("TileRenderer: failed to execute 'texImage2D', cross-origin image may not be loaded.")}const i=o.bindTexture(a.texture,L.TEXTURE_UNIT_FOR_UPDATES);return a.generateMipmap(),o.bindTexture(i,L.TEXTURE_UNIT_FOR_UPDATES),a}get test(){return{backgroundTexture:this._backgroundTexture}}}function U(e,t){V.layerIndex=t,V.vtlNeighborInfos.clear();const o=e.layerInfo[p.MAP][t];if(o.data)return r(V.offset,0,0),V.tile=e,V.scale=1,V.sourceLod=e.lij,V.sourceLayerInfo=o,m(V)&&e.forEachLoadedNeighbor(((r,s)=>{if(r.level!==e.level)return;const a=r.layerInfo[p.MAP][t];if(!y(a)||o.data===a.data)return;const i=V.vtlNeighborInfos.pushNew();i.offset=Z[s],i.sourceLod=r.lij,i.sourceLayerInfo=a})),V;const a=o.upsampleInfo;if(a){const e=a.tile.layerInfo[p.MAP][t];return V.tile=a.tile,s(V.offset,a.offset),V.scale=a.scale,V.sourceLod=a.tile.lij,V.sourceLayerInfo=e,V}return null}function B(e){return e.uid}function G(e){let t="normal"!==e.blendMode;return i(e.parent)&&(t=G(e.parent)||t),t}function F(e,t){i(e.parent)&&F(e.parent,t);const r=B(e);if(null!=r&&""!==r){const s=H.get(r);s?s.start=t:H.set(r,new C(t,t,e.blendMode,e.opacity))}}const q=new Array,v=new Array,z=new Array,H=new Map,X=new Array,V=new w,W={offset:[0,0],scale:1},Z=new Array;Z[l.NORTH]=[0,-1],Z[l.NORTH_EAST]=[-1,-1],Z[l.EAST]=[-1,0],Z[l.SOUTH_EAST]=[-1,1],Z[l.SOUTH]=[0,1],Z[l.SOUTH_WEST]=[1,1],Z[l.WEST]=[1,0],Z[l.NORTH_WEST]=[1,-1];export{C as GroupInfo,S as TileRenderer};
5
+ import{disposeMaybe as e,releaseMaybe as t}from"../../../core/maybe.js";import{s as r,j as s}from"../../../chunks/vec2.js";import{Z as o}from"../../../chunks/vec2f64.js";import{isBaseLayer as a,isGroupLayer as i}from"../../../layers/support/layerUtils.js";import{ImageWithType as n}from"../support/StreamDataLoader.js";import{BlendLayersPassParameters as c}from"./BlendLayersTechnique.js";import{TextureUpdate as u}from"./interfaces.js";import{NeighborIndex as l}from"./ITile.js";import{LayerClass as p}from"./LayerClass.js";import{isBlendableLayerView as h,isVectorTileLayerView as d,isVectorTileRenderInfo as m,isImageryTileRenderInfo as _,isRasterTileRenderInfo as f,isTextureTileRenderInfo as T,isVectorTilePerLayerInfo as y}from"./terrainUtils.js";import{ActivationTime as g}from"./TextureFader.js";import{TextureReference as b}from"./TextureReference.js";import{TileCompositor as x}from"./TileCompositor.js";import{TileRenderInfo as w}from"./TileRenderInfo.js";import I from"./TileTexture.js";import{TileUpdate as k}from"./TileUpdate.js";import{blendModeFromString as A}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{BaseOpacityMode as P,BlendLayersOutput as E}from"../webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js";import{createEmptyTexture as R}from"../webgl-engine/lib/glUtil3D.js";import{TextureSamplingMode as M,TextureWrapMode as D,PixelFormat as O}from"../../webgl/enums.js";import{Texture as j}from"../../webgl/Texture.js";import{TextureDescriptor as L}from"../../webgl/TextureDescriptor.js";class N{constructor(e,t,r,s){this.start=e,this.end=t,this.blendMode=r,this.opacity=s}}class C{constructor(e,t,r,s){this._rctx=e,this.tileSize=t,this._techniques=r,this._cache=s,this._passParameters=new c,this._backgroundTexture=null,this._backgroundColor=null,this._backgroundDirty=!1,this._maxAnisotropy=this._rctx.parameters.maxMaxAnisotropy,this._composition=new x(this._rctx,this._techniques),this._ensureBackgroundTexture(this.tileSize)}dispose(){this._composition=e(this._composition),this._backgroundTexture=t(this._backgroundTexture)}get backgroundIsGrid(){return null==this._backgroundColor}get backgroundColor(){return this._backgroundColor}updateTileTexture(e,t){if(!e.renderData)return;const r=e.surface,s=r.baseOpacity;let o=0,n=0,c=this.tileSize,u=!1;const l=r.view.state.contentPixelRatio;let m=!1;z.clear(),H.length=0;const _=e.layerInfo[p.MAP];let f=_.length,T=0,y=null;for(;T<_.length;T++){const t=r.layerViewByIndex(T,p.MAP),g=t.layer.opacity;F[T]=g;const b=t.fullOpacity;if(q[T]=b,a(t.layer)&&f>=_.length&&(f=T),h(t)){v[T]=t.layer.blendMode;let e="normal"!==t.layer.blendMode;if(i(t.layer.parent)){const r=U(t.layer.parent);null!=r&&""!==r&&(e=B(t.layer.parent)||e)}e&&(m=e,u=!1)}if(0===g&&!m){_[T].pendingUpdates&=~(k.TEXTURE_NOFADING&k.TEXTURE_FADING);continue}++n;const x=S(e,T);if(x){if(_[T].pendingUpdates&=~(k.TEXTURE_NOFADING&k.TEXTURE_FADING),i(t.layer.parent)){const e=U(t.layer.parent);null!=e&&""!==e&&G(t.layer.parent,T)}d(t)?c=Math.max(c,this.tileSize*l):1===s&&1===b&&(t.isOpaque||this._dataToTexture(x)&&x.sourceLayerInfo.data.descriptor.isOpaque)&&(u=!0),++o,null===y&&(y=T)}}const g=c/this.tileSize;0!==o&&null!==y?1===o&&!m&&this._useLayerTexture(e,y,f,q[y])||this._composeMapLayers(e,t,T-1,f,F,v,c,g,!u||m,z,m):this._useBackgroundTexture(e,n)}_ensureBackgroundTexture(e){return null==this._backgroundTexture&&(this._backgroundTexture=this._buildTexture(e,!1),this._backgroundDirty=!0),this._backgroundDirty&&(this._composition.bind(e),this._passParameters.offset=o,this._passParameters.scale=1,this._passParameters.opacity=1,null!=this.backgroundColor&&(this._passParameters.backgroundColor=this.backgroundColor),this._composition.drawBackground(this._passParameters,null!=this.backgroundColor),this._composition.copyFBOToTexture(this._backgroundTexture),this._composition.unbind(),this._backgroundDirty=!1),this._backgroundTexture}_useBackgroundTexture(e,t){const r=this._ensureBackgroundTexture(this.tileSize);let s=g.Immediate;(e.surface.view.layerViewManager.updating||t>0)&&(s=g.Delayed);const o=e.renderData;null==o.textureReference&&(s=g.Immediate),o.setTextureReference(new b(r,u.FADING,V,e.surface.baseOpacity,0,1),s)}_useLayerTexture(e,t,r,s){const o=t<r,a=o?1:e.surface.baseOpacity,i=o?e.surface.baseOpacity:1,n=S(e,t);return!!this._dataToTexture(n)&&(e.renderData.setTextureReference(new b(n.sourceLayerInfo.data,u.FADING,n,a,i,s)),!0)}_composeMapLayers(e,t,r,s,a,i,n,c,u,l,p){this._composition.ensureBuffer(n);const h=e.surface.baseOpacity;let d=!1,f=M.LINEAR_MIPMAP_LINEAR,T=!1,y=0;for(let b=r;b>=0;b--){const t=S(e,b);if(!t||0===a[b]&&!p)continue;const r=b<s&&h<1&&!d;r&&(d=!0),this._passParameters.baseOpacity=r?h:1;const g=this._passParameters.baseOpacity<1?P.Required:P.NotRequired;let x=!1;l.forEach((e=>{e.start===b&&(H.push(e),this._composition.openGroup(n),x=!0)}));const w=0===y,I=x?E.GroupBackgroundComposite:u&&w?this.backgroundIsGrid?E.GridComposite:E.ColorComposite:E.Composite,k=A[i[b]];for(m(t)?(this._passParameters.opacity=a[b],T=this._composition.drawVectorData(this._passParameters,I,n,k,g,t,c,this.tileSize,T)):_(t)?(this._passParameters.opacity=a[b],this._composition.drawImageryTileData(this._passParameters,I,n,k,g,t),this._hasNearestInterpolation(t)&&(f=M.NEAREST)):this._dataToTexture(t)&&(this._passParameters.texture=t.sourceLayerInfo.data.texture,this._passParameters.offset=t.offset,this._passParameters.scale=t.scale,this._passParameters.opacity=a[b],this._composition.drawRasterData(this._passParameters,I,n,k,g));H.length>0&&H[H.length-1].end===b;){const e=H.pop();this._passParameters.opacity=e.opacity,this._passParameters.offset=o,this._passParameters.scale=1;const t=u&&w?this.backgroundIsGrid?E.GridComposite:E.ColorComposite:E.Composite;this._composition.drawGroup(this._passParameters,t,n,A[e.blendMode],g)}y++}const g=e.renderData,x=p||d&&h<1,w=g.ensureTexture(n,x,(()=>this._buildTexture(n,x,f)));this._composition.copyFBOToTexture(w),this._composition.unbind(),g.setTextureReference(new b(w,t,V,d?1:h,0,1))}_hasNearestInterpolation(e){const t=e.sourceLayerInfo.data;return!!t.source&&"nearest"===t.interpolation}_dataToTexture(e){if(f(e)){const t=e.sourceLayerInfo;t.data=this._buildTexture(t.data,!0),e.tile.setMemoryDirty()}return T(e)}setBackground(e){this._backgroundColor!==e&&(this._backgroundColor=e,this._backgroundDirty=!0)}_buildTexture(e,t,r=M.LINEAR_MIPMAP_LINEAR){if(null==e)return null;const s=new L;s.wrapMode=D.CLAMP_TO_EDGE,s.samplingMode=r,s.maxAnisotropy=this._maxAnisotropy,s.preMultiplyAlpha=!0,s.flipped=!0,s.hasMipmap=!0,t||(s.pixelFormat=O.RGB);const o=this._rctx;let a;if("number"==typeof e){s.width=s.height=e;const t=`${e} ${s.pixelFormat}`,r=this._cache.pop(t);r?(r.retain(),a=r):a=new I(new j(o,s),this._cache)}else if(e instanceof n)s.isOpaque=e.isOpaque,s.isOpaque&&(s.pixelFormat=O.RGB),a=new I(new j(o,s,e.image)),e.release();else try{s.width=e.width,s.height=e.height,a=new I(new j(o,s,e))}catch(c){a=new I(R(o)),console.warn("TileRenderer: failed to execute 'texImage2D', cross-origin image may not be loaded.")}const i=o.bindTexture(a.texture,j.TEXTURE_UNIT_FOR_UPDATES);return a.generateMipmap(),o.bindTexture(i,j.TEXTURE_UNIT_FOR_UPDATES),a}get test(){return{backgroundTexture:this._backgroundTexture}}}function S(e,t){X.layerIndex=t,X.vtlNeighborInfos.clear();const o=e.layerInfo[p.MAP][t];if(o.data)return r(X.offset,0,0),X.tile=e,X.scale=1,X.sourceLod=e.lij,X.sourceLayerInfo=o,m(X)&&e.forEachLoadedNeighbor(((r,s)=>{if(r.level!==e.level)return;const a=r.layerInfo[p.MAP][t];if(!y(a)||o.data===a.data)return;const i=X.vtlNeighborInfos.pushNew();i.offset=W[s],i.sourceLod=r.lij,i.sourceLayerInfo=a})),X;const a=o.upsampleInfo;if(a){const e=a.tile.layerInfo[p.MAP][t];return X.tile=a.tile,s(X.offset,a.offset),X.scale=a.scale,X.sourceLod=a.tile.lij,X.sourceLayerInfo=e,X}return null}function U(e){return e.uid}function B(e){let t="normal"!==e.blendMode;return i(e.parent)&&(t=B(e.parent)||t),t}function G(e,t){i(e.parent)&&G(e.parent,t);const r=U(e);if(null!=r&&""!==r){const s=z.get(r);s?s.start=t:z.set(r,new N(t,t,e.blendMode,e.opacity))}}const F=new Array,q=new Array,v=new Array,z=new Map,H=new Array,X=new w,V={offset:[0,0],scale:1},W=new Array;W[l.NORTH]=[0,-1],W[l.NORTH_EAST]=[-1,-1],W[l.EAST]=[-1,0],W[l.SOUTH_EAST]=[-1,1],W[l.SOUTH]=[0,1],W[l.SOUTH_WEST]=[1,1],W[l.WEST]=[1,0],W[l.NORTH_WEST]=[1,-1];export{N as GroupInfo,C as TileRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- class t{constructor(t){this._texture=t,this.type="tile-texture",this._refCount=1}retain(){++this._refCount}release(){--this._refCount,0===this._refCount&&this._texture.dispose()}get texture(){return this._texture}generateMipmap(){this._texture.generateMipmap()}get descriptor(){return this._texture.descriptor}get gpuMemoryUsage(){return this._texture.gpuMemoryUsage}}export{t as default};
5
+ class t{constructor(t,e){this._texture=t,this._cache=e,this.type="tile-texture",this._refCount=1}retain(){++this._refCount}release(){if(--this._refCount,0===this._refCount)if(this._cache){const t=`${this._texture.descriptor.width} ${this._texture.descriptor.pixelFormat}`;this._cache.put(t,this)}else this.dispose()}dispose(){this._texture.dispose()}get texture(){return this._texture}generateMipmap(){this._texture.generateMipmap()}get descriptor(){return this._texture.descriptor}get memoryUsage(){return this._texture.gpuMemoryUsage}}export{t as default};
@@ -2,12 +2,12 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{RgbaFloatEncoding as e}from"../util/RgbaFloatEncoding.glsl.js";import{addCameraPosition as t,addPixelRatio as i}from"../util/View.glsl.js";import{Float4PassUniform as o}from"../../shaderModules/Float4PassUniform.js";import{FloatPassUniform as r}from"../../shaderModules/FloatPassUniform.js";import{glsl as l}from"../../shaderModules/interfaces.js";import{Texture2DPassUniform as a}from"../../shaderModules/Texture2DPassUniform.js";import{computeLongestPattern as p,computeTextureSize as s}from"../../../materials/stippleTextureRepository.js";import{ensureColor4 as n}from"../../../shaders/ensureColor4.js";function d(e,t){e.constants.add("stippleAlphaColorDiscard","float",.001),e.constants.add("stippleAlphaHighlightDiscard","float",.5),t.stippleEnabled?c(e,t):f(e)}function c(p,s){const d=!(s.draped&&s.stipplePreferContinuous),{vertex:c,fragment:f}=p;f.include(e),s.draped||(t(c,s),c.uniforms.add(new r("worldToScreenPerDistanceRatio",((e,t)=>1/t.camera.perScreenPixelRatio))),c.code.add(l`float computeWorldToScreenRatio(vec3 segmentCenter) {
5
+ import{RgbaFloatEncoding as e}from"../util/RgbaFloatEncoding.glsl.js";import{addCameraPosition as t,addPixelRatio as o}from"../util/View.glsl.js";import{Float4PassUniform as i}from"../../shaderModules/Float4PassUniform.js";import{FloatPassUniform as r}from"../../shaderModules/FloatPassUniform.js";import{glsl as l}from"../../shaderModules/interfaces.js";import{Texture2DPassUniform as a}from"../../shaderModules/Texture2DPassUniform.js";import{computeLongestPattern as s,computeTextureSize as p}from"../../../materials/stippleTextureRepository.js";import{ensureColor4 as n}from"../../../shaders/ensureColor4.js";function d(e,t){e.constants.add("stippleAlphaColorDiscard","float",.001),e.constants.add("stippleAlphaHighlightDiscard","float",.5),t.stippleEnabled?c(e,t):f(e)}function c(s,p){const d=!(p.draped&&p.stipplePreferContinuous),{vertex:c,fragment:f}=s;f.include(e),p.draped||(t(c,p),c.uniforms.add(new r("worldToScreenPerDistanceRatio",((e,t)=>1/t.camera.perScreenPixelRatio))),c.code.add(l`float computeWorldToScreenRatio(vec3 segmentCenter) {
6
6
  float segmentDistanceToCamera = length(segmentCenter - cameraPosition);
7
7
  return worldToScreenPerDistanceRatio / segmentDistanceToCamera;
8
- }`)),p.varyings.add("vStippleDistance","float"),s.stippleRequiresClamp&&p.varyings.add("vStippleDistanceLimits","vec2"),s.stippleRequiresStretchMeasure&&p.varyings.add("vStipplePatternStretch","float"),c.code.add(l`
8
+ }`)),s.varyings.add("vStippleDistance","float"),p.stippleRequiresClamp&&s.varyings.add("vStippleDistanceLimits","vec2"),p.stippleRequiresStretchMeasure&&s.varyings.add("vStipplePatternStretch","float"),c.code.add(l`
9
9
  float discretizeWorldToScreenRatio(float worldToScreenRatio) {
10
- float step = ${u};
10
+ float step = ${S};
11
11
 
12
12
  float discreteWorldToScreenRatio = log(worldToScreenRatio);
13
13
  discreteWorldToScreenRatio = ceil(discreteWorldToScreenRatio / step) * step;
@@ -16,13 +16,13 @@ return worldToScreenPerDistanceRatio / segmentDistanceToCamera;
16
16
  }
17
17
  `),c.code.add(l`vec2 computeStippleDistanceLimits(float startPseudoScreen, float segmentLengthPseudoScreen, float segmentLengthScreen, float patternLength) {`),c.code.add(l`
18
18
  if (segmentLengthPseudoScreen >= ${d?"patternLength":"1e4"}) {
19
- `),i(c),c.code.add(l`
19
+ `),o(c),c.code.add(l`
20
20
  // Round the screen length to get an integer number of pattern repetitions (minimum 1).
21
21
  float repetitions = segmentLengthScreen / (patternLength * pixelRatio);
22
22
  float flooredRepetitions = max(1.0, floor(repetitions + 0.5));
23
23
  float segmentLengthScreenRounded = flooredRepetitions * patternLength;
24
24
 
25
- ${s.stippleRequiresStretchMeasure?l`
25
+ ${p.stippleRequiresStretchMeasure?l`
26
26
  float stretch = repetitions / flooredRepetitions;
27
27
 
28
28
  // We need to impose a lower bound on the stretch factor to prevent the dots from merging together when there is only 1 repetition.
@@ -33,23 +33,22 @@ return worldToScreenPerDistanceRatio / segmentDistanceToCamera;
33
33
  }
34
34
  return vec2(startPseudoScreen, startPseudoScreen + segmentLengthPseudoScreen);
35
35
  }
36
- `),f.uniforms.add(new a("stipplePatternTexture",(e=>e.stippleTexture)),new r("stipplePatternSDFNormalizer",(e=>m(e.stipplePattern))),new r("stipplePatternPixelSizeInv",(e=>1/S(e)))),f.code.add(l`
36
+ `),f.uniforms.add(new a("stipplePatternTexture",(e=>e.stippleTexture)),new r("stipplePatternSDFNormalizer",(e=>m(e.stipplePattern))),new r("stipplePatternPixelSizeInv",(e=>1/u(e)))),f.code.add(l`
37
37
  float getStippleSDF(out bool isClamped) {
38
- ${s.stippleRequiresClamp?l`
38
+ ${p.stippleRequiresClamp?l`
39
39
  float stippleDistanceClamped = clamp(vStippleDistance, vStippleDistanceLimits.x, vStippleDistanceLimits.y);
40
40
  vec2 aaCorrectedLimits = vStippleDistanceLimits + vec2(1.0, -1.0) / gl_FragCoord.w;
41
41
  isClamped = vStippleDistance < aaCorrectedLimits.x || vStippleDistance > aaCorrectedLimits.y;`:l`
42
42
  float stippleDistanceClamped = vStippleDistance;
43
43
  isClamped = false;`}
44
44
 
45
- float u = stippleDistanceClamped * gl_FragCoord.w * stipplePatternPixelSizeInv;
46
- ${s.stippleScaleWithLineWidth?l`u *= vLineSizeInv;`:""}
45
+ float u = stippleDistanceClamped * gl_FragCoord.w * stipplePatternPixelSizeInv * vLineSizeInv;
47
46
  u = fract(u);
48
47
 
49
48
  float encodedSDF = rgba2float(texture(stipplePatternTexture, vec2(u, 0.5)));
50
49
  float sdf = (encodedSDF * 2.0 - 1.0) * stipplePatternSDFNormalizer;
51
50
 
52
- ${s.stippleRequiresStretchMeasure?l`return (sdf - 0.5) * vStipplePatternStretch + 0.5;`:l`return sdf;`}
51
+ ${p.stippleRequiresStretchMeasure?l`return (sdf - 0.5) * vStipplePatternStretch + 0.5;`:l`return sdf;`}
53
52
  }
54
53
 
55
54
  float getStippleSDF() {
@@ -61,12 +60,12 @@ return worldToScreenPerDistanceRatio / segmentDistanceToCamera;
61
60
  bool isClamped;
62
61
  float stippleSDF = getStippleSDF(isClamped);
63
62
 
64
- float antiAliasedResult = ${s.stippleScaleWithLineWidth?l`clamp(stippleSDF * vLineWidth + 0.5, 0.0, 1.0);`:l`clamp(stippleSDF + 0.5, 0.0, 1.0);`}
63
+ float antiAliasedResult = clamp(stippleSDF * vLineWidth + 0.5, 0.0, 1.0);
65
64
 
66
65
  return isClamped ? floor(antiAliasedResult + 0.5) : antiAliasedResult;
67
66
  }
68
- `),s.stippleOffColorEnabled?(f.uniforms.add(new o("stippleOffColor",(e=>n(e.stippleOffColor)))),f.code.add(l`#define discardByStippleAlpha(stippleAlpha, threshold) {}
67
+ `),p.stippleOffColorEnabled?(f.uniforms.add(new i("stippleOffColor",(e=>n(e.stippleOffColor)))),f.code.add(l`#define discardByStippleAlpha(stippleAlpha, threshold) {}
69
68
  #define blendStipple(color, stippleAlpha) mix(color, stippleOffColor, stippleAlpha)`)):f.code.add(l`#define discardByStippleAlpha(stippleAlpha, threshold) if (stippleAlpha < threshold) { discard; }
70
69
  #define blendStipple(color, stippleAlpha) vec4(color.rgb, color.a * stippleAlpha)`)}function f(e){e.fragment.code.add(l`float getStippleAlpha() { return 1.0; }
71
70
  #define discardByStippleAlpha(_stippleAlpha_, _threshold_) {}
72
- #define blendStipple(color, _stippleAlpha_) color`)}function m(e){return e?(Math.floor(.5*(p(e)-1))+.5)/e.pixelRatio:1}function S(e){const t=e.stipplePattern;return t?s(e.stipplePattern)/t.pixelRatio:1}const u=l.float(.4);export{d as LineStipple,S as computePixelSize};
71
+ #define blendStipple(color, _stippleAlpha_) color`)}function m(e){return e?(Math.floor(.5*(s(e)-1))+.5)/e.pixelRatio:1}function u(e){const t=e.stipplePattern;return t?p(e.stipplePattern)/t.pixelRatio:1}const S=l.float(.4);export{d as LineStipple,u as computePixelSize};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{update as t}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{removeMaybe as s,disposeMaybe as i,destroyMaybe as a,releaseMaybe as n}from"../../../../core/maybe.js";import h from"../../../../core/PooledArray.js";import{watch as o,syncAndInitial as d,initial as l,sync as _}from"../../../../core/reactiveUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{j as c,a as u,m as f}from"../../../../chunks/mat4.js";import{I as g,c as T}from"../../../../chunks/mat4f64.js";import{h as R}from"../../../../chunks/vec4.js";import{a as A}from"../../../../chunks/boundedPlane.js";import P from"../../support/debugFlags.js";import{TransparencyMode as b}from"../../terrain/TerrainRenderer.js";import{FBOCache as E,ColorFormat as S,DepthFormat as y}from"../core/FBOCache.js";import{RenderPassManager as C}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as I}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as O}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{AnimationTimeStep as w}from"./AnimationTimeStep.js";import{Decorations as D,RenderRequestType as N,StencilBits as M}from"./basicInterfaces.js";import{BoundingInfo as H}from"./BoundingInfo.js";import{ZERO as L,union as x}from"./depthRange.js";import{depthRangeFromScene as F}from"./depthRangeUtils.js";import{Highlight as v}from"./Highlight.js";import{RenderOccludedFlag as U}from"./Material.js";import{OffscreenRendering as G}from"./OffscreenRendering.js";import{RenderContext as q}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as B}from"./rendererUtils.js";import{setupFeatureDefaults as j,RenderFeature as V}from"./RenderFeature.js";import{RenderPluginManager as Q}from"./RenderPluginManager.js";import{RenderSlot as k}from"./RenderSlot.js";import{ShadowAccumulator as W}from"./ShadowAccumulator.js";import{ShadowHighlight as Y}from"./ShadowHighlight.js";import{ShadowMap as X,SnapshotSlot as z}from"./ShadowMap.js";import J from"./SliceHelper.js";import{SmaaRenderPass as K}from"./SmaaRenderPass.js";import{SSAOHelper as Z}from"./SSAOHelper.js";import{TransparencyPassType as $}from"./TransparencyPassType.js";import{EdgeView as ee}from"./edgeRendering/EdgeView.js";import{Transparency as re}from"./edgeRendering/interfaces.js";import{MergedRenderer as te}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as se}from"../shaders/CompositingTechniqueConfiguration.js";import{RendererPerformanceInfo as ie,PerformanceCategory as ae}from"../statistics/RendererPerformanceInfo.js";import{RenderState as ne}from"../../../support/RenderState.js";import{PixelFormat as he,PixelType as oe,ClearBufferBit as de}from"../../../webgl/enums.js";let le=class extends r{get _bindParameters(){return this._renderContext.bindParameters}updateRenderFeatures(e=null,r=!has("disable-feature:high-quality-idle")){this._renderStateFeatures=j(r,e),this.notifyChange("_renderStateFeatures"),this.renderPlugins.renderFeatureChanged(),this._requestRender()}isFeatureEnabled(e,r=this._state){return this._renderStateFeatures.get(r,e)??!1}setFeatureEnabled(e,r,t){this._renderStateFeatures.set(r,e,t),this.notifyChange("_renderStateFeatures"),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(V.HighQualityTransparency)}get hasReflections(){return this.hasWater&&(this._ssrEnabled||this.isFeatureEnabled(V.WaterReflection))}get hasDecorations(){return this._materialRenderersHas.decorations||this._renderPlugins.hasDecorations}get hasHighlights(){return this._materialRenderersHas.highlights||this._renderPlugins.requiresOutput(I.Highlight)}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(V.HighResolutionAtmosphere)}get hasWater(){return this._materialRenderersHas.water||this._hasOverlayWater}constructor(e,r,t,s,i,a,n,_){super({}),this._stage=e,this._materialRepository=r,this._techniqueRepository=s,this._rctx=i,this._compositingHelper=a,this._magnifierHelper=n,this._requestRender=_,this._materialRenderers=new h,this._needsTransparentPass=!1,this._materialRenderersHas={hudElements:!1,highlights:!1,water:!1,decorations:!1,occludees:!1},this._hasOverlayWater=!1,this._renderOverlay=e=>{},this._isRendering=!1,this._fallbackDepthStencilTexture=null,this._sliceHelper=new J,this._state=ne.IDLE,this._highQualityTransparencyEnabled=!0,this._terrainRenderingEnabled=!0,this._terrainTransparency=b.Opaque,this._ssrEnabled=!1,this._ssaoEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new w,this._renderHiddenTransparentEdges=()=>{},this.fboCache=new E(i),this._renderStateFeatures=j(!has("disable-feature:high-quality-idle"),e.view.qualityProfile),this._offscreen=new G(this.fboCache,this._compositingHelper),this.performanceInfo=new ie(this._rctx),this._shadowMap=new X(this.fboCache,e.viewingMode),this._ssaoHelper=new Z(e.view,this.fboCache,s,_),this._highlight=new v(s,this.fboCache),this._shadowHighlight=new Y(this._rctx,e.viewingMode),this._shadowAccumulator=new W(this.fboCache,s,e,(e=>{const r=this.shadowsEnabled;this._shadowMap.enabled=!0,this._prepare(e.camera,e.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=r}),((e,r,t)=>{e.shadowMap.start(e.camera,r,t,!0,this._stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(I.Shadow,e.shadowMap),e.shadowMap.finish(),e.camera.setGLViewport(this._rctx),this._prepare(e.camera,e.contentCamera)}),_),this._renderContext=new q(this._rctx,this._offscreen,this._shadowMap,this._ssaoHelper,this._sliceHelper),this._renderPlugins=new Q({renderContext:this._renderContext,techniqueRepository:s,textureRepository:t,materialRepository:this._materialRepository,requestRender:_,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this.renderPassManager=new C(this._rctx,this._techniqueRepository),this._renderPlugins.add(this.renderPassManager),this._smaaPass=new K({view:this._stage.view}),this._renderPlugins.add(this._smaaPass),this.addHandles([o((()=>this._stage.view.state.camera),(()=>_()),d),o((()=>P.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(re.TRANSPARENT):()=>{},_()}),l),o((()=>this._ssaoEnabled||this.isFeatureEnabled(V.SSAO)),(e=>this._ssaoHelper.enabled=e),d)])}normalizeCtorArgs(){return{}}destroy(){this._smaaPass.disable(),this._smaaPass.destroy(),this._gpuTimerHandle=s(this._gpuTimerHandle),this._materialRenderers.forAll((e=>e.dispose())),this._materialRenderers.clear(),this._offscreen.dispose(),this._fallbackDepthStencilTexture=i(this._fallbackDepthStencilTexture),this._shadowMap.dispose(),this._ssaoHelper.destroy(),this._highlight.dispose(),this._shadowHighlight.dispose(),this._shadowAccumulator.dispose(),this._edgeView=a(this._edgeView),this.renderPassManager.destroy(),this._releaseFBOs(),this._bindParameters.linearDepth=n(this._bindParameters.linearDepth),this._bindParameters.hudVisibility=n(this._bindParameters.hudVisibility),this.fboCache.destroy(),H.prune()}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=n(this._bindParameters.ssr.lastFrameColor),this._bindParameters.multipassTerrain.linearDepth=n(this._bindParameters.multipassTerrain.linearDepth),this._bindParameters.multipassGeometry.linearDepth=n(this._bindParameters.multipassGeometry.linearDepth)}disposeOffscreenBuffers(){this._releaseFBOs(),this._offscreen.dispose(),this._shadowMap.disposeOffscreenBuffers(),this._ssaoHelper.disposeOffscreenBuffers()}get updating(){return this._smaaPass.updating||null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._renderPlugins.updating||!this.isCameraFinal}ensureEdgeView(){if(null==this._edgeView){const e=this._stage.view.resourceController;this._edgeView=new ee({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniqueRepository:this._techniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:Te(e)}),this.addHandles(o((()=>this._edgeView?.updating),(()=>this._requestRender()),_)),this._requestRender()}return this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return c(this._bindParameters.ssr.reprojectionMatrix,g)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:r,_bindParameters:t}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.qualitySettings?.ambientOcclusion&&this._ssaoEnabled!==e.qualitySettings.ambientOcclusion&&(this._ssaoEnabled=e.qualitySettings.ambientOcclusion,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&r.maxCascades!==e.shadowMapMaxCascades&&(r.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);const r="virtual"!==e.environment.lighting.type;t.enableFillLights!==r&&(t.enableFillLights=r,this._requestRender())}e.backgroundColor&&!R(this._offscreen.backgroundColor,e.backgroundColor)&&(this._offscreen.backgroundColor=e.backgroundColor,this._requestRender()),void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.defaultHighlightOptions&&(this._highlight.setDefaultOptions(e.defaultHighlightOptions),this._shadowHighlight.setDefaultOptions(e.defaultHighlightOptions),this._requestRender()),void 0!==e.overlays&&this._bindParameters.overlays!==e.overlays&&(this._bindParameters.overlays=e.overlays,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.renderOverlay&&this._renderOverlay!==e.renderOverlay&&(this._renderOverlay=e.renderOverlay,this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=e.slicePlane,this._requestRender()),void 0!==e.terrainRenderingEnabled&&this._terrainRenderingEnabled!==e.terrainRenderingEnabled&&(this._terrainRenderingEnabled=e.terrainRenderingEnabled,this._requestRender()),void 0!==e.terrainTransparency&&this._terrainTransparency!==e.terrainTransparency&&(this._terrainTransparency=e.terrainTransparency,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,r){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:t,removes:s,updates:i}=e;if(0===t.length&&0===s.length&&0===i.length)return;const a=B(e);let n=!1;a.forEach(((t,s)=>{if(r.done)return;let i=this._materialRenderers.find((e=>e.material===s));null==i&&t.adds.length>0&&(i=new te(this._rctx,this._materialRepository,s),this._materialRenderers.push(i)),i&&(i.modify(t),i.isEmpty&&(n=!0)),t.removes.forEach((r=>e.removes.removeUnordered(r))),t.adds.forEach((r=>e.adds.removeUnordered(r))),t.updates.forEach((r=>e.updates.removeUnordered(r))),r.madeProgress()})),n&&this._materialRenderers.filterInPlace((e=>!e.isEmpty||(e.dispose(),!1))),this._updateHasFlags(),this._requestRender()}_updateHasFlags(){const has=this._materialRenderersHas;has.decorations=!1,has.highlights=!1,has.hudElements=!1,has.water=!1,has.occludees=!1,this._materialRenderers.forAll((e=>{has.highlights||=e.hasHighlights,has.occludees||=e.hasOccludees,has.water||=e.hasWater,has.decorations||=e.isDecoration,has.hudElements||=e.canRender(k.LINE_CALLOUTS_HUD_DEPTH,I.Color)||e.canRender(k.HUD_MATERIAL,I.Color)||e.canRender(k.LABEL_MATERIAL,I.Color)})),this._bindParameters.hasOccludees=has.occludees}updateAnimation(e){const r=this._hasAnimations;return this._hasAnimations=!1,this._materialRenderers.forAll((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations=this._renderPlugins.updateAnimation(e)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?s(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}render(e,r,t,s,i){this._isRendering=!0,this.performanceInfo.startFrame(),this.fboCache.resetPeakMemoryUsage();const a=this._offscreen,{camera:h,contentCamera:o,mode:d,alignPixelEnabled:l}=t;this._state=d,this._renderOverlay(i),this.performanceInfo.advance(ae.OVERLAY),this._renderContext.time=i,this._bindParameters.transparencyPassType=$.NONE,this._bindParameters.alignPixelEnabled=l,this._bindParameters.decorations=s,this._bindParameters.ssr.lastFrameColor=n(this._bindParameters.ssr.lastFrameColor),this.hasReflections?this._bindParameters.ssr.lastFrameColor=a.swapColorBuffer():a.swapColorBuffer().release();const _=A(this._sliceHelper.plane);s===D.OFF&&(this._sliceHelper.plane=null),this._rctx.bindFramebuffer(e),h.setGLViewport(this._rctx),this._prepare(h,o),this._renderPlugins.prepareRender(),this.performanceInfo.advance(ae.PREPARE);const p=this._computeDepthRange(h);this._renderShadowMap(e,h,this._bindParameters.lighting.mainLight.direction,p),this.performanceInfo.advance(ae.SHADOW_MAP),a.initializeFrame(h),this._ensureBindParameters(h,o);const m=this._terrainRenderingEnabled&&(this._terrainTransparency===b.Semitransparent||this._terrainTransparency===b.TransparentWithDraped),c=this._highQualityTransparency&&m,u=this._needsTransparentPass||this._renderPlugins.canRender(k.TRANSPARENT_MATERIAL);this._prepareShaders(c,u),this._renderLinearDepth(),this.performanceInfo.advance(ae.LINEAR_DEPTH),this._accumulateShadows(p,h,o),this.performanceInfo.advance(ae.ACCUMULATED_SHADOWS),this._ensureBindParametersSSR(i),this._renderSSAO(i),this.performanceInfo.advance(ae.SSAO),this._renderContext.output=I.Color,a.bindFbo(),this._renderOpaqueGeometry(),this.performanceInfo.advance(ae.OPAQUE),this._renderTerrainLinearDepth(c),this._setMultipassTerrain(c),this._renderEdges(re.OPAQUE),this.performanceInfo.advance(ae.OPAQUE_EDGES),a.bindFbo(),this._renderSlot(k.VOXEL),this.performanceInfo.advance(ae.VOXEL),this._renderHiddenTransparentEdges(),u&&(this._oitEnabled?this._renderOITPass(_e.Geometry):this._renderTransparentGeometry()),this.performanceInfo.advance(ae.TRANSPARENT);const f=this._renderGeometryLinearDepth(c);this._renderHUDVisibility(f),c||this._renderInternalSlot(k.LINE_CALLOUTS),this.performanceInfo.advance(ae.HUD_VISIBILITY),this._renderObjectAndLayerIdColor(r),this.performanceInfo.advance(ae.OBJECT_AND_LAYER_ID_COLOR),this._renderEdges(re.TRANSPARENT,f),f?.release(),this.performanceInfo.advance(ae.TRANSPARENT_EDGES);const g=m?this._renderTransparentTerrain():null;if(g&&this._bindParameters.hudVisibility&&(c?this._renderLineCallouts(O.Occluded):a.compositeToHUDVisibility(this._bindParameters,g.colorTexture),this._renderHUD(O.Occluded,a.framebuffer),this.performanceInfo.advance(ae.HUD_OCCLUDED)),this.performanceInfo.advance(ae.TRANSPARENT_TERRAIN),this._setTerrainCulling(!1),g&&(a.compositeToFramebuffer(this._bindParameters,g.colorTexture,se.PremultipliedAlpha,1),g.release(),c&&(this._renderEdges(re.OPAQUE),this.performanceInfo.advance(ae.OPAQUE_EDGES),u&&(this._oitEnabled?this._renderOITPass(_e.Geometry):this._renderTransparentGeometry()),this.performanceInfo.advance(ae.TRANSPARENT),this._renderEdges(re.TRANSPARENT),this.performanceInfo.advance(ae.TRANSPARENT_EDGES))),c&&this._renderLineCallouts(O.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),a.bindFbo(),this._renderInternalSlot(k.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderSlot(k.POSTPROCESSING_ENVIRONMENT_TRANSPARENT),this._renderSlot(k.LASERLINES),this.performanceInfo.advance(ae.ENVIRONMENT),this._renderPlugins.needsLaserlineWithContrastControl){const e=()=>this._renderSlot(k.LASERLINES_CONTRAST_CONTROL),{width:r,height:t,depth:s}=a,i=this.fboCache.acquire(S.RGBA,r,t);a.renderToTargets(e,i,s,me),a.compositeToFramebuffer(this._bindParameters,i.colorTexture,se.PremultipliedAlpha,1),i.release()}this.performanceInfo.advance(ae.LASER_LINE),this._renderOccluded(),this.performanceInfo.advance(ae.OCCLUDED);const T=s===D.ON&&this._magnifierHelper.enabled,R=T&&null==e?this.fboCache.acquire(S.RGBA,a.width,a.height).acquireDepth(y.DEPTH16_BUFFER):null,P=R?.fbo??e;this._bindParameters.output=P,this._rctx.bindFramebuffer(P);const E=this._offscreen.colorTexture;this.renderPlugins.canRender(k.ANTIALIASING)?this._renderSlot(k.ANTIALIASING):null!=E&&this._compositingHelper.composite(this._bindParameters,E,se.None),this.performanceInfo.advance(ae.ANTIALIASING),this._renderHUD(O.NotOccluded,P),this.performanceInfo.advance(ae.HUD),this._renderHighlights(P,this._bindParameters),this.performanceInfo.advance(ae.HIGHLIGHTS),T&&this._magnifierHelper.render(this._rctx,this._bindParameters),P!==e&&(this._rctx.bindFramebuffer(e),this._compositingHelper.composite(this._bindParameters,R?.colorTexture,se.None)),R?.release(),this._releaseFBOs(),this._offscreen.releaseBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=_,this._isRendering=!1,this.onPostRender&&this.onPostRender(),this.performanceInfo.finishFrame()}_prepareShaders(e,r){this._renderContext.output=I.Color,this._prepareOpaqueGeometrySlots(),this._setMultipassTerrain(e),this._prepareSlots(k.TRANSPARENT_TERRAIN),this._setMultipassTerrain(!1),e||this._prepareInternalSlots(this._materialRenderers,k.LINE_CALLOUTS),r&&this._prepareTransparencySlots(),this._prepareInternalSlots(this._materialRenderers,k.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._prepareSlots(k.POSTPROCESSING_ENVIRONMENT_TRANSPARENT,k.LASERLINES),this._rctx.gl.flush()}_renderObjectAndLayerIdColor(e){if(null==e||!has("enable-feature:objectAndLayerId-rendering"))return;const r=this._renderContext.output;this._rctx.bindFramebuffer(e),this._offscreen.renderToFBO((()=>this._renderGeometryAndTransparentTerrainPass(I.ObjectAndLayerIdColor)),[0,0,0,0],!0,!0),this._rctx.bindFramebuffer(e),this._offscreen.renderToFBO((()=>{this._bindParameters.hudRenderStyle=O.NotOccluded,this._renderInternalSlot(k.HUD_MATERIAL)}),void 0,!0,!0),this._renderContext.output=r}finish(e){this._hasAnimations||this._animationTimestep.clear();const r=this.performanceInfo.gpuSamplingEnabled,t=e===N.BACKGROUND;if(t||r){const e=t?this.performanceInfo.elapsedTime:0,s=r?this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.getError(),i=Math.max(e,s);this._animationTimestep.frame(i,t)}}readDepthPixels(e,r,t){const s=this._bindParameters.linearDepth?.fbo;if(s?.colorTexture)return void s.readPixels(r[0],r[1],r[2],r[3],he.RGBA,oe.UNSIGNED_BYTE,t);const i=this.fboCache.acquire(S.RGBA,this._offscreen.width,this._offscreen.height).acquireDepth(y.DEPTH16_BUFFER);this._rctx.bindFramebuffer(i.fbo),this._ensureBindParameters(e,e),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const a=de.COLOR_BUFFER_BIT|de.DEPTH_BUFFER_BIT|de.STENCIL_BUFFER_BIT;this._rctx.clearSafe(a),this._renderGeometryAndTransparentTerrainPass(I.Depth),i.fbo.readPixels(r[0],r[1],r[2],r[3],he.RGBA,oe.UNSIGNED_BYTE,t),i.release()}readHUDVisibility(e,r,t,s,i){this._bindParameters.hudVisibility?.fbo.readPixels(e,r,t,s,he.RGBA,oe.UNSIGNED_BYTE,i)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_setMultipassTerrain(e){this._setMultipassEnabled(e),this._setTerrainCulling(e)}_setMultipassEnabled(e){this._bindParameters.multipassEnabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_prepareSlots(...e){this._renderPlugins.prepareSlots(e)}_renderSlot(e){this._renderPlugins.render(this._renderPlugins.prepare(e))}_renderEdges(e,r){const t=this._edgeView;if(t?.shouldRender()){const{width:s,height:i,depth:a}=this._offscreen,n=this.fboCache.acquire(S.RGBA,s,i),h=()=>t.render(this._bindParameters,e);this._offscreen.renderToTargets(h,n,r??a,me),this._offscreen.compositeToFramebuffer(this._bindParameters,n.colorTexture,se.Alpha,1),n.release()}}_renderShadowMap(e,r,t,s){const i=this._shadowMap;i.enabled&&(i.start(r,t,s,this.isFeatureEnabled(V.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._shadowHighlight.updateParameters(r,t),this._needsShadowHighlight?(this._renderShadowCascades(I.ShadowHighlight,this._shadowMap),i.moveSnapshot(z.Highlight),i.clear(),this._renderShadowCascades(I.ShadowExcludeHighlight,this._shadowMap),i.copySnapshot(z.Default),this._renderShadowCascades(I.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(I.Shadow),i.finish(),this._rctx.bindFramebuffer(e),r.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap){for(const t of r.cascades)t.camera.setGLViewport(this._rctx),this._prepare(t.camera,t.camera),this._renderGeometryAndTransparentTerrainPass(e)}get _needsLinearDepth(){return this._ssaoHelper.active||this._renderPlugins.requiresOutput(I.Depth)||this.hasReflections||this._needsShadowHighlight||this._needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?(this._bindParameters.linearDepth=this._offscreen.renderToCachedFBO(this._bindParameters.linearDepth,(()=>this._renderGeometryAndTransparentTerrainPass(I.Depth)),[0,0,0,0]),this._bindParameters.linearDepth.releaseDepth(),this._offscreen.bindFbo()):this._bindParameters.linearDepth=n(this._bindParameters.linearDepth)}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.output;this._renderContext.output=I.Depth,this._bindParameters.multipassTerrain.linearDepth=this._offscreen.renderToCachedFBO(this._bindParameters.multipassTerrain.linearDepth,(()=>this._renderTransparentTerrain()),[-1e10,-1e10,-1e10,1]),this._bindParameters.multipassTerrain.linearDepth.releaseDepth(),this._renderContext.output=e}else this._bindParameters.multipassTerrain.linearDepth=n(this._bindParameters.multipassTerrain.linearDepth)}_renderGeometryLinearDepth(e){if(!e)return void(this._bindParameters.multipassGeometry.linearDepth=n(this._bindParameters.multipassGeometry.linearDepth));const r=this._renderContext.output;return this._bindParameters.multipassGeometry.linearDepth=this._offscreen.renderToCachedFBO(this._bindParameters.multipassGeometry.linearDepth,(()=>this._renderGeometryPass(I.Depth)),[1,1,1,1]),this._renderContext.output=r,this._bindParameters.multipassGeometry.linearDepth.detachDepth()}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(e){if(!this._needsDepthRange)return L;const r=F(e,this._materialRenderers,this._stage.layers);return x(r,this.renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderGeometryAndTransparentTerrainPass(e){this._renderContext.output=e,this._prepareSlots(k.TRANSPARENT_TERRAIN),this._renderGeometryPass(e),this._renderTransparentTerrain()}_renderGeometryPass(e){this._renderContext.output=e,this._prepareSlots(k.TRANSPARENT_MATERIAL),this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderSSAO(e){if(!this._ssaoHelper.active)return;const r=this._offscreen.renderToCachedFBO(null,(()=>this._renderGeometryAndTransparentTerrainPass(I.Normal)),[0,0,0,0],S.RGBA4);r.releaseDepth(),this._offscreen.bindFbo(),this._ssaoHelper.render(this._bindParameters,e,r.colorTexture),r.release()}_prepareOpaqueGeometrySlots(){this._prepareSlots(k.INTEGRATED_MESH,k.OPAQUE_TERRAIN,k.OPAQUE_MATERIAL,k.POSTPROCESSING_ENVIRONMENT_OPAQUE),this._prepareInternalSlots(this._materialRenderers,k.OPAQUE_MATERIAL)}_renderOpaqueGeometry(){this._renderSlot(k.INTEGRATED_MESH),this._renderSlot(k.OPAQUE_TERRAIN),this._renderInternalSlot(k.OPAQUE_MATERIAL),this._renderSlot(k.OPAQUE_MATERIAL),this._renderSlot(k.POSTPROCESSING_ENVIRONMENT_OPAQUE)}_renderTransparentGeometry(){this._renderInternalSlot(k.TRANSPARENT_MATERIAL),this._renderSlot(k.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){const e=this._renderPlugins.prepare(k.TRANSPARENT_TERRAIN);if(0===e.size)return;const r=()=>this._renderPlugins.render(e);if(this._renderContext.output!==I.Color)return void r();const{width:t,height:s,depth:i}=this._offscreen,a=this.fboCache.acquire(S.RGBA,t,s);return this._offscreen.renderToTargets(r,a,i,[0,0,0,0]),a}_renderHUDVisibility(e){let r=!1;const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.hudVisibility=t.renderHUDVisibility(this._bindParameters.hudVisibility,(()=>r=this._renderInternalSlot(k.OCCLUSION_PIXELS)),e),t.bindFbo(),r||(this._bindParameters.hudVisibility=n(this._bindParameters.hudVisibility))}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===O.Occluded){const e=()=>this._renderInternalSlot(k.LINE_CALLOUTS),{width:r,height:t,color:s}=this._offscreen,i=this.fboCache.acquireDepth(y.DEPTH16_BUFFER,r,t);this._offscreen.renderToTargets(e,s,i,void 0,!0,!0),i.release()}else this._renderInternalSlot(k.LINE_CALLOUTS)}_renderHUD(e,r){if(this._materialRenderersHas.hudElements)if(this._oitEnabled){const t=this._renderOITPass(_e.HUD,e);this._rctx.bindFramebuffer(r),this._compositingHelper.composite(this._bindParameters,t.colorTexture,se.PremultipliedAlpha),t.release()}else if(e===O.Occluded){const e=()=>this._renderHUDElements(O.Occluded),{width:r,height:t,color:s}=this._offscreen,i=this.fboCache.acquireDepth(y.DEPTH16_BUFFER,r,t);this._offscreen.renderToTargets(e,s,i,void 0,!0,!0),i.release()}else this._renderHUDElements(e)}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._prepareInternalSlots(this._materialRenderers,k.LINE_CALLOUTS_HUD_DEPTH,k.HUD_MATERIAL,k.LABEL_MATERIAL),this._renderInternalSlot(k.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(k.HUD_MATERIAL),this._renderInternalSlot(k.LABEL_MATERIAL)}get _needsShadowHighlight(){return this._shadowMap.enabled&&this._shadowHighlight.isVisible&&this.hasHighlights}_renderHighlights(e,r){if(!this.hasHighlights||r.decorations===D.OFF)return;const t=()=>{this._renderGeometryAndTransparentTerrainPass(I.Highlight),this._rctx.clearSafe(de.DEPTH_BUFFER_BIT),this._renderHUDElements(O.Both)},s=this._offscreen.renderToCachedFBO(null,t,[0,0,0,0],S.RGBA4,y.DEPTH_STENCIL_TEXTURE);this._needsShadowHighlight&&this._shadowHighlight.render(r,s.fbo.colorTexture,e),s.releaseDepth(),this._highlight.render(this._bindParameters,s.fbo,e),s.release()}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_accumulateShadows(e,r,t){this._needsShadowCast&&this._bindParameters.linearDepth?.colorTexture&&this._shadowAccumulator.renderAccumulation(this._bindParameters.linearDepth,e,r,t)}_prepareTransparencySlots(){this._renderContext.output=I.Alpha,this._bindParameters.transparencyPassType=$.Alpha,this._prepareInternalSlots(this._materialRenderers,k.TRANSPARENT_MATERIAL),this._prepareSlots(k.TRANSPARENT_MATERIAL),this._renderContext.output=I.Color,this._bindParameters.transparencyPassType=$.Color,this._prepareInternalSlots(this._materialRenderers,k.TRANSPARENT_MATERIAL),this._prepareSlots(k.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=$.FrontFace,this._prepareInternalSlots(this._materialRenderers,k.TRANSPARENT_MATERIAL),this._prepareSlots(k.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=$.NONE}_renderOITPass(e,r=O.Both){const t=e===_e.HUD,s=t?this.fboCache.acquire(S.RGBA,this._offscreen.width,this._offscreen.height):null,i=t?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),a=this._renderContext.output;this._renderContext.output=I.Alpha,this._bindParameters.transparencyPassType=$.Alpha;const n=this._offscreen.renderOITPass(i,$.Alpha,t);this._renderContext.output=I.Color,this._bindParameters.transparencyPassType=$.Color;const h=this._offscreen.renderOITPass(i,$.Color,t);this._bindParameters.transparencyPassType=$.FrontFace;const o=this._offscreen.renderOITPass(i,$.FrontFace,t);return this._offscreen.compositeTransparentOntoOpaque(this._bindParameters,h,n,o,s),s?.releaseDepth(),o.release(),h.release(),n.release(),this._bindParameters.transparencyPassType=$.NONE,this._renderContext.output=a,s}_renderOccluded(){let e=0;ce.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&r.material.renderOccluded===U.OccludeAndTransparentStencil&&(e|=r.material.renderOccluded,ce.push(r))}));const r=this._offscreen,t=(t,s,i,a,n)=>{if(0==(e&s))return;const{width:h,height:o,depth:d}=r,l=this.fboCache.acquire(S.RGBA,h,o);r.renderToTargets(i,l,d,[0,0,0,0],a,n),r.compositeToFramebuffer(this._bindParameters,l.colorTexture,se.PremultipliedAlpha,t),l.release()};0!==ce.length&&(this._prepareInternalSlots(ce,k.OCCLUDER_MATERIAL,k.TRANSPARENT_OCCLUDER_MATERIAL),this._renderInternalSlot(k.OCCLUDER_MATERIAL,ce),t(.5,U.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(k.TRANSPARENT_OCCLUDER_MATERIAL,ce)),!1,!1)),ce.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&(r.material.renderOccluded===U.OccludeAndTransparent||r.material.renderOccluded===U.Transparent||r.material.renderOccluded===U.Opaque)&&(e|=r.material.renderOccluded,ce.push(r))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const i=e=>{this._renderContext.renderOccludedMask=e,this._prepareInternalSlots(ce,k.OPAQUE_MATERIAL,k.TRANSPARENT_MATERIAL,k.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),s>U.Occlude&&this._renderSlot(k.OCCLUDED_TERRAIN),this._renderInternalSlot(k.OPAQUE_MATERIAL,ce),this._renderInternalSlot(k.TRANSPARENT_MATERIAL,ce),this._renderInternalSlot(k.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,ce),this._renderContext.resetRenderOccludedMask()};this._renderContext.output=I.Color,t(.5,U.OccludeAndTransparent,(()=>i(U.OccludeAndTransparent)),!0,M.OutlineVisualElementMask),t(.5,U.Transparent,(()=>i(U.Transparent)),!0,M.OutlineVisualElementMask),t(1,U.Opaque,(()=>i(U.Opaque)),!0,M.OutlineVisualElementMask),ce.clear()}_prepare(e,r){this._needsTransparentPass=this._materialRenderers.some((e=>e.canRender(k.TRANSPARENT_MATERIAL,I.Color))),this._bindParameters.camera=e,this._bindParameters.contentCamera=r}_ensureBindParameters(e,r){this._bindParameters.camera=e,this._bindParameters.contentCamera=r;const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.mainColor=t.colorTexture,this._bindParameters.mainDepth=t.depthTexture}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=g:(u(fe,this._bindParameters.camera.viewMatrix),u(ue,this._bindParameters.camera.projectionMatrix),f(ge,fe,ue),f(ge,this._renderContext.lastFrameCamera.viewMatrix,ge),f(ge,this._renderContext.lastFrameCamera.projectionMatrix,ge),this._reprojectionMatrix=ge);const r=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=r>0?Math.min(r,e-this._ssrEnableTime)/r:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=g,this._ssrEnableTime=null}_prepareInternalSlots(e,...r){for(const t of r)this._bindParameters.slot=t,e.forAll((e=>{e.material.shouldRender(this._renderContext)&&e.prepareTechnique(this._renderContext)}))}_renderInternalSlot(e,r=this._materialRenderers){let t=!1;return this._bindParameters.slot=e,r.forAll((e=>{if(e.material.shouldRender(this._renderContext)){const r=e.prepareTechnique(this._renderContext);null!=r&&(e.render(this._renderContext,r),t=!0)}})),t}get memoryInfo(){return{fbo:(this._offscreen?.gpuMemoryUsage??0)+(this._bindParameters.ssr.lastFrameColor?.memoryUsage??0)+(this._bindParameters.linearDepth?.memoryUsage??0)+(this._bindParameters.hudVisibility?.memoryUsage??0)+this.fboCache.peakMemoryUsage,highlights:this._highlight?.gpuMemoryUsage??0,shadows:this._shadowMap?.gpuMemoryUsage??0,ssao:this._ssaoHelper?.gpuMemoryUsage??0,vaos:this._materialRenderers.reduce(((e,r)=>e+r.usedMemory),0),plugins:this._renderPlugins.usedMemory}}get usedMemory(){return this.fboCache.peakMemoryUsage+(this._offscreen?.gpuMemoryUsage??0)+(this._bindParameters.linearDepth?.memoryUsage??0)+(this._bindParameters.hudVisibility?.memoryUsage??0)+(this._highlight?.gpuMemoryUsage??0)+(this._shadowMap?.gpuMemoryUsage??0)+(this._ssaoHelper?.gpuMemoryUsage??0)+(this.edgeView?.usedMemory??0)+this._materialRenderers.reduce(((e,r)=>e+r.usedMemory),0)+this._renderPlugins.usedMemory}get test(){const e=this;return{offscreen:this._offscreen,shadowMap:this._shadowMap,ssao:this._ssaoHelper,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,weatherIsFading:this._bindParameters.cloudsFade.isFading,resetRenderStateFeatures:()=>{e._renderStateFeatures=j(),this.renderPlugins.renderFeatureChanged(),this._requestRender()},getFramebufferTexture:r=>{switch(r){case pe.Color:return e._offscreen.colorTexture;case pe.LinearDepth:return e._bindParameters.linearDepth?.colorTexture;case pe.ShadowMap:return e._shadowMap.depthTexture;case pe.HudVisibility:return e._bindParameters.hudVisibility?.colorTexture}}}}};var _e,pe;e([p()],le.prototype,"_renderPlugins",void 0),e([p()],le.prototype,"_shadowAccumulator",void 0),e([p()],le.prototype,"_state",void 0),e([p()],le.prototype,"_renderStateFeatures",void 0),e([p()],le.prototype,"_ssaoEnabled",void 0),e([p({readOnly:!0})],le.prototype,"fullResolutionAtmosphere",null),e([p()],le.prototype,"_smaaPass",void 0),e([p({autoDestroy:!0})],le.prototype,"_edgeView",void 0),e([p()],le.prototype,"updating",null),e([p()],le.prototype,"isCameraFinal",null),le=e([m("esri.views.3d.webgl-engine.lib.Renderer")],le),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(_e||(_e={})),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.ShadowMap=2]="ShadowMap",e[e.HudVisibility=3]="HudVisibility"}(pe||(pe={}));const me=[0,0,0,0],ce=new h,ue=T(),fe=T(),ge=T();function Te(e){return r=>e.immediate.schedule(r)}export{pe as FramebufferId,le as Renderer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{update as t}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{removeMaybe as s,disposeMaybe as i,destroyMaybe as a,releaseMaybe as n}from"../../../../core/maybe.js";import h from"../../../../core/PooledArray.js";import{watch as o,syncAndInitial as d,initial as l,sync as _}from"../../../../core/reactiveUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{j as c,a as u,m as f}from"../../../../chunks/mat4.js";import{I as g,c as T}from"../../../../chunks/mat4f64.js";import{h as R}from"../../../../chunks/vec4.js";import{a as A}from"../../../../chunks/boundedPlane.js";import P from"../../support/debugFlags.js";import{TransparencyMode as b}from"../../terrain/TerrainRenderer.js";import{FBOCache as E,ColorFormat as S,DepthFormat as y}from"../core/FBOCache.js";import{RenderPassManager as C}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as I}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as w}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{AnimationTimeStep as O}from"./AnimationTimeStep.js";import{Decorations as D,RenderRequestType as N,StencilBits as M}from"./basicInterfaces.js";import{BoundingInfo as H}from"./BoundingInfo.js";import{ZERO as L,union as x}from"./depthRange.js";import{depthRangeFromScene as F}from"./depthRangeUtils.js";import{Highlight as v}from"./Highlight.js";import{RenderOccludedFlag as U}from"./Material.js";import{OffscreenRendering as G}from"./OffscreenRendering.js";import{RenderContext as q}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as B}from"./rendererUtils.js";import{setupFeatureDefaults as j,RenderFeature as V}from"./RenderFeature.js";import{RenderPluginManager as Q}from"./RenderPluginManager.js";import{RenderSlot as k}from"./RenderSlot.js";import{ShadowAccumulator as W}from"./ShadowAccumulator.js";import{ShadowHighlight as Y}from"./ShadowHighlight.js";import{ShadowMap as X,SnapshotSlot as z}from"./ShadowMap.js";import J from"./SliceHelper.js";import{SmaaRenderPass as K}from"./SmaaRenderPass.js";import{SSAOHelper as Z}from"./SSAOHelper.js";import{TransparencyPassType as $}from"./TransparencyPassType.js";import{EdgeView as ee}from"./edgeRendering/EdgeView.js";import{Transparency as re}from"./edgeRendering/interfaces.js";import{MergedRenderer as te}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as se}from"../shaders/CompositingTechniqueConfiguration.js";import{RendererPerformanceInfo as ie,PerformanceCategory as ae}from"../statistics/RendererPerformanceInfo.js";import{RenderState as ne}from"../../../support/RenderState.js";import{PixelFormat as he,PixelType as oe,ClearBufferBit as de}from"../../../webgl/enums.js";let le=class extends r{get _bindParameters(){return this._renderContext.bindParameters}updateRenderFeatures(e=null,r=!has("disable-feature:high-quality-idle")){this._renderStateFeatures=j(r,e),this.notifyChange("_renderStateFeatures"),this.renderPlugins.renderFeatureChanged(),this._requestRender()}isFeatureEnabled(e,r=this._state){return this._renderStateFeatures.get(r,e)??!1}setFeatureEnabled(e,r,t){this._renderStateFeatures.set(r,e,t),this.notifyChange("_renderStateFeatures"),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(V.HighQualityTransparency)}get hasReflections(){return this.hasWater&&(this._ssrEnabled||this.isFeatureEnabled(V.WaterReflection))}get hasDecorations(){return this._materialRenderersHas.decorations||this._renderPlugins.hasDecorations}get hasHighlights(){return this._materialRenderersHas.highlights||this._renderPlugins.requiresOutput(I.Highlight)}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(V.HighResolutionAtmosphere)}get hasWater(){return this._materialRenderersHas.water||this._hasOverlayWater}constructor(e,r,t,s,i,a,n,_){super({}),this._stage=e,this._materialRepository=r,this._techniqueRepository=s,this._rctx=i,this._compositingHelper=a,this._magnifierHelper=n,this._requestRender=_,this._materialRenderers=new h,this._needsTransparentPass=!1,this._materialRenderersHas={hudElements:!1,highlights:!1,water:!1,decorations:!1,occludees:!1},this._hasOverlayWater=!1,this._renderOverlay=e=>{},this._isRendering=!1,this._fallbackDepthStencilTexture=null,this._sliceHelper=new J,this._state=ne.IDLE,this._highQualityTransparencyEnabled=!0,this._terrainRenderingEnabled=!0,this._terrainTransparency=b.Opaque,this._ssrEnabled=!1,this._ssaoEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new O,this._renderHiddenTransparentEdges=()=>{},this.fboCache=new E(i),this._renderStateFeatures=j(!has("disable-feature:high-quality-idle"),e.view.qualityProfile),this._offscreen=new G(this.fboCache,this._compositingHelper),this.performanceInfo=new ie(this._rctx),this._shadowMap=new X(this.fboCache,e.viewingMode),this._ssaoHelper=new Z(e.view,this.fboCache,s,_),this._highlight=new v(s,this.fboCache),this._shadowHighlight=new Y(this._rctx,e.viewingMode),this._shadowAccumulator=new W(this.fboCache,s,e,(e=>{const r=this.shadowsEnabled;this._shadowMap.enabled=!0,this._prepare(e.camera,e.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=r}),((e,r,t)=>{e.shadowMap.start(e.camera,r,t,!0,this._stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(I.Shadow,e.shadowMap),e.shadowMap.finish(),e.camera.setGLViewport(this._rctx),this._prepare(e.camera,e.contentCamera)}),_),this._renderContext=new q(this._rctx,this._offscreen,this._shadowMap,this._ssaoHelper,this._sliceHelper),this._renderPlugins=new Q({renderContext:this._renderContext,techniqueRepository:s,textureRepository:t,materialRepository:this._materialRepository,requestRender:_,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this.renderPassManager=new C(this._rctx,this._techniqueRepository),this._renderPlugins.add(this.renderPassManager),this._smaaPass=new K({view:this._stage.view}),this._renderPlugins.add(this._smaaPass),this.addHandles([o((()=>this._stage.view.state.camera),(()=>_()),d),o((()=>P.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(re.TRANSPARENT):()=>{},_()}),l),o((()=>this._ssaoEnabled||this.isFeatureEnabled(V.SSAO)),(e=>this._ssaoHelper.enabled=e),d)])}normalizeCtorArgs(){return{}}destroy(){this._smaaPass.disable(),this._smaaPass.destroy(),this._gpuTimerHandle=s(this._gpuTimerHandle),this._materialRenderers.forAll((e=>e.dispose())),this._materialRenderers.clear(),this._offscreen.dispose(),this._fallbackDepthStencilTexture=i(this._fallbackDepthStencilTexture),this._shadowMap.dispose(),this._ssaoHelper.destroy(),this._highlight.dispose(),this._shadowHighlight.dispose(),this._shadowAccumulator.dispose(),this._edgeView=a(this._edgeView),this.renderPassManager.destroy(),this._releaseFBOs(),this._bindParameters.linearDepth=n(this._bindParameters.linearDepth),this._bindParameters.hudVisibility=n(this._bindParameters.hudVisibility),this.fboCache.destroy(),H.prune()}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=n(this._bindParameters.ssr.lastFrameColor),this._bindParameters.multipassTerrain.linearDepth=n(this._bindParameters.multipassTerrain.linearDepth),this._bindParameters.multipassGeometry.linearDepth=n(this._bindParameters.multipassGeometry.linearDepth)}disposeOffscreenBuffers(){this._releaseFBOs(),this._offscreen.dispose(),this._shadowMap.disposeOffscreenBuffers(),this._ssaoHelper.disposeOffscreenBuffers()}get updating(){return this._smaaPass.updating||null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._renderPlugins.updating||!this.isCameraFinal}ensureEdgeView(){if(null==this._edgeView){const e=this._stage.view.resourceController;this._edgeView=new ee({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniqueRepository:this._techniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:Te(e)}),this.addHandles(o((()=>this._edgeView?.updating),(()=>this._requestRender()),_)),this._requestRender()}return this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return c(this._bindParameters.ssr.reprojectionMatrix,g)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:r,_bindParameters:t}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.qualitySettings?.ambientOcclusion&&this._ssaoEnabled!==e.qualitySettings.ambientOcclusion&&(this._ssaoEnabled=e.qualitySettings.ambientOcclusion,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&r.maxCascades!==e.shadowMapMaxCascades&&(r.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);const r="virtual"!==e.environment.lighting.type;t.enableFillLights!==r&&(t.enableFillLights=r,this._requestRender())}e.backgroundColor&&!R(this._offscreen.backgroundColor,e.backgroundColor)&&(this._offscreen.backgroundColor=e.backgroundColor,this._requestRender()),void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.defaultHighlightOptions&&(this._highlight.setDefaultOptions(e.defaultHighlightOptions),this._shadowHighlight.setDefaultOptions(e.defaultHighlightOptions),this._requestRender()),void 0!==e.overlays&&this._bindParameters.overlays!==e.overlays&&(this._bindParameters.overlays=e.overlays,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.renderOverlay&&this._renderOverlay!==e.renderOverlay&&(this._renderOverlay=e.renderOverlay,this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=e.slicePlane,this._requestRender()),void 0!==e.terrainRenderingEnabled&&this._terrainRenderingEnabled!==e.terrainRenderingEnabled&&(this._terrainRenderingEnabled=e.terrainRenderingEnabled,this._requestRender()),void 0!==e.terrainTransparency&&this._terrainTransparency!==e.terrainTransparency&&(this._terrainTransparency=e.terrainTransparency,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,r){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:t,removes:s,updates:i}=e;if(0===t.length&&0===s.length&&0===i.length)return;const a=B(e);let n=!1;a.forEach(((t,s)=>{if(r.done)return;let i=this._materialRenderers.find((e=>e.material===s));null==i&&t.adds.length>0&&(i=new te(this._rctx,this._materialRepository,s),this._materialRenderers.push(i)),i&&(i.modify(t),i.isEmpty&&(n=!0)),t.removes.forEach((r=>e.removes.removeUnordered(r))),t.adds.forEach((r=>e.adds.removeUnordered(r))),t.updates.forEach((r=>e.updates.removeUnordered(r))),r.madeProgress()})),n&&this._materialRenderers.filterInPlace((e=>!e.isEmpty||(e.dispose(),!1))),this._updateHasFlags(),this._requestRender()}_updateHasFlags(){const has=this._materialRenderersHas;has.decorations=!1,has.highlights=!1,has.hudElements=!1,has.water=!1,has.occludees=!1,this._materialRenderers.forAll((e=>{has.highlights||=e.hasHighlights,has.occludees||=e.hasOccludees,has.water||=e.hasWater,has.decorations||=e.isDecoration,has.hudElements||=e.canRender(k.LINE_CALLOUTS_HUD_DEPTH,I.Color)||e.canRender(k.HUD_MATERIAL,I.Color)||e.canRender(k.LABEL_MATERIAL,I.Color)})),this._bindParameters.hasOccludees=has.occludees}updateAnimation(e){const r=this._hasAnimations;return this._hasAnimations=!1,this._materialRenderers.forAll((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations=this._renderPlugins.updateAnimation(e)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?s(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}render(e,r,t,s,i){this._isRendering=!0,this.performanceInfo.startFrame(),this.fboCache.resetPeakMemoryUsage();const a=this._offscreen,{camera:h,contentCamera:o,mode:d,alignPixelEnabled:l}=t;this._state=d,this._renderOverlay(i),this.performanceInfo.advance(ae.OVERLAY),this._renderContext.time=i,this._bindParameters.transparencyPassType=$.NONE,this._bindParameters.alignPixelEnabled=l,this._bindParameters.decorations=s,this._bindParameters.ssr.lastFrameColor=n(this._bindParameters.ssr.lastFrameColor),this.hasReflections?this._bindParameters.ssr.lastFrameColor=a.swapColorBuffer():a.swapColorBuffer().release();const _=A(this._sliceHelper.plane);s===D.OFF&&(this._sliceHelper.plane=null),this._rctx.bindFramebuffer(e),h.setGLViewport(this._rctx),this._prepare(h,o),this._renderPlugins.prepareRender(),this.performanceInfo.advance(ae.PREPARE);const p=this._computeDepthRange(h);this._renderShadowMap(e,h,this._bindParameters.lighting.mainLight.direction,p),this.performanceInfo.advance(ae.SHADOW_MAP),a.initializeFrame(h),this._ensureBindParameters(h,o);const m=this._terrainRenderingEnabled&&(this._terrainTransparency===b.Semitransparent||this._terrainTransparency===b.TransparentWithDraped),c=this._highQualityTransparency&&m,u=this._needsTransparentPass||this._renderPlugins.canRender(k.TRANSPARENT_MATERIAL);this._prepareShaders(c,u),this._renderLinearDepth(),this.performanceInfo.advance(ae.LINEAR_DEPTH),this._accumulateShadows(p,h,o),this.performanceInfo.advance(ae.ACCUMULATED_SHADOWS),this._ensureBindParametersSSR(i),this._renderSSAO(i),this.performanceInfo.advance(ae.SSAO),this._renderContext.output=I.Color,a.bindFbo(),this._renderOpaqueGeometry(),this.performanceInfo.advance(ae.OPAQUE),this._renderTerrainLinearDepth(c),this._setMultipassTerrain(c),this._renderEdges(re.OPAQUE),this.performanceInfo.advance(ae.OPAQUE_EDGES),a.bindFbo(),this._renderSlot(k.VOXEL),this.performanceInfo.advance(ae.VOXEL),this._renderHiddenTransparentEdges(),u&&(this._oitEnabled?this._renderOITPass(_e.Geometry):this._renderTransparentGeometry()),this.performanceInfo.advance(ae.TRANSPARENT);const f=this._renderGeometryLinearDepth(c);this._renderHUDVisibility(f),c||this._renderInternalSlot(k.LINE_CALLOUTS),this.performanceInfo.advance(ae.HUD_VISIBILITY),this._renderObjectAndLayerIdColor(r),this.performanceInfo.advance(ae.OBJECT_AND_LAYER_ID_COLOR),this._renderEdges(re.TRANSPARENT,f),f?.release(),this.performanceInfo.advance(ae.TRANSPARENT_EDGES);const g=m?this._renderTransparentTerrain():null;if(g&&this._bindParameters.hudVisibility&&(c?this._renderLineCallouts(w.Occluded):a.compositeToHUDVisibility(this._bindParameters,g.colorTexture),this._renderHUD(w.Occluded,a.framebuffer),this.performanceInfo.advance(ae.HUD_OCCLUDED)),this.performanceInfo.advance(ae.TRANSPARENT_TERRAIN),this._setTerrainCulling(!1),g&&(a.compositeToFramebuffer(this._bindParameters,g.colorTexture,se.PremultipliedAlpha,1),g.release(),c&&(this._renderEdges(re.OPAQUE),this.performanceInfo.advance(ae.OPAQUE_EDGES),u&&(this._oitEnabled?this._renderOITPass(_e.Geometry):this._renderTransparentGeometry()),this.performanceInfo.advance(ae.TRANSPARENT),this._renderEdges(re.TRANSPARENT),this.performanceInfo.advance(ae.TRANSPARENT_EDGES))),c&&this._renderLineCallouts(w.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),a.bindFbo(),this._renderInternalSlot(k.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderSlot(k.POSTPROCESSING_ENVIRONMENT_TRANSPARENT),this._renderSlot(k.LASERLINES),this.performanceInfo.advance(ae.ENVIRONMENT),this._renderPlugins.needsLaserlineWithContrastControl){const{width:e,height:r,depth:t}=a,s=this.fboCache.acquire(S.RGBA,e,r),i=()=>this._renderSlot(k.LASERLINES_CONTRAST_CONTROL);a.renderToTargets(i,s,t,me),a.compositeToFramebuffer(this._bindParameters,s.colorTexture,se.PremultipliedAlpha,1),s.release()}this.performanceInfo.advance(ae.LASER_LINE),this._renderOccluded(),this.performanceInfo.advance(ae.OCCLUDED);const T=s===D.ON&&this._magnifierHelper.enabled,R=T&&null==e?this.fboCache.acquire(S.RGBA,a.width,a.height).acquireDepth(y.DEPTH16_BUFFER):null,P=R?.fbo??e;this._bindParameters.output=P,this._rctx.bindFramebuffer(P);const E=this._offscreen.colorTexture;this.renderPlugins.canRender(k.ANTIALIASING)?this._renderSlot(k.ANTIALIASING):null!=E&&this._compositingHelper.composite(this._bindParameters,E,se.None),this.performanceInfo.advance(ae.ANTIALIASING),this._renderHUD(w.NotOccluded,P),this.performanceInfo.advance(ae.HUD),this._renderHighlights(P,this._bindParameters),this.performanceInfo.advance(ae.HIGHLIGHTS),T&&this._magnifierHelper.render(this._rctx,this._bindParameters),P!==e&&(this._rctx.bindFramebuffer(e),this._compositingHelper.composite(this._bindParameters,R?.colorTexture,se.None)),R?.release(),this._releaseFBOs(),this._offscreen.releaseBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=_,this._isRendering=!1,this.onPostRender&&this.onPostRender(),this.performanceInfo.finishFrame()}_prepareShaders(e,r){this._renderContext.output=I.Color,this._prepareOpaqueGeometrySlots(),this._setMultipassTerrain(e),this._prepareSlots(k.TRANSPARENT_TERRAIN),this._setMultipassTerrain(!1),e||this._prepareInternalSlots(this._materialRenderers,k.LINE_CALLOUTS),r&&this._prepareTransparencySlots(),this._prepareInternalSlots(this._materialRenderers,k.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._prepareSlots(k.POSTPROCESSING_ENVIRONMENT_TRANSPARENT,k.LASERLINES),this._rctx.gl.flush()}_renderObjectAndLayerIdColor(e){if(null==e||!has("enable-feature:objectAndLayerId-rendering"))return;const r=this._renderContext.output;this._rctx.bindFramebuffer(e),this._offscreen.renderToFBO((()=>this._renderGeometryAndTransparentTerrainPass(I.ObjectAndLayerIdColor)),[0,0,0,0],!0,!0),this._rctx.bindFramebuffer(e),this._offscreen.renderToFBO((()=>{this._bindParameters.hudRenderStyle=w.NotOccluded,this._renderInternalSlot(k.HUD_MATERIAL)}),void 0,!0,!0),this._renderContext.output=r}finish(e){this._hasAnimations||this._animationTimestep.clear();const r=this.performanceInfo.gpuSamplingEnabled,t=e===N.BACKGROUND;if(t||r){const e=t?this.performanceInfo.elapsedTime:0,s=r?this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.getError(),i=Math.max(e,s);this._animationTimestep.frame(i,t)}}readDepthPixels(e,r,t){const s=this._bindParameters.linearDepth?.fbo;if(s?.colorTexture)return void s.readPixels(r[0],r[1],r[2],r[3],he.RGBA,oe.UNSIGNED_BYTE,t);const i=this.fboCache.acquire(S.RGBA,this._offscreen.width,this._offscreen.height).acquireDepth(y.DEPTH16_BUFFER);this._rctx.bindFramebuffer(i.fbo),this._ensureBindParameters(e,e),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const a=de.COLOR_BUFFER_BIT|de.DEPTH_BUFFER_BIT|de.STENCIL_BUFFER_BIT;this._rctx.clearSafe(a),this._renderGeometryAndTransparentTerrainPass(I.Depth),i.fbo.readPixels(r[0],r[1],r[2],r[3],he.RGBA,oe.UNSIGNED_BYTE,t),i.release()}readHUDVisibility(e,r,t,s,i){this._bindParameters.hudVisibility?.fbo.readPixels(e,r,t,s,he.RGBA,oe.UNSIGNED_BYTE,i)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_setMultipassTerrain(e){this._setMultipassEnabled(e),this._setTerrainCulling(e)}_setMultipassEnabled(e){this._bindParameters.multipassEnabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_prepareSlots(...e){this._renderPlugins.prepareSlots(e)}_renderSlot(e){this._renderPlugins.render(this._renderPlugins.prepare(e))}_renderEdges(e,r){const t=this._edgeView;if(t?.shouldRender()){const{width:s,height:i,depth:a}=this._offscreen,n=this.fboCache.acquire(S.RGBA,s,i),h=()=>t.render(this._bindParameters,e);this._offscreen.renderToTargets(h,n,r??a,me),this._offscreen.compositeToFramebuffer(this._bindParameters,n.colorTexture,se.Alpha,1),n.release()}}_renderShadowMap(e,r,t,s){const i=this._shadowMap;i.enabled&&(i.start(r,t,s,this.isFeatureEnabled(V.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._shadowHighlight.updateParameters(r,t),this._needsShadowHighlight?(this._renderShadowCascades(I.ShadowHighlight,this._shadowMap),i.moveSnapshot(z.Highlight),i.clear(),this._renderShadowCascades(I.ShadowExcludeHighlight,this._shadowMap),i.copySnapshot(z.Default),this._renderShadowCascades(I.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(I.Shadow),i.finish(),this._rctx.bindFramebuffer(e),r.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap){for(const t of r.cascades)t.camera.setGLViewport(this._rctx),this._prepare(t.camera,t.camera),this._renderGeometryAndTransparentTerrainPass(e)}get _needsLinearDepth(){return this._ssaoHelper.active||this._renderPlugins.requiresOutput(I.Depth)||this.hasReflections||this._needsShadowHighlight||this._needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?(this._bindParameters.linearDepth=this._offscreen.renderToCachedFBO(this._bindParameters.linearDepth,(()=>this._renderGeometryAndTransparentTerrainPass(I.Depth)),[0,0,0,0]),this._bindParameters.linearDepth.releaseDepth(),this._offscreen.bindFbo()):this._bindParameters.linearDepth=n(this._bindParameters.linearDepth)}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.output;this._renderContext.output=I.Depth,this._bindParameters.multipassTerrain.linearDepth=this._offscreen.renderToCachedFBO(this._bindParameters.multipassTerrain.linearDepth,(()=>this._renderTransparentTerrain()),[-1e10,-1e10,-1e10,1]),this._bindParameters.multipassTerrain.linearDepth.releaseDepth(),this._renderContext.output=e}else this._bindParameters.multipassTerrain.linearDepth=n(this._bindParameters.multipassTerrain.linearDepth)}_renderGeometryLinearDepth(e){if(!e)return void(this._bindParameters.multipassGeometry.linearDepth=n(this._bindParameters.multipassGeometry.linearDepth));const r=this._renderContext.output;return this._bindParameters.multipassGeometry.linearDepth=this._offscreen.renderToCachedFBO(this._bindParameters.multipassGeometry.linearDepth,(()=>this._renderGeometryPass(I.Depth)),[1,1,1,1]),this._renderContext.output=r,this._bindParameters.multipassGeometry.linearDepth.detachDepth()}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(e){if(!this._needsDepthRange)return L;const r=F(e,this._materialRenderers,this._stage.layers);return x(r,this.renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderGeometryAndTransparentTerrainPass(e){this._renderContext.output=e,this._prepareSlots(k.TRANSPARENT_TERRAIN),this._renderGeometryPass(e),this._renderTransparentTerrain()}_renderGeometryPass(e){this._renderContext.output=e,this._prepareSlots(k.TRANSPARENT_MATERIAL),this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderSSAO(e){if(!this._ssaoHelper.active)return;const r=this._offscreen.renderToCachedFBO(null,(()=>this._renderGeometryAndTransparentTerrainPass(I.Normal)),[0,0,0,0],S.RGBA4);r.releaseDepth(),this._offscreen.bindFbo(),this._ssaoHelper.render(this._bindParameters,e,r.colorTexture),r.release()}_prepareOpaqueGeometrySlots(){this._prepareSlots(k.INTEGRATED_MESH,k.OPAQUE_TERRAIN,k.OPAQUE_MATERIAL,k.POSTPROCESSING_ENVIRONMENT_OPAQUE),this._prepareInternalSlots(this._materialRenderers,k.OPAQUE_MATERIAL)}_renderOpaqueGeometry(){this._renderSlot(k.INTEGRATED_MESH),this._renderSlot(k.OPAQUE_TERRAIN),this._renderInternalSlot(k.OPAQUE_MATERIAL),this._renderSlot(k.OPAQUE_MATERIAL),this._renderSlot(k.POSTPROCESSING_ENVIRONMENT_OPAQUE)}_renderTransparentGeometry(){this._renderInternalSlot(k.TRANSPARENT_MATERIAL),this._renderSlot(k.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){const e=this._renderPlugins.prepare(k.TRANSPARENT_TERRAIN);if(0===e.size)return;const r=()=>this._renderPlugins.render(e);if(this._renderContext.output!==I.Color)return void r();const{width:t,height:s,depth:i}=this._offscreen,a=this.fboCache.acquire(S.RGBA,t,s);return this._offscreen.renderToTargets(r,a,i,[0,0,0,0]),a}_renderHUDVisibility(e){let r=!1;const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.hudVisibility=t.renderHUDVisibility(this._bindParameters.hudVisibility,(()=>r=this._renderInternalSlot(k.OCCLUSION_PIXELS)),e),t.bindFbo(),r||(this._bindParameters.hudVisibility=n(this._bindParameters.hudVisibility))}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===w.Occluded){const e=()=>this._renderInternalSlot(k.LINE_CALLOUTS),{width:r,height:t,color:s}=this._offscreen,i=this.fboCache.acquireDepth(y.DEPTH16_BUFFER,r,t);this._offscreen.renderToTargets(e,s,i,void 0,!0,!0),i.release()}else this._renderInternalSlot(k.LINE_CALLOUTS)}_renderHUD(e,r){if(this._materialRenderersHas.hudElements)if(this._oitEnabled){const t=this._renderOITPass(_e.HUD,e);this._rctx.bindFramebuffer(r),this._compositingHelper.composite(this._bindParameters,t.colorTexture,se.PremultipliedAlpha),t.release()}else if(e===w.Occluded){const r=()=>this._renderHUDElements(e),{width:t,height:s,color:i}=this._offscreen,a=this.fboCache.acquireDepth(y.DEPTH16_BUFFER,t,s);this._offscreen.renderToTargets(r,i,a,void 0,!0,!0),a.release()}else this._renderHUDElements(e)}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._prepareInternalSlots(this._materialRenderers,k.LINE_CALLOUTS_HUD_DEPTH,k.HUD_MATERIAL,k.LABEL_MATERIAL),this._renderInternalSlot(k.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(k.HUD_MATERIAL),this._renderInternalSlot(k.LABEL_MATERIAL)}get _needsShadowHighlight(){return this._shadowMap.enabled&&this._shadowHighlight.isVisible&&this.hasHighlights}_renderHighlights(e,r){if(!this.hasHighlights||r.decorations===D.OFF)return;const t=()=>{this._renderGeometryAndTransparentTerrainPass(I.Highlight),this._rctx.clearSafe(de.DEPTH_BUFFER_BIT),this._renderHUDElements(w.Both)},s=this._offscreen.renderToCachedFBO(null,t,[0,0,0,0],S.RGBA4,y.DEPTH_STENCIL_TEXTURE);this._needsShadowHighlight&&this._shadowHighlight.render(r,s.fbo.colorTexture,e),s.releaseDepth(),this._highlight.render(this._bindParameters,s.fbo,e),s.release()}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_accumulateShadows(e,r,t){this._needsShadowCast&&this._bindParameters.linearDepth?.colorTexture&&this._shadowAccumulator.renderAccumulation(this._bindParameters.linearDepth,e,r,t)}_prepareTransparencySlots(){this._renderContext.output=I.Alpha,this._bindParameters.transparencyPassType=$.Alpha,this._prepareInternalSlots(this._materialRenderers,k.TRANSPARENT_MATERIAL),this._prepareSlots(k.TRANSPARENT_MATERIAL),this._renderContext.output=I.Color,this._bindParameters.transparencyPassType=$.Color,this._prepareInternalSlots(this._materialRenderers,k.TRANSPARENT_MATERIAL),this._prepareSlots(k.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=$.FrontFace,this._prepareInternalSlots(this._materialRenderers,k.TRANSPARENT_MATERIAL),this._prepareSlots(k.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=$.NONE}_renderOITPass(e,r=w.Both){const t=e===_e.HUD,s=t?this.fboCache.acquire(S.RGBA,this._offscreen.width,this._offscreen.height):null,i=t?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),a=this._renderContext.output;this._renderContext.output=I.Alpha,this._bindParameters.transparencyPassType=$.Alpha;const n=this._offscreen.renderOITPass(i,$.Alpha,t);this._renderContext.output=I.Color,this._bindParameters.transparencyPassType=$.Color;const h=this._offscreen.renderOITPass(i,$.Color,t);this._bindParameters.transparencyPassType=$.FrontFace;const o=this._offscreen.renderOITPass(i,$.FrontFace,t);return this._offscreen.compositeTransparentOntoOpaque(this._bindParameters,h,n,o,s),s?.releaseDepth(),o.release(),h.release(),n.release(),this._bindParameters.transparencyPassType=$.NONE,this._renderContext.output=a,s}_renderOccluded(){let e=0;ce.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&r.material.renderOccluded===U.OccludeAndTransparentStencil&&(e|=r.material.renderOccluded,ce.push(r))}));const r=this._offscreen,t=(t,s,i,a,n)=>{if(0==(e&s))return;const{width:h,height:o,depth:d}=r,l=this.fboCache.acquire(S.RGBA,h,o);r.renderToTargets(i,l,d,[0,0,0,0],a,n),r.compositeToFramebuffer(this._bindParameters,l.colorTexture,se.PremultipliedAlpha,t),l.release()};0!==ce.length&&(this._prepareInternalSlots(ce,k.OCCLUDER_MATERIAL,k.TRANSPARENT_OCCLUDER_MATERIAL),this._renderInternalSlot(k.OCCLUDER_MATERIAL,ce),t(.5,U.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(k.TRANSPARENT_OCCLUDER_MATERIAL,ce)),!1,!1)),ce.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&(r.material.renderOccluded===U.OccludeAndTransparent||r.material.renderOccluded===U.Transparent||r.material.renderOccluded===U.Opaque)&&(e|=r.material.renderOccluded,ce.push(r))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const i=e=>{this._renderContext.renderOccludedMask=e,this._prepareInternalSlots(ce,k.OPAQUE_MATERIAL,k.TRANSPARENT_MATERIAL,k.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),s>U.Occlude&&this._renderSlot(k.OCCLUDED_TERRAIN),this._renderInternalSlot(k.OPAQUE_MATERIAL,ce),this._renderInternalSlot(k.TRANSPARENT_MATERIAL,ce),this._renderInternalSlot(k.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,ce),this._renderContext.resetRenderOccludedMask()};this._renderContext.output=I.Color,t(.5,U.OccludeAndTransparent,(()=>i(U.OccludeAndTransparent)),!0,M.OutlineVisualElementMask),t(.5,U.Transparent,(()=>i(U.Transparent)),!0,M.OutlineVisualElementMask),t(1,U.Opaque,(()=>i(U.Opaque)),!0,M.OutlineVisualElementMask),ce.clear()}_prepare(e,r){this._needsTransparentPass=this._materialRenderers.some((e=>e.canRender(k.TRANSPARENT_MATERIAL,I.Color))),this._bindParameters.camera=e,this._bindParameters.contentCamera=r}_ensureBindParameters(e,r){this._bindParameters.camera=e,this._bindParameters.contentCamera=r;const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.mainColor=t.colorTexture,this._bindParameters.mainDepth=t.depthTexture}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=g:(u(fe,this._bindParameters.camera.viewMatrix),u(ue,this._bindParameters.camera.projectionMatrix),f(ge,fe,ue),f(ge,this._renderContext.lastFrameCamera.viewMatrix,ge),f(ge,this._renderContext.lastFrameCamera.projectionMatrix,ge),this._reprojectionMatrix=ge);const r=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=r>0?Math.min(r,e-this._ssrEnableTime)/r:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=g,this._ssrEnableTime=null}_prepareInternalSlots(e,...r){for(const t of r)this._bindParameters.slot=t,e.forAll((e=>{e.material.shouldRender(this._renderContext)&&e.prepareTechnique(this._renderContext)}))}_renderInternalSlot(e,r=this._materialRenderers){let t=!1;return this._bindParameters.slot=e,r.forAll((e=>{if(e.material.shouldRender(this._renderContext)){const r=e.prepareTechnique(this._renderContext);null!=r&&(e.render(this._renderContext,r),t=!0)}})),t}get memoryInfo(){return{fbo:(this._offscreen?.gpuMemoryUsage??0)+(this._bindParameters.ssr.lastFrameColor?.memoryUsage??0)+(this._bindParameters.linearDepth?.memoryUsage??0)+(this._bindParameters.hudVisibility?.memoryUsage??0)+this.fboCache.peakMemoryUsage,highlights:this._highlight?.gpuMemoryUsage??0,shadows:this._shadowMap?.gpuMemoryUsage??0,ssao:this._ssaoHelper?.gpuMemoryUsage??0,vaos:this._materialRenderers.reduce(((e,r)=>e+r.usedMemory),0),plugins:this._renderPlugins.usedMemory}}get usedMemory(){return this.fboCache.peakMemoryUsage+(this._offscreen?.gpuMemoryUsage??0)+(this._bindParameters.linearDepth?.memoryUsage??0)+(this._bindParameters.hudVisibility?.memoryUsage??0)+(this._highlight?.gpuMemoryUsage??0)+(this._shadowMap?.gpuMemoryUsage??0)+(this._ssaoHelper?.gpuMemoryUsage??0)+(this.edgeView?.usedMemory??0)+this._materialRenderers.reduce(((e,r)=>e+r.usedMemory),0)+this._renderPlugins.usedMemory}get test(){const e=this;return{offscreen:this._offscreen,shadowMap:this._shadowMap,ssao:this._ssaoHelper,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,weatherIsFading:this._bindParameters.cloudsFade.isFading,resetRenderStateFeatures:()=>{e._renderStateFeatures=j(),this.renderPlugins.renderFeatureChanged(),this._requestRender()},getFramebufferTexture:r=>{switch(r){case pe.Color:return e._offscreen.colorTexture;case pe.LinearDepth:return e._bindParameters.linearDepth?.colorTexture;case pe.ShadowMap:return e._shadowMap.depthTexture;case pe.HudVisibility:return e._bindParameters.hudVisibility?.colorTexture}}}}};var _e,pe;e([p()],le.prototype,"_renderPlugins",void 0),e([p()],le.prototype,"_shadowAccumulator",void 0),e([p()],le.prototype,"_state",void 0),e([p()],le.prototype,"_renderStateFeatures",void 0),e([p()],le.prototype,"_ssaoEnabled",void 0),e([p({readOnly:!0})],le.prototype,"fullResolutionAtmosphere",null),e([p()],le.prototype,"_smaaPass",void 0),e([p({autoDestroy:!0})],le.prototype,"_edgeView",void 0),e([p()],le.prototype,"updating",null),e([p()],le.prototype,"isCameraFinal",null),le=e([m("esri.views.3d.webgl-engine.lib.Renderer")],le),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(_e||(_e={})),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.ShadowMap=2]="ShadowMap",e[e.HudVisibility=3]="HudVisibility"}(pe||(pe={}));const me=[0,0,0,0],ce=new h,ue=T(),fe=T(),ge=T();function Te(e){return r=>e.immediate.schedule(r)}export{pe as FramebufferId,le as Renderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{BufferViewVec4u8 as t}from"../../../../../geometry/support/buffer/BufferView.js";import{TextureSamplingMode as e,TextureWrapMode as i}from"../../../../webgl/enums.js";import{Texture as s}from"../../../../webgl/Texture.js";import{TextureDescriptor as r}from"../../../../webgl/TextureDescriptor.js";class h{constructor(h,a=1){this._rctx=h,this._fieldCount=a,this.textureWidth=4096,this._dirty=!0;const d=new r;d.samplingMode=e.NEAREST,d.wrapMode=i.CLAMP_TO_EDGE,d.width=this.textureWidth,d.height=1,this._texture=new s(this._rctx,d),this._data=new t(new ArrayBuffer(4*this.textureWidth))}dispose(){this._texture.dispose(),this._texture=void 0,this._data=void 0}setData(t,e,i,s,r,h){const a=t*this._fieldCount+e;this._dirty=!0,this._data.set(a,0,i),this._data.set(a,1,s),this._data.set(a,2,r),this._data.set(a,3,h)}setDataElement(t,e,i,s){const r=t*this._fieldCount+e;this._dirty=!0,this._data.set(r,i,s)}getDataElement(t,e,i){const s=t*this._fieldCount+e;return this._dirty=!0,this._data.get(s,i)}resizeToFit(e){const i=(e+1)*this._fieldCount;if(i>this._data.count){const e=Math.ceil(i/this.textureWidth)*this.textureWidth,s=new t(new ArrayBuffer(4*e));s.typedBuffer.set(this._data.typedBuffer),this._data=s}}updateTexture(){if(!this._dirty)return;const t=this._texture.descriptor.width,e=this._texture.descriptor.height;this._data.count>t*e&&this._texture.resize(t,this._data.count/t),this._texture.setData(this._data.typedBuffer),this._dirty=!1}get texture(){return this._texture}}export{h as TextureBackedBuffer};
5
+ import{BufferViewVec4u8 as t}from"../../../../../geometry/support/buffer/BufferView.js";import{TextureSamplingMode as e,TextureWrapMode as i}from"../../../../webgl/enums.js";import{Texture as s}from"../../../../webgl/Texture.js";import{TextureDescriptor as r}from"../../../../webgl/TextureDescriptor.js";class h{constructor(h,a=1){this._rctx=h,this._fieldCount=a,this.textureWidth=4096,this._dirty=!0;const d=new r(this.textureWidth,1);d.samplingMode=e.NEAREST,d.wrapMode=i.CLAMP_TO_EDGE,this._texture=new s(this._rctx,d),this._data=new t(new ArrayBuffer(4*this.textureWidth))}dispose(){this._texture.dispose(),this._texture=void 0,this._data=void 0}setData(t,e,i,s,r,h){const a=t*this._fieldCount+e;this._dirty=!0,this._data.set(a,0,i),this._data.set(a,1,s),this._data.set(a,2,r),this._data.set(a,3,h)}setDataElement(t,e,i,s){const r=t*this._fieldCount+e;this._dirty=!0,this._data.set(r,i,s)}getDataElement(t,e,i){const s=t*this._fieldCount+e;return this._dirty=!0,this._data.get(s,i)}resizeToFit(e){const i=(e+1)*this._fieldCount;if(i>this._data.count){const e=Math.ceil(i/this.textureWidth)*this.textureWidth,s=new t(new ArrayBuffer(4*e));s.typedBuffer.set(this._data.typedBuffer),this._data=s}}updateTexture(){if(!this._dirty)return;const t=this._texture.descriptor.width,e=this._texture.descriptor.height;this._data.count>t*e&&this._texture.resize(t,this._data.count/t),this._texture.setData(this._data.typedBuffer),this._dirty=!1}get texture(){return this._texture}}export{h as TextureBackedBuffer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{packFloatRGBA as t}from"../../../../../core/floatRGBA.js";import{disposeMaybe as e}from"../../../../../core/maybe.js";import{Texture as s}from"../../../../webgl/Texture.js";import{TextureDescriptor as r}from"../../../../webgl/TextureDescriptor.js";function n(e){const n=4,u=a.resolution,c=u/2,h=new Uint8Array(n*u*u),p=n*u*c,m=a.amplitude,f=2*m,d=n*u,S=Math.log2(u)+1,E=a.strokes.length;let g=(S-1)*E*d;for(const{distance:s,pressure:r}of a.strokes){let e=s,u=r,c=g;for(let s=0;s<S;s++){0!==s&&(e=o(e,i.DISTANCE),u=o(u,i.PRESSURE));for(let s=0;s<a.resolution;s++){const r=.5+(e?e[s%e.length]/f:0),o=u?u[s%u.length]:1;t(r,h,c),t(o,h,c+p),c+=n}c-=d*(E+1)}g+=d}const R=new r;R.width=R.height=u;const w=new s(e,R,h);return new l(u,f,m,E,w)}function o(t,e){if(!t)return null;const s=t.length/2,r=u*s,n=new Array(s);let o=0;const l=e===i.PRESSURE;for(let i=0;i<t.length;i+=2){const e=(t[i]+t[i+1])/2;n[o++]=l?Math.min(r,1-(1-e)*c):Math.min(r,e*c)}return n}var i;!function(t){t[t.DISTANCE=0]="DISTANCE",t[t.PRESSURE=1]="PRESSURE"}(i||(i={}));const u=.1,c=.5;class l{constructor(t,e,s,r,n){this.resolution=t,this.normalizationScale=e,this.amplitude=s,this.variants=r,this.texture=n}dispose(){this.texture=e(this.texture)}}const a={amplitude:8,resolution:256,strokes:[{distance:[-1.59027,-1.59426,-1.59674,-1.59766,-1.59702,-1.59479,-1.59095,-1.5855,-1.57843,-1.56973,-1.55942,-1.5475,-1.53398,-1.5189,-1.50226,-1.4841,-1.46446,-1.44337,-1.42088,-1.39703,-1.37188,-1.34547,-1.31786,-1.28912,-1.2593,-1.22847,-1.19668,-1.16402,-1.13053,-1.09629,-1.06137,-1.02582,-.98972,-.95313,-.91611,-.87872,-.84102,-.80306,-.76488,-.72654,-.68807,-.64952,-.61092,-.57232,-.53375,-.49527,-.45692,-.41874,-.38078,-.34309,-.3057,-.26867,-.23204,-.19585,-.16015,-.12497,-.09036,-.05634,-.02296,.00977,.04183,.07321,.10389,.13386,.16313,.19169,.21956,.24672,.27321,.299,.32413,.34858,.37237,.3955,.41798,.43981,.461,.48154,.50145,.52073,.53939,.55744,.57488,.5917,.6079,.62347,.63837,.65259,.66609,.67885,.69083,.70201,.71235,.72183,.73042,.73812,.7449,.75076,.7557,.75973,.76284,.76507,.76642,.76692,.76659,.76545,.76352,.76083,.7574,.75324,.74837,.74279,.73652,.72959,.72199,.71377,.70493,.69553,.68558,.67515,.66426,.65298,.64135,.62944,.6173,.60499,.59257,.58008,.56759,.55513,.54275,.5305,.51842,.50654,.4949,.48353,.47246,.4617,.45128,.44121,.43149,.42213,.41313,.40448,.39617,.38818,.3805,.37309,.36594,.35902,.35229,.34572,.33927,.33292,.32663,.32035,.31407,.30774,.30135,.29486,.28824,.28148,.27454,.26739,.26002,.25241,.24454,.23639,.22796,.21922,.21016,.20076,.19098,.18082,.17023,.1592,.14768,.13566,.1231,.10996,.09624,.08188,.06688,.05121,.03485,.01778,0,-.0185,-.03771,-.05763,-.07824,-.09952,-.12144,-.14396,-.16706,-.19069,-.21481,-.23938,-.26436,-.28971,-.31539,-.34136,-.36759,-.39404,-.42067,-.44746,-.47437,-.50136,-.52839,-.55544,-.58248,-.60948,-.63642,-.66329,-.6901,-.71684,-.74352,-.77015,-.79675,-.82332,-.84988,-.87644,-.90301,-.92958,-.95615,-.98272,-1.00926,-1.03575,-1.06217,-1.08847,-1.11463,-1.1406,-1.16633,-1.19178,-1.2169,-1.24164,-1.26595,-1.28979,-1.31312,-1.3359,-1.35809,-1.37963,-1.4005,-1.42064,-1.44,-1.45853,-1.47616,-1.49285,-1.50853,-1.52313,-1.53659,-1.54886,-1.55986,-1.56955,-1.57788,-1.5848],pressure:[-.01365,-.00206,.01025,.02327,.03696,.05129,.06619,.08163,.09755,.11393,.1307,.14784,.16531,.18308,.20111,.21938,.23786,.25651,.2753,.29419,.31315,.33215,.35115,.37015,.38913,.40806,.42694,.44576,.46449,.48313,.50167,.5201,.53839,.55653,.57448,.59222,.60971,.62692,.6438,.66033,.67648,.69221,.70753,.72242,.73688,.75093,.76456,.77779,.79063,.80309,.81517,.82686,.83817,.84911,.85967,.86987,.87972,.88924,.89845,.90734,.91594,.92425,.93229,.94005,.94754,.95475,.96166,.96826,.97451,.9804,.98588,.99092,.99549,.99957,.99685,.99381,.99131,.98936,.98796,.98711,.98681,.98706,.98787,.98923,.99113,.99357,.99654,1,.99607,.99171,.98695,.98181,.97634,.97057,.96452,.95824,.95175,.94506,.93818,.93113,.92389,.91647,.90887,.90109,.89314,.88501,.87672,.86831,.85978,.85119,.84256,.83393,.82533,.8168,.80836,.80002,.79181,.78374,.77582,.7681,.76059,.75331,.74629,.73955,.73311,.72697,.72116,.71568,.71054,.70572,.70121,.697,.69304,.68931,.68576,.68236,.67905,.67582,.67262,.66941,.66619,.66291,.65957,.65613,.65259,.64892,.6451,.6411,.6369,.63248,.62783,.62295,.61783,.61247,.60688,.60104,.59498,.58868,.58216,.57542,.56845,.56125,.5538,.5461,.53813,.52986,.52129,.51239,.50316,.49359,.4837,.47349,.46299,.45223,.44124,.43005,.41869,.40719,.39557,.38386,.37207,.36023,.34836,.33648,.32464,.31287,.30119,.28963,.27822,.26698,.25594,.2451,.23448,.22409,.21391,.20394,.19415,.18452,.17503,.16565,.15636,.14713,.13794,.1288,.11968,.11058,.10151,.09247,.08346,.07447,.06552,.05659,.0477,.03885,.03007,.02137,.01278,.00433,-.00393,-.012,-.01983,-.02738,-.03463,-.04155,-.0481,-.05429,-.0601,-.06553,-.07057,-.07524,-.07954,-.08347,-.08703,-.09022,-.09303,-.09544,-.09744,-.09898,-.10004,-.10059,-.1006,-.10005,-.09892,-.0972,-.09487,-.09192,-.08833,-.08409,-.07918,-.07357,-.06724,-.06019,-.0524,-.04386,-.03455,-.02448]},{distance:[-3.46259,-3.47131,-3.47668,-3.47863,-3.47712,-3.4721,-3.46352,-3.45138,-3.43566,-3.41635,-3.39347,-3.36704,-3.33709,-3.30368,-3.26684,-3.22667,-3.18322,-3.1366,-3.08689,-3.0342,-2.97865,-2.92036,-2.85946,-2.79607,-2.73034,-2.66241,-2.59242,-2.52052,-2.44686,-2.37159,-2.29485,-2.2168,-2.13757,-2.05731,-1.97616,-1.89426,-1.81174,-1.72875,-1.64543,-1.56191,-1.47833,-1.39483,-1.3115,-1.22847,-1.14581,-1.06361,-.98193,-.90083,-.82036,-.74054,-.66141,-.583,-.50532,-.4284,-.35228,-.277,-.20261,-.12916,-.05672,.01463,.08485,.15384,.22153,.28784,.35269,.41602,.47776,.53787,.59629,.653,.70799,.76123,.81274,.86253,.9106,.95698,1.0017,1.04477,1.0862,1.126,1.16415,1.20065,1.23546,1.26857,1.29994,1.32953,1.35731,1.38321,1.40719,1.42921,1.44922,1.46719,1.48309,1.49691,1.50862,1.51825,1.52581,1.53133,1.53486,1.53644,1.53616,1.53409,1.53031,1.52493,1.51803,1.50972,1.50009,1.48924,1.47725,1.46421,1.45019,1.43527,1.4195,1.40295,1.38568,1.36778,1.34929,1.3303,1.31087,1.29108,1.27099,1.25066,1.23018,1.2096,1.18898,1.16838,1.14785,1.12745,1.10721,1.08719,1.06741,1.04791,1.02871,1.00986,.99136,.97324,.95551,.93819,.92127,.90476,.88866,.87296,.85767,.84277,.82823,.81406,.80022,.7867,.77346,.76049,.74774,.73519,.72278,.71049,.69827,.68606,.67381,.66145,.64893,.63618,.62313,.60973,.5959,.5816,.56675,.5513,.53516,.51826,.50053,.4819,.46231,.44169,.42002,.39725,.37336,.34834,.32219,.2949,.2665,.23698,.20638,.17469,.14193,.10809,.07316,.03714,0,-.03827,-.07772,-.11836,-.16022,-.20332,-.24768,-.29332,-.34024,-.38844,-.43788,-.48854,-.54036,-.59329,-.64724,-.70211,-.75782,-.81425,-.87128,-.92881,-.98674,-1.04498,-1.10346,-1.1621,-1.22086,-1.27969,-1.33854,-1.3974,-1.45625,-1.51511,-1.57396,-1.63283,-1.69173,-1.75067,-1.80968,-1.86875,-1.9279,-1.98712,-2.04639,-2.10568,-2.16495,-2.22416,-2.28322,-2.34208,-2.40063,-2.4588,-2.51647,-2.57354,-2.62989,-2.68543,-2.74002,-2.79357,-2.84597,-2.89711,-2.94689,-2.99521,-3.04195,-3.087,-3.13023,-3.17152,-3.21075,-3.24779,-3.28252,-3.3148,-3.34451,-3.37154,-3.39577,-3.41709,-3.43539,-3.45059],pressure:[.87183,.87151,.87129,.87118,.87117,.87128,.87149,.87182,.87225,.8728,.87347,.87424,.87513,.87613,.87723,.87845,.87978,.88122,.88276,.88441,.88616,.88801,.88996,.892,.89414,.89637,.89868,.90108,.90356,.90611,.90874,.91144,.91421,.91704,.91993,.92287,.92587,.92892,.93201,.93514,.93831,.94151,.94474,.94799,.95126,.95456,.95786,.96118,.9645,.96783,.97116,.97448,.9778,.98111,.98441,.9877,.99096,.99421,.99742,.99938,.99622,.9931,.99001,.98697,.98397,.98101,.97811,.97526,.97246,.96972,.96703,.96441,.96185,.95935,.95691,.95455,.95225,.95002,.94786,.94577,.94376,.94182,.93995,.93817,.93646,.93483,.93328,.93181,.93042,.92911,.92788,.92673,.92566,.92467,.92376,.92293,.92217,.92149,.92088,.92034,.91987,.91947,.91913,.91886,.91864,.91849,.91838,.91833,.91834,.91839,.91849,.91863,.91883,.91907,.91935,.91968,.92005,.92046,.92092,.92142,.92195,.92253,.92314,.9238,.92449,.92521,.92598,.92677,.9276,.92847,.92936,.93029,.93125,.93224,.93325,.9343,.93537,.93646,.93758,.93872,.93988,.94106,.94225,.94346,.94469,.94593,.94718,.94844,.94971,.95098,.95226,.95354,.95482,.9561,.95738,.95867,.95995,.96122,.9625,.96377,.96504,.9663,.96757,.96883,.97009,.97135,.97261,.97387,.97513,.9764,.97767,.97895,.98023,.98153,.98284,.98416,.98549,.98684,.98821,.9896,.99101,.99244,.99389,.99537,.99688,.99842,1,.99839,.99675,.99508,.99336,.99161,.98982,.98799,.98613,.98422,.98228,.98029,.97827,.97622,.97414,.97202,.96987,.9677,.96551,.9633,.96107,.95882,.95656,.9543,.95202,.94975,.94747,.94519,.94292,.94065,.93838,.93613,.93388,.93164,.92941,.9272,.92499,.9228,.92062,.91846,.91631,.91418,.91207,.90998,.90792,.90588,.90387,.90189,.89995,.89804,.89617,.89434,.89256,.89083,.88914,.88752,.88595,.88443,.88299,.88161,.8803,.87907,.87791,.87683,.87584,.87494,.87412,.8734,.87278,.87225]},{distance:[.39335,.43437,.47737,.52234,.56923,.61801,.66864,.72109,.7753,.83123,.88882,.94801,1.00875,1.07097,1.13461,1.1996,1.26586,1.33333,1.40193,1.47158,1.54221,1.61373,1.68607,1.75913,1.83284,1.90711,1.98186,2.05699,2.13243,2.20809,2.28387,2.35971,2.4355,2.51117,2.58663,2.66179,2.73658,2.81092,2.88473,2.95792,3.03043,3.10217,3.17308,3.24309,3.31211,3.3801,3.44697,3.51267,3.57712,3.64028,3.70208,3.76247,3.8214,3.87881,3.93467,3.98892,4.04152,4.09244,4.14164,4.18908,4.23474,4.27859,4.32061,4.36077,4.39905,4.43544,4.46992,4.50249,4.53314,4.56185,4.58864,4.61349,4.63642,4.65745,4.67657,4.69381,4.7092,4.72274,4.73447,4.74441,4.75259,4.75903,4.76376,4.76682,4.76822,4.768,4.76618,4.76279,4.75786,4.75142,4.74348,4.73409,4.72326,4.71102,4.69739,4.68241,4.6661,4.64849,4.6296,4.60948,4.58816,4.56567,4.54204,4.51732,4.49154,4.46473,4.43694,4.4082,4.37854,4.348,4.31662,4.28443,4.25145,4.21773,4.1833,4.14819,4.11243,4.07606,4.03912,4.00162,3.96361,3.92512,3.88618,3.84683,3.80708,3.76697,3.72653,3.68579,3.64478,3.60351,3.56202,3.52033,3.47845,3.43642,3.39425,3.35196,3.30957,3.2671,3.22455,3.18196,3.13933,3.09668,3.05402,3.01136,2.96873,2.92613,2.88357,2.84108,2.79865,2.75631,2.71407,2.67195,2.62994,2.58807,2.54634,2.50477,2.46338,2.42216,2.38114,2.34032,2.29971,2.25933,2.21916,2.17923,2.13954,2.10008,2.06087,2.02189,1.98316,1.94468,1.90644,1.86845,1.83069,1.79316,1.75586,1.71877,1.68189,1.6452,1.60868,1.57232,1.53611,1.50004,1.46407,1.4282,1.39241,1.35668,1.321,1.28535,1.24972,1.2141,1.17849,1.14286,1.10723,1.07158,1.03593,1.00028,.96464,.92902,.89344,.85793,.8225,.78719,.75203,.71705,.68231,.64784,.61369,.57991,.54656,.51368,.48134,.44959,.41849,.3881,.35848,.32967,.30174,.27474,.24872,.22373,.19982,.17702,.15539,.13497,.11579,.09791,.08137,.06621,.05248,.04022,.02948,.02029,.01271,.00677,.00252,0,-76e-5,27e-5,.00314,.00788,.01451,.02307,.03357,.04604,.0605,.07697,.09546,.11599,.13858,.16322,.18992,.21869,.24952,.28241,.31735,.35434],pressure:[.95248,.95236,.95228,.95223,.95222,.95224,.95231,.95241,.95256,.95274,.95296,.95322,.95352,.95385,.95423,.95465,.9551,.9556,.95613,.9567,.95731,.95796,.95864,.95936,.96012,.96091,.96173,.96259,.96348,.9644,.96535,.96633,.96734,.96838,.96944,.97053,.97164,.97277,.97393,.9751,.97629,.9775,.97873,.97997,.98122,.98249,.98376,.98505,.98634,.98763,.98893,.99023,.99154,.99284,.99414,.99544,.99673,.99802,.9993,.99942,.99816,.99691,.99568,.99445,.99324,.99205,.99087,.98972,.98858,.98746,.98636,.98528,.98423,.9832,.98219,.98121,.98025,.97931,.9784,.97752,.97666,.97582,.97501,.97423,.97347,.97274,.97203,.97135,.9707,.97007,.96948,.9689,.96836,.96784,.96735,.96689,.96646,.96605,.96567,.96533,.965,.96471,.96445,.96421,.964,.96382,.96367,.96355,.96346,.96339,.96335,.96334,.96336,.9634,.96348,.96358,.9637,.96385,.96403,.96423,.96446,.96471,.96499,.96529,.96561,.96595,.96631,.96669,.96709,.96751,.96795,.9684,.96887,.96935,.96984,.97035,.97087,.9714,.97194,.97249,.97304,.97361,.97418,.97476,.97534,.97592,.97651,.97711,.9777,.9783,.9789,.9795,.9801,.9807,.9813,.9819,.9825,.98309,.98369,.98428,.98486,.98545,.98603,.98661,.98718,.98775,.98832,.98888,.98944,.99,.99056,.99112,.99167,.99223,.99279,.99335,.99392,.99449,.99507,.99565,.99624,.99684,.99745,.99807,.9987,.99934,1,.99933,.99866,.99797,.99727,.99656,.99583,.9951,.99435,.99359,.99283,.99205,.99126,.99046,.98966,.98885,.98803,.9872,.98637,.98554,.9847,.98387,.98303,.98219,.98134,.9805,.97967,.97883,.978,.97717,.97634,.97552,.97471,.97389,.97309,.97229,.9715,.97071,.96993,.96915,.96838,.96762,.96687,.96612,.96539,.96466,.96395,.96324,.96255,.96187,.9612,.96055,.95991,.95929,.95869,.95811,.95754,.957,.95648,.95599,.95552,.95508,.95467,.95428,.95393,.9536,.95331,.95305,.95283,.95264]},{distance:[2.85606,2.86149,2.86432,2.8645,2.862,2.85686,2.84912,2.83886,2.82618,2.81117,2.79393,2.77456,2.75314,2.72975,2.70447,2.67734,2.64844,2.61784,2.58564,2.55196,2.5169,2.48057,2.44305,2.40438,2.36462,2.32383,2.28208,2.23943,2.19591,2.15153,2.10628,2.06016,2.01321,1.96548,1.91702,1.86793,1.8183,1.76829,1.71803,1.66767,1.61737,1.56726,1.51746,1.46803,1.41902,1.37044,1.32228,1.27452,1.22716,1.18023,1.13376,1.08781,1.04244,.99769,.95357,.91003,.86701,.82447,.78238,.74069,.69938,.65836,.61758,.57699,.53656,.49627,.45611,.41611,.37632,.33683,.29776,.25924,.22141,.18441,.14839,.11346,.07972,.04727,.01619,-.01348,-.0417,-.0684,-.09351,-.11698,-.13875,-.1588,-.17713,-.19381,-.20889,-.22242,-.23444,-.24501,-.25421,-.26216,-.26897,-.27473,-.27951,-.28336,-.28631,-.28836,-.28948,-.28963,-.28873,-.28673,-.28355,-.27916,-.27354,-.26673,-.25878,-.2498,-.23992,-.22929,-.21802,-.20623,-.19398,-.18134,-.16836,-.1551,-.14163,-.12809,-.11461,-.1013,-.08826,-.07557,-.06335,-.0517,-.04077,-.03065,-.02143,-.01321,-.00606,0,.00496,.00888,.01181,.01385,.01511,.0157,.01574,.01533,.01458,.01358,.0124,.01112,.00979,.00851,.00738,.0065,.006,.00596,.00646,.00754,.00924,.01161,.01471,.01858,.02323,.02865,.03481,.04169,.0493,.05765,.06677,.07671,.08754,.09934,.11222,.12628,.14159,.15823,.17624,.19561,.21632,.23828,.26142,.28563,.31083,.33696,.36397,.39185,.42057,.4501,.48036,.51125,.54264,.5744,.60646,.63871,.67105,.70337,.73556,.76751,.79918,.83048,.86139,.8919,.92202,.95184,.98144,1.01094,1.04045,1.0701,1.10002,1.13029,1.16103,1.1923,1.22416,1.25664,1.28979,1.32364,1.35824,1.39363,1.42985,1.4669,1.50475,1.54332,1.58252,1.62227,1.6625,1.70312,1.744,1.78501,1.82598,1.8668,1.90734,1.94754,1.98732,2.02666,2.06555,2.10402,2.1421,2.17985,2.2173,2.25448,2.29139,2.328,2.36424,2.4,2.43515,2.46955,2.50309,2.53565,2.56717,2.59761,2.62692,2.65505,2.68191,2.7074,2.73138,2.75375,2.7744,2.79324,2.81017,2.82504,2.83772,2.8481],pressure:[.22758,.23641,.24578,.25568,.26609,.27699,.28835,.30016,.31237,.32495,.33789,.35113,.36466,.37843,.39241,.40658,.4209,.43535,.44989,.4645,.47916,.49385,.50853,.5232,.53784,.55243,.56696,.58141,.59578,.61004,.62419,.63821,.65209,.6658,.67934,.69268,.70582,.71873,.73139,.7438,.75594,.76779,.77935,.79061,.80156,.81221,.82254,.83258,.84231,.85176,.86091,.86978,.87837,.88669,.89473,.9025,.91,.91725,.92425,.931,.93752,.9438,.94985,.95566,.96124,.96658,.97168,.97652,.98109,.98539,.98939,.99309,.99646,.99949,.99783,.99552,.99361,.99209,.99098,.99029,.99003,.99019,.99079,.99181,.99324,.9951,.99735,1,.99698,.99361,.98992,.98592,.98163,.97709,.97231,.96731,.96212,.95676,.95122,.94554,.93973,.93378,.92773,.92157,.91532,.90899,.90258,.89612,.88961,.88308,.87653,.87,.8635,.85705,.85068,.8444,.83823,.83219,.82628,.82052,.81493,.80952,.8043,.79929,.7945,.78994,.78561,.78151,.77765,.77402,.77062,.76742,.76443,.76161,.75896,.75645,.75406,.75175,.74951,.7473,.74511,.74289,.74064,.73833,.73592,.73341,.73078,.728,.72507,.72197,.71869,.71522,.71156,.70769,.70363,.69936,.69489,.69021,.68533,.68023,.67492,.66939,.66363,.65765,.65145,.64501,.63833,.63143,.62428,.61691,.60931,.60148,.59344,.58521,.57679,.5682,.55948,.55063,.54167,.53264,.52354,.51439,.50522,.49603,.48686,.47773,.46865,.45964,.45072,.44192,.43324,.42469,.41629,.40804,.39994,.392,.3842,.37655,.36903,.36164,.35437,.3472,.34012,.33312,.3262,.31933,.31251,.30574,.299,.2923,.28563,.27899,.27239,.26583,.25933,.25288,.24652,.24025,.2341,.22808,.22221,.21653,.21104,.20576,.20072,.19592,.19138,.18712,.18313,.17943,.17602,.17292,.17013,.16766,.16551,.16369,.16222,.1611,.16036,.16001,.16007,.16055,.16148,.16286,.16471,.16705,.16988,.17321,.17706,.18144,.18636,.19182,.19785,.20443,.21158,.2193]},{distance:[-2.31317,-2.3191,-2.32189,-2.32154,-2.31811,-2.31174,-2.30254,-2.29062,-2.27609,-2.25904,-2.23954,-2.21767,-2.19355,-2.16732,-2.13907,-2.10885,-2.07672,-2.04268,-2.00677,-1.96911,-1.92985,-1.88914,-1.84713,-1.80397,-1.75979,-1.71467,-1.66864,-1.62171,-1.57395,-1.52546,-1.47625,-1.42628,-1.3755,-1.32384,-1.27131,-1.218,-1.16408,-1.10972,-1.05508,-1.00031,-.94551,-.89077,-.83615,-.7817,-.72757,-.6739,-.62076,-.56821,-.51625,-.46484,-.41397,-.36366,-.314,-.26506,-.21689,-.16957,-.12316,-.07766,-.03301,.01085,.05399,.09643,.13827,.17967,.22079,.26176,.30265,.34342,.38397,.42414,.46381,.50285,.54115,.57863,.61524,.65093,.6856,.71914,.75153,.78275,.81283,.84182,.86972,.89651,.92208,.94634,.96919,.99052,1.01025,1.02835,1.04484,1.05976,1.07309,1.08479,1.09492,1.1036,1.11096,1.11714,1.12224,1.12627,1.12916,1.13083,1.13125,1.13036,1.12816,1.12466,1.11992,1.11397,1.10677,1.09827,1.08849,1.07746,1.06527,1.05203,1.03786,1.02283,1.00695,.99025,.97279,.9546,.93573,.9163,.8965,.8765,.85647,.83652,.81687,.79775,.77939,.76199,.74568,.73049,.71635,.70316,.69082,.67925,.66834,.65804,.64831,.63911,.63032,.62184,.61363,.60564,.59788,.59036,.58308,.57597,.5689,.56177,.55447,.5469,.53896,.53062,.5219,.51283,.5034,.49355,.48335,.47287,.46223,.45154,.44085,.43012,.41923,.40805,.39648,.38441,.37176,.35849,.34458,.32999,.31461,.29833,.28109,.26288,.2437,.22361,.20265,.18082,.15807,.13434,.1096,.0838,.0569,.02894,0,-.0298,-.0604,-.09173,-.12364,-.15594,-.18843,-.22092,-.25331,-.28559,-.31781,-.35006,-.38244,-.41502,-.44785,-.48098,-.5144,-.54811,-.58218,-.61666,-.65153,-.68677,-.72232,-.75807,-.79397,-.83002,-.86628,-.90281,-.93968,-.97693,-1.01465,-1.05282,-1.09139,-1.13031,-1.16956,-1.20917,-1.24905,-1.28907,-1.32908,-1.36891,-1.40844,-1.44765,-1.48658,-1.52527,-1.56376,-1.60206,-1.64016,-1.67801,-1.71552,-1.75264,-1.78936,-1.8257,-1.86161,-1.89702,-1.93182,-1.96584,-1.99894,-2.03102,-2.06203,-2.0919,-2.12056,-2.14794,-2.17397,-2.19852,-2.22138,-2.24235,-2.26129,-2.27805,-2.29243,-2.30422],pressure:[.9681,.97424,.98046,.98674,.99309,.9995,.99404,.98754,.981,.97444,.96785,.96124,.95462,.94801,.94139,.93479,.92822,.92167,.91515,.90868,.90225,.89589,.88959,.88336,.87722,.87115,.86519,.85932,.85356,.84792,.84239,.83699,.83173,.8266,.82162,.81679,.81211,.80759,.80324,.79906,.79505,.79121,.78756,.78409,.78081,.77771,.77481,.77211,.76959,.76728,.76516,.76324,.76153,.76001,.75869,.75757,.75665,.75593,.7554,.75507,.75493,.75498,.75523,.75565,.75627,.75706,.75803,.75917,.76049,.76197,.76361,.76541,.76737,.76947,.77172,.77409,.7766,.77923,.78198,.78484,.7878,.79086,.79401,.79724,.80055,.80394,.8074,.81092,.8145,.81813,.82182,.82556,.82934,.83317,.83703,.84093,.84487,.84884,.85284,.85687,.86094,.86503,.86915,.87329,.87746,.88166,.88587,.89011,.89436,.89863,.90291,.9072,.91149,.91579,.92009,.92438,.92867,.93295,.9372,.94144,.94566,.94985,.954,.95812,.96219,.96623,.97021,.97415,.97802,.98184,.9856,.9893,.99293,.9965,1,.99657,.9932,.98991,.98668,.98352,.98042,.97738,.9744,.97148,.9686,.96577,.96298,.96023,.95751,.95482,.95214,.94949,.94684,.9442,.94156,.93892,.93627,.93361,.93094,.92825,.92555,.92284,.9201,.91735,.91458,.91179,.90899,.90616,.90332,.90047,.8976,.89472,.89183,.88893,.88603,.88314,.88024,.87735,.87448,.87162,.86878,.86597,.86319,.86044,.85774,.85508,.85247,.84993,.84744,.84503,.84269,.84042,.83825,.83616,.83417,.83227,.83048,.8288,.82724,.82578,.82445,.82324,.82215,.82119,.82037,.81967,.81911,.81868,.81839,.81824,.81823,.81835,.81862,.81903,.81957,.82026,.82109,.82206,.82317,.82443,.82583,.82737,.82906,.83089,.83287,.83499,.83726,.83968,.84223,.84494,.84778,.85077,.8539,.85717,.86058,.86412,.86781,.87163,.87559,.87968,.88391,.88826,.89275,.89737,.90211,.90698,.91198,.91709,.92233,.92768,.93315,.93873,.94441,.95019,.95607,.96205]},{distance:[4.72925,4.81721,4.9037,4.98859,5.07177,5.15311,5.23249,5.3098,5.38491,5.45772,5.52811,5.59598,5.66122,5.72375,5.78346,5.84028,5.8941,5.94486,5.99248,6.03689,6.07803,6.11584,6.15028,6.18128,6.20882,6.23285,6.25336,6.27031,6.28369,6.29348,6.29969,6.3023,6.30133,6.29678,6.28867,6.27703,6.26187,6.24324,6.22116,6.19567,6.16683,6.13468,6.09928,6.06068,6.01896,5.97417,5.92639,5.87569,5.82217,5.76589,5.70696,5.64545,5.58147,5.5151,5.44644,5.37559,5.30265,5.2277,5.15085,5.0722,4.99184,4.90987,4.82639,4.74151,4.65533,4.56794,4.47945,4.38996,4.29959,4.20843,4.11658,4.02416,3.93125,3.83796,3.74437,3.65057,3.55666,3.46272,3.36884,3.27509,3.18155,3.08831,2.99545,2.90303,2.81114,2.71984,2.62922,2.53933,2.45026,2.36207,2.27484,2.18862,2.10349,2.01951,1.93675,1.85528,1.77515,1.69644,1.61919,1.54348,1.46935,1.39685,1.32605,1.25698,1.18967,1.12417,1.06049,.99863,.93862,.88044,.82408,.76953,.71676,.66574,.61644,.56882,.52282,.47841,.43553,.39413,.35414,.31551,.27817,.24206,.20712,.17328,.14048,.10866,.07776,.04772,.01848,-.00999,-.03776,-.06487,-.09134,-.11721,-.14251,-.16725,-.19144,-.21509,-.2382,-.26076,-.28275,-.30416,-.32496,-.34511,-.36459,-.38334,-.40134,-.41852,-.43485,-.45026,-.46471,-.47815,-.49052,-.50179,-.51189,-.52081,-.52849,-.5349,-.54003,-.54383,-.54627,-.54734,-.54702,-.54528,-.54211,-.53752,-.53149,-.52403,-.51515,-.50487,-.4932,-.48015,-.46575,-.45001,-.43297,-.41463,-.39503,-.37419,-.35213,-.32887,-.30443,-.27885,-.25214,-.22432,-.19541,-.16544,-.13442,-.10235,-.06926,-.03514,0,.03616,.07336,.11159,.15088,.19125,.23272,.27531,.31906,.36401,.41019,.45764,.5064,.55651,.60802,.66096,.71538,.77129,.82874,.88776,.94836,1.01056,1.07438,1.13982,1.20687,1.27554,1.34581,1.41766,1.49107,1.56599,1.64239,1.72025,1.79951,1.88013,1.96209,2.04532,2.12979,2.21546,2.30226,2.39017,2.47911,2.56905,2.65991,2.75164,2.84416,2.93742,3.03133,3.12582,3.2208,3.31619,3.41191,3.50785,3.60393,3.70006,3.79612,3.89202,3.98765,4.08291,4.17767,4.27182,4.36525,4.45783,4.54944,4.63995],pressure:[.30942,.30838,.30765,.30724,.30715,.30738,.30795,.30884,.31007,.31164,.31354,.31578,.31837,.32129,.32455,.32815,.33209,.33636,.34097,.34591,.35117,.35675,.36265,.36887,.37539,.38221,.38933,.39674,.40442,.41238,.4206,.42907,.43779,.44675,.45593,.46533,.47493,.48473,.49471,.50486,.51517,.52563,.53623,.54694,.55777,.5687,.57971,.59079,.60194,.61313,.62435,.6356,.64686,.65811,.66935,.68056,.69174,.70286,.71391,.72489,.73579,.74659,.75728,.76785,.7783,.7886,.79876,.80877,.81861,.82827,.83776,.84706,.85617,.86507,.87378,.88227,.89056,.89863,.90649,.91412,.92153,.92872,.93568,.94241,.94892,.95519,.96122,.96702,.97258,.97791,.98299,.98783,.99242,.99677,.99911,.99525,.99164,.98827,.98515,.98228,.97966,.97728,.97514,.97324,.97159,.97017,.96898,.96801,.96727,.96674,.96641,.96629,.96635,.96661,.96703,.96762,.96838,.96928,.97032,.97149,.97279,.9742,.97572,.97734,.97905,.98085,.98273,.98468,.98669,.98877,.99091,.99311,.99535,.99765,1,.9976,.99516,.99267,.99014,.98755,.98491,.98222,.97947,.97666,.97378,.97083,.96781,.96471,.96153,.95826,.9549,.95144,.94787,.9442,.94042,.93651,.93249,.92834,.92407,.91966,.91512,.91045,.90564,.90069,.8956,.89037,.885,.87949,.87384,.86806,.86214,.85608,.84988,.84356,.83711,.83053,.82383,.81702,.81009,.80306,.79594,.78872,.78141,.77403,.76657,.75905,.75148,.74385,.73619,.72849,.72076,.71302,.70526,.69749,.68972,.68195,.67419,.66644,.65871,.65099,.64329,.63561,.62795,.62032,.61271,.60512,.59755,.59001,.58248,.57497,.56749,.56002,.55256,.54512,.5377,.5303,.52291,.51554,.50819,.50087,.49358,.48632,.4791,.47192,.4648,.45773,.45072,.44378,.43692,.43015,.42346,.41687,.41039,.40403,.39779,.39168,.38571,.37989,.37423,.36873,.36342,.35828,.35335,.34862,.34409,.3398,.33573,.3319,.32831,.32498,.32192,.31912,.3166,.31436,.31242,.31077]}]};export{l as StrokesTexture,n as generateStrokesTexture,a as strokesDefinition};
5
+ import{packFloatRGBA as t}from"../../../../../core/floatRGBA.js";import{disposeMaybe as e}from"../../../../../core/maybe.js";import{Texture as r}from"../../../../webgl/Texture.js";import{TextureDescriptor as s}from"../../../../webgl/TextureDescriptor.js";function n(e){const n=4,u=a.resolution,l=u/2,p=new Uint8Array(n*u*u),h=n*u*l,m=a.amplitude,f=2*m,S=n*u,d=Math.log2(u)+1,E=a.strokes.length;let R=(d-1)*E*S;for(const{distance:r,pressure:s}of a.strokes){let e=r,u=s,l=R;for(let r=0;r<d;r++){0!==r&&(e=o(e,i.DISTANCE),u=o(u,i.PRESSURE));for(let r=0;r<a.resolution;r++){const s=.5+(e?e[r%e.length]/f:0),o=u?u[r%u.length]:1;t(s,p,l),t(o,p,l+h),l+=n}l-=S*(E+1)}R+=S}const g=new r(e,new s(u),p);return new c(u,f,m,E,g)}function o(t,e){if(!t)return null;const r=t.length/2,s=u*r,n=new Array(r);let o=0;const c=e===i.PRESSURE;for(let i=0;i<t.length;i+=2){const e=(t[i]+t[i+1])/2;n[o++]=c?Math.min(s,1-(1-e)*l):Math.min(s,e*l)}return n}var i;!function(t){t[t.DISTANCE=0]="DISTANCE",t[t.PRESSURE=1]="PRESSURE"}(i||(i={}));const u=.1,l=.5;class c{constructor(t,e,r,s,n){this.resolution=t,this.normalizationScale=e,this.amplitude=r,this.variants=s,this.texture=n}dispose(){this.texture=e(this.texture)}}const a={amplitude:8,resolution:256,strokes:[{distance:[-1.59027,-1.59426,-1.59674,-1.59766,-1.59702,-1.59479,-1.59095,-1.5855,-1.57843,-1.56973,-1.55942,-1.5475,-1.53398,-1.5189,-1.50226,-1.4841,-1.46446,-1.44337,-1.42088,-1.39703,-1.37188,-1.34547,-1.31786,-1.28912,-1.2593,-1.22847,-1.19668,-1.16402,-1.13053,-1.09629,-1.06137,-1.02582,-.98972,-.95313,-.91611,-.87872,-.84102,-.80306,-.76488,-.72654,-.68807,-.64952,-.61092,-.57232,-.53375,-.49527,-.45692,-.41874,-.38078,-.34309,-.3057,-.26867,-.23204,-.19585,-.16015,-.12497,-.09036,-.05634,-.02296,.00977,.04183,.07321,.10389,.13386,.16313,.19169,.21956,.24672,.27321,.299,.32413,.34858,.37237,.3955,.41798,.43981,.461,.48154,.50145,.52073,.53939,.55744,.57488,.5917,.6079,.62347,.63837,.65259,.66609,.67885,.69083,.70201,.71235,.72183,.73042,.73812,.7449,.75076,.7557,.75973,.76284,.76507,.76642,.76692,.76659,.76545,.76352,.76083,.7574,.75324,.74837,.74279,.73652,.72959,.72199,.71377,.70493,.69553,.68558,.67515,.66426,.65298,.64135,.62944,.6173,.60499,.59257,.58008,.56759,.55513,.54275,.5305,.51842,.50654,.4949,.48353,.47246,.4617,.45128,.44121,.43149,.42213,.41313,.40448,.39617,.38818,.3805,.37309,.36594,.35902,.35229,.34572,.33927,.33292,.32663,.32035,.31407,.30774,.30135,.29486,.28824,.28148,.27454,.26739,.26002,.25241,.24454,.23639,.22796,.21922,.21016,.20076,.19098,.18082,.17023,.1592,.14768,.13566,.1231,.10996,.09624,.08188,.06688,.05121,.03485,.01778,0,-.0185,-.03771,-.05763,-.07824,-.09952,-.12144,-.14396,-.16706,-.19069,-.21481,-.23938,-.26436,-.28971,-.31539,-.34136,-.36759,-.39404,-.42067,-.44746,-.47437,-.50136,-.52839,-.55544,-.58248,-.60948,-.63642,-.66329,-.6901,-.71684,-.74352,-.77015,-.79675,-.82332,-.84988,-.87644,-.90301,-.92958,-.95615,-.98272,-1.00926,-1.03575,-1.06217,-1.08847,-1.11463,-1.1406,-1.16633,-1.19178,-1.2169,-1.24164,-1.26595,-1.28979,-1.31312,-1.3359,-1.35809,-1.37963,-1.4005,-1.42064,-1.44,-1.45853,-1.47616,-1.49285,-1.50853,-1.52313,-1.53659,-1.54886,-1.55986,-1.56955,-1.57788,-1.5848],pressure:[-.01365,-.00206,.01025,.02327,.03696,.05129,.06619,.08163,.09755,.11393,.1307,.14784,.16531,.18308,.20111,.21938,.23786,.25651,.2753,.29419,.31315,.33215,.35115,.37015,.38913,.40806,.42694,.44576,.46449,.48313,.50167,.5201,.53839,.55653,.57448,.59222,.60971,.62692,.6438,.66033,.67648,.69221,.70753,.72242,.73688,.75093,.76456,.77779,.79063,.80309,.81517,.82686,.83817,.84911,.85967,.86987,.87972,.88924,.89845,.90734,.91594,.92425,.93229,.94005,.94754,.95475,.96166,.96826,.97451,.9804,.98588,.99092,.99549,.99957,.99685,.99381,.99131,.98936,.98796,.98711,.98681,.98706,.98787,.98923,.99113,.99357,.99654,1,.99607,.99171,.98695,.98181,.97634,.97057,.96452,.95824,.95175,.94506,.93818,.93113,.92389,.91647,.90887,.90109,.89314,.88501,.87672,.86831,.85978,.85119,.84256,.83393,.82533,.8168,.80836,.80002,.79181,.78374,.77582,.7681,.76059,.75331,.74629,.73955,.73311,.72697,.72116,.71568,.71054,.70572,.70121,.697,.69304,.68931,.68576,.68236,.67905,.67582,.67262,.66941,.66619,.66291,.65957,.65613,.65259,.64892,.6451,.6411,.6369,.63248,.62783,.62295,.61783,.61247,.60688,.60104,.59498,.58868,.58216,.57542,.56845,.56125,.5538,.5461,.53813,.52986,.52129,.51239,.50316,.49359,.4837,.47349,.46299,.45223,.44124,.43005,.41869,.40719,.39557,.38386,.37207,.36023,.34836,.33648,.32464,.31287,.30119,.28963,.27822,.26698,.25594,.2451,.23448,.22409,.21391,.20394,.19415,.18452,.17503,.16565,.15636,.14713,.13794,.1288,.11968,.11058,.10151,.09247,.08346,.07447,.06552,.05659,.0477,.03885,.03007,.02137,.01278,.00433,-.00393,-.012,-.01983,-.02738,-.03463,-.04155,-.0481,-.05429,-.0601,-.06553,-.07057,-.07524,-.07954,-.08347,-.08703,-.09022,-.09303,-.09544,-.09744,-.09898,-.10004,-.10059,-.1006,-.10005,-.09892,-.0972,-.09487,-.09192,-.08833,-.08409,-.07918,-.07357,-.06724,-.06019,-.0524,-.04386,-.03455,-.02448]},{distance:[-3.46259,-3.47131,-3.47668,-3.47863,-3.47712,-3.4721,-3.46352,-3.45138,-3.43566,-3.41635,-3.39347,-3.36704,-3.33709,-3.30368,-3.26684,-3.22667,-3.18322,-3.1366,-3.08689,-3.0342,-2.97865,-2.92036,-2.85946,-2.79607,-2.73034,-2.66241,-2.59242,-2.52052,-2.44686,-2.37159,-2.29485,-2.2168,-2.13757,-2.05731,-1.97616,-1.89426,-1.81174,-1.72875,-1.64543,-1.56191,-1.47833,-1.39483,-1.3115,-1.22847,-1.14581,-1.06361,-.98193,-.90083,-.82036,-.74054,-.66141,-.583,-.50532,-.4284,-.35228,-.277,-.20261,-.12916,-.05672,.01463,.08485,.15384,.22153,.28784,.35269,.41602,.47776,.53787,.59629,.653,.70799,.76123,.81274,.86253,.9106,.95698,1.0017,1.04477,1.0862,1.126,1.16415,1.20065,1.23546,1.26857,1.29994,1.32953,1.35731,1.38321,1.40719,1.42921,1.44922,1.46719,1.48309,1.49691,1.50862,1.51825,1.52581,1.53133,1.53486,1.53644,1.53616,1.53409,1.53031,1.52493,1.51803,1.50972,1.50009,1.48924,1.47725,1.46421,1.45019,1.43527,1.4195,1.40295,1.38568,1.36778,1.34929,1.3303,1.31087,1.29108,1.27099,1.25066,1.23018,1.2096,1.18898,1.16838,1.14785,1.12745,1.10721,1.08719,1.06741,1.04791,1.02871,1.00986,.99136,.97324,.95551,.93819,.92127,.90476,.88866,.87296,.85767,.84277,.82823,.81406,.80022,.7867,.77346,.76049,.74774,.73519,.72278,.71049,.69827,.68606,.67381,.66145,.64893,.63618,.62313,.60973,.5959,.5816,.56675,.5513,.53516,.51826,.50053,.4819,.46231,.44169,.42002,.39725,.37336,.34834,.32219,.2949,.2665,.23698,.20638,.17469,.14193,.10809,.07316,.03714,0,-.03827,-.07772,-.11836,-.16022,-.20332,-.24768,-.29332,-.34024,-.38844,-.43788,-.48854,-.54036,-.59329,-.64724,-.70211,-.75782,-.81425,-.87128,-.92881,-.98674,-1.04498,-1.10346,-1.1621,-1.22086,-1.27969,-1.33854,-1.3974,-1.45625,-1.51511,-1.57396,-1.63283,-1.69173,-1.75067,-1.80968,-1.86875,-1.9279,-1.98712,-2.04639,-2.10568,-2.16495,-2.22416,-2.28322,-2.34208,-2.40063,-2.4588,-2.51647,-2.57354,-2.62989,-2.68543,-2.74002,-2.79357,-2.84597,-2.89711,-2.94689,-2.99521,-3.04195,-3.087,-3.13023,-3.17152,-3.21075,-3.24779,-3.28252,-3.3148,-3.34451,-3.37154,-3.39577,-3.41709,-3.43539,-3.45059],pressure:[.87183,.87151,.87129,.87118,.87117,.87128,.87149,.87182,.87225,.8728,.87347,.87424,.87513,.87613,.87723,.87845,.87978,.88122,.88276,.88441,.88616,.88801,.88996,.892,.89414,.89637,.89868,.90108,.90356,.90611,.90874,.91144,.91421,.91704,.91993,.92287,.92587,.92892,.93201,.93514,.93831,.94151,.94474,.94799,.95126,.95456,.95786,.96118,.9645,.96783,.97116,.97448,.9778,.98111,.98441,.9877,.99096,.99421,.99742,.99938,.99622,.9931,.99001,.98697,.98397,.98101,.97811,.97526,.97246,.96972,.96703,.96441,.96185,.95935,.95691,.95455,.95225,.95002,.94786,.94577,.94376,.94182,.93995,.93817,.93646,.93483,.93328,.93181,.93042,.92911,.92788,.92673,.92566,.92467,.92376,.92293,.92217,.92149,.92088,.92034,.91987,.91947,.91913,.91886,.91864,.91849,.91838,.91833,.91834,.91839,.91849,.91863,.91883,.91907,.91935,.91968,.92005,.92046,.92092,.92142,.92195,.92253,.92314,.9238,.92449,.92521,.92598,.92677,.9276,.92847,.92936,.93029,.93125,.93224,.93325,.9343,.93537,.93646,.93758,.93872,.93988,.94106,.94225,.94346,.94469,.94593,.94718,.94844,.94971,.95098,.95226,.95354,.95482,.9561,.95738,.95867,.95995,.96122,.9625,.96377,.96504,.9663,.96757,.96883,.97009,.97135,.97261,.97387,.97513,.9764,.97767,.97895,.98023,.98153,.98284,.98416,.98549,.98684,.98821,.9896,.99101,.99244,.99389,.99537,.99688,.99842,1,.99839,.99675,.99508,.99336,.99161,.98982,.98799,.98613,.98422,.98228,.98029,.97827,.97622,.97414,.97202,.96987,.9677,.96551,.9633,.96107,.95882,.95656,.9543,.95202,.94975,.94747,.94519,.94292,.94065,.93838,.93613,.93388,.93164,.92941,.9272,.92499,.9228,.92062,.91846,.91631,.91418,.91207,.90998,.90792,.90588,.90387,.90189,.89995,.89804,.89617,.89434,.89256,.89083,.88914,.88752,.88595,.88443,.88299,.88161,.8803,.87907,.87791,.87683,.87584,.87494,.87412,.8734,.87278,.87225]},{distance:[.39335,.43437,.47737,.52234,.56923,.61801,.66864,.72109,.7753,.83123,.88882,.94801,1.00875,1.07097,1.13461,1.1996,1.26586,1.33333,1.40193,1.47158,1.54221,1.61373,1.68607,1.75913,1.83284,1.90711,1.98186,2.05699,2.13243,2.20809,2.28387,2.35971,2.4355,2.51117,2.58663,2.66179,2.73658,2.81092,2.88473,2.95792,3.03043,3.10217,3.17308,3.24309,3.31211,3.3801,3.44697,3.51267,3.57712,3.64028,3.70208,3.76247,3.8214,3.87881,3.93467,3.98892,4.04152,4.09244,4.14164,4.18908,4.23474,4.27859,4.32061,4.36077,4.39905,4.43544,4.46992,4.50249,4.53314,4.56185,4.58864,4.61349,4.63642,4.65745,4.67657,4.69381,4.7092,4.72274,4.73447,4.74441,4.75259,4.75903,4.76376,4.76682,4.76822,4.768,4.76618,4.76279,4.75786,4.75142,4.74348,4.73409,4.72326,4.71102,4.69739,4.68241,4.6661,4.64849,4.6296,4.60948,4.58816,4.56567,4.54204,4.51732,4.49154,4.46473,4.43694,4.4082,4.37854,4.348,4.31662,4.28443,4.25145,4.21773,4.1833,4.14819,4.11243,4.07606,4.03912,4.00162,3.96361,3.92512,3.88618,3.84683,3.80708,3.76697,3.72653,3.68579,3.64478,3.60351,3.56202,3.52033,3.47845,3.43642,3.39425,3.35196,3.30957,3.2671,3.22455,3.18196,3.13933,3.09668,3.05402,3.01136,2.96873,2.92613,2.88357,2.84108,2.79865,2.75631,2.71407,2.67195,2.62994,2.58807,2.54634,2.50477,2.46338,2.42216,2.38114,2.34032,2.29971,2.25933,2.21916,2.17923,2.13954,2.10008,2.06087,2.02189,1.98316,1.94468,1.90644,1.86845,1.83069,1.79316,1.75586,1.71877,1.68189,1.6452,1.60868,1.57232,1.53611,1.50004,1.46407,1.4282,1.39241,1.35668,1.321,1.28535,1.24972,1.2141,1.17849,1.14286,1.10723,1.07158,1.03593,1.00028,.96464,.92902,.89344,.85793,.8225,.78719,.75203,.71705,.68231,.64784,.61369,.57991,.54656,.51368,.48134,.44959,.41849,.3881,.35848,.32967,.30174,.27474,.24872,.22373,.19982,.17702,.15539,.13497,.11579,.09791,.08137,.06621,.05248,.04022,.02948,.02029,.01271,.00677,.00252,0,-76e-5,27e-5,.00314,.00788,.01451,.02307,.03357,.04604,.0605,.07697,.09546,.11599,.13858,.16322,.18992,.21869,.24952,.28241,.31735,.35434],pressure:[.95248,.95236,.95228,.95223,.95222,.95224,.95231,.95241,.95256,.95274,.95296,.95322,.95352,.95385,.95423,.95465,.9551,.9556,.95613,.9567,.95731,.95796,.95864,.95936,.96012,.96091,.96173,.96259,.96348,.9644,.96535,.96633,.96734,.96838,.96944,.97053,.97164,.97277,.97393,.9751,.97629,.9775,.97873,.97997,.98122,.98249,.98376,.98505,.98634,.98763,.98893,.99023,.99154,.99284,.99414,.99544,.99673,.99802,.9993,.99942,.99816,.99691,.99568,.99445,.99324,.99205,.99087,.98972,.98858,.98746,.98636,.98528,.98423,.9832,.98219,.98121,.98025,.97931,.9784,.97752,.97666,.97582,.97501,.97423,.97347,.97274,.97203,.97135,.9707,.97007,.96948,.9689,.96836,.96784,.96735,.96689,.96646,.96605,.96567,.96533,.965,.96471,.96445,.96421,.964,.96382,.96367,.96355,.96346,.96339,.96335,.96334,.96336,.9634,.96348,.96358,.9637,.96385,.96403,.96423,.96446,.96471,.96499,.96529,.96561,.96595,.96631,.96669,.96709,.96751,.96795,.9684,.96887,.96935,.96984,.97035,.97087,.9714,.97194,.97249,.97304,.97361,.97418,.97476,.97534,.97592,.97651,.97711,.9777,.9783,.9789,.9795,.9801,.9807,.9813,.9819,.9825,.98309,.98369,.98428,.98486,.98545,.98603,.98661,.98718,.98775,.98832,.98888,.98944,.99,.99056,.99112,.99167,.99223,.99279,.99335,.99392,.99449,.99507,.99565,.99624,.99684,.99745,.99807,.9987,.99934,1,.99933,.99866,.99797,.99727,.99656,.99583,.9951,.99435,.99359,.99283,.99205,.99126,.99046,.98966,.98885,.98803,.9872,.98637,.98554,.9847,.98387,.98303,.98219,.98134,.9805,.97967,.97883,.978,.97717,.97634,.97552,.97471,.97389,.97309,.97229,.9715,.97071,.96993,.96915,.96838,.96762,.96687,.96612,.96539,.96466,.96395,.96324,.96255,.96187,.9612,.96055,.95991,.95929,.95869,.95811,.95754,.957,.95648,.95599,.95552,.95508,.95467,.95428,.95393,.9536,.95331,.95305,.95283,.95264]},{distance:[2.85606,2.86149,2.86432,2.8645,2.862,2.85686,2.84912,2.83886,2.82618,2.81117,2.79393,2.77456,2.75314,2.72975,2.70447,2.67734,2.64844,2.61784,2.58564,2.55196,2.5169,2.48057,2.44305,2.40438,2.36462,2.32383,2.28208,2.23943,2.19591,2.15153,2.10628,2.06016,2.01321,1.96548,1.91702,1.86793,1.8183,1.76829,1.71803,1.66767,1.61737,1.56726,1.51746,1.46803,1.41902,1.37044,1.32228,1.27452,1.22716,1.18023,1.13376,1.08781,1.04244,.99769,.95357,.91003,.86701,.82447,.78238,.74069,.69938,.65836,.61758,.57699,.53656,.49627,.45611,.41611,.37632,.33683,.29776,.25924,.22141,.18441,.14839,.11346,.07972,.04727,.01619,-.01348,-.0417,-.0684,-.09351,-.11698,-.13875,-.1588,-.17713,-.19381,-.20889,-.22242,-.23444,-.24501,-.25421,-.26216,-.26897,-.27473,-.27951,-.28336,-.28631,-.28836,-.28948,-.28963,-.28873,-.28673,-.28355,-.27916,-.27354,-.26673,-.25878,-.2498,-.23992,-.22929,-.21802,-.20623,-.19398,-.18134,-.16836,-.1551,-.14163,-.12809,-.11461,-.1013,-.08826,-.07557,-.06335,-.0517,-.04077,-.03065,-.02143,-.01321,-.00606,0,.00496,.00888,.01181,.01385,.01511,.0157,.01574,.01533,.01458,.01358,.0124,.01112,.00979,.00851,.00738,.0065,.006,.00596,.00646,.00754,.00924,.01161,.01471,.01858,.02323,.02865,.03481,.04169,.0493,.05765,.06677,.07671,.08754,.09934,.11222,.12628,.14159,.15823,.17624,.19561,.21632,.23828,.26142,.28563,.31083,.33696,.36397,.39185,.42057,.4501,.48036,.51125,.54264,.5744,.60646,.63871,.67105,.70337,.73556,.76751,.79918,.83048,.86139,.8919,.92202,.95184,.98144,1.01094,1.04045,1.0701,1.10002,1.13029,1.16103,1.1923,1.22416,1.25664,1.28979,1.32364,1.35824,1.39363,1.42985,1.4669,1.50475,1.54332,1.58252,1.62227,1.6625,1.70312,1.744,1.78501,1.82598,1.8668,1.90734,1.94754,1.98732,2.02666,2.06555,2.10402,2.1421,2.17985,2.2173,2.25448,2.29139,2.328,2.36424,2.4,2.43515,2.46955,2.50309,2.53565,2.56717,2.59761,2.62692,2.65505,2.68191,2.7074,2.73138,2.75375,2.7744,2.79324,2.81017,2.82504,2.83772,2.8481],pressure:[.22758,.23641,.24578,.25568,.26609,.27699,.28835,.30016,.31237,.32495,.33789,.35113,.36466,.37843,.39241,.40658,.4209,.43535,.44989,.4645,.47916,.49385,.50853,.5232,.53784,.55243,.56696,.58141,.59578,.61004,.62419,.63821,.65209,.6658,.67934,.69268,.70582,.71873,.73139,.7438,.75594,.76779,.77935,.79061,.80156,.81221,.82254,.83258,.84231,.85176,.86091,.86978,.87837,.88669,.89473,.9025,.91,.91725,.92425,.931,.93752,.9438,.94985,.95566,.96124,.96658,.97168,.97652,.98109,.98539,.98939,.99309,.99646,.99949,.99783,.99552,.99361,.99209,.99098,.99029,.99003,.99019,.99079,.99181,.99324,.9951,.99735,1,.99698,.99361,.98992,.98592,.98163,.97709,.97231,.96731,.96212,.95676,.95122,.94554,.93973,.93378,.92773,.92157,.91532,.90899,.90258,.89612,.88961,.88308,.87653,.87,.8635,.85705,.85068,.8444,.83823,.83219,.82628,.82052,.81493,.80952,.8043,.79929,.7945,.78994,.78561,.78151,.77765,.77402,.77062,.76742,.76443,.76161,.75896,.75645,.75406,.75175,.74951,.7473,.74511,.74289,.74064,.73833,.73592,.73341,.73078,.728,.72507,.72197,.71869,.71522,.71156,.70769,.70363,.69936,.69489,.69021,.68533,.68023,.67492,.66939,.66363,.65765,.65145,.64501,.63833,.63143,.62428,.61691,.60931,.60148,.59344,.58521,.57679,.5682,.55948,.55063,.54167,.53264,.52354,.51439,.50522,.49603,.48686,.47773,.46865,.45964,.45072,.44192,.43324,.42469,.41629,.40804,.39994,.392,.3842,.37655,.36903,.36164,.35437,.3472,.34012,.33312,.3262,.31933,.31251,.30574,.299,.2923,.28563,.27899,.27239,.26583,.25933,.25288,.24652,.24025,.2341,.22808,.22221,.21653,.21104,.20576,.20072,.19592,.19138,.18712,.18313,.17943,.17602,.17292,.17013,.16766,.16551,.16369,.16222,.1611,.16036,.16001,.16007,.16055,.16148,.16286,.16471,.16705,.16988,.17321,.17706,.18144,.18636,.19182,.19785,.20443,.21158,.2193]},{distance:[-2.31317,-2.3191,-2.32189,-2.32154,-2.31811,-2.31174,-2.30254,-2.29062,-2.27609,-2.25904,-2.23954,-2.21767,-2.19355,-2.16732,-2.13907,-2.10885,-2.07672,-2.04268,-2.00677,-1.96911,-1.92985,-1.88914,-1.84713,-1.80397,-1.75979,-1.71467,-1.66864,-1.62171,-1.57395,-1.52546,-1.47625,-1.42628,-1.3755,-1.32384,-1.27131,-1.218,-1.16408,-1.10972,-1.05508,-1.00031,-.94551,-.89077,-.83615,-.7817,-.72757,-.6739,-.62076,-.56821,-.51625,-.46484,-.41397,-.36366,-.314,-.26506,-.21689,-.16957,-.12316,-.07766,-.03301,.01085,.05399,.09643,.13827,.17967,.22079,.26176,.30265,.34342,.38397,.42414,.46381,.50285,.54115,.57863,.61524,.65093,.6856,.71914,.75153,.78275,.81283,.84182,.86972,.89651,.92208,.94634,.96919,.99052,1.01025,1.02835,1.04484,1.05976,1.07309,1.08479,1.09492,1.1036,1.11096,1.11714,1.12224,1.12627,1.12916,1.13083,1.13125,1.13036,1.12816,1.12466,1.11992,1.11397,1.10677,1.09827,1.08849,1.07746,1.06527,1.05203,1.03786,1.02283,1.00695,.99025,.97279,.9546,.93573,.9163,.8965,.8765,.85647,.83652,.81687,.79775,.77939,.76199,.74568,.73049,.71635,.70316,.69082,.67925,.66834,.65804,.64831,.63911,.63032,.62184,.61363,.60564,.59788,.59036,.58308,.57597,.5689,.56177,.55447,.5469,.53896,.53062,.5219,.51283,.5034,.49355,.48335,.47287,.46223,.45154,.44085,.43012,.41923,.40805,.39648,.38441,.37176,.35849,.34458,.32999,.31461,.29833,.28109,.26288,.2437,.22361,.20265,.18082,.15807,.13434,.1096,.0838,.0569,.02894,0,-.0298,-.0604,-.09173,-.12364,-.15594,-.18843,-.22092,-.25331,-.28559,-.31781,-.35006,-.38244,-.41502,-.44785,-.48098,-.5144,-.54811,-.58218,-.61666,-.65153,-.68677,-.72232,-.75807,-.79397,-.83002,-.86628,-.90281,-.93968,-.97693,-1.01465,-1.05282,-1.09139,-1.13031,-1.16956,-1.20917,-1.24905,-1.28907,-1.32908,-1.36891,-1.40844,-1.44765,-1.48658,-1.52527,-1.56376,-1.60206,-1.64016,-1.67801,-1.71552,-1.75264,-1.78936,-1.8257,-1.86161,-1.89702,-1.93182,-1.96584,-1.99894,-2.03102,-2.06203,-2.0919,-2.12056,-2.14794,-2.17397,-2.19852,-2.22138,-2.24235,-2.26129,-2.27805,-2.29243,-2.30422],pressure:[.9681,.97424,.98046,.98674,.99309,.9995,.99404,.98754,.981,.97444,.96785,.96124,.95462,.94801,.94139,.93479,.92822,.92167,.91515,.90868,.90225,.89589,.88959,.88336,.87722,.87115,.86519,.85932,.85356,.84792,.84239,.83699,.83173,.8266,.82162,.81679,.81211,.80759,.80324,.79906,.79505,.79121,.78756,.78409,.78081,.77771,.77481,.77211,.76959,.76728,.76516,.76324,.76153,.76001,.75869,.75757,.75665,.75593,.7554,.75507,.75493,.75498,.75523,.75565,.75627,.75706,.75803,.75917,.76049,.76197,.76361,.76541,.76737,.76947,.77172,.77409,.7766,.77923,.78198,.78484,.7878,.79086,.79401,.79724,.80055,.80394,.8074,.81092,.8145,.81813,.82182,.82556,.82934,.83317,.83703,.84093,.84487,.84884,.85284,.85687,.86094,.86503,.86915,.87329,.87746,.88166,.88587,.89011,.89436,.89863,.90291,.9072,.91149,.91579,.92009,.92438,.92867,.93295,.9372,.94144,.94566,.94985,.954,.95812,.96219,.96623,.97021,.97415,.97802,.98184,.9856,.9893,.99293,.9965,1,.99657,.9932,.98991,.98668,.98352,.98042,.97738,.9744,.97148,.9686,.96577,.96298,.96023,.95751,.95482,.95214,.94949,.94684,.9442,.94156,.93892,.93627,.93361,.93094,.92825,.92555,.92284,.9201,.91735,.91458,.91179,.90899,.90616,.90332,.90047,.8976,.89472,.89183,.88893,.88603,.88314,.88024,.87735,.87448,.87162,.86878,.86597,.86319,.86044,.85774,.85508,.85247,.84993,.84744,.84503,.84269,.84042,.83825,.83616,.83417,.83227,.83048,.8288,.82724,.82578,.82445,.82324,.82215,.82119,.82037,.81967,.81911,.81868,.81839,.81824,.81823,.81835,.81862,.81903,.81957,.82026,.82109,.82206,.82317,.82443,.82583,.82737,.82906,.83089,.83287,.83499,.83726,.83968,.84223,.84494,.84778,.85077,.8539,.85717,.86058,.86412,.86781,.87163,.87559,.87968,.88391,.88826,.89275,.89737,.90211,.90698,.91198,.91709,.92233,.92768,.93315,.93873,.94441,.95019,.95607,.96205]},{distance:[4.72925,4.81721,4.9037,4.98859,5.07177,5.15311,5.23249,5.3098,5.38491,5.45772,5.52811,5.59598,5.66122,5.72375,5.78346,5.84028,5.8941,5.94486,5.99248,6.03689,6.07803,6.11584,6.15028,6.18128,6.20882,6.23285,6.25336,6.27031,6.28369,6.29348,6.29969,6.3023,6.30133,6.29678,6.28867,6.27703,6.26187,6.24324,6.22116,6.19567,6.16683,6.13468,6.09928,6.06068,6.01896,5.97417,5.92639,5.87569,5.82217,5.76589,5.70696,5.64545,5.58147,5.5151,5.44644,5.37559,5.30265,5.2277,5.15085,5.0722,4.99184,4.90987,4.82639,4.74151,4.65533,4.56794,4.47945,4.38996,4.29959,4.20843,4.11658,4.02416,3.93125,3.83796,3.74437,3.65057,3.55666,3.46272,3.36884,3.27509,3.18155,3.08831,2.99545,2.90303,2.81114,2.71984,2.62922,2.53933,2.45026,2.36207,2.27484,2.18862,2.10349,2.01951,1.93675,1.85528,1.77515,1.69644,1.61919,1.54348,1.46935,1.39685,1.32605,1.25698,1.18967,1.12417,1.06049,.99863,.93862,.88044,.82408,.76953,.71676,.66574,.61644,.56882,.52282,.47841,.43553,.39413,.35414,.31551,.27817,.24206,.20712,.17328,.14048,.10866,.07776,.04772,.01848,-.00999,-.03776,-.06487,-.09134,-.11721,-.14251,-.16725,-.19144,-.21509,-.2382,-.26076,-.28275,-.30416,-.32496,-.34511,-.36459,-.38334,-.40134,-.41852,-.43485,-.45026,-.46471,-.47815,-.49052,-.50179,-.51189,-.52081,-.52849,-.5349,-.54003,-.54383,-.54627,-.54734,-.54702,-.54528,-.54211,-.53752,-.53149,-.52403,-.51515,-.50487,-.4932,-.48015,-.46575,-.45001,-.43297,-.41463,-.39503,-.37419,-.35213,-.32887,-.30443,-.27885,-.25214,-.22432,-.19541,-.16544,-.13442,-.10235,-.06926,-.03514,0,.03616,.07336,.11159,.15088,.19125,.23272,.27531,.31906,.36401,.41019,.45764,.5064,.55651,.60802,.66096,.71538,.77129,.82874,.88776,.94836,1.01056,1.07438,1.13982,1.20687,1.27554,1.34581,1.41766,1.49107,1.56599,1.64239,1.72025,1.79951,1.88013,1.96209,2.04532,2.12979,2.21546,2.30226,2.39017,2.47911,2.56905,2.65991,2.75164,2.84416,2.93742,3.03133,3.12582,3.2208,3.31619,3.41191,3.50785,3.60393,3.70006,3.79612,3.89202,3.98765,4.08291,4.17767,4.27182,4.36525,4.45783,4.54944,4.63995],pressure:[.30942,.30838,.30765,.30724,.30715,.30738,.30795,.30884,.31007,.31164,.31354,.31578,.31837,.32129,.32455,.32815,.33209,.33636,.34097,.34591,.35117,.35675,.36265,.36887,.37539,.38221,.38933,.39674,.40442,.41238,.4206,.42907,.43779,.44675,.45593,.46533,.47493,.48473,.49471,.50486,.51517,.52563,.53623,.54694,.55777,.5687,.57971,.59079,.60194,.61313,.62435,.6356,.64686,.65811,.66935,.68056,.69174,.70286,.71391,.72489,.73579,.74659,.75728,.76785,.7783,.7886,.79876,.80877,.81861,.82827,.83776,.84706,.85617,.86507,.87378,.88227,.89056,.89863,.90649,.91412,.92153,.92872,.93568,.94241,.94892,.95519,.96122,.96702,.97258,.97791,.98299,.98783,.99242,.99677,.99911,.99525,.99164,.98827,.98515,.98228,.97966,.97728,.97514,.97324,.97159,.97017,.96898,.96801,.96727,.96674,.96641,.96629,.96635,.96661,.96703,.96762,.96838,.96928,.97032,.97149,.97279,.9742,.97572,.97734,.97905,.98085,.98273,.98468,.98669,.98877,.99091,.99311,.99535,.99765,1,.9976,.99516,.99267,.99014,.98755,.98491,.98222,.97947,.97666,.97378,.97083,.96781,.96471,.96153,.95826,.9549,.95144,.94787,.9442,.94042,.93651,.93249,.92834,.92407,.91966,.91512,.91045,.90564,.90069,.8956,.89037,.885,.87949,.87384,.86806,.86214,.85608,.84988,.84356,.83711,.83053,.82383,.81702,.81009,.80306,.79594,.78872,.78141,.77403,.76657,.75905,.75148,.74385,.73619,.72849,.72076,.71302,.70526,.69749,.68972,.68195,.67419,.66644,.65871,.65099,.64329,.63561,.62795,.62032,.61271,.60512,.59755,.59001,.58248,.57497,.56749,.56002,.55256,.54512,.5377,.5303,.52291,.51554,.50819,.50087,.49358,.48632,.4791,.47192,.4648,.45773,.45072,.44378,.43692,.43015,.42346,.41687,.41039,.40403,.39779,.39168,.38571,.37989,.37423,.36873,.36342,.35828,.35335,.34862,.34409,.3398,.33573,.3319,.32831,.32498,.32192,.31912,.3166,.31436,.31242,.31077]}]};export{c as StrokesTexture,n as generateStrokesTexture,a as strokesDefinition};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{Default3D as e}from"./DefaultVertexAttributeLocations.js";import{Pos2 as t,Pos2Tex as r}from"./DefaultVertexBufferLayouts.js";import{VertexArrayObject as n}from"./VertexArrayObject.js";import{BufferObject as o}from"../../../webgl/BufferObject.js";import{Usage as i,TextureSamplingMode as m}from"../../../webgl/enums.js";import{Texture as s}from"../../../webgl/Texture.js";import{TextureDescriptor as u}from"../../../webgl/TextureDescriptor.js";function f(m,s=t,u=e,f=-1,w=1){let a=null;if(s===r)a=new Float32Array([f,f,0,0,w,f,1,0,f,w,0,1,w,w,1,1]);else a=new Float32Array([f,f,w,f,f,w,w,w]);return new n(m,u,{geometry:s},{geometry:o.createVertex(m,i.STATIC_DRAW,a)})}function w(r,m=t,s=e){const u=new Float32Array([-1,-1,3,-1,-1,3]);return new n(r,s,{geometry:m},{geometry:o.createVertex(r,i.STATIC_DRAW,u)})}const a=4;function l(e,t=a){const r=new u;return r.samplingMode=m.NEAREST,r.width=r.height=t,new s(e,r)}function c(e,t,r=a){const n=new Uint8Array(r*r*4);for(let i=0;i<n.length;i+=4)n[i]=255*t[0],n[i+1]=255*t[1],n[i+2]=255*t[2],n[i+3]=255*t[3];const o=new u;return o.samplingMode=m.NEAREST,o.width=o.height=r,new s(e,o,n)}function g(e){const t=new u;return t.samplingMode=m.NEAREST,t.width=t.height=1,new s(e,t,new Uint8Array([255,255,255,255]))}export{c as createColorTexture,g as createEmptyDepthTexture,l as createEmptyTexture,f as createQuadVAO,w as createScreenSizeTriangleVAO};
5
+ import{Default3D as e}from"./DefaultVertexAttributeLocations.js";import{Pos2 as r,Pos2Tex as t}from"./DefaultVertexBufferLayouts.js";import{VertexArrayObject as o}from"./VertexArrayObject.js";import{BufferObject as n}from"../../../webgl/BufferObject.js";import{Usage as m,TextureSamplingMode as s}from"../../../webgl/enums.js";import{Texture as u}from"../../../webgl/Texture.js";import{TextureDescriptor as f}from"../../../webgl/TextureDescriptor.js";function i(s,u=r,f=e,i=-1,a=1){let l=null;if(u===t)l=new Float32Array([i,i,0,0,a,i,1,0,i,a,0,1,a,a,1,1]);else l=new Float32Array([i,i,a,i,i,a,a,a]);return new o(s,f,{geometry:u},{geometry:n.createVertex(s,m.STATIC_DRAW,l)})}function a(t,s=r,u=e){const f=new Float32Array([-1,-1,3,-1,-1,3]);return new o(t,u,{geometry:s},{geometry:n.createVertex(t,m.STATIC_DRAW,f)})}const l=4;function c(e){const r=new f(l);return r.samplingMode=s.NEAREST,new u(e,r)}function w(e){const r=new f(1);return r.samplingMode=s.NEAREST,new u(e,r,new Uint8Array([255,255,255,255]))}export{w as createEmptyDepthTexture,c as createEmptyTexture,i as createQuadVAO,a as createScreenSizeTriangleVAO};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{j as i}from"../../../../chunks/vec2.js";import{s,b as a,e as n,g as o,a as l,c,l as h,i as u,m as p}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{O as f}from"../../../../chunks/vec4f64.js";import{PlaneIndex as T}from"../../../../geometry/support/frustum.js";import{create as _,distance2 as d,fromPoints as A,closestLineSegmentPoint as E}from"../../../../geometry/support/lineSegment.js";import{create as v,fromPoints as R,signedDistance as S,normal as g}from"../../../../geometry/support/plane.js";import{newLayout as I}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as O}from"../core/shaderLibrary/ShaderOutput.js";import b from"../lib/GLMaterial.js";import{Material as P,RenderOccludedFlag as L}from"../lib/Material.js";import{RenderSlot as N}from"../lib/RenderSlot.js";import{isTranslationMatrix as C}from"../lib/Util.js";import{VertexAttribute as y}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as j}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as D}from"../shaders/LineMarkerTechniqueConfiguration.js";import{R as U}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as x,RibbonLineTechnique as F}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as w,CapType as J}from"../shaders/RibbonLineTechniqueConfiguration.js";var M;!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"}(M||(M={}));class B extends P{constructor(e){super(e,new G),this._configuration=new w,this._vertexAttributeLocations=x}isClosed(e,t){return V(this.parameters,e,t)}getConfiguration(e,t){this._configuration.output=e,this._configuration.draped=t.slot===N.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==O.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stippleScaleWithLineWidth=r&&this.parameters.stippleScaleWithLineWidth,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&Z(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.occluder=this.parameters.renderOccluded===L.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersectDraped(e,r,i,s,a,n){if(!i.options.selectionMode)return;const o=e.vertexAttributes.get(y.POSITION).data,l=e.vertexAttributes.get(y.SIZE);let c=this.parameters.width;if(this.parameters.vvSize){const r=e.vertexAttributes.get(y.SIZEFEATUREATTRIBUTE).data[0];c*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(c*=l.data[0]);const h=s[0],u=s[1],p=(c/2+4)*e.screenToWorldRatio;let m=Number.MAX_VALUE,f=0;for(let T=0;T<o.length-5;T+=3){const e=o[T],r=o[T+1],i=h-e,s=u-r,a=o[T+3]-e,n=o[T+4]-r,l=t((a*i+n*s)/(a*a+n*n),0,1),c=a*l-i,p=n*l-s,_=c*c+p*p;_<m&&(m=_,f=T/3)}m<p*p&&a(n.dist,n.normal,f,!1)}intersect(r,p,m,f,_,v){if(!m.options.selectionMode||!r.visible)return;if(!C(p))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const I=r.vertexAttributes,O=I.get(y.POSITION).data;let b=this.parameters.width;if(this.parameters.vvSize){const e=I.get(y.SIZEFEATUREATTRIBUTE).data[0];b*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else I.has(y.SIZE)&&(b*=I.get(y.SIZE).data[0]);const P=m.camera,L=K;i(L,m.point);const N=b*P.pixelRatio/2+4*P.pixelRatio;s(le[0],L[0]-N,L[1]+N,0),s(le[1],L[0]+N,L[1]+N,0),s(le[2],L[0]+N,L[1]-N,0),s(le[3],L[0]-N,L[1]-N,0);for(let e=0;e<4;e++)if(!P.unprojectFromRenderScreen(le[e],ce[e]))return;R(P.eye,ce[0],ce[1],he),R(P.eye,ce[1],ce[2],ue),R(P.eye,ce[2],ce[3],pe),R(P.eye,ce[3],ce[0],me);let j=Number.MAX_VALUE,D=0;const U=W(this.parameters,I,r.indices)?O.length-2:O.length-5;for(let e=0;e<U;e+=3){X[0]=O[e]+p[12],X[1]=O[e+1]+p[13],X[2]=O[e+2]+p[14];const t=(e+3)%O.length;if(Y[0]=O[t]+p[12],Y[1]=O[t+1]+p[13],Y[2]=O[t+2]+p[14],S(he,X)<0&&S(he,Y)<0||S(ue,X)<0&&S(ue,Y)<0||S(pe,X)<0&&S(pe,Y)<0||S(me,X)<0&&S(me,Y)<0)continue;if(P.projectToRenderScreen(X,$),P.projectToRenderScreen(Y,ee),$[2]<0&&ee[2]>0){a(q,X,Y);const e=P.frustum,t=-S(e[T.NEAR],X)/n(q,g(e[T.NEAR]));o(q,q,t),l(X,X,q),P.projectToRenderScreen(X,$)}else if($[2]>0&&ee[2]<0){a(q,Y,X);const e=P.frustum,t=-S(e[T.NEAR],Y)/n(q,g(e[T.NEAR]));o(q,q,t),l(Y,Y,q),P.projectToRenderScreen(Y,ee)}else if($[2]<0&&ee[2]<0)continue;$[2]=0,ee[2]=0;const r=d(A($,ee,ie),L);r<j&&(j=r,c(te,X),c(re,Y),D=e/3)}const x=m.rayBegin,F=m.rayEnd;if(j<N*N){let e=Number.MAX_VALUE;if(E(A(te,re,ie),A(x,F,se),Q)){a(Q,Q,x);const t=h(Q);o(Q,Q,1/t),e=t/u(x,F)}v(e,Q,D,!1)}}get _layout(){const e=I().vec3f(y.POSITION).f32(y.SUBDIVISIONFACTOR).vec2f(y.UV0).vec3f(y.AUXPOS1).vec3f(y.AUXPOS2);return this.parameters.vvSize?e.f32(y.SIZEFEATUREATTRIBUTE):e.f32(y.SIZE),this.parameters.vvColor?e.f32(y.COLORFEATUREATTRIBUTE):e.vec4f(y.COLOR),this.parameters.vvOpacity&&e.f32(y.OPACITYFEATUREATTRIBUTE),has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(y.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new H(this._layout,this.parameters)}canRender(e,t){if(t===O.Color||t===O.Alpha||t===O.Highlight||t===O.Depth||t===O.ObjectAndLayerIdColor){if(e===N.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===L.OccludeAndTransparentStencil)return e===N.OPAQUE_MATERIAL||e===N.OCCLUDER_MATERIAL||e===N.TRANSPARENT_OCCLUDER_MATERIAL;if(t===O.Color||t===O.Alpha){return e===(this.parameters.writeDepth?N.TRANSPARENT_MATERIAL:N.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===N.OPAQUE_MATERIAL}return!1}createGLMaterial(e){return new z(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class z extends b{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==O.Color&&this._output!==O.Alpha||this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextureRepository.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.ensureTechnique(F,e)}}class G extends j{constructor(){super(...arguments),this.width=0,this.color=f,this.join="miter",this.cap=J.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stippleScaleWithLineWidth=!1,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.hasOccludees=!1,this.wireframe=!1}}class H{constructor(e,t){this._parameters=t,this.numJoinSubdivisions=0,this.vertexBufferLayout=e;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=U+r}}_isClosed(e){return W(this._parameters,e.vertexAttributes,e.indices)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.indices.get(y.POSITION).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){const n=ae,o=ne,l=oe,h=r.vertexAttributes.get(y.POSITION).data,m=r.indices&&r.indices.get(y.POSITION),f=r.vertexAttributes.get(y.DISTANCETOSTART)?.data;m&&m.length!==2*(h.length/3-1)&&console.warn("RibbonLineMaterial does not support indices");let T=1,_=0;this._parameters.vvSize?_=r.vertexAttributes.get(y.SIZEFEATUREATTRIBUTE).data[0]:r.vertexAttributes.has(y.SIZE)&&(T=r.vertexAttributes.get(y.SIZE).data[0]);let d=[1,1,1,1],A=0;this._parameters.vvColor?A=r.vertexAttributes.get(y.COLORFEATUREATTRIBUTE).data[0]:r.vertexAttributes.has(y.COLOR)&&(d=r.vertexAttributes.get(y.COLOR).data);const E=has("enable-feature:objectAndLayerId-rendering")?r.objectAndLayerIdColor:null;let v=0;this._parameters.vvOpacity&&(v=r.vertexAttributes.get(y.OPACITYFEATUREATTRIBUTE).data[0]);const R=h.length/3,S=new Float32Array(i.buffer),g=has("enable-feature:objectAndLayerId-rendering")?new Uint8Array(i.buffer):null,I=this.vertexBufferLayout.stride/4;let O=a*I;const b=O;let P=0;const L=f?(e,t,r)=>P=f[r]:(e,t,r)=>P+=u(e,t),N=has("enable-feature:objectAndLayerId-rendering"),C=(e,t,r,i,s,a,n)=>{if(S[O++]=t[0],S[O++]=t[1],S[O++]=t[2],S[O++]=i,S[O++]=n,S[O++]=s,S[O++]=e[0],S[O++]=e[1],S[O++]=e[2],S[O++]=r[0],S[O++]=r[1],S[O++]=r[2],S[O++]=this._parameters.vvSize?_:T,this._parameters.vvColor)S[O++]=A;else{const e=Math.min(4*a,d.length-4);S[O++]=d[e],S[O++]=d[e+1],S[O++]=d[e+2],S[O++]=d[e+3]}this._parameters.vvOpacity&&(S[O++]=v),N&&(null!=E&&(g[4*O]=E[0],g[4*O+1]=E[1],g[4*O+2]=E[2],g[4*O+3]=E[3]),O++)};O+=I,s(o,h[0],h[1],h[2]),e&&p(o,o,e);const j=this._isClosed(r);if(j){const t=h.length-3;s(n,h[t],h[t+1],h[t+2]),e&&p(n,n,e)}else s(l,h[3],h[4],h[5]),e&&p(l,l,e),C(o,o,l,1,M.LEFT_CAP_START,0,0),C(o,o,l,1,M.RIGHT_CAP_START,0,0),c(n,o),c(o,l);const D=j?0:1,U=j?R:R-1;for(let u=D;u<U;u++){const t=(u+1)%R*3;s(l,h[t],h[t+1],h[t+2]),e&&p(l,l,e),L(n,o,u),C(n,o,l,0,M.LEFT_JOIN_END,u,P),C(n,o,l,0,M.RIGHT_JOIN_END,u,P);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);C(n,o,l,t,M.LEFT_JOIN_END,u,P),C(n,o,l,t,M.RIGHT_JOIN_END,u,P)}C(n,o,l,1,M.LEFT_JOIN_START,u,P),C(n,o,l,1,M.RIGHT_JOIN_START,u,P),c(n,o),c(o,l)}j?(s(l,h[3],h[4],h[5]),e&&p(l,l,e),P=L(n,o,U),C(n,o,l,0,M.LEFT_JOIN_END,D,P),C(n,o,l,0,M.RIGHT_JOIN_END,D,P)):(P=L(n,o,U),C(n,o,o,0,M.LEFT_CAP_END,U,P),C(n,o,o,0,M.RIGHT_CAP_END,U,P)),k(S,b+I,S,b,I);O=k(S,O-I,S,O,I),this._parameters.wireframe&&this._addWireframeVertices(i,b,O,I)}_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=k(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 k(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function W(e,t,r){return V(e,t.get(y.POSITION).data,r?r.get(y.POSITION):null)}function V(e,t,r){return!!e.isClosed&&(r?r.length>2:t.length>6)}function Z(e){return e.anchor===D.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const X=m(),Y=m(),q=m(),Q=m(),K=m(),$=r(),ee=r(),te=m(),re=m(),ie=_(),se=_(),ae=m(),ne=m(),oe=m(),le=[r(),r(),r(),r()],ce=[m(),m(),m(),m()],he=v(),ue=v(),pe=v(),me=v();export{G as Parameters,B as RibbonLineMaterial};
5
+ import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{j as i}from"../../../../chunks/vec2.js";import{s,b as a,e as n,g as o,a as l,c,l as u,i as h,m as p}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{O as f}from"../../../../chunks/vec4f64.js";import{PlaneIndex as T}from"../../../../geometry/support/frustum.js";import{create as _,distance2 as d,fromPoints as A,closestLineSegmentPoint as E}from"../../../../geometry/support/lineSegment.js";import{create as v,fromPoints as R,signedDistance as I,normal as g}from"../../../../geometry/support/plane.js";import{newLayout as S}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as O}from"../core/shaderLibrary/ShaderOutput.js";import b from"../lib/GLMaterial.js";import{Material as P,RenderOccludedFlag as L}from"../lib/Material.js";import{RenderSlot as N}from"../lib/RenderSlot.js";import{isTranslationMatrix as C}from"../lib/Util.js";import{VertexAttribute as y}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as j}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as D}from"../shaders/LineMarkerTechniqueConfiguration.js";import{R as U}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as x,RibbonLineTechnique as F}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as w,CapType as J}from"../shaders/RibbonLineTechniqueConfiguration.js";var M;!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"}(M||(M={}));class B extends P{constructor(e){super(e,new G),this._configuration=new w,this._vertexAttributeLocations=x}isClosed(e,t){return Z(this.parameters,e,t)}getConfiguration(e,t){this._configuration.output=e,this._configuration.draped=t.slot===N.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==O.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.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&W(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.occluder=this.parameters.renderOccluded===L.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersectDraped(e,r,i,s,a,n){if(!i.options.selectionMode)return;const o=e.vertexAttributes.get(y.POSITION).data,l=e.vertexAttributes.get(y.SIZE);let c=this.parameters.width;if(this.parameters.vvSize){const r=e.vertexAttributes.get(y.SIZEFEATUREATTRIBUTE).data[0];c*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(c*=l.data[0]);const u=s[0],h=s[1],p=(c/2+4)*e.screenToWorldRatio;let m=Number.MAX_VALUE,f=0;for(let T=0;T<o.length-5;T+=3){const e=o[T],r=o[T+1],i=u-e,s=h-r,a=o[T+3]-e,n=o[T+4]-r,l=t((a*i+n*s)/(a*a+n*n),0,1),c=a*l-i,p=n*l-s,_=c*c+p*p;_<m&&(m=_,f=T/3)}m<p*p&&a(n.dist,n.normal,f,!1)}intersect(r,p,m,f,_,v){if(!m.options.selectionMode||!r.visible)return;if(!C(p))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const S=r.vertexAttributes,O=S.get(y.POSITION).data;let b=this.parameters.width;if(this.parameters.vvSize){const e=S.get(y.SIZEFEATUREATTRIBUTE).data[0];b*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else S.has(y.SIZE)&&(b*=S.get(y.SIZE).data[0]);const P=m.camera,L=K;i(L,m.point);const N=b*P.pixelRatio/2+4*P.pixelRatio;s(le[0],L[0]-N,L[1]+N,0),s(le[1],L[0]+N,L[1]+N,0),s(le[2],L[0]+N,L[1]-N,0),s(le[3],L[0]-N,L[1]-N,0);for(let e=0;e<4;e++)if(!P.unprojectFromRenderScreen(le[e],ce[e]))return;R(P.eye,ce[0],ce[1],ue),R(P.eye,ce[1],ce[2],he),R(P.eye,ce[2],ce[3],pe),R(P.eye,ce[3],ce[0],me);let j=Number.MAX_VALUE,D=0;const U=V(this.parameters,S,r.indices)?O.length-2:O.length-5;for(let e=0;e<U;e+=3){X[0]=O[e]+p[12],X[1]=O[e+1]+p[13],X[2]=O[e+2]+p[14];const t=(e+3)%O.length;if(Y[0]=O[t]+p[12],Y[1]=O[t+1]+p[13],Y[2]=O[t+2]+p[14],I(ue,X)<0&&I(ue,Y)<0||I(he,X)<0&&I(he,Y)<0||I(pe,X)<0&&I(pe,Y)<0||I(me,X)<0&&I(me,Y)<0)continue;if(P.projectToRenderScreen(X,$),P.projectToRenderScreen(Y,ee),$[2]<0&&ee[2]>0){a(q,X,Y);const e=P.frustum,t=-I(e[T.NEAR],X)/n(q,g(e[T.NEAR]));o(q,q,t),l(X,X,q),P.projectToRenderScreen(X,$)}else if($[2]>0&&ee[2]<0){a(q,Y,X);const e=P.frustum,t=-I(e[T.NEAR],Y)/n(q,g(e[T.NEAR]));o(q,q,t),l(Y,Y,q),P.projectToRenderScreen(Y,ee)}else if($[2]<0&&ee[2]<0)continue;$[2]=0,ee[2]=0;const r=d(A($,ee,ie),L);r<j&&(j=r,c(te,X),c(re,Y),D=e/3)}const x=m.rayBegin,F=m.rayEnd;if(j<N*N){let e=Number.MAX_VALUE;if(E(A(te,re,ie),A(x,F,se),Q)){a(Q,Q,x);const t=u(Q);o(Q,Q,1/t),e=t/h(x,F)}v(e,Q,D,!1)}}get _layout(){const e=S().vec3f(y.POSITION).f32(y.SUBDIVISIONFACTOR).vec2f(y.UV0).vec3f(y.AUXPOS1).vec3f(y.AUXPOS2);return this.parameters.vvSize?e.f32(y.SIZEFEATUREATTRIBUTE):e.f32(y.SIZE),this.parameters.vvColor?e.f32(y.COLORFEATUREATTRIBUTE):e.vec4f(y.COLOR),this.parameters.vvOpacity&&e.f32(y.OPACITYFEATUREATTRIBUTE),has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(y.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new H(this._layout,this.parameters)}canRender(e,t){if(t===O.Color||t===O.Alpha||t===O.Highlight||t===O.Depth||t===O.ObjectAndLayerIdColor){if(e===N.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===L.OccludeAndTransparentStencil)return e===N.OPAQUE_MATERIAL||e===N.OCCLUDER_MATERIAL||e===N.TRANSPARENT_OCCLUDER_MATERIAL;if(t===O.Color||t===O.Alpha){return e===(this.parameters.writeDepth?N.TRANSPARENT_MATERIAL:N.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===N.OPAQUE_MATERIAL}return!1}createGLMaterial(e){return new z(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class z extends b{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==O.Color&&this._output!==O.Alpha||this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextureRepository.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.ensureTechnique(F,e)}}class G extends j{constructor(){super(...arguments),this.width=0,this.color=f,this.join="miter",this.cap=J.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.hasOccludees=!1,this.wireframe=!1}}class H{constructor(e,t){this._parameters=t,this.numJoinSubdivisions=0,this.vertexBufferLayout=e;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=U+r}}_isClosed(e){return V(this._parameters,e.vertexAttributes,e.indices)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.indices.get(y.POSITION).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){const n=ae,o=ne,l=oe,u=r.vertexAttributes.get(y.POSITION).data,m=r.indices&&r.indices.get(y.POSITION),f=r.vertexAttributes.get(y.DISTANCETOSTART)?.data;m&&m.length!==2*(u.length/3-1)&&console.warn("RibbonLineMaterial does not support indices");let T=1,_=0;this._parameters.vvSize?_=r.vertexAttributes.get(y.SIZEFEATUREATTRIBUTE).data[0]:r.vertexAttributes.has(y.SIZE)&&(T=r.vertexAttributes.get(y.SIZE).data[0]);let d=[1,1,1,1],A=0;this._parameters.vvColor?A=r.vertexAttributes.get(y.COLORFEATUREATTRIBUTE).data[0]:r.vertexAttributes.has(y.COLOR)&&(d=r.vertexAttributes.get(y.COLOR).data);const E=has("enable-feature:objectAndLayerId-rendering")?r.objectAndLayerIdColor:null;let v=0;this._parameters.vvOpacity&&(v=r.vertexAttributes.get(y.OPACITYFEATUREATTRIBUTE).data[0]);const R=u.length/3,I=new Float32Array(i.buffer),g=has("enable-feature:objectAndLayerId-rendering")?new Uint8Array(i.buffer):null,S=this.vertexBufferLayout.stride/4;let O=a*S;const b=O;let P=0;const L=f?(e,t,r)=>P=f[r]:(e,t,r)=>P+=h(e,t),N=has("enable-feature:objectAndLayerId-rendering"),C=(e,t,r,i,s,a,n)=>{if(I[O++]=t[0],I[O++]=t[1],I[O++]=t[2],I[O++]=i,I[O++]=n,I[O++]=s,I[O++]=e[0],I[O++]=e[1],I[O++]=e[2],I[O++]=r[0],I[O++]=r[1],I[O++]=r[2],I[O++]=this._parameters.vvSize?_:T,this._parameters.vvColor)I[O++]=A;else{const e=Math.min(4*a,d.length-4);I[O++]=d[e],I[O++]=d[e+1],I[O++]=d[e+2],I[O++]=d[e+3]}this._parameters.vvOpacity&&(I[O++]=v),N&&(null!=E&&(g[4*O]=E[0],g[4*O+1]=E[1],g[4*O+2]=E[2],g[4*O+3]=E[3]),O++)};O+=S,s(o,u[0],u[1],u[2]),e&&p(o,o,e);const j=this._isClosed(r);if(j){const t=u.length-3;s(n,u[t],u[t+1],u[t+2]),e&&p(n,n,e)}else s(l,u[3],u[4],u[5]),e&&p(l,l,e),C(o,o,l,1,M.LEFT_CAP_START,0,0),C(o,o,l,1,M.RIGHT_CAP_START,0,0),c(n,o),c(o,l);const D=j?0:1,U=j?R:R-1;for(let h=D;h<U;h++){const t=(h+1)%R*3;s(l,u[t],u[t+1],u[t+2]),e&&p(l,l,e),L(n,o,h),C(n,o,l,0,M.LEFT_JOIN_END,h,P),C(n,o,l,0,M.RIGHT_JOIN_END,h,P);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);C(n,o,l,t,M.LEFT_JOIN_END,h,P),C(n,o,l,t,M.RIGHT_JOIN_END,h,P)}C(n,o,l,1,M.LEFT_JOIN_START,h,P),C(n,o,l,1,M.RIGHT_JOIN_START,h,P),c(n,o),c(o,l)}j?(s(l,u[3],u[4],u[5]),e&&p(l,l,e),P=L(n,o,U),C(n,o,l,0,M.LEFT_JOIN_END,D,P),C(n,o,l,0,M.RIGHT_JOIN_END,D,P)):(P=L(n,o,U),C(n,o,o,0,M.LEFT_CAP_END,U,P),C(n,o,o,0,M.RIGHT_CAP_END,U,P)),k(I,b+S,I,b,S);O=k(I,O-S,I,O,S),this._parameters.wireframe&&this._addWireframeVertices(i,b,O,S)}_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=k(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 k(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function V(e,t,r){return Z(e,t.get(y.POSITION).data,r?r.get(y.POSITION):null)}function Z(e,t,r){return!!e.isClosed&&(r?r.length>2:t.length>6)}function W(e){return e.anchor===D.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const X=m(),Y=m(),q=m(),Q=m(),K=m(),$=r(),ee=r(),te=m(),re=m(),ie=_(),se=_(),ae=m(),ne=m(),oe=m(),le=[r(),r(),r(),r()],ce=[m(),m(),m(),m()],ue=v(),he=v(),pe=v(),me=v();export{G as Parameters,B 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.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{getAssetUrl as r}from"../../../../../assets.js";import t from"../../../../../core/Accessor.js";import s from"../../../../../core/Logger.js";import{disposeMaybe as a}from"../../../../../core/maybe.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators/subclass.js";import{requestImage as m}from"../../../../../support/requestImageUtils.js";import{NoParameters as p}from"../../core/shaderModules/interfaces.js";import{ResourceState as n}from"../../lib/basicInterfaces.js";import{TextureSamplingMode as l}from"../../../../webgl/enums.js";import{Texture as h}from"../../../../webgl/Texture.js";import{TextureDescriptor as u}from"../../../../webgl/TextureDescriptor.js";let c=class extends t{constructor(){super(...arguments),this._passParameters=new g,this._loading=0}get passParameters(){return this._passParameters}destroy(){this._passParameters.waveNormal=a(this._passParameters.waveNormal),this._passParameters.wavePertubation=a(this._passParameters.wavePertubation)}get updating(){return this._loading>0}ensureResources(e){if(this._loading>0)return n.LOADING;if(null!=this._passParameters.waveNormal&&null!=this._passParameters.wavePertubation)return n.LOADED;const t=new u;return t.samplingMode=l.LINEAR_MIPMAP_LINEAR,t.hasMipmap=!0,t.maxAnisotropy=8,++this._loading,m(r("esri/images/materials/water/normals.jpg")).then((r=>this._passParameters.waveNormal=new h(e,{...t,width:r.width,height:r.height},r))).catch((e=>s.getLogger(this).error("Failed to load water material normal texture.",e))).finally((()=>--this._loading)),++this._loading,m(r("esri/images/materials/water/perturbation.jpg")).then((r=>this._passParameters.wavePertubation=new h(e,{...t,width:r.width,height:r.height},r))).catch((e=>s.getLogger(this).error("Failed to load water material pertubation texture.",e))).finally((()=>--this._loading)),n.LOADING}};e([o()],c.prototype,"_loading",void 0),e([o({type:Boolean,readOnly:!0})],c.prototype,"updating",null),c=e([i("esri.views.3d.webgl-engine.materials.internal.WaterTextureRepository")],c);class g extends p{}export{g as WaterTexturePassParameters,c as WaterTextureRepository};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{getAssetUrl as r}from"../../../../../assets.js";import t from"../../../../../core/Accessor.js";import s from"../../../../../core/Logger.js";import{disposeMaybe as a}from"../../../../../core/maybe.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators/subclass.js";import{requestImage as m}from"../../../../../support/requestImageUtils.js";import{NoParameters as p}from"../../core/shaderModules/interfaces.js";import{ResourceState as n}from"../../lib/basicInterfaces.js";import{PixelFormat as l,TextureSamplingMode as h}from"../../../../webgl/enums.js";import{Texture as u}from"../../../../webgl/Texture.js";import{TextureDescriptor as c}from"../../../../webgl/TextureDescriptor.js";let g=class extends t{constructor(){super(...arguments),this._passParameters=new d,this._loading=0}get passParameters(){return this._passParameters}destroy(){this._passParameters.waveNormal=a(this._passParameters.waveNormal),this._passParameters.wavePertubation=a(this._passParameters.wavePertubation)}get updating(){return this._loading>0}ensureResources(e){if(this._loading>0)return n.LOADING;if(null!=this._passParameters.waveNormal&&null!=this._passParameters.wavePertubation)return n.LOADED;const t=new c;return t.pixelFormat=l.RGB,t.samplingMode=h.LINEAR_MIPMAP_LINEAR,t.hasMipmap=!0,t.maxAnisotropy=8,++this._loading,m(r("esri/images/materials/water/normals.jpg")).then((r=>this._passParameters.waveNormal=new u(e,{...t,width:r.width,height:r.height},r))).catch((e=>s.getLogger(this).error("Failed to load water material normal texture.",e))).finally((()=>--this._loading)),++this._loading,m(r("esri/images/materials/water/perturbation.jpg")).then((r=>this._passParameters.wavePertubation=new u(e,{...t,width:r.width,height:r.height},r))).catch((e=>s.getLogger(this).error("Failed to load water material pertubation texture.",e))).finally((()=>--this._loading)),n.LOADING}};e([o()],g.prototype,"_loading",void 0),e([o({type:Boolean,readOnly:!0})],g.prototype,"updating",null),g=e([i("esri.views.3d.webgl-engine.materials.internal.WaterTextureRepository")],g);class d extends p{}export{d as WaterTexturePassParameters,g as WaterTextureRepository};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{ViewingMode as e}from"../../../ViewingMode.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{Default3D as o}from"../lib/DefaultVertexAttributeLocations.js";import{oitBlending as n}from"../lib/OrderIndependentTransparency.js";import{Program as s}from"../lib/Program.js";import{TransparencyPassType as a}from"../lib/TransparencyPassType.js";import{H as l}from"../../../../chunks/HUDMaterial.glsl.js";import{BlendFactor as u,CompareFunction as p,PrimitiveType as c}from"../../../webgl/enums.js";import{simpleBlendingParams as h,defaultDepthWriteParams as m,makePipelineState as f,defaultColorWriteParams as d}from"../../../webgl/renderState.js";class g extends r{initializeConfiguration(t,i){i.spherical=t.viewingMode===e.Global}initializeProgram(e){return new s(e.rctx,g.shader.get().build(this.configuration),o)}_setPipelineState(e){const i=this.configuration,r=e===a.NONE,o=e===a.FrontFace,s=this.configuration.hasPolygonOffset?b:null,l=(r||o)&&i.output!==t.Highlight&&(i.depthEnabled||i.occlusionPass)?m:null;return f({blending:i.output===t.Color||i.output===t.Alpha||i.output===t.Highlight?r?j:n(e):null,depthTest:{func:p.LEQUAL},depthWrite:l,colorWrite:d,polygonOffset:s})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}get primitiveType(){return this.configuration.occlusionPass?c.POINTS:c.TRIANGLES}}g.shader=new i(l,(()=>import("./HUDMaterial.glsl.js")));const b={factor:0,units:-4},j=h(u.ONE,u.ONE_MINUS_SRC_ALPHA);export{g as HUDMaterialTechnique};
5
+ import{ViewingMode as r}from"../../../ViewingMode.js";import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../core/shaderTechnique/ShaderTechnique.js";import{Default3D as o}from"../lib/DefaultVertexAttributeLocations.js";import{oitBlending as n}from"../lib/OrderIndependentTransparency.js";import{Program as s}from"../lib/Program.js";import{TransparencyPassType as a}from"../lib/TransparencyPassType.js";import{H as l}from"../../../../chunks/HUDMaterial.glsl.js";import{BlendFactor as u,CompareFunction as p,PrimitiveType as c}from"../../../webgl/enums.js";import{simpleBlendingParams as h,defaultDepthWriteParams as m,makePipelineState as f,defaultColorWriteParams as d}from"../../../webgl/renderState.js";class g extends t{initializeConfiguration(e,i){i.spherical=e.viewingMode===r.Global}initializeProgram(r){return new s(r.rctx,g.shader.get().build(this.configuration),o)}initializePipeline(){const r=this.configuration.transparencyPassType,i=this.configuration,t=r===a.NONE,o=r===a.FrontFace,s=this.configuration.hasPolygonOffset?b:null,l=(t||o)&&i.output!==e.Highlight&&(i.depthEnabled||i.occlusionPass)?m:null;return f({blending:i.output===e.Color||i.output===e.Alpha||i.output===e.Highlight?t?j:n(r):null,depthTest:{func:p.LEQUAL},depthWrite:l,colorWrite:d,polygonOffset:s})}get primitiveType(){return this.configuration.occlusionPass?c.POINTS:c.TRIANGLES}}g.shader=new i(l,(()=>import("./HUDMaterial.glsl.js")));const b={factor:0,units:-4},j=h(u.ONE,u.ONE_MINUS_SRC_ALPHA);export{g as HUDMaterialTechnique};