@arcgis/core 4.31.0-next.20240708 → 4.31.0-next.20240709

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 (159) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{0975e54c50383375cc09.js → 14cf7411e8318a1bccb9.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{71852b8437ec66b9ef06.js → 2123ab24163a532ebc8d.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{c91b3800cf3891bf2d59.js → 252ff37bf5e12dae0b18.js} +1 -1
  5. package/assets/esri/core/workers/chunks/2799007b5f3f4a2e364c.js +51 -0
  6. package/assets/esri/core/workers/chunks/{ff5e6d823d512f87a527.js → 2dddb8a989b9c96572fe.js} +1 -1
  7. package/assets/esri/core/workers/chunks/3375de864347a847393d.js +1042 -0
  8. package/assets/esri/core/workers/chunks/543f9db420c99d429637.js +1 -0
  9. package/assets/esri/core/workers/chunks/{812e18c65aa6e398c338.js → 5b6c89dc41067d81c952.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{5089a12084a8a8fb93d8.js → 61e5179fb49866241128.js} +1 -1
  11. package/assets/esri/core/workers/chunks/632e3ba2b8a881df29a0.js +1 -0
  12. package/assets/esri/core/workers/chunks/{1cc4a89c96a36d6b3d52.js → 7767559d56d16b644655.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{43e83f4d827f59ff556a.js → 8087288f00dfdcc479b9.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{a5fbe1c95e49093e5af4.js → 8cce4b218568638e6e64.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{c7e2a97cb7bcd153bcef.js → 8e326def543268f8a08e.js} +1 -1
  16. package/assets/esri/core/workers/chunks/92cb45b18e151db007dc.js +1 -0
  17. package/assets/esri/core/workers/chunks/b2e8cc76381077b78d4c.js +1 -0
  18. package/assets/esri/core/workers/chunks/b6a8132708afcd988fa9.js +1 -0
  19. package/assets/esri/core/workers/chunks/{b4d850e82a8ae902d684.js → c44cc686774ff53c0a94.js} +1 -1
  20. package/assets/esri/core/workers/chunks/c52701477405c1fb2072.js +1 -0
  21. package/assets/esri/core/workers/chunks/{9ed11b9202013ca001ee.js → cfc2a1858a8bbb284979.js} +2 -2
  22. package/assets/esri/core/workers/chunks/{9ed11b9202013ca001ee.js.LICENSE.txt → cfc2a1858a8bbb284979.js.LICENSE.txt} +1 -1
  23. package/assets/esri/core/workers/chunks/d9863289c69d2550cd49.js +1 -0
  24. package/assets/esri/core/workers/chunks/e1f4df3a5b0b31521b3c.js +1 -0
  25. package/assets/esri/core/workers/chunks/{61505947371cebab9cbe.js → fdebfe55cd097714ec11.js} +1 -1
  26. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +13 -18
  27. package/assets/esri/themes/dark/main.css +1 -1
  28. package/assets/esri/themes/light/main.css +1 -1
  29. package/assets/esri/themes/light/view.css +1 -1
  30. package/chunks/AtmosphereCompositing.glsl.js +6 -9
  31. package/chunks/BlendLayers.glsl.js +1 -7
  32. package/chunks/BlendWeights.glsl.js +45 -51
  33. package/chunks/Blur.glsl.js +1 -3
  34. package/chunks/ChapmanAtmosphere.glsl.js +3 -8
  35. package/chunks/CheckerBoard.glsl.js +3 -9
  36. package/chunks/Clouds.glsl.js +21 -10
  37. package/chunks/CloudsComposition.glsl.js +3 -7
  38. package/chunks/ColorMaterial.glsl.js +3 -9
  39. package/chunks/ComponentShader.glsl.js +35 -50
  40. package/chunks/Compositing.glsl.js +5 -7
  41. package/chunks/DefaultMaterial.glsl.js +68 -73
  42. package/chunks/EdgeDetect.glsl.js +5 -10
  43. package/chunks/EdgeShader.glsl.js +37 -60
  44. package/chunks/Fog.glsl.js +4 -9
  45. package/chunks/HUDCompositing.glsl.js +1 -3
  46. package/chunks/HUDMaterial.glsl.js +8 -14
  47. package/chunks/Heatmap.glsl.js +4 -7
  48. package/chunks/HeatmapDensity.glsl.js +5 -11
  49. package/chunks/HighlightApply.glsl.js +133 -152
  50. package/chunks/HighlightDownsample.glsl.js +29 -32
  51. package/chunks/ImageMaterial.glsl.js +11 -21
  52. package/chunks/LaserlinePath.glsl.js +4 -9
  53. package/chunks/LineCallout.glsl.js +91 -108
  54. package/chunks/LineMarker.glsl.js +2 -8
  55. package/chunks/Magnifier.glsl.js +4 -9
  56. package/chunks/MeasurementArrow.glsl.js +9 -15
  57. package/chunks/NativeLine.glsl.js +8 -12
  58. package/chunks/NoiseTextureAtlas.glsl.js +89 -86
  59. package/chunks/OITCompositing.glsl.js +2 -3
  60. package/chunks/OverlayCompositing.glsl.js +2 -4
  61. package/chunks/Path.glsl.js +31 -55
  62. package/chunks/Pattern.glsl.js +16 -20
  63. package/chunks/PointRenderer.glsl.js +39 -48
  64. package/chunks/Precipitation.glsl.js +15 -27
  65. package/chunks/RasterColorizer.glsl.js +25 -33
  66. package/chunks/RealisticTree.glsl.js +53 -65
  67. package/chunks/SSAO.glsl.js +7 -10
  68. package/chunks/SSAOBlur.glsl.js +10 -14
  69. package/chunks/ShadedColorMaterial.glsl.js +12 -15
  70. package/chunks/ShadowCastAccumulate.glsl.js +2 -4
  71. package/chunks/ShadowCastVisualize.glsl.js +12 -19
  72. package/chunks/ShadowHighlight.glsl.js +46 -50
  73. package/chunks/SimpleAtmosphere.glsl.js +4 -13
  74. package/chunks/SlicePlaneMaterial.glsl.js +3 -7
  75. package/chunks/Stars.glsl.js +3 -7
  76. package/chunks/Terrain.glsl.js +20 -61
  77. package/chunks/TextureOnly.glsl.js +2 -4
  78. package/chunks/Viewshed.glsl.js +20 -38
  79. package/chunks/WaterSurface.glsl.js +34 -60
  80. package/core/workers/registry.js +1 -1
  81. package/interfaces.d.ts +34 -4
  82. package/layers/WCSLayer.js +1 -1
  83. package/layers/support/SubtypeSublayer.js +1 -1
  84. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  85. package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
  86. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  87. package/package.json +3 -3
  88. package/support/revision.js +1 -1
  89. package/views/2d/engine/webgl/shaderGraph/ShaderBuilder2D.js +1 -1
  90. package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
  91. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  92. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  93. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  94. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  95. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  96. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  97. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  98. package/views/3d/layers/StreamLayerView3D.js +1 -1
  99. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  100. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  101. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +5 -0
  102. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +5 -0
  103. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +5 -0
  104. package/views/3d/layers/graphics/pipeline/PBFPointFeaturesView.js +5 -0
  105. package/views/3d/layers/graphics/pipeline/TestSymbol.js +5 -0
  106. package/views/3d/layers/graphics/pipeline/Tile.js +5 -0
  107. package/views/3d/layers/graphics/pipeline/Tile3DFetcher.js +5 -0
  108. package/views/3d/layers/graphics/pipeline/Tile3DProcessor.js +5 -0
  109. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  110. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  111. package/views/3d/layers/support/projectExtentUtils.js +1 -1
  112. package/views/3d/terrain/OverlayRenderer.js +1 -1
  113. package/views/3d/terrain/TerrainRenderer.js +1 -1
  114. package/views/3d/terrain/TileCompositor.js +1 -1
  115. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  116. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js +3 -5
  117. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +3 -3
  118. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +29 -59
  119. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +6 -12
  120. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +1 -1
  121. package/views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js +6 -6
  122. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +2 -2
  123. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +2 -4
  124. package/views/3d/webgl-engine/core/shaderLibrary/util/LocalFromScreenSpace.glsl.js +2 -2
  125. package/views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js +1 -1
  126. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  127. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  128. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  129. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  130. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  131. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  132. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  133. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  134. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  135. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  136. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  137. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  138. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  139. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  140. package/views/3d/webgl-engine/materials/DrawParameters.js +1 -1
  141. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  142. package/views/SceneView.js +1 -1
  143. package/views/webgl/RenderingContext.js +1 -1
  144. package/views/webgl/enums.js +1 -1
  145. package/views/webgl/heatmapTextureUtils.js +1 -1
  146. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  147. package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
  148. package/widgets/FeatureForm.js +1 -1
  149. package/widgets/OrientedImageryViewer/constants.js +1 -1
  150. package/widgets/OrientedImageryViewer.js +1 -1
  151. package/assets/esri/core/workers/chunks/0cb2eb96ffb1dbed00eb.js +0 -1
  152. package/assets/esri/core/workers/chunks/0d6ed27fc9948f4ea061.js +0 -1
  153. package/assets/esri/core/workers/chunks/225b947ba4b2fcfd5630.js +0 -1
  154. package/assets/esri/core/workers/chunks/7c7c3068da3bf7467685.js +0 -1
  155. package/assets/esri/core/workers/chunks/85e5cdd723f68dec8c25.js +0 -1
  156. package/assets/esri/core/workers/chunks/aed0db145187d9eb52f2.js +0 -51
  157. package/assets/esri/core/workers/chunks/cf9a32a03b3d3b66effb.js +0 -1
  158. package/assets/esri/core/workers/chunks/e840e54455eb500b501d.js +0 -1098
  159. package/assets/esri/core/workers/chunks/fec53ce15ae52f8cb802.js +0 -1
@@ -2,8 +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{alphaCutoff as e}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{Float2PassUniform as o}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{FloatPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{Integer2PassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Integer2PassUniform.js";import{IntegerPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{glsl as n}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as r}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{b as c,o as d}from"./HighlightDownsample.glsl.js";function u(){const u=new r,{vertex:f,fragment:s}=u,g=f.code,v=s.code;return f.uniforms.add(new a("coverageTex",(e=>e.coverageTexture)),new o("coverageRounding",(e=>e.coverageRounding)),new t("highlightRenderCellCount",(e=>[e.verticalCellCount+1,e.horizontalCellCount+1]))),u.varyings.add("uv","vec2"),u.varyings.add("uv2","vec2"),g.add(n`void main() {
6
- int vid = gl_VertexID & 3;
5
+ import{alphaCutoff as e}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{Float2PassUniform as o}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{FloatPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{Integer2PassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Integer2PassUniform.js";import{IntegerPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{glsl as n}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as r}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{b as c,o as d}from"./HighlightDownsample.glsl.js";function u(){const u=new r,{vertex:f,fragment:s}=u;return f.uniforms.add(new a("coverageTex",(e=>e.coverageTexture)),new o("coverageRounding",(e=>e.coverageRounding)),new t("highlightRenderCellCount",(e=>[e.verticalCellCount+1,e.horizontalCellCount+1]))),u.varyings.add("uv","vec2"),u.varyings.add("uv2","vec2"),f.main.add(n`int vid = gl_VertexID & 3;
7
6
  int cellIndex = gl_InstanceID;
8
7
  int renderCellCountHorizontal = highlightRenderCellCount[0];
9
8
  int renderCellCountVertical = highlightRenderCellCount[1];
@@ -24,175 +23,157 @@ float posY = uv0.y * 2.0 + ySign * iV - 1.0;
24
23
  vec2 pos = vec2(posX,posY);
25
24
  gl_Position = vec4(pos, 0.0, 1.0);
26
25
  uv = pos * 0.5 + vec2(0.5);
27
- uv2 = uv0;
28
- }`),s.uniforms.add(new a("highlightTexture",(e=>e.highlightTexture)),new a("coverageTex",(e=>e.coverageTexture)),new o("coverageRounding",(e=>e.coverageRounding)),new a("highlightOptionsTexture",(e=>e.highlightOptionsTexture)),new l("pixelRatio",(e=>e.pixelRatio)),new l("occludedIntensityFactor",(e=>e.occludedFactor)),new i("maxHighlightLevel",(e=>e.maxHighlightLevel))),s.constants.add("inner","float",c/d),v.add(n`
29
- const float pascal9[5] = float[5](70.0, 56.0, 28.0, 8.0, 1.0);
30
- const float denom9 = 256.0;
31
-
32
- const float pascal11[6] = float[6](252.0, 210.0, 120.0, 45.0, 10.0, 1.0);
33
- const float denom11 = 1024.0;
34
-
35
- const float pascal13[7] = float[7](924.0, 792.0, 495.0, 220.0, 66.0, 12.0, 1.0);
36
- const float denom13 = 4096.0;
37
-
38
- const float pascal15[8] = float[8](3432.0, 3003.0, 2002.0, 1001.0, 364.0, 91.0, 14.0, 1.0);
39
- const float denom15 = 16384.0;
40
-
41
- const float pascal17[9] = float[9](12870.0, 11440.0, 8008.0, 4368.0, 1820.0, 560.0, 120.0, 16.0, 1.0);
42
- const float denom17 = 65536.0;
43
-
44
- const float pixelSampleScale = 1.0;
45
-
46
- float colorWeight[16] = float[16](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
47
- float colorOcclusion[16] = float[16](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
48
-
49
- //Check bitmap for each highlight level (0..15) and update weight and curColorOcclusion-weight accodingly
50
- void applyTexel(vec4 texel, float pf) {
51
- if (texel != vec4(0.0)){
52
- for (int colorIndex = 0; colorIndex <= maxHighlightLevel; ++colorIndex){
53
- //Read appropriate channel from texture
54
- int v = int(texel[colorIndex >> 2] * 255.0);
55
- if (v != 0){
56
- //Read relevant two bits
57
- int vj = (v >> ((colorIndex&3)<<1)) & 3;
58
- if ((vj & 1) == 1){
59
- colorWeight[colorIndex] += pf;
60
- if ((vj & 2) == 2){
61
- colorOcclusion[colorIndex] += pf;
62
- }
63
- }
64
- }
65
- }
66
- }
67
- }
68
-
69
- void readAndApplyTexel(ivec2 iuv, int du, int dv, float pf) {
70
- vec4 texel = texelFetch(highlightTexture, iuv + ivec2(du, dv), 0);
71
- applyTexel(texel,pf);
72
- }
73
-
74
- void readAndApply2TexelsU(ivec2 iuv, int du, int dv, float pf) {
75
- vec4 texel1 = texelFetch(highlightTexture, iuv + ivec2(-du, dv), 0);
76
- applyTexel(texel1,pf);
77
- vec4 texel2 = texelFetch(highlightTexture, iuv + ivec2(+du, dv), 0);
78
- applyTexel(texel2,pf);
79
- }
80
-
81
- float getWeight(int pixelDistance) {
82
- float scaledDistance = float(pixelDistance) * pixelSampleScale / pixelRatio;
83
- float d0f = floor(scaledDistance);
84
- int d0 = int(d0f);
85
- if (d0 >= 8){
86
- return 0.0;
87
- }
88
- float w0 = pascal17[d0];
89
- float w1 = d0 > 8 ? 0.0 : pascal17[d0+1];
90
- float f = d0f - d0f;
91
- return mix(w0, w1, f);
92
- }
93
-
94
- void main() {
95
- vec2 highlightTextureSize = vec2(textureSize(highlightTexture,0));
26
+ uv2 = uv0;`),s.uniforms.add(new a("highlightTexture",(e=>e.highlightTexture)),new a("coverageTex",(e=>e.coverageTexture)),new o("coverageRounding",(e=>e.coverageRounding)),new a("highlightOptionsTexture",(e=>e.highlightOptionsTexture)),new l("pixelRatio",(e=>e.pixelRatio)),new l("occludedIntensityFactor",(e=>e.occludedFactor)),new i("maxHighlightLevel",(e=>e.maxHighlightLevel))),s.constants.add("inner","float",c/d),s.code.add(n`const float pascal9[5] = float[5](70.0, 56.0, 28.0, 8.0, 1.0);
27
+ const float denom9 = 256.0;
28
+ const float pascal11[6] = float[6](252.0, 210.0, 120.0, 45.0, 10.0, 1.0);
29
+ const float denom11 = 1024.0;
30
+ const float pascal13[7] = float[7](924.0, 792.0, 495.0, 220.0, 66.0, 12.0, 1.0);
31
+ const float denom13 = 4096.0;
32
+ const float pascal15[8] = float[8](3432.0, 3003.0, 2002.0, 1001.0, 364.0, 91.0, 14.0, 1.0);
33
+ const float denom15 = 16384.0;
34
+ const float pascal17[9] = float[9](12870.0, 11440.0, 8008.0, 4368.0, 1820.0, 560.0, 120.0, 16.0, 1.0);
35
+ const float denom17 = 65536.0;
36
+ const float pixelSampleScale = 1.0;
37
+ float colorWeight[16] = float[16](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
38
+ float colorOcclusion[16] = float[16](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
39
+ void applyTexel(vec4 texel, float pf) {
40
+ if (texel != vec4(0.0)){
41
+ for (int colorIndex = 0; colorIndex <= maxHighlightLevel; ++colorIndex){
42
+ int v = int(texel[colorIndex >> 2] * 255.0);
43
+ if (v != 0){
44
+ int vj = (v >> ((colorIndex&3)<<1)) & 3;
45
+ if ((vj & 1) == 1){
46
+ colorWeight[colorIndex] += pf;
47
+ if ((vj & 2) == 2){
48
+ colorOcclusion[colorIndex] += pf;
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
55
+ void readAndApplyTexel(ivec2 iuv, int du, int dv, float pf) {
56
+ vec4 texel = texelFetch(highlightTexture, iuv + ivec2(du, dv), 0);
57
+ applyTexel(texel,pf);
58
+ }
59
+ void readAndApply2TexelsU(ivec2 iuv, int du, int dv, float pf) {
60
+ vec4 texel1 = texelFetch(highlightTexture, iuv + ivec2(-du, dv), 0);
61
+ applyTexel(texel1,pf);
62
+ vec4 texel2 = texelFetch(highlightTexture, iuv + ivec2(+du, dv), 0);
63
+ applyTexel(texel2,pf);
64
+ }
65
+ float getWeight(int pixelDistance) {
66
+ float scaledDistance = float(pixelDistance) * pixelSampleScale / pixelRatio;
67
+ float d0f = floor(scaledDistance);
68
+ int d0 = int(d0f);
69
+ if (d0 >= 8){
70
+ return 0.0;
71
+ }
72
+ float w0 = pascal17[d0];
73
+ float w1 = d0 > 8 ? 0.0 : pascal17[d0+1];
74
+ float f = d0f - d0f;
75
+ return mix(w0, w1, f);
76
+ }`),s.main.add(n`
77
+ vec2 highlightTextureSize = vec2(textureSize(highlightTexture,0));
96
78
 
97
- ivec2 iuv = ivec2(uv * highlightTextureSize);
98
- vec4 center = texelFetch(highlightTexture, iuv, 0);
79
+ ivec2 iuv = ivec2(uv * highlightTextureSize);
80
+ vec4 center = texelFetch(highlightTexture, iuv, 0);
99
81
 
100
- vec4 accumulatedColor = vec4(0.0);
82
+ vec4 accumulatedColor = vec4(0.0);
101
83
 
102
- vec4 cov = texture(coverageTex, uv2 * coverageRounding);
84
+ vec4 cov = texture(coverageTex, uv2 * coverageRounding);
103
85
 
104
- bool potentialOutline = cov.g < 1.0;
105
- if (potentialOutline) {
106
- // Calculate outline share
86
+ bool potentialOutline = cov.g < 1.0;
87
+ if (potentialOutline) {
88
+ // Calculate outline share
107
89
 
108
- int maxPixelDistance = clamp(int(8.0 * pixelRatio / pixelSampleScale),2,16);
90
+ int maxPixelDistance = clamp(int(8.0 * pixelRatio / pixelSampleScale),2,16);
109
91
 
110
- // Calculate denominator for the filter so that the weights sum up to 1.0
111
- int fs = maxPixelDistance;
112
- float denom = 0.0;
113
- for(int y = 0; y <= fs; y += 1) {
114
- float w = getWeight(y);
115
- denom += w * (y == 0 ? 1.0 : 2.0);
116
- }
92
+ // Calculate denominator for the filter so that the weights sum up to 1.0
93
+ int fs = maxPixelDistance;
94
+ float denom = 0.0;
95
+ for(int y = 0; y <= fs; y += 1) {
96
+ float w = getWeight(y);
97
+ denom += w * (y == 0 ? 1.0 : 2.0);
98
+ }
117
99
 
118
- for(int y = 0; y <= fs; y += 1) {
119
- float yFactor = getWeight(y);
120
- {
121
- float xFactor = getWeight(0);
122
- float pf = xFactor * yFactor / (denom*denom);
123
- if (pf > 0.0) {
124
- readAndApplyTexel(iuv, 0, +y, pf);
125
- if (y!=0){
126
- readAndApplyTexel(iuv, 0, -y, pf);
127
- }
100
+ for(int y = 0; y <= fs; y += 1) {
101
+ float yFactor = getWeight(y);
102
+ {
103
+ float xFactor = getWeight(0);
104
+ float pf = xFactor * yFactor / (denom*denom);
105
+ if (pf > 0.0) {
106
+ readAndApplyTexel(iuv, 0, +y, pf);
107
+ if (y!=0){
108
+ readAndApplyTexel(iuv, 0, -y, pf);
128
109
  }
129
110
  }
111
+ }
130
112
 
131
- for(int x = 1; x <= fs; x += 1) {
132
- float xFactor = getWeight(x);
133
- float pf = xFactor * yFactor / (denom*denom);
134
- if (pf > 0.0) {
135
- readAndApply2TexelsU(iuv, x, +y, pf);
136
- if (y!=0){
137
- readAndApply2TexelsU(iuv, x, -y, pf);
138
- }
113
+ for(int x = 1; x <= fs; x += 1) {
114
+ float xFactor = getWeight(x);
115
+ float pf = xFactor * yFactor / (denom*denom);
116
+ if (pf > 0.0) {
117
+ readAndApply2TexelsU(iuv, x, +y, pf);
118
+ if (y!=0){
119
+ readAndApply2TexelsU(iuv, x, -y, pf);
139
120
  }
140
121
  }
141
122
  }
142
- } else {
143
- applyTexel(center, 1.0);
144
- }
145
-
146
- int frontColorIndex = 999;
147
- int maxColorIndex = 0;
148
- for (int i=0; i<maxHighlightLevel; ++i){
149
- if (colorWeight[i] > 0.0){
150
- frontColorIndex = min(frontColorIndex,i);
151
- maxColorIndex = max(maxColorIndex,i);
152
- }
153
123
  }
124
+ } else {
125
+ applyTexel(center, 1.0);
126
+ }
154
127
 
155
- if (frontColorIndex == 999){
156
- discard;
128
+ int frontColorIndex = 999;
129
+ int maxColorIndex = 0;
130
+ for (int i=0; i<maxHighlightLevel; ++i){
131
+ if (colorWeight[i] > 0.0){
132
+ frontColorIndex = min(frontColorIndex,i);
133
+ maxColorIndex = max(maxColorIndex,i);
157
134
  }
135
+ }
158
136
 
159
- for (int curColorIndex=maxColorIndex; curColorIndex>=frontColorIndex; --curColorIndex){
160
- float curColorWeight = colorWeight[curColorIndex];
161
- if (curColorWeight <= 0.01){
162
- continue;
163
- }
137
+ if (frontColorIndex == 999){
138
+ discard;
139
+ }
164
140
 
165
- int lic = (curColorIndex >> 2) & 3;
166
- int llc = curColorIndex & 3;
167
- int vc = (int(center[lic] * 255.0) >> (llc*2)) & 3;
168
- bool centerFilled = (vc & 1) == 1;
169
- bool centerOccluded = centerFilled && ((vc & 2) == 2);
170
-
171
- float curColorOcclusion = colorOcclusion[curColorIndex];
172
- bool occluded = centerFilled ? centerOccluded : curColorOcclusion > 0.5 * curColorWeight;
173
-
174
- int colorChannel = centerFilled ? 0 : 1;
175
- vec4 colorBase = texelFetch(highlightOptionsTexture,ivec2(curColorIndex,colorChannel),0);
176
- float occlusionFactor = occluded ? occludedIntensityFactor : 1.0;
177
- float outlineFactor = centerFilled ? 1.0 : smoothstep(0.0, 0.03, curColorWeight);
178
- float intensity = colorBase.a * occlusionFactor * outlineFactor;
179
-
180
- // Compose two RGBAs to be blended to the frame buffer
181
- vec3 currentColor = colorBase.rgb;
182
- float a0 = accumulatedColor.a;
183
- float a1 = intensity;
184
- float alpha = clamp(a0 + a1 - a0 * a1,0.0,1.0);
185
- if (alpha > 0.001){
186
- vec3 blendedColor = ((1.0 - a1) * a0 * accumulatedColor.rgb + a1 * currentColor) / alpha;
187
- accumulatedColor = vec4(blendedColor, alpha);
188
- }
141
+ for (int curColorIndex=maxColorIndex; curColorIndex>=frontColorIndex; --curColorIndex){
142
+ float curColorWeight = colorWeight[curColorIndex];
143
+ if (curColorWeight <= 0.01){
144
+ continue;
189
145
  }
190
146
 
191
- if (accumulatedColor.a < ${n.float(e)}){
192
- discard;
147
+ int lic = (curColorIndex >> 2) & 3;
148
+ int llc = curColorIndex & 3;
149
+ int vc = (int(center[lic] * 255.0) >> (llc*2)) & 3;
150
+ bool centerFilled = (vc & 1) == 1;
151
+ bool centerOccluded = centerFilled && ((vc & 2) == 2);
152
+
153
+ float curColorOcclusion = colorOcclusion[curColorIndex];
154
+ bool occluded = centerFilled ? centerOccluded : curColorOcclusion > 0.5 * curColorWeight;
155
+
156
+ int colorChannel = centerFilled ? 0 : 1;
157
+ vec4 colorBase = texelFetch(highlightOptionsTexture,ivec2(curColorIndex,colorChannel),0);
158
+ float occlusionFactor = occluded ? occludedIntensityFactor : 1.0;
159
+ float outlineFactor = centerFilled ? 1.0 : smoothstep(0.0, 0.03, curColorWeight);
160
+ float intensity = colorBase.a * occlusionFactor * outlineFactor;
161
+
162
+ // Compose two RGBAs to be blended to the frame buffer
163
+ vec3 currentColor = colorBase.rgb;
164
+ float a0 = accumulatedColor.a;
165
+ float a1 = intensity;
166
+ float alpha = clamp(a0 + a1 - a0 * a1,0.0,1.0);
167
+ if (alpha > 0.001){
168
+ vec3 blendedColor = ((1.0 - a1) * a0 * accumulatedColor.rgb + a1 * currentColor) / alpha;
169
+ accumulatedColor = vec4(blendedColor, alpha);
193
170
  }
171
+ }
172
+
173
+ if (accumulatedColor.a < ${n.float(e)}){
174
+ discard;
175
+ }
194
176
 
195
- // Blending equation: gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
196
- // I.e., colours should not be premultiplied with alpha
197
- fragColor = accumulatedColor;
198
- }`),u}const f=Object.freeze(Object.defineProperty({__proto__:null,build:u},Symbol.toStringTag,{value:"Module"}));export{f as H,u as b};
177
+ // Blending equation: gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
178
+ // I.e., colours should not be premultiplied with alpha
179
+ fragColor = accumulatedColor;`),u}const f=Object.freeze(Object.defineProperty({__proto__:null,build:u},Symbol.toStringTag,{value:"Module"}));export{f as H,u as b};
@@ -2,40 +2,37 @@
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 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
- void main() {
7
- int cellSize = ${a.int(s)};
8
- vec2 texelSize = 1.0 / vec2(textureSize(textureInput, 0));
9
- vec2 offset = floor(gl_FragCoord.xy) * vec2(float(cellSize));
10
-
11
- bool first = true;
12
- bool allEqual = true;
13
- bool hasAny = false;
14
- vec4 commonValue = vec4(0.0);
15
- for(int x = -sampleArea; x < cellSize + sampleArea; x += 2) {
16
- for(int y = -sampleArea; y < cellSize + sampleArea; y += 2) {
17
- vec2 coord = (offset + vec2(float(x), float(y))) * texelSize;
18
- vec4 value = texture(textureInput, coord);
19
- if (allEqual){
20
- if (first){
21
- first = false;
22
- commonValue = value;
23
- }else{
24
- if (value != commonValue){
25
- allEqual = false;
26
- }
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 t}from"../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js";class o extends l{}function i(){const l=new r,{outputs:o,fragment:i}=l;return l.include(e),i.uniforms.add(new t("textureInput",(e=>e.input))),i.constants.add("sampleArea","int",Math.ceil(n/2)),o.add("fragGrid","vec2"),i.main.add(a`
6
+ int cellSize = ${a.int(s)};
7
+ vec2 texelSize = 1.0 / vec2(textureSize(textureInput, 0));
8
+ vec2 offset = floor(gl_FragCoord.xy) * vec2(float(cellSize));
9
+ bool first = true;
10
+ bool allEqual = true;
11
+ bool hasAny = false;
12
+ vec4 commonValue = vec4(0.0);
13
+ for(int x = -sampleArea; x < cellSize + sampleArea; x += 2) {
14
+ for(int y = -sampleArea; y < cellSize + sampleArea; y += 2) {
15
+ vec2 coord = (offset + vec2(float(x), float(y))) * texelSize;
16
+ vec4 value = texture(textureInput, coord);
17
+ if (allEqual){
18
+ if (first){
19
+ first = false;
20
+ commonValue = value;
21
+ }else{
22
+ if (value != commonValue){
23
+ allEqual = false;
27
24
  }
28
25
  }
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);
36
- return;
26
+ }
27
+ if (!hasAny){
28
+ if (value != vec4(0.0)){
29
+ hasAny = true;
37
30
  }
38
31
  }
32
+ if (hasAny && !allEqual){
33
+ fragGrid = vec2(hasAny ? 1.0 : 0.0, allEqual ? 1.0 : 0.0);
34
+ return;
35
+ }
39
36
  }
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};
37
+ }
38
+ fragGrid = vec2(hasAny ? 1.0 : 0.0, allEqual ? 1.0 : 0.0);`),l}const s=32,n=9,u=.4,c=Object.freeze(Object.defineProperty({__proto__:null,HighlightDownsampleDrawParameters:o,blurSize:u,build:i,gridCellPixelSize:s,outlineSize:n},Symbol.toStringTag,{value:"Module"}));export{o as H,c as a,u as b,i as c,s as g,n as o};
@@ -2,24 +2,14 @@
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 r}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as i}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{ObjectAndLayerIdColor as o}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{multipassTerrainTest as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{ColorConversion as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{FloatPassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as l}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as a}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{VertexAttribute as p}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{outputColorHighlightOID as v}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";function c(c){const u=new a,{vertex:m,fragment:b}=u;return d(m,c),u.include(i,c),u.include(s,c),u.include(r,c),u.include(o,c),u.include(v,c),u.attributes.add(p.POSITION,"vec3"),u.attributes.add(p.UV0,"vec2"),c.perspectiveInterpolation&&u.attributes.add(p.PERSPECTIVEDIVIDE,"float"),u.varyings.add("vpos","vec3"),c.multipassEnabled&&u.varyings.add("depth","float"),m.code.add(l`
6
- void main(void) {
7
- vpos = position;
8
- ${c.multipassEnabled?"depth = (view * vec4(vpos, 1.0)).z;":""}
9
- vTexCoord = uv0;
10
- gl_Position = transformPosition(proj, view, vpos);
11
-
12
- ${c.perspectiveInterpolation?"gl_Position *= perspectiveDivide;":""}
13
- }
14
- `),b.uniforms.add(new g("tex",(e=>e.texture)),new n("opacity",(e=>e.opacity))),u.varyings.add("vTexCoord","vec2"),b.include(t),b.code.add(l`
15
- void main() {
16
- discardBySlice(vpos);
17
- ${c.multipassEnabled?"terrainDepthTest(depth);":""}
18
- ${c.output===e.ObjectAndLayerIdColor?l`
19
- fragColor = vec4(0, 0, 0, 1);
20
- return;
21
- `:""}
22
- vec4 finalColor = texture(tex, vTexCoord) * opacity;
23
- outputColorHighlightOID(finalColor, vpos);
24
- }
25
- `),u}const u=Object.freeze(Object.defineProperty({__proto__:null,build:c},Symbol.toStringTag,{value:"Module"}));export{u as I,c as b};
5
+ import{ShaderOutput as e}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as r}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as i}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{ObjectAndLayerIdColor as o}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{multipassTerrainTest as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{ColorConversion as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as n}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{FloatPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as l}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as a}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{VertexAttribute as p}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{outputColorHighlightOID as u}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";function v(v){const c=new a,{vertex:m,fragment:b}=c;return n(m,v),c.include(i,v),c.include(s,v),c.include(r,v),c.include(o,v),c.include(u,v),c.attributes.add(p.POSITION,"vec3"),c.attributes.add(p.UV0,"vec2"),v.perspectiveInterpolation&&c.attributes.add(p.PERSPECTIVEDIVIDE,"float"),c.varyings.add("vpos","vec3"),v.multipassEnabled&&c.varyings.add("depth","float"),m.main.add(l`
6
+ vpos = position;
7
+ ${v.multipassEnabled?"depth = (view * vec4(vpos, 1.0)).z;":""}
8
+ vTexCoord = uv0;
9
+ gl_Position = transformPosition(proj, view, vpos);
10
+ ${v.perspectiveInterpolation?"gl_Position *= perspectiveDivide;":""}`),b.uniforms.add(new g("tex",(e=>e.texture)),new d("opacity",(e=>e.opacity))),c.varyings.add("vTexCoord","vec2"),b.include(t),b.main.add(l`
11
+ discardBySlice(vpos);
12
+ ${v.multipassEnabled?"terrainDepthTest(depth);":""}
13
+ ${v.output===e.ObjectAndLayerIdColor?"fragColor = vec4(0, 0, 0, 1);\n return;":""}
14
+ vec4 finalColor = texture(tex, vTexCoord) * opacity;
15
+ outputColorHighlightOID(finalColor, vpos);`),c}const c=Object.freeze(Object.defineProperty({__proto__:null,build:v},Symbol.toStringTag,{value:"Module"}));export{c as I,v as b};
@@ -2,8 +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 i}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as o}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as t}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{Laserline as r}from"../views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js";import{Float2PassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{FloatPassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as l}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as d}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{VertexAttribute as c}from"../views/3d/webgl-engine/lib/VertexAttribute.js";function v(i){const t=new d;t.include(r,i);const{vertex:v,fragment:w}=t;return v.uniforms.add(new n("modelView",((i,{camera:o})=>e(p,o.viewMatrix,i.origin))),new n("proj",((e,{camera:i})=>i.projectionMatrix)),new s("glowWidth",((e,{camera:i})=>e.glowWidth*i.pixelRatio)),new a("pixelToNDC",((e,{camera:i})=>o(m,2/i.fullViewport[2],2/i.fullViewport[3])))),t.attributes.add(c.START,"vec3"),t.attributes.add(c.END,"vec3"),t.attributes.add(c.UP,"vec3"),t.attributes.add(c.EXTRUDE,"vec2"),t.varyings.add("uv","vec2"),t.varyings.add("vViewStart","vec3"),t.varyings.add("vViewEnd","vec3"),t.varyings.add("vViewPlane","vec4"),v.code.add(l`void main() {
6
- vec3 pos = mix(start, end, extrude.x);
5
+ import{translate as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as o}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as t}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{Laserline as r}from"../views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js";import{Float2PassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{FloatPassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as l}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as d}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{VertexAttribute as c}from"../views/3d/webgl-engine/lib/VertexAttribute.js";function v(i){const t=new d;t.include(r,i);const{vertex:v,fragment:w}=t;return v.uniforms.add(new n("modelView",((i,{camera:o})=>e(p,o.viewMatrix,i.origin))),new n("proj",((e,{camera:i})=>i.projectionMatrix)),new s("glowWidth",((e,{camera:i})=>e.glowWidth*i.pixelRatio)),new a("pixelToNDC",((e,{camera:i})=>o(m,2/i.fullViewport[2],2/i.fullViewport[3])))),t.attributes.add(c.START,"vec3"),t.attributes.add(c.END,"vec3"),t.attributes.add(c.UP,"vec3"),t.attributes.add(c.EXTRUDE,"vec2"),t.varyings.add("uv","vec2"),t.varyings.add("vViewStart","vec3"),t.varyings.add("vViewEnd","vec3"),t.varyings.add("vViewPlane","vec4"),v.main.add(l`vec3 pos = mix(start, end, extrude.x);
7
6
  vec4 viewPos = modelView * vec4(pos, 1);
8
7
  vec4 projPos = proj * viewPos;
9
8
  vec2 ndcPos = projPos.xy / projPos.w;
@@ -20,8 +19,7 @@ vViewPlane = vec4(viewPlaneNormal, -dot(viewPlaneNormal, vViewStart));
20
19
  float xPaddingPixels = sign(dot(viewPlaneNormal, viewPos.xyz)) * (extrude.x * 2.0 - 1.0) * glowWidth;
21
20
  ndcPos.x += xPaddingPixels * pixelToNDC.x;
22
21
  uv = ndcPos * 0.5 + 0.5;
23
- gl_Position = vec4(ndcPos, 0, 1);
24
- }`),w.uniforms.add(new s("perScreenPixelRatio",((e,i)=>i.camera.perScreenPixelRatio))),w.code.add(l`float planeDistancePixels(vec4 plane, vec3 pos, vec3 start, vec3 end) {
22
+ gl_Position = vec4(ndcPos, 0, 1);`),w.uniforms.add(new s("perScreenPixelRatio",((e,i)=>i.camera.perScreenPixelRatio))),w.code.add(l`float planeDistancePixels(vec4 plane, vec3 pos, vec3 start, vec3 end) {
25
23
  vec3 origin = mix(start, end, 0.5);
26
24
  vec3 basis = end - origin;
27
25
  vec3 posAtOrigin = pos - origin;
@@ -34,9 +32,7 @@ float width = fwidth(y);
34
32
  float maxPixelDistance = length(pos) * perScreenPixelRatio * 2.0;
35
33
  float pixelDist = dist / min(width, maxPixelDistance);
36
34
  return abs(pixelDist);
37
- }
38
- void main() {
39
- vec3 dEndStart = vViewEnd - vViewStart;
35
+ }`),w.main.add(l`vec3 dEndStart = vViewEnd - vViewStart;
40
36
  if (dot(dEndStart, dEndStart) < 1e-5) {
41
37
  discard;
42
38
  }
@@ -50,5 +46,4 @@ discard;
50
46
  float distance = planeDistancePixels(vViewPlane, pos, vViewStart, vViewEnd);
51
47
  vec4 color = laserlineProfile(distance);
52
48
  float alpha = (1.0 - smoothstep(0.995 - angleCutoffAdjust, 0.999 - angleCutoffAdjust, abs(dot(normal, vViewPlane.xyz))));
53
- fragColor = laserlineOutput(color * alpha * depthDiscontinuityAlpha);
54
- }`),t}const m=t(),p=i(),w=Object.freeze(Object.defineProperty({__proto__:null,build:v},Symbol.toStringTag,{value:"Module"}));export{w as L,v as b};
49
+ fragColor = laserlineOutput(color * alpha * depthDiscontinuityAlpha);`),t}const m=t(),p=i(),w=Object.freeze(Object.defineProperty({__proto__:null,build:v},Symbol.toStringTag,{value:"Module"}));export{w as L,v as b};