@arcgis/core 5.2.0-next.117 → 5.2.0-next.119

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 (218) hide show
  1. package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -1
  2. package/analysis/featureReferenceUtils.js +1 -1
  3. package/arcade.d.ts +1 -1
  4. package/arcade.js +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/03918a862455191a8910.js +1 -0
  7. package/assets/esri/core/workers/chunks/{9b9a60f1e0c48aa701f0.js → 066b7f6866d602f963e0.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{564fdf0d663b773806cc.js → 114bc14c49176f64a2c5.js} +1 -1
  9. package/assets/esri/core/workers/chunks/1630913399384030d0b9.js +1 -0
  10. package/assets/esri/core/workers/chunks/{db141122060d8d9b38da.js → 1742dbc6a827cfda471b.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{045ff98313b06a2188b7.js → 1a39335aa2dce6d564d9.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{caf38cf4d8542fb11c46.js → 20e4277a4a6c57957202.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{f42243c62dd0b6993816.js → 24014f3701c31ee74bc2.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{62b1f94f4fa978d4da48.js → 354912041363502c6a89.js} +1 -1
  15. package/assets/esri/core/workers/chunks/37cf4ca2083cd3b6002e.js +1 -0
  16. package/assets/esri/core/workers/chunks/{3b499cfc89c8f87cdb20.js → 3c3e5e952fd6740bb234.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{44d3fe10cb35d16f0b33.js → 4396ef5ab3eb9e9a7df2.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{56989b48c0a5d7fe85e6.js → 4c4ba466e23159991322.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{b9023cc3298ee4fddea7.js → 54f3bc940cea15fce2c7.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{7e42be27ead91a4cc0f1.js → 581285e4d7bbe1b7c27a.js} +1 -1
  21. package/assets/esri/core/workers/chunks/5938d5f6e37f49867d5a.js +1 -0
  22. package/assets/esri/core/workers/chunks/{05584d8828ae7bca0fc5.js → 64ee22134fda2f09c094.js} +1 -1
  23. package/assets/esri/core/workers/chunks/6efc5873747b9cd44fb9.js +1 -0
  24. package/assets/esri/core/workers/chunks/{0463c807b37f01bbc35c.js → 70347d25968975126fa7.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{4bfd63f3cf9208eb839b.js → 723478607badcde5706b.js} +43 -43
  26. package/assets/esri/core/workers/chunks/{42c4d0c1c08bf111e5a4.js → 731ec5de16753e10b963.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{5965a947f68b707eaa6b.js → 82ce034b5ba54de9b970.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{1eafb214519d8fc63ccb.js → 8465e2c7221125fd3cc4.js} +1 -1
  29. package/assets/esri/core/workers/chunks/862e1acd80c4e43831dc.js +1 -0
  30. package/assets/esri/core/workers/chunks/{fd808d38ae2d475ac442.js → 8675ab3c4dec2f13b9c6.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{925a0b29d3ed7165b8dd.js → 8984d02c0ce828fd223a.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{57328c206f1e699ac06f.js → 89edaa1ffa566908ebca.js} +1 -1
  33. package/assets/esri/core/workers/chunks/97fea852f8e93e1286e4.js +1 -0
  34. package/assets/esri/core/workers/chunks/{bb4cbf6b7c35e8c78cc7.js → a917a1df8270860dc514.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{996438b3afec92c5c68e.js → b0058619e0363002ad86.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{9fb46ccd4be4c3b61c31.js → b5a102cf9f4377fb9842.js} +1 -1
  37. package/assets/esri/core/workers/chunks/b6409d89914030d5854a.js +1 -0
  38. package/assets/esri/core/workers/chunks/{fa869977ac2abb063925.js → b9c834e3c0701e9b14a2.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{32dd990a3bd93cbad309.js → c0ec87800faf99cbd8bd.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{20de0ea9fa08a6545978.js → cf1106eda10f3cccb1bd.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{ed988360264574cd8f6b.js → cf7c06702babd6fa88b4.js} +1 -1
  42. package/assets/esri/core/workers/chunks/cfd8317ecd2e63af7c40.js +1 -0
  43. package/assets/esri/core/workers/chunks/d090baaa974e1e83fa44.js +1 -0
  44. package/assets/esri/core/workers/chunks/{c5ceceb0683671f92efa.js → da6583e8d88441a1c02a.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{e1f2b07be33e33117313.js → dd02cc18ebebb90778c6.js} +1 -1
  46. package/assets/esri/core/workers/chunks/de8a3a0796bd115426c0.js +1 -0
  47. package/assets/esri/core/workers/chunks/{05b373a663cb5d4d722f.js → deb5b1d772ca407654d4.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{10fa8fbade8ae084c307.js → e22a013ec38989caf9de.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{c7e6b5594fed5bb16691.js → e4016ae9cb8f16e3efc3.js} +1 -1
  50. package/assets/esri/core/workers/chunks/e5f0c47957a4e9663720.js +1 -0
  51. package/assets/esri/core/workers/chunks/{a3f4818f4190fa92331d.js → edd36e98355f1655e5c8.js} +1 -1
  52. package/assets/esri/core/workers/chunks/ef6e52f9b656751eebaf.js +1 -0
  53. package/assets/esri/core/workers/chunks/f0709c48daca93e759c8.js +1 -0
  54. package/assets/esri/core/workers/chunks/f5423006fb07db7dd6ee.js +1 -0
  55. package/assets/esri/core/workers/chunks/{d926bffc3ff9f87e9081.js → f890359d972cce54459e.js} +1 -1
  56. package/assets/esri/core/workers/chunks/fb11ff3f2eae5f072560.js +1 -0
  57. package/assets/esri/core/workers/chunks/fdad31bbe8aee68a6eaf.js +1 -0
  58. package/assets/esri/core/workers/chunks/fe1787a8d499832996b3.js +1 -0
  59. package/chunks/CloudsComposition.glsl.js +2 -2
  60. package/chunks/ColorMaterial.glsl.js +3 -3
  61. package/chunks/Compositing.glsl.js +4 -4
  62. package/chunks/DeepSky.glsl.js +3 -3
  63. package/chunks/EdgeShader.glsl.js +6 -6
  64. package/chunks/FocusArea.glsl.js +1 -1
  65. package/chunks/GlobalIllumination.glsl.js +7 -7
  66. package/chunks/HUDMaterial.glsl.js +5 -5
  67. package/chunks/LaserlinePath.glsl.js +5 -5
  68. package/chunks/LineCallout.glsl.js +2 -2
  69. package/chunks/LineMarker.glsl.js +30 -30
  70. package/chunks/NavigationDepth.glsl.js +1 -1
  71. package/chunks/OccludedGeometryDepth.glsl.js +2 -2
  72. package/chunks/Path.glsl.js +12 -12
  73. package/chunks/PointRenderer.glsl.js +5 -5
  74. package/chunks/Precipitation.glsl.js +7 -7
  75. package/chunks/RibbonLine.glsl.js +50 -50
  76. package/chunks/SimpleAtmosphere.glsl.js +9 -9
  77. package/chunks/Stars.glsl.js +5 -5
  78. package/chunks/Terrain.glsl.js +18 -16
  79. package/chunks/Viewshed.glsl.js +3 -3
  80. package/chunks/VolumeMask.glsl.js +2 -2
  81. package/chunks/Water.glsl.js +38 -48
  82. package/config.js +1 -1
  83. package/core/NestedMap.js +1 -1
  84. package/kernel.js +1 -1
  85. package/layers/AnnotationFeatureLayer.d.ts +2 -1
  86. package/layers/AnnotationFeatureLayer.js +1 -1
  87. package/layers/CatalogLayer.d.ts +2 -1
  88. package/layers/CatalogLayer.js +1 -1
  89. package/layers/DimensionFeatureLayer.d.ts +2 -1
  90. package/layers/DimensionFeatureLayer.js +1 -1
  91. package/layers/FeatureLayer.d.ts +2 -30
  92. package/layers/FeatureLayer.js +1 -1
  93. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  94. package/layers/SubtypeGroupLayer.d.ts +2 -1
  95. package/layers/SubtypeGroupLayer.js +1 -1
  96. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  97. package/layers/mixins/FeatureLayerBase.js +1 -1
  98. package/layers/mixins/FeatureLayerReload.d.ts +26 -0
  99. package/layers/mixins/FeatureLayerReload.js +2 -0
  100. package/layers/mixins/PortalLayer.js +1 -1
  101. package/layers/support/TimeInfo.d.ts +2 -2
  102. package/layers/support/TimeInfo.js +1 -1
  103. package/layers/support/fieldUtils.js +1 -1
  104. package/layers/video/VideoController.js +1 -1
  105. package/package.json +3 -3
  106. package/support/revision.js +1 -1
  107. package/symbols/cim/animationUtils.js +1 -1
  108. package/time/timeZoneUtils.js +1 -1
  109. package/views/2d/engine/webgl/animations/instructions.js +1 -1
  110. package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
  111. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  112. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  113. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  114. package/views/3d/camera/constraintUtils.js +1 -1
  115. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  116. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  117. package/views/3d/state/controllers/GroundNavigationController.js +1 -1
  118. package/views/3d/state/controllers/InteractiveController.js +1 -1
  119. package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
  120. package/views/3d/state/controllers/momentum/MomentumController.js +1 -1
  121. package/views/3d/state/utils/OffsetCorrectionController.js +2 -0
  122. package/views/3d/support/engineContent/line.js +1 -1
  123. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
  124. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js +4 -4
  125. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  126. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +9 -9
  127. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +15 -15
  128. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +3 -3
  129. package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +23 -23
  130. package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +3 -3
  131. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +8 -8
  132. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +7 -7
  133. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +7 -7
  134. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  135. package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +2 -0
  136. package/views/3d/webgl-engine/effects/AmbientIllumination.js +1 -1
  137. package/views/3d/webgl-engine/effects/atmosphere/SimpleAtmosphere.glsl.js +1 -1
  138. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.glsl.js +1 -1
  139. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  140. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  141. package/views/3d/webgl-engine/effects/laserlines/LaserlinePath.glsl.js +1 -1
  142. package/views/3d/webgl-engine/effects/precipitation/Precipitation.glsl.js +1 -1
  143. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  144. package/views/3d/webgl-engine/effects/stars/DeepSky.glsl.js +1 -1
  145. package/views/3d/webgl-engine/effects/stars/Stars.glsl.js +1 -1
  146. package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
  147. package/views/3d/webgl-engine/lib/Program.js +1 -1
  148. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  149. package/views/3d/webgl-engine/lib/edgeRendering/AdjustProjectedPosition.glsl.js +4 -4
  150. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
  151. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  152. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  153. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  154. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  155. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  156. package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
  157. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  158. package/views/3d/webgl-engine/materials/ViewingModeConfiguration.js +1 -1
  159. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  160. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  161. package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
  162. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  163. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  164. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  165. package/views/3d/webgl-engine/shaders/Compositing.glsl.js +1 -1
  166. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +26 -26
  167. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  168. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  169. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  170. package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
  171. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  172. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  173. package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
  174. package/views/3d/webgl-engine/shaders/LineTechniqueConfiguration.js +2 -0
  175. package/views/3d/webgl-engine/shaders/MeasurementArrowTechniqueConfiguration.js +1 -1
  176. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
  177. package/views/3d/webgl-engine/shaders/NavigationDepth.glsl.js +1 -1
  178. package/views/3d/webgl-engine/shaders/OccludedGeometryDepth.glsl.js +1 -1
  179. package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
  180. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  181. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  182. package/views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js +1 -1
  183. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  184. package/views/3d/webgl-engine/shaders/Viewshed.glsl.js +1 -1
  185. package/views/3d/webgl-engine/shaders/VolumeMask.glsl.js +1 -1
  186. package/widgets/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -1
  187. package/widgets/Measurement.d.ts +1 -2
  188. package/widgets/Measurement.js +1 -1
  189. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  190. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  191. package/widgets/Sketch/SketchViewModel.d.ts +13 -0
  192. package/widgets/Sketch/SketchViewModel.js +1 -1
  193. package/widgets/Sketch/VisibleElements.d.ts +8 -1
  194. package/widgets/Sketch/VisibleElements.js +1 -1
  195. package/widgets/Sketch/support/PluginManager.d.ts +11 -1
  196. package/widgets/ValuePicker.d.ts +1 -1
  197. package/widgets/ValuePicker.js +1 -1
  198. package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +4 -2
  199. package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
  200. package/widgets/VideoPlayer.js +1 -1
  201. package/assets/esri/core/workers/chunks/0630e650abdfea1792e4.js +0 -1
  202. package/assets/esri/core/workers/chunks/0edebc6c516f0b9dac7b.js +0 -1
  203. package/assets/esri/core/workers/chunks/25c5e1b14b184b1228a3.js +0 -1
  204. package/assets/esri/core/workers/chunks/2e0fd0536408053ac6f5.js +0 -1
  205. package/assets/esri/core/workers/chunks/573e8fa0af8711ffec45.js +0 -1
  206. package/assets/esri/core/workers/chunks/5b9925f23d4b10a7087e.js +0 -1
  207. package/assets/esri/core/workers/chunks/66c46c5a7147550ea3ed.js +0 -1
  208. package/assets/esri/core/workers/chunks/6c7cb7974969e3167f2b.js +0 -1
  209. package/assets/esri/core/workers/chunks/729d458e9e28641227cd.js +0 -1
  210. package/assets/esri/core/workers/chunks/7bbc3d22383388d11345.js +0 -1
  211. package/assets/esri/core/workers/chunks/7edf57e31ff07af9032b.js +0 -1
  212. package/assets/esri/core/workers/chunks/8bd187b48a4e4296e3d8.js +0 -1
  213. package/assets/esri/core/workers/chunks/9acaabe950319d031f2e.js +0 -1
  214. package/assets/esri/core/workers/chunks/ac02df176f9ea94278bb.js +0 -1
  215. package/assets/esri/core/workers/chunks/b4222152efaf73b37b53.js +0 -1
  216. package/assets/esri/core/workers/chunks/c0855be20ffcd52c7026.js +0 -1
  217. package/assets/esri/core/workers/chunks/e606be4ece4eac1e9bbe.js +0 -1
  218. package/assets/esri/core/workers/chunks/f05622413cadfd14553e.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../../../core/has.js";import{NestedMap as e}from"../../../../core/NestedMap.js";function t(t){const i=new e;if(i.set(2,4,!0),i.set(2,0,!0),i.set(2,2,!0),i.set(2,1,!0),i.set(2,8,!0),"high"!==t&&i.set(2,3,!0),"low"!==t&&(i.set(2,5,!0),i.set(2,6,!0)),"medium"===t)for(const e of s)i.set(0,e,!0),i.set(1,e,!0),i.set(2,e,!0);else if("high"===t){const e=has("disable-feature:global-illumination")?3:11;for(const t of[...o,e])i.set(0,t,!0),i.set(1,t,!0),i.set(2,t,!0);11===e&&i.set(2,10,!0)}return i}const s=[9,7],o=[...s,0,2,4];export{t as setupFeatureDefaults};
2
+ import has from"../../../../core/has.js";import{NestedMap as e}from"../../../../core/NestedMap.js";function t(t){const i=new e;if(i.set(2,4,!0),i.set(2,0,!0),i.set(2,2,!0),i.set(2,1,!0),i.set(2,8,!0),"high"===t){const e=has("disable-feature:global-illumination")?3:11;i.set(0,e,!0),i.set(1,e,!0),i.set(2,e,!0),11===e&&i.set(2,10,!0)}else i.set(2,3,!0);if("low"!==t&&(i.set(2,5,!0),i.set(2,6,!0)),"medium"===t)for(const e of s)i.set(0,e,!0),i.set(1,e,!0),i.set(2,e,!0);else if("high"===t)for(const e of o)i.set(0,e,!0),i.set(1,e,!0),i.set(2,e,!0);return i}const s=[9,7],o=[...s,0,2,4];export{t as setupFeatureDefaults};
@@ -1,13 +1,13 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{fromValues as o}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{IsNaN as r}from"../../core/shaderLibrary/util/IsNaN.glsl.js";import{Float2BindUniform as e}from"../../core/shaderModules/Float2BindUniform.js";import{glsl as a}from"../../core/shaderModules/glsl.js";import{Matrix3PassUniform as s}from"../../core/shaderModules/Matrix3PassUniform.js";import{Matrix4BindUniform as t}from"../../core/shaderModules/Matrix4BindUniform.js";const l=o(.5,-4e-4);function i(o,i){const c=o.vertex;c.include(r),c.constants.add("depthBias","vec2",l),c.uniforms.add(new e("inverseViewport",o=>o.inverseViewport)),i.legacy?(c.uniforms.add(new t("proj",o=>o.camera.projectionMatrix)),c.code.add(a`vec2 calculateProjectedBiasXY(vec4 projPos, vec3 globalNormal) {
2
+ import{fromValues as o}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{projMatrix as r}from"../../core/shaderLibrary/util/cameraUniforms.js";import{IsNaN as e}from"../../core/shaderLibrary/util/IsNaN.glsl.js";import{Float2BindUniform as a}from"../../core/shaderModules/Float2BindUniform.js";import{glsl as s}from"../../core/shaderModules/glsl.js";import{Matrix3PassUniform as t}from"../../core/shaderModules/Matrix3PassUniform.js";import{Matrix4BindUniform as l}from"../../core/shaderModules/Matrix4BindUniform.js";const i=o(.5,-4e-4);function c(o,c){const m=o.vertex;m.include(e),m.constants.add("depthBias","vec2",i),m.uniforms.add(new a("inverseViewport",o=>o.inverseViewport)),c.legacy?(m.uniforms.add(r),m.code.add(s`vec2 calculateProjectedBiasXY(vec4 projPos, vec3 globalNormal) {
3
3
  float offsetXY = depthBias.x;
4
4
  vec4 projNormal = proj * localView * vec4(globalNormal, 0.0);
5
5
  return offsetXY * projPos.w * 2.0 * inverseViewport * normalize(projNormal.xyz).xy;
6
- }`)):(c.uniforms.add(new s("transformNormalViewFromGlobal",o=>o.transformNormalViewFromGlobal),new t("transformProjFromView",o=>o.camera.projectionMatrix)),c.code.add(a`vec2 calculateProjectedBiasXY(vec4 projPos, vec3 globalNormal) {
6
+ }`)):(m.uniforms.add(new t("transformNormalViewFromGlobal",o=>o.transformNormalViewFromGlobal),new l("transformProjFromView",o=>o.camera.projectionMatrix)),m.code.add(s`vec2 calculateProjectedBiasXY(vec4 projPos, vec3 globalNormal) {
7
7
  float offsetXY = depthBias.x;
8
8
  vec4 projNormal = transformProjFromView * vec4(transformNormalViewFromGlobal * globalNormal, 0.0);
9
9
  return offsetXY * projPos.w * 2.0 * inverseViewport * normalize(projNormal.xyz).xy;
10
- }`)),c.code.add(a`float _calculateProjectedBiasZ(vec4 projPos) {
10
+ }`)),m.code.add(s`float _calculateProjectedBiasZ(vec4 projPos) {
11
11
  float offsetZ = depthBias.y;
12
12
  return sqrt(max(projPos.z,0.0)) * offsetZ;
13
13
  }
@@ -18,4 +18,4 @@ projPos.xy += offsetXY;
18
18
  }
19
19
  projPos.z += _calculateProjectedBiasZ(projPos);
20
20
  return projPos;
21
- }`)}export{i as AdjustProjectedPosition};
21
+ }`)}export{c as AdjustProjectedPosition};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../core/shaderLibrary/Slice.glsl.js";import"../../core/shaderModules/Float2BindUniform.js";import"../../core/shaderModules/Float4BindUniform.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"./AdjustProjectedPosition.glsl.js";import"./DiscardNonSilhouetteEdges.glsl.js";import"./EdgeUtil.glsl.js";import"./LineAmplitude.glsl.js";import"./LineOffset.glsl.js";import"./UnpackAttributes.glsl.js";import"../../../../webgl/ShaderBuilder.js";import"../../../../webgl/Uniform.js";export{b as build}from"../../../../../chunks/EdgeShader.glsl.js";
2
+ import"../../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../core/shaderLibrary/Slice.glsl.js";import"../../core/shaderLibrary/util/cameraUniforms.js";import"../../core/shaderModules/Float2BindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"./AdjustProjectedPosition.glsl.js";import"./DiscardNonSilhouetteEdges.glsl.js";import"./EdgeUtil.glsl.js";import"./LineAmplitude.glsl.js";import"./LineOffset.glsl.js";import"./UnpackAttributes.glsl.js";import"../../../../webgl/ShaderBuilder.js";import"../../../../webgl/Uniform.js";export{b as build}from"../../../../../chunks/EdgeShader.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{LineMaterial as s}from"../lib/LineMaterial.js";import{MaterialParameters as n}from"../lib/Material.js";import{writeBufferVec2 as a,writePosition as o,writeNormal as l,writeBufferVec3 as c,writeBufferFloat as u}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as h,layout as f,baseLayout as p}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as d}from"../shaders/LineCalloutTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class m extends s{constructor(e,t){super(e,b),this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[15,e=>r(e)],[16,e=>r(e)]]),this._configuration=new d(t),this._uniqueMaterialIdentifier=S(this.parameters)}passParameters(){return this.parameters}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hudDepth=16===e.slot,this._configuration.hudDepthAlignStart=!!this.parameters.hudDepthAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane}get visible(){return this.parameters.color[3]>=g||(this.parameters.borderColor?.[3]??0)>=g}intersectRay(){}intersectScreenPolygon(){return null}createGLMaterial(e){return new O(e)}createBufferWriter(){return new $}validateParameters(e){this._uniqueMaterialIdentifier=S(e)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}}function S({renderOccluded:t,isDecoration:r,horizontalScreenOffset:i,color:s,size:n,shaderPolygonOffset:a,hudDepthAlignStart:o,centerOffsetUnits:l,hasSlicePlane:c,screenSizePerspective:u,verticalOffset:h,borderColor:f}){return e`${t}:${r}:${i}:[${s}]:${n}:${a}:${o}:${l}:${c}:${null!=u}:{${h?.screenLength}:${h?.minWorldLength}:${h?.maxWorldLength}}:[${f}]`}class O extends i{beginSlot(e){return this.getTechnique(h,e)}}class b extends n{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=t(0,0,0,1),this.size=1,this.shaderPolygonOffset=1e-5,this.hudDepthAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}class ${constructor(){this.layout=f,this.baseInstanceLayout=p}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}writeBaseInstance(e,t){const{uv0:r}=t;a(e.get("uv0"),r,0)}write(e,t,r,i){if(null==i)return;const{buffer:s,offset:n}=i;o(r.get("position"),e,s.position,n),l(r.get("normal"),t,s.normal,n),c(r.get("centerOffset"),s.centerOffset,n),u(r.get("groundDistance"),s.groundDistance,n)}}export{m as LineCalloutMaterial,b as Parameters,S as uniqueMaterialIdentifier};
2
+ import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{LineMaterial as s,LineMaterialParameters as n}from"../lib/LineMaterial.js";import{writeBufferVec2 as a,writePosition as o,writeNormal as c,writeBufferVec3 as l,writeBufferFloat as u}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as h,layout as f,baseLayout as p}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as d}from"../shaders/LineCalloutTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class m extends s{constructor(e,t){super(e,$),this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[15,e=>r(e)],[16,e=>r(e)]]),this._configuration=new d(t),this._uniqueMaterialIdentifier=S(this.parameters)}passParameters(){return this.parameters}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hudDepth=16===e.slot,this._configuration.hudDepthAlignStart=!!this.parameters.hudDepthAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane}get visible(){return this.parameters.color[3]>=g||(this.parameters.borderColor?.[3]??0)>=g}intersectRay(){}intersectScreenPolygon(){return null}createGLMaterial(e){return new O(e)}createBufferWriter(){return new b}validateParameters(e){this._uniqueMaterialIdentifier=S(e)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}}function S({renderOccluded:t,isDecoration:r,horizontalScreenOffset:i,color:s,size:n,shaderPolygonOffset:a,hudDepthAlignStart:o,centerOffsetUnits:c,hasSlicePlane:l,screenSizePerspective:u,verticalOffset:h,borderColor:f}){return e`${t}:${r}:${i}:[${s}]:${n}:${a}:${o}:${c}:${l}:${null!=u}:{${h?.screenLength}:${h?.minWorldLength}:${h?.maxWorldLength}}:[${f}]`}class O extends i{beginSlot(e){return this.getTechnique(h,e)}}class $ extends n{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=t(0,0,0,1),this.size=1,this.shaderPolygonOffset=1e-5,this.hudDepthAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}class b{constructor(){this.layout=f,this.baseInstanceLayout=p}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}writeBaseInstance(e,t){const{uv0:r}=t;a(e.get("uv0"),r,0)}write(e,t,r,i){if(null==i)return;const{buffer:s,offset:n}=i;o(r.get("position"),e,s.position,n),c(r.get("normal"),t,s.normal,n),l(r.get("centerOffset"),s.centerOffset,n),u(r.get("groundDistance"),s.groundDistance,n)}}export{m as LineCalloutMaterial,$ as Parameters,S as uniqueMaterialIdentifier};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as e,equals as t,transformMat4 as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColor as s,isDepth as a,isColorHighlightOLIDOrDepth as o}from"../core/shaderLibrary/ShaderOutput.js";import n from"../lib/GLMaterial.js";import{LineMaterial as h}from"../lib/LineMaterial.js";import{VisualVariablePassParameters as c}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as l}from"./internal/bufferWriterUtils.js";import{getLayout as m,LineMarkerTechnique as p}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as u}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";class f extends h{constructor(e,t){super(e,_),this.produces=new Map([[2,e=>10===e||s(e)&&8===this.parameters.renderOccluded],[3,e=>a(e)],[10,e=>o(e)&&8===this.parameters.renderOccluded],[11,e=>o(e)&&8===this.parameters.renderOccluded],[4,e=>s(e)],[18,e=>s(e)||10===e]]),this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this._configuration=new u(t)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.space=18===e.slot?0:this.parameters.worldSpace?2:1,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=0!==this.parameters.cap,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=e.hasOccludees,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.emissionSource=this.emissions?1:0,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.worldSized=18===e.slot&&this.parameters.worldSized,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective&&!this._configuration.worldSized}get visible(){return this.parameters.color[3]>=d}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}intersectRay(){}intersectScreenPolygon(){return null}createBufferWriter(){return new S(m(this.parameters),this.parameters)}createGLMaterial(e){return new g(e)}}class g extends n{dispose(){super.dispose(),this._markerTextures?.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(p,e)}}class _ extends c{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=0,this.anchor=0,this.hasTip=!1,this.worldSpace=!1,this.worldSized=!1,this.hideOnShortSegments=!1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.stipplePattern=null,this.markerTexture=null}}class S{constructor(e,t){this.layout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,s,a,o){if(null==o)return;const{buffer:n,offset:h}=o,c=a.get("position").data,m=c.length/3;let p=[1,0,0];const u=a.get("normal");this._parameters.worldSpace&&null!=u&&(p=u.data);let d=1,f=0;this._parameters.vvSize?f=a.get("sizeFeatureAttribute").data[0]:a.has("size")&&(d=a.get("size").data[0]);let g=[1,1,1,1],_=0;this._parameters.vvColor?_=a.get("colorFeatureAttribute").data[0]:a.has("color")&&(g=a.get("color").data);let S=0;this._parameters.vvOpacity&&(S=a.get("opacityFeatureAttribute").data[0]);const w=new Float32Array(n.buffer),P=new Float16Array(n.buffer),y=new Uint8Array(n.buffer);let O=h*(this.layout.stride/4);const T=w.BYTES_PER_ELEMENT/P.BYTES_PER_ELEMENT,V=4/T,k=(e,t,r,i)=>{w[O++]=e[0],w[O++]=e[1],w[O++]=e[2],l(t,e,P,O*T),O+=V;let s=O*T;if(P[s++]=r[0],P[s++]=r[1],O=Math.ceil(s/T),this._parameters.vvColor)w[O++]=_;else{const e=Math.min(4*i,g.length-4),t=4*O++;y[t]=255*g[e],y[t+1]=255*g[e+1],y[t+2]=255*g[e+2],y[t+3]=255*g[e+3]}this._parameters.vvOpacity&&(w[O++]=S),s=O*T,this._parameters.vvSize?(w[O++]=f,s+=2):P[s++]=d,this._parameters.worldSpace&&(P[s++]=p[0],P[s++]=p[1],P[s++]=p[2]),O=Math.ceil(s/T)},z=(s,a)=>{const o=e(v,c[3*s],c[3*s+1],c[3*s+2]),n=b;let h=s+a;do{e(n,c[3*h],c[3*h+1],c[3*h+2]),h+=a}while(t(o,n)&&h>=0&&h<m);i&&(r(o,o,i),r(n,n,i)),k(o,n,[-1,-1],s),k(o,n,[1,-1],s),k(o,n,[1,1],s),k(o,n,[-1,-1],s),k(o,n,[1,1],s),k(o,n,[-1,1],s)},M=this._parameters.placement;"begin"!==M&&"begin-end"!==M||z(0,1),"end"!==M&&"begin-end"!==M||z(m-1,-1)}}const v=i(),b=i();export{f as LineMarkerMaterial,_ as Parameters};
2
+ import{set as e,equals as t,transformMat4 as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColor as s,isDepth as a,isColorHighlightOLIDOrDepth as n}from"../core/shaderLibrary/ShaderOutput.js";import o from"../lib/GLMaterial.js";import{LineMaterial as h}from"../lib/LineMaterial.js";import{VisualVariablePassParameters as l}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as c}from"./internal/bufferWriterUtils.js";import{getLayout as m,LineMarkerTechnique as p}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as u}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";class f extends h{constructor(e,t){super(e,_),this.produces=new Map([[2,e=>10===e||s(e)&&8===this.parameters.renderOccluded],[3,e=>a(e)],[10,e=>n(e)&&8===this.parameters.renderOccluded],[11,e=>n(e)&&8===this.parameters.renderOccluded],[4,e=>s(e)],[18,e=>s(e)||10===e]]),this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this._configuration=new u(t)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=0!==this.parameters.cap,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.worldSpace=this.parameters.worldSpace&&!this._configuration.draped,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective&&!this._configuration.worldSized}get visible(){return this.parameters.color[3]>=d}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}intersectRay(){}intersectScreenPolygon(){return null}createBufferWriter(){return new v(m(this.parameters),this.parameters)}createGLMaterial(e){return new g(e)}}class g extends o{dispose(){super.dispose(),this._markerTextures?.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(p,e)}}class _ extends l{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.markerScale=1,this.placement="end",this.cap=0,this.anchor=0,this.hasTip=!1,this.worldSpace=!1,this.worldSized=!1,this.hideOnShortSegments=!1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.stipplePattern=null,this.markerTexture=null}}class v{constructor(e,t){this.layout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,s,a,n){if(null==n)return;const{buffer:o,offset:h}=n,l=a.get("position").data,m=l.length/3;let p=[1,0,0];const u=a.get("normal");this._parameters.worldSpace&&null!=u&&(p=u.data);let d=1,f=0;this._parameters.vvSize?f=a.get("sizeFeatureAttribute").data[0]:a.has("size")&&(d=a.get("size").data[0]);let g=[1,1,1,1],_=0;this._parameters.vvColor?_=a.get("colorFeatureAttribute").data[0]:a.has("color")&&(g=a.get("color").data);let v=0;this._parameters.vvOpacity&&(v=a.get("opacityFeatureAttribute").data[0]);const w=new Float32Array(o.buffer),P=new Float16Array(o.buffer),k=new Uint8Array(o.buffer);let T=h*(this.layout.stride/4);const y=w.BYTES_PER_ELEMENT/P.BYTES_PER_ELEMENT,M=4/y,j=(e,t,r,i)=>{w[T++]=e[0],w[T++]=e[1],w[T++]=e[2],c(t,e,P,T*y),T+=M;let s=T*y;if(P[s++]=r[0],P[s++]=r[1],T=Math.ceil(s/y),this._parameters.vvColor)w[T++]=_;else{const e=Math.min(4*i,g.length-4),t=4*T++;k[t]=255*g[e],k[t+1]=255*g[e+1],k[t+2]=255*g[e+2],k[t+3]=255*g[e+3]}this._parameters.vvOpacity&&(w[T++]=v),s=T*y,this._parameters.vvSize?(w[T++]=f,s+=2):P[s++]=d,this._parameters.worldSpace&&(P[s++]=p[0],P[s++]=p[1],P[s++]=p[2]),T=Math.ceil(s/y)},x=(s,a)=>{const n=e(S,l[3*s],l[3*s+1],l[3*s+2]),o=b;let h=s+a;do{e(o,l[3*h],l[3*h+1],l[3*h+2]),h+=a}while(t(n,o)&&h>=0&&h<m);i&&(r(n,n,i),r(o,o,i)),j(n,o,[-1,-1],s),j(n,o,[1,-1],s),j(n,o,[1,1],s),j(n,o,[-1,-1],s),j(n,o,[1,1],s),j(n,o,[-1,1],s)},E=this._parameters.placement;"begin"!==E&&"begin-end"!==E||x(0,1),"end"!==E&&"begin-end"!==E||x(m-1,-1)}}const S=i(),b=i();export{f as LineMarkerMaterial,_ as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as t,normalize as e,subtract as r,cross as s,distance as o,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as l}from"../core/shaderLibrary/ShaderOutput.js";import c from"../lib/GLMaterial.js";import{LineMaterial as u}from"../lib/LineMaterial.js";import{MaterialParameters as p}from"../lib/Material.js";import{MeasurementArrowTechnique as f,layout as h}from"../shaders/MeasurementArrowTechnique.js";import{MeasurementArrowTechniqueConfiguration as m}from"../shaders/MeasurementArrowTechniqueConfiguration.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";class g extends u{constructor(t){super(t,b),this._configuration=new m,this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,t=>!this._transparent&&l(t)],[8,t=>this._transparent&&l(t)]])}updateConfiguration(t){super.updateConfiguration(t),this._configuration.enableOITOffset=t.enableOITOffset,this._configuration.transparent=this._transparent,this._configuration.writeDepth=2===t.slot}get visible(){const{outlineColor:t,stripeEvenColor:e,stripeOddColor:r}=this.parameters;return t[3]>=d||e[3]>=d||r[3]>=d}intersectRay(){}intersectScreenPolygon(){return null}createGLMaterial(t){return new C(t)}createBufferWriter(){return new _}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class C extends c{beginSlot(t){return this.getTechnique(f,t)}}class b extends p{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1}}const w=n(),j=n(),v=n(),M=n(),O=n();class _{constructor(){this.layout=h}elementCount(t){return 2*(t.get("position").indices.length/2+1)}write(n,a,l,c){if(null==c)return;const{buffer:u,offset:p}=c,{data:f,indices:h}=l.get("position"),m=l.get("normal").data,d=f.length/3;h&&h.length!==2*(d-1)&&console.warn("MeasurementArrowMaterial does not support indices");const g=w,C=j,b=v,_=M,x=O,y=u.position,L=u.normal,S=u.uv0;let T=0;for(let w=0;w<d;++w){const l=3*w;if(t(g,f[l],f[l+1],f[l+2]),w<d-1){const o=3*(w+1);t(C,f[o],f[o+1],f[o+2]),t(x,m[o],m[o+1],m[o+2]),e(x,x),r(b,C,g),e(b,b),s(_,x,b),e(_,_)}const c=o(g,C);n&&a&&(i(g,g,n),i(C,C,n),i(_,_,a));const u=p+2*w,h=u+1;y.setVec(u,g),y.setVec(h,g),L.setVec(u,_),L.setVec(h,_),S.set(u,0,T),S.set(u,1,-1),S.set(h,0,T),S.set(h,1,1),w<d-1&&(T+=c)}const A=u.length;for(let t=0;t<2*d;++t)A.set(p+t,T)}}export{g as MeasurementArrowMaterial,b as Parameters};
2
+ import{set as t,normalize as e,subtract as r,cross as s,distance as o,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as c}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{LineMaterial as u,LineMaterialParameters as p}from"../lib/LineMaterial.js";import{MeasurementArrowTechnique as f,layout as h}from"../shaders/MeasurementArrowTechnique.js";import{MeasurementArrowTechniqueConfiguration as m}from"../shaders/MeasurementArrowTechniqueConfiguration.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";class g extends u{constructor(t,e){super(t,b),this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,t=>!this._transparent&&c(t)],[8,t=>this._transparent&&c(t)]]),this._configuration=new m(e)}updateConfiguration(t){super.updateConfiguration(t),this._configuration.enableOITOffset=t.enableOITOffset,this._configuration.transparent=this._transparent,this._configuration.writeDepth=2===t.slot}get visible(){const{outlineColor:t,stripeEvenColor:e,stripeOddColor:r}=this.parameters;return t[3]>=d||e[3]>=d||r[3]>=d}intersectRay(){}intersectScreenPolygon(){return null}createGLMaterial(t){return new C(t)}createBufferWriter(){return new _}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class C extends l{beginSlot(t){return this.getTechnique(f,t)}}class b extends p{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1}}const w=n(),v=n(),j=n(),M=n(),O=n();class _{constructor(){this.layout=h}elementCount(t){return 2*(t.get("position").indices.length/2+1)}write(n,a,c,l){if(null==l)return;const{buffer:u,offset:p}=l,{data:f,indices:h}=c.get("position"),m=c.get("normal").data,d=f.length/3;h&&h.length!==2*(d-1)&&console.warn("MeasurementArrowMaterial does not support indices");const g=w,C=v,b=j,_=M,x=O,y=u.position,L=u.normal,S=u.uv0;let T=0;for(let w=0;w<d;++w){const c=3*w;if(t(g,f[c],f[c+1],f[c+2]),w<d-1){const o=3*(w+1);t(C,f[o],f[o+1],f[o+2]),t(x,m[o],m[o+1],m[o+2]),e(x,x),r(b,C,g),e(b,b),s(_,x,b),e(_,_)}const l=o(g,C);n&&a&&(i(g,g,n),i(C,C,n),i(_,_,a));const u=p+2*w,h=u+1;y.setVec(u,g),y.setVec(h,g),L.setVec(u,_),L.setVec(h,_),S.set(u,0,T),S.set(u,1,-1),S.set(h,0,T),S.set(h,1,1),w<d-1&&(T+=l)}const A=u.length;for(let t=0;t<2*d;++t)A.set(p+t,T)}}export{g as MeasurementArrowMaterial,b as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{clamp as r}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as t,createScreenPointArray as o}from"../../../../core/screenUtils.js";import{copy as i,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as a,subtract as c,dot as l,scale as f,add as m,copy as u,length as p,distance as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as d}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{distance2 as j,fromPoints as b,closestLineSegmentPoint as y,projectPoint as v,create as x}from"../../../../geometry/support/lineSegment.js";import{fromPoints as L,signedDistance as S,getNormal as M,create as w}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOLID as P}from"../core/shaderLibrary/ShaderOutput.js";import T from"../lib/GLMaterial.js";import{LineMaterial as C}from"../lib/LineMaterial.js";import{MaterialParameters as R}from"../lib/Material.js";import{projectWorldLineSegmentToRenderScreen as V,screenPolygonIntersectsBufferedSegment as _}from"../lib/screenPolygonOverlapUtils.js";import{Hit as A,DrapedHit as N}from"../lib/screenPolygonTriangleIntersections.js";import{isTranslationMatrix as U}from"../lib/Util.js";import{DefaultBufferWriter as D}from"./DefaultBufferWriter.js";import{PositionColorLayout as E,PositionLayout as O}from"./DefaultLayouts.js";import{NativeLineTechnique as q}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as B}from"../shaders/NativeLineTechniqueConfiguration.js";import{alphaCutoff as X}from"../../../../webscene/support/AlphaCutoff.js";class F extends C{constructor(e){super(e,k),this._configuration=new B,this.produces=new Map([[2,e=>P(e)]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=e.hasOccludees}get visible(){return this.parameters.color[3]>=X}intersectRay(r,t,o,s,n,h){const{options:d,camera:v,rayBegin:x,rayEnd:w}=o;if(!d.selectionMode||!r.visible||!v)return;if(!U(t))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const P=r.attributes.get("position").data,T=oe;i(T,o.point);const C=ge*v.pixelRatio;a(ce[0],T[0]-C,T[1]+C,0),a(ce[1],T[0]+C,T[1]+C,0),a(ce[2],T[0]+C,T[1]-C,0),a(ce[3],T[0]-C,T[1]-C,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(ce[e],le[e]))return;L(v.eye,le[0],le[1],fe),L(v.eye,le[1],le[2],me),L(v.eye,le[2],le[3],ue),L(v.eye,le[3],le[0],pe);let R=Number.MAX_VALUE,V=0;for(const e of I(H,J,P,t)){if(S(fe,H)<0&&S(fe,J)<0||S(me,H)<0&&S(me,J)<0||S(ue,H)<0&&S(ue,J)<0||S(pe,H)<0&&S(pe,J)<0)continue;const r=v.projectToRenderScreen(H,Y),t=v.projectToRenderScreen(J,Z);if(null==r||null==t)continue;if(r[2]<0&&t[2]>0){c(K,H,J);const e=v.frustum,t=-S(e[4],H)/l(K,M(e[4]));if(f(K,K,t),m(H,H,K),!v.projectToRenderScreen(H,r))continue}else if(r[2]>0&&t[2]<0){c(K,J,H);const e=v.frustum,r=-S(e[4],J)/l(K,M(e[4]));if(f(K,K,r),m(J,J,K),!v.projectToRenderScreen(J,t))continue}else if(r[2]<0&&t[2]<0)continue;r[2]=0,t[2]=0;const o=j(b(r,t,re),T);o<R&&(R=o,u($,H),u(ee,J),V=e)}if(R<C*C){let e=Number.MAX_VALUE;if(y(b($,ee,re),b(x,w,te),Q)){c(Q,Q,x);const r=p(Q);f(Q,Q,1/r),e=r/g(x,w)}h(e,e,Q,V)}}intersectScreenPolygon(r,t,o,i){const{options:s,camera:n,screenPolygonPrimitiveProcessor:a}=o;if(!s.selectionMode||!r.visible)return null;if(!U(t))return e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix"),null;const c=r.attributes.get("position").data,l=new A(4);for(const e of I(H,J,c,t))for(const[r,t]of a.processLineSegment(he,H,J))V(n,r,t,Y,Z)&&(n.renderToScreen(Y,ie),n.renderToScreen(Z,se),_(i,ie,se,ge)&&(v(b(r,t,te),n.eye,oe),l.updateIfCloserFromValues(g(n.eye,oe),e,oe,null)));return l}intersectRayDraped(e,t,o,i,s,n){if(!t.options.selectionMode)return;const a=o[0],c=o[1],l=W(e,n);let f=Number.MAX_VALUE,m=0;for(const u of z(ne,ae,e)){const e=a-ne[0],t=c-ne[1],o=ae[0]-ne[0],i=ae[1]-ne[1],s=r((o*e+i*t)/(o*o+i*i),0,1),n=o*s-e,l=i*s-t,p=n*n+l*l;p<f&&(f=p,m=u)}f<l*l&&i(s.distance,s.renderDistance,s.normal,m)}intersectScreenPolygonDraped(e,r,t,o,i){if(!t.options.selectionMode)return null;const s=W(e,i);for(const n of z(ne,ae,e,r))if(_(o,ne,ae,s))return new N(n);return null}createGLMaterial(e){return new G(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?E:O;return new D(e)}}class G extends T{beginSlot(e){return this.getTechnique(q,e)}}function*I(e,r,t,o){for(let i=0;i<t.length-5;i+=3)e[0]=t[i]+o[12],e[1]=t[i+1]+o[13],e[2]=t[i+2]+o[14],r[0]=t[i+3]+o[12],r[1]=t[i+4]+o[13],r[2]=t[i+5]+o[14],yield i/3}function W(e,r){const t=e.attributes.get("size");return(((t?t.data[0]:0)+1)/2+4)*r}function*z(e,r,t,o){const n=t.attributes.get("position").data,a=o?.[0]??0,c=o?.[1]??0;s(e,n[0]+a,n[1]+c);for(let l=3;l<n.length-2;l+=3){const t=l%n.length;s(r,n[t]+a,n[t+1]+c),yield l/3,i(e,r)}}class k extends R{constructor(){super(...arguments),this.color=d,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1}}const H=h(),J=h(),K=h(),Q=h(),Y=t(),Z=t(),$=h(),ee=h(),re=x(),te=x(),oe=h(),ie=o(),se=o(),ne=n(),ae=n(),ce=[t(),t(),t(),t()],le=[h(),h(),h(),h()],fe=w(),me=w(),ue=w(),pe=w(),ge=2,he=[h(),h()];export{F as NativeLineMaterial,k as Parameters};
2
+ import e from"../../../../core/Logger.js";import{clamp as r}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as t,createScreenPointArray as o}from"../../../../core/screenUtils.js";import{copy as i,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as a,subtract as c,dot as l,scale as f,add as m,copy as u,length as p,distance as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as d}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{distance2 as j,fromPoints as b,closestLineSegmentPoint as y,projectPoint as v,create as x}from"../../../../geometry/support/lineSegment.js";import{fromPoints as L,signedDistance as S,getNormal as w,create as M}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOLID as P}from"../core/shaderLibrary/ShaderOutput.js";import T from"../lib/GLMaterial.js";import{LineMaterial as C,LineMaterialParameters as R}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as V,screenPolygonIntersectsBufferedSegment as A}from"../lib/screenPolygonOverlapUtils.js";import{Hit as N,DrapedHit as U}from"../lib/screenPolygonTriangleIntersections.js";import{isTranslationMatrix as _}from"../lib/Util.js";import{DefaultBufferWriter as D}from"./DefaultBufferWriter.js";import{PositionColorLayout as E,PositionLayout as q}from"./DefaultLayouts.js";import{NativeLineTechnique as B}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as X}from"../shaders/NativeLineTechniqueConfiguration.js";import{alphaCutoff as F}from"../../../../webscene/support/AlphaCutoff.js";class G extends C{constructor(e){super(e,k),this._configuration=new X(!0),this.produces=new Map([[2,e=>P(e)]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1}get visible(){return this.parameters.color[3]>=F}intersectRay(r,t,o,s,n,h){const{options:d,camera:v,rayBegin:x,rayEnd:M}=o;if(!d.selectionMode||!r.visible||!v)return;if(!_(t))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const P=r.attributes.get("position").data,T=oe;i(T,o.point);const C=ge*v.pixelRatio;a(ce[0],T[0]-C,T[1]+C,0),a(ce[1],T[0]+C,T[1]+C,0),a(ce[2],T[0]+C,T[1]-C,0),a(ce[3],T[0]-C,T[1]-C,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(ce[e],le[e]))return;L(v.eye,le[0],le[1],fe),L(v.eye,le[1],le[2],me),L(v.eye,le[2],le[3],ue),L(v.eye,le[3],le[0],pe);let R=Number.MAX_VALUE,V=0;for(const e of O(H,J,P,t)){if(S(fe,H)<0&&S(fe,J)<0||S(me,H)<0&&S(me,J)<0||S(ue,H)<0&&S(ue,J)<0||S(pe,H)<0&&S(pe,J)<0)continue;const r=v.projectToRenderScreen(H,Y),t=v.projectToRenderScreen(J,Z);if(null==r||null==t)continue;if(r[2]<0&&t[2]>0){c(K,H,J);const e=v.frustum,t=-S(e[4],H)/l(K,w(e[4]));if(f(K,K,t),m(H,H,K),!v.projectToRenderScreen(H,r))continue}else if(r[2]>0&&t[2]<0){c(K,J,H);const e=v.frustum,r=-S(e[4],J)/l(K,w(e[4]));if(f(K,K,r),m(J,J,K),!v.projectToRenderScreen(J,t))continue}else if(r[2]<0&&t[2]<0)continue;r[2]=0,t[2]=0;const o=j(b(r,t,re),T);o<R&&(R=o,u($,H),u(ee,J),V=e)}if(R<C*C){let e=Number.MAX_VALUE;if(y(b($,ee,re),b(x,M,te),Q)){c(Q,Q,x);const r=p(Q);f(Q,Q,1/r),e=r/g(x,M)}h(e,e,Q,V)}}intersectScreenPolygon(r,t,o,i){const{options:s,camera:n,screenPolygonPrimitiveProcessor:a}=o;if(!s.selectionMode||!r.visible)return null;if(!_(t))return e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix"),null;const c=r.attributes.get("position").data,l=new N(4);for(const e of O(H,J,c,t))for(const[r,t]of a.processLineSegment(he,H,J))V(n,r,t,Y,Z)&&(n.renderToScreen(Y,ie),n.renderToScreen(Z,se),A(i,ie,se,ge)&&(v(b(r,t,te),n.eye,oe),l.updateIfCloserFromValues(g(n.eye,oe),e,oe,null)));return l}intersectRayDraped(e,t,o,i,s,n){if(!t.options.selectionMode)return;const a=o[0],c=o[1],l=W(e,n);let f=Number.MAX_VALUE,m=0;for(const u of z(ne,ae,e)){const e=a-ne[0],t=c-ne[1],o=ae[0]-ne[0],i=ae[1]-ne[1],s=r((o*e+i*t)/(o*o+i*i),0,1),n=o*s-e,l=i*s-t,p=n*n+l*l;p<f&&(f=p,m=u)}f<l*l&&i(s.distance,s.renderDistance,s.normal,m)}intersectScreenPolygonDraped(e,r,t,o,i){if(!t.options.selectionMode)return null;const s=W(e,i);for(const n of z(ne,ae,e,r))if(A(o,ne,ae,s))return new U(n);return null}createGLMaterial(e){return new I(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?E:q;return new D(e)}}class I extends T{beginSlot(e){return this.getTechnique(B,e)}}function*O(e,r,t,o){for(let i=0;i<t.length-5;i+=3)e[0]=t[i]+o[12],e[1]=t[i+1]+o[13],e[2]=t[i+2]+o[14],r[0]=t[i+3]+o[12],r[1]=t[i+4]+o[13],r[2]=t[i+5]+o[14],yield i/3}function W(e,r){const t=e.attributes.get("size");return(((t?t.data[0]:0)+1)/2+4)*r}function*z(e,r,t,o){const n=t.attributes.get("position").data,a=o?.[0]??0,c=o?.[1]??0;s(e,n[0]+a,n[1]+c);for(let l=3;l<n.length-2;l+=3){const t=l%n.length;s(r,n[t]+a,n[t+1]+c),yield l/3,i(e,r)}}class k extends R{constructor(){super(...arguments),this.color=d,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1}}const H=h(),J=h(),K=h(),Q=h(),Y=t(),Z=t(),$=h(),ee=h(),re=x(),te=x(),oe=h(),ie=o(),se=o(),ne=n(),ae=n(),ce=[t(),t(),t(),t()],le=[h(),h(),h(),h()],fe=M(),me=M(),ue=M(),pe=M(),ge=2,he=[h(),h()];export{G as NativeLineMaterial,k as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../effects/snowcover/SnowCover.glsl.js";import"../shaders/OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/Path.glsl.js";
2
+ import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../effects/snowcover/SnowCover.glsl.js";import"../shaders/OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/Path.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isOITColorAlpha as t}from"../core/shaderLibrary/ShaderOutput.js";const n=2,o=1,r=i(-1),f=i(1),u=r,e=new Array;e[0]=null,e[1]=f,e[2]=r,e[3]=i(-2),e[4]=i(-3);const s=e.map(t=>a(u,t));function c({output:n,enableOITOffset:o,polygonOffset:r}){return t(n)&&o?s[r]:e[r]}function a(t,n){return n?{factor:t.factor+n.factor,units:t.units+n.units}:t}function i(t){return{factor:o*t,units:n*t}}function p(t){const n=c(t)??{factor:0,units:0};return{factor:n.factor+r.factor*t.polygonOffsetIndex,units:n.units+r.units*t.polygonOffsetIndex}}e[1]=f;export{p as getRibbonLineLayerPolygonOffset,c as polygonOffset};
2
+ import{isOITColorAlpha as t}from"../core/shaderLibrary/ShaderOutput.js";const n=2,o=1,r=p(-1),f=p(1),u={factor:0,units:-10},s=r,c=new Array;c[0]=null,c[1]=f,c[2]=r,c[3]=p(-2),c[4]=p(-3);const e=c.map(t=>i(s,t));function a({output:n,enableOITOffset:o,polygonOffset:r}){return t(n)&&o?e[r]:c[r]}function i(t,n){return n?{factor:t.factor+n.factor,units:t.units+n.units}:t}function p(t){return{factor:o*t,units:n*t}}function l(t){const n=a(t)??{factor:0,units:0};return{factor:n.factor+r.factor*t.polygonOffsetIndex,units:n.units+r.units*t.polygonOffsetIndex}}c[1]=f;export{l as getRibbonLineLayerPolygonOffset,u as lineMarkerPolygonOffset,a as polygonOffset};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as n}from"../../../../core/time.js";import{copy as a,set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c,subtract as p,dot as u,scale as m,add as h,copy as f,length as d,distance as g,lerp as b,transformMat4 as _,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as E,distance2 as w,closestLineSegmentPoint as v,projectPoint as x,projectPointFraction as T,create as z}from"../../../../geometry/support/lineSegment.js";import{fromPoints as j,signedDistance as L,getNormal as A,create as C}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as M,BufferViewFloat as V,BufferViewVec4Unorm8 as O,BufferViewVec4f16 as F,BufferViewUint32 as R}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as B,isColor as I,isDepth as U,isColorHighlightOLIDOrDepth as N,is2DGeometryOutput as k}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as W}from"../effects/geometry/olidUtils.js";import D from"../lib/GLMaterial.js";import{LineMaterial as Y}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as J,screenPolygonIntersectsBufferedSegment as q}from"../lib/screenPolygonOverlapUtils.js";import{Hit as G,DrapedHit as X}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as H}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as K,assert as Q}from"../lib/Util.js";import{isImagePattern as Z}from"./lineStippleUtils.js";import{VisualVariablePassParameters as $}from"./VisualVariablePassParameters.js";import{writeColor as ee}from"./internal/bufferWriterUtils.js";import{n as te}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as ie,getTextureBufferLayout as re}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as se}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as ne}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class oe extends Y{constructor(e,t){super(e,ce),this.produces=new Map([[2,e=>B(e)||I(e)&&8===this.parameters.renderOccluded],[3,e=>U(e)],[10,e=>N(e)&&8===this.parameters.renderOccluded],[11,e=>N(e)&&8===this.parameters.renderOccluded],[4,e=>I(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>I(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>k(e)]]),this._configuration=new ne(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&this.parameters.isImagePattern(),s=t&&(this.parameters.worldSized||r);this._configuration.draped=t,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=ge(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&de(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.pbrMode=this.parameters.shadingEnabled?2:0,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!s,this._configuration.worldSized=s,this._configuration.imagePattern=r,I(e.output)&&this.parameters.shadingEnabled?(this._configuration.receiveAmbientOcclusion=null!=e.ssao,this._configuration.receiveGlobalIllumination=e.globalIlluminationEnabled):this._configuration.receiveAmbientOcclusion=this._configuration.receiveGlobalIllumination=!1}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},i,r,s,n,a){if(!i.options.selectionMode)return;const o=this._getLineSize(e,!0),l=r[0],c=r[1],p=he(o,a,this.parameters.worldSized);let u=Number.MAX_VALUE,m=0;for(const h of fe(Pe,ye,this.parameters,e)){const e=l-Pe[0],i=c-Pe[1],r=ye[0]-Pe[0],s=ye[1]-Pe[1],n=t((r*e+s*i)/(r*r+s*s),0,1),a=r*n-e,o=s*n-i,p=a*a+o*o;p<u&&(u=p,m=h)}u<p*p&&s(n.distance,n.renderDistance,n.normal,m)}intersectRay(t,i,r,s,n,o){const{options:l,camera:b,rayBegin:_,rayEnd:S}=r;if(!l.selectionMode||!t.visible||!b)return;if(!K(i))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,x=this._getLineSize(P),T=ze;a(T,r.point);const z=x*b.pixelRatio,C=Ye*b.pixelRatio,M=z/2+C;c(Ie[0],T[0]-M,T[1]+M,0),c(Ie[1],T[0]+M,T[1]+M,0),c(Ie[2],T[0]+M,T[1]-M,0),c(Ie[3],T[0]-M,T[1]-M,0);for(let e=0;e<4;e++)if(!b.unprojectFromRenderScreen(Ie[e],Ue[e]))return;j(b.eye,Ue[0],Ue[1],Ne),j(b.eye,Ue[1],Ue[2],ke),j(b.eye,Ue[2],Ue[3],We),j(b.eye,Ue[3],Ue[0],De);let V=Number.MAX_VALUE,O=0;for(const e of this._forEachTransformedLineSegment(_e,Se,y,i,me(this.parameters,P))){if(L(Ne,_e)<0&&L(Ne,Se)<0||L(ke,_e)<0&&L(ke,Se)<0||L(We,_e)<0&&L(We,Se)<0||L(De,_e)<0&&L(De,Se)<0)continue;const t=b.projectToRenderScreen(_e,je),i=b.projectToRenderScreen(Se,Le);if(null==t||null==i)continue;if(t[2]<0&&i[2]>0){p(xe,_e,Se);const e=b.frustum,i=-L(e[4],_e)/u(xe,A(e[4]));if(m(xe,xe,i),h(_e,_e,xe),!b.projectToRenderScreen(_e,t))continue}else if(t[2]>0&&i[2]<0){p(xe,Se,_e);const e=b.frustum,t=-L(e[4],Se)/u(xe,A(e[4]));if(m(xe,xe,t),h(Se,Se,xe),!b.projectToRenderScreen(Se,i))continue}else if(t[2]<0&&i[2]<0)continue;t[2]=0,i[2]=0;const r=E(t,i,Oe),s=w(r,T);if(!(s>=V)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(r,_e,Se,T,b,x,C);if(s>=e*e)continue}V=s,f(Me,_e),f(Ve,Se),O=e}}if(V<M*M){let e=Number.MAX_VALUE;if(v(E(Me,Ve,Oe),E(_,S,Fe),Te)){p(Te,Te,_);const t=d(Te);m(Te,Te,1/t),e=t/g(_,S)}o(e,e,Te,O)}}intersectScreenPolygon(t,i,r,s){const{options:n,camera:a,screenPolygonPrimitiveProcessor:o}=r;if(!n.selectionMode||!t.visible)return null;if(!K(i))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,c=l.get("position").data,p=this._getLineSize(l),u=Ye,m=u*a.pixelRatio,h=new G(4);for(const e of this._forEachTransformedLineSegment(_e,Se,c,i,me(this.parameters,l)))for(const[t,i]of o.processLineSegment(Je,_e,Se)){if(!J(a,t,i,je,Le))continue;const r=E(je,Le,Oe);let n=p/2+u;this.parameters.screenSizePerspective&&(b(ze,je,Le,.5),n=Math.max(n,this.computeScreenSizePerspectiveWidth(r,t,i,ze,a,p,m)/a.pixelRatio)),a.renderToScreen(je,Ae),a.renderToScreen(Le,Ce),q(s,Ae,Ce,n)&&(x(E(t,i,Fe),a.eye,Ee),h.updateIfCloserFromValues(g(a.eye,Ee),e,Ee,null))}return h}intersectScreenPolygonDraped({attributes:e},t,i,r,s){if(!i.options.selectionMode)return null;const n=he(this._getLineSize(e,!0),s,this.parameters.worldSized);for(const a of fe(Pe,ye,this.parameters,e,t))if(q(r,Pe,ye,n))return new X(a);return null}createBufferWriter(){return new pe(ie(this.parameters),re(this.parameters),this.parameters)}createGLMaterial(e){return new le(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,s,n,a){const o=T(e,r);b(Ee,t,i,o),_(we,Ee,s.viewMatrix);const l=d(we),c=this.computeCameraAbsCosAngle(Ee,s,this._configuration.spherical);be.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return be.apply(n)*s.pixelRatio/2+a}computeCameraAbsCosAngle(e,t,i){return i?S(Te,e):c(Te,0,0,1),p(ve,e,t.eye),S(ve,ve),Math.abs(u(Te,ve))}_getLineSize(e,i=!1){let r=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?i&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(r*=e.get("size").data[0]);return r}*_forEachTransformedLineSegment(e,t,i,r,s){const n=s?i.length-2:i.length-5;for(let a=0;a<n;a+=3){e[0]=i[a]+r[12],e[1]=i[a+1]+r[13],e[2]=i[a+2]+r[14];const s=(a+3)%i.length;t[0]=i[s]+r[12],t[1]=i[s+1]+r[13],t[2]=i[s+2]+r[14],yield a/3}}}class le extends D{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(se,e)}}class ce extends ${constructor(){super(...arguments),this._width=0,this.color=y,this.join="miter",this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=n(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=n(0),this.endTime=n(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return Z(this.stipplePattern)&&null!=this.stippleTexture}}class pe{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=ge(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return me(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+(this._isClosed(e)?3:2)}elementCount(e){const t=2,i=e.get("position").indices.length/2+1,r=this._isClosed(e);let s=r?2:2*t;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,i,r,s,n){null!=n&&this._writeTextureBuffer(e,i,n),null!=r&&this._writeVertexBuffer(e,i,r,s)}_writeTextureBuffer(e,t,i){const r=t.get("position"),s=r.data.length/3,n=this._isClosed(t),{buffer:a,offset:o}=i,l=a.getField("position",M),c=a.getField("u0",V),p=a.getField("sizeFeatureAttribute",V),u=a.getField("size",V),m=a.getField("colorFeatureAttribute",V),h=a.getField("color",O),d=a.getField("olidColor",O),b=a.getField("timeStamps",F),_=a.getField("opacityFeatureAttribute",V),S=t.get("sizeFeatureAttribute")?.data,P=t.get("size")?.data,y=t.get("colorFeatureAttribute")?.data,E=t.get("color")?.data,w=t.get("opacityFeatureAttribute")?.data,v=t.get("distanceToStart")?.data,x=t.get("timeStamps");Q(null!==l,"Expected valid position field in texture buffer"),Q(null!==c,"Expected valid u0 field in texture buffer");let T=0;for(let j=0;j<s;++j){this._getTransformedPosition(Be,r.data,j,e),j>0&&(null!=v?T=v[j]??T:T+=g(Re,Be));const t=o+j+1;if(l.setVec(t,Be),c.set(t,T),f(Re,Be),p&&p.set(t,1===S?.length?S[0]:S?.[j]??0),u&&u.set(t,1===P?.length?P[0]:P?.[j]??1),m&&m.set(t,1===y?.length?y[0]:y?.[j]??0),h)if(null!=E){const e=Math.min(4*j,E.length-4);h.setValues(t,E[e],E[e+1],E[e+2],E[e+3])}else h.setValues(t,1,1,1,1);_&&_.set(t,1===w?.length?w[0]:w?.[j]??0)}if(null!=b&&null!=x){Q(4===x.size);const e=x.data;for(let t=0;t<s;++t){const i=4*t,r=o+t+1;b.set(r,0,e[i]),b.set(r,1,e[i+1]),b.set(r,2,e[i+2]),b.set(r,3,e[i+3])}}if(n){const e=o,t=o+1,i=o+2,r=o+s,n=r+1,p=r+2;a.copyItem(r,e),a.copyItem(t,n),a.copyItem(i,p),l.getVec(r,Re),l.getVec(t,Be);const u=v?.[s]??T+g(Re,Be);c.set(n,u)}else{const e=o,t=o+1,i=o+s,r=i+1;a.copyItem(t,e),a.copyItem(i,r)}const z=t.get("olidColor");W()&&null!=z&&null!=d&&ee(z,4,d,o)}_writeVertexBuffer(e,t,i,r){const{buffer:s,offset:n}=i,{layout:a}=this,o=t.get("position"),l=o.indices,c=o.data.length/3,p=this._isClosed(t),u=c+(p?3:2);l&&l.length!==2*(c-1)&&console.warn("RibbonLineMaterial does not support indices");const m=s.getField("textureElementIndex",R);Q(null!=m,"Missing texture buffer index field"),Q(null!=r,"Using a texture layout, but the texture range for this instance was not provided");const h=r.from;Q(r.numElements===u,"Expected number of elements in TextureBuffer to equal number of points");const f=new Float32Array(s.buffer),d=new Float16Array(s.buffer),g=new Uint32Array(s.buffer),b=a.stride/4;let _=n*b;const S=_,P=f.BYTES_PER_ELEMENT/d.BYTES_PER_ELEMENT,y=(e,t,i)=>{const r=i+1;g[_]=h+r,_++;let s=_*P;d[s++]=e,d[s++]=t,_=Math.ceil(s/P)};_+=b;let E=0,w=0;p?(E=0,w=c):(y(1,-4,0),y(1,4,0),E=1,w=c-1);for(let v=E;v<w;v++){y(0,-1,v),y(0,1,v);const e=this.numJoinSubdivisions;for(let t=0;t<e;++t){const i=(t+1)/(e+1);y(i,-1,v),y(i,1,v)}y(1,-2,v),y(1,2,v)}p?(y(0,-1,w),y(0,1,w)):(y(0,-5,w),y(0,5,w)),ue(f,S+b,f,S,b);_=ue(f,_-b,f,_,b),this._parameters.wireframe&&this._addWireframeVertices(s,S,_,b)}_getTransformedPosition(e,t,i,r){const s=3*i;c(e,t[s+0],t[s+1],t[s+2]),r&&_(e,e,r)}_addWireframeVertices(e,t,i,r){const s=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),n=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),a=r*Float32Array.BYTES_PER_ELEMENT;let o=0;const l=e=>o=ue(n,e,s,o,a);for(let c=0;c<=n.length-4*a;c+=2*a)l(c),l(c+2*a),l(c+1*a),l(c+2*a),l(c+1*a),l(c+3*a)}}function ue(e,t,i,r,s){for(let n=0;n<s;n++)i[r++]=e[t++];return r}function me(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function he(e,t,i){return i?e/2+Ye*t:(e/2+Ye)*t}function*fe(e,t,i,r,s){const n=r.get("position").data,l=me(i,r)?n.length-2:n.length-5,c=s?.[0]??0,p=s?.[1]??0;o(e,n[0]+c,n[1]+p);for(let u=3;u<l+3;u+=3){const i=u%n.length;o(t,n[i]+c,n[i+1]+p),yield u/3,a(e,t)}}function de(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function ge(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return te+i}}const be=new H,_e=P(),Se=P(),Pe=l(),ye=l(),Ee=P(),we=P(),ve=P(),xe=P(),Te=P(),ze=P(),je=i(),Le=i(),Ae=r(),Ce=r(),Me=P(),Ve=P(),Oe=z(),Fe=z(),Re=P(),Be=P(),Ie=[i(),i(),i(),i()],Ue=[P(),P(),P(),P()],Ne=C(),ke=C(),We=C(),De=C(),Ye=4,Je=[P(),P()];export{ce as Parameters,oe as RibbonLineMaterial};
2
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as n}from"../../../../core/time.js";import{copy as a,set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c,subtract as p,dot as u,scale as m,add as h,copy as f,length as d,distance as g,lerp as b,transformMat4 as _,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as E,distance2 as w,closestLineSegmentPoint as v,projectPoint as x,projectPointFraction as T,create as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as z,signedDistance as L,getNormal as A,create as C}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as M,BufferViewFloat as F,BufferViewVec4Unorm8 as R,BufferViewVec4f16 as O,BufferViewUint32 as B}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as I,isColor as U,isDepth as V,isColorHighlightOLIDOrDepth as N,is2DGeometryOutput as k}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as W}from"../effects/geometry/olidUtils.js";import D from"../lib/GLMaterial.js";import{LineMaterial as Y}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as J,screenPolygonIntersectsBufferedSegment as q}from"../lib/screenPolygonOverlapUtils.js";import{Hit as G,DrapedHit as X}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as H}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as K,assert as Q}from"../lib/Util.js";import{isImagePattern as Z}from"./lineStippleUtils.js";import{VisualVariablePassParameters as $}from"./VisualVariablePassParameters.js";import{writeColor as ee}from"./internal/bufferWriterUtils.js";import{n as te}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as ie,getTextureBufferLayout as re}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as se}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as ne}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class oe extends Y{constructor(e,t){super(e,ce),this.produces=new Map([[2,e=>I(e)||U(e)&&8===this.parameters.renderOccluded],[3,e=>V(e)],[10,e=>N(e)&&8===this.parameters.renderOccluded],[11,e=>N(e)&&8===this.parameters.renderOccluded],[4,e=>U(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>U(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>k(e)]]),this._configuration=new ne(t)}updateConfiguration(e){super.updateConfiguration(e);const{draped:t}=this._configuration,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&this.parameters.isImagePattern(),s=t&&(this.parameters.worldSized||r);this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=ge(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&de(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.pbrMode=this.parameters.shadingEnabled?2:0,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!s,this._configuration.worldSized=s,this._configuration.imagePattern=r,U(e.output)&&this.parameters.shadingEnabled?(this._configuration.receiveAmbientOcclusion=null!=e.ssao,this._configuration.receiveGlobalIllumination=e.globalIlluminationEnabled):this._configuration.receiveAmbientOcclusion=this._configuration.receiveGlobalIllumination=!1}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},i,r,s,n,a){if(!i.options.selectionMode)return;const o=this._getLineSize(e,!0),l=r[0],c=r[1],p=he(o,a,this.parameters.worldSized);let u=Number.MAX_VALUE,m=0;for(const h of fe(Pe,ye,this.parameters,e)){const e=l-Pe[0],i=c-Pe[1],r=ye[0]-Pe[0],s=ye[1]-Pe[1],n=t((r*e+s*i)/(r*r+s*s),0,1),a=r*n-e,o=s*n-i,p=a*a+o*o;p<u&&(u=p,m=h)}u<p*p&&s(n.distance,n.renderDistance,n.normal,m)}intersectRay(t,i,r,s,n,o){const{options:l,camera:b,rayBegin:_,rayEnd:S}=r;if(!l.selectionMode||!t.visible||!b)return;if(!K(i))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,x=this._getLineSize(P),T=je;a(T,r.point);const j=x*b.pixelRatio,C=Ye*b.pixelRatio,M=j/2+C;c(Ue[0],T[0]-M,T[1]+M,0),c(Ue[1],T[0]+M,T[1]+M,0),c(Ue[2],T[0]+M,T[1]-M,0),c(Ue[3],T[0]-M,T[1]-M,0);for(let e=0;e<4;e++)if(!b.unprojectFromRenderScreen(Ue[e],Ve[e]))return;z(b.eye,Ve[0],Ve[1],Ne),z(b.eye,Ve[1],Ve[2],ke),z(b.eye,Ve[2],Ve[3],We),z(b.eye,Ve[3],Ve[0],De);let F=Number.MAX_VALUE,R=0;for(const e of this._forEachTransformedLineSegment(_e,Se,y,i,me(this.parameters,P))){if(L(Ne,_e)<0&&L(Ne,Se)<0||L(ke,_e)<0&&L(ke,Se)<0||L(We,_e)<0&&L(We,Se)<0||L(De,_e)<0&&L(De,Se)<0)continue;const t=b.projectToRenderScreen(_e,ze),i=b.projectToRenderScreen(Se,Le);if(null==t||null==i)continue;if(t[2]<0&&i[2]>0){p(xe,_e,Se);const e=b.frustum,i=-L(e[4],_e)/u(xe,A(e[4]));if(m(xe,xe,i),h(_e,_e,xe),!b.projectToRenderScreen(_e,t))continue}else if(t[2]>0&&i[2]<0){p(xe,Se,_e);const e=b.frustum,t=-L(e[4],Se)/u(xe,A(e[4]));if(m(xe,xe,t),h(Se,Se,xe),!b.projectToRenderScreen(Se,i))continue}else if(t[2]<0&&i[2]<0)continue;t[2]=0,i[2]=0;const r=E(t,i,Re),s=w(r,T);if(!(s>=F)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(r,_e,Se,T,b,x,C);if(s>=e*e)continue}F=s,f(Me,_e),f(Fe,Se),R=e}}if(F<M*M){let e=Number.MAX_VALUE;if(v(E(Me,Fe,Re),E(_,S,Oe),Te)){p(Te,Te,_);const t=d(Te);m(Te,Te,1/t),e=t/g(_,S)}o(e,e,Te,R)}}intersectScreenPolygon(t,i,r,s){const{options:n,camera:a,screenPolygonPrimitiveProcessor:o}=r;if(!n.selectionMode||!t.visible)return null;if(!K(i))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,c=l.get("position").data,p=this._getLineSize(l),u=Ye,m=u*a.pixelRatio,h=new G(4);for(const e of this._forEachTransformedLineSegment(_e,Se,c,i,me(this.parameters,l)))for(const[t,i]of o.processLineSegment(Je,_e,Se)){if(!J(a,t,i,ze,Le))continue;const r=E(ze,Le,Re);let n=p/2+u;this.parameters.screenSizePerspective&&(b(je,ze,Le,.5),n=Math.max(n,this.computeScreenSizePerspectiveWidth(r,t,i,je,a,p,m)/a.pixelRatio)),a.renderToScreen(ze,Ae),a.renderToScreen(Le,Ce),q(s,Ae,Ce,n)&&(x(E(t,i,Oe),a.eye,Ee),h.updateIfCloserFromValues(g(a.eye,Ee),e,Ee,null))}return h}intersectScreenPolygonDraped({attributes:e},t,i,r,s){if(!i.options.selectionMode)return null;const n=he(this._getLineSize(e,!0),s,this.parameters.worldSized);for(const a of fe(Pe,ye,this.parameters,e,t))if(q(r,Pe,ye,n))return new X(a);return null}createBufferWriter(){return new pe(ie(this.parameters),re(this.parameters),this.parameters)}createGLMaterial(e){return new le(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,s,n,a){const o=T(e,r);b(Ee,t,i,o),_(we,Ee,s.viewMatrix);const l=d(we),c=this.computeCameraAbsCosAngle(Ee,s,this._configuration.spherical);be.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return be.apply(n)*s.pixelRatio/2+a}computeCameraAbsCosAngle(e,t,i){return i?S(Te,e):c(Te,0,0,1),p(ve,e,t.eye),S(ve,ve),Math.abs(u(Te,ve))}_getLineSize(e,i=!1){let r=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?i&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(r*=e.get("size").data[0]);return r}*_forEachTransformedLineSegment(e,t,i,r,s){const n=s?i.length-2:i.length-5;for(let a=0;a<n;a+=3){e[0]=i[a]+r[12],e[1]=i[a+1]+r[13],e[2]=i[a+2]+r[14];const s=(a+3)%i.length;t[0]=i[s]+r[12],t[1]=i[s+1]+r[13],t[2]=i[s+2]+r[14],yield a/3}}}class le extends D{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(se,e)}}class ce extends ${constructor(){super(...arguments),this._width=0,this.color=y,this.join="miter",this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=n(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=n(0),this.endTime=n(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return Z(this.stipplePattern)&&null!=this.stippleTexture}}class pe{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=ge(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return me(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+(this._isClosed(e)?3:2)}elementCount(e){const t=2,i=e.get("position").indices.length/2+1,r=this._isClosed(e);let s=r?2:2*t;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,i,r,s,n){null!=n&&this._writeTextureBuffer(e,i,n),null!=r&&this._writeVertexBuffer(e,i,r,s)}_writeTextureBuffer(e,t,i){const r=t.get("position"),s=r.data.length/3,n=this._isClosed(t),{buffer:a,offset:o}=i,l=a.getField("position",M),c=a.getField("u0",F),p=a.getField("sizeFeatureAttribute",F),u=a.getField("size",F),m=a.getField("colorFeatureAttribute",F),h=a.getField("color",R),d=a.getField("olidColor",R),b=a.getField("timeStamps",O),_=a.getField("opacityFeatureAttribute",F),S=t.get("sizeFeatureAttribute")?.data,P=t.get("size")?.data,y=t.get("colorFeatureAttribute")?.data,E=t.get("color")?.data,w=t.get("opacityFeatureAttribute")?.data,v=t.get("distanceToStart")?.data,x=t.get("timeStamps");Q(null!==l,"Expected valid position field in texture buffer"),Q(null!==c,"Expected valid u0 field in texture buffer");let T=0;for(let z=0;z<s;++z){this._getTransformedPosition(Ie,r.data,z,e),z>0&&(null!=v?T=v[z]??T:T+=g(Be,Ie));const t=o+z+1;if(l.setVec(t,Ie),c.set(t,T),f(Be,Ie),p&&p.set(t,1===S?.length?S[0]:S?.[z]??0),u&&u.set(t,1===P?.length?P[0]:P?.[z]??1),m&&m.set(t,1===y?.length?y[0]:y?.[z]??0),h)if(null!=E){const e=Math.min(4*z,E.length-4);h.setValues(t,E[e],E[e+1],E[e+2],E[e+3])}else h.setValues(t,1,1,1,1);_&&_.set(t,1===w?.length?w[0]:w?.[z]??0)}if(null!=b&&null!=x){Q(4===x.size);const e=x.data;for(let t=0;t<s;++t){const i=4*t,r=o+t+1;b.set(r,0,e[i]),b.set(r,1,e[i+1]),b.set(r,2,e[i+2]),b.set(r,3,e[i+3])}}if(n){const e=o,t=o+1,i=o+2,r=o+s,n=r+1,p=r+2;a.copyItem(r,e),a.copyItem(t,n),a.copyItem(i,p),l.getVec(r,Be),l.getVec(t,Ie);const u=v?.[s]??T+g(Be,Ie);c.set(n,u)}else{const e=o,t=o+1,i=o+s,r=i+1;a.copyItem(t,e),a.copyItem(i,r)}const j=t.get("olidColor");W()&&null!=j&&null!=d&&ee(j,4,d,o)}_writeVertexBuffer(e,t,i,r){const{buffer:s,offset:n}=i,{layout:a}=this,o=t.get("position"),l=o.indices,c=o.data.length/3,p=this._isClosed(t),u=c+(p?3:2);l&&l.length!==2*(c-1)&&console.warn("RibbonLineMaterial does not support indices");const m=s.getField("textureElementIndex",B);Q(null!=m,"Missing texture buffer index field"),Q(null!=r,"Using a texture layout, but the texture range for this instance was not provided");const h=r.from;Q(r.numElements===u,"Expected number of elements in TextureBuffer to equal number of points");const f=new Float32Array(s.buffer),d=new Float16Array(s.buffer),g=new Uint32Array(s.buffer),b=a.stride/4;let _=n*b;const S=_,P=f.BYTES_PER_ELEMENT/d.BYTES_PER_ELEMENT,y=(e,t,i)=>{const r=i+1;g[_]=h+r,_++;let s=_*P;d[s++]=e,d[s++]=t,_=Math.ceil(s/P)};_+=b;let E=0,w=0;p?(E=0,w=c):(y(1,-4,0),y(1,4,0),E=1,w=c-1);for(let v=E;v<w;v++){y(0,-1,v),y(0,1,v);const e=this.numJoinSubdivisions;for(let t=0;t<e;++t){const i=(t+1)/(e+1);y(i,-1,v),y(i,1,v)}y(1,-2,v),y(1,2,v)}p?(y(0,-1,w),y(0,1,w)):(y(0,-5,w),y(0,5,w)),ue(f,S+b,f,S,b);_=ue(f,_-b,f,_,b),this._parameters.wireframe&&this._addWireframeVertices(s,S,_,b)}_getTransformedPosition(e,t,i,r){const s=3*i;c(e,t[s+0],t[s+1],t[s+2]),r&&_(e,e,r)}_addWireframeVertices(e,t,i,r){const s=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),n=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),a=r*Float32Array.BYTES_PER_ELEMENT;let o=0;const l=e=>o=ue(n,e,s,o,a);for(let c=0;c<=n.length-4*a;c+=2*a)l(c),l(c+2*a),l(c+1*a),l(c+2*a),l(c+1*a),l(c+3*a)}}function ue(e,t,i,r,s){for(let n=0;n<s;n++)i[r++]=e[t++];return r}function me(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function he(e,t,i){return i?e/2+Ye*t:(e/2+Ye)*t}function*fe(e,t,i,r,s){const n=r.get("position").data,l=me(i,r)?n.length-2:n.length-5,c=s?.[0]??0,p=s?.[1]??0;o(e,n[0]+c,n[1]+p);for(let u=3;u<l+3;u+=3){const i=u%n.length;o(t,n[i]+c,n[i+1]+p),yield u/3,a(e,t)}}function de(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function ge(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return te+i}}const be=new H,_e=P(),Se=P(),Pe=l(),ye=l(),Ee=P(),we=P(),ve=P(),xe=P(),Te=P(),je=P(),ze=i(),Le=i(),Ae=r(),Ce=r(),Me=P(),Fe=P(),Re=j(),Oe=j(),Be=P(),Ie=P(),Ue=[i(),i(),i(),i()],Ve=[P(),P(),P(),P()],Ne=C(),ke=C(),We=C(),De=C(),Ye=4,Je=[P(),P()];export{ce as Parameters,oe as RibbonLineMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{ShaderTechniqueConfiguration as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends e{constructor(e){super(),this.spherical=e}}export{r as ViewingModeConfiguration};
2
+ import{ShaderTechniqueConfiguration as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends e{constructor(e){super(),this.spherical=e,this.draped=!1}}export{r as ViewingModeConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../../../core/Error.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/WaterColor.glsl.js";import"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../shaders/OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../chunks/Water.glsl.js";
2
+ import"../../../../core/Error.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/WaterColor.glsl.js";import"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../shaders/OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../chunks/Water.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../../../core/has.js";import{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{is3DGeometry as a,isColor as s}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as o}from"../effects/geometry/olidUtils.js";import{DefaultBufferWriter as n}from"./DefaultBufferWriter.js";import{PositionUvf32OlidLayout as h,PositionUvf32Layout as c}from"./DefaultLayouts.js";import{TriangleMaterialParameters as p,TriangleMaterial as m}from"./TriangleMaterial.js";import{WaterGLMaterial as f}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as l}from"./WaterTechniqueConfiguration.js";import{hasShadowHighlights as u}from"../shaders/ReceiveShadowsConfiguration.js";class d extends m{constructor(t,e){super(t,g),this.visible=!0,this.produces=new Map([[2,t=>a(t)&&!this.transparent],[4,t=>a(t)&&this.transparent],[18,t=>this.parameters.draped&&a(t)],[19,t=>4===t]]),this._configuration=new l(e.spherical)}updateConfiguration(t){super.updateConfiguration(t),this._configuration.writeDepth=!0,this._configuration.receiveShadows=s(t.output)&&t.shadowMap.enabled,this._configuration.hasShadowHighlights=u(this._configuration,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.screenSpaceReflections=t.hasScreenSpaceReflections,this._configuration.cloudReflections=null!=t.clouds.data,this._configuration.draped=this.parameters.draped}update(e){return this.setParameters({timeElapsed:t(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(t){const e=Math.min(t.relativeElevation,t.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*e<w}get transparent(){return this.parameters.transparent}createGLMaterial(t){return new f(t)}createBufferWriter(){return new n(o()?h:c)}get test(){}}class g extends p{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=i(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=r(),this.modelTransformation=null}}const w=35e3;export{g as Parameters,d as WaterMaterial};
2
+ import"../../../../core/has.js";import{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{is3DGeometry as a,isColor as s,isNormals as o}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{DefaultBufferWriter as h}from"./DefaultBufferWriter.js";import{PositionUvf32OlidLayout as c,PositionUvf32Layout as p}from"./DefaultLayouts.js";import{TriangleMaterialParameters as m,TriangleMaterial as l}from"./TriangleMaterial.js";import{WaterGLMaterial as f}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as u}from"./WaterTechniqueConfiguration.js";import{hasShadowHighlights as d}from"../shaders/ReceiveShadowsConfiguration.js";class g extends l{constructor(t,e){super(t,w),this.visible=!0,this.produces=new Map([[2,t=>a(t)&&!this.transparent],[4,t=>a(t)&&this.transparent],[18,t=>this.parameters.draped&&a(t)],[19,t=>4===t]]),this._configuration=new u(e.spherical)}updateConfiguration(t){super.updateConfiguration(t),this._configuration.receiveShadows=s(t.output)&&t.shadowMap.enabled,this._configuration.hasShadowHighlights=d(this._configuration,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.screenSpaceReflections=t.hasScreenSpaceReflections,this._configuration.cloudReflections=null!=t.clouds.data,this._configuration.draped=this.parameters.draped,this._configuration.drapedNormals=o(t.output)&&19===t.slot}update(e){return this.setParameters({timeElapsed:t(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(t){const e=Math.min(t.relativeElevation,t.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*e<S}get transparent(){return this.parameters.transparent}createGLMaterial(t){return new f(t)}createBufferWriter(){return new h(n()?c:p)}get test(){}}class w extends m{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=i(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=r(),this.modelTransformation=null}}const S=35e3;export{w as Parameters,g as WaterMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as i}from"./TriangleTechniqueConfiguration.js";class o extends i{constructor(e){super(),this.spherical=e,this.receiveGlobalIllumination=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.writeDepth=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.draped=!1,this.textureCoordinateType=0,this.emissionSource=0,this.pbrMode=3,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!0,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=150,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.useFillLights=!1,this.overlayEnabled=!1,this.snowCover=!1,this.renderOccluded=!1}}e([t()],o.prototype,"receiveGlobalIllumination",void 0),e([t()],o.prototype,"receiveShadows",void 0),e([t()],o.prototype,"hasShadowHighlights",void 0),e([t()],o.prototype,"writeDepth",void 0),e([t()],o.prototype,"screenSpaceReflections",void 0),e([t()],o.prototype,"cloudReflections",void 0),e([t()],o.prototype,"draped",void 0);export{o as WaterTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as i}from"./TriangleTechniqueConfiguration.js";class t extends i{constructor(e){super(),this.spherical=e,this.receiveGlobalIllumination=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.draped=!1,this.drapedNormals=!1,this.textureCoordinateType=0,this.emissionSource=0,this.pbrMode=3,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!0,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=150,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.useFillLights=!1,this.overlayEnabled=!1,this.snowCover=!1,this.renderOccluded=!1}}e([o()],t.prototype,"receiveGlobalIllumination",void 0),e([o()],t.prototype,"receiveShadows",void 0),e([o()],t.prototype,"hasShadowHighlights",void 0),e([o()],t.prototype,"screenSpaceReflections",void 0),e([o()],t.prototype,"cloudReflections",void 0),e([o()],t.prototype,"draped",void 0),e([o()],t.prototype,"drapedNormals",void 0);export{t as WaterTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import s from"../../../../../core/PooledArray.js";import{assert as e}from"../../lib/Util.js";import{bufferRangePool as n,mergeAdjacentRanges as a}from"./BufferRange.js";import{DrawCommand as i}from"./DrawCommand.js";import{Instance as r}from"./Instance.js";import{InstancedCommandVAO as o}from"./InstancedCommandVAO.js";import{InstancedCommandVAOs as h}from"./InstancedCommandVAOs.js";import{defaultHighlightName as d}from"../../../../support/HighlightDefaults.js";class m{constructor(t,s){this.isInstanced=t,this.targetBuffers=s,this.vao=null,this.textureBuffer=null,this.endElements={geometry:0,texture:0,index:0},this._instances=new Map,this.hasHiddenInstances=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.highlightNames=new Set,this.drawCommandsDefault=u(),this.drawCommandsHighlights=new Map,this.drawCommandsOccludees=u(),this.drawCommandsShadowHighlightRest=u(),this._instancedCommandVAOs=null;const e={},n={};for(const a of s)e[a]=0,n[a]=[];this._numElements=e,this._holes=n,this.useIndexing=s.includes("index"),this._drawRangesTarget=this.useIndexing?"index":"geometry"}getTargetBuffer(t){return"geometry"===t?this.vao?.buffer("geometry"):"texture"===t?this.textureBuffer:this.vao?.indexBuffer}get numElements(){return this._numElements}get instances(){return this._instances}get writeableInstances(){return this._instances}get indexType(){return this.vao?.indexBuffer?.indexType}clearHoles(){for(const t of this.targetBuffers){const s=this._holes[t];for(const t of s)n.release(t);s.length=0}}get holes(){return this._holes}get hasHighlights(){return this.highlightNames.size>0}get instancedCommandVAOs(){return this._instancedCommandVAOs}get _drawTargetHoles(){return this._holes[this._drawRangesTarget]}get _drawTargetEndElement(){return this.endElements[this._drawRangesTarget]}get usedMemory(){return(this.vao?.usedMemory??0)+(this.textureBuffer?.usedMemory??0)}resetInstanceSummary(){this.hasHiddenInstances=!1,this.hasOccludees=!1,this.highlightNames.clear()}updateDirtyDrawCommands(t){if(this.drawCommandsDirty){this.resetInstanceSummary();for(const t of this.instances.values())this.updateDrawState(t);this.updateDrawCommands(t)}}createInstance(t,s,e=this._makeEmptyRanges()){const n=new r(t,e,s,this._drawRangesTarget);return this.addInstance(t.id,n),n}addInstance(t,s){e(!this._instances.has(t)),this._instances.set(t,s);for(const e of this.targetBuffers)this._numElements[e]+=s.targetRanges[e].numElements}deleteInstance(t){const s=this._instances.get(t);if(s){for(const t of this.targetBuffers){const e=s.targetRanges[t];this._numElements[t]-=e.numElements,n.release(e)}this._instances.delete(t)}}updateInstances(){const{targetBuffers:t}=this,s={};for(const e of t)s[e]=0;for(const e of this._instances.values()){for(const n of t)s[n]+=e.targetRanges[n].numElements;this.updateDrawState(e)}this._numElements=s}updateDrawState(t){if(t.isVisible){const{highlightName:s}=t;s&&this.highlightNames.add(s),t.hasOccludees&&(this.hasOccludees=!0)}else this.hasHiddenInstances=!0}updateDrawCommands(t){this._updateDrawCommands(t),this._updateInstancedCommandVAOs()}_updateDrawCommands(t){if(this.drawCommandsDefault.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsDirty=!1,0===this._instances.size)return;const{sortedInstances:s}=this;if(this._updateHighlightDrawCommands(t,s),!this.needsMultipleCommands){const t=this.drawCommandsDefault.pushNew(),s=this._drawTargetHoles,e=s.at(0);return this.vao&&1===s.length&&e.to===this._drawTargetEndElement?(t.first=0,void(t.count=e.from)):(t.first=1/0,t.count=0,this._instances.forEach(s=>{t.first=Math.min(t.first,s.drawRange.from),t.count=Math.max(t.count,s.drawRange.to)}),void(t.count-=t.first))}for(const e of s)e.isVisible&&this.addOrMerge(e.hasOccludees?this.drawCommandsOccludees:this.drawCommandsDefault,e)}get sortedInstances(){return Array.from(this._instances.values()).sort(({drawRange:t},{drawRange:s})=>t.from===s.from?t.to-s.to:t.from-s.from)}updateHighlights(t){this.highlightNames.clear();const s=this.sortedInstances;for(const e of s)e.updateHighlightOptions(t),e.isVisible&&e.highlightName&&this.highlightNames.add(e.highlightName);this._updateHighlightDrawCommands(t,s),this._updateInstancedCommandVAOs()}mergeHoles(){const t=this._holes;for(const s of this.targetBuffers)a(t[s])}_updateHighlightDrawCommands(s,e){const{drawCommandsHighlights:n,drawCommandsShadowHighlightRest:a}=this;n.clear(),a.clear();for(const i of e){if(i.updateHighlightOptions(s),!i.isVisible)continue;const{highlightName:e}=i;if(e){this.highlightNames.add(e);const s=t(n,e,u);this.addOrMerge(s,i)}e&&e===d||this.addOrMerge(a,i)}}_updateInstancedCommandVAOs(){const t=this.vao;if(!this.isInstanced||null==t)return;this._instancedCommandVAOs??=new h;const s=this._instancedCommandVAOs,e=s.commandVAOs.copy();s.clear();const n=s.commandVAOs,a=(s,a)=>{for(const i of s){const{first:s,count:r}=i,h=n.get(s,r)??e.pop(s,r)??new o(t.shallowCloneWithBaseInstances(new Map([["geometry",i.first]])),i.count);n.set(s,r,h),a.push(h)}};a(this.drawCommandsDefault,s.drawCommandsDefault);for(const[i,r]of this.drawCommandsHighlights){const t=new Array;a(r,t),s.drawCommandsHighlights.set(i,t)}a(this.drawCommandsOccludees,s.drawCommandsOccludees),a(this.drawCommandsShadowHighlightRest,s.drawCommandsShadowHighlightRest);for(const i of e.values())i.dispose();e.clear()}get needsMultipleCommands(){return this.hasOccludees||this.hasHighlights||this.hasHiddenInstances}addOrMerge(t,{drawRange:s}){const e=t.back();if(null==e){const e=t.pushNew();return e.first=s.from,void(e.count=s.numElements)}if(l(e,s)){const t=s.from-e.first+s.numElements;e.count=t}else{const e=t.pushNew();e.first=s.from,e.count=s.numElements}}_makeEmptyRanges(){const t={};for(const s of this.targetBuffers)t[s]=n.acquire(0,0);return t}}function c(t){return null!=t.vao}function u(){return new s({allocator:t=>t||new i,deallocator:t=>t})}function l(t,s){return t.first+t.count>=s.from}export{m as PerBufferData,c as hasVao};
2
+ import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import s from"../../../../../core/PooledArray.js";import{assert as e}from"../../lib/Util.js";import{bufferRangePool as n,mergeAdjacentRanges as a}from"./BufferRange.js";import{DrawCommand as i}from"./DrawCommand.js";import{Instance as r}from"./Instance.js";import{InstancedCommandVAO as o}from"./InstancedCommandVAO.js";import{InstancedCommandVAOs as h}from"./InstancedCommandVAOs.js";import{defaultHighlightName as d}from"../../../../support/HighlightDefaults.js";class m{constructor(t,s){this.isInstanced=t,this.targetBuffers=s,this.vao=null,this.textureBuffer=null,this.endElements={geometry:0,texture:0,index:0},this._instances=new Map,this.hasHiddenInstances=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.highlightNames=new Set,this.drawCommandsDefault=u(),this.drawCommandsHighlights=new Map,this.drawCommandsOccludees=u(),this.drawCommandsShadowHighlightRest=u(),this._instancedCommandVAOs=null;const e={},n={};for(const a of s)e[a]=0,n[a]=[];this._numElements=e,this._holes=n,this.useIndexing=s.includes("index"),this._drawRangesTarget=this.useIndexing?"index":"geometry"}getTargetBuffer(t){return"geometry"===t?this.vao?.buffer("geometry"):"texture"===t?this.textureBuffer:this.vao?.indexBuffer}get numElements(){return this._numElements}get instances(){return this._instances}get writeableInstances(){return this._instances}get indexType(){return this.vao?.indexBuffer?.indexType}clearHoles(){for(const t of this.targetBuffers){const s=this._holes[t];for(const t of s)n.release(t);s.length=0}}get holes(){return this._holes}get hasHighlights(){return this.highlightNames.size>0}get instancedCommandVAOs(){return this._instancedCommandVAOs}get _drawTargetHoles(){return this._holes[this._drawRangesTarget]}get _drawTargetEndElement(){return this.endElements[this._drawRangesTarget]}get usedMemory(){return(this.vao?.usedMemory??0)+(this.textureBuffer?.usedMemory??0)}resetInstanceSummary(){this.hasHiddenInstances=!1,this.hasOccludees=!1,this.highlightNames.clear()}updateDirtyDrawCommands(t){if(this.drawCommandsDirty){this.resetInstanceSummary();for(const t of this.instances.values())this.updateDrawState(t);this.updateDrawCommands(t)}}createInstance(t,s,e=this._makeEmptyRanges()){const n=new r(t,e,s,this._drawRangesTarget);return this.addInstance(t.id,n),n}addInstance(t,s){e(!this._instances.has(t)),this._instances.set(t,s);for(const e of this.targetBuffers)this._numElements[e]+=s.targetRanges[e].numElements}deleteInstance(t){const s=this._instances.get(t);if(s){for(const t of this.targetBuffers){const e=s.targetRanges[t];this._numElements[t]-=e.numElements,n.release(e)}this._instances.delete(t)}}updateInstances(){const{targetBuffers:t}=this,s={};for(const e of t)s[e]=0;for(const e of this._instances.values()){for(const n of t)s[n]+=e.targetRanges[n].numElements;this.updateDrawState(e)}this._numElements=s}updateDrawState(t){if(t.isVisible){const{highlightName:s}=t;s&&this.highlightNames.add(s),t.hasOccludees&&(this.hasOccludees=!0)}else this.hasHiddenInstances=!0}updateDrawCommands(t){this._updateDrawCommands(t),this._updateInstancedCommandVAOs()}_updateDrawCommands(t){if(this.drawCommandsDefault.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsDirty=!1,0===this._instances.size)return;const{sortedInstances:s}=this;if(this._updateHighlightDrawCommands(t,s),!this.needsMultipleCommands){const t=this.drawCommandsDefault.pushNew(),s=this._drawTargetHoles,e=s.at(0);return this.vao&&1===s.length&&e.to===this._drawTargetEndElement?(t.first=0,void(t.count=e.from)):(t.first=1/0,t.count=0,this._instances.forEach(s=>{t.first=Math.min(t.first,s.drawRange.from),t.count=Math.max(t.count,s.drawRange.to)}),void(t.count-=t.first))}for(const e of s)e.isVisible&&this.addOrMerge(e.hasOccludees?this.drawCommandsOccludees:this.drawCommandsDefault,e)}get sortedInstances(){return Array.from(this._instances.values()).sort(({drawRange:t},{drawRange:s})=>t.from===s.from?t.to-s.to:t.from-s.from)}updateHighlights(t){this.highlightNames.clear();const s=this.sortedInstances;for(const e of s)e.updateHighlightOptions(t),e.isVisible&&e.highlightName&&this.highlightNames.add(e.highlightName);this._updateHighlightDrawCommands(t,s),this._updateInstancedCommandVAOs()}mergeHoles(){const t=this._holes;for(const s of this.targetBuffers)a(t[s])}_updateHighlightDrawCommands(s,e){const{drawCommandsHighlights:n,drawCommandsShadowHighlightRest:a}=this;n.clear(),a.clear();for(const i of e){if(i.updateHighlightOptions(s),!i.isVisible)continue;const{highlightName:e}=i;if(e){this.highlightNames.add(e);const s=t(n,e,u);this.addOrMerge(s,i)}e&&e===d||this.addOrMerge(a,i)}}_updateInstancedCommandVAOs(){const t=this.vao;if(!this.isInstanced||null==t)return;this._instancedCommandVAOs??=new h;const s=this._instancedCommandVAOs,e=s.commandVAOs.clone();s.clear();const n=s.commandVAOs,a=(s,a)=>{for(const i of s){const{first:s,count:r}=i,h=n.get(s,r)??e.pop(s,r)??new o(t.shallowCloneWithBaseInstances(new Map([["geometry",i.first]])),i.count);n.set(s,r,h),a.push(h)}};a(this.drawCommandsDefault,s.drawCommandsDefault);for(const[i,r]of this.drawCommandsHighlights){const t=new Array;a(r,t),s.drawCommandsHighlights.set(i,t)}a(this.drawCommandsOccludees,s.drawCommandsOccludees),a(this.drawCommandsShadowHighlightRest,s.drawCommandsShadowHighlightRest);for(const i of e.values())i.dispose();e.clear()}get needsMultipleCommands(){return this.hasOccludees||this.hasHighlights||this.hasHiddenInstances}addOrMerge(t,{drawRange:s}){const e=t.back();if(null==e){const e=t.pushNew();return e.first=s.from,void(e.count=s.numElements)}if(l(e,s)){const t=s.from-e.first+s.numElements;e.count=t}else{const e=t.pushNew();e.first=s.from,e.count=s.numElements}}_makeEmptyRanges(){const t={};for(const s of this.targetBuffers)t[s]=n.acquire(0,0);return t}}function c(t){return null!=t.vao}function u(){return new s({allocator:t=>t||new i,deallocator:t=>t})}function l(t,s){return t.first+t.count>=s.from}export{m as PerBufferData,c as hasVao};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as i}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{when as a,initial as h,watch as l,syncAndInitial as d}from"../../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../../core/scheduling.js";import{signal as p}from"../../../../core/signal.js";import{Milliseconds as m}from"../../../../core/time.js";import{property as u,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{isMoon as g,isMars as w}from"../../../../geometry/ellipsoidUtils.js";import{debugFlags as _}from"../../support/debugFlags.js";import{ComponentObjectCollection as v}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as x}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as j}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ChapmanAtmosphere as y}from"../effects/atmosphere/ChapmanAtmosphere.js";import{LocalAtmosphere as b}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as R}from"../effects/atmosphere/MarsAtmosphere.js";import{CloudsComposition as A}from"../effects/clouds/CloudsComposition.js";import{Fog as C}from"../effects/fog/Fog.js";import{ObjectAndLayerID as S}from"../effects/geometry/ObjectAndLayerID.js";import{olidEnabled as T}from"../effects/geometry/olidUtils.js";import{RenderOccluded as U}from"../effects/geometry/RenderOccluded.js";import{GlobalIllumination as D}from"../effects/globalIllumination/GlobalIllumination.js";import{Haze as M}from"../effects/haze/Haze.js";import{Highlight as O}from"../effects/highlight/Highlight.js";import{ShadowHighlight as q}from"../effects/highlight/ShadowHighlight.js";import{ShadowHighlightBuffer as F}from"../effects/highlight/ShadowHighlightBuffer.js";import{Magnifier as L}from"../effects/magnifier/Magnifier.js";import{ShadowAccumulator as k}from"../effects/shadowAccumulation/ShadowAccumulator.js";import{ShadowCastRenderer as W}from"../effects/shadowAccumulation/ShadowCastRenderer.js";import{SMAA as I}from"../effects/smaa/SMAA.js";import{SSAO as B}from"../effects/ssao/SSAO.js";import{Stars as E}from"../effects/stars/Stars.js";import{EmissionComposite as H}from"../lib/EmissionComposite.js";import{GLMaterialRepository as G}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as P}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as N}from"../lib/Renderer.js";import{RenderingContext as z}from"../lib/RenderingContext.js";import{RenderingContextOptions as V}from"../lib/RenderingContextOptions.js";import{TextureRepository as X}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as Q}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as J}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as K}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as Y}from"./contextCache.js";import{removeLoadedShaderModules as Z}from"./renderUtils.js";import{ScreenshotManager as $,ScreenshotContext as ee}from"./ScreenshotManager.js";import{contextCache as te}from"./testUtils.js";import{noBudget as re}from"../../../support/Scheduler.js";import{checkWebGLError as ie}from"../../../webgl/checkWebGLError.js";const se=has("disable-feature:async-navigation-3d-depth-readback");let ne=class extends t{constructor(e,t){super(e),this.olidRenderHelper=T()?new P:null,this.waterTextures=new K,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this._fog=p(null),this.globalIllumination=null,this.shadowAccumulator=null,this.test=null,this._initializeContext(t);const{memoryController:r}=t.view.resourceController;this.stippleTextures=J(this._rctx,r),this.markerTextures=Q(this._rctx,r),this.techniques=new j(new x(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new X(t),this.addHandles(this.textures.events.on("changed",e=>this.requestRender(e)));const i=new G(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new N(t,i,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([a(()=>t.view.ready,()=>this._createRenderNodes(),h),l(()=>this.waterTextures.updating,()=>this.requestRender(),h),l(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),d)]);const s={renderScene:(e,t,r,i)=>(this.renderer.setTime(t),this.renderer.render(e,r,i)),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,i)=>t.options.screenshot.renderOverlay(e,r,i)};this._screenshotManager=new $(this._rctx,s,e=>t.view.overlayManager.updateOverlays(re,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=o(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.globalIllumination=null,this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=o(this._rctx),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;this.shadowAccumulator=new k({view:e}),this.shadowAccumulator.accumulationRenderer=new W({view:e,data:this.shadowAccumulator}),this.renderer.setShadowAccumulator(this.shadowAccumulator),new E({view:e}),g(e.spatialReference)||(2===t?new b({view:e}):w(e.spatialReference)?new R({view:e}):(new y({view:e}),new A({view:e}),new M({view:e}),this._fog.value=new C({view:e}))),new B({view:e}),has("disable-feature:global-illumination")||(this.globalIllumination=new D({view:e})),new I({view:e,isEnabled:()=>this.renderer.hasSMAA}),new L({view:e}),new O({view:e}),new F({view:e}),new q({view:e,viewingMode:t}),new H({view:e}),new U({view:e}),T()&&new S({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0,this.globalIllumination?.resetAccumulatedFrames();case 0:this._needsRender=!0}}get updating(){const e=this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating;return e&&_.UPDATING&&console.log(" RenderView:",this._needsUpdate,this._needsWaterReflectionUpdate,this.renderer.updating,this.textures.updating,this.waterTextures.updating),e}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,s,n=s){let o=se?this._readMainDepthSynchronously(t,r,i,s,n):this.renderer.navigationDepthCache.getMinimalDepthForArea(t,r,i,s,n)??Number.MAX_VALUE;if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&o>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(o=s)}return o===Number.MAX_VALUE?void 0:o}whenRepresentativeDepthForArea(e,t,r,i,s,n=1){return this.renderer.navigationDepthCache.whenRepresentativeDepthForArea(e,t,r,i,s,n)}_readMainDepthSynchronously(e,t,r,i,s){const n=r.constrainWindowSize(e,t,i*r.pixelRatio,s*r.pixelRatio),o=this._ensureLinearDepthArrayBuffer(n);this.renderer.readMainDepth(n,o);let a=Number.MAX_VALUE;for(let h=0;h<n[2]*n[3];h++){const e=this._linearDepthFromTexture(4*h,o,r.nearFar);a>e&&e!==r.nearFar[0]&&e!==r.nearFar[1]&&(a=e)}return a}_linearDepthFromTexture(e,t,r){return i(t,e)*(r[1]-r[0])+r[0]}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){Z(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,i=0,s=!1;const n={preRender:({time:s})=>{r=this.updating,i=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),s=this.test?.time??s;const n=m(s-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(n>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,s)&&this.requestRender(0),this._lastAnimationUpdate=s)},render:({time:e})=>{if(e=this.test?.time??e,this.renderer.setTime(e),(this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const e=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this.renderer.render(t,0),s=!0,e&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();const r=new ee(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{s&&(this.renderer.finish(2===t.mode?i:1),s=!1)}};this._frameTask=c(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const i={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",i);if(null==n)return void s.getLogger(this).error("A WebGL2 context could not be created.");ie(n,!0),this._rctx=oe(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&s.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new v(this.renderer.renderPassManager,this._viewingMode,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){null!=this.test?.time&&null!=e.fadeDuration&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=m(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}get fog(){return r(this._fog.value)}};function oe(e,t){const r=new V(t);if(te.enabled){let t=ae.get(e);return 1===t?.refCount?(t.configure(r),t.ref(),t):(t=new z(e,r),ae.set(e,t),t.ref(),t)}return new z(e,r)}e([u({type:Boolean,readOnly:!0})],ne.prototype,"updating",null),e([u({constructOnly:!0})],ne.prototype,"view",void 0),e([u({readOnly:!0})],ne.prototype,"componentObjectCollection",null),e([u()],ne.prototype,"_componentObjectCollection",void 0),e([u()],ne.prototype,"_needsUpdate",void 0),e([u()],ne.prototype,"_needsWaterReflectionUpdate",void 0),ne=e([f("esri.views.3d.webgl-engine.parts.RenderView")],ne);const ae=Y();export{ne as RenderView};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as i}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{when as a,initial as h,watch as l,syncAndInitial as d}from"../../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../../core/scheduling.js";import{signal as p}from"../../../../core/signal.js";import{Milliseconds as m}from"../../../../core/time.js";import{property as u,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{isMoon as g,isMars as w}from"../../../../geometry/ellipsoidUtils.js";import{debugFlags as _}from"../../support/debugFlags.js";import{ComponentObjectCollection as v}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as x}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as j}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ChapmanAtmosphere as y}from"../effects/atmosphere/ChapmanAtmosphere.js";import{LocalAtmosphere as b}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as R}from"../effects/atmosphere/MarsAtmosphere.js";import{CloudsComposition as A}from"../effects/clouds/CloudsComposition.js";import{Fog as C}from"../effects/fog/Fog.js";import{ObjectAndLayerID as S}from"../effects/geometry/ObjectAndLayerID.js";import{olidEnabled as T}from"../effects/geometry/olidUtils.js";import{RenderOccluded as U}from"../effects/geometry/RenderOccluded.js";import{GlobalIllumination as D}from"../effects/globalIllumination/GlobalIllumination.js";import{Haze as M}from"../effects/haze/Haze.js";import{Highlight as O}from"../effects/highlight/Highlight.js";import{ShadowHighlight as q}from"../effects/highlight/ShadowHighlight.js";import{ShadowHighlightBuffer as F}from"../effects/highlight/ShadowHighlightBuffer.js";import{Magnifier as L}from"../effects/magnifier/Magnifier.js";import{ShadowAccumulator as k}from"../effects/shadowAccumulation/ShadowAccumulator.js";import{ShadowCastRenderer as W}from"../effects/shadowAccumulation/ShadowCastRenderer.js";import{SMAA as I}from"../effects/smaa/SMAA.js";import{SSAO as B}from"../effects/ssao/SSAO.js";import{Stars as E}from"../effects/stars/Stars.js";import{EmissionComposite as H}from"../lib/EmissionComposite.js";import{GLMaterialRepository as G}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as P}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as N}from"../lib/Renderer.js";import{RenderingContext as z}from"../lib/RenderingContext.js";import{RenderingContextOptions as V}from"../lib/RenderingContextOptions.js";import{TextureRepository as X}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as Q}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as J}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as K}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as Y}from"./contextCache.js";import{removeLoadedShaderModules as Z}from"./renderUtils.js";import{ScreenshotManager as $,ScreenshotContext as ee}from"./ScreenshotManager.js";import{contextCache as te}from"./testUtils.js";import{noBudget as re}from"../../../support/Scheduler.js";import{checkWebGLError as ie}from"../../../webgl/checkWebGLError.js";const se=has("disable-feature:async-navigation-3d-depth-readback");let ne=class extends t{constructor(e,t){super(e),this.olidRenderHelper=T()?new P:null,this.waterTextures=new K,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this._fog=p(null),this.globalIllumination=null,this.shadowAccumulator=null,this.test=null,this._initializeContext(t);const{memoryController:r}=t.view.resourceController;this.stippleTextures=J(this._rctx,r),this.markerTextures=Q(this._rctx,r),this.techniques=new j(new x(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new X(t),this.addHandles(this.textures.events.on("changed",e=>this.requestRender(e)));const i=new G(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new N(t,i,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([a(()=>t.view.ready,()=>this._createRenderNodes(),h),l(()=>this.waterTextures.updating,()=>this.requestRender(),h),l(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),d)]);const s={renderScene:(e,t,r,i)=>(this.renderer.setTime(t),this.renderer.render(e,r,i)),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,i)=>t.options.screenshot.renderOverlay(e,r,i)};this._screenshotManager=new $(this._rctx,s,e=>t.view.overlayManager.updateOverlays(re,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=o(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.globalIllumination=null,this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=o(this._rctx),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;this.shadowAccumulator=new k({view:e}),this.shadowAccumulator.accumulationRenderer=new W({view:e,data:this.shadowAccumulator}),this.renderer.setShadowAccumulator(this.shadowAccumulator),new E({view:e}),g(e.spatialReference)||(2===t?new b({view:e}):w(e.spatialReference)?new R({view:e}):(new y({view:e}),new A({view:e}),new M({view:e}),this._fog.value=new C({view:e}))),new B({view:e}),has("disable-feature:global-illumination")||(this.globalIllumination=new D({view:e})),new I({view:e,isEnabled:()=>this.renderer.hasSMAA}),new L({view:e}),new O({view:e}),new F({view:e}),new q({view:e,viewingMode:t}),new H({view:e}),new U({view:e}),T()&&new S({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0,this.globalIllumination?.resetAccumulation();case 0:this._needsRender=!0}}get updating(){const e=this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating;return e&&_.UPDATING&&console.log(" RenderView:",this._needsUpdate,this._needsWaterReflectionUpdate,this.renderer.updating,this.textures.updating,this.waterTextures.updating),e}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,s,n=s){let o=se?this._readMainDepthSynchronously(t,r,i,s,n):this.renderer.navigationDepthCache.getMinimalDepthForArea(t,r,i,s,n)??Number.MAX_VALUE;if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&o>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(o=s)}return o===Number.MAX_VALUE?void 0:o}whenRepresentativeDepthForArea(e,t,r,i,s,n=1){return this.renderer.navigationDepthCache.whenRepresentativeDepthForArea(e,t,r,i,s,n)}_readMainDepthSynchronously(e,t,r,i,s){const n=r.constrainWindowSize(e,t,i*r.pixelRatio,s*r.pixelRatio),o=this._ensureLinearDepthArrayBuffer(n);this.renderer.readMainDepth(n,o);let a=Number.MAX_VALUE;for(let h=0;h<n[2]*n[3];h++){const e=this._linearDepthFromTexture(4*h,o,r.nearFar);a>e&&e!==r.nearFar[0]&&e!==r.nearFar[1]&&(a=e)}return a}_linearDepthFromTexture(e,t,r){return i(t,e)*(r[1]-r[0])+r[0]}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){Z(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,i=0,s=!1;const n={preRender:({time:s})=>{r=this.updating,i=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),s=this.test?.time??s;const n=m(s-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(n>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,s)&&this.requestRender(0),this._lastAnimationUpdate=s)},render:({time:e})=>{if(e=this.test?.time??e,this.renderer.setTime(e),(this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const e=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this.renderer.render(t,0),s=!0,e&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();const r=new ee(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{s&&(this.renderer.finish(2===t.mode?i:1),s=!1)}};this._frameTask=c(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const i={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",i);if(null==n)return void s.getLogger(this).error("A WebGL2 context could not be created.");ie(n,!0),this._rctx=oe(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&s.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new v(this.renderer.renderPassManager,this._viewingMode,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){null!=this.test?.time&&null!=e.fadeDuration&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=m(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}get fog(){return r(this._fog.value)}};function oe(e,t){const r=new V(t);if(te.enabled){let t=ae.get(e);return 1===t?.refCount?(t.configure(r),t.ref(),t):(t=new z(e,r),ae.set(e,t),t.ref(),t)}return new z(e,r)}e([u({type:Boolean,readOnly:!0})],ne.prototype,"updating",null),e([u({constructOnly:!0})],ne.prototype,"view",void 0),e([u({readOnly:!0})],ne.prototype,"componentObjectCollection",null),e([u()],ne.prototype,"_componentObjectCollection",void 0),e([u()],ne.prototype,"_needsUpdate",void 0),e([u()],ne.prototype,"_needsWaterReflectionUpdate",void 0),ne=e([f("esri.views.3d.webgl-engine.parts.RenderView")],ne);const ae=Y();export{ne as RenderView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../core/shaderLibrary/ScreenSizeScaling.glsl.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/ColorMaterial.glsl.js";
2
+ import"../core/shaderLibrary/ScreenSizeScaling.glsl.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/ColorMaterial.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/output/ReadDepth.glsl.js";import"../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{C as CompositingPassParameters,b as build}from"../../../../chunks/Compositing.glsl.js";
2
+ import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/output/ReadDepth.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{C as CompositingPassParameters,b as build}from"../../../../chunks/Compositing.glsl.js";
@@ -1,22 +1,22 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{RejectBySlicePass as i}from"../core/shaderLibrary/Slice.glsl.js";import{DepthConversion as n}from"../core/shaderLibrary/output/DepthConversion.glsl.js";import{positionOutsideClipSpace as r}from"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{GaussianSplatCovariance as t}from"../core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import{GaussianSplatEvaluation as s}from"../core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import{GaussianSplatTextureFetch as o}from"../core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import{GaussianSplatUnpacking as c}from"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as l}from"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2BindUniform as u}from"../core/shaderModules/Float2BindUniform.js";import{Float2PassUniform as d}from"../core/shaderModules/Float2PassUniform.js";import{Float3PassUniform as p}from"../core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as m}from"../core/shaderModules/FloatPassUniform.js";import{glsl as f,If as v}from"../core/shaderModules/glsl.js";import{Matrix4BindUniform as g}from"../core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintPassUniform as x}from"../core/shaderModules/Texture2DUintPassUniform.js";function y(e,n){const{clippingEnabled:r}=n,{fragment:d,varyings:v,vertex:y}=e;v.add("gaussianCoordinates","vec2"),v.add("gaussianLogAlphaCutoff","float"),v.add("fragmentPositionCameraRelative","vec3"),y.uniforms.add(new x("splatOrderTexture",a=>a.splatOrder),new x("splatAtlasTexture",a=>a.splatAtlas),new x("splatHeaderTexture",a=>a.splatHeader),new m("minSplatRadius",a=>a.minSplatRadius),new u("inverseScreenSize",({camera:e})=>a(D,1/e.fullWidth,1/e.fullHeight)),new g("proj",a=>a.camera.projectionMatrix),new g("view",a=>a.camera.viewMatrix),new u("nearFar",a=>a.camera.nearFar)),r&&(y.uniforms.add(new p("clipMin",a=>a.clipMinCameraRelative),new p("clipMax",a=>a.clipMaxCameraRelative)),d.uniforms.add(new p("clipMin",a=>a.clipMinCameraRelative),new p("clipMax",a=>a.clipMaxCameraRelative))),y.include(c),y.include(o),y.include(l),y.include(t),y.include(s),y.include(i,n),d.include(s),d.include(i,n),d.main.add(f`
3
- ${z(n)}
4
- `)}function h(a,e){a.include(y,e),a.vertex.uniforms.add(new m("focalLength",a=>a.focalLength),new d("tanFov",a=>a.tanFov)),e.preciseDepth?(a.include(P),a.vertex.uniforms.add(new g("inverseProjectionMatrix",({camera:a})=>a.inverseProjectionMatrix)),a.fragment.include(n),a.fragment.code.add(f`float gaussianSplatDepth() {
2
+ import{RejectBySlicePass as a}from"../core/shaderLibrary/Slice.glsl.js";import{DepthConversion as e}from"../core/shaderLibrary/output/DepthConversion.glsl.js";import{positionOutsideClipSpace as i}from"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{inverseProjMatrix as n,inverseScreenSize as t,projMatrix as s,viewMatrix as r,nearFar as o}from"../core/shaderLibrary/util/cameraUniforms.js";import{GaussianSplatCovariance as c}from"../core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import{GaussianSplatEvaluation as l}from"../core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import{GaussianSplatTextureFetch as u}from"../core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import{GaussianSplatUnpacking as d}from"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as p}from"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2PassUniform as f}from"../core/shaderModules/Float2PassUniform.js";import{Float3PassUniform as m}from"../core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as v}from"../core/shaderModules/FloatPassUniform.js";import{glsl as g,If as x}from"../core/shaderModules/glsl.js";import{Texture2DUintPassUniform as y}from"../core/shaderModules/Texture2DUintPassUniform.js";function h(e,i){const{clippingEnabled:n}=i,{fragment:f,varyings:x,vertex:h}=e;x.add("gaussianCoordinates","vec2"),x.add("gaussianLogAlphaCutoff","float"),x.add("fragmentPositionCameraRelative","vec3"),h.uniforms.add(new y("splatOrderTexture",a=>a.splatOrder),new y("splatAtlasTexture",a=>a.splatAtlas),new y("splatHeaderTexture",a=>a.splatHeader),new v("minSplatRadius",a=>a.minSplatRadius),t,s,r,o),n&&(h.uniforms.add(new m("clipMin",a=>a.clipMinCameraRelative),new m("clipMax",a=>a.clipMaxCameraRelative)),f.uniforms.add(new m("clipMin",a=>a.clipMinCameraRelative),new m("clipMax",a=>a.clipMaxCameraRelative))),h.include(d),h.include(u),h.include(p),h.include(c),h.include(l),h.include(a,i),f.include(l),f.include(a,i),f.main.add(g`
3
+ ${D(i)}
4
+ `)}function P(a,i){a.include(h,i),a.vertex.uniforms.add(new v("focalLength",a=>a.focalLength),new f("tanFov",a=>a.tanFov)),i.preciseDepth?(a.include(R),a.vertex.uniforms.add(n),a.fragment.include(e),a.fragment.code.add(g`float gaussianSplatDepth() {
5
5
  float rayDepth = gaussianSplatRayDepth();
6
6
  return delinearizeDepth(-rayDepth);
7
- }`)):a.fragment.code.add(f`float gaussianSplatDepth() {
7
+ }`)):a.fragment.code.add(g`float gaussianSplatDepth() {
8
8
  return gl_FragCoord.z;
9
- }`)}function P(a){a.varyings.add("rayGaussianFactor","vec4"),a.fragment.code.add(f`float gaussianSplatRayDepth() {
9
+ }`)}function R(a){a.varyings.add("rayGaussianFactor","vec4"),a.fragment.code.add(g`float gaussianSplatRayDepth() {
10
10
  return rayGaussianFactor.w / dot(rayGaussianFactor.xyz, rayGaussianFactor.xyz);
11
- }`)}function R(a){a.uniforms.add(new x("splatFadingTexture",a=>a.splatFading)),a.code.add(f`float applyGaussianSplatFading(float opacity, uint gaussianIndex) {
11
+ }`)}function S(a){a.uniforms.add(new y("splatFadingTexture",a=>a.splatFading)),a.code.add(g`float applyGaussianSplatFading(float opacity, uint gaussianIndex) {
12
12
  uint pageIndex = fetchGaussianPageIndex(gaussianIndex);
13
13
  uint fadingTextureWidth = uint(textureSize(splatFadingTexture, 0).x);
14
14
  uint fadeX = pageIndex % fadingTextureWidth;
15
15
  uint fadeY = pageIndex / fadingTextureWidth;
16
16
  uint opacityModifier = texelFetch(splatFadingTexture, ivec2(fadeX, fadeY), 0).r;
17
17
  return opacity * float(opacityModifier) / 255.0;
18
- }`)}function S(a,e){const{clippingEnabled:i,hasSlicePlane:n}=a;return f`
19
- gl_Position = ${r};
18
+ }`)}function C(a,e){const{clippingEnabled:n,hasSlicePlane:t}=a;return g`
19
+ gl_Position = ${i};
20
20
 
21
21
  if (opacity < ${e}) {
22
22
  return;
@@ -24,14 +24,14 @@ return opacity * float(opacityModifier) / 255.0;
24
24
 
25
25
  vec3 cameraRelativePosition = fetchGaussianCameraRelativePosition(gaussianIndex, packedGaussian);
26
26
 
27
- ${v(i,f`
27
+ ${x(n,g`
28
28
  if (cameraRelativePosition.x < clipMin.x || cameraRelativePosition.y < clipMin.y || cameraRelativePosition.z < clipMin.z ||
29
29
  cameraRelativePosition.x > clipMax.x || cameraRelativePosition.y > clipMax.y || cameraRelativePosition.z > clipMax.z) {
30
30
  return;
31
31
  }
32
32
  `)}
33
33
 
34
- ${v(n,f`
34
+ ${x(t,g`
35
35
  if (rejectBySlice(cameraRelativePosition)) {
36
36
  return;
37
37
  }
@@ -42,11 +42,11 @@ return opacity * float(opacityModifier) / 255.0;
42
42
  if (viewPos.z > -nearFar.x || viewPos.z < -nearFar.y) {
43
43
  return;
44
44
  }
45
- `}const C=f`vec3 gaussianScale = unpackScale(packedGaussian);
46
- mat3 gaussianRotation = quaternionToRotationMatrix(unpackQuaternion(packedGaussian));`;function w(a){return f`
45
+ `}const G=g`vec3 gaussianScale = unpackScale(packedGaussian);
46
+ mat3 gaussianRotation = quaternionToRotationMatrix(unpackQuaternion(packedGaussian));`;function w(a){return g`
47
47
  vec3 inverseGaussianScale = 1.0 / gaussianScale;
48
48
  vec3 rayGaussianFactorCenter = (gaussianRotation * ${a}) * inverseGaussianScale;
49
- `}function M(a,e){return f`
49
+ `}function M(a,e){return g`
50
50
  float determinant = computeGaussianCovarianceDeterminant(covariance2D);
51
51
  if (determinant <= 0.0) {
52
52
  return;
@@ -61,7 +61,7 @@ mat3 gaussianRotation = quaternionToRotationMatrix(unpackQuaternion(packedGaussi
61
61
  if (rejectGaussianByMinimumRadius(maxRadius, ${e}, minSplatRadius)) {
62
62
  return;
63
63
  }
64
- `}const G=f`vec2 clipSpacePixelScale = 2.0 * inverseScreenSize;
64
+ `}const F=g`vec2 clipSpacePixelScale = 2.0 * inverseScreenSize;
65
65
  if (rejectGaussianByScreenBounds(ndcPos.xy, screenRadii, clipSpacePixelScale)) {
66
66
  return;
67
67
  }
@@ -70,32 +70,32 @@ gaussianCoordinates = quadCorner * sqrt(gaussianEllipseThreshold);
70
70
  float inverseRadiusX = inversesqrt(covariance2D.x);
71
71
  vec2 choleskyAxisX = covariance2D.xy * inverseRadiusX;
72
72
  vec2 choleskyAxisY = vec2(0.0, sqrt(determinant) * inverseRadiusX);
73
- vec2 offsetFromCenter = gaussianCoordinates.x * choleskyAxisX + gaussianCoordinates.y * choleskyAxisY;`;function F(a,e){return f`
74
- ${S(a,f.float(e))}
73
+ vec2 offsetFromCenter = gaussianCoordinates.x * choleskyAxisX + gaussianCoordinates.y * choleskyAxisY;`;function z(a,e){return g`
74
+ ${C(a,g.float(e))}
75
75
 
76
- ${C}
76
+ ${G}
77
77
  vec3 covariance2D = computeGaussianCovariance2D(viewPos.xyz, focalLength, tanFov, gaussianScale, gaussianRotation, view);
78
78
  float minimumRadiusOpacity = opacity;
79
79
  float opacityScale = regularizeGaussianCovariance(covariance2D);
80
80
  opacity *= opacityScale;
81
- if (opacity < ${f.float(e)}) {
81
+ if (opacity < ${g.float(e)}) {
82
82
  return;
83
83
  }
84
84
 
85
- ${M(`${f.float(Math.log(e))} - log(opacity)`,"minimumRadiusOpacity")}
85
+ ${M(`${g.float(Math.log(e))} - log(opacity)`,"minimumRadiusOpacity")}
86
86
  ${j(a)}
87
- `}function j(a){return f`
87
+ `}function j(a){return g`
88
88
  vec4 projPos = proj * viewPos;
89
89
  float invW = 1.0 / (projPos.w + 1e-7);
90
90
  vec3 ndcPos = projPos.xyz * invW;
91
- ${G}
91
+ ${F}
92
92
 
93
93
  float viewSpacePixelScale = -viewPos.z / focalLength;
94
94
  vec3 fragmentViewOffset = vec3(offsetFromCenter * viewSpacePixelScale, 0.0);
95
95
  fragmentPositionCameraRelative = cameraRelativePosition + transpose(mat3(view)) * fragmentViewOffset;
96
96
 
97
97
  vec2 quadClipPosition = ndcPos.xy + offsetFromCenter * clipSpacePixelScale - inverseScreenSize;
98
- ${v(a.preciseDepth,f`
98
+ ${x(a.preciseDepth,g`
99
99
  ${w("cameraRelativePosition")}
100
100
  vec3 rayViewPoint = (inverseProjectionMatrix * vec4(quadClipPosition, -1.0, 1.0)).xyz;
101
101
  vec3 rayView = vec3(-rayViewPoint.xy / rayViewPoint.z, -1.0);
@@ -103,17 +103,17 @@ vec2 offsetFromCenter = gaussianCoordinates.x * choleskyAxisX + gaussianCoordina
103
103
  rayGaussianFactor = vec4(rayGaussianFactorRay, dot(rayGaussianFactorCenter, rayGaussianFactorRay));
104
104
  `)}
105
105
  gl_Position = vec4(quadClipPosition, ndcPos.z, 1.0);
106
- `}function z(a){const{clippingEnabled:e,hasSlicePlane:i}=a;return f`
107
- ${v(e,f`
106
+ `}function D(a){const{clippingEnabled:e,hasSlicePlane:i}=a;return g`
107
+ ${x(e,g`
108
108
  if (fragmentPositionCameraRelative.x < clipMin.x || fragmentPositionCameraRelative.y < clipMin.y || fragmentPositionCameraRelative.z < clipMin.z ||
109
109
  fragmentPositionCameraRelative.x > clipMax.x || fragmentPositionCameraRelative.y > clipMax.y || fragmentPositionCameraRelative.z > clipMax.z) {
110
110
  discard;
111
111
  }
112
112
  `)}
113
- ${v(i,f`if (rejectBySlice(fragmentPositionCameraRelative)) { discard; }`)}
113
+ ${x(i,g`if (rejectBySlice(fragmentPositionCameraRelative)) { discard; }`)}
114
114
 
115
115
  float gaussianExponent = evaluateGaussianExponent(gaussianCoordinates);
116
116
  if (gaussianExponent > 0.0 || gaussianExponent < gaussianLogAlphaCutoff) {
117
117
  discard;
118
118
  }
119
- `}const D=e();export{R as GaussianSplatFading,y as GaussianSplatPass,h as GaussianSplatPerspectivePass,M as gaussianSplatComputeEllipse,G as gaussianSplatComputeQuad,S as gaussianSplatCullAndTransformVertex,F as gaussianSplatPerspectiveVertex,C as gaussianSplatUnpackScaleAndRotation};
119
+ `}export{S as GaussianSplatFading,h as GaussianSplatPass,P as GaussianSplatPerspectivePass,M as gaussianSplatComputeEllipse,F as gaussianSplatComputeQuad,C as gaussianSplatCullAndTransformVertex,z as gaussianSplatPerspectiveVertex,G as gaussianSplatUnpackScaleAndRotation};