@arcgis/core 4.31.0-next.20240619 → 4.31.0-next.20240621

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 (189) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{3a74d3fc690177a703f5.js → 019ce38b02e3bf517125.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{222807cfaa2e17d0efea.js → 6745cedf6f82c8917904.js} +1 -1
  4. package/assets/esri/core/workers/chunks/7b6cd976367a0dd297d6.js +1 -0
  5. package/assets/esri/core/workers/chunks/{d7c0728bdd9a7fd1d701.js → 9d677af08238d9e09e72.js} +36 -25
  6. package/assets/esri/core/workers/chunks/bedf60888f07b78b314d.js +1 -0
  7. package/assets/esri/core/workers/chunks/c39237c00c1d588dc107.js +1 -0
  8. package/assets/esri/core/workers/chunks/cf1530abe2842f3d8eb0.js +1 -0
  9. package/assets/esri/core/workers/chunks/de7fa31d86a65ccdffc1.js +1 -0
  10. package/assets/esri/core/workers/chunks/{8ee8f3c54b2cce217845.js → f13fb6b712e364bbf48c.js} +1 -1
  11. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ar.json +1 -1
  12. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_bg.json +1 -1
  13. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_bs.json +1 -1
  14. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ca.json +1 -1
  15. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_cs.json +1 -1
  16. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_da.json +1 -1
  17. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_de.json +1 -1
  18. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_el.json +1 -1
  19. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_es.json +1 -1
  20. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_et.json +1 -1
  21. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_fi.json +1 -1
  22. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_fr.json +1 -1
  23. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_he.json +1 -1
  24. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_hr.json +1 -1
  25. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_hu.json +1 -1
  26. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_id.json +1 -1
  27. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_it.json +1 -1
  28. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ja.json +1 -1
  29. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ko.json +1 -1
  30. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_lt.json +1 -1
  31. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_lv.json +1 -1
  32. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_nb.json +1 -1
  33. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_nl.json +1 -1
  34. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_pl.json +1 -1
  35. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_pt-BR.json +1 -1
  36. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_pt-PT.json +1 -1
  37. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ro.json +1 -1
  38. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ru.json +1 -1
  39. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sk.json +1 -1
  40. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sl.json +1 -1
  41. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sr.json +1 -1
  42. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sv.json +1 -1
  43. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_th.json +1 -1
  44. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_tr.json +1 -1
  45. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_uk.json +1 -1
  46. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_vi.json +1 -1
  47. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_zh-CN.json +1 -1
  48. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_zh-HK.json +1 -1
  49. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_zh-TW.json +1 -1
  50. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  51. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  52. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  53. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  54. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  55. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  56. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  57. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  58. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  59. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  60. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  61. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  62. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  63. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  64. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  65. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  66. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  67. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  68. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  69. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  70. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  71. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nb.json +1 -1
  72. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  73. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  74. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  75. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  76. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  77. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  78. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  79. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  80. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  81. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  82. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  83. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  84. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  85. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  86. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  87. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  88. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  89. package/chunks/CheckerBoard.glsl.js +9 -6
  90. package/chunks/ComponentShader.glsl.js +23 -23
  91. package/chunks/HUDMaterial.glsl.js +29 -33
  92. package/chunks/HighlightApply.glsl.js +150 -23
  93. package/chunks/HighlightDownsample.glsl.js +25 -12
  94. package/chunks/ImageMaterial.glsl.js +1 -2
  95. package/chunks/LineMarker.glsl.js +30 -30
  96. package/chunks/RibbonLine.glsl.js +42 -42
  97. package/chunks/ShadowHighlight.glsl.js +15 -6
  98. package/chunks/Terrain.glsl.js +6 -3
  99. package/interfaces.d.ts +50 -14
  100. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  101. package/layers/mixins/EditBusLayer.js +1 -1
  102. package/layers/mixins/FeatureLayerBase.js +1 -1
  103. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  104. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  105. package/layers/support/featureLayerUtils.js +1 -1
  106. package/package.json +1 -1
  107. package/portal/schemas/definitions.js +1 -1
  108. package/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js +1 -1
  109. package/support/revision.js +1 -1
  110. package/views/2d/layers/support/ExportStrategy.js +1 -1
  111. package/views/3d/layers/I3SMeshView3D.js +1 -1
  112. package/views/3d/layers/SceneLayerView3D.js +1 -1
  113. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  114. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  115. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  116. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  117. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  118. package/views/3d/layers/i3s/Highlights.js +1 -1
  119. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  120. package/views/3d/support/HighlightOptions.js +1 -1
  121. package/views/3d/support/HighlightOptionsBase.js +5 -0
  122. package/views/3d/terrain/OverlayRenderTargets.js +1 -1
  123. package/views/3d/terrain/TerrainRenderer.js +1 -1
  124. package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
  125. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  126. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  127. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +1 -2
  128. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  129. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  130. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +18 -7
  131. package/views/3d/webgl-engine/core/shaderModules/Integer2PassUniform.js +5 -0
  132. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  133. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  134. package/views/3d/webgl-engine/effects/highlight/HighlightPassParameters.js +1 -1
  135. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  136. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  137. package/views/3d/webgl-engine/lib/Material.js +1 -1
  138. package/views/3d/webgl-engine/lib/Program.js +1 -1
  139. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  140. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  141. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  142. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  143. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  144. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  145. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  146. package/views/3d/webgl-engine/lib/edgeRendering/interfaces.js +1 -1
  147. package/views/3d/webgl-engine/lib/edgeRendering/util.js +1 -1
  148. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  149. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  150. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  151. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  152. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  153. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  154. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  155. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  156. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  157. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  158. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  159. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  160. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  161. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  162. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  163. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  164. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  165. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  166. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  167. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  168. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  169. package/views/SceneView.js +1 -1
  170. package/views/SelectionManager.js +1 -1
  171. package/views/support/HighlightDefaults.js +1 -1
  172. package/views/webgl/BufferObject.js +1 -1
  173. package/views/webgl/RenderingContext.js +1 -1
  174. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  175. package/widgets/OrientedImageryViewer/adapters/OrientedImageryViewerViewModelAdapter2D.js +1 -1
  176. package/widgets/OrientedImageryViewer/utils.js +1 -1
  177. package/widgets/OrientedImageryViewer.js +1 -1
  178. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  179. package/widgets/PanoramicViewer/constants.js +1 -1
  180. package/widgets/PanoramicViewer/utils.js +1 -1
  181. package/widgets/Print.js +1 -1
  182. package/assets/esri/core/workers/chunks/24484bd0185ea0f79760.js +0 -1
  183. package/assets/esri/core/workers/chunks/4f2be9fd4ff5b3ad3110.js +0 -1
  184. package/assets/esri/core/workers/chunks/88c7d84a1fde246ca71f.js +0 -1
  185. package/assets/esri/core/workers/chunks/986520dd0de64105dbff.js +0 -1
  186. package/assets/esri/core/workers/chunks/ad0a87dba95785ad6171.js +0 -1
  187. package/chunks/HighlightBlur.glsl.js +0 -25
  188. package/views/3d/webgl-engine/effects/highlight/HighlightBlurTechnique.js +0 -5
  189. package/views/3d/webgl-engine/shaders/HighlightBlur.glsl.js +0 -5
@@ -2,27 +2,40 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{NoParameters as r,glsl as a}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as t}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DDrawUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js";class o extends r{}function i(){const r=new t,{outputs:o,fragment:i}=r;return r.include(e),i.uniforms.add(new l("textureInput",(e=>e.input))),i.constants.add("sampleArea","int",Math.ceil(s/2)),o.add("fragGrid","vec2"),i.code.add(a`
5
+ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{NoParameters as l,glsl as a}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as r}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DDrawUniform as o}from"../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js";class t extends l{}function i(){const l=new r,{outputs:t,fragment:i}=l;return l.include(e),i.uniforms.add(new o("textureInput",(e=>e.input))),i.constants.add("sampleArea","int",Math.ceil(n/2)),t.add("fragGrid","vec2"),i.code.add(a`
6
6
  void main() {
7
- float red = 0.0;
8
- float green = 1.0;
9
- int cellSize = ${a.int(n)};
7
+ int cellSize = ${a.int(s)};
10
8
  vec2 texelSize = 1.0 / vec2(textureSize(textureInput, 0));
11
9
  vec2 offset = floor(gl_FragCoord.xy) * vec2(float(cellSize));
12
10
 
11
+ bool first = true;
12
+ bool allEqual = true;
13
+ bool hasAny = false;
14
+ vec4 commonValue = vec4(0.0);
13
15
  for(int x = -sampleArea; x < cellSize + sampleArea; x += 2) {
14
16
  for(int y = -sampleArea; y < cellSize + sampleArea; y += 2) {
15
17
  vec2 coord = (offset + vec2(float(x), float(y))) * texelSize;
16
18
  vec4 value = texture(textureInput, coord);
17
- float mx = floor(max(value.g, value.b));
18
-
19
- red = max(red, ceil(value.r));
20
- green = min(green, mx);
21
- if(red == 1.0 && green == 0.0) {
22
- fragGrid = vec2(red, green);
19
+ if (allEqual){
20
+ if (first){
21
+ first = false;
22
+ commonValue = value;
23
+ }else{
24
+ if (value != commonValue){
25
+ allEqual = false;
26
+ }
27
+ }
28
+ }
29
+ if (!hasAny){
30
+ if (value != vec4(0.0)){
31
+ hasAny = true;
32
+ }
33
+ }
34
+ if (hasAny && !allEqual){
35
+ fragGrid = vec2(hasAny ? 1.0 : 0.0, allEqual ? 1.0 : 0.0);
23
36
  return;
24
37
  }
25
38
  }
26
39
  }
27
- fragGrid = vec2(red, green);
28
- }`),r}const n=32,s=9,d=.4,c=Object.freeze(Object.defineProperty({__proto__:null,HighlightDownsampleDrawParameters:o,blurSize:d,build:i,gridCellPixelSize:n,outlineSize:s},Symbol.toStringTag,{value:"Module"}));export{o as H,c as a,d as b,i as c,n as g,s as o};
40
+ fragGrid = vec2(hasAny ? 1.0 : 0.0, allEqual ? 1.0 : 0.0);
41
+ }`),l}const s=32,n=9,u=.4,c=Object.freeze(Object.defineProperty({__proto__:null,HighlightDownsampleDrawParameters:t,blurSize:u,build:i,gridCellPixelSize:s,outlineSize:n},Symbol.toStringTag,{value:"Module"}));export{t as H,c as a,u as b,i as c,s as g,n as o};
@@ -25,7 +25,6 @@ import{ShaderOutput as e}from"../views/3d/webgl-engine/core/shaderLibrary/Shader
25
25
  ${v.transparencyPassType===g.ColorAlpha?d`
26
26
  fragColor = premultiplyAlpha(fragColor);
27
27
  fragAlpha = fragColor.a;`:""}
28
- ${v.output===e.ObjectAndLayerIdColor?d`
29
- fragColor = vec4(0,0,0,1);`:""}
28
+ ${v.output===e.ObjectAndLayerIdColor?d`fragColor = vec4(0, 0, 0, 1);`:""}
30
29
  }
31
30
  `),f}const f=Object.freeze(Object.defineProperty({__proto__:null,build:v},Symbol.toStringTag,{value:"Module"}));export{f as I,v as b};
@@ -2,33 +2,33 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{markerTextureSize as e,markerSymbolSize as r,markerTipThicknessFactor as o}from"../views/3d/support/engineContent/marker.js";import{ShaderOutput as i}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as a}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{RibbonVertexPosition as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import{MarkerSizing as n}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js";import{multipassTerrainTest as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{alphaCutoff as l}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{ColorConversion as c}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{RgbaFloatEncoding as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{addProjViewLocalOrigin as p,addViewNormal as v,addPixelRatio as m}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float2PassUniform as f}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float4PassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as h}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as u}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as w}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as y}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as S}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{TransparencyPassType as b}from"../views/3d/webgl-engine/lib/TransparencyPassType.js";import{VertexAttribute as P}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{LineMarkerSpace as x,LineMarkerAnchor as z}from"../views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js";function C(C){const j=new y,L=C.multipassEnabled&&C.output===i.Color,M=C.space===x.World;j.include(t,C),j.include(n,C);const{vertex:k,fragment:N}=j;return N.include(d),p(k,C),j.attributes.add(P.POSITION,"vec3"),j.attributes.add(P.PREVPOSITION,"vec3"),j.attributes.add(P.UV0,"vec2"),j.varyings.add("vColor","vec4"),j.varyings.add("vpos","vec3"),j.varyings.add("vUV","vec2"),j.varyings.add("vSize","float"),L&&j.varyings.add("depth","float"),C.hasTip&&j.varyings.add("vLineWidth","float"),k.uniforms.add(new f("nearFar",((e,r)=>r.camera.nearFar)),new g("viewport",((e,r)=>r.camera.fullViewport))),k.code.add(u`vec4 projectAndScale(vec4 pos) {
5
+ import{markerTextureSize as e,markerSymbolSize as r,markerTipThicknessFactor as o}from"../views/3d/support/engineContent/marker.js";import{ShaderOutput as i}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as a}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{RibbonVertexPosition as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import{OutputHighlight as n}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{MarkerSizing as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js";import{multipassTerrainTest as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{alphaCutoff as c}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{ColorConversion as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{RgbaFloatEncoding as p}from"../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{addProjViewLocalOrigin as v,addViewNormal as m,addPixelRatio as f}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float2PassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float4PassUniform as h}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as u}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as w}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as y}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as S}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as b}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{TransparencyPassType as P}from"../views/3d/webgl-engine/lib/TransparencyPassType.js";import{VertexAttribute as x}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{LineMarkerSpace as z,LineMarkerAnchor as j}from"../views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js";function C(C){const L=new S,M=C.multipassEnabled&&C.output===i.Color,k=C.space===z.World;L.include(t,C),L.include(s,C);const{vertex:N,fragment:T}=L;return T.include(p),v(N,C),L.attributes.add(x.POSITION,"vec3"),L.attributes.add(x.PREVPOSITION,"vec3"),L.attributes.add(x.UV0,"vec2"),L.varyings.add("vColor","vec4"),L.varyings.add("vpos","vec3"),L.varyings.add("vUV","vec2"),L.varyings.add("vSize","float"),M&&L.varyings.add("depth","float"),C.hasTip&&L.varyings.add("vLineWidth","float"),N.uniforms.add(new g("nearFar",((e,r)=>r.camera.nearFar)),new h("viewport",((e,r)=>r.camera.fullViewport))),N.code.add(w`vec4 projectAndScale(vec4 pos) {
6
6
  vec4 posNdc = proj * pos;
7
7
  posNdc.xy *= viewport.zw / posNdc.w;
8
8
  return posNdc;
9
- }`),k.code.add(u`void clip(vec4 pos, inout vec4 prev) {
9
+ }`),N.code.add(w`void clip(vec4 pos, inout vec4 prev) {
10
10
  float vnp = nearFar[0] * 0.99;
11
11
  if (prev.z > -nearFar[0]) {
12
12
  float interpolation = (-vnp - pos.z) / (prev.z - pos.z);
13
13
  prev = mix(pos, prev, interpolation);
14
14
  }
15
- }`),M?(j.attributes.add(P.NORMAL,"vec3"),v(k),k.constants.add("tiltThreshold","float",.7),k.code.add(u`vec3 perpendicular(vec3 v) {
15
+ }`),k?(L.attributes.add(x.NORMAL,"vec3"),m(N),N.constants.add("tiltThreshold","float",.7),N.code.add(w`vec3 perpendicular(vec3 v) {
16
16
  vec3 n = (viewNormal * vec4(normal.xyz, 1.0)).xyz;
17
17
  vec3 n2 = cross(v, n);
18
18
  vec3 forward = vec3(0.0, 0.0, 1.0);
19
19
  float tiltDot = dot(forward, n);
20
20
  return abs(tiltDot) < tiltThreshold ? n : n2;
21
- }`)):k.code.add(u`vec2 perpendicular(vec2 v) {
21
+ }`)):N.code.add(w`vec2 perpendicular(vec2 v) {
22
22
  return vec2(v.y, -v.x);
23
- }`),k.code.add(u`
24
- #define vecN ${M?"vec3":"vec2"}
23
+ }`),N.code.add(w`
24
+ #define vecN ${k?"vec3":"vec2"}
25
25
 
26
26
  vecN normalizedSegment(vecN pos, vecN prev) {
27
27
  vecN segment = pos - prev;
28
28
  float segmentLen = length(segment);
29
29
 
30
30
  // normalize or zero if too short
31
- return (segmentLen > 0.001) ? segment / segmentLen : ${M?"vec3(0.0, 0.0, 0.0)":"vec2(0.0, 0.0)"};
31
+ return (segmentLen > 0.001) ? segment / segmentLen : ${k?"vec3(0.0, 0.0, 0.0)":"vec2(0.0, 0.0)"};
32
32
  }
33
33
 
34
34
  vecN displace(vecN pos, vecN prev, float displacementLen) {
@@ -37,19 +37,19 @@ return vec2(v.y, -v.x);
37
37
  vecN displacementDirU = perpendicular(segment);
38
38
  vecN displacementDirV = segment;
39
39
 
40
- ${C.anchor===z.Tip?"pos -= 0.5 * displacementLen * displacementDirV;":""}
40
+ ${C.anchor===j.Tip?"pos -= 0.5 * displacementLen * displacementDirV;":""}
41
41
 
42
42
  return pos + displacementLen * (uv0.x * displacementDirU + uv0.y * displacementDirV);
43
43
  }
44
- `),C.space===x.Screen&&(k.uniforms.add(new w("inverseProjectionMatrix",((e,r)=>r.camera.inverseProjectionMatrix))),k.code.add(u`vec3 inverseProject(vec4 posScreen) {
44
+ `),C.space===z.Screen&&(N.uniforms.add(new y("inverseProjectionMatrix",((e,r)=>r.camera.inverseProjectionMatrix))),N.code.add(w`vec3 inverseProject(vec4 posScreen) {
45
45
  posScreen.xy = (posScreen.xy / viewport.zw) * posScreen.w;
46
46
  return (inverseProjectionMatrix * posScreen).xyz;
47
- }`),k.code.add(u`bool rayIntersectPlane(vec3 rayDir, vec3 planeOrigin, vec3 planeNormal, out vec3 intersection) {
47
+ }`),N.code.add(w`bool rayIntersectPlane(vec3 rayDir, vec3 planeOrigin, vec3 planeNormal, out vec3 intersection) {
48
48
  float cos = dot(rayDir, planeNormal);
49
49
  float t = dot(planeOrigin, planeNormal) / cos;
50
50
  intersection = t * rayDir;
51
51
  return abs(cos) > 0.001 && t > 0.0;
52
- }`),k.uniforms.add(new h("perScreenPixelRatio",((e,r)=>r.camera.perScreenPixelRatio))),k.code.add(u`
52
+ }`),N.uniforms.add(new u("perScreenPixelRatio",((e,r)=>r.camera.perScreenPixelRatio))),N.code.add(w`
53
53
  vec4 toFront(vec4 displacedPosScreen, vec3 posLeft, vec3 posRight, vec3 prev, float lineWidth) {
54
54
  // Project displaced position back to camera space
55
55
  vec3 displacedPos = inverseProject(displacedPosScreen);
@@ -78,7 +78,7 @@ return abs(cos) > 0.001 && t > 0.0;
78
78
  displacedPos *= minDepth / length(displacedPos);
79
79
  return vec4(displacedPos.xyz, 1.0);
80
80
  }
81
- `)),m(k),k.code.add(u`void main(void) {
81
+ `)),f(N),N.code.add(w`void main(void) {
82
82
  if (uv0.y == 0.0) {
83
83
  gl_Position = vec4(1e038, 1e038, 1e038, 1.0);
84
84
  }
@@ -87,19 +87,19 @@ float lineWidth = getLineWidth();
87
87
  float screenMarkerSize = getScreenMarkerSize();
88
88
  vec4 pos = view * vec4(position, 1.0);
89
89
  vec4 prev = view * vec4(prevPosition, 1.0);
90
- clip(pos, prev);`),M?(C.hideOnShortSegments&&k.code.add(u`if (areWorldMarkersHidden(pos, prev)) {
90
+ clip(pos, prev);`),k?(C.hideOnShortSegments&&N.code.add(w`if (areWorldMarkersHidden(pos, prev)) {
91
91
  gl_Position = vec4(1e038, 1e038, 1e038, 1.0);
92
92
  return;
93
- }`),k.code.add(u`pos.xyz = displace(pos.xyz, prev.xyz, getWorldMarkerSize(pos));
94
- vec4 displacedPosScreen = projectAndScale(pos);`)):(k.code.add(u`vec4 posScreen = projectAndScale(pos);
93
+ }`),N.code.add(w`pos.xyz = displace(pos.xyz, prev.xyz, getWorldMarkerSize(pos));
94
+ vec4 displacedPosScreen = projectAndScale(pos);`)):(N.code.add(w`vec4 posScreen = projectAndScale(pos);
95
95
  vec4 prevScreen = projectAndScale(prev);
96
96
  vec4 displacedPosScreen = posScreen;
97
- displacedPosScreen.xy = displace(posScreen.xy, prevScreen.xy, screenMarkerSize);`),C.space===x.Screen&&k.code.add(u`vec2 displacementDirU = perpendicular(normalizedSegment(posScreen.xy, prevScreen.xy));
97
+ displacedPosScreen.xy = displace(posScreen.xy, prevScreen.xy, screenMarkerSize);`),C.space===z.Screen&&N.code.add(w`vec2 displacementDirU = perpendicular(normalizedSegment(posScreen.xy, prevScreen.xy));
98
98
  vec3 lineRight = inverseProject(posScreen + lineWidth * vec4(displacementDirU.xy, 0.0, 0.0));
99
99
  vec3 lineLeft = pos.xyz + (pos.xyz - lineRight);
100
100
  pos = toFront(displacedPosScreen, lineLeft, lineRight, prev.xyz, lineWidth);
101
- displacedPosScreen = projectAndScale(pos);`)),k.code.add(u`
102
- ${L?"depth = pos.z;":""}
101
+ displacedPosScreen = projectAndScale(pos);`)),N.code.add(w`
102
+ ${M?"depth = pos.z;":""}
103
103
 
104
104
  // Convert back into NDC
105
105
  displacedPosScreen.xy = (displacedPosScreen.xy / viewport.zw) * displacedPosScreen.w;
@@ -107,7 +107,7 @@ displacedPosScreen = projectAndScale(pos);`)),k.code.add(u`
107
107
  // Convert texture coordinate into [0,1]
108
108
  vUV = (uv0 + 1.0) / 2.0;
109
109
 
110
- ${M?"":"vUV *= displacedPosScreen.w;"}
110
+ ${k?"":"vUV *= displacedPosScreen.w;"}
111
111
 
112
112
  ${C.hasTip?"vLineWidth = lineWidth;":""}
113
113
 
@@ -120,13 +120,13 @@ displacedPosScreen = projectAndScale(pos);`)),k.code.add(u`
120
120
  gl_Position = displacedPosScreen;
121
121
  }
122
122
  }
123
- `),L&&j.include(s,C),j.include(a,C),N.uniforms.add(new g("intrinsicColor",(e=>e.color)),new S("tex",(e=>e.markerTexture))),N.include(c),j.constants.add("texelSize","float",1/e),N.code.add(u`float markerAlpha(vec2 samplePos) {
123
+ `),M&&L.include(l,C),L.include(a,C),T.uniforms.add(new h("intrinsicColor",(e=>e.color)),new b("tex",(e=>e.markerTexture))),T.include(d),L.constants.add("texelSize","float",1/e),T.code.add(w`float markerAlpha(vec2 samplePos) {
124
124
  samplePos += vec2(0.5, -0.5) * texelSize;
125
125
  float sdf = rgba2float(texture(tex, samplePos)) - 0.5;
126
126
  float distance = sdf * vSize;
127
127
  distance -= 0.5;
128
128
  return clamp(0.5 - distance, 0.0, 1.0);
129
- }`),C.hasTip&&(j.constants.add("relativeMarkerSize","float",r/e),j.constants.add("relativeTipLineWidth","float",o),N.code.add(u`
129
+ }`),C.hasTip&&(L.constants.add("relativeMarkerSize","float",r/e),L.constants.add("relativeTipLineWidth","float",o),T.code.add(w`
130
130
  float tipAlpha(vec2 samplePos) {
131
131
  // Convert coordinates s.t. they are in pixels and relative to the tip of an arrow marker
132
132
  samplePos -= vec2(0.5, 0.5 + 0.5 * relativeMarkerSize);
@@ -135,32 +135,32 @@ return clamp(0.5 - distance, 0.0, 1.0);
135
135
  float halfMarkerSize = 0.5 * relativeMarkerSize * vSize;
136
136
  float halfTipLineWidth = 0.5 * max(1.0, relativeTipLineWidth * vLineWidth);
137
137
 
138
- ${M?"halfTipLineWidth *= fwidth(samplePos.y);":""}
138
+ ${k?"halfTipLineWidth *= fwidth(samplePos.y);":""}
139
139
 
140
140
  float distance = max(abs(samplePos.x) - halfMarkerSize, abs(samplePos.y) - halfTipLineWidth);
141
141
  return clamp(0.5 - distance, 0.0, 1.0);
142
142
  }
143
- `)),C.transparencyPassType===b.ColorAlpha&&(j.outputs.add("fragColor","vec4",0),j.outputs.add("fragAlpha","float",1)),j.constants.add("symbolAlphaCutoff","float",l),N.code.add(u`
143
+ `)),C.transparencyPassType===P.ColorAlpha&&(L.outputs.add("fragColor","vec4",0),L.outputs.add("fragAlpha","float",1)),L.constants.add("symbolAlphaCutoff","float",c),C.output===i.Highlight&&L.include(n,C),T.code.add(w`
144
144
  void main() {
145
145
  discardBySlice(vpos);
146
- ${L?"terrainDepthTest(depth);":""}
146
+ ${M?"terrainDepthTest(depth);":""}
147
147
 
148
148
  vec4 finalColor = intrinsicColor * vColor;
149
149
 
150
- ${M?"vec2 samplePos = vUV;":"vec2 samplePos = vUV * gl_FragCoord.w;"}
150
+ ${k?"vec2 samplePos = vUV;":"vec2 samplePos = vUV * gl_FragCoord.w;"}
151
151
 
152
152
  ${C.hasTip?"finalColor.a *= max(markerAlpha(samplePos), tipAlpha(samplePos));":"finalColor.a *= markerAlpha(samplePos);"}
153
153
 
154
- ${C.output===i.ObjectAndLayerIdColor?u`finalColor.a = 1.0;`:""}
154
+ ${C.output===i.ObjectAndLayerIdColor?w`finalColor.a = 1.0;`:""}
155
155
 
156
156
  if (finalColor.a < symbolAlphaCutoff) {
157
157
  discard;
158
158
  }
159
159
 
160
- ${C.output===i.Color?u`fragColor = highlightSlice(finalColor, vpos);`:""}
161
- ${C.output===i.Color&&C.transparencyPassType===b.ColorAlpha?u`
160
+ ${C.output===i.Color?w`fragColor = highlightSlice(finalColor, vpos);`:""}
161
+ ${C.output===i.Color&&C.transparencyPassType===P.ColorAlpha?w`
162
162
  fragColor = premultiplyAlpha(fragColor);
163
163
  fragAlpha = fragColor.a;`:""}
164
- ${C.output===i.Highlight?u`fragColor = vec4(1.0);`:""}
164
+ ${C.output===i.Highlight?w`outputHighlight();`:""}
165
165
  }
166
- `),j}const j=Object.freeze(Object.defineProperty({__proto__:null,build:C},Symbol.toStringTag,{value:"Module"}));export{j as L,C as b};
166
+ `),L}const L=Object.freeze(Object.defineProperty({__proto__:null,build:C},Symbol.toStringTag,{value:"Module"}));export{L,C as b};
@@ -2,7 +2,7 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{ShaderOutput as e}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as i}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{ObjectAndLayerIdColor as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{RibbonVertexPosition as o}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import{LineStipple as n,computePixelSize as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js";import{MarkerSizing as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js";import{multipassTerrainTest as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{PiUtils as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js";import{alphaCutoff as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{ColorConversion as p}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as c,addPixelRatio as m}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float2PassUniform as f}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float4PassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as h}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as S}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{TransparencyPassType as D}from"../views/3d/webgl-engine/lib/TransparencyPassType.js";import{VertexAttribute as L}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{LineMarkerSpace as b}from"../views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js";import{CapType as x}from"../views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js";const w=1;function y(y){const C=new S,{attributes:j,varyings:P,constants:A,vertex:R,fragment:E}=C;C.include(l),C.include(o,y),C.include(n,y);const T=y.applyMarkerOffset&&!y.draped;T&&(R.uniforms.add(new g("markerScale",(e=>e.markerScale))),C.include(a,{space:b.World,draped:!1})),C.include(t,y),c(R,y),R.uniforms.add(new u("inverseProjectionMatrix",((e,i)=>i.camera.inverseProjectionMatrix)),new f("nearFar",((e,i)=>i.camera.nearFar)),new g("miterLimit",(e=>"miter"!==e.join?0:e.miterLimit)),new v("viewport",((e,i)=>i.camera.fullViewport))),R.constants.add("LARGE_HALF_FLOAT","float",65500),j.add(L.POSITION,"vec3"),j.add(L.PREVPOSITION,"vec3"),j.add(L.NEXTPOSITION,"vec3"),j.add(L.SUBDIVISIONFACTOR,"float"),j.add(L.UV0,"vec2"),P.add("vColor","vec4"),P.add("vpos","vec3"),P.add("vLineDistance","float"),P.add("vLineWidth","float");const F=y.multipassEnabled&&y.output===e.Color;F&&P.add("depth","float");const z=y.stippleEnabled;z&&P.add("vLineSizeInv","float"),A.add("aaWidth","float",y.stippleEnabled?0:1);const V=y.capType===x.ROUND,O=y.stippleEnabled&&V,W=y.falloffEnabled||O;W&&P.add("vLineDistanceNorm","float"),V&&(P.add("vSegmentSDF","float"),P.add("vReverseSegmentSDF","float")),R.code.add(h`#define PERPENDICULAR(v) vec2(v.y, -v.x);
5
+ import{ShaderOutput as e}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as i}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{ObjectAndLayerIdColor as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{RibbonVertexPosition as o}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import{OutputHighlight as n}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{LineStipple as r,computePixelSize as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js";import{MarkerSizing as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js";import{multipassTerrainTest as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{PiUtils as d}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js";import{alphaCutoff as p}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{ColorConversion as c}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as m,addPixelRatio as f}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float2PassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float4PassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as h}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as u}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as S}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as D}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{TransparencyPassType as L}from"../views/3d/webgl-engine/lib/TransparencyPassType.js";import{VertexAttribute as b}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{LineMarkerSpace as x}from"../views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js";import{CapType as w}from"../views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js";const y=1;function C(C){const j=new D,{attributes:P,varyings:A,constants:R,vertex:E,fragment:T}=j;j.include(d),j.include(o,C),j.include(r,C);const F=C.applyMarkerOffset&&!C.draped;F&&(E.uniforms.add(new h("markerScale",(e=>e.markerScale))),j.include(s,{space:x.World,draped:!1})),j.include(t,C),m(E,C),E.uniforms.add(new S("inverseProjectionMatrix",((e,i)=>i.camera.inverseProjectionMatrix)),new v("nearFar",((e,i)=>i.camera.nearFar)),new h("miterLimit",(e=>"miter"!==e.join?0:e.miterLimit)),new g("viewport",((e,i)=>i.camera.fullViewport))),E.constants.add("LARGE_HALF_FLOAT","float",65500),P.add(b.POSITION,"vec3"),P.add(b.PREVPOSITION,"vec3"),P.add(b.NEXTPOSITION,"vec3"),P.add(b.SUBDIVISIONFACTOR,"float"),P.add(b.UV0,"vec2"),A.add("vColor","vec4"),A.add("vpos","vec3"),A.add("vLineDistance","float"),A.add("vLineWidth","float");const z=C.multipassEnabled&&C.output===e.Color;z&&A.add("depth","float");const O=C.stippleEnabled;O&&A.add("vLineSizeInv","float"),R.add("aaWidth","float",C.stippleEnabled?0:1);const V=C.capType===w.ROUND,W=C.stippleEnabled&&V,I=C.falloffEnabled||W;I&&A.add("vLineDistanceNorm","float"),V&&(A.add("vSegmentSDF","float"),A.add("vReverseSegmentSDF","float")),E.code.add(u`#define PERPENDICULAR(v) vec2(v.y, -v.x);
6
6
  float interp(float ncp, vec4 a, vec4 b) {
7
7
  return (-ncp - a.z) / (b.z - a.z);
8
8
  }
@@ -11,11 +11,11 @@ float s = sin(a);
11
11
  float c = cos(a);
12
12
  mat2 m = mat2(c, -s, s, c);
13
13
  return m * v;
14
- }`),R.code.add(h`vec4 projectAndScale(vec4 pos) {
14
+ }`),E.code.add(u`vec4 projectAndScale(vec4 pos) {
15
15
  vec4 posNdc = proj * pos;
16
16
  posNdc.xy *= viewport.zw / posNdc.w;
17
17
  return posNdc;
18
- }`),R.code.add(h`
18
+ }`),E.code.add(u`
19
19
  void clipAndTransform(inout vec4 pos, inout vec4 prev, inout vec4 next, in bool isStartVertex) {
20
20
  float vnp = nearFar[0] * 0.99;
21
21
 
@@ -50,13 +50,13 @@ return posNdc;
50
50
  }
51
51
  }
52
52
 
53
- ${F?"depth = pos.z;":""}
53
+ ${z?"depth = pos.z;":""}
54
54
 
55
55
  pos = projectAndScale(pos);
56
56
  next = projectAndScale(next);
57
57
  prev = projectAndScale(prev);
58
58
  }
59
- `),m(R),R.code.add(h`
59
+ `),f(E),E.code.add(u`
60
60
  void main(void) {
61
61
  // unpack values from uv0.y
62
62
  bool isStartVertex = abs(abs(uv0.y)-3.0) == 1.0;
@@ -82,25 +82,25 @@ return posNdc;
82
82
 
83
83
  float lineWidth = lineSize * pixelRatio;
84
84
  vLineWidth = lineWidth;
85
- ${z?h`vLineSizeInv = 1.0 / lineSize;`:""}
85
+ ${O?u`vLineSizeInv = 1.0 / lineSize;`:""}
86
86
 
87
87
  vec4 pos = view * vec4(position, 1.0);
88
88
  vec4 prev = view * vec4(prevPosition, 1.0);
89
89
  vec4 next = view * vec4(nextPosition, 1.0);
90
- `),T&&R.code.add(h`vec4 other = isStartVertex ? next : prev;
90
+ `),F&&E.code.add(u`vec4 other = isStartVertex ? next : prev;
91
91
  bool markersHidden = areWorldMarkersHidden(pos, other);
92
92
  if(!isJoin && !markersHidden) {
93
93
  pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos) * 0.5;
94
- }`),R.code.add(h`clipAndTransform(pos, prev, next, isStartVertex);
94
+ }`),E.code.add(u`clipAndTransform(pos, prev, next, isStartVertex);
95
95
  vec2 left = (pos.xy - prev.xy);
96
96
  vec2 right = (next.xy - pos.xy);
97
97
  float leftLen = length(left);
98
- float rightLen = length(right);`);(y.stippleEnabled||V)&&R.code.add(h`
98
+ float rightLen = length(right);`);(C.stippleEnabled||V)&&E.code.add(u`
99
99
  float isEndVertex = float(!isStartVertex);
100
100
  vec2 segmentOrigin = mix(pos.xy, prev.xy, isEndVertex);
101
101
  vec2 segment = mix(right, left, isEndVertex);
102
- ${V?h`vec2 segmentEnd = mix(next.xy, pos.xy, isEndVertex);`:""}
103
- `),R.code.add(h`left = (leftLen > 0.001) ? left/leftLen : vec2(0.0, 0.0);
102
+ ${V?u`vec2 segmentEnd = mix(next.xy, pos.xy, isEndVertex);`:""}
103
+ `),E.code.add(u`left = (leftLen > 0.001) ? left/leftLen : vec2(0.0, 0.0);
104
104
  right = (rightLen > 0.001) ? right/rightLen : vec2(0.0, 0.0);
105
105
  vec2 capDisplacementDir = vec2(0, 0);
106
106
  vec2 joinDisplacementDir = vec2(0, 0);
@@ -116,18 +116,18 @@ if (!isOutside) {
116
116
  displacementLen = min(displacementLen, min(leftLen, rightLen)/abs(nDotSeg));
117
117
  }
118
118
  }
119
- if (isOutside && (displacementLen > miterLimit * lineWidth)) {`),y.roundJoins?R.code.add(h`
119
+ if (isOutside && (displacementLen > miterLimit * lineWidth)) {`),C.roundJoins?E.code.add(u`
120
120
  vec2 startDir = leftLen < 0.001 ? right : left;
121
121
  startDir = PERPENDICULAR(startDir);
122
122
 
123
123
  vec2 endDir = rightLen < 0.001 ? left : right;
124
124
  endDir = PERPENDICULAR(endDir);
125
125
 
126
- float factor = ${y.stippleEnabled?h`min(1.0, subdivisionFactor * ${h.float((w+2)/(w+1))})`:h`subdivisionFactor`};
126
+ float factor = ${C.stippleEnabled?u`min(1.0, subdivisionFactor * ${u.float((y+2)/(y+1))})`:u`subdivisionFactor`};
127
127
 
128
128
  float rotationAngle = acos(clamp(dot(startDir, endDir), -1.0, 1.0));
129
129
  joinDisplacementDir = rotate(startDir, -sign(uv0.y) * factor * rotationAngle);
130
- `):R.code.add(h`if (leftLen < 0.001) {
130
+ `):E.code.add(u`if (leftLen < 0.001) {
131
131
  joinDisplacementDir = right;
132
132
  }
133
133
  else if (rightLen < 0.001) {
@@ -136,7 +136,7 @@ joinDisplacementDir = left;
136
136
  else {
137
137
  joinDisplacementDir = (isStartVertex || subdivisionFactor > 0.0) ? right : left;
138
138
  }
139
- joinDisplacementDir = PERPENDICULAR(joinDisplacementDir);`);const I=y.capType!==x.BUTT;return R.code.add(h`
139
+ joinDisplacementDir = PERPENDICULAR(joinDisplacementDir);`);const N=C.capType!==w.BUTT;return E.code.add(u`
140
140
  displacementLen = lineWidth;
141
141
  }
142
142
  } else {
@@ -144,27 +144,27 @@ joinDisplacementDir = PERPENDICULAR(joinDisplacementDir);`);const I=y.capType!==
144
144
  joinDisplacementDir = isStartVertex ? right : left;
145
145
  joinDisplacementDir = PERPENDICULAR(joinDisplacementDir);
146
146
 
147
- ${I?h`capDisplacementDir = isStartVertex ? -right : left;`:""}
147
+ ${N?u`capDisplacementDir = isStartVertex ? -right : left;`:""}
148
148
  }
149
- `),R.code.add(h`
149
+ `),E.code.add(u`
150
150
  // Displacement (in pixels) caused by join/or cap
151
151
  vec2 dpos = joinDisplacementDir * sign(uv0.y) * displacementLen + capDisplacementDir * displacementLen;
152
152
  float lineDistNorm = sign(uv0.y) * pos.w;
153
153
 
154
154
  vLineDistance = lineWidth * lineDistNorm;
155
- ${W?h`vLineDistanceNorm = lineDistNorm;`:""}
155
+ ${I?u`vLineDistanceNorm = lineDistNorm;`:""}
156
156
 
157
157
  pos.xy += dpos;
158
- `),V&&R.code.add(h`vec2 segmentDir = normalize(segment);
158
+ `),V&&E.code.add(u`vec2 segmentDir = normalize(segment);
159
159
  vSegmentSDF = (isJoin && isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentOrigin, segmentDir) * pos.w) ;
160
- vReverseSegmentSDF = (isJoin && !isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentEnd, -segmentDir) * pos.w);`),y.stippleEnabled&&(y.draped?R.uniforms.add(new g("worldToScreenRatio",((e,i)=>1/i.screenToPCSRatio))):R.code.add(h`vec3 segmentCenter = mix((nextPosition + position) * 0.5, (position + prevPosition) * 0.5, isEndVertex);
161
- float worldToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),R.code.add(h`float segmentLengthScreenDouble = length(segment);
160
+ vReverseSegmentSDF = (isJoin && !isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentEnd, -segmentDir) * pos.w);`),C.stippleEnabled&&(C.draped?E.uniforms.add(new h("worldToScreenRatio",((e,i)=>1/i.screenToPCSRatio))):E.code.add(u`vec3 segmentCenter = mix((nextPosition + position) * 0.5, (position + prevPosition) * 0.5, isEndVertex);
161
+ float worldToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),E.code.add(u`float segmentLengthScreenDouble = length(segment);
162
162
  float segmentLengthScreen = segmentLengthScreenDouble * 0.5;
163
163
  float discreteWorldToScreenRatio = discretizeWorldToScreenRatio(worldToScreenRatio);
164
164
  float segmentLengthRender = length(mix(nextPosition - position, position - prevPosition, isEndVertex));
165
- vStipplePatternStretch = worldToScreenRatio / discreteWorldToScreenRatio;`),y.draped?R.code.add(h`float segmentLengthPseudoScreen = segmentLengthScreen / pixelRatio * discreteWorldToScreenRatio / worldToScreenRatio;
166
- float startPseudoScreen = uv0.x * discreteWorldToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):R.code.add(h`float startPseudoScreen = mix(uv0.x, uv0.x - segmentLengthRender, isEndVertex) * discreteWorldToScreenRatio;
167
- float segmentLengthPseudoScreen = segmentLengthRender * discreteWorldToScreenRatio;`),R.uniforms.add(new g("stipplePatternPixelSize",(e=>r(e)))),R.code.add(h`float patternLength = lineSize * stipplePatternPixelSize;
165
+ vStipplePatternStretch = worldToScreenRatio / discreteWorldToScreenRatio;`),C.draped?E.code.add(u`float segmentLengthPseudoScreen = segmentLengthScreen / pixelRatio * discreteWorldToScreenRatio / worldToScreenRatio;
166
+ float startPseudoScreen = uv0.x * discreteWorldToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):E.code.add(u`float startPseudoScreen = mix(uv0.x, uv0.x - segmentLengthRender, isEndVertex) * discreteWorldToScreenRatio;
167
+ float segmentLengthPseudoScreen = segmentLengthRender * discreteWorldToScreenRatio;`),E.uniforms.add(new h("stipplePatternPixelSize",(e=>a(e)))),E.code.add(u`float patternLength = lineSize * stipplePatternPixelSize;
168
168
  vStippleDistanceLimits = computeStippleDistanceLimits(startPseudoScreen, segmentLengthPseudoScreen, segmentLengthScreen, patternLength);
169
169
  vStippleDistance = mix(vStippleDistanceLimits.x, vStippleDistanceLimits.y, isEndVertex);
170
170
  if (segmentLengthScreenDouble >= 0.001) {
@@ -178,14 +178,14 @@ vStippleDistanceLimits = isJoin ?
178
178
  vStippleDistanceLimits :
179
179
  isStartVertex ?
180
180
  vec2(-1e34, vStippleDistanceLimits.y) :
181
- vec2(vStippleDistanceLimits.x, 1e34);`)),R.code.add(h`
181
+ vec2(vStippleDistanceLimits.x, 1e34);`)),E.code.add(u`
182
182
  // Convert back into NDC
183
183
  pos.xy = (pos.xy / viewport.zw) * pos.w;
184
184
 
185
185
  vColor = getColor();
186
186
  vColor.a *= coverage;
187
187
 
188
- ${y.wireframe&&!y.draped?"pos.z -= 0.001 * pos.w;":""}
188
+ ${C.wireframe&&!C.draped?"pos.z -= 0.001 * pos.w;":""}
189
189
 
190
190
  // transform final position to camera space for slicing
191
191
  vpos = (inverseProjectionMatrix * pos).xyz;
@@ -193,11 +193,11 @@ vec2(vStippleDistanceLimits.x, 1e34);`)),R.code.add(h`
193
193
  forwardObjectAndLayerIdColor();
194
194
  }
195
195
  }
196
- `),F&&C.include(s,y),C.include(i,y),E.include(p),E.code.add(h`
196
+ `),z&&j.include(l,C),j.include(i,C),T.include(c),j.include(n,C),T.code.add(u`
197
197
  void main() {
198
198
  discardBySlice(vpos);
199
- ${F?"terrainDepthTest(depth);":""}
200
- `),y.wireframe?E.code.add(h`vec4 finalColor = vec4(1.0, 0.0, 1.0, 1.0);`):(V&&E.code.add(h`
199
+ ${z?"terrainDepthTest(depth);":""}
200
+ `),C.wireframe?T.code.add(u`vec4 finalColor = vec4(1.0, 0.0, 1.0, 1.0);`):(V&&T.code.add(u`
201
201
  float sdf = min(vSegmentSDF, vReverseSegmentSDF);
202
202
  vec2 fragmentPosition = vec2(
203
203
  min(sdf, 0.0),
@@ -208,10 +208,10 @@ vec2(vStippleDistanceLimits.x, 1e34);`)),R.code.add(h`
208
208
  float fragmentCapSDF = (fragmentRadius - vLineWidth) * 0.5; // Divide by 2 to transform from double pixel scale
209
209
  float capCoverage = clamp(0.5 - fragmentCapSDF, 0.0, 1.0);
210
210
 
211
- if (capCoverage < ${h.float(d)}) {
211
+ if (capCoverage < ${u.float(p)}) {
212
212
  discard;
213
213
  }
214
- `),O?E.code.add(h`
214
+ `),W?T.code.add(u`
215
215
  vec2 stipplePosition = vec2(
216
216
  min(getStippleSDF() * 2.0 - 1.0, 0.0),
217
217
  vLineDistanceNorm * gl_FragCoord.w
@@ -219,25 +219,25 @@ vec2(vStippleDistanceLimits.x, 1e34);`)),R.code.add(h`
219
219
  float stippleRadius = length(stipplePosition * vLineWidth);
220
220
  float stippleCapSDF = (stippleRadius - vLineWidth) * 0.5; // Divide by 2 to transform from double pixel scale
221
221
  float stippleCoverage = clamp(0.5 - stippleCapSDF, 0.0, 1.0);
222
- float stippleAlpha = step(${h.float(d)}, stippleCoverage);
223
- `):E.code.add(h`float stippleAlpha = getStippleAlpha();`),y.output!==e.ObjectAndLayerIdColor&&E.code.add(h`discardByStippleAlpha(stippleAlpha, stippleAlphaColorDiscard);`),E.uniforms.add(new v("intrinsicColor",(e=>e.color))),E.code.add(h`vec4 color = intrinsicColor * vColor;`),y.innerColorEnabled&&(E.uniforms.add(new v("innerColor",(e=>e.innerColor??e.color)),new g("innerWidth",((e,i)=>e.innerWidth*i.camera.pixelRatio))),E.code.add(h`float distToInner = abs(vLineDistance * gl_FragCoord.w) - innerWidth;
222
+ float stippleAlpha = step(${u.float(p)}, stippleCoverage);
223
+ `):T.code.add(u`float stippleAlpha = getStippleAlpha();`),C.output!==e.ObjectAndLayerIdColor&&T.code.add(u`discardByStippleAlpha(stippleAlpha, stippleAlphaColorDiscard);`),T.uniforms.add(new g("intrinsicColor",(e=>e.color))),T.code.add(u`vec4 color = intrinsicColor * vColor;`),C.innerColorEnabled&&(T.uniforms.add(new g("innerColor",(e=>e.innerColor??e.color)),new h("innerWidth",((e,i)=>e.innerWidth*i.camera.pixelRatio))),T.code.add(u`float distToInner = abs(vLineDistance * gl_FragCoord.w) - innerWidth;
224
224
  float innerAA = clamp(0.5 - distToInner, 0.0, 1.0);
225
225
  float innerAlpha = innerColor.a + color.a * (1.0 - innerColor.a);
226
- color = mix(color, vec4(innerColor.rgb, innerAlpha), innerAA);`)),E.code.add(h`vec4 finalColor = blendStipple(color, stippleAlpha);`),y.falloffEnabled&&(E.uniforms.add(new g("falloff",(e=>e.falloff))),E.code.add(h`finalColor.a *= pow(max(0.0, 1.0 - abs(vLineDistanceNorm * gl_FragCoord.w)), falloff);`)),y.stippleEnabled||E.code.add(h`float featherStartDistance = max(vLineWidth - 2.0, 0.0);
226
+ color = mix(color, vec4(innerColor.rgb, innerAlpha), innerAA);`)),T.code.add(u`vec4 finalColor = blendStipple(color, stippleAlpha);`),C.falloffEnabled&&(T.uniforms.add(new h("falloff",(e=>e.falloff))),T.code.add(u`finalColor.a *= pow(max(0.0, 1.0 - abs(vLineDistanceNorm * gl_FragCoord.w)), falloff);`)),C.stippleEnabled||T.code.add(u`float featherStartDistance = max(vLineWidth - 2.0, 0.0);
227
227
  float value = abs(vLineDistance) * gl_FragCoord.w;
228
228
  float feather = (value - featherStartDistance) / (vLineWidth - featherStartDistance);
229
- finalColor.a *= 1.0 - clamp(feather, 0.0, 1.0);`)),y.transparencyPassType===D.ColorAlpha&&(C.outputs.add("fragColor","vec4",0),C.outputs.add("fragAlpha","float",1)),E.code.add(h`
230
- ${y.output===e.ObjectAndLayerIdColor?h`finalColor.a = 1.0;`:""}
229
+ finalColor.a *= 1.0 - clamp(feather, 0.0, 1.0);`)),C.transparencyPassType===L.ColorAlpha&&(j.outputs.add("fragColor","vec4",0),j.outputs.add("fragAlpha","float",1)),T.code.add(u`
230
+ ${C.output===e.ObjectAndLayerIdColor?u`finalColor.a = 1.0;`:""}
231
231
 
232
- if (finalColor.a < ${h.float(d)}) {
232
+ if (finalColor.a < ${u.float(p)}) {
233
233
  discard;
234
234
  }
235
235
 
236
- ${y.output===e.Color?h`fragColor = highlightSlice(finalColor, vpos);`:""}
237
- ${y.output===e.Color&&y.transparencyPassType===D.ColorAlpha?h`
236
+ ${C.output===e.Color?u`fragColor = highlightSlice(finalColor, vpos);`:""}
237
+ ${C.output===e.Color&&C.transparencyPassType===L.ColorAlpha?u`
238
238
  fragColor = premultiplyAlpha(fragColor);
239
239
  fragAlpha = fragColor.a;`:""}
240
- ${y.output===e.Highlight?h`fragColor = vec4(1.0);`:""}
241
- ${y.output===e.ObjectAndLayerIdColor?h`outputObjectAndLayerIdColor();`:""}
240
+ ${C.output===e.Highlight?u`outputHighlight();`:""}
241
+ ${C.output===e.ObjectAndLayerIdColor?u`outputObjectAndLayerIdColor();`:""}
242
242
  }
243
- `),C}const C=Object.freeze(Object.defineProperty({__proto__:null,build:y,ribbonlineNumRoundJoinSubdivisions:w},Symbol.toStringTag,{value:"Module"}));export{C as R,y as b,w as r};
243
+ `),j}const j=Object.freeze(Object.defineProperty({__proto__:null,build:C,ribbonlineNumRoundJoinSubdivisions:y},Symbol.toStringTag,{value:"Module"}));export{j as R,C as b,y as r};
@@ -2,11 +2,20 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{invert as e,translate as i}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{n as t,h as a}from"./vec32.js";import{create as r}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{NormalFromDepth as l}from"../views/3d/webgl-engine/core/shaderLibrary/NormalFromDepth.glsl.js";import{ScreenSpacePass as s}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{unoccludedHighlightFlag as d}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{ReadShadowMapPass as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{RgbaFloatEncoding as n}from"../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{Float3PassUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as p}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as m}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as w}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as u}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as f}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{SnapshotSlot as v}from"../views/3d/webgl-engine/lib/ShadowMap.js";const x=.99999,b=.025;function M(o){const r=new u;r.include(h,o),r.include(s),r.include(l);const M=r.fragment;return M.include(n),M.uniforms.add(new f("defaultDepthTex",((e,i)=>i.shadowMap.getSnapshot(v.ExcludeHighlight))),new f("highlightDepthTex",((e,i)=>i.shadowMap.getSnapshot(v.Highlight))),new f("depthMap",((e,i)=>i.depth?.attachment)),new f("highlightTexture",(e=>e.highlight)),new g("uColor",(e=>e.shadowColor)),new p("opacity",(e=>e.shadowOpacity)),new p("occludedOpacity",(e=>e.occludedShadowOpacity)),new p("terminationFactor",(e=>e.opacityElevation*e.dayNightTerminator)),new c("lightingMainDirectionView",((e,i)=>t(S,a(S,i.lighting.mainLight.direction,i.camera.viewInverseTransposeMatrix)))),new w("inverseViewMatrix",((o,t)=>e(y,i(y,t.camera.viewMatrix,t.camera.center))))),M.constants.add("unoccludedHighlightFlag","vec4",d),M.code.add(m`
5
+ import{invert as e,translate as i}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{n as o,h as r}from"./vec32.js";import{create as a}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{NormalFromDepth as h}from"../views/3d/webgl-engine/core/shaderLibrary/NormalFromDepth.glsl.js";import{ScreenSpacePass as l}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadShadowMapPass as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{RgbaFloatEncoding as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{Float3PassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as p}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as w}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{SnapshotSlot as f}from"../views/3d/webgl-engine/lib/ShadowMap.js";const v=.025;function x(t){const a=new w;a.include(s,t),a.include(l),a.include(h);const x=a.fragment;return x.include(d),x.uniforms.add(new u("defaultDepthTex",((e,i)=>i.shadowMap.getSnapshot(f.ExcludeHighlight))),new u("highlightDepthTex",((e,i)=>i.shadowMap.getSnapshot(f.Highlight))),new u("depthMap",((e,i)=>i.depth?.attachment)),new u("highlightTexture",(e=>e.highlight)),new c("uColor",(e=>e.shadowColor)),new g("opacity",(e=>e.shadowOpacity)),new g("occludedOpacity",(e=>e.occludedShadowOpacity)),new g("terminationFactor",(e=>e.opacityElevation*e.dayNightTerminator)),new n("lightingMainDirectionView",((e,i)=>o(M,r(M,i.lighting.mainLight.direction,i.camera.viewInverseTransposeMatrix)))),new m("inverseViewMatrix",((t,o)=>e(b,i(b,o.camera.viewMatrix,o.camera.center))))),x.code.add(p`
6
6
  void main(void) {
7
- vec4 highlightInfo = texture(highlightTexture, uv);
8
- float visiblyHighlighted = (1.0 - clamp(distance(unoccludedHighlightFlag, highlightInfo), 0.0, 1.0)) * highlightInfo.a;
9
- if (visiblyHighlighted > ${m.float(x)}) {
7
+
8
+ ivec2 highlightTextureSize = textureSize(highlightTexture, 0);
9
+ ivec2 highlightIUV = ivec2(uv * vec2(highlightTextureSize));
10
+ vec4 highlightInfo = texelFetch(highlightTexture, highlightIUV, 0);
11
+ //Calculate bit mask to check if pixel is highlit unoccluded at any level
12
+ int ored =
13
+ (int(highlightInfo.r*255.0) << 0)
14
+ | (int(highlightInfo.g*255.0) << 8)
15
+ | (int(highlightInfo.b*255.0) << 16)
16
+ | (int(highlightInfo.a*255.0) << 24);
17
+ bool visiblyHighlighted = ((ored & ~(ored >> 1)) & (1+4+16+64)) != 0;
18
+ if (visiblyHighlighted) {
10
19
  discard;
11
20
  }
12
21
 
@@ -48,9 +57,9 @@ import{invert as e,translate as i}from"../core/libs/gl-matrix-2/math/mat4.js";im
48
57
  bool shadowDefault = depthDefault < lvpos.z;
49
58
 
50
59
  vec3 normal = normalFromDepth(depthMap, currentPixelPos.xyz, gl_FragCoord.xy, uv);
51
- bool shaded = dot(normal, lightingMainDirectionView) < ${m.float(b)};
60
+ bool shaded = dot(normal, lightingMainDirectionView) < ${p.float(v)};
52
61
 
53
62
  float fragOpacity = (shadowDefault || shaded) ? occludedOpacity : opacity;
54
63
  fragColor = vec4(uColor.rgb, uColor.a * fragOpacity * terminationFactor);
55
64
  }
56
- `),r}const y=o(),S=r(),D=Object.freeze(Object.defineProperty({__proto__:null,build:M},Symbol.toStringTag,{value:"Module"}));export{D as S,M as b};
65
+ `),a}const b=t(),M=a(),y=Object.freeze(Object.defineProperty({__proto__:null,build:x},Symbol.toStringTag,{value:"Module"}));export{y as S,x as b};
@@ -2,7 +2,7 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{translate as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{n as o,s as i}from"./vec32.js";import{create as a}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{OverlayContent as l}from"../views/3d/terrain/OverlayContent.js";import{TransparencyMode as t}from"../views/3d/terrain/TransparencyMode.js";import{addLinearDepth as n,addNearFar as s,ForwardLinearDepth as d}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js";import{ShaderOutput as c}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as v}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as m}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{NormalAttribute as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{PositionAttribute as p}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js";import{TextureCoordinateAttribute as f}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexTangent as w}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl.js";import{OutputDepth as h}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as u}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{EvaluateAmbientOcclusion as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as y,addAmbientBoostFactor as C,addLightingGlobalFactor as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightDirection as S,addMainLightIntensity as O}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{NormalUtils as j}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{PBRMode as L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapDraw as z}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{OverlayMode as P,OverlayTerrain as T}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{OverlayTerrainPassParameters as M,TerrainTexture as N}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js";import{addProjViewLocalOrigin as $,addViewNormal as D,addCameraPosition as W}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as V}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{glsl as U}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4DrawUniform as F}from"../views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js";import{ShaderBuilder as A}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as _}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";class B extends M{}function k(r){const a=new A,{vertex:M,fragment:B,varyings:k}=a;a.include(p),a.include(g,r),a.include(f,r);const q=()=>{a.include(j,r),M.code.add(U`vec3 getNormal() {
5
+ import{translate as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{n as o,s as i}from"./vec32.js";import{create as a}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{OverlayContent as l}from"../views/3d/terrain/OverlayContent.js";import{TransparencyMode as t}from"../views/3d/terrain/TransparencyMode.js";import{addLinearDepth as n,addNearFar as s,ForwardLinearDepth as d}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js";import{ShaderOutput as c}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as v}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as m}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{NormalAttribute as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{PositionAttribute as p}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js";import{TextureCoordinateAttribute as f}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexTangent as w}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl.js";import{OutputDepth as h}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as u}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{EvaluateAmbientOcclusion as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as y,addAmbientBoostFactor as C,addLightingGlobalFactor as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightDirection as O,addMainLightIntensity as S}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{NormalUtils as j}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{PBRMode as L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapDraw as z}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{OverlayMode as P,OverlayTerrain as T}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{OverlayTerrainPassParameters as M,TerrainTexture as N}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js";import{addProjViewLocalOrigin as $,addViewNormal as D,addCameraPosition as W}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as V}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{glsl as U}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4DrawUniform as F}from"../views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js";import{ShaderBuilder as A}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as _}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";class B extends M{}function k(r){const a=new A,{vertex:M,fragment:B,varyings:k}=a;a.include(p),a.include(g,r),a.include(f,r);const q=()=>{a.include(j,r),M.code.add(U`vec3 getNormal() {
6
6
  float z = 1.0 - abs(normalCompressed.x) - abs(normalCompressed.y);
7
7
  vec3 n = vec3(normalCompressed + vec2(normalCompressed.x >= 0.0 ? 1.0 : -1.0,
8
8
  normalCompressed.y >= 0.0 ? 1.0 : -1.0) * min(z, 0.0), z);
@@ -40,7 +40,7 @@ return normalize(n);
40
40
  `),a.include(v,r),a.include(y,r),a.include(b,r),a.include(z,r),W(B,r),C(B),x(B),B.uniforms.add(M.uniforms.get("localOrigin"),new V("viewDirection",((e,r)=>o(H,i(H,r.camera.viewMatrix[12],r.camera.viewMatrix[13],r.camera.viewMatrix[14]))))),t&&B.uniforms.add(new _("ovWaterTex",((e,r)=>r.overlay?.getTexture(l.WaterNormal))),new F("view",((r,o)=>e(E,o.camera.viewMatrix,r.origin)))),B.code.add(U`const float sliceOpacity = 0.2;
41
41
  float lum(vec3 c) {
42
42
  return (min(min(c.r, c.g), c.b) + max(max(c.r, c.g), c.b)) * 0.5;
43
- }`),S(B),O(B),B.code.add(U`
43
+ }`),O(B),S(B),B.code.add(U`
44
44
  void main() {
45
45
  vec3 normal = normalize(vnormal);
46
46
  float vndl = dot(normal, mainLightDirection);
@@ -156,7 +156,10 @@ outputDepth(linearDepth);
156
156
  }
157
157
  `),a.include(u,r),B.code.add(U`
158
158
  void main() {
159
- ${G?U`if (getCombinedOverlayColor().a == 0.0) { discard; }`:""}
159
+ ${G?U`
160
+ vec4 combinedOverlayColor = getCombinedOverlayColor();
161
+ if (combinedOverlayColor == vec4(0.0)) { discard; }
162
+ `:U``}
160
163
  outputHighlight();
161
164
  }
162
165
  `)}if(r.output===c.ObjectAndLayerIdColor)if(G)a.include(T,{...r,pbrMode:L.Disabled}),M.code.add(U`void main(void) {